@loaders.gl/scene 5.0.0-beta.4 → 5.0.0-beta.6
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/DRACO-README.md +1 -1
- package/GLTF-README.md +1 -1
- package/OBJ-README.md +1 -1
- package/README.md +6 -1
- package/THIRD-PARTY-NOTICES.md +6 -0
- package/dist/dist.dev.js +2959 -750
- package/dist/dist.min.js +18 -18
- package/dist/draco/draco-javascript-loader-with-parser.d.ts +2 -2
- package/dist/draco/draco-loader-types.cjs +3 -3
- package/dist/draco/draco-loader-types.cjs.map +2 -2
- package/dist/draco/draco-loader-types.d.ts +1 -1
- package/dist/draco/draco-loader-types.d.ts.map +1 -1
- package/dist/draco/draco-loader-types.js +1 -1
- package/dist/draco/draco-loader-types.js.map +1 -1
- package/dist/draco/draco-loader.d.ts +2 -2
- package/dist/draco/draco-wasm-loader-with-parser.d.ts +2 -2
- package/dist/draco/draco3d-loader-with-parser.d.ts +2 -2
- package/dist/draco/lib/utils/version.cjs +1 -1
- package/dist/draco/lib/utils/version.js +1 -1
- package/dist/draco-worker-node.js +401 -113
- package/dist/draco-worker-node.js.map +4 -4
- package/dist/draco-worker.js +395 -113
- package/dist/draco-worker.js.map +4 -4
- package/dist/draco-writer-worker-node.cjs +655 -85
- package/dist/draco-writer-worker-node.cjs.map +4 -4
- package/dist/draco-writer-worker.js +625 -69
- package/dist/draco-writer-worker.js.map +4 -4
- package/dist/gltf/lib/extensions/KHR_gaussian_splatting.cjs +11 -4
- package/dist/gltf/lib/extensions/KHR_gaussian_splatting.cjs.map +2 -2
- package/dist/gltf/lib/extensions/KHR_gaussian_splatting.d.ts.map +1 -1
- package/dist/gltf/lib/extensions/KHR_gaussian_splatting.js +12 -2
- package/dist/gltf/lib/extensions/KHR_gaussian_splatting.js.map +1 -1
- package/dist/gltf/lib/parsers/parse-gltf.cjs.map +2 -2
- package/dist/gltf/lib/parsers/parse-gltf.d.ts +2 -0
- package/dist/gltf/lib/parsers/parse-gltf.d.ts.map +1 -1
- package/dist/gltf/lib/parsers/parse-gltf.js.map +1 -1
- package/dist/gltf/lib/types/gltf-additional-extension-schemas.cjs +22 -0
- package/dist/gltf/lib/types/gltf-additional-extension-schemas.cjs.map +2 -2
- package/dist/gltf/lib/types/gltf-additional-extension-schemas.d.ts +23 -0
- package/dist/gltf/lib/types/gltf-additional-extension-schemas.d.ts.map +1 -1
- package/dist/gltf/lib/types/gltf-additional-extension-schemas.js +22 -0
- package/dist/gltf/lib/types/gltf-additional-extension-schemas.js.map +1 -1
- package/dist/gltf/lib/types/gltf-extension-schemas.cjs +8 -0
- package/dist/gltf/lib/types/gltf-extension-schemas.cjs.map +2 -2
- package/dist/gltf/lib/types/gltf-extension-schemas.d.ts +27 -0
- package/dist/gltf/lib/types/gltf-extension-schemas.d.ts.map +1 -1
- package/dist/gltf/lib/types/gltf-extension-schemas.js +8 -1
- package/dist/gltf/lib/types/gltf-extension-schemas.js.map +1 -1
- package/dist/gltf/lib/types/gltf-json-schema.cjs.map +1 -1
- package/dist/gltf/lib/types/gltf-json-schema.d.ts +2 -2
- package/dist/gltf/lib/types/gltf-json-schema.d.ts.map +1 -1
- package/dist/gltf/lib/types/gltf-version-zod-schemas.d.ts +34 -0
- package/dist/gltf/lib/types/gltf-version-zod-schemas.d.ts.map +1 -1
- package/dist/gltf/lib/types/gltf-zod-schema.cjs +1 -1
- package/dist/gltf/lib/types/gltf-zod-schema.cjs.map +2 -2
- package/dist/gltf/lib/types/gltf-zod-schema.d.ts +51 -0
- package/dist/gltf/lib/types/gltf-zod-schema.d.ts.map +1 -1
- package/dist/gltf/lib/types/gltf-zod-schema.js +2 -2
- package/dist/gltf/lib/types/gltf-zod-schema.js.map +1 -1
- package/dist/gltf/lib/utils/version.cjs +1 -1
- package/dist/gltf/lib/utils/version.js +1 -1
- package/dist/index.cjs +4 -1
- package/dist/index.cjs.map +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/mtl-loader-types.cjs +1 -1
- package/dist/obj/mtl-loader-types.cjs +1 -1
- package/dist/obj/mtl-loader-types.js +1 -1
- package/dist/obj/obj-loader-types.cjs +3 -3
- package/dist/obj/obj-loader-types.cjs.map +2 -2
- package/dist/obj/obj-loader-types.d.ts +1 -1
- package/dist/obj/obj-loader-types.d.ts.map +1 -1
- package/dist/obj/obj-loader-types.js +2 -2
- package/dist/obj/obj-loader-types.js.map +1 -1
- package/dist/obj/obj-loader.cjs +5 -5
- package/dist/obj/obj-loader.cjs.map +2 -2
- package/dist/obj/obj-loader.d.ts +1 -1
- package/dist/obj/obj-loader.d.ts.map +1 -1
- package/dist/obj/obj-loader.js +1 -1
- package/dist/obj/obj-loader.js.map +1 -1
- package/dist/obj/obj-writer.cjs +1 -1
- package/dist/obj/obj-writer.js +1 -1
- package/dist/obj-loader-types.cjs +3 -3
- package/dist/obj-loader-types.cjs.map +2 -2
- package/dist/obj-loader.cjs +5 -5
- package/dist/obj-loader.cjs.map +2 -2
- package/dist/obj-worker.js +568 -287
- package/dist/obj-writer.cjs +1 -1
- package/dist/stl/parse-stl.cjs +100 -0
- package/dist/stl/parse-stl.cjs.map +7 -0
- package/dist/stl/parse-stl.d.ts +4 -0
- package/dist/stl/parse-stl.d.ts.map +1 -0
- package/dist/stl/parse-stl.js +84 -0
- package/dist/stl/parse-stl.js.map +1 -0
- package/dist/stl-loader-types.cjs +58 -0
- package/dist/stl-loader-types.cjs.map +7 -0
- package/dist/stl-loader-types.d.ts +32 -0
- package/dist/stl-loader-types.d.ts.map +1 -0
- package/dist/stl-loader-types.js +25 -0
- package/dist/stl-loader-types.js.map +1 -0
- package/dist/stl-loader.cjs +38 -0
- package/dist/stl-loader.cjs.map +7 -0
- package/dist/stl-loader.d.ts +17 -0
- package/dist/stl-loader.d.ts.map +1 -0
- package/dist/stl-loader.js +13 -0
- package/dist/stl-loader.js.map +1 -0
- package/dist/usd/index.cjs.map +1 -1
- package/dist/usd/index.d.ts +1 -1
- package/dist/usd/index.d.ts.map +1 -1
- package/dist/usd/lib/parse-usd.cjs +42 -5
- package/dist/usd/lib/parse-usd.cjs.map +2 -2
- package/dist/usd/lib/parse-usd.d.ts.map +1 -1
- package/dist/usd/lib/parse-usd.js +53 -6
- package/dist/usd/lib/parse-usd.js.map +1 -1
- package/dist/usd/lib/parse-usdc.cjs +187 -0
- package/dist/usd/lib/parse-usdc.cjs.map +7 -0
- package/dist/usd/lib/parse-usdc.d.ts +4 -0
- package/dist/usd/lib/parse-usdc.d.ts.map +1 -0
- package/dist/usd/lib/parse-usdc.js +176 -0
- package/dist/usd/lib/parse-usdc.js.map +1 -0
- package/dist/usd/lib/parse-usdz.cjs +22 -0
- package/dist/usd/lib/parse-usdz.cjs.map +2 -2
- package/dist/usd/lib/parse-usdz.d.ts.map +1 -1
- package/dist/usd/lib/parse-usdz.js +26 -0
- package/dist/usd/lib/parse-usdz.js.map +1 -1
- package/dist/usd/lib/usd-types.cjs.map +1 -1
- package/dist/usd/lib/usd-types.d.ts +14 -1
- package/dist/usd/lib/usd-types.d.ts.map +1 -1
- package/dist/usd/lib/usd-types.js +1 -1
- package/dist/usd/lib/usd-types.js.map +1 -1
- package/dist/usd/libs/README.md +27 -0
- package/dist/usd/libs/THREE-LICENSE +21 -0
- package/dist/usd/libs/usdc-parser.d.ts +78 -0
- package/dist/usd/libs/usdc-parser.d.ts.map +1 -0
- package/dist/usd/libs/usdc-parser.js +1669 -0
- package/dist/usd/libs/usdc-parser.js.map +1 -0
- package/dist/usd/usd-loader-types.cjs +4 -4
- package/dist/usd/usd-loader-types.cjs.map +2 -2
- package/dist/usd/usd-loader-types.d.ts +7 -7
- package/dist/usd/usd-loader-types.d.ts.map +1 -1
- package/dist/usd/usd-loader-types.js +6 -6
- package/dist/usd/usd-loader-types.js.map +1 -1
- package/dist/usd/usd-loader.cjs.map +1 -1
- package/dist/usd/usd-loader.d.ts +4 -4
- package/dist/usd/usd-loader.d.ts.map +1 -1
- package/dist/usd/usd-loader.js +2 -2
- package/dist/usd/usd-loader.js.map +1 -1
- package/dist/usd-loader-types.cjs +4 -4
- package/dist/usd-loader-types.cjs.map +2 -2
- package/dist/usd-loader.cjs.map +1 -1
- package/package.json +14 -8
- package/src/draco/draco-loader-types.ts +1 -1
- package/src/gltf/lib/extensions/KHR_gaussian_splatting.ts +14 -4
- package/src/gltf/lib/parsers/parse-gltf.ts +2 -0
- package/src/gltf/lib/types/gltf-additional-extension-schemas.ts +32 -0
- package/src/gltf/lib/types/gltf-extension-schemas.ts +12 -0
- package/src/gltf/lib/types/gltf-json-schema.ts +2 -1
- package/src/gltf/lib/types/gltf-zod-schema.ts +2 -1
- package/src/index.ts +3 -1
- package/src/obj/obj-loader-types.ts +1 -1
- package/src/obj/obj-loader.ts +1 -1
- package/src/stl/parse-stl.ts +90 -0
- package/src/stl-loader-types.ts +28 -0
- package/src/stl-loader.ts +12 -0
- package/src/usd/index.ts +1 -0
- package/src/usd/lib/parse-usd.ts +68 -7
- package/src/usd/lib/parse-usdc.ts +188 -0
- package/src/usd/lib/parse-usdz.ts +28 -0
- package/src/usd/lib/usd-types.ts +16 -2
- package/src/usd/libs/README.md +27 -0
- package/src/usd/libs/THREE-LICENSE +21 -0
- package/src/usd/libs/usdc-parser.d.ts +18 -0
- package/src/usd/libs/usdc-parser.js +1669 -0
- package/src/usd/usd-loader-types.ts +5 -5
- package/src/usd/usd-loader.ts +2 -2
package/dist/dist.min.js
CHANGED
|
@@ -4,54 +4,54 @@
|
|
|
4
4
|
else if (typeof define === 'function' && define.amd) define([], factory);
|
|
5
5
|
else if (typeof exports === 'object') exports['loaders'] = factory();
|
|
6
6
|
else root['loaders'] = factory();})(globalThis, function () {
|
|
7
|
-
"use strict";var __exports__=(()=>{var xL=Object.create;var gu=Object.defineProperty;var TL=Object.getOwnPropertyDescriptor;var _L=Object.getOwnPropertyNames;var AL=Object.getPrototypeOf,vL=Object.prototype.hasOwnProperty;var p=(r,e,t)=>()=>{if(t)throw t[0];try{return r&&(e=r(r=0)),e}catch(n){throw t=[n],n}};var IL=(r,e)=>()=>{try{return e||r((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}},J=(r,e)=>{for(var t in e)gu(r,t,{get:e[t],enumerable:!0})},dw=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of _L(e))!vL.call(r,s)&&s!==t&&gu(r,s,{get:()=>e[s],enumerable:!(n=TL(e,s))||n.enumerable});return r};var SL=(r,e,t)=>(t=r!=null?xL(AL(r)):{},dw(e||!r||!r.__esModule?gu(t,"default",{value:r,enumerable:!0}):t,r)),EL=r=>dw(gu({},"__esModule",{value:!0}),r);var pw=IL((b3,hw)=>{hw.exports=globalThis.loaders});function mw(r,e){if(!r.trimStart().startsWith("#usda"))throw new Error("OpenUSD ASCII layers must begin with the #usda header.");return new Id(r,e).parse()}var LL,BL,Id,Sd,bw=p(()=>{"use strict";LL=/^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/,BL=new Set(["uniform","varying","custom","prepend","append","add","delete","reorder"]);Id=class{tokenizer;url;constructor(e,t){this.tokenizer=new Sd(e),this.url=t}parse(){let e=this.tokenizer.match("(")?this.parseMetadata(")"):{},t=[];for(;!this.tokenizer.isAtEnd();)this.isPrimDeclaration()?t.push(this.parsePrim("")):this.tokenizer.read();return{format:"usda",url:this.url,metadata:e,rootPrims:t,layers:this.url?[this.url]:[]}}parsePrim(e){let n=this.tokenizer.read().value,s=this.tokenizer.read(),i=this.tokenizer.peek().kind==="string",o=i?s.value:"",a=i?this.tokenizer.read().value:s.value,c=`${e}/${a}`,u=this.tokenizer.match("(")?this.parseMetadata(")"):{};this.tokenizer.expect("{");let f=this.parsePrimContents(c);return{name:a,path:c,sourceUrl:this.url,type:o,specifier:n,attributes:f.attributes,metadata:{...u,...f.metadata},variants:f.variants,children:f.children}}parsePrimContents(e){let t={},n={},s=[],i={};for(;!this.tokenizer.isAtEnd()&&!this.tokenizer.match("}");)if(this.isPrimDeclaration())s.push(this.parsePrim(e));else if(this.tokenizer.peek().value==="variantSet")this.parseVariantSet(e,i);else{let o=this.parseAttribute();o&&(t[o.name]=o)}return{attributes:t,metadata:n,children:s,variants:i}}parseVariantSet(e,t){this.tokenizer.expect("variantSet");let n=this.tokenizer.read().value;this.tokenizer.expect("="),this.tokenizer.expect("{");let s={};for(;!this.tokenizer.isAtEnd()&&!this.tokenizer.match("}");){let i=this.tokenizer.read().value;this.tokenizer.expect("{");let o=this.parsePrimContents(e);s[i]={attributes:o.attributes,metadata:o.metadata,children:o.children}}t[n]=s}parseAttribute(){let e=this.tokenizer.read();if(e.kind==="end")return null;let t=[e];for(;!this.tokenizer.isAtEnd()&&this.tokenizer.peek().line===e.line;){let u=this.tokenizer.peek();if(u.value==="="){this.tokenizer.read();break}if(u.value==="{"||u.value==="}")return null;t.push(this.tokenizer.read())}if(!(this.tokenizer.previousValue==="="))return null;let s=t.filter(u=>!BL.has(u.value));if(s.length===0)return null;let i=s[s.length-1].value,o=s.slice(0,-1).map(u=>u.value).join(""),a=this.parseValue(),c=this.tokenizer.match("(")?this.parseMetadata(")"):{};return{name:i,type:o,value:a,metadata:c}}parseMetadata(e){let t={};for(;!this.tokenizer.isAtEnd()&&!this.tokenizer.match(e);){if(this.tokenizer.match(","),this.tokenizer.peek().value===e){this.tokenizer.read();break}let n=this.tokenizer.read(),s=[n];for(;!this.tokenizer.isAtEnd()&&this.tokenizer.peek().line===n.line;){if(this.tokenizer.peek().value==="="||this.tokenizer.peek().value===":"){this.tokenizer.read();break}if(this.tokenizer.peek().value===e)break;s.push(this.tokenizer.read())}if(this.tokenizer.previousValue!=="="&&this.tokenizer.previousValue!==":")continue;let i=s[s.length-1].value;t[i]=this.parseValue(),this.tokenizer.match(",")}return t}parseValue(){let e=this.tokenizer.read();if(e.value==="[")return this.parseList("]");if(e.value==="(")return this.parseList(")");if(e.value==="{")return this.parseMetadata("}");if(e.kind==="asset"){let t={assetPath:e.value};return this.tokenizer.peek().kind==="path"&&this.tokenizer.peek().line===e.line&&(t.primPath=this.tokenizer.read().value),t}return e.kind==="path"?{path:e.value}:e.kind==="number"?Number(e.value):e.value==="true"?!0:e.value==="false"?!1:e.value==="None"||e.value==="null"?null:e.value}parseList(e){let t=[];for(;!this.tokenizer.isAtEnd()&&!this.tokenizer.match(e);)this.tokenizer.match(",")||(t.push(this.parseValue()),this.tokenizer.match(","));return t}isPrimDeclaration(){let e=this.tokenizer.peek().value;return e==="def"||e==="over"||e==="class"}},Sd=class{source;offset=0;line=1;bufferedToken=null;previousValue="";constructor(e){this.source=e}peek(){return this.bufferedToken||=this.readToken(),this.bufferedToken}read(){let e=this.peek();return this.bufferedToken=null,this.previousValue=e.value,e}match(e){return this.peek().value!==e?!1:(this.read(),!0)}expect(e){let t=this.read();if(t.value!==e)throw new Error(`Expected "${e}" at USDA line ${t.line}, received "${t.value}".`)}isAtEnd(){return this.peek().kind==="end"}readToken(){this.skipIgnoredText();let e=this.line,t=this.source[this.offset];if(t===void 0)return{value:"",line:e,kind:"end"};if("{}[](),=".includes(t))return this.offset++,{value:t,line:e,kind:"punctuation"};if(t==='"'||t==="'")return{value:this.readQuotedString(t),line:e,kind:"string"};if(t==="@")return{value:this.readDelimitedValue("@"),line:e,kind:"asset"};if(t==="<")return{value:this.readDelimitedValue(">"),line:e,kind:"path"};let n=this.source.slice(this.offset).match(LL);if(n)return this.offset+=n[0].length,{value:n[0],line:e,kind:"number"};let s=this.offset;for(;this.offset<this.source.length;){let i=this.source[this.offset];if(/\s/.test(i)||"{}[](),=@<>".includes(i))break;this.offset++}return this.offset===s&&this.offset++,{value:this.source.slice(s,this.offset),line:e,kind:"word"}}skipIgnoredText(){for(;this.offset<this.source.length;){let e=this.source[this.offset];if(e===`
|
|
7
|
+
"use strict";var __exports__=(()=>{var hB=Object.create;var Au=Object.defineProperty;var pB=Object.getOwnPropertyDescriptor;var mB=Object.getOwnPropertyNames;var bB=Object.getPrototypeOf,gB=Object.prototype.hasOwnProperty;var p=(r,e,t)=>()=>{if(t)throw t[0];try{return r&&(e=r(r=0)),e}catch(n){throw t=[n],n}};var yB=(r,e)=>()=>{try{return e||r((e={exports:{}}).exports,e),e.exports}catch(t){throw e=0,t}},J=(r,e)=>{for(var t in e)Au(r,t,{get:e[t],enumerable:!0})},Pw=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of mB(e))!gB.call(r,s)&&s!==t&&Au(r,s,{get:()=>e[s],enumerable:!(n=pB(e,s))||n.enumerable});return r};var wB=(r,e,t)=>(t=r!=null?hB(bB(r)):{},Pw(e||!r||!r.__esModule?Au(t,"default",{value:r,enumerable:!0}):t,r)),xB=r=>Pw(Au({},"__esModule",{value:!0}),r);var jw=yB((TU,Vw)=>{Vw.exports=globalThis.loaders});function Ie(r,e=8){let t=r*e;if(!Number.isSafeInteger(r)||r<0||!Number.isSafeInteger(t)||t>256*1024*1024-Vd)throw new Error("USDC: decoded allocation limit exceeded");return Vd+=t,r}function Tt(r){if(!Number.isSafeInteger(r)||r<0||r>4e6)throw new Error("USDC: decoded allocation limit exceeded");return Ie(r)}function Gw(r,e,t,n,s,i){for(;e<t;){let o=r[e++];if(e>t)throw new Error("USDC: truncated LZ4 token");let a=o>>4;if(a===15){let f;do{if(e>=t)throw new Error("USDC: truncated LZ4 length");f=r[e++],a+=f}while(f===255)}if(a>0){if(e+a>t)throw new Error("USDC: truncated LZ4 literal");for(let f=0;f<a;f++){if(s>=i)throw new Error("USDC: LZ4 output overflow");n[s++]=r[e++]}}if(e>=t)break;if(e+2>t)throw new Error("USDC: truncated LZ4 offset");let c=r[e++]|r[e++]<<8;if(c===0)throw new Error("USDC: invalid LZ4 match offset");let u=(o&15)+4;if(u===19){let f;do{if(e>=t)throw new Error("USDC: truncated LZ4 length");f=r[e++],u+=f}while(f===255)}let l=s-c;if(l<0)throw new Error("USDC: invalid LZ4 match position");for(let f=0;f<u;f++){if(s>=i)throw new Error("USDC: LZ4 output overflow");n[s++]=n[l+f]}}return s}function Gd(r,e,t=!1){let n=new Uint8Array(Ie(e,1));if(!r.length)throw new Error("USDC: missing LZ4 chunk header");let s=r[0];if(s===0){let i=Gw(r,1,r.length,n,0,e);if(!t&&i!==e)throw new Error("USDC: incomplete LZ4 output");return n.subarray(0,i)}else{if(1+s*4>r.length)throw new Error("USDC: truncated LZ4 chunk sizes");let o=1,a=[];for(let l=0;l<s;l++){let f=(r[o]|r[o+1]<<8|r[o+2]<<16|r[o+3]<<24)>>>0;a.push(f),o+=4}let c=o,u=0;for(let l=0;l<s;l++){let f=a[l],d=Math.min(65536,e-u);if(f>r.length-c)throw new Error("USDC: truncated LZ4 chunk");let h=Gw(r,c,c+f,n,u,u+d);if(c+=f,l<s-1&&h!==u+d)throw new Error("USDC: incomplete LZ4 chunk");u=h}if(c!==r.length||!t&&u!==e)throw new Error("USDC: incomplete LZ4 output");return n.subarray(0,u)}}function Lr(r,e){let t=e*4+(e*2+7>>3)+4,n=Gd(new Uint8Array(r),t,!0);return SB(n,e)}function SB(r,e){let t=new DataView(r.buffer,r.byteOffset,r.byteLength),n=0,s=t.getInt32(n,!0);n+=4;let i=e*2+7>>3;if(r.length<n+i)throw new Error("USDC: truncated integer codes");let o=n,a=n+i,c=new Int32Array(Ie(e)),u=0,l=o,f=a;for(let d=0;d<e;){let h=r[l++];for(let m=0;m<4&&d<e;m++,d++){let b=h>>m*2&3,g=0;switch(b){case 0:g=s;break;case 1:g=t.getInt8(f),f+=1;break;case 2:g=t.getInt16(f,!0),f+=2;break;case 3:g=t.getInt32(f,!0),f+=4;break}u+=g,c[d]=u}}return c}var Vd,jd,zw,TB,S,_B,AB,vB,IB,zd,ci,vu,Ww=p(()=>{"use strict";Vd=0;jd=new TextDecoder,zw=new Float32Array(32);for(let r=0;r<32;r++)zw[r]=Math.pow(2,r-15);TB=Math.pow(2,-14),S={Invalid:0,Bool:1,UChar:2,Int:3,UInt:4,Int64:5,UInt64:6,Half:7,Float:8,Double:9,String:10,Token:11,AssetPath:12,Matrix2d:13,Matrix3d:14,Matrix4d:15,Quatd:16,Quatf:17,Quath:18,Vec2d:19,Vec2f:20,Vec2h:21,Vec2i:22,Vec3d:23,Vec3f:24,Vec3h:25,Vec3i:26,Vec4d:27,Vec4f:28,Vec4h:29,Vec4i:30,Dictionary:31,TokenListOp:32,StringListOp:33,PathListOp:34,ReferenceListOp:35,IntListOp:36,Int64ListOp:37,UIntListOp:38,UInt64ListOp:39,PathVector:40,TokenVector:41,Specifier:42,Permission:43,Variability:44,VariantSelectionMap:45,TimeSamples:46,Payload:47,DoubleVector:48,LayerOffsetVector:49,StringVector:50,ValueBlock:51,Value:52,UnregisteredValue:53,UnregisteredValueListOp:54,PayloadListOp:55,TimeCode:56,PathExpression:57,Relocates:58,Spline:59,AnimationBlock:60},_B=new Set([S.Int,S.UInt,S.Float,S.Double,S.Half,S.String,S.Token]),AB=4294967295,vB=105,IB=116;zd=class{constructor(e){this.buffer=e,this.view=new DataView(e),this.offset=0}seek(e){if(!Number.isSafeInteger(e)||e<0||e>this.buffer.byteLength)throw new Error("USDC: invalid seek");this.offset=e}tell(){return this.offset}readUint8(){let e=this.view.getUint8(this.offset);return this.offset+=1,e}readInt8(){let e=this.view.getInt8(this.offset);return this.offset+=1,e}readUint16(){let e=this.view.getUint16(this.offset,!0);return this.offset+=2,e}readInt16(){let e=this.view.getInt16(this.offset,!0);return this.offset+=2,e}readUint32(){let e=this.view.getUint32(this.offset,!0);return this.offset+=4,e}readInt32(){let e=this.view.getInt32(this.offset,!0);return this.offset+=4,e}readUint64(){let e=this.view.getUint32(this.offset,!0),t=this.view.getUint32(this.offset+4,!0);this.offset+=8;let n=t*4294967296+e;if(!Number.isSafeInteger(n))throw new Error("USDC: integer exceeds safe precision");return n}readInt64(){let e=this.view.getUint32(this.offset,!0),t=this.view.getInt32(this.offset+4,!0);this.offset+=8;let n=t*4294967296+e;if(!Number.isSafeInteger(n))throw new Error("USDC: integer exceeds safe precision");return n}readFloat32(){let e=this.view.getFloat32(this.offset,!0);return this.offset+=4,e}readFloat64(){let e=this.view.getFloat64(this.offset,!0);return this.offset+=8,e}readBytes(e){let t=new Uint8Array(this.buffer,this.offset,e);return this.offset+=e,t}readString(e){let t=this.readBytes(e),n=0;for(;n<e&&t[n]!==0;)n++;return jd.decode(t.subarray(0,n))}},ci=class{constructor(e,t){this.lo=e,this.hi=t}get isArray(){return(this.hi&2147483648)!==0}get isInlined(){return(this.hi&1073741824)!==0}get isCompressed(){return(this.hi&536870912)!==0}get typeEnum(){return this.hi>>16&255}get payload(){return this.lo+(this.hi&65535)*4294967296}getInlinedValue(){return this.lo}},vu=class{parseData(e){Vd=0,this._valueReadCount=0,this._activeDictionaries=new Set,this.buffer=e instanceof ArrayBuffer?e:e.buffer,this.reader=new zd(this.buffer),this.version={major:0,minor:0,patch:0},this._conversionBuffer=new ArrayBuffer(4),this._conversionView=new DataView(this._conversionBuffer),this._readBootstrap(),this._readTOC(),this._readTokens(),this._readStrings(),this._readFields(),this._readFieldSets(),this._readPaths(),this._readSpecs(),this.specsByPath=Object.create(null);for(let t of this.specs){let n=this.paths[t.pathIndex];if(!n)continue;let s=this._getFieldsForSpec(t);this.specsByPath[n]={specType:t.specType,fields:s}}return{specsByPath:this.specsByPath}}_readBootstrap(){let e=this.reader;if(e.seek(0),e.readString(8)!=="PXR-USDC")throw new Error("THREE.USDCParser: Not a valid USDC file.");this.version.major=e.readUint8(),this.version.minor=e.readUint8(),this.version.patch=e.readUint8(),e.readBytes(5),this.tocOffset=e.readUint64()}_readTOC(){let e=this.reader;e.seek(this.tocOffset);let t=e.readUint64();if(t>16)throw new Error("USDC: invalid section count");this.sections=Object.create(null);for(let n=0;n<t;n++){let s=e.readString(16),i=e.readUint64(),o=e.readUint64();this.sections[s]={start:i,size:o}}}_readTokens(){let e=this.sections.TOKENS;if(!e)return;let t=this.reader;t.seek(e.start);let n=Tt(t.readUint64());if(this.tokens=[],this.version.major===0&&this.version.minor<4){let s=t.readUint64(),i=t.readBytes(s),o=0;for(let a=0;a<n;a++){let c=o;for(;c<i.length&&i[c]!==0;)c++;if(c>=i.length)throw new Error("USDC: unterminated token data");this.tokens.push(jd.decode(i.subarray(o,c))),o=c+1}}else{let s=t.readUint64(),i=t.readUint64(),o=t.readBytes(i),a=Gd(o,s);Ie(a.length,2);let c=0;for(let u=0;u<n;u++){let l=c;for(;l<a.length&&a[l]!==0;)l++;if(l>=a.length)throw new Error("USDC: unterminated token data");this.tokens.push(jd.decode(a.subarray(c,l))),c=l+1}}}_readStrings(){let e=this.sections.STRINGS;if(!e){this.strings=[];return}let t=this.reader;t.seek(e.start);let n=Tt(t.readUint64());this.strings=[];for(let s=0;s<n;s++)this.strings.push(t.readUint32())}_readFields(){let e=this.sections.FIELDS;if(!e)return;let t=this.reader;if(t.seek(e.start),this.fields=[],this.version.major===0&&this.version.minor<4){let n=Math.floor(e.size/12);for(let s=0;s<n;s++){let i=t.readUint32(),o=t.readUint32(),a=t.readUint32();this.fields.push({tokenIndex:i,valueRep:new ci(o,a)})}}else{let n=Tt(t.readUint64()),s=t.readUint64(),i=t.readBytes(s),o=Lr(i.buffer.slice(i.byteOffset,i.byteOffset+s),n),a=t.readUint64(),c=t.readBytes(a),u=Gd(c,n*8),l=new DataView(u.buffer,u.byteOffset,u.byteLength);for(let f=0;f<n;f++){let d=l.getUint32(f*8,!0),h=l.getUint32(f*8+4,!0);this.fields.push({tokenIndex:o[f],valueRep:new ci(d,h)})}}}_readFieldSets(){let e=this.sections.FIELDSETS;if(!e)return;let t=this.reader;if(t.seek(e.start),this.fieldSets=[],this.version.major===0&&this.version.minor<4){let n=Math.floor(e.size/4);for(let s=0;s<n;s++)this.fieldSets.push(t.readUint32())}else{let n=Tt(t.readUint64()),s=t.readUint64(),i=t.readBytes(s),o=Lr(i.buffer.slice(i.byteOffset,i.byteOffset+s),n);for(let a=0;a<n;a++)this.fieldSets.push(o[a])}}_readPaths(){let e=this.sections.PATHS;if(!e)return;let t=this.reader;t.seek(e.start);let n=Tt(t.readUint64());if(this.paths=new Array(Ie(n)).fill(""),this.version.major===0&&this.version.minor<4)this._readPathsRecursive("");else{t.readUint64();let s=t.readUint64(),i=t.readBytes(s),o=Lr(i.buffer.slice(i.byteOffset,i.byteOffset+s),n),a=t.readUint64(),c=t.readBytes(a),u=Lr(c.buffer.slice(c.byteOffset,c.byteOffset+a),n),l=t.readUint64(),f=t.readBytes(l),d=Lr(f.buffer.slice(f.byteOffset,f.byteOffset+l),n);this._buildPathsFromCompressed(o,u,d)}}_readPathsRecursive(e,t=0){let n=this.reader;if(t>1e3)return;let s=n.readUint32(),i=n.readUint32(),o=n.readUint8(),a=(o&1)!==0,c=(o&2)!==0,u=(o&4)!==0,l;if(e==="")l="/";else{let f=this.tokens[i]||"";u?l=e+"."+f:l=e==="/"?"/"+f:e+"/"+f}if(Ie(l.length,2),this.paths[s]=l,a&&c){let f=n.readUint64();this._readPathsRecursive(l,t+1),n.seek(f),this._readPathsRecursive(e,t+1)}else a?this._readPathsRecursive(l,t+1):c&&this._readPathsRecursive(e,t+1)}_buildPathsFromCompressed(e,t,n){let s=0,i=[{startIndex:0,parentPath:""}];for(;i.length;){let o=i.pop(),a=o.startIndex,c=o.parentPath;for(;a<e.length;){if(++s>e.length*2)throw new Error("USDC: path traversal limit exceeded");let u=a++,l=e[u],f=t[u],d=n[u];if(l<0||l>=this.paths.length||Math.abs(f)>=this.tokens.length||d<-2)throw new Error("USDC: invalid compressed path index");let h;if(c==="")h="/",c=h;else{let g=this.tokens[Math.abs(f)];h=f<0?c+"."+g:c==="/"?"/"+g:c+"/"+g}Ie(h.length,2),this.paths[l]=h;let m=d>0||d===-1,b=d>=0;if((m||b)&&a>=e.length)throw new Error("USDC: missing compressed path entry");if(m&&b){let g=u+d;if(g<=a||g>=e.length)throw new Error("USDC: invalid compressed path jump");i.push({startIndex:g,parentPath:c})}if(m)c=h;else if(!b)break}}}_readSpecs(){let e=this.sections.SPECS;if(!e)return;let t=this.reader;if(t.seek(e.start),this.specs=[],this.version.major===0&&this.version.minor<4){let n=this.version.minor===0&&this.version.patch===1?16:12,s=Math.floor(e.size/n);for(let i=0;i<s;i++){let o=t.readUint32(),a=t.readUint32(),c=t.readUint32();n===16&&t.readUint32(),this.specs.push({pathIndex:o,fieldSetIndex:a,specType:c})}}else{let n=Tt(t.readUint64()),s=t.readUint64(),i=t.readBytes(s),o=Lr(i.buffer.slice(i.byteOffset,i.byteOffset+s),n),a=t.readUint64(),c=t.readBytes(a),u=Lr(c.buffer.slice(c.byteOffset,c.byteOffset+a),n),l=t.readUint64(),f=t.readBytes(l),d=Lr(f.buffer.slice(f.byteOffset,f.byteOffset+l),n);for(let h=0;h<n;h++)this.specs.push({pathIndex:o[h],fieldSetIndex:u[h],specType:d[h]})}}_readValue(e){if(this._valueReadCount=(this._valueReadCount||0)+1,this._valueReadCount>1e6)throw new Error("USDC: value traversal limit exceeded");let t=e.typeEnum,n=e.isArray,s=e.isInlined;if(t===S.TimeSamples)return this._readTimeSamples(e);if(s)return this._readInlinedValue(e);let i=e.payload;if(i===0&&n)return[];if(i<0||i>=this.buffer.byteLength)throw new RangeError("USDCParser: Invalid payload offset "+i+" for type "+t+".");let o=this.reader.tell();this.reader.seek(i);let a;return n?a=this._readArrayValue(e):a=this._readScalarValue(t),this.reader.seek(o),a}_readInlinedValue(e){let t=e.typeEnum,n=e.getInlinedValue(),s=this._conversionView;switch(t){case S.Dictionary:if(n!==0)throw new Error("USDC: invalid inline dictionary");return Object.create(null);case S.Bool:return n!==0;case S.UChar:return n&255;case S.Int:case S.Int64:return n|0;case S.UInt:case S.UInt64:return n>>>0;case S.Half:return this._halfToFloat(n&65535);case S.Float:return s.setUint32(0,n,!0),s.getFloat32(0,!0);case S.Double:return s.setUint32(0,n,!0),s.getFloat32(0,!0);case S.Token:return this.tokens[n]||"";case S.String:return this.tokens[this.strings[n]]||"";case S.AssetPath:return this.tokens[n]||"";case S.Specifier:return n;case S.Permission:case S.Variability:return n;case S.Vec2h:return s.setUint32(0,n,!0),[this._halfToFloat(s.getUint16(0,!0)),this._halfToFloat(s.getUint16(2,!0))];case S.Vec2f:case S.Vec2i:return s.setUint32(0,n,!0),[s.getInt8(0),s.getInt8(1)];case S.Vec3f:case S.Vec3i:return s.setUint32(0,n,!0),[s.getInt8(0),s.getInt8(1),s.getInt8(2)];case S.Vec4f:case S.Vec4i:return s.setUint32(0,n,!0),[s.getInt8(0),s.getInt8(1),s.getInt8(2),s.getInt8(3)];case S.Matrix2d:{s.setUint32(0,n,!0);let i=s.getInt8(0),o=s.getInt8(1);return[i,0,0,o]}case S.Matrix3d:{s.setUint32(0,n,!0);let i=s.getInt8(0),o=s.getInt8(1),a=s.getInt8(2);return[i,0,0,0,o,0,0,0,a]}case S.Matrix4d:{s.setUint32(0,n,!0);let i=s.getInt8(0),o=s.getInt8(1),a=s.getInt8(2),c=s.getInt8(3);return[i,0,0,0,0,o,0,0,0,0,a,0,0,0,0,c]}default:throw new Error("USDC: unsupported inline value type "+t)}}_readTimeSamples(e){let t=this.reader,n=e.payload,s=t.tell();t.seek(n);let i=t.tell(),o=t.readInt64();t.seek(i+o);let a=t.readUint32(),c=t.readUint32(),u=new ci(a,c),l=this._readValue(u),f=i+o+8;t.seek(f);let d=t.tell(),h=t.readInt64();t.seek(d+h);let m=Tt(t.readUint64()),b=[];for(let x=0;x<m;x++){let T=t.readUint32(),_=t.readUint32();b.push(new ci(T,_))}let g=[];for(let x=0;x<m;x++)g.push(this._readValue(b[x]));return t.seek(s),{times:l instanceof Float64Array?Array.from(l):Array.isArray(l)?l:[l],values:g}}_readScalarValue(e){let t=this.reader;switch(e){case S.Invalid:return null;case S.Bool:return t.readUint8()!==0;case S.UChar:return t.readUint8();case S.Int:return t.readInt32();case S.UInt:return t.readUint32();case S.Int64:return t.readInt64();case S.UInt64:return t.readUint64();case S.Half:return this._readHalf();case S.Float:return t.readFloat32();case S.Double:return t.readFloat64();case S.String:case S.Token:{let n=t.readUint32();return this.tokens[n]||""}case S.AssetPath:{let n=t.readUint32();return this.tokens[n]||""}case S.Vec2f:return[t.readFloat32(),t.readFloat32()];case S.Vec2d:return[t.readFloat64(),t.readFloat64()];case S.Vec2i:return[t.readInt32(),t.readInt32()];case S.Vec3f:return[t.readFloat32(),t.readFloat32(),t.readFloat32()];case S.Vec3d:return[t.readFloat64(),t.readFloat64(),t.readFloat64()];case S.Vec3i:return[t.readInt32(),t.readInt32(),t.readInt32()];case S.Vec4f:return[t.readFloat32(),t.readFloat32(),t.readFloat32(),t.readFloat32()];case S.Vec4d:return[t.readFloat64(),t.readFloat64(),t.readFloat64(),t.readFloat64()];case S.Quatf:return[t.readFloat32(),t.readFloat32(),t.readFloat32(),t.readFloat32()];case S.Quatd:return[t.readFloat64(),t.readFloat64(),t.readFloat64(),t.readFloat64()];case S.Matrix4d:{let n=[];for(let s=0;s<16;s++)n.push(t.readFloat64());return n}case S.TokenVector:{let n=Tt(t.readUint64()),s=[];for(let i=0;i<n;i++){let o=t.readUint32();s.push(this.tokens[o]||"")}return s}case S.PathVector:{let n=Tt(t.readUint64()),s=[];for(let i=0;i<n;i++){let o=t.readUint32();s.push(this.paths[o]||"")}return s}case S.DoubleVector:{let n=Tt(t.readUint64()),s=new Float64Array(Ie(n));for(let i=0;i<n;i++)s[i]=t.readFloat64();return s}case S.Dictionary:return this._readDictionary();case S.TokenListOp:case S.StringListOp:case S.IntListOp:case S.Int64ListOp:case S.UIntListOp:case S.UInt64ListOp:throw new Error("USDC: value list operations are unsupported");case S.PathListOp:{let n=t.readUint8();if(n&24||(n&102).toString(2).replaceAll("0","").length>1)throw new Error("USDC: compound path list operations are unsupported");let s=(n&2)!==0,i=(n&4)!==0,o=(n&8)!==0,a=(n&16)!==0,c=(n&32)!==0,u=(n&64)!==0,l=()=>{let b=Tt(t.readUint64()),g=[];for(let y=0;y<b;y++){let x=t.readUint32();g.push(this.paths[x])}return g},f=null,d=null,h=null,m=null;return s&&(f=l()),i&&(d=l()),c&&(h=l()),u&&(m=l()),o&&l(),a&&l(),h&&h.length>0?h:f&&f.length>0?f:m&&m.length>0?m:d&&d.length>0?d:null}case S.VariantSelectionMap:{let n=Tt(t.readUint64()),s=Object.create(null);for(let i=0;i<n;i++){let o=t.readUint32(),a=t.readUint32(),c=this.tokens[this.strings[o]],u=this.tokens[this.strings[a]];c&&u&&(s[c]=u)}return s}default:throw new Error("USDC: unsupported encoding: "+["USDCParser: Unsupported scalar type",e].join(" "))}}_readDictionary(){let e=this.reader,t=e.tell();if(this._activeDictionaries||=new Set,this._activeDictionaries.has(t))throw new Error("USDC: cyclic dictionary value");if(this._activeDictionaries.size>=64)throw new Error("USDC: dictionary depth limit exceeded");this._activeDictionaries.add(t);try{let n=Tt(e.readUint64());if(n>Math.floor((this.buffer.byteLength-e.tell())/20))throw new Error("USDC: truncated dictionary entries");let s=Object.create(null);for(let i=0;i<n;i++){let o=e.readUint32(),a=this.tokens[this.strings[o]];if(typeof a!="string"||Object.hasOwn(s,a))throw new Error("USDC: invalid dictionary key");let c=e.tell(),u=e.readInt64();if(u<8)throw new Error("USDC: invalid dictionary value offset");e.seek(c+u);let l=new ci(e.readUint32(),e.readUint32());if(l.typeEnum<S.Bool||l.typeEnum>S.AssetPath&&l.typeEnum!==S.Dictionary||l.isArray&&!_B.has(l.typeEnum))throw new Error("USDC: unsupported dictionary value type");let f=e.tell(),d=this._readValue(l);s[a]=l.typeEnum===S.AssetPath?{assetPath:d}:d,e.seek(f)}return s}finally{this._activeDictionaries.delete(t)}}_readArrayValue(e){let t=this.reader,n=e.typeEnum,s=e.isCompressed,i;if(this.version.major===0&&this.version.minor<7?i=t.readUint32():i=t.readUint64(),!Number.isSafeInteger(i)||i<0)throw new RangeError("USDCParser: Invalid array size "+i+" for type "+n+".");if(i>2147483647)throw new RangeError("USDCParser: Array size "+i+" exceeds implementation limits.");if(i=Tt(i),i===0)return[];if(s)return this._readCompressedArray(n,i);switch(n){case S.Int:{let o=new Int32Array(Ie(i));for(let a=0;a<i;a++)o[a]=t.readInt32();return o}case S.UInt:{let o=new Uint32Array(Ie(i));for(let a=0;a<i;a++)o[a]=t.readUint32();return o}case S.Float:{let o=new Float32Array(Ie(i));for(let a=0;a<i;a++)o[a]=t.readFloat32();return o}case S.Double:{let o=new Float64Array(Ie(i));for(let a=0;a<i;a++)o[a]=t.readFloat64();return o}case S.Vec2f:{let o=new Float32Array(Ie(i*2));for(let a=0;a<i*2;a++)o[a]=t.readFloat32();return o}case S.Vec3f:{let o=new Float32Array(Ie(i*3));for(let a=0;a<i*3;a++)o[a]=t.readFloat32();return o}case S.Vec4f:{let o=new Float32Array(Ie(i*4));for(let a=0;a<i*4;a++)o[a]=t.readFloat32();return o}case S.Vec3h:{let o=new Float32Array(Ie(i*3));for(let a=0;a<i*3;a++)o[a]=this._readHalf();return o}case S.Quatf:{let o=new Float32Array(Ie(i*4));for(let a=0;a<i*4;a++)o[a]=t.readFloat32();return o}case S.Quath:{let o=new Float32Array(Ie(i*4));for(let a=0;a<i*4;a++)o[a]=this._readHalf();return o}case S.Matrix4d:{let o=new Float64Array(Ie(i*16));for(let a=0;a<i*16;a++)o[a]=t.readFloat64();return o}case S.String:case S.Token:{let o=[];for(let a=0;a<i;a++){let c=t.readUint32(),u=n===S.String?this.strings[c]:c,l=this.tokens[u];if(typeof l!="string")throw new Error("USDC: invalid string array index");o.push(l)}return o}case S.Half:{let o=new Float32Array(Ie(i));for(let a=0;a<i;a++)o[a]=this._readHalf();return o}default:throw new Error("USDC: unsupported encoding: "+["USDCParser: Unsupported array type",n].join(" "))}}_readCompressedArray(e,t){let n=this.reader;switch(e){case S.Int:case S.UInt:{let s=n.readUint64(),i=n.readBytes(s),o=Lr(i.buffer.slice(i.byteOffset,i.byteOffset+s),t);return e===S.UInt?new Uint32Array(o.buffer,o.byteOffset,o.length):o}case S.Half:case S.Double:case S.Float:{let s=n.readInt8();if(s===vB){let i=n.readUint64(),o=n.readBytes(i),a=Lr(o.buffer.slice(o.byteOffset,o.byteOffset+i),t),c=e===S.Double?new Float64Array(Ie(t)):new Float32Array(Ie(t));for(let u=0;u<t;u++)c[u]=e===S.Half?this._convertHalfInteger(a[u]):a[u];return c}else if(s===IB){let i=Tt(n.readUint32());if(i===0)throw new Error("USDC: invalid float lookup table");let o=e===S.Double?new Float64Array(Ie(i)):new Float32Array(Ie(i));for(let f=0;f<i;f++)o[f]=e===S.Half?this._readHalf():e===S.Double?n.readFloat64():n.readFloat32();let a=n.readUint64(),c=n.readBytes(a),u=Lr(c.buffer.slice(c.byteOffset,c.byteOffset+a),t),l=e===S.Double?new Float64Array(Ie(t)):new Float32Array(Ie(t));for(let f=0;f<t;f++){if(u[f]<0||u[f]>=i)throw new Error("USDC: invalid float lookup index");l[f]=o[u[f]]}return l}throw new Error("USDC: unsupported encoding: "+["USDCParser: Unknown float compression code",s].join(" "))}default:throw new Error("USDC: unsupported encoding: "+["USDCParser: Unsupported compressed array type",e].join(" "))}}_convertHalfInteger(e){let t=Math.abs(e);if(t<=2048)return e;if(t>=65520)return Math.sign(e)*(1/0);let n=2**(Math.floor(Math.log2(t))-10),s=t/n,i=Math.floor(s),o=s-i,a=o>.5||o===.5&&i%2!==0?i+1:i;return Math.sign(e)*a*n}_readHalf(){return this._halfToFloat(this.reader.readUint16())}_halfToFloat(e){let t=(e&32768)>>15,n=(e&31744)>>10,s=e&1023;return n===0?s===0?t?-0:0:(t?-1:1)*TB*(s/1024):n===31?s?NaN:t?-1/0:1/0:(t?-1:1)*zw[n]*(1+s/1024)}_getFieldsForSpec(e){let t=Object.create(null),n=e.fieldSetIndex,s=1e4,i=0;for(;n<this.fieldSets.length&&i<s;){let o=this.fieldSets[n];if(o===AB||o===-1)break;let a=this.fields[o];if(!a)throw new Error("USDC: invalid field index");if(a){let c=this.tokens[a.tokenIndex],u=this._readValue(a.valueRep);t[c]=u}n++,i++}if(i>=s)throw new Error("USDC: field traversal limit exceeded");return t}}});function qw(r,e){if(r.byteLength<88||r.byteLength>64*1024*1024)throw new Error("USDC: invalid input size");let t=new Uint8Array(r);if(t[8]!==0||t[9]!==8||t[10]!==0)throw new Error("USDC: initial decoder requires crate version 0.8.0");let n=new DataView(r),s=n.getBigUint64(16,!0);if(s>BigInt(r.byteLength-8))throw new Error("USDC: invalid section table");let i=Number(s),o=n.getBigUint64(i,!0);if(o>16n||i+8+Number(o)*32>r.byteLength)throw new Error("USDC: invalid section table length");let a=new Set;for(let f=0;f<Number(o);f++){let d=i+8+f*32,h=t.subarray(d,d+16),m=h.indexOf(0),b=new TextDecoder().decode(h.subarray(0,m<0?h.length:m));if(a.has(b))throw new Error("USDC: duplicate section");a.add(b);let g=n.getBigUint64(d+16,!0),y=n.getBigUint64(d+24,!0);if(g<88n||g+y>BigInt(r.byteLength))throw new Error("USDC: section out of bounds")}for(let f of["TOKENS","STRINGS","FIELDS","FIELDSETS","PATHS","SPECS"])if(!a.has(f))throw new Error("USDC: missing required section");let{specsByPath:c}=new vu().parseData(r),u=new Map;for(let[f,d]of Object.entries(c)){if(d.specType===7&&f==="/"||d.specType===1||d.specType===8)continue;if(d.specType!==6||!/^\/(?:[A-Za-z_][\w:]*\/)*[A-Za-z_][\w:]*$/.test(f))throw new Error("USDC: unsupported prim specification");let h=d.fields,m=h.specifier??0;if(m!==0&&m!==1&&m!==2)throw new Error("USDC: invalid prim specifier");let b=Iu(h,new Set(["specifier","typeName","primChildren","properties"]));u.set(f,{name:f.slice(f.lastIndexOf("/")+1),path:f,sourceUrl:e,type:String(h.typeName||""),specifier:["def","over","class"][m],attributes:Object.create(null),metadata:b,variants:Object.create(null),children:[]})}let l=[];for(let f of u.values()){let d=f.path.slice(0,f.path.lastIndexOf("/"));if(!d)l.push(f);else{let h=u.get(d);if(!h)throw new Error("USDC: missing parent prim");h.children.push(f)}}$w(l,c["/"]?.fields.primChildren);for(let f of u.values())$w(f.children,c[f.path]?.fields.primChildren);for(let[f,d]of Object.entries(c)){if(d.specType!==1&&d.specType!==8)continue;let h=f.indexOf("."),m=u.get(f.slice(0,h));if(h<0||!m)throw new Error("USDC: property has no owning prim");let b=f.slice(h+1),g=d.fields,y=d.specType===8?"rel":String(g.typeName||""),x=Kw(d.specType===8?g.targetPaths:g.default,y),T=Iu(g,new Set(["typeName","default","targetPaths","timeSamples"]));g.timeSamples!==void 0&&(T.timeSamples=EB(g.timeSamples,y)),m.attributes[b]={name:b,type:y,value:x,metadata:T}}return{format:"usdc",url:e,metadata:Iu(c["/"]?.fields||{},new Set(["primChildren"])),rootPrims:l,layers:[]}}function Iu(r,e){let t=Object.create(null);for(let[n,s]of Object.entries(r))e.has(n)||(t[n]=Su(s));return t}function Su(r){if(r==null)return null;if(typeof r=="number"||typeof r=="string"||typeof r=="boolean")return r;if(Array.isArray(r))return r.map(Su);if(ArrayBuffer.isView(r)&&!(r instanceof DataView))return Array.from(r);if(typeof r=="object")return Iu(r,new Set);throw new Error("USDC: unsupported decoded value")}function Kw(r,e){let t=Su(r);if(e==="asset"&&typeof t=="string")return{assetPath:t};if(e==="rel"&&Array.isArray(t))return t.map(s=>typeof s=="string"?{path:s}:s);let n=/^(?:(?:point|normal|vector|color|texCoord)([234])[fdh]|(?:float|double|half|int)([234]))\[\]$/.exec(e);if(n&&Array.isArray(t)){let s=Number(n[1]||n[2]);if(t.length%s)throw new Error("USDC: incomplete vector tuple");let i=[];for(let o=0;o<t.length;o+=s)i.push(t.slice(o,o+s));return i}return t}function $w(r,e){if(e===void 0)return;if(!Array.isArray(e))throw new Error("USDC: invalid primChildren order");let t=new Map(r.map(s=>[s.name,s])),n=[];for(let s of e){let i=typeof s=="string"?t.get(s):void 0;if(!i)throw new Error("USDC: invalid primChildren reference");n.push(i),t.delete(s)}for(let s of t.values())n.push(s);for(let s=0;s<n.length;s++)r[s]=n[s]}function EB(r,e){if(!r||typeof r!="object")throw new Error("USDC: invalid time samples");let t=r,n=Su(t.times);if(!Array.isArray(n)||!Array.isArray(t.values)||n.length!==t.values.length)throw new Error("USDC: invalid time samples");return{times:n,values:t.values.map(s=>Kw(s,e))}}var Xw=p(()=>{"use strict";Ww()});function Hw(r,e){if(!r.trimStart().startsWith("#usda"))throw new Error("OpenUSD ASCII layers must begin with the #usda header.");return new Wd(r,e).parse()}var LB,BB,Wd,$d,Jw=p(()=>{"use strict";LB=/^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?/,BB=new Set(["uniform","varying","custom","prepend","append","add","delete","reorder"]);Wd=class{tokenizer;url;constructor(e,t){this.tokenizer=new $d(e),this.url=t}parse(){let e=this.tokenizer.match("(")?this.parseMetadata(")"):{},t=[];for(;!this.tokenizer.isAtEnd();)this.isPrimDeclaration()?t.push(this.parsePrim("")):this.tokenizer.read();return{format:"usda",url:this.url,metadata:e,rootPrims:t,layers:this.url?[this.url]:[]}}parsePrim(e){let n=this.tokenizer.read().value,s=this.tokenizer.read(),i=this.tokenizer.peek().kind==="string",o=i?s.value:"",a=i?this.tokenizer.read().value:s.value,c=`${e}/${a}`,u=this.tokenizer.match("(")?this.parseMetadata(")"):{};this.tokenizer.expect("{");let l=this.parsePrimContents(c);return{name:a,path:c,sourceUrl:this.url,type:o,specifier:n,attributes:l.attributes,metadata:{...u,...l.metadata},variants:l.variants,children:l.children}}parsePrimContents(e){let t={},n={},s=[],i={};for(;!this.tokenizer.isAtEnd()&&!this.tokenizer.match("}");)if(this.isPrimDeclaration())s.push(this.parsePrim(e));else if(this.tokenizer.peek().value==="variantSet")this.parseVariantSet(e,i);else{let o=this.parseAttribute();o&&(t[o.name]=o)}return{attributes:t,metadata:n,children:s,variants:i}}parseVariantSet(e,t){this.tokenizer.expect("variantSet");let n=this.tokenizer.read().value;this.tokenizer.expect("="),this.tokenizer.expect("{");let s={};for(;!this.tokenizer.isAtEnd()&&!this.tokenizer.match("}");){let i=this.tokenizer.read().value;this.tokenizer.expect("{");let o=this.parsePrimContents(e);s[i]={attributes:o.attributes,metadata:o.metadata,children:o.children}}t[n]=s}parseAttribute(){let e=this.tokenizer.read();if(e.kind==="end")return null;let t=[e];for(;!this.tokenizer.isAtEnd()&&this.tokenizer.peek().line===e.line;){let u=this.tokenizer.peek();if(u.value==="="){this.tokenizer.read();break}if(u.value==="{"||u.value==="}")return null;t.push(this.tokenizer.read())}if(!(this.tokenizer.previousValue==="="))return null;let s=t.filter(u=>!BB.has(u.value));if(s.length===0)return null;let i=s[s.length-1].value,o=s.slice(0,-1).map(u=>u.value).join(""),a=this.parseValue(),c=this.tokenizer.match("(")?this.parseMetadata(")"):{};return{name:i,type:o,value:a,metadata:c}}parseMetadata(e){let t={};for(;!this.tokenizer.isAtEnd()&&!this.tokenizer.match(e);){if(this.tokenizer.match(","),this.tokenizer.peek().value===e){this.tokenizer.read();break}let n=this.tokenizer.read(),s=[n];for(;!this.tokenizer.isAtEnd()&&this.tokenizer.peek().line===n.line;){if(this.tokenizer.peek().value==="="||this.tokenizer.peek().value===":"){this.tokenizer.read();break}if(this.tokenizer.peek().value===e)break;s.push(this.tokenizer.read())}if(this.tokenizer.previousValue!=="="&&this.tokenizer.previousValue!==":")continue;let i=s[s.length-1].value;t[i]=this.parseValue(),this.tokenizer.match(",")}return t}parseValue(){let e=this.tokenizer.read();if(e.value==="[")return this.parseList("]");if(e.value==="(")return this.parseList(")");if(e.value==="{")return this.parseMetadata("}");if(e.kind==="asset"){let t={assetPath:e.value};return this.tokenizer.peek().kind==="path"&&this.tokenizer.peek().line===e.line&&(t.primPath=this.tokenizer.read().value),t}return e.kind==="path"?{path:e.value}:e.kind==="number"?Number(e.value):e.value==="true"?!0:e.value==="false"?!1:e.value==="None"||e.value==="null"?null:e.value}parseList(e){let t=[];for(;!this.tokenizer.isAtEnd()&&!this.tokenizer.match(e);)this.tokenizer.match(",")||(t.push(this.parseValue()),this.tokenizer.match(","));return t}isPrimDeclaration(){let e=this.tokenizer.peek().value;return e==="def"||e==="over"||e==="class"}},$d=class{source;offset=0;line=1;bufferedToken=null;previousValue="";constructor(e){this.source=e}peek(){return this.bufferedToken||=this.readToken(),this.bufferedToken}read(){let e=this.peek();return this.bufferedToken=null,this.previousValue=e.value,e}match(e){return this.peek().value!==e?!1:(this.read(),!0)}expect(e){let t=this.read();if(t.value!==e)throw new Error(`Expected "${e}" at USDA line ${t.line}, received "${t.value}".`)}isAtEnd(){return this.peek().kind==="end"}readToken(){this.skipIgnoredText();let e=this.line,t=this.source[this.offset];if(t===void 0)return{value:"",line:e,kind:"end"};if("{}[](),=".includes(t))return this.offset++,{value:t,line:e,kind:"punctuation"};if(t==='"'||t==="'")return{value:this.readQuotedString(t),line:e,kind:"string"};if(t==="@")return{value:this.readDelimitedValue("@"),line:e,kind:"asset"};if(t==="<")return{value:this.readDelimitedValue(">"),line:e,kind:"path"};let n=this.source.slice(this.offset).match(LB);if(n)return this.offset+=n[0].length,{value:n[0],line:e,kind:"number"};let s=this.offset;for(;this.offset<this.source.length;){let i=this.source[this.offset];if(/\s/.test(i)||"{}[](),=@<>".includes(i))break;this.offset++}return this.offset===s&&this.offset++,{value:this.source.slice(s,this.offset),line:e,kind:"word"}}skipIgnoredText(){for(;this.offset<this.source.length;){let e=this.source[this.offset];if(e===`
|
|
8
8
|
`)this.line++,this.offset++;else if(/\s/.test(e))this.offset++;else if(e==="#")for(;this.offset<this.source.length&&this.source[this.offset]!==`
|
|
9
9
|
`;)this.offset++;else if(e==="/"&&this.source[this.offset+1]==="*"){for(this.offset+=2;this.offset<this.source.length&&!this.source.startsWith("*/",this.offset);)this.source[this.offset]===`
|
|
10
10
|
`&&this.line++,this.offset++;this.offset+=2}else if(this.source.startsWith('"""',this.offset)){for(this.offset+=3;this.offset<this.source.length&&!this.source.startsWith('"""',this.offset);)this.source[this.offset]===`
|
|
11
11
|
`&&this.line++,this.offset++;this.offset+=3}else break}}readQuotedString(e){this.offset++;let t="";for(;this.offset<this.source.length;){let n=this.source[this.offset++];if(n===e)break;if(n==="\\"&&this.offset<this.source.length){let s=this.source[this.offset++];t+=s==="n"?`
|
|
12
|
-
`:s}else t+=n}return t}readDelimitedValue(e){this.offset++;let t=this.offset;for(;this.offset<this.source.length&&this.source[this.offset]!==e;)this.offset++;let n=this.source.slice(t,this.offset);return this.offset++,n}}});function gw(r){let e=new DataView(r),t=FL(e),n=e.getUint16(t+10,!0),s=e.getUint32(t+16,!0),i=new Map,o=new TextDecoder;for(let a=0;a<n;a++){if(e.getUint32(s,!0)!==33639248)throw new Error("USDZ archive contains an invalid ZIP central-directory entry.");let c=e.getUint16(s+10,!0),u=e.getUint32(s+20,!0),f=e.getUint16(s+28,!0),l=e.getUint16(s+30,!0),d=e.getUint16(s+32,!0),h=e.getUint32(s+42,!0),m=o.decode(new Uint8Array(r,s+46,f));if(c!==0)throw new Error(`USDZ entry "${m}" is compressed; USDZ requires stored ZIP entries.`);if(e.getUint32(h,!0)!==67324752)throw new Error(`USDZ entry "${m}" has an invalid local ZIP header.`);let b=e.getUint16(h+26,!0),w=e.getUint16(h+28,!0),g=h+30+b+w;i.set(m,r.slice(g,g+u)),s+=46+f+l+d}return i}function FL(r){let e=Math.max(0,r.byteLength-65557);for(let t=r.byteLength-22;t>=e;t--)if(r.getUint32(t,!0)===101010256)return t;throw new Error("USDZ archive does not contain a ZIP end-of-central-directory record.")}var yw=p(()=>{"use strict"});async function Od(r,e={},t){let n=RL(e.core?.baseUrl,t?.url),s={fetch:async o=>{let a=await(t?.fetch||fetch)(o);if(!(a instanceof Response))throw new Error(`OpenUSD reference "${o}" did not return an HTTP response.`);if(!a.ok)throw new Error(`Unable to load OpenUSD reference "${o}": ${a.status}.`);return a},cache:new Map,archiveFiles:new Map,layers:new Set,options:{...e,usd:{...NL,...e.usd}}},i;if(VL(r)){let o=gw(r),a=Array.from(o.keys()).find(f=>/\.usda?$/i.test(f));if(!a)throw new Error("USDZ archives with binary USDC root layers are not implemented yet.");let c="https://usd.archive/";for(let[f,l]of o)s.archiveFiles.set(new URL(f,c).href,l);let u=new URL(a,c).href;i=Ed(o.get(a),u),i.format="usdz"}else i=Ed(r,n);return i.url&&s.layers.add(i.url),s.options.usd?.compose!==!1&&(i.rootPrims=await Ld(i.rootPrims,i.url,{},s,0)),i.layers=Array.from(s.layers),n&&(i.url=n),i}function RL(r,e){let t=xw(r);return t||xw(e)||r||e}function xw(r){try{return r?new URL(r).href:void 0}catch{return}}function DL(r,e){try{return new URL(r,e).href}catch{let t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t>=0?`${e.slice(0,t+1)}${r}`:r}}function Ed(r,e){if(ww.decode(r.slice(0,8))===OL)throw new Error("Binary USDC crate layers are not implemented yet; use ASCII USDA layers.");return mw(ww.decode(r),e)}async function Ld(r,e,t,n,s){if(s>(n.options.usd?.maxReferenceDepth??12))throw new Error("OpenUSD reference composition exceeded the configured depth limit.");let i=[];for(let o of r){if(o.specifier==="class")continue;let c={...UL(o.metadata.variants),...t,...n.options.usd?.variantSelections},u=o.sourceUrl||e,f=Oa(o);for(let[d,h]of Object.entries(f.variants)){let m=c[d]||Object.keys(h)[0],b=h[m];b&&(f=Fd(f,{...f,attributes:b.attributes,metadata:b.metadata,children:b.children,variants:{}}))}let l=_w(f);if(n.options.usd?.loadReferences!==!1&&l.length>0)for(let d of l){if(!u)throw new Error("OpenUSD references require a source URL or options.core.baseUrl.");let h=DL(d.assetPath,u),m=await kL(h,n),b=CL(m,d.primPath),w=await Ld(b,h,c,n,s+1);for(let g of w)f=Fd(Aw(g,f.path),f)}f.children=await Ld(f.children,u,c,n,s),i.push(f)}return i}async function kL(r,e){let t=e.cache.get(r);return t||(t=(async()=>{let s=e.archiveFiles.get(r);if(!s){let o;try{o=await e.fetch(r)}catch(a){throw new Error(`Unable to fetch USD layer "${r}": ${String(a)}`)}s=o.arrayBuffer()}let i=Ed(await s,r);return e.layers.add(r),i})(),e.cache.set(r,t)),t}function CL(r,e){let t=e||r.metadata.defaultPrim;if(typeof t!="string")return r.rootPrims;let n=t.startsWith("/")?t:`/${t}`,s=Tw(r.rootPrims,n);return s?[s]:[]}function Tw(r,e){for(let t of r){if(t.path===e)return t;let n=Tw(t.children,e);if(n)return n}}function _w(r){let e=[];for(let t of[r.metadata.references,r.metadata.payload,r.metadata.payloads])Array.isArray(t)?e.push(...t.filter(Bd)):Bd(t)&&e.push(t);return e}function UL(r){return!r||typeof r!="object"||Array.isArray(r)||Bd(r)?{}:Object.fromEntries(Object.entries(r).filter(e=>typeof e[1]=="string"))}function Bd(r){return!!(r&&typeof r=="object"&&!Array.isArray(r)&&"assetPath"in r)}function Oa(r){return{...r,attributes:{...r.attributes},metadata:{...r.metadata},variants:{...r.variants},children:r.children.map(Oa)}}function Aw(r,e){let t=Oa(r);return t.path=e,t.children=t.children.map(n=>Aw(n,`${e}/${n.name}`)),t}function Fd(r,e){let t=r.children.map(Oa);for(let n of e.children){let s=t.findIndex(i=>i.name===n.name);s>=0?t[s]=Fd(t[s],n):t.push(Oa(n))}return{...r,...e,sourceUrl:_w(e).length>0?e.sourceUrl:r.sourceUrl||e.sourceUrl,type:e.type||r.type,attributes:{...r.attributes,...e.attributes},metadata:{...r.metadata,...e.metadata},variants:{...r.variants,...e.variants},children:t}}function VL(r){return r.byteLength>=4&&new DataView(r).getUint32(0,!0)===ML}var ww,OL,ML,NL,vw=p(()=>{"use strict";bw();yw();ww=new TextDecoder,OL="PXR-USDC",ML=67324752;NL={compose:!0,loadReferences:!0,maxReferenceDepth:12,variantSelections:{}}});async function GL(r,e,t){return Od(new TextEncoder().encode(r).buffer,e,t)}var v3,PL,jL,Iw=p(()=>{"use strict";vw();Md();({preload:v3,...PL}=Ma),jL={...PL,parse:Od,parseText:GL}});var Sw={};J(Sw,{USDLoaderWithParser:()=>jL});var Ew=p(()=>{"use strict";Iw()});async function WL(){let{USDLoaderWithParser:r}=await Promise.resolve().then(()=>(Ew(),Sw));return r}var zL,Ma,Md=p(()=>{"use strict";zL="5.0.0-beta.4";Ma={dataType:null,batchType:null,name:"Universal Scene Description",id:"usd",module:"scene",version:zL,extensions:["usd","usda","usdz"],mimeTypes:["model/vnd.usd","model/vnd.usda","model/vnd.usdz+zip"],text:!0,binary:!0,tests:["#usda","PK"],options:{usd:{compose:!0,loadReferences:!0,maxReferenceDepth:12,variantSelections:{}}},preload:WL}});var Lw,Bw=p(()=>{"use strict";Lw={name:"OBJ",id:"obj",module:"scene",encoding:"text",format:"obj",extensions:["obj"],mimeTypes:["text/plain"]}});function Ow(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(r);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(r,n[s])&&(t[n[s]]=r[n[s]]);return t}function B(r,e,t,n){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(f){try{u(n.next(f))}catch(l){o(l)}}function c(f){try{u(n.throw(f))}catch(l){o(l)}}function u(f){f.done?i(f.value):s(f.value).then(a,c)}u((n=n.apply(r,e||[])).next())})}function Fw(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function H(r){return this instanceof H?(this.v=r,this):new H(r)}function gt(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),s,i=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(h){return function(m){return Promise.resolve(m).then(h,l)}}function a(h,m){n[h]&&(s[h]=function(b){return new Promise(function(w,g){i.push([h,b,w,g])>1||c(h,b)})},m&&(s[h]=m(s[h])))}function c(h,m){try{u(n[h](m))}catch(b){d(i[0][3],b)}}function u(h){h.value instanceof H?Promise.resolve(h.value.v).then(f,l):d(i[0][2],h)}function f(h){c("next",h)}function l(h){c("throw",h)}function d(h,m){h(m),i.shift(),i.length&&c(i[0][0],i[0][1])}}function yo(r){var e,t;return e={},n("next"),n("throw",function(s){throw s}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(s,i){e[s]=r[s]?function(o){return(t=!t)?{value:H(r[s](o)),done:!1}:i?i(o):o}:i}}function $t(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof Fw=="function"?Fw(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=r[i]&&function(o){return new Promise(function(a,c){o=r[i](o),s(a,c,o.done,o.value)})}}function s(i,o,a,c){Promise.resolve(c).then(function(u){i({value:u,done:a})},o)}}var Ft=p(()=>{});var Mw,wo,$L,qt,dn=p(()=>{Mw=new TextDecoder("utf-8"),wo=Mw.decode.bind(Mw),$L=new TextEncoder,qt=r=>$L.encode(r)});var qL,Rw,We,yt,Kt,Ar,hr,yu,wu,xu,Tu,_u,Dw,Ra,Nw,Au,kw,qn=p(()=>{qL=r=>typeof r=="number",Rw=r=>typeof r=="boolean",We=r=>typeof r=="function",yt=r=>r!=null&&Object(r)===r,Kt=r=>yt(r)&&We(r.then),Ar=r=>yt(r)&&We(r[Symbol.iterator]),hr=r=>yt(r)&&We(r[Symbol.asyncIterator]),yu=r=>yt(r)&&yt(r.schema),wu=r=>yt(r)&&"done"in r&&"value"in r,xu=r=>yt(r)&&We(r.stat)&&qL(r.fd),Tu=r=>yt(r)&&Ra(r.body),_u=r=>"_getDOMStream"in r&&"_getNodeStream"in r,Dw=r=>yt(r)&&We(r.abort)&&We(r.getWriter)&&!_u(r),Ra=r=>yt(r)&&We(r.cancel)&&We(r.getReader)&&!_u(r),Nw=r=>yt(r)&&We(r.end)&&We(r.write)&&Rw(r.writable)&&!_u(r),Au=r=>yt(r)&&We(r.read)&&We(r.pipe)&&Rw(r.readable)&&!_u(r),kw=r=>yt(r)&&We(r.clear)&&We(r.bytes)&&We(r.position)&&We(r.setPosition)&&We(r.capacity)&&We(r.getBufferIdentifier)&&We(r.createLong)});var Ud={};J(Ud,{compareArrayLike:()=>Cd,joinUint8Arrays:()=>Xt,memcpy:()=>Da,rebaseValueOffsets:()=>vu,toArrayBufferView:()=>Z,toArrayBufferViewAsyncIterator:()=>vr,toArrayBufferViewIterator:()=>Gr,toBigInt64Array:()=>Na,toBigUint64Array:()=>QL,toFloat32Array:()=>ZL,toFloat32ArrayAsyncIterator:()=>mB,toFloat32ArrayIterator:()=>aB,toFloat64Array:()=>eB,toFloat64ArrayAsyncIterator:()=>bB,toFloat64ArrayIterator:()=>cB,toInt16Array:()=>HL,toInt16ArrayAsyncIterator:()=>lB,toInt16ArrayIterator:()=>nB,toInt32Array:()=>si,toInt32ArrayAsyncIterator:()=>dB,toInt32ArrayIterator:()=>sB,toInt8Array:()=>XL,toInt8ArrayAsyncIterator:()=>fB,toInt8ArrayIterator:()=>rB,toUint16Array:()=>JL,toUint16ArrayAsyncIterator:()=>hB,toUint16ArrayIterator:()=>iB,toUint32Array:()=>YL,toUint32ArrayAsyncIterator:()=>pB,toUint32ArrayIterator:()=>oB,toUint8Array:()=>D,toUint8ArrayAsyncIterator:()=>kd,toUint8ArrayIterator:()=>Nd,toUint8ClampedArray:()=>tB,toUint8ClampedArrayAsyncIterator:()=>gB,toUint8ClampedArrayIterator:()=>uB});function KL(r){let e=r[0]?[r[0]]:[],t,n,s,i;for(let o,a,c=0,u=0,f=r.length;++c<f;){if(o=e[u],a=r[c],!o||!a||o.buffer!==a.buffer||a.byteOffset<o.byteOffset){a&&(e[++u]=a);continue}if({byteOffset:t,byteLength:s}=o,{byteOffset:n,byteLength:i}=a,t+s<n||n+i<t){a&&(e[++u]=a);continue}e[u]=new Uint8Array(o.buffer,t,n-t+i)}return e}function Da(r,e,t=0,n=e.byteLength){let s=r.byteLength,i=new Uint8Array(r.buffer,r.byteOffset,s),o=new Uint8Array(e.buffer,e.byteOffset,Math.min(n,s));return i.set(o,t),r}function Xt(r,e){let t=KL(r),n=t.reduce((f,l)=>f+l.byteLength,0),s,i,o,a=0,c=-1,u=Math.min(e||Number.POSITIVE_INFINITY,n);for(let f=t.length;++c<f;){if(s=t[c],i=s.subarray(0,Math.min(s.length,u-a)),u<=a+i.length){i.length<s.length?t[c]=s.subarray(i.length):i.length===s.length&&c++,o?Da(o,i,a):o=i;break}Da(o||(o=new Uint8Array(u)),i,a),a+=i.length}return[o||new Uint8Array(0),t.slice(c),n-(o?o.byteLength:0)]}function Z(r,e){let t=wu(e)?e.value:e;return t instanceof r?r===Uint8Array?new r(t.buffer,t.byteOffset,t.byteLength):t:t?(typeof t=="string"&&(t=qt(t)),t instanceof ArrayBuffer?new r(t):t instanceof Dd?new r(t):kw(t)?Z(r,t.bytes()):ArrayBuffer.isView(t)?t.byteLength<=0?new r(0):new r(t.buffer,t.byteOffset,t.byteLength/r.BYTES_PER_ELEMENT):r.from(t)):new r(0)}function*Gr(r,e){let t=function*(s){yield s},n=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof Dd?t(e):Ar(e)?e:t(e);return yield*Rd((function*(s){let i=null;do i=s.next(yield Z(r,i));while(!i.done)})(n[Symbol.iterator]())),new r}function vr(r,e){return gt(this,arguments,function*(){if(Kt(e))return yield H(yield H(yield*yo($t(vr(r,yield H(e))))));let n=function(o){return gt(this,arguments,function*(){yield yield H(yield H(o))})},s=function(o){return gt(this,arguments,function*(){yield H(yield*yo($t(Rd((function*(a){let c=null;do c=a.next(yield c?.value);while(!c.done)})(o[Symbol.iterator]())))))})},i=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof Dd?n(e):Ar(e)?s(e):hr(e)?e:n(e);return yield H(yield*yo($t(Rd((function(o){return gt(this,arguments,function*(){let a=null;do a=yield H(o.next(yield yield H(Z(r,a))));while(!a.done)})})(i[Symbol.asyncIterator]()))))),yield H(new r)})}function vu(r,e,t){if(r!==0){t=t.slice(0,e);let n=typeof t[0]=="bigint"?BigInt(r):r;for(let s=-1,i=t.length;++s<i;)t[s]+=n}return t.subarray(0,e)}function Cd(r,e){let t=0,n=r.length;if(n!==e.length)return!1;if(n>0)do if(r[t]!==e[t])return!1;while(++t<n);return!0}var Dd,XL,HL,si,Na,D,JL,YL,QL,ZL,eB,tB,Rd,rB,nB,sB,Nd,iB,oB,aB,cB,uB,fB,lB,dB,kd,hB,pB,mB,bB,gB,$e=p(()=>{Ft();dn();qn();Dd=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;XL=r=>Z(Int8Array,r),HL=r=>Z(Int16Array,r),si=r=>Z(Int32Array,r),Na=r=>Z(BigInt64Array,r),D=r=>Z(Uint8Array,r),JL=r=>Z(Uint16Array,r),YL=r=>Z(Uint32Array,r),QL=r=>Z(BigUint64Array,r),ZL=r=>Z(Float32Array,r),eB=r=>Z(Float64Array,r),tB=r=>Z(Uint8ClampedArray,r),Rd=r=>(r.next(),r);rB=r=>Gr(Int8Array,r),nB=r=>Gr(Int16Array,r),sB=r=>Gr(Int32Array,r),Nd=r=>Gr(Uint8Array,r),iB=r=>Gr(Uint16Array,r),oB=r=>Gr(Uint32Array,r),aB=r=>Gr(Float32Array,r),cB=r=>Gr(Float64Array,r),uB=r=>Gr(Uint8ClampedArray,r);fB=r=>vr(Int8Array,r),lB=r=>vr(Int16Array,r),dB=r=>vr(Int32Array,r),kd=r=>vr(Uint8Array,r),hB=r=>vr(Uint16Array,r),pB=r=>vr(Uint32Array,r),mB=r=>vr(Float32Array,r),bB=r=>vr(Float64Array,r),gB=r=>vr(Uint8ClampedArray,r)});function*yB(r){let e,t=!1,n=[],s,i,o,a=0;function c(){return i==="peek"?Xt(n,o)[0]:([s,n,a]=Xt(n,o),s)}({cmd:i,size:o}=(yield null)||{cmd:"read",size:0});let u=Nd(r)[Symbol.iterator]();try{do if({done:e,value:s}=Number.isNaN(o-a)?u.next():u.next(o-a),!e&&s.byteLength>0&&(n.push(s),a+=s.byteLength),e||o<=a)do({cmd:i,size:o}=yield c());while(o<a);while(!e)}catch(f){t=!0,typeof u.throw=="function"&&u.throw(f)}finally{t===!1&&typeof u.return=="function"&&u.return(null)}return null}function wB(r){return gt(this,arguments,function*(){let t,n=!1,s=[],i,o,a,c=0;function u(){return o==="peek"?Xt(s,a)[0]:([i,s,c]=Xt(s,a),i)}({cmd:o,size:a}=(yield yield H(null))||{cmd:"read",size:0});let f=kd(r)[Symbol.asyncIterator]();try{do if({done:t,value:i}=Number.isNaN(a-c)?yield H(f.next()):yield H(f.next(a-c)),!t&&i.byteLength>0&&(s.push(i),c+=i.byteLength),t||a<=c)do({cmd:o,size:a}=yield yield H(u()));while(a<c);while(!t)}catch(l){n=!0,typeof f.throw=="function"&&(yield H(f.throw(l)))}finally{n===!1&&typeof f.return=="function"&&(yield H(f.return(new Uint8Array(0))))}return yield H(null)})}function xB(r){return gt(this,arguments,function*(){let t=!1,n=!1,s=[],i,o,a,c=0;function u(){return o==="peek"?Xt(s,a)[0]:([i,s,c]=Xt(s,a),i)}({cmd:o,size:a}=(yield yield H(null))||{cmd:"read",size:0});let f=new Pd(r);try{do if({done:t,value:i}=Number.isNaN(a-c)?yield H(f.read()):yield H(f.read(a-c)),!t&&i.byteLength>0&&(s.push(D(i)),c+=i.byteLength),t||a<=c)do({cmd:o,size:a}=yield yield H(u()));while(a<c);while(!t)}catch(l){n=!0,yield H(f.cancel(l))}finally{n===!1?yield H(f.cancel()):r.locked&&f.releaseLock()}return yield H(null)})}function TB(r){return gt(this,arguments,function*(){let t=[],n="error",s=!1,i=null,o,a,c=0,u=[],f;function l(){return o==="peek"?Xt(u,a)[0]:([f,u,c]=Xt(u,a),f)}if({cmd:o,size:a}=(yield yield H(null))||{cmd:"read",size:0},r.isTTY)return yield yield H(new Uint8Array(0)),yield H(null);try{t[0]=Vd(r,"end"),t[1]=Vd(r,"error");do{if(t[2]=Vd(r,"readable"),[n,i]=yield H(Promise.race(t.map(h=>h[2]))),n==="error")break;if((s=n==="end")||(Number.isFinite(a-c)?(f=D(r.read(a-c)),f.byteLength<a-c&&(f=D(r.read()))):f=D(r.read()),f.byteLength>0&&(u.push(f),c+=f.byteLength)),s||a<=c)do({cmd:o,size:a}=yield yield H(l()));while(a<c)}while(!s)}finally{yield H(d(t,n==="error"?i:null))}return yield H(null);function d(h,m){return f=u=null,new Promise((b,w)=>{for(let[g,x]of h)r.off(g,x);try{let g=r.destroy;g&&g.call(r,m),m=void 0}catch(g){m=g||m}finally{m!=null?w(m):b()}})}})}var Je,Iu,Pd,Vd,ka=p(()=>{Ft();$e();Je={fromIterable(r){return Iu(yB(r))},fromAsyncIterable(r){return Iu(wB(r))},fromDOMStream(r){return Iu(xB(r))},fromNodeStream(r){return Iu(TB(r))},toDOMStream(r,e){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(r,e){throw new Error('"toNodeStream" not available in this environment')}},Iu=r=>(r.next(),r);Pd=class{constructor(e){this.source=e,this.reader=null,this.reader=this.source.getReader(),this.reader.closed.catch(()=>{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(e){return B(this,void 0,void 0,function*(){let{reader:t,source:n}=this;t&&(yield t.cancel(e).catch(()=>{})),n&&n.locked&&this.releaseLock()})}read(e){return B(this,void 0,void 0,function*(){if(e===0)return{done:this.reader==null,value:new Uint8Array(0)};let t=yield this.reader.read();return!t.done&&(t.value=D(t)),t})}},Vd=(r,e)=>{let t=s=>n([e,s]),n;return[e,t,new Promise(s=>(n=s)&&r.once(e,t))]}});var me,Su=p(()=>{(function(r){r[r.V1=0]="V1",r[r.V2=1]="V2",r[r.V3=2]="V3",r[r.V4=3]="V4",r[r.V5=4]="V5"})(me||(me={}))});var de,jd=p(()=>{(function(r){r[r.Sparse=0]="Sparse",r[r.Dense=1]="Dense"})(de||(de={}))});var ue,Gd=p(()=>{(function(r){r[r.HALF=0]="HALF",r[r.SINGLE=1]="SINGLE",r[r.DOUBLE=2]="DOUBLE"})(ue||(ue={}))});var ge,zd=p(()=>{(function(r){r[r.DAY=0]="DAY",r[r.MILLISECOND=1]="MILLISECOND"})(ge||(ge={}))});var E,Ca=p(()=>{(function(r){r[r.SECOND=0]="SECOND",r[r.MILLISECOND=1]="MILLISECOND",r[r.MICROSECOND=2]="MICROSECOND",r[r.NANOSECOND=3]="NANOSECOND"})(E||(E={}))});var oe,Wd=p(()=>{(function(r){r[r.YEAR_MONTH=0]="YEAR_MONTH",r[r.DAY_TIME=1]="DAY_TIME",r[r.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(oe||(oe={}))});var Eu=p(()=>{});var zr,Lu,Bu,xo,$d=p(()=>{zr=new Int32Array(2),Lu=new Float32Array(zr.buffer),Bu=new Float64Array(zr.buffer),xo=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1});var Ua,qd=p(()=>{(function(r){r[r.UTF8_BYTES=1]="UTF8_BYTES",r[r.UTF16_STRING=2]="UTF16_STRING"})(Ua||(Ua={}))});var Ye,Kd=p(()=>{Eu();qd();$d();Ye=class r{constructor(e){this.bytes_=e,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(e){return new r(new Uint8Array(e))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(e){this.position_=e}capacity(){return this.bytes_.length}readInt8(e){return this.readUint8(e)<<24>>24}readUint8(e){return this.bytes_[e]}readInt16(e){return this.readUint16(e)<<16>>16}readUint16(e){return this.bytes_[e]|this.bytes_[e+1]<<8}readInt32(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24}readUint32(e){return this.readInt32(e)>>>0}readInt64(e){return BigInt.asIntN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readUint64(e){return BigInt.asUintN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readFloat32(e){return zr[0]=this.readInt32(e),Lu[0]}readFloat64(e){return zr[xo?0:1]=this.readInt32(e),zr[xo?1:0]=this.readInt32(e+4),Bu[0]}writeInt8(e,t){this.bytes_[e]=t}writeUint8(e,t){this.bytes_[e]=t}writeInt16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeUint16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeInt32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeUint32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeInt64(e,t){this.writeInt32(e,Number(BigInt.asIntN(32,t))),this.writeInt32(e+4,Number(BigInt.asIntN(32,t>>BigInt(32))))}writeUint64(e,t){this.writeUint32(e,Number(BigInt.asUintN(32,t))),this.writeUint32(e+4,Number(BigInt.asUintN(32,t>>BigInt(32))))}writeFloat32(e,t){Lu[0]=t,this.writeInt32(e,zr[0])}writeFloat64(e,t){Bu[0]=t,this.writeInt32(e,zr[xo?0:1]),this.writeInt32(e+4,zr[xo?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+4+4)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let e="";for(let t=0;t<4;t++)e+=String.fromCharCode(this.readInt8(this.position_+4+t));return e}__offset(e,t){let n=e-this.readInt32(e);return t<this.readInt16(n)?this.readInt16(n+t):0}__union(e,t){return e.bb_pos=t+this.readInt32(t),e.bb=this,e}__string(e,t){e+=this.readInt32(e);let n=this.readInt32(e);e+=4;let s=this.bytes_.subarray(e,e+n);return t===Ua.UTF8_BYTES?s:this.text_decoder_.decode(s)}__union_with_string(e,t){return typeof e=="string"?this.__string(t):this.__union(e,t)}__indirect(e){return e+this.readInt32(e)}__vector(e){return e+this.readInt32(e)+4}__vector_len(e){return this.readInt32(e+this.readInt32(e))}__has_identifier(e){if(e.length!=4)throw new Error("FlatBuffers: file identifier must be length "+4);for(let t=0;t<4;t++)if(e.charCodeAt(t)!=this.readInt8(this.position()+4+t))return!1;return!0}createScalarList(e,t){let n=[];for(let s=0;s<t;++s){let i=e(s);i!==null&&n.push(i)}return n}createObjList(e,t){let n=[];for(let s=0;s<t;++s){let i=e(s);i!==null&&n.push(i.unpack())}return n}}});var ii,Cw=p(()=>{Kd();Eu();ii=class r{constructor(e){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,this.text_encoder=new TextEncoder;let t;e?t=e:t=1024,this.bb=Ye.allocate(t),this.space=t}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(e){this.force_defaults=e}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(e,t){e>this.minalign&&(this.minalign=e);let n=~(this.bb.capacity()-this.space+t)+1&e-1;for(;this.space<n+e+t;){let s=this.bb.capacity();this.bb=r.growByteBuffer(this.bb),this.space+=this.bb.capacity()-s}this.pad(n)}pad(e){for(let t=0;t<e;t++)this.bb.writeInt8(--this.space,0)}writeInt8(e){this.bb.writeInt8(this.space-=1,e)}writeInt16(e){this.bb.writeInt16(this.space-=2,e)}writeInt32(e){this.bb.writeInt32(this.space-=4,e)}writeInt64(e){this.bb.writeInt64(this.space-=8,e)}writeFloat32(e){this.bb.writeFloat32(this.space-=4,e)}writeFloat64(e){this.bb.writeFloat64(this.space-=8,e)}addInt8(e){this.prep(1,0),this.writeInt8(e)}addInt16(e){this.prep(2,0),this.writeInt16(e)}addInt32(e){this.prep(4,0),this.writeInt32(e)}addInt64(e){this.prep(8,0),this.writeInt64(e)}addFloat32(e){this.prep(4,0),this.writeFloat32(e)}addFloat64(e){this.prep(8,0),this.writeFloat64(e)}addFieldInt8(e,t,n){(this.force_defaults||t!=n)&&(this.addInt8(t),this.slot(e))}addFieldInt16(e,t,n){(this.force_defaults||t!=n)&&(this.addInt16(t),this.slot(e))}addFieldInt32(e,t,n){(this.force_defaults||t!=n)&&(this.addInt32(t),this.slot(e))}addFieldInt64(e,t,n){(this.force_defaults||t!==n)&&(this.addInt64(t),this.slot(e))}addFieldFloat32(e,t,n){(this.force_defaults||t!=n)&&(this.addFloat32(t),this.slot(e))}addFieldFloat64(e,t,n){(this.force_defaults||t!=n)&&(this.addFloat64(t),this.slot(e))}addFieldOffset(e,t,n){(this.force_defaults||t!=n)&&(this.addOffset(t),this.slot(e))}addFieldStruct(e,t,n){t!=n&&(this.nested(t),this.slot(e))}nested(e){if(e!=this.offset())throw new TypeError("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new TypeError("FlatBuffers: object serialization must not be nested.")}slot(e){this.vtable!==null&&(this.vtable[e]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(e){let t=e.capacity();if(t&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");let n=t<<1,s=Ye.allocate(n);return s.setPosition(n-t),s.bytes().set(e.bytes(),n-t),s}addOffset(e){this.prep(4,0),this.writeInt32(this.offset()-e+4)}startObject(e){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=e;for(let t=0;t<e;t++)this.vtable[t]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);let e=this.offset(),t=this.vtable_in_use-1;for(;t>=0&&this.vtable[t]==0;t--);let n=t+1;for(;t>=0;t--)this.addInt16(this.vtable[t]!=0?e-this.vtable[t]:0);let s=2;this.addInt16(e-this.object_start);let i=(n+s)*2;this.addInt16(i);let o=0,a=this.space;e:for(t=0;t<this.vtables.length;t++){let c=this.bb.capacity()-this.vtables[t];if(i==this.bb.readInt16(c)){for(let u=2;u<i;u+=2)if(this.bb.readInt16(a+u)!=this.bb.readInt16(c+u))continue e;o=this.vtables[t];break}}return o?(this.space=this.bb.capacity()-e,this.bb.writeInt32(this.space,o-e)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-e,this.offset()-e)),this.isNested=!1,e}finish(e,t,n){let s=n?4:0;if(t){let i=t;if(this.prep(this.minalign,8+s),i.length!=4)throw new TypeError("FlatBuffers: file identifier must be length "+4);for(let o=3;o>=0;o--)this.writeInt8(i.charCodeAt(o))}this.prep(this.minalign,4+s),this.addOffset(e),s&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(e,t){this.finish(e,t,!0)}requiredField(e,t){let n=this.bb.capacity()-e,s=n-this.bb.readInt32(n);if(!(t<this.bb.readInt16(s)&&this.bb.readInt16(s+t)!=0))throw new TypeError("FlatBuffers: field "+t+" must be set")}startVector(e,t,n){this.notNested(),this.vector_num_elems=t,this.prep(4,e*t),this.prep(n,e*t)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(e){if(!e)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(e))return this.string_maps.get(e);let t=this.createString(e);return this.string_maps.set(e,t),t}createString(e){if(e==null)return 0;let t;return e instanceof Uint8Array?t=e:t=this.text_encoder.encode(e),this.addInt8(0),this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),this.bb.bytes().set(t,this.space),this.endVector()}createByteVector(e){return e==null?0:(this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),this.bb.bytes().set(e,this.space),this.endVector())}createObjectOffset(e){return e===null?0:typeof e=="string"?this.createString(e):e.pack(this)}createObjectOffsetList(e){let t=[];for(let n=0;n<e.length;++n){let s=e[n];if(s!==null)t.push(this.createObjectOffset(s));else throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return t}createStructOffsetList(e,t){return t(this,e.length),this.createObjectOffsetList(e.slice().reverse()),this.endVector()}}});var ae=p(()=>{Eu();$d();Cw();Kd();qd()});var oi,Xd=p(()=>{(function(r){r[r.BUFFER=0]="BUFFER"})(oi||(oi={}))});var Qe,To=p(()=>{(function(r){r[r.LZ4_FRAME=0]="LZ4_FRAME",r[r.ZSTD=1]="ZSTD"})(Qe||(Qe={}))});var hn,Hd=p(()=>{ae();Xd();To();hn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBodyCompression(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBodyCompression(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}codec(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt8(this.bb_pos+e):Qe.LZ4_FRAME}method(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt8(this.bb_pos+e):oi.BUFFER}static startBodyCompression(e){e.startObject(2)}static addCodec(e,t){e.addFieldInt8(0,t,Qe.LZ4_FRAME)}static addMethod(e,t){e.addFieldInt8(1,t,oi.BUFFER)}static endBodyCompression(e){return e.endObject()}static createBodyCompression(e,t,n){return r.startBodyCompression(e),r.addCodec(e,t),r.addMethod(e,n),r.endBodyCompression(e)}}});var _o,Jd=p(()=>{_o=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createBuffer(e,t,n){return e.prep(8,16),e.writeInt64(BigInt(n??0)),e.writeInt64(BigInt(t??0)),e.offset()}}});var Ao,Yd=p(()=>{Ao=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createFieldNode(e,t,n){return e.prep(8,16),e.writeInt64(BigInt(n??0)),e.writeInt64(BigInt(t??0)),e.offset()}}});var st,Qd=p(()=>{ae();Hd();Jd();Yd();st=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsRecordBatch(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsRecordBatch(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}length(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}nodes(e,t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new Ao).__init(this.bb.__vector(this.bb_pos+n)+e*16,this.bb):null}nodesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}buffers(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new _o).__init(this.bb.__vector(this.bb_pos+n)+e*16,this.bb):null}buffersLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}compression(e){let t=this.bb.__offset(this.bb_pos,10);return t?(e||new hn).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}variadicBufferCounts(e){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+e*8):BigInt(0)}variadicBufferCountsLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startRecordBatch(e){e.startObject(5)}static addLength(e,t){e.addFieldInt64(0,t,BigInt("0"))}static addNodes(e,t){e.addFieldOffset(1,t,0)}static startNodesVector(e,t){e.startVector(16,t,8)}static addBuffers(e,t){e.addFieldOffset(2,t,0)}static startBuffersVector(e,t){e.startVector(16,t,8)}static addCompression(e,t){e.addFieldOffset(3,t,0)}static addVariadicBufferCounts(e,t){e.addFieldOffset(4,t,0)}static createVariadicBufferCountsVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startVariadicBufferCountsVector(e,t){e.startVector(8,t,8)}static endRecordBatch(e){return e.endObject()}}});var pn,Uw=p(()=>{ae();Qd();pn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDictionaryBatch(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryBatch(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}id(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}data(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new st).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}isDelta(){let e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startDictionaryBatch(e){e.startObject(3)}static addId(e,t){e.addFieldInt64(0,t,BigInt("0"))}static addData(e,t){e.addFieldOffset(1,t,0)}static addIsDelta(e,t){e.addFieldInt8(2,+t,0)}static endDictionaryBatch(e){return e.endObject()}}});var Kn,Zd=p(()=>{(function(r){r[r.Little=0]="Little",r[r.Big=1]="Big"})(Kn||(Kn={}))});var Va,Vw=p(()=>{(function(r){r[r.DenseArray=0]="DenseArray"})(Va||(Va={}))});var Sr,Ou=p(()=>{ae();Sr=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsInt(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInt(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}bitWidth(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}isSigned(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startInt(e){e.startObject(2)}static addBitWidth(e,t){e.addFieldInt32(0,t,0)}static addIsSigned(e,t){e.addFieldInt8(1,+t,0)}static endInt(e){return e.endObject()}static createInt(e,t,n){return r.startInt(e),r.addBitWidth(e,t),r.addIsSigned(e,n),r.endInt(e)}}});var Wr,eh=p(()=>{ae();Vw();Ou();Wr=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDictionaryEncoding(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryEncoding(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}id(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}indexType(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new Sr).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}isOrdered(){let e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}dictionaryKind(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt16(this.bb_pos+e):Va.DenseArray}static startDictionaryEncoding(e){e.startObject(4)}static addId(e,t){e.addFieldInt64(0,t,BigInt("0"))}static addIndexType(e,t){e.addFieldOffset(1,t,0)}static addIsOrdered(e,t){e.addFieldInt8(2,+t,0)}static addDictionaryKind(e,t){e.addFieldInt16(3,t,Va.DenseArray)}static endDictionaryEncoding(e){return e.endObject()}}});var Be,vo=p(()=>{ae();Be=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsKeyValue(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsKeyValue(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}key(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}value(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}static startKeyValue(e){e.startObject(2)}static addKey(e,t){e.addFieldOffset(0,t,0)}static addValue(e,t){e.addFieldOffset(1,t,0)}static endKeyValue(e){return e.endObject()}static createKeyValue(e,t,n){return r.startKeyValue(e),r.addKey(e,t),r.addValue(e,n),r.endKeyValue(e)}}});var Pa,Pw=p(()=>{ae();Pa=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBinary(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBinary(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startBinary(e){e.startObject(0)}static endBinary(e){return e.endObject()}static createBinary(e){return r.startBinary(e),r.endBinary(e)}}});var ja,jw=p(()=>{ae();ja=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBinaryView(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBinaryView(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startBinaryView(e){e.startObject(0)}static endBinaryView(e){return e.endObject()}static createBinaryView(e){return r.startBinaryView(e),r.endBinaryView(e)}}});var Ga,Gw=p(()=>{ae();Ga=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBool(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBool(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startBool(e){e.startObject(0)}static endBool(e){return e.endObject()}static createBool(e){return r.startBool(e),r.endBool(e)}}});var Xn,th=p(()=>{ae();zd();Xn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDate(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDate(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):ge.MILLISECOND}static startDate(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,ge.MILLISECOND)}static endDate(e){return e.endObject()}static createDate(e,t){return r.startDate(e),r.addUnit(e,t),r.endDate(e)}}});var $r,rh=p(()=>{ae();$r=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDecimal(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDecimal(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}scale(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):0}bitWidth(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt32(this.bb_pos+e):128}static startDecimal(e){e.startObject(3)}static addPrecision(e,t){e.addFieldInt32(0,t,0)}static addScale(e,t){e.addFieldInt32(1,t,0)}static addBitWidth(e,t){e.addFieldInt32(2,t,128)}static endDecimal(e){return e.endObject()}static createDecimal(e,t,n,s){return r.startDecimal(e),r.addPrecision(e,t),r.addScale(e,n),r.addBitWidth(e,s),r.endDecimal(e)}}});var Hn,nh=p(()=>{ae();Ca();Hn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDuration(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDuration(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):E.MILLISECOND}static startDuration(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,E.MILLISECOND)}static endDuration(e){return e.endObject()}static createDuration(e,t){return r.startDuration(e),r.addUnit(e,t),r.endDuration(e)}}});var Jn,sh=p(()=>{ae();Jn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFixedSizeBinary(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeBinary(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}byteWidth(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeBinary(e){e.startObject(1)}static addByteWidth(e,t){e.addFieldInt32(0,t,0)}static endFixedSizeBinary(e){return e.endObject()}static createFixedSizeBinary(e,t){return r.startFixedSizeBinary(e),r.addByteWidth(e,t),r.endFixedSizeBinary(e)}}});var Yn,ih=p(()=>{ae();Yn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFixedSizeList(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeList(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}listSize(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeList(e){e.startObject(1)}static addListSize(e,t){e.addFieldInt32(0,t,0)}static endFixedSizeList(e){return e.endObject()}static createFixedSizeList(e,t){return r.startFixedSizeList(e),r.addListSize(e,t),r.endFixedSizeList(e)}}});var Qn,oh=p(()=>{ae();Gd();Qn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFloatingPoint(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFloatingPoint(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):ue.HALF}static startFloatingPoint(e){e.startObject(1)}static addPrecision(e,t){e.addFieldInt16(0,t,ue.HALF)}static endFloatingPoint(e){return e.endObject()}static createFloatingPoint(e,t){return r.startFloatingPoint(e),r.addPrecision(e,t),r.endFloatingPoint(e)}}});var Zn,ah=p(()=>{ae();Wd();Zn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsInterval(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInterval(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):oe.YEAR_MONTH}static startInterval(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,oe.YEAR_MONTH)}static endInterval(e){return e.endObject()}static createInterval(e,t){return r.startInterval(e),r.addUnit(e,t),r.endInterval(e)}}});var za,zw=p(()=>{ae();za=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsLargeBinary(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeBinary(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startLargeBinary(e){e.startObject(0)}static endLargeBinary(e){return e.endObject()}static createLargeBinary(e){return r.startLargeBinary(e),r.endLargeBinary(e)}}});var Wa,Ww=p(()=>{ae();Wa=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsLargeList(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeList(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startLargeList(e){e.startObject(0)}static endLargeList(e){return e.endObject()}static createLargeList(e){return r.startLargeList(e),r.endLargeList(e)}}});var $a,$w=p(()=>{ae();$a=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsLargeUtf8(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeUtf8(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startLargeUtf8(e){e.startObject(0)}static endLargeUtf8(e){return e.endObject()}static createLargeUtf8(e){return r.startLargeUtf8(e),r.endLargeUtf8(e)}}});var qa,qw=p(()=>{ae();qa=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsList(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsList(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startList(e){e.startObject(0)}static endList(e){return e.endObject()}static createList(e){return r.startList(e),r.endList(e)}}});var es,ch=p(()=>{ae();es=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMap(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMap(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}keysSorted(){let e=this.bb.__offset(this.bb_pos,4);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startMap(e){e.startObject(1)}static addKeysSorted(e,t){e.addFieldInt8(0,+t,0)}static endMap(e){return e.endObject()}static createMap(e,t){return r.startMap(e),r.addKeysSorted(e,t),r.endMap(e)}}});var Ka,Kw=p(()=>{ae();Ka=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsNull(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsNull(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startNull(e){e.startObject(0)}static endNull(e){return e.endObject()}static createNull(e){return r.startNull(e),r.endNull(e)}}});var Xa,Xw=p(()=>{ae();Xa=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsStruct_(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsStruct_(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startStruct_(e){e.startObject(0)}static endStruct_(e){return e.endObject()}static createStruct_(e){return r.startStruct_(e),r.endStruct_(e)}}});var mn,uh=p(()=>{ae();Ca();mn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTime(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTime(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):E.MILLISECOND}bitWidth(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):32}static startTime(e){e.startObject(2)}static addUnit(e,t){e.addFieldInt16(0,t,E.MILLISECOND)}static addBitWidth(e,t){e.addFieldInt32(1,t,32)}static endTime(e){return e.endObject()}static createTime(e,t,n){return r.startTime(e),r.addUnit(e,t),r.addBitWidth(e,n),r.endTime(e)}}});var bn,fh=p(()=>{ae();Ca();bn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTimestamp(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTimestamp(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):E.SECOND}timezone(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}static startTimestamp(e){e.startObject(2)}static addUnit(e,t){e.addFieldInt16(0,t,E.SECOND)}static addTimezone(e,t){e.addFieldOffset(1,t,0)}static endTimestamp(e){return e.endObject()}static createTimestamp(e,t,n){return r.startTimestamp(e),r.addUnit(e,t),r.addTimezone(e,n),r.endTimestamp(e)}}});var Er,lh=p(()=>{ae();jd();Er=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUnion(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUnion(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}mode(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):de.Sparse}typeIds(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb.__vector(this.bb_pos+t)+e*4):0}typeIdsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}typeIdsArray(){let e=this.bb.__offset(this.bb_pos,6);return e?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}static startUnion(e){e.startObject(2)}static addMode(e,t){e.addFieldInt16(0,t,de.Sparse)}static addTypeIds(e,t){e.addFieldOffset(1,t,0)}static createTypeIdsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addInt32(t[n]);return e.endVector()}static startTypeIdsVector(e,t){e.startVector(4,t,4)}static endUnion(e){return e.endObject()}static createUnion(e,t,n){return r.startUnion(e),r.addMode(e,t),r.addTypeIds(e,n),r.endUnion(e)}}});var Ha,Hw=p(()=>{ae();Ha=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUtf8(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUtf8(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startUtf8(e){e.startObject(0)}static endUtf8(e){return e.endObject()}static createUtf8(e){return r.startUtf8(e),r.endUtf8(e)}}});var Ja,Jw=p(()=>{ae();Ja=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUtf8View(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUtf8View(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startUtf8View(e){e.startObject(0)}static endUtf8View(e){return e.endObject()}static createUtf8View(e){return r.startUtf8View(e),r.endUtf8View(e)}}});var G,Mu=p(()=>{(function(r){r[r.NONE=0]="NONE",r[r.Null=1]="Null",r[r.Int=2]="Int",r[r.FloatingPoint=3]="FloatingPoint",r[r.Binary=4]="Binary",r[r.Utf8=5]="Utf8",r[r.Bool=6]="Bool",r[r.Decimal=7]="Decimal",r[r.Date=8]="Date",r[r.Time=9]="Time",r[r.Timestamp=10]="Timestamp",r[r.Interval=11]="Interval",r[r.List=12]="List",r[r.Struct_=13]="Struct_",r[r.Union=14]="Union",r[r.FixedSizeBinary=15]="FixedSizeBinary",r[r.FixedSizeList=16]="FixedSizeList",r[r.Map=17]="Map",r[r.Duration=18]="Duration",r[r.LargeBinary=19]="LargeBinary",r[r.LargeUtf8=20]="LargeUtf8",r[r.LargeList=21]="LargeList",r[r.RunEndEncoded=22]="RunEndEncoded",r[r.BinaryView=23]="BinaryView",r[r.Utf8View=24]="Utf8View",r[r.ListView=25]="ListView",r[r.LargeListView=26]="LargeListView"})(G||(G={}))});var it,dh=p(()=>{ae();eh();vo();Mu();it=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsField(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsField(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}nullable(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}typeType(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):G.NONE}type(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__union(e,this.bb_pos+t):null}dictionary(e){let t=this.bb.__offset(this.bb_pos,12);return t?(e||new Wr).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}children(e,t){let n=this.bb.__offset(this.bb_pos,14);return n?(t||new r).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}childrenLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,16);return n?(t||new Be).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__vector_len(this.bb_pos+e):0}static startField(e){e.startObject(7)}static addName(e,t){e.addFieldOffset(0,t,0)}static addNullable(e,t){e.addFieldInt8(1,+t,0)}static addTypeType(e,t){e.addFieldInt8(2,t,G.NONE)}static addType(e,t){e.addFieldOffset(3,t,0)}static addDictionary(e,t){e.addFieldOffset(4,t,0)}static addChildren(e,t){e.addFieldOffset(5,t,0)}static createChildrenVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startChildrenVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(6,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endField(e){return e.endObject()}}});var Ot,hh=p(()=>{ae();Zd();dh();vo();Ot=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSchema(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSchema(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}endianness(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Kn.Little}fields(e,t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new it).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}fieldsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new Be).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}features(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+e*8):BigInt(0)}featuresLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSchema(e){e.startObject(4)}static addEndianness(e,t){e.addFieldInt16(0,t,Kn.Little)}static addFields(e,t){e.addFieldOffset(1,t,0)}static createFieldsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startFieldsVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(2,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static addFeatures(e,t){e.addFieldOffset(3,t,0)}static createFeaturesVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startFeaturesVector(e,t){e.startVector(8,t,8)}static endSchema(e){return e.endObject()}static createSchema(e,t,n,s,i){return r.startSchema(e),r.addEndianness(e,t),r.addFields(e,n),r.addCustomMetadata(e,s),r.addFeatures(e,i),r.endSchema(e)}}});var ne,Ru=p(()=>{(function(r){r[r.NONE=0]="NONE",r[r.Schema=1]="Schema",r[r.DictionaryBatch=2]="DictionaryBatch",r[r.RecordBatch=3]="RecordBatch",r[r.Tensor=4]="Tensor",r[r.SparseTensor=5]="SparseTensor"})(ne||(ne={}))});var y,te,Fe=p(()=>{Su();jd();Gd();zd();Ca();Wd();Ru();(function(r){r[r.NONE=0]="NONE",r[r.Null=1]="Null",r[r.Int=2]="Int",r[r.Float=3]="Float",r[r.Binary=4]="Binary",r[r.Utf8=5]="Utf8",r[r.Bool=6]="Bool",r[r.Decimal=7]="Decimal",r[r.Date=8]="Date",r[r.Time=9]="Time",r[r.Timestamp=10]="Timestamp",r[r.Interval=11]="Interval",r[r.List=12]="List",r[r.Struct=13]="Struct",r[r.Union=14]="Union",r[r.FixedSizeBinary=15]="FixedSizeBinary",r[r.FixedSizeList=16]="FixedSizeList",r[r.Map=17]="Map",r[r.Duration=18]="Duration",r[r.LargeBinary=19]="LargeBinary",r[r.LargeUtf8=20]="LargeUtf8",r[r.LargeList=21]="LargeList",r[r.BinaryView=23]="BinaryView",r[r.Utf8View=24]="Utf8View",r[r.Dictionary=-1]="Dictionary",r[r.Int8=-2]="Int8",r[r.Int16=-3]="Int16",r[r.Int32=-4]="Int32",r[r.Int64=-5]="Int64",r[r.Uint8=-6]="Uint8",r[r.Uint16=-7]="Uint16",r[r.Uint32=-8]="Uint32",r[r.Uint64=-9]="Uint64",r[r.Float16=-10]="Float16",r[r.Float32=-11]="Float32",r[r.Float64=-12]="Float64",r[r.DateDay=-13]="DateDay",r[r.DateMillisecond=-14]="DateMillisecond",r[r.TimestampSecond=-15]="TimestampSecond",r[r.TimestampMillisecond=-16]="TimestampMillisecond",r[r.TimestampMicrosecond=-17]="TimestampMicrosecond",r[r.TimestampNanosecond=-18]="TimestampNanosecond",r[r.TimeSecond=-19]="TimeSecond",r[r.TimeMillisecond=-20]="TimeMillisecond",r[r.TimeMicrosecond=-21]="TimeMicrosecond",r[r.TimeNanosecond=-22]="TimeNanosecond",r[r.DenseUnion=-23]="DenseUnion",r[r.SparseUnion=-24]="SparseUnion",r[r.IntervalDayTime=-25]="IntervalDayTime",r[r.IntervalYearMonth=-26]="IntervalYearMonth",r[r.DurationSecond=-27]="DurationSecond",r[r.DurationMillisecond=-28]="DurationMillisecond",r[r.DurationMicrosecond=-29]="DurationMicrosecond",r[r.DurationNanosecond=-30]="DurationNanosecond",r[r.IntervalMonthDayNano=-31]="IntervalMonthDayNano"})(y||(y={}));(function(r){r[r.OFFSET=0]="OFFSET",r[r.DATA=1]="DATA",r[r.VALIDITY=2]="VALIDITY",r[r.TYPE=3]="TYPE"})(te||(te={}))});var ph={};J(ph,{valueToString:()=>Lr});function Lr(r){if(r===null)return"null";if(r===void 0)return"undefined";switch(typeof r){case"number":return`${r}`;case"bigint":return`${r}`;case"string":return`"${r}"`}return typeof r[Symbol.toPrimitive]=="function"?r[Symbol.toPrimitive]("string"):ArrayBuffer.isView(r)?r instanceof BigInt64Array||r instanceof BigUint64Array?`[${[...r].map(e=>Lr(e))}]`:`[${r}]`:ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r,(e,t)=>typeof t=="bigint"?`${t}`:t)}var Ya=p(()=>{});function ee(r){if(typeof r=="bigint"&&(r<Number.MIN_SAFE_INTEGER||r>Number.MAX_SAFE_INTEGER))throw new TypeError(`${r} is not safe to convert to a number.`);return Number(r)}function mh(r,e){return ee(r/e)+ee(r%e)/ee(e)}var qr=p(()=>{});var yh={};J(yh,{BN:()=>ai,bigNumToBigInt:()=>Qw,bigNumToNumber:()=>gh,bigNumToString:()=>Eo,isArrowBigNumSymbol:()=>Yw});function Br(r,...e){return e.length===0?Object.setPrototypeOf(Z(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...e),this.constructor.prototype)}function Io(...r){return Br.apply(this,r)}function So(...r){return Br.apply(this,r)}function Qa(...r){return Br.apply(this,r)}function gh(r,e){let{buffer:t,byteOffset:n,byteLength:s,signed:i}=r,o=new BigUint64Array(t,n,s/8),a=i&&o.at(-1)&BigInt(1)<<BigInt(63),c=BigInt(0),u=0;if(a){for(let f of o)c|=(f^AB)*(BigInt(1)<<BigInt(64*u++));c*=BigInt(-1),c-=BigInt(1)}else for(let f of o)c|=f*(BigInt(1)<<BigInt(64*u++));if(typeof e=="number"&&e>0){let f=BigInt("1".padEnd(e+1,"0")),l=c/f,d=a?-(c%f):c%f,h=ee(l),m=`${d}`.padStart(e,"0");return+`${a&&h===0?"-":""}${h}.${m}`}return ee(c)}function Eo(r){if(r.byteLength===8)return`${new r.BigIntArray(r.buffer,r.byteOffset,1)[0]}`;if(!r.signed)return bh(r);let e=new Uint16Array(r.buffer,r.byteOffset,r.byteLength/2);if(new Int16Array([e.at(-1)])[0]>=0)return bh(r);e=e.slice();let n=1;for(let i=0;i<e.length;i++){let o=e[i],a=~o+n;e[i]=a,n&=o===0?1:0}return`-${bh(e)}`}function Qw(r){return r.byteLength===8?new r.BigIntArray(r.buffer,r.byteOffset,1)[0]:Eo(r)}function bh(r){let e="",t=new Uint32Array(2),n=new Uint16Array(r.buffer,r.byteOffset,r.byteLength/2),s=new Uint32Array((n=new Uint16Array(n).reverse()).buffer),i=-1,o=n.length-1;do{for(t[0]=n[i=0];i<o;)n[i++]=t[1]=t[0]/10,t[0]=(t[0]-t[1]*10<<16)+n[i];n[i]=t[1]=t[0]/10,t[0]=t[0]-t[1]*10,e=`${t[0]}${e}`}while(s[0]||s[1]||s[2]||s[3]);return e??"0"}var Yw,_B,AB,ai,Du=p(()=>{$e();qr();Yw=Symbol.for("isArrowBigNum");Br.prototype[Yw]=!0;Br.prototype.toJSON=function(){return`"${Eo(this)}"`};Br.prototype.valueOf=function(r){return gh(this,r)};Br.prototype.toString=function(){return Eo(this)};Br.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return gh(this);case"string":return Eo(this);case"default":return Qw(this)}return Eo(this)};Object.setPrototypeOf(Io.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(So.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(Qa.prototype,Object.create(Uint32Array.prototype));Object.assign(Io.prototype,Br.prototype,{constructor:Io,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(So.prototype,Br.prototype,{constructor:So,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(Qa.prototype,Br.prototype,{constructor:Qa,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});_B=BigInt(4294967296)*BigInt(4294967296),AB=_B-BigInt(1);ai=class r{static new(e,t){switch(t){case!0:return new Io(e);case!1:return new So(e)}switch(e.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new Io(e)}return e.byteLength===16?new Qa(e):new So(e)}static signed(e){return new Io(e)}static unsigned(e){return new So(e)}static decimal(e){return new Qa(e)}constructor(e,t){return r.new(e,t)}}});function rr(r){let e=r;switch(r.typeId){case y.Decimal:return r.bitWidth/32;case y.Interval:return e.unit===oe.MONTH_DAY_NANO?4:1+e.unit;case y.BinaryView:case y.Utf8View:return 16;case y.FixedSizeList:return e.listSize;case y.FixedSizeBinary:return e.byteWidth;default:return 1}}var Zw,ex,tx,rx,nx,sx,ix,ox,ax,cx,ux,fx,lx,dx,hx,px,mx,bx,gx,yx,wx,xx,Tx,_x,Ax,vx,S,De,Le,Ht,Jt,Ce,Yt,Qt,Zt,wt,Fr,ot,Or,xt,er,Mt,Q,Mr,at,Tt,Rr,ct,Rt,_t,ts,rs,Ze,ns,ss,is,os,et,as,Kr,cs,us,ut,fs,ls,Za,At,ec,tc,rc,nc,Ve,tr,he,vt,gn,ds,Dt,Ee,ft,vB,Pe,ye=p(()=>{qr();Fe();vx=Symbol.for("apache-arrow/DataType"),S=class r{static isDataType(e){return e?.[vx]===!0}static isNull(e){return e?.typeId===y.Null}static isInt(e){return e?.typeId===y.Int}static isFloat(e){return e?.typeId===y.Float}static isBinary(e){return e?.typeId===y.Binary}static isBinaryView(e){return e?.typeId===y.BinaryView}static isLargeBinary(e){return e?.typeId===y.LargeBinary}static isUtf8(e){return e?.typeId===y.Utf8}static isUtf8View(e){return e?.typeId===y.Utf8View}static isLargeUtf8(e){return e?.typeId===y.LargeUtf8}static isBool(e){return e?.typeId===y.Bool}static isDecimal(e){return e?.typeId===y.Decimal}static isDate(e){return e?.typeId===y.Date}static isTime(e){return e?.typeId===y.Time}static isTimestamp(e){return e?.typeId===y.Timestamp}static isInterval(e){return e?.typeId===y.Interval}static isDuration(e){return e?.typeId===y.Duration}static isList(e){return e?.typeId===y.List}static isLargeList(e){return e?.typeId===y.LargeList}static isStruct(e){return e?.typeId===y.Struct}static isUnion(e){return e?.typeId===y.Union}static isFixedSizeBinary(e){return e?.typeId===y.FixedSizeBinary}static isFixedSizeList(e){return e?.typeId===y.FixedSizeList}static isMap(e){return e?.typeId===y.Map}static isDictionary(e){return e?.typeId===y.Dictionary}static isDenseUnion(e){return r.isUnion(e)&&e.mode===de.Dense}static isSparseUnion(e){return r.isUnion(e)&&e.mode===de.Sparse}constructor(e){this.typeId=e}};Zw=Symbol.toStringTag;S[Zw]=(r=>(r.children=null,r.ArrayType=Array,r.OffsetArrayType=Int32Array,r[vx]=!0,r[Symbol.toStringTag]="DataType"))(S.prototype);De=class extends S{constructor(){super(y.Null)}toString(){return"Null"}};ex=Symbol.toStringTag;De[ex]=(r=>r[Symbol.toStringTag]="Null")(De.prototype);Le=class extends S{constructor(e,t){super(y.Int),this.isSigned=e,this.bitWidth=t}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}};tx=Symbol.toStringTag;Le[tx]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))(Le.prototype);Ht=class extends Le{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},Jt=class extends Le{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},Ce=class extends Le{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},Yt=class extends Le{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},Qt=class extends Le{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},Zt=class extends Le{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},wt=class extends Le{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},Fr=class extends Le{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Ht.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(Jt.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(Ce.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(Yt.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(Qt.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(Zt.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(wt.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Fr.prototype,"ArrayType",{value:BigUint64Array});ot=class extends S{constructor(e){super(y.Float),this.precision=e}get ArrayType(){switch(this.precision){case ue.HALF:return Uint16Array;case ue.SINGLE:return Float32Array;case ue.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};rx=Symbol.toStringTag;ot[rx]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(ot.prototype);Or=class extends ot{constructor(){super(ue.HALF)}},xt=class extends ot{constructor(){super(ue.SINGLE)}},er=class extends ot{constructor(){super(ue.DOUBLE)}};Object.defineProperty(Or.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(xt.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(er.prototype,"ArrayType",{value:Float64Array});Mt=class extends S{constructor(){super(y.Binary)}toString(){return"Binary"}};nx=Symbol.toStringTag;Mt[nx]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(Mt.prototype);Q=class extends S{constructor(){super(y.BinaryView)}toString(){return"BinaryView"}};sx=Symbol.toStringTag;Q.ELEMENT_WIDTH=16;Q.INLINE_CAPACITY=12;Q.LENGTH_OFFSET=0;Q.INLINE_OFFSET=4;Q.BUFFER_INDEX_OFFSET=8;Q.BUFFER_OFFSET_OFFSET=12;Q[sx]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="BinaryView"))(Q.prototype);Mr=class extends S{constructor(){super(y.LargeBinary)}toString(){return"LargeBinary"}};ix=Symbol.toStringTag;Mr[ix]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeBinary"))(Mr.prototype);at=class extends S{constructor(){super(y.Utf8)}toString(){return"Utf8"}};ox=Symbol.toStringTag;at[ox]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(at.prototype);Tt=class extends S{constructor(){super(y.Utf8View)}toString(){return"Utf8View"}};ax=Symbol.toStringTag;Tt.ELEMENT_WIDTH=Q.ELEMENT_WIDTH;Tt.INLINE_CAPACITY=Q.INLINE_CAPACITY;Tt[ax]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8View"))(Tt.prototype);Rr=class extends S{constructor(){super(y.LargeUtf8)}toString(){return"LargeUtf8"}};cx=Symbol.toStringTag;Rr[cx]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeUtf8"))(Rr.prototype);ct=class extends S{constructor(){super(y.Bool)}toString(){return"Bool"}};ux=Symbol.toStringTag;ct[ux]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(ct.prototype);Rt=class extends S{constructor(e,t,n=128){super(y.Decimal),this.scale=e,this.precision=t,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};fx=Symbol.toStringTag;Rt[fx]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(Rt.prototype);_t=class extends S{constructor(e){super(y.Date),this.unit=e}toString(){return`Date${(this.unit+1)*32}<${ge[this.unit]}>`}get ArrayType(){return this.unit===ge.DAY?Int32Array:BigInt64Array}};lx=Symbol.toStringTag;_t[lx]=(r=>(r.unit=null,r[Symbol.toStringTag]="Date"))(_t.prototype);ts=class extends _t{constructor(){super(ge.DAY)}},rs=class extends _t{constructor(){super(ge.MILLISECOND)}},Ze=class extends S{constructor(e,t){super(y.Time),this.unit=e,this.bitWidth=t}toString(){return`Time${this.bitWidth}<${E[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};dx=Symbol.toStringTag;Ze[dx]=(r=>(r.unit=null,r.bitWidth=null,r[Symbol.toStringTag]="Time"))(Ze.prototype);ns=class extends Ze{constructor(){super(E.SECOND,32)}},ss=class extends Ze{constructor(){super(E.MILLISECOND,32)}},is=class extends Ze{constructor(){super(E.MICROSECOND,64)}},os=class extends Ze{constructor(){super(E.NANOSECOND,64)}},et=class extends S{constructor(e,t){super(y.Timestamp),this.unit=e,this.timezone=t}toString(){return`Timestamp<${E[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};hx=Symbol.toStringTag;et[hx]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Timestamp"))(et.prototype);as=class extends et{constructor(e){super(E.SECOND,e)}},Kr=class extends et{constructor(e){super(E.MILLISECOND,e)}},cs=class extends et{constructor(e){super(E.MICROSECOND,e)}},us=class extends et{constructor(e){super(E.NANOSECOND,e)}},ut=class extends S{constructor(e){super(y.Interval),this.unit=e}toString(){return`Interval<${oe[this.unit]}>`}};px=Symbol.toStringTag;ut[px]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(ut.prototype);fs=class extends ut{constructor(){super(oe.DAY_TIME)}},ls=class extends ut{constructor(){super(oe.YEAR_MONTH)}},Za=class extends ut{constructor(){super(oe.MONTH_DAY_NANO)}},At=class extends S{constructor(e){super(y.Duration),this.unit=e}toString(){return`Duration<${E[this.unit]}>`}};mx=Symbol.toStringTag;At[mx]=(r=>(r.unit=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Duration"))(At.prototype);ec=class extends At{constructor(){super(E.SECOND)}},tc=class extends At{constructor(){super(E.MILLISECOND)}},rc=class extends At{constructor(){super(E.MICROSECOND)}},nc=class extends At{constructor(){super(E.NANOSECOND)}},Ve=class extends S{constructor(e){super(y.List),this.children=[e]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};bx=Symbol.toStringTag;Ve[bx]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(Ve.prototype);tr=class extends S{constructor(e){super(y.LargeList),this.children=[e]}toString(){return`LargeList<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};gx=Symbol.toStringTag;tr[gx]=(r=>(r.children=null,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeList"))(tr.prototype);he=class extends S{constructor(e){super(y.Struct),this.children=e}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}};yx=Symbol.toStringTag;he[yx]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(he.prototype);vt=class extends S{constructor(e,t,n){super(y.Union),this.mode=e,this.children=n,this.typeIds=t=Int32Array.from(t),this.typeIdToChildIndex=t.reduce((s,i,o)=>(s[i]=o)&&s||s,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(e=>`${e.type}`).join(" | ")}>`}};wx=Symbol.toStringTag;vt[wx]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))(vt.prototype);gn=class extends vt{constructor(e,t){super(de.Dense,e,t)}},ds=class extends vt{constructor(e,t){super(de.Sparse,e,t)}},Dt=class extends S{constructor(e){super(y.FixedSizeBinary),this.byteWidth=e}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};xx=Symbol.toStringTag;Dt[xx]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(Dt.prototype);Ee=class extends S{constructor(e,t){super(y.FixedSizeList),this.listSize=e,this.children=[t]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};Tx=Symbol.toStringTag;Ee[Tx]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(Ee.prototype);ft=class extends S{constructor(e,t=!1){var n,s,i;if(super(y.Map),this.children=[e],this.keysSorted=t,e&&(e.name="entries",!((n=e?.type)===null||n===void 0)&&n.children)){let o=(s=e?.type)===null||s===void 0?void 0:s.children[0];o&&(o.name="key");let a=(i=e?.type)===null||i===void 0?void 0:i.children[1];a&&(a.name="value")}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}};_x=Symbol.toStringTag;ft[_x]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(ft.prototype);vB=(r=>()=>++r)(-1),Pe=class extends S{constructor(e,t,n,s){super(y.Dictionary),this.indices=t,this.dictionary=e,this.isOrdered=s||!1,this.id=n==null?vB():ee(n)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};Ax=Symbol.toStringTag;Pe[Ax]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(Pe.prototype)});function IB(r,e,t=!0){return typeof e=="number"?Lo(r,e,t):typeof e=="string"&&e in y?Lo(r,y[e],t):e&&e instanceof S?Lo(r,Sx(e),t):e?.type&&e.type instanceof S?Lo(r,Sx(e.type),t):Lo(r,y.NONE,t)}function Lo(r,e,t=!0){let n=null;switch(e){case y.Null:n=r.visitNull;break;case y.Bool:n=r.visitBool;break;case y.Int:n=r.visitInt;break;case y.Int8:n=r.visitInt8||r.visitInt;break;case y.Int16:n=r.visitInt16||r.visitInt;break;case y.Int32:n=r.visitInt32||r.visitInt;break;case y.Int64:n=r.visitInt64||r.visitInt;break;case y.Uint8:n=r.visitUint8||r.visitInt;break;case y.Uint16:n=r.visitUint16||r.visitInt;break;case y.Uint32:n=r.visitUint32||r.visitInt;break;case y.Uint64:n=r.visitUint64||r.visitInt;break;case y.Float:n=r.visitFloat;break;case y.Float16:n=r.visitFloat16||r.visitFloat;break;case y.Float32:n=r.visitFloat32||r.visitFloat;break;case y.Float64:n=r.visitFloat64||r.visitFloat;break;case y.Utf8:n=r.visitUtf8;break;case y.LargeUtf8:n=r.visitLargeUtf8;break;case y.Utf8View:n=r.visitUtf8View||r.visitUtf8;break;case y.Binary:n=r.visitBinary;break;case y.LargeBinary:n=r.visitLargeBinary;break;case y.BinaryView:n=r.visitBinaryView||r.visitBinary;break;case y.FixedSizeBinary:n=r.visitFixedSizeBinary;break;case y.Date:n=r.visitDate;break;case y.DateDay:n=r.visitDateDay||r.visitDate;break;case y.DateMillisecond:n=r.visitDateMillisecond||r.visitDate;break;case y.Timestamp:n=r.visitTimestamp;break;case y.TimestampSecond:n=r.visitTimestampSecond||r.visitTimestamp;break;case y.TimestampMillisecond:n=r.visitTimestampMillisecond||r.visitTimestamp;break;case y.TimestampMicrosecond:n=r.visitTimestampMicrosecond||r.visitTimestamp;break;case y.TimestampNanosecond:n=r.visitTimestampNanosecond||r.visitTimestamp;break;case y.Time:n=r.visitTime;break;case y.TimeSecond:n=r.visitTimeSecond||r.visitTime;break;case y.TimeMillisecond:n=r.visitTimeMillisecond||r.visitTime;break;case y.TimeMicrosecond:n=r.visitTimeMicrosecond||r.visitTime;break;case y.TimeNanosecond:n=r.visitTimeNanosecond||r.visitTime;break;case y.Decimal:n=r.visitDecimal;break;case y.List:n=r.visitList;break;case y.LargeList:n=r.visitLargeList;break;case y.Struct:n=r.visitStruct;break;case y.Union:n=r.visitUnion;break;case y.DenseUnion:n=r.visitDenseUnion||r.visitUnion;break;case y.SparseUnion:n=r.visitSparseUnion||r.visitUnion;break;case y.Dictionary:n=r.visitDictionary;break;case y.Interval:n=r.visitInterval;break;case y.IntervalDayTime:n=r.visitIntervalDayTime||r.visitInterval;break;case y.IntervalYearMonth:n=r.visitIntervalYearMonth||r.visitInterval;break;case y.IntervalMonthDayNano:n=r.visitIntervalMonthDayNano||r.visitInterval;break;case y.Duration:n=r.visitDuration;break;case y.DurationSecond:n=r.visitDurationSecond||r.visitDuration;break;case y.DurationMillisecond:n=r.visitDurationMillisecond||r.visitDuration;break;case y.DurationMicrosecond:n=r.visitDurationMicrosecond||r.visitDuration;break;case y.DurationNanosecond:n=r.visitDurationNanosecond||r.visitDuration;break;case y.FixedSizeList:n=r.visitFixedSizeList;break;case y.Map:n=r.visitMap;break}if(typeof n=="function")return n;if(!t)return()=>null;throw new Error(`Unrecognized type '${y[e]}'`)}function Sx(r){switch(r.typeId){case y.Null:return y.Null;case y.Int:{let{bitWidth:e,isSigned:t}=r;switch(e){case 8:return t?y.Int8:y.Uint8;case 16:return t?y.Int16:y.Uint16;case 32:return t?y.Int32:y.Uint32;case 64:return t?y.Int64:y.Uint64}return y.Int}case y.Float:switch(r.precision){case ue.HALF:return y.Float16;case ue.SINGLE:return y.Float32;case ue.DOUBLE:return y.Float64}return y.Float;case y.Binary:return y.Binary;case y.LargeBinary:return y.LargeBinary;case y.BinaryView:return y.BinaryView;case y.Utf8:return y.Utf8;case y.LargeUtf8:return y.LargeUtf8;case y.Utf8View:return y.Utf8View;case y.Bool:return y.Bool;case y.Decimal:return y.Decimal;case y.Time:switch(r.unit){case E.SECOND:return y.TimeSecond;case E.MILLISECOND:return y.TimeMillisecond;case E.MICROSECOND:return y.TimeMicrosecond;case E.NANOSECOND:return y.TimeNanosecond}return y.Time;case y.Timestamp:switch(r.unit){case E.SECOND:return y.TimestampSecond;case E.MILLISECOND:return y.TimestampMillisecond;case E.MICROSECOND:return y.TimestampMicrosecond;case E.NANOSECOND:return y.TimestampNanosecond}return y.Timestamp;case y.Date:switch(r.unit){case ge.DAY:return y.DateDay;case ge.MILLISECOND:return y.DateMillisecond}return y.Date;case y.Interval:switch(r.unit){case oe.DAY_TIME:return y.IntervalDayTime;case oe.YEAR_MONTH:return y.IntervalYearMonth;case oe.MONTH_DAY_NANO:return y.IntervalMonthDayNano}return y.Interval;case y.Duration:switch(r.unit){case E.SECOND:return y.DurationSecond;case E.MILLISECOND:return y.DurationMillisecond;case E.MICROSECOND:return y.DurationMicrosecond;case E.NANOSECOND:return y.DurationNanosecond}return y.Duration;case y.Map:return y.Map;case y.List:return y.List;case y.LargeList:return y.LargeList;case y.Struct:return y.Struct;case y.Union:switch(r.mode){case de.Dense:return y.DenseUnion;case de.Sparse:return y.SparseUnion}return y.Union;case y.FixedSizeBinary:return y.FixedSizeBinary;case y.FixedSizeList:return y.FixedSizeList;case y.Dictionary:return y.Dictionary}throw new Error(`Unrecognized type '${y[r.typeId]}'`)}var R,Nt=p(()=>{Fe();ye();R=class{visitMany(e,...t){return e.map((n,s)=>this.visit(n,...t.map(i=>i[s])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,t=!0){return IB(this,e,t)}getVisitFnByTypeId(e,t=!0){return Lo(this,e,t)}visitNull(e,...t){return null}visitBool(e,...t){return null}visitInt(e,...t){return null}visitFloat(e,...t){return null}visitUtf8(e,...t){return null}visitLargeUtf8(e,...t){return null}visitUtf8View(e,...t){return null}visitBinary(e,...t){return null}visitLargeBinary(e,...t){return null}visitBinaryView(e,...t){return null}visitFixedSizeBinary(e,...t){return null}visitDate(e,...t){return null}visitTimestamp(e,...t){return null}visitTime(e,...t){return null}visitDecimal(e,...t){return null}visitList(e,...t){return null}visitLargeList(e,...t){return null}visitStruct(e,...t){return null}visitUnion(e,...t){return null}visitDictionary(e,...t){return null}visitInterval(e,...t){return null}visitDuration(e,...t){return null}visitFixedSizeList(e,...t){return null}visitMap(e,...t){return null}};R.prototype.visitInt8=null;R.prototype.visitInt16=null;R.prototype.visitInt32=null;R.prototype.visitInt64=null;R.prototype.visitUint8=null;R.prototype.visitUint16=null;R.prototype.visitUint32=null;R.prototype.visitUint64=null;R.prototype.visitFloat16=null;R.prototype.visitFloat32=null;R.prototype.visitFloat64=null;R.prototype.visitDateDay=null;R.prototype.visitDateMillisecond=null;R.prototype.visitTimestampSecond=null;R.prototype.visitTimestampMillisecond=null;R.prototype.visitTimestampMicrosecond=null;R.prototype.visitTimestampNanosecond=null;R.prototype.visitTimeSecond=null;R.prototype.visitTimeMillisecond=null;R.prototype.visitTimeMicrosecond=null;R.prototype.visitTimeNanosecond=null;R.prototype.visitDenseUnion=null;R.prototype.visitSparseUnion=null;R.prototype.visitIntervalDayTime=null;R.prototype.visitIntervalYearMonth=null;R.prototype.visitIntervalMonthDayNano=null;R.prototype.visitDuration=null;R.prototype.visitDurationSecond=null;R.prototype.visitDurationMillisecond=null;R.prototype.visitDurationMicrosecond=null;R.prototype.visitDurationNanosecond=null});var wh={};J(wh,{float64ToUint16:()=>sc,uint16ToFloat64:()=>Nu});function Nu(r){let e=(r&31744)>>10,t=(r&1023)/1024,n=Math.pow(-1,(r&32768)>>15);switch(e){case 31:return n*(t?Number.NaN:1/0);case 0:return n*(t?6103515625e-14*t:0)}return n*Math.pow(2,e-15)*(1+t)}function sc(r){if(r!==r)return 32256;Ex[0]=r;let e=(Bo[1]&2147483648)>>16&65535,t=Bo[1]&2146435072,n=0;return t>=1089470464?Bo[0]>0?t=31744:(t=(t&2080374784)>>16,n=(Bo[1]&1048575)>>10):t<=1056964608?(n=1048576+(Bo[1]&1048575),n=1048576+(n<<(t>>20)-998)>>21,t=0):(t=t-1056964608>>10,n=(Bo[1]&1048575)+512>>10),e|t|n&65535}var Ex,Bo,ic=p(()=>{Ex=new Float64Array(1),Bo=new Uint32Array(Ex.buffer)});function $(r){return(e,t,n)=>{if(e.setValid(t,n!=null))return r(e,t,n)}}var j,SB,Lx,EB,yn,xh,Bx,LB,ku,Cu,Th,Fx,BB,Ox,FB,Mx,OB,_h,Uu,Vu,Pu,ju,Ah,Gu,zu,Wu,$u,vh,Ih,Rx,MB,RB,DB,NB,kB,CB,UB,Dx,Nx,VB,Sh,qu,Ku,Xu,Hu,Ju,Yu,Qu,Eh,PB,tt,nr=p(()=>{lt();Nt();qr();dn();ic();Fe();ye();j=class extends R{};SB=(r,e,t)=>{r[e]=Math.floor(t/864e5)},Lx=(r,e,t,n)=>{if(t+1<e.length){let s=ee(e[t]),i=ee(e[t+1]);r.set(n.subarray(0,i-s),s)}},EB=({offset:r,values:e},t,n)=>{let s=r+t;n?e[s>>3]|=1<<s%8:e[s>>3]&=~(1<<s%8)},yn=({values:r},e,t)=>{r[e]=t},xh=({values:r},e,t)=>{r[e]=t},Bx=({values:r},e,t)=>{r[e]=sc(t)},LB=(r,e,t)=>{switch(r.type.precision){case ue.HALF:return Bx(r,e,t);case ue.SINGLE:case ue.DOUBLE:return xh(r,e,t)}},ku=({values:r},e,t)=>{SB(r,e,t.valueOf())},Cu=({values:r},e,t)=>{r[e]=BigInt(t)},Th=({stride:r,values:e},t,n)=>{e.set(n.subarray(0,r),r*t)},Fx=({values:r,valueOffsets:e},t,n)=>Lx(r,e,t,n),BB=r=>{let e=r.variadicBuffers;return(!Array.isArray(e)||Object.isFrozen(e))&&(e=Array.from(e),r.variadicBuffers=e),e},Ox=(r,e,t)=>{var n,s,i,o;let a=r.values;if(!a)throw new Error("BinaryView data is missing view buffer");let c=Q.ELEMENT_WIDTH,u=e*c,f=u+c;if(u<0||f>a.length)throw new RangeError(`BinaryView index ${e} out of bounds`);a.fill(0,u,f);let l=new DataView(a.buffer,a.byteOffset+u,c),d=t.length;if(l.setInt32(Q.LENGTH_OFFSET,d,!0),d<=Q.INLINE_CAPACITY){a.set(t,u+Q.INLINE_OFFSET);return}let h=((n=t[0])!==null&&n!==void 0?n:0)|((s=t[1])!==null&&s!==void 0?s:0)<<8|((i=t[2])!==null&&i!==void 0?i:0)<<16|((o=t[3])!==null&&o!==void 0?o:0)<<24;l.setUint32(Q.INLINE_OFFSET,h>>>0,!0);let m=BB(r),b=t.slice(),w=m.push(b)-1;l.setInt32(Q.BUFFER_INDEX_OFFSET,w,!0),l.setInt32(Q.BUFFER_OFFSET_OFFSET,0,!0)},FB=(r,e,t)=>{let n=t instanceof Uint8Array?t:new Uint8Array(t);Ox(r,e,n)},Mx=({values:r,valueOffsets:e},t,n)=>Lx(r,e,t,qt(n)),OB=(r,e,t)=>{let n=qt(t);Ox(r,e,n)},_h=(r,e,t)=>{r.type.unit===ge.DAY?ku(r,e,t):Cu(r,e,t)},Uu=({values:r},e,t)=>{r[e]=BigInt(t/1e3)},Vu=({values:r},e,t)=>{r[e]=BigInt(t)},Pu=({values:r},e,t)=>{r[e]=BigInt(t*1e3)},ju=({values:r},e,t)=>{r[e]=BigInt(t*1e6)},Ah=(r,e,t)=>{switch(r.type.unit){case E.SECOND:return Uu(r,e,t);case E.MILLISECOND:return Vu(r,e,t);case E.MICROSECOND:return Pu(r,e,t);case E.NANOSECOND:return ju(r,e,t)}},Gu=({values:r},e,t)=>{r[e]=t},zu=({values:r},e,t)=>{r[e]=t},Wu=({values:r},e,t)=>{r[e]=t},$u=({values:r},e,t)=>{r[e]=t},vh=(r,e,t)=>{switch(r.type.unit){case E.SECOND:return Gu(r,e,t);case E.MILLISECOND:return zu(r,e,t);case E.MICROSECOND:return Wu(r,e,t);case E.NANOSECOND:return $u(r,e,t)}},Ih=({values:r,stride:e},t,n)=>{r.set(n.subarray(0,e),e*t)},Rx=(r,e,t)=>{let n=r.children[0],s=r.valueOffsets,i=tt.getVisitFn(n),o=ee(s[e]),a=ee(s[e+1]);if(Array.isArray(t))for(let c=-1,u=o;u<a;)i(n,u++,t[++c]);else for(let c=-1,u=o;u<a;)i(n,u++,t.get(++c))},MB=(r,e,t)=>{let n=r.children[0],{valueOffsets:s}=r,i=tt.getVisitFn(n),{[e]:o,[e+1]:a}=s,c=t instanceof Map?t.entries():Object.entries(t);for(let u of c)if(i(n,o,u),++o>=a)break},RB=(r,e)=>(t,n,s,i)=>n&&t(n,r,e[i]),DB=(r,e)=>(t,n,s,i)=>n&&t(n,r,e.get(i)),NB=(r,e)=>(t,n,s,i)=>n&&t(n,r,e.get(s.name)),kB=(r,e)=>(t,n,s,i)=>n&&t(n,r,e[s.name]),CB=(r,e,t)=>{let n=r.type.children.map(i=>tt.getVisitFn(i.type)),s=t instanceof Map?NB(e,t):t instanceof L?DB(e,t):Array.isArray(t)?RB(e,t):kB(e,t);r.type.children.forEach((i,o)=>s(n[o],r.children[o],i,o))},UB=(r,e,t)=>{r.type.mode===de.Dense?Dx(r,e,t):Nx(r,e,t)},Dx=(r,e,t)=>{let n=r.type.typeIdToChildIndex[r.typeIds[e]],s=r.children[n];tt.visit(s,r.valueOffsets[e],t)},Nx=(r,e,t)=>{let n=r.type.typeIdToChildIndex[r.typeIds[e]],s=r.children[n];tt.visit(s,e,t)},VB=(r,e,t)=>{var n;(n=r.dictionary)===null||n===void 0||n.set(r.values[e],t)},Sh=(r,e,t)=>{switch(r.type.unit){case oe.YEAR_MONTH:return Ku(r,e,t);case oe.DAY_TIME:return qu(r,e,t);case oe.MONTH_DAY_NANO:return Xu(r,e,t)}},qu=({values:r},e,t)=>{r.set(t.subarray(0,2),2*e)},Ku=({values:r},e,t)=>{r[e]=t[0]*12+t[1]%12},Xu=({values:r,stride:e},t,n)=>{r.set(n.subarray(0,e),e*t)},Hu=({values:r},e,t)=>{r[e]=t},Ju=({values:r},e,t)=>{r[e]=t},Yu=({values:r},e,t)=>{r[e]=t},Qu=({values:r},e,t)=>{r[e]=t},Eh=(r,e,t)=>{switch(r.type.unit){case E.SECOND:return Hu(r,e,t);case E.MILLISECOND:return Ju(r,e,t);case E.MICROSECOND:return Yu(r,e,t);case E.NANOSECOND:return Qu(r,e,t)}},PB=(r,e,t)=>{let{stride:n}=r,s=r.children[0],i=tt.getVisitFn(s);if(Array.isArray(t))for(let o=-1,a=e*n;++o<n;)i(s,a+o,t[o]);else for(let o=-1,a=e*n;++o<n;)i(s,a+o,t.get(o))};j.prototype.visitBool=$(EB);j.prototype.visitInt=$(yn);j.prototype.visitInt8=$(yn);j.prototype.visitInt16=$(yn);j.prototype.visitInt32=$(yn);j.prototype.visitInt64=$(yn);j.prototype.visitUint8=$(yn);j.prototype.visitUint16=$(yn);j.prototype.visitUint32=$(yn);j.prototype.visitUint64=$(yn);j.prototype.visitFloat=$(LB);j.prototype.visitFloat16=$(Bx);j.prototype.visitFloat32=$(xh);j.prototype.visitFloat64=$(xh);j.prototype.visitUtf8=$(Mx);j.prototype.visitLargeUtf8=$(Mx);j.prototype.visitUtf8View=$(OB);j.prototype.visitBinary=$(Fx);j.prototype.visitLargeBinary=$(Fx);j.prototype.visitBinaryView=$(FB);j.prototype.visitFixedSizeBinary=$(Th);j.prototype.visitDate=$(_h);j.prototype.visitDateDay=$(ku);j.prototype.visitDateMillisecond=$(Cu);j.prototype.visitTimestamp=$(Ah);j.prototype.visitTimestampSecond=$(Uu);j.prototype.visitTimestampMillisecond=$(Vu);j.prototype.visitTimestampMicrosecond=$(Pu);j.prototype.visitTimestampNanosecond=$(ju);j.prototype.visitTime=$(vh);j.prototype.visitTimeSecond=$(Gu);j.prototype.visitTimeMillisecond=$(zu);j.prototype.visitTimeMicrosecond=$(Wu);j.prototype.visitTimeNanosecond=$($u);j.prototype.visitDecimal=$(Ih);j.prototype.visitList=$(Rx);j.prototype.visitLargeList=$(Rx);j.prototype.visitStruct=$(CB);j.prototype.visitUnion=$(UB);j.prototype.visitDenseUnion=$(Dx);j.prototype.visitSparseUnion=$(Nx);j.prototype.visitDictionary=$(VB);j.prototype.visitInterval=$(Sh);j.prototype.visitIntervalDayTime=$(qu);j.prototype.visitIntervalYearMonth=$(Ku);j.prototype.visitIntervalMonthDayNano=$(Xu);j.prototype.visitDuration=$(Eh);j.prototype.visitDurationSecond=$(Hu);j.prototype.visitDurationMillisecond=$(Ju);j.prototype.visitDurationMicrosecond=$(Yu);j.prototype.visitDurationNanosecond=$(Qu);j.prototype.visitFixedSizeList=$(PB);j.prototype.visitMap=$(MB);tt=new j});var Dr,Fo,Xr,Lh,Bh,jB,Zu=p(()=>{Ya();ci();nr();Dr=Symbol.for("parent"),Fo=Symbol.for("rowIndex"),Xr=class{constructor(e,t){return this[Dr]=e,this[Fo]=t,new Proxy(this,jB)}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[Fo],t=this[Dr],n=t.type.children,s={};for(let i=-1,o=n.length;++i<o;)s[n[i].name]=je.visit(t.children[i],e);return s}toString(){return`{${[...this].map(([e,t])=>`${Lr(e)}: ${Lr(t)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new Lh(this[Dr],this[Fo])}},Lh=class{constructor(e,t){this.childIndex=0,this.children=e.children,this.rowIndex=t,this.childFields=e.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let e=this.childIndex;return e<this.numChildren?(this.childIndex=e+1,{done:!1,value:[this.childFields[e].name,je.visit(this.children[e],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(Xr.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Dr]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Fo]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});Bh=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[Dr].type.children.map(t=>t.name)}has(e,t){return e[Dr].type.children.some(n=>n.name===t)}getOwnPropertyDescriptor(e,t){if(e[Dr].type.children.some(n=>n.name===t))return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[Dr].type.children.findIndex(s=>s.name===t);if(n!==-1){let s=je.visit(e[Dr].children[n],e[Fo]);return Reflect.set(e,t,s),s}}set(e,t,n){let s=e[Dr].type.children.findIndex(i=>i.name===t);return s!==-1?(tt.visit(e[Dr].children[s],e[Fo],n),Reflect.set(e,t,n)):Reflect.has(e,t)||typeof t=="symbol"?Reflect.set(e,t,n):!1}},jB=new Bh});function z(r){return(e,t)=>e.getValid(t)?r(e,t):null}var C,GB,Oo,zB,WB,kx,$B,Cx,Ux,hs,qB,Vx,KB,Px,jx,XB,Gx,HB,JB,YB,QB,zx,Wx,$x,qx,ZB,Kx,Xx,Hx,Jx,eF,tF,Yx,rF,nF,sF,Qx,Zx,iF,oF,eT,tT,rT,nT,sT,iT,oT,aF,cF,je,ci=p(()=>{Du();lt();Nt();oc();Zu();qr();dn();ic();Fe();C=class extends R{};GB=(r,e)=>864e5*r[e],Oo=16,zB=12,WB=(r,e)=>null,kx=(r,e,t)=>{if(t+1>=e.length)return null;let n=ee(e[t]),s=ee(e[t+1]);return r.subarray(n,s)},$B=({offset:r,values:e},t)=>{let n=r+t;return(e[n>>3]&1<<n%8)!==0},Cx=({values:r},e)=>GB(r,e),Ux=({values:r},e)=>ee(r[e]),hs=({stride:r,values:e},t)=>e[r*t],qB=({stride:r,values:e},t)=>Nu(e[r*t]),Vx=({values:r},e)=>r[e],KB=({stride:r,values:e},t)=>e.subarray(r*t,r*(t+1)),Px=({values:r,valueOffsets:e},t)=>kx(r,e,t),jx=(r,e)=>{var t;let n=r.values;if(!n)throw new Error("BinaryView data is missing view buffer");let s=e*Oo,i=s+Oo;if(s<0||i>n.length)throw new Error(`BinaryView data buffer is too short: expected ${Oo} bytes, got ${Math.max(0,n.length-s)}`);let o=n.subarray(s,i);if(o.length<Oo)throw new Error(`BinaryView data buffer is too short: expected ${Oo} bytes, got ${o.length}`);let a=new DataView(n.buffer,o.byteOffset,Oo),c=a.getInt32(0,!0);if(c<=0)return new Uint8Array(0);if(c<=zB)return o.subarray(4,4+c);let u=a.getInt32(8,!0),f=a.getInt32(12,!0),l=(t=r.variadicBuffers)===null||t===void 0?void 0:t[u];if(!l)throw new Error(`BinaryView variadic buffer ${u} is missing`);return l.subarray(f,f+c)},XB=(r,e)=>jx(r,e),Gx=({values:r,valueOffsets:e},t)=>{let n=kx(r,e,t);return n!==null?wo(n):null},HB=(r,e)=>{let t=jx(r,e);return wo(t)},JB=({values:r},e)=>r[e],YB=({type:r,values:e},t)=>r.precision!==ue.HALF?e[t]:Nu(e[t]),QB=(r,e)=>r.type.unit===ge.DAY?Cx(r,e):Ux(r,e),zx=({values:r},e)=>1e3*ee(r[e]),Wx=({values:r},e)=>ee(r[e]),$x=({values:r},e)=>mh(r[e],BigInt(1e3)),qx=({values:r},e)=>mh(r[e],BigInt(1e6)),ZB=(r,e)=>{switch(r.type.unit){case E.SECOND:return zx(r,e);case E.MILLISECOND:return Wx(r,e);case E.MICROSECOND:return $x(r,e);case E.NANOSECOND:return qx(r,e)}},Kx=({values:r},e)=>r[e],Xx=({values:r},e)=>r[e],Hx=({values:r},e)=>r[e],Jx=({values:r},e)=>r[e],eF=(r,e)=>{switch(r.type.unit){case E.SECOND:return Kx(r,e);case E.MILLISECOND:return Xx(r,e);case E.MICROSECOND:return Hx(r,e);case E.NANOSECOND:return Jx(r,e)}},tF=({values:r,stride:e},t)=>ai.decimal(r.subarray(e*t,e*(t+1))),Yx=(r,e)=>{let{valueOffsets:t,stride:n,children:s}=r,i=ee(t[e*n]),o=ee(t[e*n+1]),c=s[0].slice(i,o-i);return new L([c])},rF=(r,e)=>{let{valueOffsets:t,children:n}=r,{[e]:s,[e+1]:i}=t,o=n[0];return new mr(o.slice(s,i-s))},nF=(r,e)=>new Xr(r,e),sF=(r,e)=>r.type.mode===de.Dense?Qx(r,e):Zx(r,e),Qx=(r,e)=>{let t=r.type.typeIdToChildIndex[r.typeIds[e]],n=r.children[t];return je.visit(n,r.valueOffsets[e])},Zx=(r,e)=>{let t=r.type.typeIdToChildIndex[r.typeIds[e]],n=r.children[t];return je.visit(n,e)},iF=(r,e)=>{var t;return(t=r.dictionary)===null||t===void 0?void 0:t.get(r.values[e])},oF=(r,e)=>r.type.unit===oe.MONTH_DAY_NANO?rT(r,e):r.type.unit===oe.DAY_TIME?eT(r,e):tT(r,e),eT=({values:r},e)=>r.subarray(2*e,2*(e+1)),tT=({values:r},e)=>{let t=r[e],n=new Int32Array(2);return n[0]=Math.trunc(t/12),n[1]=Math.trunc(t%12),n},rT=({values:r},e)=>r.subarray(4*e,4*(e+1)),nT=({values:r},e)=>r[e],sT=({values:r},e)=>r[e],iT=({values:r},e)=>r[e],oT=({values:r},e)=>r[e],aF=(r,e)=>{switch(r.type.unit){case E.SECOND:return nT(r,e);case E.MILLISECOND:return sT(r,e);case E.MICROSECOND:return iT(r,e);case E.NANOSECOND:return oT(r,e)}},cF=(r,e)=>{let{stride:t,children:n}=r,i=n[0].slice(e*t,t);return new L([i])};C.prototype.visitNull=z(WB);C.prototype.visitBool=z($B);C.prototype.visitInt=z(JB);C.prototype.visitInt8=z(hs);C.prototype.visitInt16=z(hs);C.prototype.visitInt32=z(hs);C.prototype.visitInt64=z(Vx);C.prototype.visitUint8=z(hs);C.prototype.visitUint16=z(hs);C.prototype.visitUint32=z(hs);C.prototype.visitUint64=z(Vx);C.prototype.visitFloat=z(YB);C.prototype.visitFloat16=z(qB);C.prototype.visitFloat32=z(hs);C.prototype.visitFloat64=z(hs);C.prototype.visitUtf8=z(Gx);C.prototype.visitLargeUtf8=z(Gx);C.prototype.visitUtf8View=z(HB);C.prototype.visitBinary=z(Px);C.prototype.visitLargeBinary=z(Px);C.prototype.visitBinaryView=z(XB);C.prototype.visitFixedSizeBinary=z(KB);C.prototype.visitDate=z(QB);C.prototype.visitDateDay=z(Cx);C.prototype.visitDateMillisecond=z(Ux);C.prototype.visitTimestamp=z(ZB);C.prototype.visitTimestampSecond=z(zx);C.prototype.visitTimestampMillisecond=z(Wx);C.prototype.visitTimestampMicrosecond=z($x);C.prototype.visitTimestampNanosecond=z(qx);C.prototype.visitTime=z(eF);C.prototype.visitTimeSecond=z(Kx);C.prototype.visitTimeMillisecond=z(Xx);C.prototype.visitTimeMicrosecond=z(Hx);C.prototype.visitTimeNanosecond=z(Jx);C.prototype.visitDecimal=z(tF);C.prototype.visitList=z(Yx);C.prototype.visitLargeList=z(Yx);C.prototype.visitStruct=z(nF);C.prototype.visitUnion=z(sF);C.prototype.visitDenseUnion=z(Qx);C.prototype.visitSparseUnion=z(Zx);C.prototype.visitDictionary=z(iF);C.prototype.visitInterval=z(oF);C.prototype.visitIntervalDayTime=z(eT);C.prototype.visitIntervalYearMonth=z(tT);C.prototype.visitIntervalMonthDayNano=z(rT);C.prototype.visitDuration=z(aF);C.prototype.visitDurationSecond=z(nT);C.prototype.visitDurationMillisecond=z(sT);C.prototype.visitDurationMicrosecond=z(iT);C.prototype.visitDurationNanosecond=z(oT);C.prototype.visitFixedSizeList=z(cF);C.prototype.visitMap=z(rF);je=new C});var ps,Ro,Mo,Fh,mr,Oh,Mh,oc=p(()=>{lt();Ya();ci();nr();ps=Symbol.for("keys"),Ro=Symbol.for("vals"),Mo=Symbol.for("kKeysAsStrings"),Fh=Symbol.for("_kKeysAsStrings"),mr=class{constructor(e){return this[ps]=new L([e.children[0]]).memoize(),this[Ro]=e.children[1],new Proxy(this,new Mh)}get[Mo](){return this[Fh]||(this[Fh]=Array.from(this[ps].toArray(),String))}[Symbol.iterator](){return new Oh(this[ps],this[Ro])}get size(){return this[ps].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[ps],t=this[Ro],n={};for(let s=-1,i=e.length;++s<i;)n[e.get(s)]=je.visit(t,s);return n}toString(){return`{${[...this].map(([e,t])=>`${Lr(e)}: ${Lr(t)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},Oh=class{constructor(e,t){this.keys=e,this.vals=t,this.keyIndex=0,this.numKeys=e.length}[Symbol.iterator](){return this}next(){let e=this.keyIndex;return e===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(e),je.visit(this.vals,e)]})}},Mh=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[Mo]}has(e,t){return e[Mo].includes(t)}getOwnPropertyDescriptor(e,t){if(e[Mo].indexOf(t)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[Mo].indexOf(t);if(n!==-1){let s=je.visit(Reflect.get(e,Ro),n);return Reflect.set(e,t,s),s}}set(e,t,n){let s=e[Mo].indexOf(t);return s!==-1?(tt.visit(Reflect.get(e,Ro),s,n),Reflect.set(e,t,n)):Reflect.has(e,t)?Reflect.set(e,t,n):!1}};Object.defineProperties(mr.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[ps]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Ro]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Fh]:{writable:!0,enumerable:!1,configurable:!1,value:null}})});var Rh={};J(Rh,{clampRange:()=>ac,createElementComparator:()=>ms,wrapIndex:()=>ui});function ac(r,e,t,n){let{length:s=0}=r,i=typeof e!="number"?0:e,o=typeof t!="number"?s:t;return i<0&&(i=(i%s+s)%s),o<0&&(o=(o%s+s)%s),o<i&&(aT=i,i=o,o=aT),o>s&&(o=s),n?n(r,i,o):[i,o]}function ms(r){if(typeof r!=="object"||r===null)return cT(r)?cT:t=>t===r;if(r instanceof Date){let t=r.valueOf();return n=>n instanceof Date?n.valueOf()===t:!1}return ArrayBuffer.isView(r)?t=>t?Cd(r,t):!1:r instanceof Map?fF(r):Array.isArray(r)?uF(r):r instanceof L?lF(r):dF(r,!0)}function uF(r){let e=[];for(let t=-1,n=r.length;++t<n;)e[t]=ms(r[t]);return ef(e)}function fF(r){let e=-1,t=[];for(let n of r.values())t[++e]=ms(n);return ef(t)}function lF(r){let e=[];for(let t=-1,n=r.length;++t<n;)e[t]=ms(r.get(t));return ef(e)}function dF(r,e=!1){let t=Object.keys(r);if(!e&&t.length===0)return()=>!1;let n=[];for(let s=-1,i=t.length;++s<i;)n[s]=ms(r[t[s]]);return ef(n,t)}function ef(r,e){return t=>{if(!t||typeof t!="object")return!1;switch(t.constructor){case Array:return hF(r,t);case Map:return uT(r,t,t.keys());case mr:case Xr:case Object:case void 0:return uT(r,t,e||Object.keys(t))}return t instanceof L?pF(r,t):!1}}function hF(r,e){let t=r.length;if(e.length!==t)return!1;for(let n=-1;++n<t;)if(!r[n](e[n]))return!1;return!0}function pF(r,e){let t=r.length;if(e.length!==t)return!1;for(let n=-1;++n<t;)if(!r[n](e.get(n)))return!1;return!0}function uT(r,e,t){let n=t[Symbol.iterator](),s=e instanceof Map?e.keys():Object.keys(e)[Symbol.iterator](),i=e instanceof Map?e.values():Object.values(e)[Symbol.iterator](),o=0,a=r.length,c=i.next(),u=n.next(),f=s.next();for(;o<a&&!u.done&&!f.done&&!c.done&&!(u.value!==f.value||!r[o](c.value));++o,u=n.next(),f=s.next(),c=i.next());return o===a&&u.done&&f.done&&c.done?!0:(n.return&&n.return(),s.return&&s.return(),i.return&&i.return(),!1)}var aT,ui,cT,Do=p(()=>{lt();oc();Zu();$e();ui=(r,e)=>r<0?e+r:r,cT=r=>r!==r});var Dh={};J(Dh,{BitIterator:()=>Hr,getBit:()=>rf,getBool:()=>No,packBools:()=>li,popcnt_array:()=>fT,popcnt_bit_range:()=>cc,popcnt_uint32:()=>tf,setBool:()=>mF,truncateBitmap:()=>fi});function No(r,e,t,n){return(t&1<<n)!==0}function rf(r,e,t,n){return(t&1<<n)>>n}function mF(r,e,t){return t?!!(r[e>>3]|=1<<e%8)||!0:!(r[e>>3]&=~(1<<e%8))&&!1}function fi(r,e,t){let n=t.byteLength+7&-8;if(r>0||t.byteLength<n){let s=new Uint8Array(n);return s.set(r%8===0?t.subarray(r>>3):li(new Hr(t,r,e,null,No)).subarray(0,n)),s}return t}function li(r){let e=[],t=0,n=0,s=0;for(let o of r)o&&(s|=1<<n),++n===8&&(e[t++]=s,s=n=0);(t===0||n>0)&&(e[t++]=s);let i=new Uint8Array(e.length+7&-8);return i.set(e),i}function cc(r,e,t){if(t-e<=0)return 0;if(t-e<8){let i=0;for(let o of new Hr(r,e,t-e,r,rf))i+=o;return i}let n=t>>3<<3,s=e+(e%8===0?0:8-e%8);return cc(r,e,s)+cc(r,n,t)+fT(r,s>>3,n-s>>3)}function fT(r,e,t){let n=0,s=Math.trunc(e),i=new DataView(r.buffer,r.byteOffset,r.byteLength),o=t===void 0?r.byteLength:s+t;for(;o-s>=4;)n+=tf(i.getUint32(s)),s+=4;for(;o-s>=2;)n+=tf(i.getUint16(s)),s+=2;for(;o-s>=1;)n+=tf(i.getUint8(s)),s+=1;return n}function tf(r){let e=Math.trunc(r);return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24}var Hr,di=p(()=>{Hr=class{constructor(e,t,n,s,i){this.bytes=e,this.length=n,this.context=s,this.get=i,this.bit=t%8,this.byteIndex=t>>3,this.byte=e[this.byteIndex++],this.index=0}next(){return this.index<this.length?(this.bit===8&&(this.bit=0,this.byte=this.bytes[this.byteIndex++]),{value:this.get(this.context,this.index++,this.byte,this.bit++)}):{done:!0,value:null}}[Symbol.iterator](){return this}}});function M(r){return gF.visit(r)}var bF,lT,k,Nh,gF,br=p(()=>{lt();Fe();ye();di();ye();Nt();$e();bF=-1,lT=Symbol.for("apache-arrow/Data"),k=class r{static isData(e){return e?.[lT]===!0}get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:e}=this;return S.isSparseUnion(e)?this.children.some(t=>t.nullable):S.isDenseUnion(e)?this.children.some(t=>t.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let e=0,{valueOffsets:t,values:n,nullBitmap:s,typeIds:i}=this;return t&&(e+=t.byteLength),n&&(e+=n.byteLength),s&&(e+=s.byteLength),i&&(e+=i.byteLength),e+=this.variadicBuffers.reduce((o,a)=>{var c;return o+((c=a?.byteLength)!==null&&c!==void 0?c:0)},0),this.children.reduce((o,a)=>o+a.byteLength,e)}get nullCount(){if(S.isUnion(this.type))return this.children.reduce((n,s)=>n+s.nullCount,0);let e=this._nullCount,t;return e<=bF&&(t=this.nullBitmap)&&(this._nullCount=e=t.length===0?0:this.length-cc(t,this.offset,this.offset+this.length)),e}constructor(e,t,n,s,i,o=[],a,c=[]){var u;this.type=e,this.children=o,this.dictionary=a,this.offset=Math.floor(Math.max(t||0,0)),this.length=Math.floor(Math.max(n||0,0)),this._nullCount=Math.floor(Math.max(s||0,-1));let f;i instanceof r?(this.stride=i.stride,this.values=i.values,this.typeIds=i.typeIds,this.nullBitmap=i.nullBitmap,this.valueOffsets=i.valueOffsets,this.variadicBuffers=i.variadicBuffers):(this.stride=rr(e),i&&((f=i[0])&&(this.valueOffsets=f),(f=i[1])&&(this.values=f),(f=i[2])&&(this.nullBitmap=f),(f=i[3])&&(this.typeIds=f)),this.variadicBuffers=c),(u=this.variadicBuffers)!==null&&u!==void 0||(this.variadicBuffers=[])}getValid(e){let{type:t}=this;if(S.isUnion(t)){let n=t,s=this.typeIds[e],i=n.typeIdToChildIndex[s],o=this.children[i],a=this.valueOffsets,c=n.mode===de.Dense&&a?Number(a[e]):e;return o.getValid(c)}if(this.nullable&&this.nullCount>0){let n=this.offset+e;return(this.nullBitmap[n>>3]&1<<n%8)!==0}return!0}setValid(e,t){let n,{type:s}=this;if(S.isUnion(s)){let i=s,o=this.typeIds[e],a=i.typeIdToChildIndex[o],c=this.children[a],u=this.valueOffsets,f=i.mode===de.Dense&&u?Number(u[e]):e;n=c.getValid(f),c.setValid(f,t)}else{let{nullBitmap:i}=this,{offset:o,length:a}=this,c=o+e,u=1<<c%8,f=c>>3;(!i||i.byteLength<=f)&&(i=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0?(i.set(fi(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:i})):Object.assign(this,{nullBitmap:i,_nullCount:0}));let l=i[f];n=(l&u)!==0,i[f]=t?l|u:l&~u}return n!==!!t&&(this._nullCount=this.nullCount+(t?-1:1)),t}clone(e=this.type,t=this.offset,n=this.length,s=this._nullCount,i=this,o=this.children,a=this.variadicBuffers){return new r(e,t,n,s,i,o,this.dictionary,a)}slice(e,t){let{stride:n,typeId:s,children:i}=this,o=+(this._nullCount===0)-1,a=s===16?n:1,c=this._sliceBuffers(e,t,n,s);return this.clone(this.type,this.offset+e,t,o,c,i.length===0||this.valueOffsets?i:this._sliceChildren(i,a*e,a*t),this.variadicBuffers)}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===y.Null)return this.clone(this.type,0,e,0,this.buffers,this.children,this.variadicBuffers);let{length:t,nullCount:n}=this,s=new Uint8Array((e+63&-64)>>3).fill(255,0,t>>3);s[t>>3]=(1<<t-(t&-8))-1,n>0&&s.set(fi(this.offset,t,this.nullBitmap),0);let i=this.buffers;return i[te.VALIDITY]=s,this.clone(this.type,0,e,n+(e-t),i,this.children,this.variadicBuffers)}_sliceBuffers(e,t,n,s){let i,{buffers:o}=this;if((i=o[te.TYPE])&&(o[te.TYPE]=i.subarray(e,e+t)),S.isBinaryView(this.type)||S.isUtf8View(this.type)){let a=Q.ELEMENT_WIDTH;(i=o[te.DATA])&&(o[te.DATA]=i.subarray(e*a,(e+t)*a))}else(i=o[te.OFFSET])&&(o[te.OFFSET]=i.subarray(e,e+t+1))||(i=o[te.DATA])&&(o[te.DATA]=s===6?i:i.subarray(n*e,n*(e+t)));return o}_sliceChildren(e,t,n){return e.map(s=>s.slice(t,n))}};k.prototype.children=Object.freeze([]);k.prototype[lT]=!0;Object.defineProperty(k,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===k&&k.isData(e)}});Nh=class r extends R{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){let{["type"]:t,["offset"]:n=0,["length"]:s=0}=e;return new k(t,n,s,s)}visitBool(e){let{["type"]:t,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Z(t.ArrayType,e.data),{["length"]:o=i.length>>3,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new k(t,n,o,a,[void 0,i,s])}visitInt(e){let{["type"]:t,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Z(t.ArrayType,e.data),{["length"]:o=i.length,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new k(t,n,o,a,[void 0,i,s])}visitFloat(e){let{["type"]:t,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Z(t.ArrayType,e.data),{["length"]:o=i.length,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new k(t,n,o,a,[void 0,i,s])}visitUtf8(e){let{["type"]:t,["offset"]:n=0}=e,s=D(e.data),i=D(e.nullBitmap),o=si(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new k(t,n,a,c,[o,s,i])}visitUtf8View(e){var t;let{["type"]:n,["offset"]:s=0}=e,i=Z(n.ArrayType,e.views),o=D(e.nullBitmap),a=(e.variadicBuffers||[]).map(f=>D(f)),c=(t=e.length)!==null&&t!==void 0?t:Math.trunc(i.length/Tt.ELEMENT_WIDTH),u=e.nullBitmap?-1:0;return new k(n,s,c,u,[void 0,i,o],[],void 0,a)}visitLargeUtf8(e){let{["type"]:t,["offset"]:n=0}=e,s=D(e.data),i=D(e.nullBitmap),o=Na(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new k(t,n,a,c,[o,s,i])}visitBinary(e){let{["type"]:t,["offset"]:n=0}=e,s=D(e.data),i=D(e.nullBitmap),o=si(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new k(t,n,a,c,[o,s,i])}visitBinaryView(e){var t;let{["type"]:n,["offset"]:s=0}=e,i=Z(n.ArrayType,e.views),o=D(e.nullBitmap),a=(e.variadicBuffers||[]).map(f=>D(f)),c=(t=e.length)!==null&&t!==void 0?t:Math.trunc(i.length/Q.ELEMENT_WIDTH),u=e.nullBitmap?-1:0;return new k(n,s,c,u,[void 0,i,o],[],void 0,a)}visitLargeBinary(e){let{["type"]:t,["offset"]:n=0}=e,s=D(e.data),i=D(e.nullBitmap),o=Na(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new k(t,n,a,c,[o,s,i])}visitFixedSizeBinary(e){let{["type"]:t,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Z(t.ArrayType,e.data),{["length"]:o=i.length/rr(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new k(t,n,o,a,[void 0,i,s])}visitDate(e){let{["type"]:t,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Z(t.ArrayType,e.data),{["length"]:o=i.length/rr(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new k(t,n,o,a,[void 0,i,s])}visitTimestamp(e){let{["type"]:t,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Z(t.ArrayType,e.data),{["length"]:o=i.length/rr(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new k(t,n,o,a,[void 0,i,s])}visitTime(e){let{["type"]:t,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Z(t.ArrayType,e.data),{["length"]:o=i.length/rr(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new k(t,n,o,a,[void 0,i,s])}visitDecimal(e){let{["type"]:t,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Z(t.ArrayType,e.data),{["length"]:o=i.length/rr(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new k(t,n,o,a,[void 0,i,s])}visitList(e){let{["type"]:t,["offset"]:n=0,["child"]:s}=e,i=D(e.nullBitmap),o=si(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new k(t,n,a,c,[o,void 0,i],[s])}visitLargeList(e){let{["type"]:t,["offset"]:n=0,["child"]:s}=e,i=D(e.nullBitmap),o=Na(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new k(t,n,a,c,[o,void 0,i],[s])}visitStruct(e){let{["type"]:t,["offset"]:n=0,["children"]:s=[]}=e,i=D(e.nullBitmap),{length:o=s.reduce((c,{length:u})=>Math.max(c,u),0),nullCount:a=e.nullBitmap?-1:0}=e;return new k(t,n,o,a,[void 0,void 0,i],s)}visitUnion(e){let{["type"]:t,["offset"]:n=0,["children"]:s=[]}=e,i=Z(t.ArrayType,e.typeIds),{["length"]:o=i.length,["nullCount"]:a=-1}=e;if(S.isSparseUnion(t))return new k(t,n,o,a,[void 0,void 0,void 0,i],s);let c=si(e.valueOffsets);return new k(t,n,o,a,[c,void 0,void 0,i],s)}visitDictionary(e){let{["type"]:t,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Z(t.indices.ArrayType,e.data),{["dictionary"]:o=new L([new r().visit({type:t.dictionary})])}=e,{["length"]:a=i.length,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new k(t,n,a,c,[void 0,i,s],[],o)}visitInterval(e){let{["type"]:t,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Z(t.ArrayType,e.data),{["length"]:o=i.length/rr(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new k(t,n,o,a,[void 0,i,s])}visitDuration(e){let{["type"]:t,["offset"]:n=0}=e,s=D(e.nullBitmap),i=Z(t.ArrayType,e.data),{["length"]:o=i.length,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new k(t,n,o,a,[void 0,i,s])}visitFixedSizeList(e){let{["type"]:t,["offset"]:n=0,["child"]:s=new r().visit({type:t.valueType})}=e,i=D(e.nullBitmap),{["length"]:o=s.length/rr(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new k(t,n,o,a,[void 0,void 0,i],[s])}visitMap(e){let{["type"]:t,["offset"]:n=0,["child"]:s=new r().visit({type:t.childType})}=e,i=D(e.nullBitmap),o=si(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new k(t,n,a,c,[o,void 0,i],[s])}},gF=new Nh});function dT(r){return r.some(e=>e.nullable)}function nf(r){return r.reduce((e,t)=>e+t.nullCount,0)}function sf(r){return r.reduce((e,t,n)=>(e[n+1]=e[n]+t.length,e),new Uint32Array(r.length+1))}function of(r,e,t,n){let s=[];for(let i=-1,o=r.length;++i<o;){let a=r[i],c=e[i],{length:u}=a;if(c>=n)break;if(t>=c+u)continue;if(c>=t&&c+u<=n){s.push(a);continue}let f=Math.max(0,t-c),l=Math.min(n-c,u);s.push(a.slice(f,l-f))}return s.length===0&&s.push(r[0].slice(0,0)),s}function kh(r,e,t,n){let s=0,i=0,o=e.length-1;do{if(s>=o-1)return t<e[o]?n(r,s,t-e[s]):null;i=s+Math.trunc((o-s)*.5),t<e[i]?o=i:s=i}while(s<o)}function fc(r,e){return r.getValid(e)}function ko(r){function e(t,n,s){return r(t[n],s)}return function(t){let n=this.data;return kh(n,this._offsets,t,e)}}function af(r){let e;function t(n,s,i){return r(n[s],i,e)}return function(n,s){let i=this.data;e=s;let o=kh(i,this._offsets,n,t);return e=void 0,o}}function cf(r){let e;function t(n,s,i){let o=i,a=0,c=0;for(let u=s-1,f=n.length;++u<f;){let l=n[u];if(~(a=r(l,e,o)))return c+a;o=0,c+=l.length}return-1}return function(n,s){e=n;let i=this.data,o=typeof s!="number"?t(i,0,0):kh(i,this._offsets,s,t);return e=void 0,o}}var uc,uf=p(()=>{uc=class{constructor(e=0,t){this.numChunks=e,this.getChunkIterator=t,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndex<this.numChunks;){let e=this.chunkIterator.next();if(!e.done)return e;++this.chunkIndex<this.numChunks&&(this.chunkIterator=this.getChunkIterator(this.chunkIndex))}return{done:!0,value:null}}[Symbol.iterator](){return this}}});function yF(r,e){return e===null&&r.length>0?0:-1}function wF(r,e){let{nullBitmap:t}=r;if(!t||r.nullCount<=0)return-1;let n=0;for(let s of new Hr(t,r.offset+(e||0),r.length,t,No)){if(!s)return n;++n}return-1}function K(r,e,t){if(e===void 0)return-1;if(e===null)switch(r.typeId){case y.Union:break;case y.Dictionary:break;default:return wF(r,t)}let n=je.getVisitFn(r),s=ms(e);for(let i=(t||0)-1,o=r.length;++i<o;)if(s(n(r,i)))return i;return-1}function hT(r,e,t){let n=je.getVisitFn(r),s=ms(e);for(let i=(t||0)-1,o=r.length;++i<o;)if(s(n(r,i)))return i;return-1}var U,hi,ff=p(()=>{Fe();Nt();ci();di();Do();U=class extends R{};U.prototype.visitNull=yF;U.prototype.visitBool=K;U.prototype.visitInt=K;U.prototype.visitInt8=K;U.prototype.visitInt16=K;U.prototype.visitInt32=K;U.prototype.visitInt64=K;U.prototype.visitUint8=K;U.prototype.visitUint16=K;U.prototype.visitUint32=K;U.prototype.visitUint64=K;U.prototype.visitFloat=K;U.prototype.visitFloat16=K;U.prototype.visitFloat32=K;U.prototype.visitFloat64=K;U.prototype.visitUtf8=K;U.prototype.visitLargeUtf8=K;U.prototype.visitUtf8View=K;U.prototype.visitBinary=K;U.prototype.visitLargeBinary=K;U.prototype.visitBinaryView=K;U.prototype.visitFixedSizeBinary=K;U.prototype.visitDate=K;U.prototype.visitDateDay=K;U.prototype.visitDateMillisecond=K;U.prototype.visitTimestamp=K;U.prototype.visitTimestampSecond=K;U.prototype.visitTimestampMillisecond=K;U.prototype.visitTimestampMicrosecond=K;U.prototype.visitTimestampNanosecond=K;U.prototype.visitTime=K;U.prototype.visitTimeSecond=K;U.prototype.visitTimeMillisecond=K;U.prototype.visitTimeMicrosecond=K;U.prototype.visitTimeNanosecond=K;U.prototype.visitDecimal=K;U.prototype.visitList=K;U.prototype.visitLargeList=K;U.prototype.visitStruct=K;U.prototype.visitUnion=K;U.prototype.visitDenseUnion=hT;U.prototype.visitSparseUnion=hT;U.prototype.visitDictionary=K;U.prototype.visitInterval=K;U.prototype.visitIntervalDayTime=K;U.prototype.visitIntervalYearMonth=K;U.prototype.visitIntervalMonthDayNano=K;U.prototype.visitDuration=K;U.prototype.visitDurationSecond=K;U.prototype.visitDurationMillisecond=K;U.prototype.visitDurationMicrosecond=K;U.prototype.visitDurationNanosecond=K;U.prototype.visitFixedSizeList=K;U.prototype.visitMap=K;hi=new U});function W(r){let{type:e}=r;if(r.nullCount===0&&r.stride===1&&(S.isInt(e)&&e.bitWidth!==64||S.isTime(e)&&e.bitWidth!==64||S.isFloat(e)&&e.precision!==ue.HALF))return new uc(r.data.length,n=>{let s=r.data[n];return s.values.subarray(0,s.length)[Symbol.iterator]()});let t=0;return new uc(r.data.length,n=>{let i=r.data[n].length,o=r.slice(t,t+i);return t+=i,new Ch(o)})}var V,Ch,Co,lf=p(()=>{Nt();Fe();ye();uf();V=class extends R{};Ch=class{constructor(e){this.vector=e,this.index=0}next(){return this.index<this.vector.length?{value:this.vector.get(this.index++)}:{done:!0,value:null}}[Symbol.iterator](){return this}};V.prototype.visitNull=W;V.prototype.visitBool=W;V.prototype.visitInt=W;V.prototype.visitInt8=W;V.prototype.visitInt16=W;V.prototype.visitInt32=W;V.prototype.visitInt64=W;V.prototype.visitUint8=W;V.prototype.visitUint16=W;V.prototype.visitUint32=W;V.prototype.visitUint64=W;V.prototype.visitFloat=W;V.prototype.visitFloat16=W;V.prototype.visitFloat32=W;V.prototype.visitFloat64=W;V.prototype.visitUtf8=W;V.prototype.visitLargeUtf8=W;V.prototype.visitUtf8View=W;V.prototype.visitBinary=W;V.prototype.visitLargeBinary=W;V.prototype.visitBinaryView=W;V.prototype.visitFixedSizeBinary=W;V.prototype.visitDate=W;V.prototype.visitDateDay=W;V.prototype.visitDateMillisecond=W;V.prototype.visitTimestamp=W;V.prototype.visitTimestampSecond=W;V.prototype.visitTimestampMillisecond=W;V.prototype.visitTimestampMicrosecond=W;V.prototype.visitTimestampNanosecond=W;V.prototype.visitTime=W;V.prototype.visitTimeSecond=W;V.prototype.visitTimeMillisecond=W;V.prototype.visitTimeMicrosecond=W;V.prototype.visitTimeNanosecond=W;V.prototype.visitDecimal=W;V.prototype.visitList=W;V.prototype.visitLargeList=W;V.prototype.visitStruct=W;V.prototype.visitUnion=W;V.prototype.visitDenseUnion=W;V.prototype.visitSparseUnion=W;V.prototype.visitDictionary=W;V.prototype.visitInterval=W;V.prototype.visitIntervalDayTime=W;V.prototype.visitIntervalYearMonth=W;V.prototype.visitIntervalMonthDayNano=W;V.prototype.visitDuration=W;V.prototype.visitDurationSecond=W;V.prototype.visitDurationMillisecond=W;V.prototype.visitDurationMicrosecond=W;V.prototype.visitDurationNanosecond=W;V.prototype.visitFixedSizeList=W;V.prototype.visitMap=W;Co=new V});function Jr(r){if(r){if(r instanceof k)return new L([r]);if(r instanceof L)return new L(r.data);if(r.type instanceof S)return new L([M(r)]);if(Array.isArray(r))return new L(r.flatMap(e=>xF(e)));if(ArrayBuffer.isView(r)){r instanceof DataView&&(r=new Uint8Array(r.buffer));let e={offset:0,length:r.length,nullCount:-1,data:r};if(r instanceof Int8Array)return new L([M(Object.assign(Object.assign({},e),{type:new Ht}))]);if(r instanceof Int16Array)return new L([M(Object.assign(Object.assign({},e),{type:new Jt}))]);if(r instanceof Int32Array)return new L([M(Object.assign(Object.assign({},e),{type:new Ce}))]);if(r instanceof BigInt64Array)return new L([M(Object.assign(Object.assign({},e),{type:new Yt}))]);if(r instanceof Uint8Array||r instanceof Uint8ClampedArray)return new L([M(Object.assign(Object.assign({},e),{type:new Qt}))]);if(r instanceof Uint16Array)return new L([M(Object.assign(Object.assign({},e),{type:new Zt}))]);if(r instanceof Uint32Array)return new L([M(Object.assign(Object.assign({},e),{type:new wt}))]);if(r instanceof BigUint64Array)return new L([M(Object.assign(Object.assign({},e),{type:new Fr}))]);if(r instanceof Float32Array)return new L([M(Object.assign(Object.assign({},e),{type:new xt}))]);if(r instanceof Float64Array)return new L([M(Object.assign(Object.assign({},e),{type:new er}))]);throw new Error("Unrecognized input")}}throw new Error("Unrecognized input")}function xF(r){return r instanceof k?[r]:r instanceof L?r.data:Jr(r).data}var pT,mT,bT,gT,L,df,lt=p(()=>{Fe();Do();ye();br();uf();ci();nr();ff();lf();ye();mT=Symbol.for("apache-arrow/Vector"),bT={},gT={},L=class r{static isVector(e){return e?.[mT]===!0}constructor(e){var t,n,s;let i=e[0]instanceof r?e.flatMap(a=>a.data):e;if(i.length===0||i.some(a=>!(a instanceof k)))throw new TypeError("Vector constructor expects an Array of Data instances.");let o=(t=i[0])===null||t===void 0?void 0:t.type;switch(i.length){case 0:this._offsets=[0];break;case 1:{let{get:a,set:c,indexOf:u}=bT[o.typeId],f=i[0];this.isValid=l=>fc(f,l),this.get=l=>a(f,l),this.set=(l,d)=>c(f,l,d),this.indexOf=l=>u(f,l),this._offsets=[0,f.length];break}default:Object.setPrototypeOf(this,gT[o.typeId]),this._offsets=sf(i);break}this.data=i,this.type=o,this.stride=rr(o),this.numChildren=(s=(n=o.children)===null||n===void 0?void 0:n.length)!==null&&s!==void 0?s:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((e,t)=>e+t.byteLength,0)}get nullable(){return dT(this.data)}get nullCount(){return nf(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${y[this.type.typeId]}Vector`}isValid(e){return!1}get(e){return null}at(e){return this.get(ui(e,this.length))}set(e,t){}indexOf(e,t){return-1}includes(e,t){return this.indexOf(e,t)>-1}[Symbol.iterator](){return Co.visit(this)}concat(...e){return new r(this.data.concat(e.flatMap(t=>t.data).flat(Number.POSITIVE_INFINITY)))}slice(e,t){return new r(ac(this,e,t,({data:n,_offsets:s},i,o)=>of(n,s,i,o)))}toJSON(){return[...this]}toArray(){let{type:e,data:t,length:n,stride:s,ArrayType:i}=this;switch(e.typeId){case y.Int:case y.Float:case y.Decimal:case y.Time:case y.Timestamp:switch(t.length){case 0:return new i;case 1:return t[0].values.subarray(0,n*s);default:return t.reduce((o,{values:a,length:c})=>(o.array.set(a.subarray(0,c*s),o.offset),o.offset+=c*s,o),{array:new i(n*s),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(e){var t;return this.getChildAt((t=this.type.children)===null||t===void 0?void 0:t.findIndex(n=>n.name===e))}getChildAt(e){return e>-1&&e<this.numChildren?new r(this.data.map(({children:t})=>t[e])):null}get isMemoized(){return S.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(S.isDictionary(this.type)){let e=new df(this.data[0].dictionary),t=this.data.map(n=>{let s=n.clone();return s.dictionary=e,s});return new r(t)}return new df(this)}unmemoize(){if(S.isDictionary(this.type)&&this.isMemoized){let e=this.data[0].dictionary.unmemoize(),t=this.data.map(n=>{let s=n.clone();return s.dictionary=e,s});return new r(t)}return this}};pT=Symbol.toStringTag;L[pT]=(r=>{r.type=S.prototype,r.data=[],r.length=0,r.stride=1,r.numChildren=0,r._offsets=new Uint32Array([0]),r[Symbol.isConcatSpreadable]=!0,r[mT]=!0;let e=Object.keys(y).map(t=>y[t]).filter(t=>typeof t=="number"&&t!==y.NONE);for(let t of e){let n=je.getVisitFnByTypeId(t),s=tt.getVisitFnByTypeId(t),i=hi.getVisitFnByTypeId(t);bT[t]={get:n,set:s,indexOf:i},gT[t]=Object.create(r,{isValid:{value:ko(fc)},get:{value:ko(je.getVisitFnByTypeId(t))},set:{value:af(tt.getVisitFnByTypeId(t))},indexOf:{value:cf(hi.getVisitFnByTypeId(t))}})}return"Vector"})(L.prototype);Object.defineProperty(L,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===L&&L.isVector(e)}});df=class r extends L{constructor(e){super(e.data);let t=this.get,n=this.set,s=this.slice,i=new Array(this.length);Object.defineProperty(this,"get",{value(o){let a=i[o];if(a!==void 0)return a;let c=t.call(this,o);return i[o]=c,c}}),Object.defineProperty(this,"set",{value(o,a){n.call(this,o,a),i[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new r(s.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new L(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}});function yT(r){if(!r||r.length<=0)return function(s){return!0};let e="",t=r.filter(n=>n===n);return t.length>0&&(e=`
|
|
12
|
+
`:s}else t+=n}return t}readDelimitedValue(e){this.offset++;let t=this.offset;for(;this.offset<this.source.length&&this.source[this.offset]!==e;)this.offset++;let n=this.source.slice(t,this.offset);return this.offset++,n}}});function Yw(r){let e=new DataView(r),t=FB(e),n=e.getUint16(t+10,!0),s=e.getUint32(t+16,!0),i=s,o=new Map,a=new TextDecoder,c=0;for(let u=0;u<n;u++){if(s+46>t)throw new Error("USDZ archive contains a truncated ZIP central-directory entry.");if(e.getUint32(s,!0)!==33639248)throw new Error("USDZ archive contains an invalid ZIP central-directory entry.");let l=e.getUint16(s+10,!0),f=e.getUint32(s+20,!0),d=e.getUint32(s+24,!0),h=e.getUint16(s+28,!0),m=e.getUint16(s+30,!0),b=e.getUint16(s+32,!0),g=e.getUint32(s+42,!0);if(s+46+h+m+b>t)throw new Error("USDZ archive contains a truncated ZIP filename or extra field.");let y=a.decode(new Uint8Array(r,s+46,h));if(l!==0)throw new Error(`USDZ entry "${y}" is compressed; USDZ requires stored ZIP entries.`);if(g+30>i||f!==d)throw new Error(`USDZ entry "${y}" has invalid stored ZIP bounds.`);if(e.getUint32(g,!0)!==67324752)throw new Error(`USDZ entry "${y}" has an invalid local ZIP header.`);let x=e.getUint16(g+26,!0),T=e.getUint16(g+28,!0),_=g+30+x+T;if((e.getUint16(s+8,!0)|e.getUint16(g+6,!0))&1)throw new Error(`USDZ entry "${y}" is encrypted.`);if(_+f>i||e.getUint16(g+8,!0)!==0||a.decode(new Uint8Array(r,g+30,x))!==y||o.has(y))throw new Error(`USDZ entry "${y}" has invalid or duplicate stored ZIP data.`);if(c+=f,c>r.byteLength)throw new Error("USDZ archive exceeds its stored data budget.");o.set(y,r.slice(_,_+f)),s+=46+h+m+b}return o}function FB(r){let e=Math.max(0,r.byteLength-65557);for(let t=r.byteLength-22;t>=e;t--)if(r.getUint32(t,!0)===101010256)return t;throw new Error("USDZ archive does not contain a ZIP end-of-central-directory record.")}var Qw=p(()=>{"use strict"});async function Jd(r,e={},t){let n=RB(e.core?.baseUrl,t?.url),s={fetch:async o=>{let a=await(t?.fetch||fetch)(o);if(!(a instanceof Response))throw new Error(`OpenUSD reference "${o}" did not return an HTTP response.`);if(!a.ok)throw new Error(`Unable to load OpenUSD reference "${o}": ${a.status}.`);return a},cache:new Map,archiveFiles:new Map,layers:new Set,options:{...e,usd:{...NB,...e.usd}}},i;if(VB(r)){let o=Yw(r),a=o.keys().next().value;if(!a||!/\.(?:usd[ac]?)$/i.test(a))throw new Error("USDZ archive has no supported USD root layer.");let c="https://usd.archive/",u=Object.create(null);for(let[f,d]of o){let h=new URL(f,c);if(f.startsWith("/")||/^[a-z][a-z\d+.-]*:/i.test(f)||f.includes("\\")||/[\u0000-\u001f\u007f]/.test(f)||f.trim()!==f||f.split("/").some(m=>{let b=m.replace(/%2e/gi,".");return b==="."||b===".."})||h.origin!==new URL(c).origin||h.search||h.hash||u[h.href])throw new Error(`USDZ entry "${f}" has an ambiguous package URL.`);s.archiveFiles.set(h.href,d),u[h.href]=DB(f,d)}let l=new URL(a,c).href;i=qd(o.get(a),l),i.format="usdz",i.assets=u}else i=qd(r,n);return i.url&&(tx(i,i.url),s.layers.add(i.url)),s.options.usd?.compose!==!1&&(i.rootPrims=await Kd(i.rootPrims,i.url,{},s,0)),i.layers=Array.from(s.layers),n&&(i.url=n),i}function DB(r,e){let t=r.slice(r.lastIndexOf(".")+1).toLowerCase(),n=t==="png"?"image/png":/^(?:jpe?g)$/.test(t)?"image/jpeg":void 0;return n?{path:r,data:e,mimeType:n}:{path:r,data:e}}function RB(r,e){let t=ex(r);return t||ex(e)||r||e}function ex(r){try{return r?new URL(r).href:void 0}catch{return}}function kB(r,e){try{return new URL(r,e).href}catch{let t=Math.max(e.lastIndexOf("/"),e.lastIndexOf("\\"));return t>=0?`${e.slice(0,t+1)}${r}`:r}}function qd(r,e){return Zw.decode(r.slice(0,8))===OB?qw(r,e):Hw(Zw.decode(r),e)}function tx(r,e){let t=[...r.rootPrims];for(;t.length;){let n=t.pop();for(let s of Object.values(n.attributes))s.sourceUrl=e;for(let s of n.children)t.push(s);if("variants"in n)for(let s of Object.values(n.variants))for(let i of Object.values(s))t.push(i)}}async function Kd(r,e,t,n,s){if(s>(n.options.usd?.maxReferenceDepth??12))throw new Error("OpenUSD reference composition exceeded the configured depth limit.");let i=[];for(let o of r){if(o.specifier==="class")continue;let c={...PB(o.metadata.variants),...t,...n.options.usd?.variantSelections},u=o.sourceUrl||e,l=ka(o);for(let[d,h]of Object.entries(l.variants)){let m=c[d]||Object.keys(h)[0],b=h[m];b&&(l=Hd(l,{...l,attributes:b.attributes,metadata:b.metadata,children:b.children,variants:{}}))}let f=nx(l);if(n.options.usd?.loadReferences!==!1&&f.length>0)for(let d of f){if(!u)throw new Error("OpenUSD references require a source URL or options.core.baseUrl.");let h=kB(d.assetPath,u),m=await CB(h,n),b=UB(m,d.primPath),g=await Kd(b,h,c,n,s+1);for(let y of g)l=Hd(sx(y,l.path),l)}l.children=await Kd(l.children,u,c,n,s),i.push(l)}return i}async function CB(r,e){let t=e.cache.get(r);return t||(t=(async()=>{let s=e.archiveFiles.get(r);if(!s){let o;try{o=await e.fetch(r)}catch(a){throw new Error(`Unable to fetch USD layer "${r}": ${String(a)}`)}s=o.arrayBuffer()}let i=qd(await s,r);return tx(i,r),e.layers.add(r),i})(),e.cache.set(r,t)),t}function UB(r,e){let t=e||r.metadata.defaultPrim;if(typeof t!="string")return r.rootPrims;let n=t.startsWith("/")?t:`/${t}`,s=rx(r.rootPrims,n);return s?[s]:[]}function rx(r,e){for(let t of r){if(t.path===e)return t;let n=rx(t.children,e);if(n)return n}}function nx(r){let e=[];for(let t of[r.metadata.references,r.metadata.payload,r.metadata.payloads])Array.isArray(t)?e.push(...t.filter(Xd)):Xd(t)&&e.push(t);return e}function PB(r){return!r||typeof r!="object"||Array.isArray(r)||Xd(r)?{}:Object.fromEntries(Object.entries(r).filter(e=>typeof e[1]=="string"))}function Xd(r){return!!(r&&typeof r=="object"&&!Array.isArray(r)&&"assetPath"in r)}function ka(r){return{...r,attributes:{...r.attributes},metadata:{...r.metadata},variants:{...r.variants},children:r.children.map(ka)}}function sx(r,e){let t=ka(r);return t.path=e,t.children=t.children.map(n=>sx(n,`${e}/${n.name}`)),t}function Hd(r,e){let t=r.children.map(ka);for(let n of e.children){let s=t.findIndex(i=>i.name===n.name);s>=0?t[s]=Hd(t[s],n):t.push(ka(n))}return{...r,...e,sourceUrl:nx(e).length>0?e.sourceUrl:r.sourceUrl||e.sourceUrl,type:e.type||r.type,attributes:{...r.attributes,...e.attributes},metadata:{...r.metadata,...e.metadata},variants:{...r.variants,...e.variants},children:t}}function VB(r){return r.byteLength>=4&&new DataView(r).getUint32(0,!0)===MB}var Zw,OB,MB,NB,ix=p(()=>{"use strict";Xw();Jw();Qw();Zw=new TextDecoder,OB="PXR-USDC",MB=67324752;NB={compose:!0,loadReferences:!0,maxReferenceDepth:12,variantSelections:{}}});async function zB(r,e,t){return Jd(new TextEncoder().encode(r).buffer,e,t)}var DU,jB,GB,ox=p(()=>{"use strict";ix();Yd();({preload:DU,...jB}=Na),GB={...jB,parse:Jd,parseText:zB}});var ax={};J(ax,{USDLoaderWithParser:()=>GB});var cx=p(()=>{"use strict";ox()});async function $B(){let{USDLoaderWithParser:r}=await Promise.resolve().then(()=>(cx(),ax));return r}var WB,Na,Yd=p(()=>{"use strict";WB="5.0.0-beta.6";Na={dataType:null,batchType:null,name:"Universal Scene Description",id:"usd",module:"scene",version:WB,extensions:["usd","usda","usdc","usdz"],mimeTypes:["model/vnd.usd","model/vnd.usda","model/vnd.usdc","model/vnd.usdz+zip"],text:!0,binary:!0,tests:["#usda","PXR-USDC","PK"],options:{usd:{compose:!0,loadReferences:!0,maxReferenceDepth:12,variantSelections:{}}},preload:$B}});var ux,lx=p(()=>{"use strict";ux={name:"OBJ",id:"obj",module:"scene",encoding:"text",format:"obj",extensions:["obj"],mimeTypes:["text/plain"]}});function dx(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(r);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(r,n[s])&&(t[n[s]]=r[n[s]]);return t}function F(r,e,t,n){function s(i){return i instanceof t?i:new t(function(o){o(i)})}return new(t||(t=Promise))(function(i,o){function a(l){try{u(n.next(l))}catch(f){o(f)}}function c(l){try{u(n.throw(l))}catch(f){o(f)}}function u(l){l.done?i(l.value):s(l.value).then(a,c)}u((n=n.apply(r,e||[])).next())})}function fx(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Y(r){return this instanceof Y?(this.v=r,this):new Y(r)}function _t(r,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(r,e||[]),s,i=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",o),s[Symbol.asyncIterator]=function(){return this},s;function o(h){return function(m){return Promise.resolve(m).then(h,f)}}function a(h,m){n[h]&&(s[h]=function(b){return new Promise(function(g,y){i.push([h,b,g,y])>1||c(h,b)})},m&&(s[h]=m(s[h])))}function c(h,m){try{u(n[h](m))}catch(b){d(i[0][3],b)}}function u(h){h.value instanceof Y?Promise.resolve(h.value.v).then(l,f):d(i[0][2],h)}function l(h){c("next",h)}function f(h){c("throw",h)}function d(h,m){h(m),i.shift(),i.length&&c(i[0][0],i[0][1])}}function Ao(r){var e,t;return e={},n("next"),n("throw",function(s){throw s}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(s,i){e[s]=r[s]?function(o){return(t=!t)?{value:Y(r[s](o)),done:!1}:i?i(o):o}:i}}function Ht(r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof fx=="function"?fx(r):r[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(i){t[i]=r[i]&&function(o){return new Promise(function(a,c){o=r[i](o),s(a,c,o.done,o.value)})}}function s(i,o,a,c){Promise.resolve(c).then(function(u){i({value:u,done:a})},o)}}var kt=p(()=>{});var hx,vo,qB,Jt,gn=p(()=>{hx=new TextDecoder("utf-8"),vo=hx.decode.bind(hx),qB=new TextEncoder,Jt=r=>qB.encode(r)});var KB,px,qe,At,Yt,Br,br,Eu,Lu,Bu,Fu,Ou,mx,Ca,bx,Mu,gx,Yn=p(()=>{KB=r=>typeof r=="number",px=r=>typeof r=="boolean",qe=r=>typeof r=="function",At=r=>r!=null&&Object(r)===r,Yt=r=>At(r)&&qe(r.then),Br=r=>At(r)&&qe(r[Symbol.iterator]),br=r=>At(r)&&qe(r[Symbol.asyncIterator]),Eu=r=>At(r)&&At(r.schema),Lu=r=>At(r)&&"done"in r&&"value"in r,Bu=r=>At(r)&&qe(r.stat)&&KB(r.fd),Fu=r=>At(r)&&Ca(r.body),Ou=r=>"_getDOMStream"in r&&"_getNodeStream"in r,mx=r=>At(r)&&qe(r.abort)&&qe(r.getWriter)&&!Ou(r),Ca=r=>At(r)&&qe(r.cancel)&&qe(r.getReader)&&!Ou(r),bx=r=>At(r)&&qe(r.end)&&qe(r.write)&&px(r.writable)&&!Ou(r),Mu=r=>At(r)&&qe(r.read)&&qe(r.pipe)&&px(r.readable)&&!Ou(r),gx=r=>At(r)&&qe(r.clear)&&qe(r.bytes)&&qe(r.position)&&qe(r.setPosition)&&qe(r.capacity)&&qe(r.getBufferIdentifier)&&qe(r.createLong)});var nh={};J(nh,{compareArrayLike:()=>rh,joinUint8Arrays:()=>Qt,memcpy:()=>Ua,rebaseValueOffsets:()=>Du,toArrayBufferView:()=>ee,toArrayBufferViewAsyncIterator:()=>Fr,toArrayBufferViewIterator:()=>Xr,toBigInt64Array:()=>Pa,toBigUint64Array:()=>ZB,toFloat32Array:()=>eF,toFloat32ArrayAsyncIterator:()=>bF,toFloat32ArrayIterator:()=>cF,toFloat64Array:()=>tF,toFloat64ArrayAsyncIterator:()=>gF,toFloat64ArrayIterator:()=>uF,toInt16Array:()=>JB,toInt16ArrayAsyncIterator:()=>dF,toInt16ArrayIterator:()=>sF,toInt32Array:()=>ui,toInt32ArrayAsyncIterator:()=>hF,toInt32ArrayIterator:()=>iF,toInt8Array:()=>HB,toInt8ArrayAsyncIterator:()=>fF,toInt8ArrayIterator:()=>nF,toUint16Array:()=>YB,toUint16ArrayAsyncIterator:()=>pF,toUint16ArrayIterator:()=>oF,toUint32Array:()=>QB,toUint32ArrayAsyncIterator:()=>mF,toUint32ArrayIterator:()=>aF,toUint8Array:()=>k,toUint8ArrayAsyncIterator:()=>th,toUint8ArrayIterator:()=>eh,toUint8ClampedArray:()=>rF,toUint8ClampedArrayAsyncIterator:()=>yF,toUint8ClampedArrayIterator:()=>lF});function XB(r){let e=r[0]?[r[0]]:[],t,n,s,i;for(let o,a,c=0,u=0,l=r.length;++c<l;){if(o=e[u],a=r[c],!o||!a||o.buffer!==a.buffer||a.byteOffset<o.byteOffset){a&&(e[++u]=a);continue}if({byteOffset:t,byteLength:s}=o,{byteOffset:n,byteLength:i}=a,t+s<n||n+i<t){a&&(e[++u]=a);continue}e[u]=new Uint8Array(o.buffer,t,n-t+i)}return e}function Ua(r,e,t=0,n=e.byteLength){let s=r.byteLength,i=new Uint8Array(r.buffer,r.byteOffset,s),o=new Uint8Array(e.buffer,e.byteOffset,Math.min(n,s));return i.set(o,t),r}function Qt(r,e){let t=XB(r),n=t.reduce((l,f)=>l+f.byteLength,0),s,i,o,a=0,c=-1,u=Math.min(e||Number.POSITIVE_INFINITY,n);for(let l=t.length;++c<l;){if(s=t[c],i=s.subarray(0,Math.min(s.length,u-a)),u<=a+i.length){i.length<s.length?t[c]=s.subarray(i.length):i.length===s.length&&c++,o?Ua(o,i,a):o=i;break}Ua(o||(o=new Uint8Array(u)),i,a),a+=i.length}return[o||new Uint8Array(0),t.slice(c),n-(o?o.byteLength:0)]}function ee(r,e){let t=Lu(e)?e.value:e;return t instanceof r?r===Uint8Array?new r(t.buffer,t.byteOffset,t.byteLength):t:t?(typeof t=="string"&&(t=Jt(t)),t instanceof ArrayBuffer?new r(t):t instanceof Zd?new r(t):gx(t)?ee(r,t.bytes()):ArrayBuffer.isView(t)?t.byteLength<=0?new r(0):new r(t.buffer,t.byteOffset,t.byteLength/r.BYTES_PER_ELEMENT):r.from(t)):new r(0)}function*Xr(r,e){let t=function*(s){yield s},n=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof Zd?t(e):Br(e)?e:t(e);return yield*Qd((function*(s){let i=null;do i=s.next(yield ee(r,i));while(!i.done)})(n[Symbol.iterator]())),new r}function Fr(r,e){return _t(this,arguments,function*(){if(Yt(e))return yield Y(yield Y(yield*Ao(Ht(Fr(r,yield Y(e))))));let n=function(o){return _t(this,arguments,function*(){yield yield Y(yield Y(o))})},s=function(o){return _t(this,arguments,function*(){yield Y(yield*Ao(Ht(Qd((function*(a){let c=null;do c=a.next(yield c?.value);while(!c.done)})(o[Symbol.iterator]())))))})},i=typeof e=="string"||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof Zd?n(e):Br(e)?s(e):br(e)?e:n(e);return yield Y(yield*Ao(Ht(Qd((function(o){return _t(this,arguments,function*(){let a=null;do a=yield Y(o.next(yield yield Y(ee(r,a))));while(!a.done)})})(i[Symbol.asyncIterator]()))))),yield Y(new r)})}function Du(r,e,t){if(r!==0){t=t.slice(0,e);let n=typeof t[0]=="bigint"?BigInt(r):r;for(let s=-1,i=t.length;++s<i;)t[s]+=n}return t.subarray(0,e)}function rh(r,e){let t=0,n=r.length;if(n!==e.length)return!1;if(n>0)do if(r[t]!==e[t])return!1;while(++t<n);return!0}var Zd,HB,JB,ui,Pa,k,YB,QB,ZB,eF,tF,rF,Qd,nF,sF,iF,eh,oF,aF,cF,uF,lF,fF,dF,hF,th,pF,mF,bF,gF,yF,Ke=p(()=>{kt();gn();Yn();Zd=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:ArrayBuffer;HB=r=>ee(Int8Array,r),JB=r=>ee(Int16Array,r),ui=r=>ee(Int32Array,r),Pa=r=>ee(BigInt64Array,r),k=r=>ee(Uint8Array,r),YB=r=>ee(Uint16Array,r),QB=r=>ee(Uint32Array,r),ZB=r=>ee(BigUint64Array,r),eF=r=>ee(Float32Array,r),tF=r=>ee(Float64Array,r),rF=r=>ee(Uint8ClampedArray,r),Qd=r=>(r.next(),r);nF=r=>Xr(Int8Array,r),sF=r=>Xr(Int16Array,r),iF=r=>Xr(Int32Array,r),eh=r=>Xr(Uint8Array,r),oF=r=>Xr(Uint16Array,r),aF=r=>Xr(Uint32Array,r),cF=r=>Xr(Float32Array,r),uF=r=>Xr(Float64Array,r),lF=r=>Xr(Uint8ClampedArray,r);fF=r=>Fr(Int8Array,r),dF=r=>Fr(Int16Array,r),hF=r=>Fr(Int32Array,r),th=r=>Fr(Uint8Array,r),pF=r=>Fr(Uint16Array,r),mF=r=>Fr(Uint32Array,r),bF=r=>Fr(Float32Array,r),gF=r=>Fr(Float64Array,r),yF=r=>Fr(Uint8ClampedArray,r)});function*wF(r){let e,t=!1,n=[],s,i,o,a=0;function c(){return i==="peek"?Qt(n,o)[0]:([s,n,a]=Qt(n,o),s)}({cmd:i,size:o}=(yield null)||{cmd:"read",size:0});let u=eh(r)[Symbol.iterator]();try{do if({done:e,value:s}=Number.isNaN(o-a)?u.next():u.next(o-a),!e&&s.byteLength>0&&(n.push(s),a+=s.byteLength),e||o<=a)do({cmd:i,size:o}=yield c());while(o<a);while(!e)}catch(l){t=!0,typeof u.throw=="function"&&u.throw(l)}finally{t===!1&&typeof u.return=="function"&&u.return(null)}return null}function xF(r){return _t(this,arguments,function*(){let t,n=!1,s=[],i,o,a,c=0;function u(){return o==="peek"?Qt(s,a)[0]:([i,s,c]=Qt(s,a),i)}({cmd:o,size:a}=(yield yield Y(null))||{cmd:"read",size:0});let l=th(r)[Symbol.asyncIterator]();try{do if({done:t,value:i}=Number.isNaN(a-c)?yield Y(l.next()):yield Y(l.next(a-c)),!t&&i.byteLength>0&&(s.push(i),c+=i.byteLength),t||a<=c)do({cmd:o,size:a}=yield yield Y(u()));while(a<c);while(!t)}catch(f){n=!0,typeof l.throw=="function"&&(yield Y(l.throw(f)))}finally{n===!1&&typeof l.return=="function"&&(yield Y(l.return(new Uint8Array(0))))}return yield Y(null)})}function TF(r){return _t(this,arguments,function*(){let t=!1,n=!1,s=[],i,o,a,c=0;function u(){return o==="peek"?Qt(s,a)[0]:([i,s,c]=Qt(s,a),i)}({cmd:o,size:a}=(yield yield Y(null))||{cmd:"read",size:0});let l=new ih(r);try{do if({done:t,value:i}=Number.isNaN(a-c)?yield Y(l.read()):yield Y(l.read(a-c)),!t&&i.byteLength>0&&(s.push(k(i)),c+=i.byteLength),t||a<=c)do({cmd:o,size:a}=yield yield Y(u()));while(a<c);while(!t)}catch(f){n=!0,yield Y(l.cancel(f))}finally{n===!1?yield Y(l.cancel()):r.locked&&l.releaseLock()}return yield Y(null)})}function _F(r){return _t(this,arguments,function*(){let t=[],n="error",s=!1,i=null,o,a,c=0,u=[],l;function f(){return o==="peek"?Qt(u,a)[0]:([l,u,c]=Qt(u,a),l)}if({cmd:o,size:a}=(yield yield Y(null))||{cmd:"read",size:0},r.isTTY)return yield yield Y(new Uint8Array(0)),yield Y(null);try{t[0]=sh(r,"end"),t[1]=sh(r,"error");do{if(t[2]=sh(r,"readable"),[n,i]=yield Y(Promise.race(t.map(h=>h[2]))),n==="error")break;if((s=n==="end")||(Number.isFinite(a-c)?(l=k(r.read(a-c)),l.byteLength<a-c&&(l=k(r.read()))):l=k(r.read()),l.byteLength>0&&(u.push(l),c+=l.byteLength)),s||a<=c)do({cmd:o,size:a}=yield yield Y(f()));while(a<c)}while(!s)}finally{yield Y(d(t,n==="error"?i:null))}return yield Y(null);function d(h,m){return l=u=null,new Promise((b,g)=>{for(let[y,x]of h)r.off(y,x);try{let y=r.destroy;y&&y.call(r,m),m=void 0}catch(y){m=y||m}finally{m!=null?g(m):b()}})}})}var Qe,Ru,ih,sh,Va=p(()=>{kt();Ke();Qe={fromIterable(r){return Ru(wF(r))},fromAsyncIterable(r){return Ru(xF(r))},fromDOMStream(r){return Ru(TF(r))},fromNodeStream(r){return Ru(_F(r))},toDOMStream(r,e){throw new Error('"toDOMStream" not available in this environment')},toNodeStream(r,e){throw new Error('"toNodeStream" not available in this environment')}},Ru=r=>(r.next(),r);ih=class{constructor(e){this.source=e,this.reader=null,this.reader=this.source.getReader(),this.reader.closed.catch(()=>{})}get closed(){return this.reader?this.reader.closed.catch(()=>{}):Promise.resolve()}releaseLock(){this.reader&&this.reader.releaseLock(),this.reader=null}cancel(e){return F(this,void 0,void 0,function*(){let{reader:t,source:n}=this;t&&(yield t.cancel(e).catch(()=>{})),n&&n.locked&&this.releaseLock()})}read(e){return F(this,void 0,void 0,function*(){if(e===0)return{done:this.reader==null,value:new Uint8Array(0)};let t=yield this.reader.read();return!t.done&&(t.value=k(t)),t})}},sh=(r,e)=>{let t=s=>n([e,s]),n;return[e,t,new Promise(s=>(n=s)&&r.once(e,t))]}});var ge,ku=p(()=>{(function(r){r[r.V1=0]="V1",r[r.V2=1]="V2",r[r.V3=2]="V3",r[r.V4=3]="V4",r[r.V5=4]="V5"})(ge||(ge={}))});var he,oh=p(()=>{(function(r){r[r.Sparse=0]="Sparse",r[r.Dense=1]="Dense"})(he||(he={}))});var le,ah=p(()=>{(function(r){r[r.HALF=0]="HALF",r[r.SINGLE=1]="SINGLE",r[r.DOUBLE=2]="DOUBLE"})(le||(le={}))});var ye,ch=p(()=>{(function(r){r[r.DAY=0]="DAY",r[r.MILLISECOND=1]="MILLISECOND"})(ye||(ye={}))});var L,ja=p(()=>{(function(r){r[r.SECOND=0]="SECOND",r[r.MILLISECOND=1]="MILLISECOND",r[r.MICROSECOND=2]="MICROSECOND",r[r.NANOSECOND=3]="NANOSECOND"})(L||(L={}))});var ae,uh=p(()=>{(function(r){r[r.YEAR_MONTH=0]="YEAR_MONTH",r[r.DAY_TIME=1]="DAY_TIME",r[r.MONTH_DAY_NANO=2]="MONTH_DAY_NANO"})(ae||(ae={}))});var Nu=p(()=>{});var Hr,Cu,Uu,Io,lh=p(()=>{Hr=new Int32Array(2),Cu=new Float32Array(Hr.buffer),Uu=new Float64Array(Hr.buffer),Io=new Uint16Array(new Uint8Array([1,0]).buffer)[0]===1});var Ga,fh=p(()=>{(function(r){r[r.UTF8_BYTES=1]="UTF8_BYTES",r[r.UTF16_STRING=2]="UTF16_STRING"})(Ga||(Ga={}))});var Ze,dh=p(()=>{Nu();fh();lh();Ze=class r{constructor(e){this.bytes_=e,this.position_=0,this.text_decoder_=new TextDecoder}static allocate(e){return new r(new Uint8Array(e))}clear(){this.position_=0}bytes(){return this.bytes_}position(){return this.position_}setPosition(e){this.position_=e}capacity(){return this.bytes_.length}readInt8(e){return this.readUint8(e)<<24>>24}readUint8(e){return this.bytes_[e]}readInt16(e){return this.readUint16(e)<<16>>16}readUint16(e){return this.bytes_[e]|this.bytes_[e+1]<<8}readInt32(e){return this.bytes_[e]|this.bytes_[e+1]<<8|this.bytes_[e+2]<<16|this.bytes_[e+3]<<24}readUint32(e){return this.readInt32(e)>>>0}readInt64(e){return BigInt.asIntN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readUint64(e){return BigInt.asUintN(64,BigInt(this.readUint32(e))+(BigInt(this.readUint32(e+4))<<BigInt(32)))}readFloat32(e){return Hr[0]=this.readInt32(e),Cu[0]}readFloat64(e){return Hr[Io?0:1]=this.readInt32(e),Hr[Io?1:0]=this.readInt32(e+4),Uu[0]}writeInt8(e,t){this.bytes_[e]=t}writeUint8(e,t){this.bytes_[e]=t}writeInt16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeUint16(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8}writeInt32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeUint32(e,t){this.bytes_[e]=t,this.bytes_[e+1]=t>>8,this.bytes_[e+2]=t>>16,this.bytes_[e+3]=t>>24}writeInt64(e,t){this.writeInt32(e,Number(BigInt.asIntN(32,t))),this.writeInt32(e+4,Number(BigInt.asIntN(32,t>>BigInt(32))))}writeUint64(e,t){this.writeUint32(e,Number(BigInt.asUintN(32,t))),this.writeUint32(e+4,Number(BigInt.asUintN(32,t>>BigInt(32))))}writeFloat32(e,t){Cu[0]=t,this.writeInt32(e,Hr[0])}writeFloat64(e,t){Uu[0]=t,this.writeInt32(e,Hr[Io?0:1]),this.writeInt32(e+4,Hr[Io?1:0])}getBufferIdentifier(){if(this.bytes_.length<this.position_+4+4)throw new Error("FlatBuffers: ByteBuffer is too short to contain an identifier.");let e="";for(let t=0;t<4;t++)e+=String.fromCharCode(this.readInt8(this.position_+4+t));return e}__offset(e,t){let n=e-this.readInt32(e);return t<this.readInt16(n)?this.readInt16(n+t):0}__union(e,t){return e.bb_pos=t+this.readInt32(t),e.bb=this,e}__string(e,t){e+=this.readInt32(e);let n=this.readInt32(e);e+=4;let s=this.bytes_.subarray(e,e+n);return t===Ga.UTF8_BYTES?s:this.text_decoder_.decode(s)}__union_with_string(e,t){return typeof e=="string"?this.__string(t):this.__union(e,t)}__indirect(e){return e+this.readInt32(e)}__vector(e){return e+this.readInt32(e)+4}__vector_len(e){return this.readInt32(e+this.readInt32(e))}__has_identifier(e){if(e.length!=4)throw new Error("FlatBuffers: file identifier must be length "+4);for(let t=0;t<4;t++)if(e.charCodeAt(t)!=this.readInt8(this.position()+4+t))return!1;return!0}createScalarList(e,t){let n=[];for(let s=0;s<t;++s){let i=e(s);i!==null&&n.push(i)}return n}createObjList(e,t){let n=[];for(let s=0;s<t;++s){let i=e(s);i!==null&&n.push(i.unpack())}return n}}});var li,yx=p(()=>{dh();Nu();li=class r{constructor(e){this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null,this.text_encoder=new TextEncoder;let t;e?t=e:t=1024,this.bb=Ze.allocate(t),this.space=t}clear(){this.bb.clear(),this.space=this.bb.capacity(),this.minalign=1,this.vtable=null,this.vtable_in_use=0,this.isNested=!1,this.object_start=0,this.vtables=[],this.vector_num_elems=0,this.force_defaults=!1,this.string_maps=null}forceDefaults(e){this.force_defaults=e}dataBuffer(){return this.bb}asUint8Array(){return this.bb.bytes().subarray(this.bb.position(),this.bb.position()+this.offset())}prep(e,t){e>this.minalign&&(this.minalign=e);let n=~(this.bb.capacity()-this.space+t)+1&e-1;for(;this.space<n+e+t;){let s=this.bb.capacity();this.bb=r.growByteBuffer(this.bb),this.space+=this.bb.capacity()-s}this.pad(n)}pad(e){for(let t=0;t<e;t++)this.bb.writeInt8(--this.space,0)}writeInt8(e){this.bb.writeInt8(this.space-=1,e)}writeInt16(e){this.bb.writeInt16(this.space-=2,e)}writeInt32(e){this.bb.writeInt32(this.space-=4,e)}writeInt64(e){this.bb.writeInt64(this.space-=8,e)}writeFloat32(e){this.bb.writeFloat32(this.space-=4,e)}writeFloat64(e){this.bb.writeFloat64(this.space-=8,e)}addInt8(e){this.prep(1,0),this.writeInt8(e)}addInt16(e){this.prep(2,0),this.writeInt16(e)}addInt32(e){this.prep(4,0),this.writeInt32(e)}addInt64(e){this.prep(8,0),this.writeInt64(e)}addFloat32(e){this.prep(4,0),this.writeFloat32(e)}addFloat64(e){this.prep(8,0),this.writeFloat64(e)}addFieldInt8(e,t,n){(this.force_defaults||t!=n)&&(this.addInt8(t),this.slot(e))}addFieldInt16(e,t,n){(this.force_defaults||t!=n)&&(this.addInt16(t),this.slot(e))}addFieldInt32(e,t,n){(this.force_defaults||t!=n)&&(this.addInt32(t),this.slot(e))}addFieldInt64(e,t,n){(this.force_defaults||t!==n)&&(this.addInt64(t),this.slot(e))}addFieldFloat32(e,t,n){(this.force_defaults||t!=n)&&(this.addFloat32(t),this.slot(e))}addFieldFloat64(e,t,n){(this.force_defaults||t!=n)&&(this.addFloat64(t),this.slot(e))}addFieldOffset(e,t,n){(this.force_defaults||t!=n)&&(this.addOffset(t),this.slot(e))}addFieldStruct(e,t,n){t!=n&&(this.nested(t),this.slot(e))}nested(e){if(e!=this.offset())throw new TypeError("FlatBuffers: struct must be serialized inline.")}notNested(){if(this.isNested)throw new TypeError("FlatBuffers: object serialization must not be nested.")}slot(e){this.vtable!==null&&(this.vtable[e]=this.offset())}offset(){return this.bb.capacity()-this.space}static growByteBuffer(e){let t=e.capacity();if(t&3221225472)throw new Error("FlatBuffers: cannot grow buffer beyond 2 gigabytes.");let n=t<<1,s=Ze.allocate(n);return s.setPosition(n-t),s.bytes().set(e.bytes(),n-t),s}addOffset(e){this.prep(4,0),this.writeInt32(this.offset()-e+4)}startObject(e){this.notNested(),this.vtable==null&&(this.vtable=[]),this.vtable_in_use=e;for(let t=0;t<e;t++)this.vtable[t]=0;this.isNested=!0,this.object_start=this.offset()}endObject(){if(this.vtable==null||!this.isNested)throw new Error("FlatBuffers: endObject called without startObject");this.addInt32(0);let e=this.offset(),t=this.vtable_in_use-1;for(;t>=0&&this.vtable[t]==0;t--);let n=t+1;for(;t>=0;t--)this.addInt16(this.vtable[t]!=0?e-this.vtable[t]:0);let s=2;this.addInt16(e-this.object_start);let i=(n+s)*2;this.addInt16(i);let o=0,a=this.space;e:for(t=0;t<this.vtables.length;t++){let c=this.bb.capacity()-this.vtables[t];if(i==this.bb.readInt16(c)){for(let u=2;u<i;u+=2)if(this.bb.readInt16(a+u)!=this.bb.readInt16(c+u))continue e;o=this.vtables[t];break}}return o?(this.space=this.bb.capacity()-e,this.bb.writeInt32(this.space,o-e)):(this.vtables.push(this.offset()),this.bb.writeInt32(this.bb.capacity()-e,this.offset()-e)),this.isNested=!1,e}finish(e,t,n){let s=n?4:0;if(t){let i=t;if(this.prep(this.minalign,8+s),i.length!=4)throw new TypeError("FlatBuffers: file identifier must be length "+4);for(let o=3;o>=0;o--)this.writeInt8(i.charCodeAt(o))}this.prep(this.minalign,4+s),this.addOffset(e),s&&this.addInt32(this.bb.capacity()-this.space),this.bb.setPosition(this.space)}finishSizePrefixed(e,t){this.finish(e,t,!0)}requiredField(e,t){let n=this.bb.capacity()-e,s=n-this.bb.readInt32(n);if(!(t<this.bb.readInt16(s)&&this.bb.readInt16(s+t)!=0))throw new TypeError("FlatBuffers: field "+t+" must be set")}startVector(e,t,n){this.notNested(),this.vector_num_elems=t,this.prep(4,e*t),this.prep(n,e*t)}endVector(){return this.writeInt32(this.vector_num_elems),this.offset()}createSharedString(e){if(!e)return 0;if(this.string_maps||(this.string_maps=new Map),this.string_maps.has(e))return this.string_maps.get(e);let t=this.createString(e);return this.string_maps.set(e,t),t}createString(e){if(e==null)return 0;let t;return e instanceof Uint8Array?t=e:t=this.text_encoder.encode(e),this.addInt8(0),this.startVector(1,t.length,1),this.bb.setPosition(this.space-=t.length),this.bb.bytes().set(t,this.space),this.endVector()}createByteVector(e){return e==null?0:(this.startVector(1,e.length,1),this.bb.setPosition(this.space-=e.length),this.bb.bytes().set(e,this.space),this.endVector())}createObjectOffset(e){return e===null?0:typeof e=="string"?this.createString(e):e.pack(this)}createObjectOffsetList(e){let t=[];for(let n=0;n<e.length;++n){let s=e[n];if(s!==null)t.push(this.createObjectOffset(s));else throw new TypeError("FlatBuffers: Argument for createObjectOffsetList cannot contain null.")}return t}createStructOffsetList(e,t){return t(this,e.length),this.createObjectOffsetList(e.slice().reverse()),this.endVector()}}});var ce=p(()=>{Nu();lh();yx();dh();fh()});var fi,hh=p(()=>{(function(r){r[r.BUFFER=0]="BUFFER"})(fi||(fi={}))});var et,So=p(()=>{(function(r){r[r.LZ4_FRAME=0]="LZ4_FRAME",r[r.ZSTD=1]="ZSTD"})(et||(et={}))});var yn,ph=p(()=>{ce();hh();So();yn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBodyCompression(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBodyCompression(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}codec(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt8(this.bb_pos+e):et.LZ4_FRAME}method(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt8(this.bb_pos+e):fi.BUFFER}static startBodyCompression(e){e.startObject(2)}static addCodec(e,t){e.addFieldInt8(0,t,et.LZ4_FRAME)}static addMethod(e,t){e.addFieldInt8(1,t,fi.BUFFER)}static endBodyCompression(e){return e.endObject()}static createBodyCompression(e,t,n){return r.startBodyCompression(e),r.addCodec(e,t),r.addMethod(e,n),r.endBodyCompression(e)}}});var Eo,mh=p(()=>{Eo=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}offset(){return this.bb.readInt64(this.bb_pos)}length(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createBuffer(e,t,n){return e.prep(8,16),e.writeInt64(BigInt(n??0)),e.writeInt64(BigInt(t??0)),e.offset()}}});var Lo,bh=p(()=>{Lo=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}length(){return this.bb.readInt64(this.bb_pos)}nullCount(){return this.bb.readInt64(this.bb_pos+8)}static sizeOf(){return 16}static createFieldNode(e,t,n){return e.prep(8,16),e.writeInt64(BigInt(n??0)),e.writeInt64(BigInt(t??0)),e.offset()}}});var ot,gh=p(()=>{ce();ph();mh();bh();ot=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsRecordBatch(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsRecordBatch(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}length(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}nodes(e,t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new Lo).__init(this.bb.__vector(this.bb_pos+n)+e*16,this.bb):null}nodesLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}buffers(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new Eo).__init(this.bb.__vector(this.bb_pos+n)+e*16,this.bb):null}buffersLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}compression(e){let t=this.bb.__offset(this.bb_pos,10);return t?(e||new yn).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}variadicBufferCounts(e){let t=this.bb.__offset(this.bb_pos,12);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+e*8):BigInt(0)}variadicBufferCountsLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startRecordBatch(e){e.startObject(5)}static addLength(e,t){e.addFieldInt64(0,t,BigInt("0"))}static addNodes(e,t){e.addFieldOffset(1,t,0)}static startNodesVector(e,t){e.startVector(16,t,8)}static addBuffers(e,t){e.addFieldOffset(2,t,0)}static startBuffersVector(e,t){e.startVector(16,t,8)}static addCompression(e,t){e.addFieldOffset(3,t,0)}static addVariadicBufferCounts(e,t){e.addFieldOffset(4,t,0)}static createVariadicBufferCountsVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startVariadicBufferCountsVector(e,t){e.startVector(8,t,8)}static endRecordBatch(e){return e.endObject()}}});var wn,wx=p(()=>{ce();gh();wn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDictionaryBatch(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryBatch(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}id(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}data(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new ot).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}isDelta(){let e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startDictionaryBatch(e){e.startObject(3)}static addId(e,t){e.addFieldInt64(0,t,BigInt("0"))}static addData(e,t){e.addFieldOffset(1,t,0)}static addIsDelta(e,t){e.addFieldInt8(2,+t,0)}static endDictionaryBatch(e){return e.endObject()}}});var Qn,yh=p(()=>{(function(r){r[r.Little=0]="Little",r[r.Big=1]="Big"})(Qn||(Qn={}))});var za,xx=p(()=>{(function(r){r[r.DenseArray=0]="DenseArray"})(za||(za={}))});var Mr,Vu=p(()=>{ce();Mr=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsInt(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInt(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}bitWidth(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}isSigned(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startInt(e){e.startObject(2)}static addBitWidth(e,t){e.addFieldInt32(0,t,0)}static addIsSigned(e,t){e.addFieldInt8(1,+t,0)}static endInt(e){return e.endObject()}static createInt(e,t,n){return r.startInt(e),r.addBitWidth(e,t),r.addIsSigned(e,n),r.endInt(e)}}});var Jr,wh=p(()=>{ce();xx();Vu();Jr=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDictionaryEncoding(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDictionaryEncoding(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}id(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}indexType(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new Mr).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}isOrdered(){let e=this.bb.__offset(this.bb_pos,8);return e?!!this.bb.readInt8(this.bb_pos+e):!1}dictionaryKind(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt16(this.bb_pos+e):za.DenseArray}static startDictionaryEncoding(e){e.startObject(4)}static addId(e,t){e.addFieldInt64(0,t,BigInt("0"))}static addIndexType(e,t){e.addFieldOffset(1,t,0)}static addIsOrdered(e,t){e.addFieldInt8(2,+t,0)}static addDictionaryKind(e,t){e.addFieldInt16(3,t,za.DenseArray)}static endDictionaryEncoding(e){return e.endObject()}}});var Oe,Bo=p(()=>{ce();Oe=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsKeyValue(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsKeyValue(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}key(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}value(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}static startKeyValue(e){e.startObject(2)}static addKey(e,t){e.addFieldOffset(0,t,0)}static addValue(e,t){e.addFieldOffset(1,t,0)}static endKeyValue(e){return e.endObject()}static createKeyValue(e,t,n){return r.startKeyValue(e),r.addKey(e,t),r.addValue(e,n),r.endKeyValue(e)}}});var Wa,Tx=p(()=>{ce();Wa=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBinary(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBinary(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startBinary(e){e.startObject(0)}static endBinary(e){return e.endObject()}static createBinary(e){return r.startBinary(e),r.endBinary(e)}}});var $a,_x=p(()=>{ce();$a=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBinaryView(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBinaryView(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startBinaryView(e){e.startObject(0)}static endBinaryView(e){return e.endObject()}static createBinaryView(e){return r.startBinaryView(e),r.endBinaryView(e)}}});var qa,Ax=p(()=>{ce();qa=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsBool(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsBool(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startBool(e){e.startObject(0)}static endBool(e){return e.endObject()}static createBool(e){return r.startBool(e),r.endBool(e)}}});var Zn,xh=p(()=>{ce();ch();Zn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDate(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDate(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):ye.MILLISECOND}static startDate(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,ye.MILLISECOND)}static endDate(e){return e.endObject()}static createDate(e,t){return r.startDate(e),r.addUnit(e,t),r.endDate(e)}}});var Yr,Th=p(()=>{ce();Yr=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDecimal(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDecimal(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}scale(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):0}bitWidth(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readInt32(this.bb_pos+e):128}static startDecimal(e){e.startObject(3)}static addPrecision(e,t){e.addFieldInt32(0,t,0)}static addScale(e,t){e.addFieldInt32(1,t,0)}static addBitWidth(e,t){e.addFieldInt32(2,t,128)}static endDecimal(e){return e.endObject()}static createDecimal(e,t,n,s){return r.startDecimal(e),r.addPrecision(e,t),r.addScale(e,n),r.addBitWidth(e,s),r.endDecimal(e)}}});var es,_h=p(()=>{ce();ja();es=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsDuration(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsDuration(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):L.MILLISECOND}static startDuration(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,L.MILLISECOND)}static endDuration(e){return e.endObject()}static createDuration(e,t){return r.startDuration(e),r.addUnit(e,t),r.endDuration(e)}}});var ts,Ah=p(()=>{ce();ts=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFixedSizeBinary(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeBinary(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}byteWidth(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeBinary(e){e.startObject(1)}static addByteWidth(e,t){e.addFieldInt32(0,t,0)}static endFixedSizeBinary(e){return e.endObject()}static createFixedSizeBinary(e,t){return r.startFixedSizeBinary(e),r.addByteWidth(e,t),r.endFixedSizeBinary(e)}}});var rs,vh=p(()=>{ce();rs=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFixedSizeList(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFixedSizeList(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}listSize(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt32(this.bb_pos+e):0}static startFixedSizeList(e){e.startObject(1)}static addListSize(e,t){e.addFieldInt32(0,t,0)}static endFixedSizeList(e){return e.endObject()}static createFixedSizeList(e,t){return r.startFixedSizeList(e),r.addListSize(e,t),r.endFixedSizeList(e)}}});var ns,Ih=p(()=>{ce();ah();ns=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFloatingPoint(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFloatingPoint(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}precision(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):le.HALF}static startFloatingPoint(e){e.startObject(1)}static addPrecision(e,t){e.addFieldInt16(0,t,le.HALF)}static endFloatingPoint(e){return e.endObject()}static createFloatingPoint(e,t){return r.startFloatingPoint(e),r.addPrecision(e,t),r.endFloatingPoint(e)}}});var ss,Sh=p(()=>{ce();uh();ss=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsInterval(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsInterval(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):ae.YEAR_MONTH}static startInterval(e){e.startObject(1)}static addUnit(e,t){e.addFieldInt16(0,t,ae.YEAR_MONTH)}static endInterval(e){return e.endObject()}static createInterval(e,t){return r.startInterval(e),r.addUnit(e,t),r.endInterval(e)}}});var Ka,vx=p(()=>{ce();Ka=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsLargeBinary(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeBinary(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startLargeBinary(e){e.startObject(0)}static endLargeBinary(e){return e.endObject()}static createLargeBinary(e){return r.startLargeBinary(e),r.endLargeBinary(e)}}});var Xa,Ix=p(()=>{ce();Xa=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsLargeList(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeList(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startLargeList(e){e.startObject(0)}static endLargeList(e){return e.endObject()}static createLargeList(e){return r.startLargeList(e),r.endLargeList(e)}}});var Ha,Sx=p(()=>{ce();Ha=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsLargeUtf8(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsLargeUtf8(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startLargeUtf8(e){e.startObject(0)}static endLargeUtf8(e){return e.endObject()}static createLargeUtf8(e){return r.startLargeUtf8(e),r.endLargeUtf8(e)}}});var Ja,Ex=p(()=>{ce();Ja=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsList(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsList(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startList(e){e.startObject(0)}static endList(e){return e.endObject()}static createList(e){return r.startList(e),r.endList(e)}}});var is,Eh=p(()=>{ce();is=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMap(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMap(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}keysSorted(){let e=this.bb.__offset(this.bb_pos,4);return e?!!this.bb.readInt8(this.bb_pos+e):!1}static startMap(e){e.startObject(1)}static addKeysSorted(e,t){e.addFieldInt8(0,+t,0)}static endMap(e){return e.endObject()}static createMap(e,t){return r.startMap(e),r.addKeysSorted(e,t),r.endMap(e)}}});var Ya,Lx=p(()=>{ce();Ya=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsNull(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsNull(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startNull(e){e.startObject(0)}static endNull(e){return e.endObject()}static createNull(e){return r.startNull(e),r.endNull(e)}}});var Qa,Bx=p(()=>{ce();Qa=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsStruct_(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsStruct_(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startStruct_(e){e.startObject(0)}static endStruct_(e){return e.endObject()}static createStruct_(e){return r.startStruct_(e),r.endStruct_(e)}}});var xn,Lh=p(()=>{ce();ja();xn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTime(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTime(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):L.MILLISECOND}bitWidth(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readInt32(this.bb_pos+e):32}static startTime(e){e.startObject(2)}static addUnit(e,t){e.addFieldInt16(0,t,L.MILLISECOND)}static addBitWidth(e,t){e.addFieldInt32(1,t,32)}static endTime(e){return e.endObject()}static createTime(e,t,n){return r.startTime(e),r.addUnit(e,t),r.addBitWidth(e,n),r.endTime(e)}}});var Tn,Bh=p(()=>{ce();ja();Tn=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsTimestamp(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsTimestamp(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}unit(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):L.SECOND}timezone(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.__string(this.bb_pos+t,e):null}static startTimestamp(e){e.startObject(2)}static addUnit(e,t){e.addFieldInt16(0,t,L.SECOND)}static addTimezone(e,t){e.addFieldOffset(1,t,0)}static endTimestamp(e){return e.endObject()}static createTimestamp(e,t,n){return r.startTimestamp(e),r.addUnit(e,t),r.addTimezone(e,n),r.endTimestamp(e)}}});var Dr,Fh=p(()=>{ce();oh();Dr=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUnion(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUnion(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}mode(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):he.Sparse}typeIds(e){let t=this.bb.__offset(this.bb_pos,6);return t?this.bb.readInt32(this.bb.__vector(this.bb_pos+t)+e*4):0}typeIdsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}typeIdsArray(){let e=this.bb.__offset(this.bb_pos,6);return e?new Int32Array(this.bb.bytes().buffer,this.bb.bytes().byteOffset+this.bb.__vector(this.bb_pos+e),this.bb.__vector_len(this.bb_pos+e)):null}static startUnion(e){e.startObject(2)}static addMode(e,t){e.addFieldInt16(0,t,he.Sparse)}static addTypeIds(e,t){e.addFieldOffset(1,t,0)}static createTypeIdsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addInt32(t[n]);return e.endVector()}static startTypeIdsVector(e,t){e.startVector(4,t,4)}static endUnion(e){return e.endObject()}static createUnion(e,t,n){return r.startUnion(e),r.addMode(e,t),r.addTypeIds(e,n),r.endUnion(e)}}});var Za,Fx=p(()=>{ce();Za=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUtf8(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUtf8(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startUtf8(e){e.startObject(0)}static endUtf8(e){return e.endObject()}static createUtf8(e){return r.startUtf8(e),r.endUtf8(e)}}});var ec,Ox=p(()=>{ce();ec=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsUtf8View(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsUtf8View(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static startUtf8View(e){e.startObject(0)}static endUtf8View(e){return e.endObject()}static createUtf8View(e){return r.startUtf8View(e),r.endUtf8View(e)}}});var z,ju=p(()=>{(function(r){r[r.NONE=0]="NONE",r[r.Null=1]="Null",r[r.Int=2]="Int",r[r.FloatingPoint=3]="FloatingPoint",r[r.Binary=4]="Binary",r[r.Utf8=5]="Utf8",r[r.Bool=6]="Bool",r[r.Decimal=7]="Decimal",r[r.Date=8]="Date",r[r.Time=9]="Time",r[r.Timestamp=10]="Timestamp",r[r.Interval=11]="Interval",r[r.List=12]="List",r[r.Struct_=13]="Struct_",r[r.Union=14]="Union",r[r.FixedSizeBinary=15]="FixedSizeBinary",r[r.FixedSizeList=16]="FixedSizeList",r[r.Map=17]="Map",r[r.Duration=18]="Duration",r[r.LargeBinary=19]="LargeBinary",r[r.LargeUtf8=20]="LargeUtf8",r[r.LargeList=21]="LargeList",r[r.RunEndEncoded=22]="RunEndEncoded",r[r.BinaryView=23]="BinaryView",r[r.Utf8View=24]="Utf8View",r[r.ListView=25]="ListView",r[r.LargeListView=26]="LargeListView"})(z||(z={}))});var at,Oh=p(()=>{ce();wh();Bo();ju();at=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsField(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsField(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}name(e){let t=this.bb.__offset(this.bb_pos,4);return t?this.bb.__string(this.bb_pos+t,e):null}nullable(){let e=this.bb.__offset(this.bb_pos,6);return e?!!this.bb.readInt8(this.bb_pos+e):!1}typeType(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.readUint8(this.bb_pos+e):z.NONE}type(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.__union(e,this.bb_pos+t):null}dictionary(e){let t=this.bb.__offset(this.bb_pos,12);return t?(e||new Jr).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}children(e,t){let n=this.bb.__offset(this.bb_pos,14);return n?(t||new r).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}childrenLength(){let e=this.bb.__offset(this.bb_pos,14);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,16);return n?(t||new Oe).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,16);return e?this.bb.__vector_len(this.bb_pos+e):0}static startField(e){e.startObject(7)}static addName(e,t){e.addFieldOffset(0,t,0)}static addNullable(e,t){e.addFieldInt8(1,+t,0)}static addTypeType(e,t){e.addFieldInt8(2,t,z.NONE)}static addType(e,t){e.addFieldOffset(3,t,0)}static addDictionary(e,t){e.addFieldOffset(4,t,0)}static addChildren(e,t){e.addFieldOffset(5,t,0)}static createChildrenVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startChildrenVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(6,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endField(e){return e.endObject()}}});var Nt,Mh=p(()=>{ce();yh();Oh();Bo();Nt=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsSchema(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsSchema(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}endianness(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):Qn.Little}fields(e,t){let n=this.bb.__offset(this.bb_pos,6);return n?(t||new at).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}fieldsLength(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new Oe).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}features(e){let t=this.bb.__offset(this.bb_pos,10);return t?this.bb.readInt64(this.bb.__vector(this.bb_pos+t)+e*8):BigInt(0)}featuresLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}static startSchema(e){e.startObject(4)}static addEndianness(e,t){e.addFieldInt16(0,t,Qn.Little)}static addFields(e,t){e.addFieldOffset(1,t,0)}static createFieldsVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startFieldsVector(e,t){e.startVector(4,t,4)}static addCustomMetadata(e,t){e.addFieldOffset(2,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static addFeatures(e,t){e.addFieldOffset(3,t,0)}static createFeaturesVector(e,t){e.startVector(8,t.length,8);for(let n=t.length-1;n>=0;n--)e.addInt64(t[n]);return e.endVector()}static startFeaturesVector(e,t){e.startVector(8,t,8)}static endSchema(e){return e.endObject()}static createSchema(e,t,n,s,i){return r.startSchema(e),r.addEndianness(e,t),r.addFields(e,n),r.addCustomMetadata(e,s),r.addFeatures(e,i),r.endSchema(e)}}});var se,Gu=p(()=>{(function(r){r[r.NONE=0]="NONE",r[r.Schema=1]="Schema",r[r.DictionaryBatch=2]="DictionaryBatch",r[r.RecordBatch=3]="RecordBatch",r[r.Tensor=4]="Tensor",r[r.SparseTensor=5]="SparseTensor"})(se||(se={}))});var w,re,Me=p(()=>{ku();oh();ah();ch();ja();uh();Gu();(function(r){r[r.NONE=0]="NONE",r[r.Null=1]="Null",r[r.Int=2]="Int",r[r.Float=3]="Float",r[r.Binary=4]="Binary",r[r.Utf8=5]="Utf8",r[r.Bool=6]="Bool",r[r.Decimal=7]="Decimal",r[r.Date=8]="Date",r[r.Time=9]="Time",r[r.Timestamp=10]="Timestamp",r[r.Interval=11]="Interval",r[r.List=12]="List",r[r.Struct=13]="Struct",r[r.Union=14]="Union",r[r.FixedSizeBinary=15]="FixedSizeBinary",r[r.FixedSizeList=16]="FixedSizeList",r[r.Map=17]="Map",r[r.Duration=18]="Duration",r[r.LargeBinary=19]="LargeBinary",r[r.LargeUtf8=20]="LargeUtf8",r[r.LargeList=21]="LargeList",r[r.BinaryView=23]="BinaryView",r[r.Utf8View=24]="Utf8View",r[r.Dictionary=-1]="Dictionary",r[r.Int8=-2]="Int8",r[r.Int16=-3]="Int16",r[r.Int32=-4]="Int32",r[r.Int64=-5]="Int64",r[r.Uint8=-6]="Uint8",r[r.Uint16=-7]="Uint16",r[r.Uint32=-8]="Uint32",r[r.Uint64=-9]="Uint64",r[r.Float16=-10]="Float16",r[r.Float32=-11]="Float32",r[r.Float64=-12]="Float64",r[r.DateDay=-13]="DateDay",r[r.DateMillisecond=-14]="DateMillisecond",r[r.TimestampSecond=-15]="TimestampSecond",r[r.TimestampMillisecond=-16]="TimestampMillisecond",r[r.TimestampMicrosecond=-17]="TimestampMicrosecond",r[r.TimestampNanosecond=-18]="TimestampNanosecond",r[r.TimeSecond=-19]="TimeSecond",r[r.TimeMillisecond=-20]="TimeMillisecond",r[r.TimeMicrosecond=-21]="TimeMicrosecond",r[r.TimeNanosecond=-22]="TimeNanosecond",r[r.DenseUnion=-23]="DenseUnion",r[r.SparseUnion=-24]="SparseUnion",r[r.IntervalDayTime=-25]="IntervalDayTime",r[r.IntervalYearMonth=-26]="IntervalYearMonth",r[r.DurationSecond=-27]="DurationSecond",r[r.DurationMillisecond=-28]="DurationMillisecond",r[r.DurationMicrosecond=-29]="DurationMicrosecond",r[r.DurationNanosecond=-30]="DurationNanosecond",r[r.IntervalMonthDayNano=-31]="IntervalMonthDayNano"})(w||(w={}));(function(r){r[r.OFFSET=0]="OFFSET",r[r.DATA=1]="DATA",r[r.VALIDITY=2]="VALIDITY",r[r.TYPE=3]="TYPE"})(re||(re={}))});var Dh={};J(Dh,{valueToString:()=>Rr});function Rr(r){if(r===null)return"null";if(r===void 0)return"undefined";switch(typeof r){case"number":return`${r}`;case"bigint":return`${r}`;case"string":return`"${r}"`}return typeof r[Symbol.toPrimitive]=="function"?r[Symbol.toPrimitive]("string"):ArrayBuffer.isView(r)?r instanceof BigInt64Array||r instanceof BigUint64Array?`[${[...r].map(e=>Rr(e))}]`:`[${r}]`:ArrayBuffer.isView(r)?`[${r}]`:JSON.stringify(r,(e,t)=>typeof t=="bigint"?`${t}`:t)}var tc=p(()=>{});function te(r){if(typeof r=="bigint"&&(r<Number.MIN_SAFE_INTEGER||r>Number.MAX_SAFE_INTEGER))throw new TypeError(`${r} is not safe to convert to a number.`);return Number(r)}function Rh(r,e){return te(r/e)+te(r%e)/te(e)}var Qr=p(()=>{});var Ch={};J(Ch,{BN:()=>di,bigNumToBigInt:()=>Dx,bigNumToNumber:()=>Nh,bigNumToString:()=>Mo,isArrowBigNumSymbol:()=>Mx});function kr(r,...e){return e.length===0?Object.setPrototypeOf(ee(this.TypedArray,r),this.constructor.prototype):Object.setPrototypeOf(new this.TypedArray(r,...e),this.constructor.prototype)}function Fo(...r){return kr.apply(this,r)}function Oo(...r){return kr.apply(this,r)}function rc(...r){return kr.apply(this,r)}function Nh(r,e){let{buffer:t,byteOffset:n,byteLength:s,signed:i}=r,o=new BigUint64Array(t,n,s/8),a=i&&o.at(-1)&BigInt(1)<<BigInt(63),c=BigInt(0),u=0;if(a){for(let l of o)c|=(l^vF)*(BigInt(1)<<BigInt(64*u++));c*=BigInt(-1),c-=BigInt(1)}else for(let l of o)c|=l*(BigInt(1)<<BigInt(64*u++));if(typeof e=="number"&&e>0){let l=BigInt("1".padEnd(e+1,"0")),f=c/l,d=a?-(c%l):c%l,h=te(f),m=`${d}`.padStart(e,"0");return+`${a&&h===0?"-":""}${h}.${m}`}return te(c)}function Mo(r){if(r.byteLength===8)return`${new r.BigIntArray(r.buffer,r.byteOffset,1)[0]}`;if(!r.signed)return kh(r);let e=new Uint16Array(r.buffer,r.byteOffset,r.byteLength/2);if(new Int16Array([e.at(-1)])[0]>=0)return kh(r);e=e.slice();let n=1;for(let i=0;i<e.length;i++){let o=e[i],a=~o+n;e[i]=a,n&=o===0?1:0}return`-${kh(e)}`}function Dx(r){return r.byteLength===8?new r.BigIntArray(r.buffer,r.byteOffset,1)[0]:Mo(r)}function kh(r){let e="",t=new Uint32Array(2),n=new Uint16Array(r.buffer,r.byteOffset,r.byteLength/2),s=new Uint32Array((n=new Uint16Array(n).reverse()).buffer),i=-1,o=n.length-1;do{for(t[0]=n[i=0];i<o;)n[i++]=t[1]=t[0]/10,t[0]=(t[0]-t[1]*10<<16)+n[i];n[i]=t[1]=t[0]/10,t[0]=t[0]-t[1]*10,e=`${t[0]}${e}`}while(s[0]||s[1]||s[2]||s[3]);return e??"0"}var Mx,AF,vF,di,zu=p(()=>{Ke();Qr();Mx=Symbol.for("isArrowBigNum");kr.prototype[Mx]=!0;kr.prototype.toJSON=function(){return`"${Mo(this)}"`};kr.prototype.valueOf=function(r){return Nh(this,r)};kr.prototype.toString=function(){return Mo(this)};kr.prototype[Symbol.toPrimitive]=function(r="default"){switch(r){case"number":return Nh(this);case"string":return Mo(this);case"default":return Dx(this)}return Mo(this)};Object.setPrototypeOf(Fo.prototype,Object.create(Int32Array.prototype));Object.setPrototypeOf(Oo.prototype,Object.create(Uint32Array.prototype));Object.setPrototypeOf(rc.prototype,Object.create(Uint32Array.prototype));Object.assign(Fo.prototype,kr.prototype,{constructor:Fo,signed:!0,TypedArray:Int32Array,BigIntArray:BigInt64Array});Object.assign(Oo.prototype,kr.prototype,{constructor:Oo,signed:!1,TypedArray:Uint32Array,BigIntArray:BigUint64Array});Object.assign(rc.prototype,kr.prototype,{constructor:rc,signed:!0,TypedArray:Uint32Array,BigIntArray:BigUint64Array});AF=BigInt(4294967296)*BigInt(4294967296),vF=AF-BigInt(1);di=class r{static new(e,t){switch(t){case!0:return new Fo(e);case!1:return new Oo(e)}switch(e.constructor){case Int8Array:case Int16Array:case Int32Array:case BigInt64Array:return new Fo(e)}return e.byteLength===16?new rc(e):new Oo(e)}static signed(e){return new Fo(e)}static unsigned(e){return new Oo(e)}static decimal(e){return new rc(e)}constructor(e,t){return r.new(e,t)}}});function or(r){let e=r;switch(r.typeId){case w.Decimal:return r.bitWidth/32;case w.Interval:return e.unit===ae.MONTH_DAY_NANO?4:1+e.unit;case w.BinaryView:case w.Utf8View:return 16;case w.FixedSizeList:return e.listSize;case w.FixedSizeBinary:return e.byteWidth;default:return 1}}var Rx,kx,Nx,Cx,Ux,Px,Vx,jx,Gx,zx,Wx,$x,qx,Kx,Xx,Hx,Jx,Yx,Qx,Zx,eT,tT,rT,nT,sT,iT,E,Ne,Fe,Zt,er,Pe,tr,rr,nr,vt,Nr,ct,Cr,It,sr,Ct,Z,Ur,ut,St,Pr,lt,Ut,Et,os,as,tt,cs,us,ls,fs,rt,ds,Zr,hs,ps,ft,ms,bs,nc,Lt,sc,ic,oc,ac,je,ir,pe,Bt,_n,gs,Pt,Be,dt,IF,Ge,we=p(()=>{Qr();Me();iT=Symbol.for("apache-arrow/DataType"),E=class r{static isDataType(e){return e?.[iT]===!0}static isNull(e){return e?.typeId===w.Null}static isInt(e){return e?.typeId===w.Int}static isFloat(e){return e?.typeId===w.Float}static isBinary(e){return e?.typeId===w.Binary}static isBinaryView(e){return e?.typeId===w.BinaryView}static isLargeBinary(e){return e?.typeId===w.LargeBinary}static isUtf8(e){return e?.typeId===w.Utf8}static isUtf8View(e){return e?.typeId===w.Utf8View}static isLargeUtf8(e){return e?.typeId===w.LargeUtf8}static isBool(e){return e?.typeId===w.Bool}static isDecimal(e){return e?.typeId===w.Decimal}static isDate(e){return e?.typeId===w.Date}static isTime(e){return e?.typeId===w.Time}static isTimestamp(e){return e?.typeId===w.Timestamp}static isInterval(e){return e?.typeId===w.Interval}static isDuration(e){return e?.typeId===w.Duration}static isList(e){return e?.typeId===w.List}static isLargeList(e){return e?.typeId===w.LargeList}static isStruct(e){return e?.typeId===w.Struct}static isUnion(e){return e?.typeId===w.Union}static isFixedSizeBinary(e){return e?.typeId===w.FixedSizeBinary}static isFixedSizeList(e){return e?.typeId===w.FixedSizeList}static isMap(e){return e?.typeId===w.Map}static isDictionary(e){return e?.typeId===w.Dictionary}static isDenseUnion(e){return r.isUnion(e)&&e.mode===he.Dense}static isSparseUnion(e){return r.isUnion(e)&&e.mode===he.Sparse}constructor(e){this.typeId=e}};Rx=Symbol.toStringTag;E[Rx]=(r=>(r.children=null,r.ArrayType=Array,r.OffsetArrayType=Int32Array,r[iT]=!0,r[Symbol.toStringTag]="DataType"))(E.prototype);Ne=class extends E{constructor(){super(w.Null)}toString(){return"Null"}};kx=Symbol.toStringTag;Ne[kx]=(r=>r[Symbol.toStringTag]="Null")(Ne.prototype);Fe=class extends E{constructor(e,t){super(w.Int),this.isSigned=e,this.bitWidth=t}get ArrayType(){switch(this.bitWidth){case 8:return this.isSigned?Int8Array:Uint8Array;case 16:return this.isSigned?Int16Array:Uint16Array;case 32:return this.isSigned?Int32Array:Uint32Array;case 64:return this.isSigned?BigInt64Array:BigUint64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`${this.isSigned?"I":"Ui"}nt${this.bitWidth}`}};Nx=Symbol.toStringTag;Fe[Nx]=(r=>(r.isSigned=null,r.bitWidth=null,r[Symbol.toStringTag]="Int"))(Fe.prototype);Zt=class extends Fe{constructor(){super(!0,8)}get ArrayType(){return Int8Array}},er=class extends Fe{constructor(){super(!0,16)}get ArrayType(){return Int16Array}},Pe=class extends Fe{constructor(){super(!0,32)}get ArrayType(){return Int32Array}},tr=class extends Fe{constructor(){super(!0,64)}get ArrayType(){return BigInt64Array}},rr=class extends Fe{constructor(){super(!1,8)}get ArrayType(){return Uint8Array}},nr=class extends Fe{constructor(){super(!1,16)}get ArrayType(){return Uint16Array}},vt=class extends Fe{constructor(){super(!1,32)}get ArrayType(){return Uint32Array}},Nr=class extends Fe{constructor(){super(!1,64)}get ArrayType(){return BigUint64Array}};Object.defineProperty(Zt.prototype,"ArrayType",{value:Int8Array});Object.defineProperty(er.prototype,"ArrayType",{value:Int16Array});Object.defineProperty(Pe.prototype,"ArrayType",{value:Int32Array});Object.defineProperty(tr.prototype,"ArrayType",{value:BigInt64Array});Object.defineProperty(rr.prototype,"ArrayType",{value:Uint8Array});Object.defineProperty(nr.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(vt.prototype,"ArrayType",{value:Uint32Array});Object.defineProperty(Nr.prototype,"ArrayType",{value:BigUint64Array});ct=class extends E{constructor(e){super(w.Float),this.precision=e}get ArrayType(){switch(this.precision){case le.HALF:return Uint16Array;case le.SINGLE:return Float32Array;case le.DOUBLE:return Float64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}toString(){return`Float${this.precision<<5||16}`}};Cx=Symbol.toStringTag;ct[Cx]=(r=>(r.precision=null,r[Symbol.toStringTag]="Float"))(ct.prototype);Cr=class extends ct{constructor(){super(le.HALF)}},It=class extends ct{constructor(){super(le.SINGLE)}},sr=class extends ct{constructor(){super(le.DOUBLE)}};Object.defineProperty(Cr.prototype,"ArrayType",{value:Uint16Array});Object.defineProperty(It.prototype,"ArrayType",{value:Float32Array});Object.defineProperty(sr.prototype,"ArrayType",{value:Float64Array});Ct=class extends E{constructor(){super(w.Binary)}toString(){return"Binary"}};Ux=Symbol.toStringTag;Ct[Ux]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Binary"))(Ct.prototype);Z=class extends E{constructor(){super(w.BinaryView)}toString(){return"BinaryView"}};Px=Symbol.toStringTag;Z.ELEMENT_WIDTH=16;Z.INLINE_CAPACITY=12;Z.LENGTH_OFFSET=0;Z.INLINE_OFFSET=4;Z.BUFFER_INDEX_OFFSET=8;Z.BUFFER_OFFSET_OFFSET=12;Z[Px]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="BinaryView"))(Z.prototype);Ur=class extends E{constructor(){super(w.LargeBinary)}toString(){return"LargeBinary"}};Vx=Symbol.toStringTag;Ur[Vx]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeBinary"))(Ur.prototype);ut=class extends E{constructor(){super(w.Utf8)}toString(){return"Utf8"}};jx=Symbol.toStringTag;ut[jx]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8"))(ut.prototype);St=class extends E{constructor(){super(w.Utf8View)}toString(){return"Utf8View"}};Gx=Symbol.toStringTag;St.ELEMENT_WIDTH=Z.ELEMENT_WIDTH;St.INLINE_CAPACITY=Z.INLINE_CAPACITY;St[Gx]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Utf8View"))(St.prototype);Pr=class extends E{constructor(){super(w.LargeUtf8)}toString(){return"LargeUtf8"}};zx=Symbol.toStringTag;Pr[zx]=(r=>(r.ArrayType=Uint8Array,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeUtf8"))(Pr.prototype);lt=class extends E{constructor(){super(w.Bool)}toString(){return"Bool"}};Wx=Symbol.toStringTag;lt[Wx]=(r=>(r.ArrayType=Uint8Array,r[Symbol.toStringTag]="Bool"))(lt.prototype);Ut=class extends E{constructor(e,t,n=128){super(w.Decimal),this.scale=e,this.precision=t,this.bitWidth=n}toString(){return`Decimal[${this.precision}e${this.scale>0?"+":""}${this.scale}]`}};$x=Symbol.toStringTag;Ut[$x]=(r=>(r.scale=null,r.precision=null,r.ArrayType=Uint32Array,r[Symbol.toStringTag]="Decimal"))(Ut.prototype);Et=class extends E{constructor(e){super(w.Date),this.unit=e}toString(){return`Date${(this.unit+1)*32}<${ye[this.unit]}>`}get ArrayType(){return this.unit===ye.DAY?Int32Array:BigInt64Array}};qx=Symbol.toStringTag;Et[qx]=(r=>(r.unit=null,r[Symbol.toStringTag]="Date"))(Et.prototype);os=class extends Et{constructor(){super(ye.DAY)}},as=class extends Et{constructor(){super(ye.MILLISECOND)}},tt=class extends E{constructor(e,t){super(w.Time),this.unit=e,this.bitWidth=t}toString(){return`Time${this.bitWidth}<${L[this.unit]}>`}get ArrayType(){switch(this.bitWidth){case 32:return Int32Array;case 64:return BigInt64Array}throw new Error(`Unrecognized ${this[Symbol.toStringTag]} type`)}};Kx=Symbol.toStringTag;tt[Kx]=(r=>(r.unit=null,r.bitWidth=null,r[Symbol.toStringTag]="Time"))(tt.prototype);cs=class extends tt{constructor(){super(L.SECOND,32)}},us=class extends tt{constructor(){super(L.MILLISECOND,32)}},ls=class extends tt{constructor(){super(L.MICROSECOND,64)}},fs=class extends tt{constructor(){super(L.NANOSECOND,64)}},rt=class extends E{constructor(e,t){super(w.Timestamp),this.unit=e,this.timezone=t}toString(){return`Timestamp<${L[this.unit]}${this.timezone?`, ${this.timezone}`:""}>`}};Xx=Symbol.toStringTag;rt[Xx]=(r=>(r.unit=null,r.timezone=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Timestamp"))(rt.prototype);ds=class extends rt{constructor(e){super(L.SECOND,e)}},Zr=class extends rt{constructor(e){super(L.MILLISECOND,e)}},hs=class extends rt{constructor(e){super(L.MICROSECOND,e)}},ps=class extends rt{constructor(e){super(L.NANOSECOND,e)}},ft=class extends E{constructor(e){super(w.Interval),this.unit=e}toString(){return`Interval<${ae[this.unit]}>`}};Hx=Symbol.toStringTag;ft[Hx]=(r=>(r.unit=null,r.ArrayType=Int32Array,r[Symbol.toStringTag]="Interval"))(ft.prototype);ms=class extends ft{constructor(){super(ae.DAY_TIME)}},bs=class extends ft{constructor(){super(ae.YEAR_MONTH)}},nc=class extends ft{constructor(){super(ae.MONTH_DAY_NANO)}},Lt=class extends E{constructor(e){super(w.Duration),this.unit=e}toString(){return`Duration<${L[this.unit]}>`}};Jx=Symbol.toStringTag;Lt[Jx]=(r=>(r.unit=null,r.ArrayType=BigInt64Array,r[Symbol.toStringTag]="Duration"))(Lt.prototype);sc=class extends Lt{constructor(){super(L.SECOND)}},ic=class extends Lt{constructor(){super(L.MILLISECOND)}},oc=class extends Lt{constructor(){super(L.MICROSECOND)}},ac=class extends Lt{constructor(){super(L.NANOSECOND)}},je=class extends E{constructor(e){super(w.List),this.children=[e]}toString(){return`List<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};Yx=Symbol.toStringTag;je[Yx]=(r=>(r.children=null,r[Symbol.toStringTag]="List"))(je.prototype);ir=class extends E{constructor(e){super(w.LargeList),this.children=[e]}toString(){return`LargeList<${this.valueType}>`}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}};Qx=Symbol.toStringTag;ir[Qx]=(r=>(r.children=null,r.OffsetArrayType=BigInt64Array,r[Symbol.toStringTag]="LargeList"))(ir.prototype);pe=class extends E{constructor(e){super(w.Struct),this.children=e}toString(){return`Struct<{${this.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}};Zx=Symbol.toStringTag;pe[Zx]=(r=>(r.children=null,r[Symbol.toStringTag]="Struct"))(pe.prototype);Bt=class extends E{constructor(e,t,n){super(w.Union),this.mode=e,this.children=n,this.typeIds=t=Int32Array.from(t),this.typeIdToChildIndex=t.reduce((s,i,o)=>(s[i]=o)&&s||s,Object.create(null))}toString(){return`${this[Symbol.toStringTag]}<${this.children.map(e=>`${e.type}`).join(" | ")}>`}};eT=Symbol.toStringTag;Bt[eT]=(r=>(r.mode=null,r.typeIds=null,r.children=null,r.typeIdToChildIndex=null,r.ArrayType=Int8Array,r[Symbol.toStringTag]="Union"))(Bt.prototype);_n=class extends Bt{constructor(e,t){super(he.Dense,e,t)}},gs=class extends Bt{constructor(e,t){super(he.Sparse,e,t)}},Pt=class extends E{constructor(e){super(w.FixedSizeBinary),this.byteWidth=e}toString(){return`FixedSizeBinary[${this.byteWidth}]`}};tT=Symbol.toStringTag;Pt[tT]=(r=>(r.byteWidth=null,r.ArrayType=Uint8Array,r[Symbol.toStringTag]="FixedSizeBinary"))(Pt.prototype);Be=class extends E{constructor(e,t){super(w.FixedSizeList),this.listSize=e,this.children=[t]}get valueType(){return this.children[0].type}get valueField(){return this.children[0]}get ArrayType(){return this.valueType.ArrayType}toString(){return`FixedSizeList[${this.listSize}]<${this.valueType}>`}};rT=Symbol.toStringTag;Be[rT]=(r=>(r.children=null,r.listSize=null,r[Symbol.toStringTag]="FixedSizeList"))(Be.prototype);dt=class extends E{constructor(e,t=!1){var n,s,i;if(super(w.Map),this.children=[e],this.keysSorted=t,e&&(e.name="entries",!((n=e?.type)===null||n===void 0)&&n.children)){let o=(s=e?.type)===null||s===void 0?void 0:s.children[0];o&&(o.name="key");let a=(i=e?.type)===null||i===void 0?void 0:i.children[1];a&&(a.name="value")}}get keyType(){return this.children[0].type.children[0].type}get valueType(){return this.children[0].type.children[1].type}get childType(){return this.children[0].type}toString(){return`Map<{${this.children[0].type.children.map(e=>`${e.name}:${e.type}`).join(", ")}}>`}};nT=Symbol.toStringTag;dt[nT]=(r=>(r.children=null,r.keysSorted=null,r[Symbol.toStringTag]="Map_"))(dt.prototype);IF=(r=>()=>++r)(-1),Ge=class extends E{constructor(e,t,n,s){super(w.Dictionary),this.indices=t,this.dictionary=e,this.isOrdered=s||!1,this.id=n==null?IF():te(n)}get children(){return this.dictionary.children}get valueType(){return this.dictionary}get ArrayType(){return this.dictionary.ArrayType}toString(){return`Dictionary<${this.indices}, ${this.dictionary}>`}};sT=Symbol.toStringTag;Ge[sT]=(r=>(r.id=null,r.indices=null,r.isOrdered=null,r.dictionary=null,r[Symbol.toStringTag]="Dictionary"))(Ge.prototype)});function SF(r,e,t=!0){return typeof e=="number"?Do(r,e,t):typeof e=="string"&&e in w?Do(r,w[e],t):e&&e instanceof E?Do(r,aT(e),t):e?.type&&e.type instanceof E?Do(r,aT(e.type),t):Do(r,w.NONE,t)}function Do(r,e,t=!0){let n=null;switch(e){case w.Null:n=r.visitNull;break;case w.Bool:n=r.visitBool;break;case w.Int:n=r.visitInt;break;case w.Int8:n=r.visitInt8||r.visitInt;break;case w.Int16:n=r.visitInt16||r.visitInt;break;case w.Int32:n=r.visitInt32||r.visitInt;break;case w.Int64:n=r.visitInt64||r.visitInt;break;case w.Uint8:n=r.visitUint8||r.visitInt;break;case w.Uint16:n=r.visitUint16||r.visitInt;break;case w.Uint32:n=r.visitUint32||r.visitInt;break;case w.Uint64:n=r.visitUint64||r.visitInt;break;case w.Float:n=r.visitFloat;break;case w.Float16:n=r.visitFloat16||r.visitFloat;break;case w.Float32:n=r.visitFloat32||r.visitFloat;break;case w.Float64:n=r.visitFloat64||r.visitFloat;break;case w.Utf8:n=r.visitUtf8;break;case w.LargeUtf8:n=r.visitLargeUtf8;break;case w.Utf8View:n=r.visitUtf8View||r.visitUtf8;break;case w.Binary:n=r.visitBinary;break;case w.LargeBinary:n=r.visitLargeBinary;break;case w.BinaryView:n=r.visitBinaryView||r.visitBinary;break;case w.FixedSizeBinary:n=r.visitFixedSizeBinary;break;case w.Date:n=r.visitDate;break;case w.DateDay:n=r.visitDateDay||r.visitDate;break;case w.DateMillisecond:n=r.visitDateMillisecond||r.visitDate;break;case w.Timestamp:n=r.visitTimestamp;break;case w.TimestampSecond:n=r.visitTimestampSecond||r.visitTimestamp;break;case w.TimestampMillisecond:n=r.visitTimestampMillisecond||r.visitTimestamp;break;case w.TimestampMicrosecond:n=r.visitTimestampMicrosecond||r.visitTimestamp;break;case w.TimestampNanosecond:n=r.visitTimestampNanosecond||r.visitTimestamp;break;case w.Time:n=r.visitTime;break;case w.TimeSecond:n=r.visitTimeSecond||r.visitTime;break;case w.TimeMillisecond:n=r.visitTimeMillisecond||r.visitTime;break;case w.TimeMicrosecond:n=r.visitTimeMicrosecond||r.visitTime;break;case w.TimeNanosecond:n=r.visitTimeNanosecond||r.visitTime;break;case w.Decimal:n=r.visitDecimal;break;case w.List:n=r.visitList;break;case w.LargeList:n=r.visitLargeList;break;case w.Struct:n=r.visitStruct;break;case w.Union:n=r.visitUnion;break;case w.DenseUnion:n=r.visitDenseUnion||r.visitUnion;break;case w.SparseUnion:n=r.visitSparseUnion||r.visitUnion;break;case w.Dictionary:n=r.visitDictionary;break;case w.Interval:n=r.visitInterval;break;case w.IntervalDayTime:n=r.visitIntervalDayTime||r.visitInterval;break;case w.IntervalYearMonth:n=r.visitIntervalYearMonth||r.visitInterval;break;case w.IntervalMonthDayNano:n=r.visitIntervalMonthDayNano||r.visitInterval;break;case w.Duration:n=r.visitDuration;break;case w.DurationSecond:n=r.visitDurationSecond||r.visitDuration;break;case w.DurationMillisecond:n=r.visitDurationMillisecond||r.visitDuration;break;case w.DurationMicrosecond:n=r.visitDurationMicrosecond||r.visitDuration;break;case w.DurationNanosecond:n=r.visitDurationNanosecond||r.visitDuration;break;case w.FixedSizeList:n=r.visitFixedSizeList;break;case w.Map:n=r.visitMap;break}if(typeof n=="function")return n;if(!t)return()=>null;throw new Error(`Unrecognized type '${w[e]}'`)}function aT(r){switch(r.typeId){case w.Null:return w.Null;case w.Int:{let{bitWidth:e,isSigned:t}=r;switch(e){case 8:return t?w.Int8:w.Uint8;case 16:return t?w.Int16:w.Uint16;case 32:return t?w.Int32:w.Uint32;case 64:return t?w.Int64:w.Uint64}return w.Int}case w.Float:switch(r.precision){case le.HALF:return w.Float16;case le.SINGLE:return w.Float32;case le.DOUBLE:return w.Float64}return w.Float;case w.Binary:return w.Binary;case w.LargeBinary:return w.LargeBinary;case w.BinaryView:return w.BinaryView;case w.Utf8:return w.Utf8;case w.LargeUtf8:return w.LargeUtf8;case w.Utf8View:return w.Utf8View;case w.Bool:return w.Bool;case w.Decimal:return w.Decimal;case w.Time:switch(r.unit){case L.SECOND:return w.TimeSecond;case L.MILLISECOND:return w.TimeMillisecond;case L.MICROSECOND:return w.TimeMicrosecond;case L.NANOSECOND:return w.TimeNanosecond}return w.Time;case w.Timestamp:switch(r.unit){case L.SECOND:return w.TimestampSecond;case L.MILLISECOND:return w.TimestampMillisecond;case L.MICROSECOND:return w.TimestampMicrosecond;case L.NANOSECOND:return w.TimestampNanosecond}return w.Timestamp;case w.Date:switch(r.unit){case ye.DAY:return w.DateDay;case ye.MILLISECOND:return w.DateMillisecond}return w.Date;case w.Interval:switch(r.unit){case ae.DAY_TIME:return w.IntervalDayTime;case ae.YEAR_MONTH:return w.IntervalYearMonth;case ae.MONTH_DAY_NANO:return w.IntervalMonthDayNano}return w.Interval;case w.Duration:switch(r.unit){case L.SECOND:return w.DurationSecond;case L.MILLISECOND:return w.DurationMillisecond;case L.MICROSECOND:return w.DurationMicrosecond;case L.NANOSECOND:return w.DurationNanosecond}return w.Duration;case w.Map:return w.Map;case w.List:return w.List;case w.LargeList:return w.LargeList;case w.Struct:return w.Struct;case w.Union:switch(r.mode){case he.Dense:return w.DenseUnion;case he.Sparse:return w.SparseUnion}return w.Union;case w.FixedSizeBinary:return w.FixedSizeBinary;case w.FixedSizeList:return w.FixedSizeList;case w.Dictionary:return w.Dictionary}throw new Error(`Unrecognized type '${w[r.typeId]}'`)}var R,Vt=p(()=>{Me();we();R=class{visitMany(e,...t){return e.map((n,s)=>this.visit(n,...t.map(i=>i[s])))}visit(...e){return this.getVisitFn(e[0],!1).apply(this,e)}getVisitFn(e,t=!0){return SF(this,e,t)}getVisitFnByTypeId(e,t=!0){return Do(this,e,t)}visitNull(e,...t){return null}visitBool(e,...t){return null}visitInt(e,...t){return null}visitFloat(e,...t){return null}visitUtf8(e,...t){return null}visitLargeUtf8(e,...t){return null}visitUtf8View(e,...t){return null}visitBinary(e,...t){return null}visitLargeBinary(e,...t){return null}visitBinaryView(e,...t){return null}visitFixedSizeBinary(e,...t){return null}visitDate(e,...t){return null}visitTimestamp(e,...t){return null}visitTime(e,...t){return null}visitDecimal(e,...t){return null}visitList(e,...t){return null}visitLargeList(e,...t){return null}visitStruct(e,...t){return null}visitUnion(e,...t){return null}visitDictionary(e,...t){return null}visitInterval(e,...t){return null}visitDuration(e,...t){return null}visitFixedSizeList(e,...t){return null}visitMap(e,...t){return null}};R.prototype.visitInt8=null;R.prototype.visitInt16=null;R.prototype.visitInt32=null;R.prototype.visitInt64=null;R.prototype.visitUint8=null;R.prototype.visitUint16=null;R.prototype.visitUint32=null;R.prototype.visitUint64=null;R.prototype.visitFloat16=null;R.prototype.visitFloat32=null;R.prototype.visitFloat64=null;R.prototype.visitDateDay=null;R.prototype.visitDateMillisecond=null;R.prototype.visitTimestampSecond=null;R.prototype.visitTimestampMillisecond=null;R.prototype.visitTimestampMicrosecond=null;R.prototype.visitTimestampNanosecond=null;R.prototype.visitTimeSecond=null;R.prototype.visitTimeMillisecond=null;R.prototype.visitTimeMicrosecond=null;R.prototype.visitTimeNanosecond=null;R.prototype.visitDenseUnion=null;R.prototype.visitSparseUnion=null;R.prototype.visitIntervalDayTime=null;R.prototype.visitIntervalYearMonth=null;R.prototype.visitIntervalMonthDayNano=null;R.prototype.visitDuration=null;R.prototype.visitDurationSecond=null;R.prototype.visitDurationMillisecond=null;R.prototype.visitDurationMicrosecond=null;R.prototype.visitDurationNanosecond=null});var Uh={};J(Uh,{float64ToUint16:()=>cc,uint16ToFloat64:()=>Wu});function Wu(r){let e=(r&31744)>>10,t=(r&1023)/1024,n=Math.pow(-1,(r&32768)>>15);switch(e){case 31:return n*(t?Number.NaN:1/0);case 0:return n*(t?6103515625e-14*t:0)}return n*Math.pow(2,e-15)*(1+t)}function cc(r){if(r!==r)return 32256;cT[0]=r;let e=(Ro[1]&2147483648)>>16&65535,t=Ro[1]&2146435072,n=0;return t>=1089470464?Ro[0]>0?t=31744:(t=(t&2080374784)>>16,n=(Ro[1]&1048575)>>10):t<=1056964608?(n=1048576+(Ro[1]&1048575),n=1048576+(n<<(t>>20)-998)>>21,t=0):(t=t-1056964608>>10,n=(Ro[1]&1048575)+512>>10),e|t|n&65535}var cT,Ro,uc=p(()=>{cT=new Float64Array(1),Ro=new Uint32Array(cT.buffer)});function q(r){return(e,t,n)=>{if(e.setValid(t,n!=null))return r(e,t,n)}}var j,EF,uT,LF,An,Ph,lT,BF,$u,qu,Vh,fT,FF,dT,OF,hT,MF,jh,Ku,Xu,Hu,Ju,Gh,Yu,Qu,Zu,el,zh,Wh,pT,DF,RF,kF,NF,CF,UF,PF,mT,bT,VF,$h,tl,rl,nl,sl,il,ol,al,qh,jF,nt,ar=p(()=>{ht();Vt();Qr();gn();uc();Me();we();j=class extends R{};EF=(r,e,t)=>{r[e]=Math.floor(t/864e5)},uT=(r,e,t,n)=>{if(t+1<e.length){let s=te(e[t]),i=te(e[t+1]);r.set(n.subarray(0,i-s),s)}},LF=({offset:r,values:e},t,n)=>{let s=r+t;n?e[s>>3]|=1<<s%8:e[s>>3]&=~(1<<s%8)},An=({values:r},e,t)=>{r[e]=t},Ph=({values:r},e,t)=>{r[e]=t},lT=({values:r},e,t)=>{r[e]=cc(t)},BF=(r,e,t)=>{switch(r.type.precision){case le.HALF:return lT(r,e,t);case le.SINGLE:case le.DOUBLE:return Ph(r,e,t)}},$u=({values:r},e,t)=>{EF(r,e,t.valueOf())},qu=({values:r},e,t)=>{r[e]=BigInt(t)},Vh=({stride:r,values:e},t,n)=>{e.set(n.subarray(0,r),r*t)},fT=({values:r,valueOffsets:e},t,n)=>uT(r,e,t,n),FF=r=>{let e=r.variadicBuffers;return(!Array.isArray(e)||Object.isFrozen(e))&&(e=Array.from(e),r.variadicBuffers=e),e},dT=(r,e,t)=>{var n,s,i,o;let a=r.values;if(!a)throw new Error("BinaryView data is missing view buffer");let c=Z.ELEMENT_WIDTH,u=e*c,l=u+c;if(u<0||l>a.length)throw new RangeError(`BinaryView index ${e} out of bounds`);a.fill(0,u,l);let f=new DataView(a.buffer,a.byteOffset+u,c),d=t.length;if(f.setInt32(Z.LENGTH_OFFSET,d,!0),d<=Z.INLINE_CAPACITY){a.set(t,u+Z.INLINE_OFFSET);return}let h=((n=t[0])!==null&&n!==void 0?n:0)|((s=t[1])!==null&&s!==void 0?s:0)<<8|((i=t[2])!==null&&i!==void 0?i:0)<<16|((o=t[3])!==null&&o!==void 0?o:0)<<24;f.setUint32(Z.INLINE_OFFSET,h>>>0,!0);let m=FF(r),b=t.slice(),g=m.push(b)-1;f.setInt32(Z.BUFFER_INDEX_OFFSET,g,!0),f.setInt32(Z.BUFFER_OFFSET_OFFSET,0,!0)},OF=(r,e,t)=>{let n=t instanceof Uint8Array?t:new Uint8Array(t);dT(r,e,n)},hT=({values:r,valueOffsets:e},t,n)=>uT(r,e,t,Jt(n)),MF=(r,e,t)=>{let n=Jt(t);dT(r,e,n)},jh=(r,e,t)=>{r.type.unit===ye.DAY?$u(r,e,t):qu(r,e,t)},Ku=({values:r},e,t)=>{r[e]=BigInt(t/1e3)},Xu=({values:r},e,t)=>{r[e]=BigInt(t)},Hu=({values:r},e,t)=>{r[e]=BigInt(t*1e3)},Ju=({values:r},e,t)=>{r[e]=BigInt(t*1e6)},Gh=(r,e,t)=>{switch(r.type.unit){case L.SECOND:return Ku(r,e,t);case L.MILLISECOND:return Xu(r,e,t);case L.MICROSECOND:return Hu(r,e,t);case L.NANOSECOND:return Ju(r,e,t)}},Yu=({values:r},e,t)=>{r[e]=t},Qu=({values:r},e,t)=>{r[e]=t},Zu=({values:r},e,t)=>{r[e]=t},el=({values:r},e,t)=>{r[e]=t},zh=(r,e,t)=>{switch(r.type.unit){case L.SECOND:return Yu(r,e,t);case L.MILLISECOND:return Qu(r,e,t);case L.MICROSECOND:return Zu(r,e,t);case L.NANOSECOND:return el(r,e,t)}},Wh=({values:r,stride:e},t,n)=>{r.set(n.subarray(0,e),e*t)},pT=(r,e,t)=>{let n=r.children[0],s=r.valueOffsets,i=nt.getVisitFn(n),o=te(s[e]),a=te(s[e+1]);if(Array.isArray(t))for(let c=-1,u=o;u<a;)i(n,u++,t[++c]);else for(let c=-1,u=o;u<a;)i(n,u++,t.get(++c))},DF=(r,e,t)=>{let n=r.children[0],{valueOffsets:s}=r,i=nt.getVisitFn(n),{[e]:o,[e+1]:a}=s,c=t instanceof Map?t.entries():Object.entries(t);for(let u of c)if(i(n,o,u),++o>=a)break},RF=(r,e)=>(t,n,s,i)=>n&&t(n,r,e[i]),kF=(r,e)=>(t,n,s,i)=>n&&t(n,r,e.get(i)),NF=(r,e)=>(t,n,s,i)=>n&&t(n,r,e.get(s.name)),CF=(r,e)=>(t,n,s,i)=>n&&t(n,r,e[s.name]),UF=(r,e,t)=>{let n=r.type.children.map(i=>nt.getVisitFn(i.type)),s=t instanceof Map?NF(e,t):t instanceof B?kF(e,t):Array.isArray(t)?RF(e,t):CF(e,t);r.type.children.forEach((i,o)=>s(n[o],r.children[o],i,o))},PF=(r,e,t)=>{r.type.mode===he.Dense?mT(r,e,t):bT(r,e,t)},mT=(r,e,t)=>{let n=r.type.typeIdToChildIndex[r.typeIds[e]],s=r.children[n];nt.visit(s,r.valueOffsets[e],t)},bT=(r,e,t)=>{let n=r.type.typeIdToChildIndex[r.typeIds[e]],s=r.children[n];nt.visit(s,e,t)},VF=(r,e,t)=>{var n;(n=r.dictionary)===null||n===void 0||n.set(r.values[e],t)},$h=(r,e,t)=>{switch(r.type.unit){case ae.YEAR_MONTH:return rl(r,e,t);case ae.DAY_TIME:return tl(r,e,t);case ae.MONTH_DAY_NANO:return nl(r,e,t)}},tl=({values:r},e,t)=>{r.set(t.subarray(0,2),2*e)},rl=({values:r},e,t)=>{r[e]=t[0]*12+t[1]%12},nl=({values:r,stride:e},t,n)=>{r.set(n.subarray(0,e),e*t)},sl=({values:r},e,t)=>{r[e]=t},il=({values:r},e,t)=>{r[e]=t},ol=({values:r},e,t)=>{r[e]=t},al=({values:r},e,t)=>{r[e]=t},qh=(r,e,t)=>{switch(r.type.unit){case L.SECOND:return sl(r,e,t);case L.MILLISECOND:return il(r,e,t);case L.MICROSECOND:return ol(r,e,t);case L.NANOSECOND:return al(r,e,t)}},jF=(r,e,t)=>{let{stride:n}=r,s=r.children[0],i=nt.getVisitFn(s);if(Array.isArray(t))for(let o=-1,a=e*n;++o<n;)i(s,a+o,t[o]);else for(let o=-1,a=e*n;++o<n;)i(s,a+o,t.get(o))};j.prototype.visitBool=q(LF);j.prototype.visitInt=q(An);j.prototype.visitInt8=q(An);j.prototype.visitInt16=q(An);j.prototype.visitInt32=q(An);j.prototype.visitInt64=q(An);j.prototype.visitUint8=q(An);j.prototype.visitUint16=q(An);j.prototype.visitUint32=q(An);j.prototype.visitUint64=q(An);j.prototype.visitFloat=q(BF);j.prototype.visitFloat16=q(lT);j.prototype.visitFloat32=q(Ph);j.prototype.visitFloat64=q(Ph);j.prototype.visitUtf8=q(hT);j.prototype.visitLargeUtf8=q(hT);j.prototype.visitUtf8View=q(MF);j.prototype.visitBinary=q(fT);j.prototype.visitLargeBinary=q(fT);j.prototype.visitBinaryView=q(OF);j.prototype.visitFixedSizeBinary=q(Vh);j.prototype.visitDate=q(jh);j.prototype.visitDateDay=q($u);j.prototype.visitDateMillisecond=q(qu);j.prototype.visitTimestamp=q(Gh);j.prototype.visitTimestampSecond=q(Ku);j.prototype.visitTimestampMillisecond=q(Xu);j.prototype.visitTimestampMicrosecond=q(Hu);j.prototype.visitTimestampNanosecond=q(Ju);j.prototype.visitTime=q(zh);j.prototype.visitTimeSecond=q(Yu);j.prototype.visitTimeMillisecond=q(Qu);j.prototype.visitTimeMicrosecond=q(Zu);j.prototype.visitTimeNanosecond=q(el);j.prototype.visitDecimal=q(Wh);j.prototype.visitList=q(pT);j.prototype.visitLargeList=q(pT);j.prototype.visitStruct=q(UF);j.prototype.visitUnion=q(PF);j.prototype.visitDenseUnion=q(mT);j.prototype.visitSparseUnion=q(bT);j.prototype.visitDictionary=q(VF);j.prototype.visitInterval=q($h);j.prototype.visitIntervalDayTime=q(tl);j.prototype.visitIntervalYearMonth=q(rl);j.prototype.visitIntervalMonthDayNano=q(nl);j.prototype.visitDuration=q(qh);j.prototype.visitDurationSecond=q(sl);j.prototype.visitDurationMillisecond=q(il);j.prototype.visitDurationMicrosecond=q(ol);j.prototype.visitDurationNanosecond=q(al);j.prototype.visitFixedSizeList=q(jF);j.prototype.visitMap=q(DF);nt=new j});var Vr,ko,en,Kh,Xh,GF,cl=p(()=>{tc();hi();ar();Vr=Symbol.for("parent"),ko=Symbol.for("rowIndex"),en=class{constructor(e,t){return this[Vr]=e,this[ko]=t,new Proxy(this,GF)}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[ko],t=this[Vr],n=t.type.children,s={};for(let i=-1,o=n.length;++i<o;)s[n[i].name]=ze.visit(t.children[i],e);return s}toString(){return`{${[...this].map(([e,t])=>`${Rr(e)}: ${Rr(t)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}[Symbol.iterator](){return new Kh(this[Vr],this[ko])}},Kh=class{constructor(e,t){this.childIndex=0,this.children=e.children,this.rowIndex=t,this.childFields=e.type.children,this.numChildren=this.childFields.length}[Symbol.iterator](){return this}next(){let e=this.childIndex;return e<this.numChildren?(this.childIndex=e+1,{done:!1,value:[this.childFields[e].name,ze.visit(this.children[e],this.rowIndex)]}):{done:!0,value:null}}};Object.defineProperties(en.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[Vr]:{writable:!0,enumerable:!1,configurable:!1,value:null},[ko]:{writable:!0,enumerable:!1,configurable:!1,value:-1}});Xh=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[Vr].type.children.map(t=>t.name)}has(e,t){return e[Vr].type.children.some(n=>n.name===t)}getOwnPropertyDescriptor(e,t){if(e[Vr].type.children.some(n=>n.name===t))return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[Vr].type.children.findIndex(s=>s.name===t);if(n!==-1){let s=ze.visit(e[Vr].children[n],e[ko]);return Reflect.set(e,t,s),s}}set(e,t,n){let s=e[Vr].type.children.findIndex(i=>i.name===t);return s!==-1?(nt.visit(e[Vr].children[s],e[ko],n),Reflect.set(e,t,n)):Reflect.has(e,t)||typeof t=="symbol"?Reflect.set(e,t,n):!1}},GF=new Xh});function W(r){return(e,t)=>e.getValid(t)?r(e,t):null}var C,zF,No,WF,$F,gT,qF,yT,wT,ys,KF,xT,XF,TT,_T,HF,AT,JF,YF,QF,ZF,vT,IT,ST,ET,eO,LT,BT,FT,OT,tO,rO,MT,nO,sO,iO,DT,RT,oO,aO,kT,NT,CT,UT,PT,VT,jT,cO,uO,ze,hi=p(()=>{zu();ht();Vt();lc();cl();Qr();gn();uc();Me();C=class extends R{};zF=(r,e)=>864e5*r[e],No=16,WF=12,$F=(r,e)=>null,gT=(r,e,t)=>{if(t+1>=e.length)return null;let n=te(e[t]),s=te(e[t+1]);return r.subarray(n,s)},qF=({offset:r,values:e},t)=>{let n=r+t;return(e[n>>3]&1<<n%8)!==0},yT=({values:r},e)=>zF(r,e),wT=({values:r},e)=>te(r[e]),ys=({stride:r,values:e},t)=>e[r*t],KF=({stride:r,values:e},t)=>Wu(e[r*t]),xT=({values:r},e)=>r[e],XF=({stride:r,values:e},t)=>e.subarray(r*t,r*(t+1)),TT=({values:r,valueOffsets:e},t)=>gT(r,e,t),_T=(r,e)=>{var t;let n=r.values;if(!n)throw new Error("BinaryView data is missing view buffer");let s=e*No,i=s+No;if(s<0||i>n.length)throw new Error(`BinaryView data buffer is too short: expected ${No} bytes, got ${Math.max(0,n.length-s)}`);let o=n.subarray(s,i);if(o.length<No)throw new Error(`BinaryView data buffer is too short: expected ${No} bytes, got ${o.length}`);let a=new DataView(n.buffer,o.byteOffset,No),c=a.getInt32(0,!0);if(c<=0)return new Uint8Array(0);if(c<=WF)return o.subarray(4,4+c);let u=a.getInt32(8,!0),l=a.getInt32(12,!0),f=(t=r.variadicBuffers)===null||t===void 0?void 0:t[u];if(!f)throw new Error(`BinaryView variadic buffer ${u} is missing`);return f.subarray(l,l+c)},HF=(r,e)=>_T(r,e),AT=({values:r,valueOffsets:e},t)=>{let n=gT(r,e,t);return n!==null?vo(n):null},JF=(r,e)=>{let t=_T(r,e);return vo(t)},YF=({values:r},e)=>r[e],QF=({type:r,values:e},t)=>r.precision!==le.HALF?e[t]:Wu(e[t]),ZF=(r,e)=>r.type.unit===ye.DAY?yT(r,e):wT(r,e),vT=({values:r},e)=>1e3*te(r[e]),IT=({values:r},e)=>te(r[e]),ST=({values:r},e)=>Rh(r[e],BigInt(1e3)),ET=({values:r},e)=>Rh(r[e],BigInt(1e6)),eO=(r,e)=>{switch(r.type.unit){case L.SECOND:return vT(r,e);case L.MILLISECOND:return IT(r,e);case L.MICROSECOND:return ST(r,e);case L.NANOSECOND:return ET(r,e)}},LT=({values:r},e)=>r[e],BT=({values:r},e)=>r[e],FT=({values:r},e)=>r[e],OT=({values:r},e)=>r[e],tO=(r,e)=>{switch(r.type.unit){case L.SECOND:return LT(r,e);case L.MILLISECOND:return BT(r,e);case L.MICROSECOND:return FT(r,e);case L.NANOSECOND:return OT(r,e)}},rO=({values:r,stride:e},t)=>di.decimal(r.subarray(e*t,e*(t+1))),MT=(r,e)=>{let{valueOffsets:t,stride:n,children:s}=r,i=te(t[e*n]),o=te(t[e*n+1]),c=s[0].slice(i,o-i);return new B([c])},nO=(r,e)=>{let{valueOffsets:t,children:n}=r,{[e]:s,[e+1]:i}=t,o=n[0];return new yr(o.slice(s,i-s))},sO=(r,e)=>new en(r,e),iO=(r,e)=>r.type.mode===he.Dense?DT(r,e):RT(r,e),DT=(r,e)=>{let t=r.type.typeIdToChildIndex[r.typeIds[e]],n=r.children[t];return ze.visit(n,r.valueOffsets[e])},RT=(r,e)=>{let t=r.type.typeIdToChildIndex[r.typeIds[e]],n=r.children[t];return ze.visit(n,e)},oO=(r,e)=>{var t;return(t=r.dictionary)===null||t===void 0?void 0:t.get(r.values[e])},aO=(r,e)=>r.type.unit===ae.MONTH_DAY_NANO?CT(r,e):r.type.unit===ae.DAY_TIME?kT(r,e):NT(r,e),kT=({values:r},e)=>r.subarray(2*e,2*(e+1)),NT=({values:r},e)=>{let t=r[e],n=new Int32Array(2);return n[0]=Math.trunc(t/12),n[1]=Math.trunc(t%12),n},CT=({values:r},e)=>r.subarray(4*e,4*(e+1)),UT=({values:r},e)=>r[e],PT=({values:r},e)=>r[e],VT=({values:r},e)=>r[e],jT=({values:r},e)=>r[e],cO=(r,e)=>{switch(r.type.unit){case L.SECOND:return UT(r,e);case L.MILLISECOND:return PT(r,e);case L.MICROSECOND:return VT(r,e);case L.NANOSECOND:return jT(r,e)}},uO=(r,e)=>{let{stride:t,children:n}=r,i=n[0].slice(e*t,t);return new B([i])};C.prototype.visitNull=W($F);C.prototype.visitBool=W(qF);C.prototype.visitInt=W(YF);C.prototype.visitInt8=W(ys);C.prototype.visitInt16=W(ys);C.prototype.visitInt32=W(ys);C.prototype.visitInt64=W(xT);C.prototype.visitUint8=W(ys);C.prototype.visitUint16=W(ys);C.prototype.visitUint32=W(ys);C.prototype.visitUint64=W(xT);C.prototype.visitFloat=W(QF);C.prototype.visitFloat16=W(KF);C.prototype.visitFloat32=W(ys);C.prototype.visitFloat64=W(ys);C.prototype.visitUtf8=W(AT);C.prototype.visitLargeUtf8=W(AT);C.prototype.visitUtf8View=W(JF);C.prototype.visitBinary=W(TT);C.prototype.visitLargeBinary=W(TT);C.prototype.visitBinaryView=W(HF);C.prototype.visitFixedSizeBinary=W(XF);C.prototype.visitDate=W(ZF);C.prototype.visitDateDay=W(yT);C.prototype.visitDateMillisecond=W(wT);C.prototype.visitTimestamp=W(eO);C.prototype.visitTimestampSecond=W(vT);C.prototype.visitTimestampMillisecond=W(IT);C.prototype.visitTimestampMicrosecond=W(ST);C.prototype.visitTimestampNanosecond=W(ET);C.prototype.visitTime=W(tO);C.prototype.visitTimeSecond=W(LT);C.prototype.visitTimeMillisecond=W(BT);C.prototype.visitTimeMicrosecond=W(FT);C.prototype.visitTimeNanosecond=W(OT);C.prototype.visitDecimal=W(rO);C.prototype.visitList=W(MT);C.prototype.visitLargeList=W(MT);C.prototype.visitStruct=W(sO);C.prototype.visitUnion=W(iO);C.prototype.visitDenseUnion=W(DT);C.prototype.visitSparseUnion=W(RT);C.prototype.visitDictionary=W(oO);C.prototype.visitInterval=W(aO);C.prototype.visitIntervalDayTime=W(kT);C.prototype.visitIntervalYearMonth=W(NT);C.prototype.visitIntervalMonthDayNano=W(CT);C.prototype.visitDuration=W(cO);C.prototype.visitDurationSecond=W(UT);C.prototype.visitDurationMillisecond=W(PT);C.prototype.visitDurationMicrosecond=W(VT);C.prototype.visitDurationNanosecond=W(jT);C.prototype.visitFixedSizeList=W(uO);C.prototype.visitMap=W(nO);ze=new C});var ws,Uo,Co,Hh,yr,Jh,Yh,lc=p(()=>{ht();tc();hi();ar();ws=Symbol.for("keys"),Uo=Symbol.for("vals"),Co=Symbol.for("kKeysAsStrings"),Hh=Symbol.for("_kKeysAsStrings"),yr=class{constructor(e){return this[ws]=new B([e.children[0]]).memoize(),this[Uo]=e.children[1],new Proxy(this,new Yh)}get[Co](){return this[Hh]||(this[Hh]=Array.from(this[ws].toArray(),String))}[Symbol.iterator](){return new Jh(this[ws],this[Uo])}get size(){return this[ws].length}toArray(){return Object.values(this.toJSON())}toJSON(){let e=this[ws],t=this[Uo],n={};for(let s=-1,i=e.length;++s<i;)n[e.get(s)]=ze.visit(t,s);return n}toString(){return`{${[...this].map(([e,t])=>`${Rr(e)}: ${Rr(t)}`).join(", ")}}`}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}},Jh=class{constructor(e,t){this.keys=e,this.vals=t,this.keyIndex=0,this.numKeys=e.length}[Symbol.iterator](){return this}next(){let e=this.keyIndex;return e===this.numKeys?{done:!0,value:null}:(this.keyIndex++,{done:!1,value:[this.keys.get(e),ze.visit(this.vals,e)]})}},Yh=class{isExtensible(){return!1}deleteProperty(){return!1}preventExtensions(){return!0}ownKeys(e){return e[Co]}has(e,t){return e[Co].includes(t)}getOwnPropertyDescriptor(e,t){if(e[Co].indexOf(t)!==-1)return{writable:!0,enumerable:!0,configurable:!0}}get(e,t){if(Reflect.has(e,t))return e[t];let n=e[Co].indexOf(t);if(n!==-1){let s=ze.visit(Reflect.get(e,Uo),n);return Reflect.set(e,t,s),s}}set(e,t,n){let s=e[Co].indexOf(t);return s!==-1?(nt.visit(Reflect.get(e,Uo),s,n),Reflect.set(e,t,n)):Reflect.has(e,t)?Reflect.set(e,t,n):!1}};Object.defineProperties(yr.prototype,{[Symbol.toStringTag]:{enumerable:!1,configurable:!1,value:"Row"},[ws]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Uo]:{writable:!0,enumerable:!1,configurable:!1,value:null},[Hh]:{writable:!0,enumerable:!1,configurable:!1,value:null}})});var Qh={};J(Qh,{clampRange:()=>fc,createElementComparator:()=>xs,wrapIndex:()=>pi});function fc(r,e,t,n){let{length:s=0}=r,i=typeof e!="number"?0:e,o=typeof t!="number"?s:t;return i<0&&(i=(i%s+s)%s),o<0&&(o=(o%s+s)%s),o<i&&(GT=i,i=o,o=GT),o>s&&(o=s),n?n(r,i,o):[i,o]}function xs(r){if(typeof r!=="object"||r===null)return zT(r)?zT:t=>t===r;if(r instanceof Date){let t=r.valueOf();return n=>n instanceof Date?n.valueOf()===t:!1}return ArrayBuffer.isView(r)?t=>t?rh(r,t):!1:r instanceof Map?fO(r):Array.isArray(r)?lO(r):r instanceof B?dO(r):hO(r,!0)}function lO(r){let e=[];for(let t=-1,n=r.length;++t<n;)e[t]=xs(r[t]);return ul(e)}function fO(r){let e=-1,t=[];for(let n of r.values())t[++e]=xs(n);return ul(t)}function dO(r){let e=[];for(let t=-1,n=r.length;++t<n;)e[t]=xs(r.get(t));return ul(e)}function hO(r,e=!1){let t=Object.keys(r);if(!e&&t.length===0)return()=>!1;let n=[];for(let s=-1,i=t.length;++s<i;)n[s]=xs(r[t[s]]);return ul(n,t)}function ul(r,e){return t=>{if(!t||typeof t!="object")return!1;switch(t.constructor){case Array:return pO(r,t);case Map:return WT(r,t,t.keys());case yr:case en:case Object:case void 0:return WT(r,t,e||Object.keys(t))}return t instanceof B?mO(r,t):!1}}function pO(r,e){let t=r.length;if(e.length!==t)return!1;for(let n=-1;++n<t;)if(!r[n](e[n]))return!1;return!0}function mO(r,e){let t=r.length;if(e.length!==t)return!1;for(let n=-1;++n<t;)if(!r[n](e.get(n)))return!1;return!0}function WT(r,e,t){let n=t[Symbol.iterator](),s=e instanceof Map?e.keys():Object.keys(e)[Symbol.iterator](),i=e instanceof Map?e.values():Object.values(e)[Symbol.iterator](),o=0,a=r.length,c=i.next(),u=n.next(),l=s.next();for(;o<a&&!u.done&&!l.done&&!c.done&&!(u.value!==l.value||!r[o](c.value));++o,u=n.next(),l=s.next(),c=i.next());return o===a&&u.done&&l.done&&c.done?!0:(n.return&&n.return(),s.return&&s.return(),i.return&&i.return(),!1)}var GT,pi,zT,Po=p(()=>{ht();lc();cl();Ke();pi=(r,e)=>r<0?e+r:r,zT=r=>r!==r});var Zh={};J(Zh,{BitIterator:()=>tn,getBit:()=>fl,getBool:()=>Vo,packBools:()=>bi,popcnt_array:()=>$T,popcnt_bit_range:()=>dc,popcnt_uint32:()=>ll,setBool:()=>bO,truncateBitmap:()=>mi});function Vo(r,e,t,n){return(t&1<<n)!==0}function fl(r,e,t,n){return(t&1<<n)>>n}function bO(r,e,t){return t?!!(r[e>>3]|=1<<e%8)||!0:!(r[e>>3]&=~(1<<e%8))&&!1}function mi(r,e,t){let n=t.byteLength+7&-8;if(r>0||t.byteLength<n){let s=new Uint8Array(n);return s.set(r%8===0?t.subarray(r>>3):bi(new tn(t,r,e,null,Vo)).subarray(0,n)),s}return t}function bi(r){let e=[],t=0,n=0,s=0;for(let o of r)o&&(s|=1<<n),++n===8&&(e[t++]=s,s=n=0);(t===0||n>0)&&(e[t++]=s);let i=new Uint8Array(e.length+7&-8);return i.set(e),i}function dc(r,e,t){if(t-e<=0)return 0;if(t-e<8){let i=0;for(let o of new tn(r,e,t-e,r,fl))i+=o;return i}let n=t>>3<<3,s=e+(e%8===0?0:8-e%8);return dc(r,e,s)+dc(r,n,t)+$T(r,s>>3,n-s>>3)}function $T(r,e,t){let n=0,s=Math.trunc(e),i=new DataView(r.buffer,r.byteOffset,r.byteLength),o=t===void 0?r.byteLength:s+t;for(;o-s>=4;)n+=ll(i.getUint32(s)),s+=4;for(;o-s>=2;)n+=ll(i.getUint16(s)),s+=2;for(;o-s>=1;)n+=ll(i.getUint8(s)),s+=1;return n}function ll(r){let e=Math.trunc(r);return e=e-(e>>>1&1431655765),e=(e&858993459)+(e>>>2&858993459),(e+(e>>>4)&252645135)*16843009>>>24}var tn,gi=p(()=>{tn=class{constructor(e,t,n,s,i){this.bytes=e,this.length=n,this.context=s,this.get=i,this.bit=t%8,this.byteIndex=t>>3,this.byte=e[this.byteIndex++],this.index=0}next(){return this.index<this.length?(this.bit===8&&(this.bit=0,this.byte=this.bytes[this.byteIndex++]),{value:this.get(this.context,this.index++,this.byte,this.bit++)}):{done:!0,value:null}}[Symbol.iterator](){return this}}});function D(r){return yO.visit(r)}var gO,qT,G,ep,yO,wr=p(()=>{ht();Me();we();gi();we();Vt();Ke();gO=-1,qT=Symbol.for("apache-arrow/Data"),G=class r{static isData(e){return e?.[qT]===!0}get typeId(){return this.type.typeId}get ArrayType(){return this.type.ArrayType}get buffers(){return[this.valueOffsets,this.values,this.nullBitmap,this.typeIds]}get nullable(){if(this._nullCount!==0){let{type:e}=this;return E.isSparseUnion(e)?this.children.some(t=>t.nullable):E.isDenseUnion(e)?this.children.some(t=>t.nullable):this.nullBitmap&&this.nullBitmap.byteLength>0}return!0}get byteLength(){let e=0,{valueOffsets:t,values:n,nullBitmap:s,typeIds:i}=this;return t&&(e+=t.byteLength),n&&(e+=n.byteLength),s&&(e+=s.byteLength),i&&(e+=i.byteLength),e+=this.variadicBuffers.reduce((o,a)=>{var c;return o+((c=a?.byteLength)!==null&&c!==void 0?c:0)},0),this.children.reduce((o,a)=>o+a.byteLength,e)}get nullCount(){if(E.isUnion(this.type))return this.children.reduce((n,s)=>n+s.nullCount,0);let e=this._nullCount,t;return e<=gO&&(t=this.nullBitmap)&&(this._nullCount=e=t.length===0?0:this.length-dc(t,this.offset,this.offset+this.length)),e}constructor(e,t,n,s,i,o=[],a,c=[]){var u;this.type=e,this.children=o,this.dictionary=a,this.offset=Math.floor(Math.max(t||0,0)),this.length=Math.floor(Math.max(n||0,0)),this._nullCount=Math.floor(Math.max(s||0,-1));let l;i instanceof r?(this.stride=i.stride,this.values=i.values,this.typeIds=i.typeIds,this.nullBitmap=i.nullBitmap,this.valueOffsets=i.valueOffsets,this.variadicBuffers=i.variadicBuffers):(this.stride=or(e),i&&((l=i[0])&&(this.valueOffsets=l),(l=i[1])&&(this.values=l),(l=i[2])&&(this.nullBitmap=l),(l=i[3])&&(this.typeIds=l)),this.variadicBuffers=c),(u=this.variadicBuffers)!==null&&u!==void 0||(this.variadicBuffers=[])}getValid(e){let{type:t}=this;if(E.isUnion(t)){let n=t,s=this.typeIds[e],i=n.typeIdToChildIndex[s],o=this.children[i],a=this.valueOffsets,c=n.mode===he.Dense&&a?Number(a[e]):e;return o.getValid(c)}if(this.nullable&&this.nullCount>0){let n=this.offset+e;return(this.nullBitmap[n>>3]&1<<n%8)!==0}return!0}setValid(e,t){let n,{type:s}=this;if(E.isUnion(s)){let i=s,o=this.typeIds[e],a=i.typeIdToChildIndex[o],c=this.children[a],u=this.valueOffsets,l=i.mode===he.Dense&&u?Number(u[e]):e;n=c.getValid(l),c.setValid(l,t)}else{let{nullBitmap:i}=this,{offset:o,length:a}=this,c=o+e,u=1<<c%8,l=c>>3;(!i||i.byteLength<=l)&&(i=new Uint8Array((o+a+63&-64)>>3).fill(255),this.nullCount>0?(i.set(mi(o,a,this.nullBitmap),0),Object.assign(this,{nullBitmap:i})):Object.assign(this,{nullBitmap:i,_nullCount:0}));let f=i[l];n=(f&u)!==0,i[l]=t?f|u:f&~u}return n!==!!t&&(this._nullCount=this.nullCount+(t?-1:1)),t}clone(e=this.type,t=this.offset,n=this.length,s=this._nullCount,i=this,o=this.children,a=this.variadicBuffers){return new r(e,t,n,s,i,o,this.dictionary,a)}slice(e,t){let{stride:n,typeId:s,children:i}=this,o=+(this._nullCount===0)-1,a=s===16?n:1,c=this._sliceBuffers(e,t,n,s);return this.clone(this.type,this.offset+e,t,o,c,i.length===0||this.valueOffsets?i:this._sliceChildren(i,a*e,a*t),this.variadicBuffers)}_changeLengthAndBackfillNullBitmap(e){if(this.typeId===w.Null)return this.clone(this.type,0,e,0,this.buffers,this.children,this.variadicBuffers);let{length:t,nullCount:n}=this,s=new Uint8Array((e+63&-64)>>3).fill(255,0,t>>3);s[t>>3]=(1<<t-(t&-8))-1,n>0&&s.set(mi(this.offset,t,this.nullBitmap),0);let i=this.buffers;return i[re.VALIDITY]=s,this.clone(this.type,0,e,n+(e-t),i,this.children,this.variadicBuffers)}_sliceBuffers(e,t,n,s){let i,{buffers:o}=this;if((i=o[re.TYPE])&&(o[re.TYPE]=i.subarray(e,e+t)),E.isBinaryView(this.type)||E.isUtf8View(this.type)){let a=Z.ELEMENT_WIDTH;(i=o[re.DATA])&&(o[re.DATA]=i.subarray(e*a,(e+t)*a))}else(i=o[re.OFFSET])&&(o[re.OFFSET]=i.subarray(e,e+t+1))||(i=o[re.DATA])&&(o[re.DATA]=s===6?i:i.subarray(n*e,n*(e+t)));return o}_sliceChildren(e,t,n){return e.map(s=>s.slice(t,n))}};G.prototype.children=Object.freeze([]);G.prototype[qT]=!0;Object.defineProperty(G,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===G&&G.isData(e)}});ep=class r extends R{visit(e){return this.getVisitFn(e.type).call(this,e)}visitNull(e){let{["type"]:t,["offset"]:n=0,["length"]:s=0}=e;return new G(t,n,s,s)}visitBool(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length>>3,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitInt(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitFloat(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitUtf8(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.data),i=k(e.nullBitmap),o=ui(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new G(t,n,a,c,[o,s,i])}visitUtf8View(e){var t;let{["type"]:n,["offset"]:s=0}=e,i=ee(n.ArrayType,e.views),o=k(e.nullBitmap),a=(e.variadicBuffers||[]).map(l=>k(l)),c=(t=e.length)!==null&&t!==void 0?t:Math.trunc(i.length/St.ELEMENT_WIDTH),u=e.nullBitmap?-1:0;return new G(n,s,c,u,[void 0,i,o],[],void 0,a)}visitLargeUtf8(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.data),i=k(e.nullBitmap),o=Pa(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new G(t,n,a,c,[o,s,i])}visitBinary(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.data),i=k(e.nullBitmap),o=ui(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new G(t,n,a,c,[o,s,i])}visitBinaryView(e){var t;let{["type"]:n,["offset"]:s=0}=e,i=ee(n.ArrayType,e.views),o=k(e.nullBitmap),a=(e.variadicBuffers||[]).map(l=>k(l)),c=(t=e.length)!==null&&t!==void 0?t:Math.trunc(i.length/Z.ELEMENT_WIDTH),u=e.nullBitmap?-1:0;return new G(n,s,c,u,[void 0,i,o],[],void 0,a)}visitLargeBinary(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.data),i=k(e.nullBitmap),o=Pa(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new G(t,n,a,c,[o,s,i])}visitFixedSizeBinary(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length/or(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitDate(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length/or(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitTimestamp(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length/or(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitTime(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length/or(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitDecimal(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length/or(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitList(e){let{["type"]:t,["offset"]:n=0,["child"]:s}=e,i=k(e.nullBitmap),o=ui(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new G(t,n,a,c,[o,void 0,i],[s])}visitLargeList(e){let{["type"]:t,["offset"]:n=0,["child"]:s}=e,i=k(e.nullBitmap),o=Pa(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new G(t,n,a,c,[o,void 0,i],[s])}visitStruct(e){let{["type"]:t,["offset"]:n=0,["children"]:s=[]}=e,i=k(e.nullBitmap),{length:o=s.reduce((c,{length:u})=>Math.max(c,u),0),nullCount:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,void 0,i],s)}visitUnion(e){let{["type"]:t,["offset"]:n=0,["children"]:s=[]}=e,i=ee(t.ArrayType,e.typeIds),{["length"]:o=i.length,["nullCount"]:a=-1}=e;if(E.isSparseUnion(t))return new G(t,n,o,a,[void 0,void 0,void 0,i],s);let c=ui(e.valueOffsets);return new G(t,n,o,a,[c,void 0,void 0,i],s)}visitDictionary(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.indices.ArrayType,e.data),{["dictionary"]:o=new B([new r().visit({type:t.dictionary})])}=e,{["length"]:a=i.length,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new G(t,n,a,c,[void 0,i,s],[],o)}visitInterval(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length/or(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitDuration(e){let{["type"]:t,["offset"]:n=0}=e,s=k(e.nullBitmap),i=ee(t.ArrayType,e.data),{["length"]:o=i.length,["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,i,s])}visitFixedSizeList(e){let{["type"]:t,["offset"]:n=0,["child"]:s=new r().visit({type:t.valueType})}=e,i=k(e.nullBitmap),{["length"]:o=s.length/or(t),["nullCount"]:a=e.nullBitmap?-1:0}=e;return new G(t,n,o,a,[void 0,void 0,i],[s])}visitMap(e){let{["type"]:t,["offset"]:n=0,["child"]:s=new r().visit({type:t.childType})}=e,i=k(e.nullBitmap),o=ui(e.valueOffsets),{["length"]:a=o.length-1,["nullCount"]:c=e.nullBitmap?-1:0}=e;return new G(t,n,a,c,[o,void 0,i],[s])}},yO=new ep});function KT(r){return r.some(e=>e.nullable)}function dl(r){return r.reduce((e,t)=>e+t.nullCount,0)}function hl(r){return r.reduce((e,t,n)=>(e[n+1]=e[n]+t.length,e),new Uint32Array(r.length+1))}function pl(r,e,t,n){let s=[];for(let i=-1,o=r.length;++i<o;){let a=r[i],c=e[i],{length:u}=a;if(c>=n)break;if(t>=c+u)continue;if(c>=t&&c+u<=n){s.push(a);continue}let l=Math.max(0,t-c),f=Math.min(n-c,u);s.push(a.slice(l,f-l))}return s.length===0&&s.push(r[0].slice(0,0)),s}function tp(r,e,t,n){let s=0,i=0,o=e.length-1;do{if(s>=o-1)return t<e[o]?n(r,s,t-e[s]):null;i=s+Math.trunc((o-s)*.5),t<e[i]?o=i:s=i}while(s<o)}function pc(r,e){return r.getValid(e)}function jo(r){function e(t,n,s){return r(t[n],s)}return function(t){let n=this.data;return tp(n,this._offsets,t,e)}}function ml(r){let e;function t(n,s,i){return r(n[s],i,e)}return function(n,s){let i=this.data;e=s;let o=tp(i,this._offsets,n,t);return e=void 0,o}}function bl(r){let e;function t(n,s,i){let o=i,a=0,c=0;for(let u=s-1,l=n.length;++u<l;){let f=n[u];if(~(a=r(f,e,o)))return c+a;o=0,c+=f.length}return-1}return function(n,s){e=n;let i=this.data,o=typeof s!="number"?t(i,0,0):tp(i,this._offsets,s,t);return e=void 0,o}}var hc,gl=p(()=>{hc=class{constructor(e=0,t){this.numChunks=e,this.getChunkIterator=t,this.chunkIndex=0,this.chunkIterator=this.getChunkIterator(0)}next(){for(;this.chunkIndex<this.numChunks;){let e=this.chunkIterator.next();if(!e.done)return e;++this.chunkIndex<this.numChunks&&(this.chunkIterator=this.getChunkIterator(this.chunkIndex))}return{done:!0,value:null}}[Symbol.iterator](){return this}}});function wO(r,e){return e===null&&r.length>0?0:-1}function xO(r,e){let{nullBitmap:t}=r;if(!t||r.nullCount<=0)return-1;let n=0;for(let s of new tn(t,r.offset+(e||0),r.length,t,Vo)){if(!s)return n;++n}return-1}function X(r,e,t){if(e===void 0)return-1;if(e===null)switch(r.typeId){case w.Union:break;case w.Dictionary:break;default:return xO(r,t)}let n=ze.getVisitFn(r),s=xs(e);for(let i=(t||0)-1,o=r.length;++i<o;)if(s(n(r,i)))return i;return-1}function XT(r,e,t){let n=ze.getVisitFn(r),s=xs(e);for(let i=(t||0)-1,o=r.length;++i<o;)if(s(n(r,i)))return i;return-1}var U,yi,yl=p(()=>{Me();Vt();hi();gi();Po();U=class extends R{};U.prototype.visitNull=wO;U.prototype.visitBool=X;U.prototype.visitInt=X;U.prototype.visitInt8=X;U.prototype.visitInt16=X;U.prototype.visitInt32=X;U.prototype.visitInt64=X;U.prototype.visitUint8=X;U.prototype.visitUint16=X;U.prototype.visitUint32=X;U.prototype.visitUint64=X;U.prototype.visitFloat=X;U.prototype.visitFloat16=X;U.prototype.visitFloat32=X;U.prototype.visitFloat64=X;U.prototype.visitUtf8=X;U.prototype.visitLargeUtf8=X;U.prototype.visitUtf8View=X;U.prototype.visitBinary=X;U.prototype.visitLargeBinary=X;U.prototype.visitBinaryView=X;U.prototype.visitFixedSizeBinary=X;U.prototype.visitDate=X;U.prototype.visitDateDay=X;U.prototype.visitDateMillisecond=X;U.prototype.visitTimestamp=X;U.prototype.visitTimestampSecond=X;U.prototype.visitTimestampMillisecond=X;U.prototype.visitTimestampMicrosecond=X;U.prototype.visitTimestampNanosecond=X;U.prototype.visitTime=X;U.prototype.visitTimeSecond=X;U.prototype.visitTimeMillisecond=X;U.prototype.visitTimeMicrosecond=X;U.prototype.visitTimeNanosecond=X;U.prototype.visitDecimal=X;U.prototype.visitList=X;U.prototype.visitLargeList=X;U.prototype.visitStruct=X;U.prototype.visitUnion=X;U.prototype.visitDenseUnion=XT;U.prototype.visitSparseUnion=XT;U.prototype.visitDictionary=X;U.prototype.visitInterval=X;U.prototype.visitIntervalDayTime=X;U.prototype.visitIntervalYearMonth=X;U.prototype.visitIntervalMonthDayNano=X;U.prototype.visitDuration=X;U.prototype.visitDurationSecond=X;U.prototype.visitDurationMillisecond=X;U.prototype.visitDurationMicrosecond=X;U.prototype.visitDurationNanosecond=X;U.prototype.visitFixedSizeList=X;U.prototype.visitMap=X;yi=new U});function $(r){let{type:e}=r;if(r.nullCount===0&&r.stride===1&&(E.isInt(e)&&e.bitWidth!==64||E.isTime(e)&&e.bitWidth!==64||E.isFloat(e)&&e.precision!==le.HALF))return new hc(r.data.length,n=>{let s=r.data[n];return s.values.subarray(0,s.length)[Symbol.iterator]()});let t=0;return new hc(r.data.length,n=>{let i=r.data[n].length,o=r.slice(t,t+i);return t+=i,new rp(o)})}var P,rp,Go,wl=p(()=>{Vt();Me();we();gl();P=class extends R{};rp=class{constructor(e){this.vector=e,this.index=0}next(){return this.index<this.vector.length?{value:this.vector.get(this.index++)}:{done:!0,value:null}}[Symbol.iterator](){return this}};P.prototype.visitNull=$;P.prototype.visitBool=$;P.prototype.visitInt=$;P.prototype.visitInt8=$;P.prototype.visitInt16=$;P.prototype.visitInt32=$;P.prototype.visitInt64=$;P.prototype.visitUint8=$;P.prototype.visitUint16=$;P.prototype.visitUint32=$;P.prototype.visitUint64=$;P.prototype.visitFloat=$;P.prototype.visitFloat16=$;P.prototype.visitFloat32=$;P.prototype.visitFloat64=$;P.prototype.visitUtf8=$;P.prototype.visitLargeUtf8=$;P.prototype.visitUtf8View=$;P.prototype.visitBinary=$;P.prototype.visitLargeBinary=$;P.prototype.visitBinaryView=$;P.prototype.visitFixedSizeBinary=$;P.prototype.visitDate=$;P.prototype.visitDateDay=$;P.prototype.visitDateMillisecond=$;P.prototype.visitTimestamp=$;P.prototype.visitTimestampSecond=$;P.prototype.visitTimestampMillisecond=$;P.prototype.visitTimestampMicrosecond=$;P.prototype.visitTimestampNanosecond=$;P.prototype.visitTime=$;P.prototype.visitTimeSecond=$;P.prototype.visitTimeMillisecond=$;P.prototype.visitTimeMicrosecond=$;P.prototype.visitTimeNanosecond=$;P.prototype.visitDecimal=$;P.prototype.visitList=$;P.prototype.visitLargeList=$;P.prototype.visitStruct=$;P.prototype.visitUnion=$;P.prototype.visitDenseUnion=$;P.prototype.visitSparseUnion=$;P.prototype.visitDictionary=$;P.prototype.visitInterval=$;P.prototype.visitIntervalDayTime=$;P.prototype.visitIntervalYearMonth=$;P.prototype.visitIntervalMonthDayNano=$;P.prototype.visitDuration=$;P.prototype.visitDurationSecond=$;P.prototype.visitDurationMillisecond=$;P.prototype.visitDurationMicrosecond=$;P.prototype.visitDurationNanosecond=$;P.prototype.visitFixedSizeList=$;P.prototype.visitMap=$;Go=new P});function rn(r){if(r){if(r instanceof G)return new B([r]);if(r instanceof B)return new B(r.data);if(r.type instanceof E)return new B([D(r)]);if(Array.isArray(r))return new B(r.flatMap(e=>TO(e)));if(ArrayBuffer.isView(r)){r instanceof DataView&&(r=new Uint8Array(r.buffer));let e={offset:0,length:r.length,nullCount:-1,data:r};if(r instanceof Int8Array)return new B([D(Object.assign(Object.assign({},e),{type:new Zt}))]);if(r instanceof Int16Array)return new B([D(Object.assign(Object.assign({},e),{type:new er}))]);if(r instanceof Int32Array)return new B([D(Object.assign(Object.assign({},e),{type:new Pe}))]);if(r instanceof BigInt64Array)return new B([D(Object.assign(Object.assign({},e),{type:new tr}))]);if(r instanceof Uint8Array||r instanceof Uint8ClampedArray)return new B([D(Object.assign(Object.assign({},e),{type:new rr}))]);if(r instanceof Uint16Array)return new B([D(Object.assign(Object.assign({},e),{type:new nr}))]);if(r instanceof Uint32Array)return new B([D(Object.assign(Object.assign({},e),{type:new vt}))]);if(r instanceof BigUint64Array)return new B([D(Object.assign(Object.assign({},e),{type:new Nr}))]);if(r instanceof Float32Array)return new B([D(Object.assign(Object.assign({},e),{type:new It}))]);if(r instanceof Float64Array)return new B([D(Object.assign(Object.assign({},e),{type:new sr}))]);throw new Error("Unrecognized input")}}throw new Error("Unrecognized input")}function TO(r){return r instanceof G?[r]:r instanceof B?r.data:rn(r).data}var HT,JT,YT,QT,B,xl,ht=p(()=>{Me();Po();we();wr();gl();hi();ar();yl();wl();we();JT=Symbol.for("apache-arrow/Vector"),YT={},QT={},B=class r{static isVector(e){return e?.[JT]===!0}constructor(e){var t,n,s;let i=e[0]instanceof r?e.flatMap(a=>a.data):e;if(i.length===0||i.some(a=>!(a instanceof G)))throw new TypeError("Vector constructor expects an Array of Data instances.");let o=(t=i[0])===null||t===void 0?void 0:t.type;switch(i.length){case 0:this._offsets=[0];break;case 1:{let{get:a,set:c,indexOf:u}=YT[o.typeId],l=i[0];this.isValid=f=>pc(l,f),this.get=f=>a(l,f),this.set=(f,d)=>c(l,f,d),this.indexOf=f=>u(l,f),this._offsets=[0,l.length];break}default:Object.setPrototypeOf(this,QT[o.typeId]),this._offsets=hl(i);break}this.data=i,this.type=o,this.stride=or(o),this.numChildren=(s=(n=o.children)===null||n===void 0?void 0:n.length)!==null&&s!==void 0?s:0,this.length=this._offsets.at(-1)}get byteLength(){return this.data.reduce((e,t)=>e+t.byteLength,0)}get nullable(){return KT(this.data)}get nullCount(){return dl(this.data)}get ArrayType(){return this.type.ArrayType}get[Symbol.toStringTag](){return`${this.VectorName}<${this.type[Symbol.toStringTag]}>`}get VectorName(){return`${w[this.type.typeId]}Vector`}isValid(e){return!1}get(e){return null}at(e){return this.get(pi(e,this.length))}set(e,t){}indexOf(e,t){return-1}includes(e,t){return this.indexOf(e,t)>-1}[Symbol.iterator](){return Go.visit(this)}concat(...e){return new r(this.data.concat(e.flatMap(t=>t.data).flat(Number.POSITIVE_INFINITY)))}slice(e,t){return new r(fc(this,e,t,({data:n,_offsets:s},i,o)=>pl(n,s,i,o)))}toJSON(){return[...this]}toArray(){let{type:e,data:t,length:n,stride:s,ArrayType:i}=this;switch(e.typeId){case w.Int:case w.Float:case w.Decimal:case w.Time:case w.Timestamp:switch(t.length){case 0:return new i;case 1:return t[0].values.subarray(0,n*s);default:return t.reduce((o,{values:a,length:c})=>(o.array.set(a.subarray(0,c*s),o.offset),o.offset+=c*s,o),{array:new i(n*s),offset:0}).array}}return[...this]}toString(){return`[${[...this].join(",")}]`}getChild(e){var t;return this.getChildAt((t=this.type.children)===null||t===void 0?void 0:t.findIndex(n=>n.name===e))}getChildAt(e){return e>-1&&e<this.numChildren?new r(this.data.map(({children:t})=>t[e])):null}get isMemoized(){return E.isDictionary(this.type)?this.data[0].dictionary.isMemoized:!1}memoize(){if(E.isDictionary(this.type)){let e=new xl(this.data[0].dictionary),t=this.data.map(n=>{let s=n.clone();return s.dictionary=e,s});return new r(t)}return new xl(this)}unmemoize(){if(E.isDictionary(this.type)&&this.isMemoized){let e=this.data[0].dictionary.unmemoize(),t=this.data.map(n=>{let s=n.clone();return s.dictionary=e,s});return new r(t)}return this}};HT=Symbol.toStringTag;B[HT]=(r=>{r.type=E.prototype,r.data=[],r.length=0,r.stride=1,r.numChildren=0,r._offsets=new Uint32Array([0]),r[Symbol.isConcatSpreadable]=!0,r[JT]=!0;let e=Object.keys(w).map(t=>w[t]).filter(t=>typeof t=="number"&&t!==w.NONE);for(let t of e){let n=ze.getVisitFnByTypeId(t),s=nt.getVisitFnByTypeId(t),i=yi.getVisitFnByTypeId(t);YT[t]={get:n,set:s,indexOf:i},QT[t]=Object.create(r,{isValid:{value:jo(pc)},get:{value:jo(ze.getVisitFnByTypeId(t))},set:{value:ml(nt.getVisitFnByTypeId(t))},indexOf:{value:bl(yi.getVisitFnByTypeId(t))}})}return"Vector"})(B.prototype);Object.defineProperty(B,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===B&&B.isVector(e)}});xl=class r extends B{constructor(e){super(e.data);let t=this.get,n=this.set,s=this.slice,i=new Array(this.length);Object.defineProperty(this,"get",{value(o){let a=i[o];if(a!==void 0)return a;let c=t.call(this,o);return i[o]=c,c}}),Object.defineProperty(this,"set",{value(o,a){n.call(this,o,a),i[o]=a}}),Object.defineProperty(this,"slice",{value:(o,a)=>new r(s.call(this,o,a))}),Object.defineProperty(this,"isMemoized",{value:!0}),Object.defineProperty(this,"unmemoize",{value:()=>new B(this.data)}),Object.defineProperty(this,"memoize",{value:()=>this})}}});function ZT(r){if(!r||r.length<=0)return function(s){return!0};let e="",t=r.filter(n=>n===n);return t.length>0&&(e=`
|
|
13
13
|
switch (x) {${t.map(n=>`
|
|
14
|
-
case ${
|
|
14
|
+
case ${_O(n)}:`).join("")}
|
|
15
15
|
return false;
|
|
16
16
|
}`),r.length!==t.length&&(e=`if (x !== x) return false;
|
|
17
17
|
${e}`),new Function("x",`${e}
|
|
18
|
-
return true;`)}function TF(r){return typeof r!="bigint"?Lr(r):`${Lr(r)}n`}var wT=p(()=>{Ya()});function Uh(r,e){let t=Math.ceil(r)*e-1;return(t-t%64+64||64)/e}function xT(r,e=0){return r.length>=e?r.subarray(0,e):Da(new r.constructor(e),r,0)}var kt,wn,Uo,bs,Nr=p(()=>{$e();kt=class{constructor(e,t=0,n=1){this.length=Math.ceil(t/n),this.buffer=new e(this.length),this.stride=n,this.BYTES_PER_ELEMENT=e.BYTES_PER_ELEMENT,this.ArrayType=e}get byteLength(){return Math.ceil(this.length*this.stride)*this.BYTES_PER_ELEMENT}get reservedLength(){return this.buffer.length/this.stride}get reservedByteLength(){return this.buffer.byteLength}set(e,t){return this}append(e){return this.set(this.length,e)}reserve(e){if(e>0){this.length+=e;let t=this.stride,n=this.length*t,s=this.buffer.length;n>=s&&this._resize(s===0?Uh(n*1,this.BYTES_PER_ELEMENT):Uh(n*2,this.BYTES_PER_ELEMENT))}return this}flush(e=this.length){e=Uh(e*this.stride,this.BYTES_PER_ELEMENT);let t=xT(this.buffer,e);return this.clear(),t}clear(){return this.length=0,this.buffer=new this.ArrayType,this}_resize(e){return this.buffer=xT(this.buffer,e)}},wn=class extends kt{last(){return this.get(this.length-1)}get(e){return this.buffer[e]}set(e,t){return this.reserve(e-this.length+1),this.buffer[e*this.stride]=t,this}},Uo=class extends wn{constructor(){super(Uint8Array,0,1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(e){return this.buffer[e>>3]>>e%8&1}set(e,t){let{buffer:n}=this.reserve(e-this.length+1),s=e>>3,i=e%8,o=n[s]>>i&1;return t?o===0&&(n[s]|=1<<i,++this.numValid):o===1&&(n[s]&=~(1<<i),--this.numValid),this}clear(){return this.numValid=0,super.clear()}},bs=class extends wn{constructor(e){super(e.OffsetArrayType,1,1)}append(e){return this.set(this.length-1,e)}set(e,t){let n=this.length-1,s=this.reserve(e-n+1).buffer;return n<e++&&n>=0&&s.fill(s[n],n,e),s[e]=s[e-1]+t,this}flush(e=this.length-1){return e>this.length&&this.set(e-1,this.BYTES_PER_ELEMENT>4?BigInt(0):0),super.flush(e+1)}}});var xe,Ge,dt,ve=p(()=>{lt();br();oc();ye();wT();Nr();xe=class{static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e){throw new Error('"throughDOM" not available in this environment')}constructor({type:e,nullValues:t}){this.length=0,this.finished=!1,this.type=e,this.children=[],this.nullValues=t,this.stride=rr(e),this._nulls=new Uo,t&&t.length>0&&(this._isValid=yT(t))}toVector(){return new L([this.flush()])}get ArrayType(){return this.type.ArrayType}get nullCount(){return this._nulls.numInvalid}get numChildren(){return this.children.length}get byteLength(){let e=0,{_offsets:t,_values:n,_nulls:s,_typeIds:i,children:o}=this;return t&&(e+=t.byteLength),n&&(e+=n.byteLength),s&&(e+=s.byteLength),i&&(e+=i.byteLength),o.reduce((a,c)=>a+c.byteLength,e)}get reservedLength(){return this._nulls.reservedLength}get reservedByteLength(){let e=0;return this._offsets&&(e+=this._offsets.reservedByteLength),this._values&&(e+=this._values.reservedByteLength),this._nulls&&(e+=this._nulls.reservedByteLength),this._typeIds&&(e+=this._typeIds.reservedByteLength),this.children.reduce((t,n)=>t+n.reservedByteLength,e)}get valueOffsets(){return this._offsets?this._offsets.buffer:null}get values(){return this._values?this._values.buffer:null}get nullBitmap(){return this._nulls?this._nulls.buffer:null}get typeIds(){return this._typeIds?this._typeIds.buffer:null}append(e){return this.set(this.length,e)}isValid(e){return this._isValid(e)}set(e,t){return this.setValid(e,this.isValid(t))&&this.setValue(e,t),this}setValue(e,t){this._setValue(this,e,t)}setValid(e,t){return this.length=this._nulls.set(e,+t).length,t}addChild(e,t=`${this.numChildren}`){throw new Error(`Cannot append children to non-nested type "${this.type}"`)}getChildAt(e){return this.children[e]||null}flush(){let e,t,n,s,{type:i,length:o,nullCount:a,_typeIds:c,_offsets:u,_values:f,_nulls:l}=this;(t=c?.flush(o))?s=u?.flush(o):(s=u?.flush(o))?e=f?.flush(u.last()):e=f?.flush(o),a>0&&(n=l?.flush(o));let d=this.children.map(h=>h.flush());return this.clear(),M({type:i,length:o,nullCount:a,children:d,child:d[0],data:e,typeIds:t,nullBitmap:n,valueOffsets:s})}finish(){this.finished=!0;for(let e of this.children)e.finish();return this}clear(){var e,t,n,s;this.length=0,(e=this._nulls)===null||e===void 0||e.clear(),(t=this._values)===null||t===void 0||t.clear(),(n=this._offsets)===null||n===void 0||n.clear(),(s=this._typeIds)===null||s===void 0||s.clear();for(let i of this.children)i.clear();return this}};xe.prototype.length=1;xe.prototype.stride=1;xe.prototype.children=null;xe.prototype.finished=!1;xe.prototype.nullValues=null;xe.prototype._isValid=()=>!0;Ge=class extends xe{constructor(e){super(e),this._values=new wn(this.ArrayType,0,this.stride)}setValue(e,t){let n=this._values;return n.reserve(e-n.length+1),super.setValue(e,t)}},dt=class extends xe{constructor(e){super(e),this._pendingLength=0,this._offsets=new bs(e.type)}setValue(e,t){let n=this._pending||(this._pending=new Map),s=n.get(e);s&&(this._pendingLength-=s.length),this._pendingLength+=t instanceof mr?t[ps].length:t.length,n.set(e,t)}setValid(e,t){return super.setValid(e,t)?!0:((this._pending||(this._pending=new Map)).set(e,void 0),!1)}clear(){return this._pendingLength=0,this._pending=void 0,super.clear()}flush(){return this._flush(),super.flush()}finish(){return this._flush(),super.finish()}_flush(){let e=this._pending,t=this._pendingLength;return this._pendingLength=0,this._pending=void 0,e&&e.size>0&&this._flushPending(e,t),this}}});var pi,Vh=p(()=>{pi=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(e,t,n,s){return e.prep(8,24),e.writeInt64(BigInt(s??0)),e.pad(4),e.writeInt32(n),e.writeInt64(BigInt(t??0)),e.offset()}}});var sr,TT=p(()=>{ae();Vh();vo();Su();hh();sr=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFooter(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFooter(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):me.V1}schema(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new Ot).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}dictionaries(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new pi).__init(this.bb.__vector(this.bb_pos+n)+e*24,this.bb):null}dictionariesLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}recordBatches(e,t){let n=this.bb.__offset(this.bb_pos,10);return n?(t||new pi).__init(this.bb.__vector(this.bb_pos+n)+e*24,this.bb):null}recordBatchesLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,12);return n?(t||new Be).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startFooter(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,me.V1)}static addSchema(e,t){e.addFieldOffset(1,t,0)}static addDictionaries(e,t){e.addFieldOffset(2,t,0)}static startDictionariesVector(e,t){e.startVector(24,t,8)}static addRecordBatches(e,t){e.addFieldOffset(3,t,0)}static startRecordBatchesVector(e,t){e.startVector(24,t,8)}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endFooter(e){return e.endObject()}static finishFooterBuffer(e,t){e.finish(t)}static finishSizePrefixedFooterBuffer(e,t){e.finish(t,void 0,!0)}}});function hf(r,e){return new Map([...r||new Map,...e||new Map])}function Ph(r,e=new Map){for(let t=-1,n=r.length;++t<n;){let i=r[t].type;if(S.isDictionary(i)){if(!e.has(i.id))e.set(i.id,i.dictionary);else if(e.get(i.id)!==i.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}i.children&&i.children.length>0&&Ph(i.children,e)}return e}var _T,AT,Y,F,ht=p(()=>{Fe();ye();_T=Symbol.for("apache-arrow/Schema"),AT=Symbol.for("apache-arrow/Field"),Y=class r{static isSchema(e){return e?.[_T]===!0}constructor(e=[],t,n,s=me.V5){this.fields=e||[],this.metadata=t||new Map,n||(n=Ph(this.fields)),this.dictionaries=n,this.metadataVersion=s}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(e=>e.name)}toString(){return`Schema<{ ${this.fields.map((e,t)=>`${t}: ${e}`).join(", ")} }>`}select(e){let t=new Set(e),n=this.fields.filter(s=>t.has(s.name));return new r(n,this.metadata)}selectAt(e){let t=e.map(n=>this.fields[n]).filter(Boolean);return new r(t,this.metadata)}assign(...e){let t=e[0]instanceof r?e[0]:Array.isArray(e[0])?new r(e[0]):new r(e),n=[...this.fields],s=hf(hf(new Map,this.metadata),t.metadata),i=t.fields.filter(a=>{let c=n.findIndex(u=>u.name===a.name);return~c?(n[c]=a.clone({metadata:hf(hf(new Map,n[c].metadata),a.metadata)}))&&!1:!0}),o=Ph(i,new Map);return new r([...n,...i],s,new Map([...this.dictionaries,...o]))}};Y.prototype.fields=null;Y.prototype.metadata=null;Y.prototype.dictionaries=null;Y.prototype[_T]=!0;Object.defineProperty(Y,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===Y&&Y.isSchema(e)}});F=class r{static isField(e){return e?.[AT]===!0}static new(...e){let[t,n,s,i]=e;return e[0]&&typeof e[0]=="object"&&({name:t}=e[0],n===void 0&&(n=e[0].type),s===void 0&&(s=e[0].nullable),i===void 0&&(i=e[0].metadata)),new r(`${t}`,n,s,i)}constructor(e,t,n=!1,s){this.name=e,this.type=t,this.nullable=n,this.metadata=s||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...e){let[t,n,s,i]=e;return!e[0]||typeof e[0]!="object"?[t=this.name,n=this.type,s=this.nullable,i=this.metadata]=e:{name:t=this.name,type:n=this.type,nullable:s=this.nullable,metadata:i=this.metadata}=e[0],r.new(t,n,s,i)}};F.prototype.type=null;F.prototype.name=null;F.prototype.nullable=null;F.prototype.metadata=null;F.prototype[AT]=!0;Object.defineProperty(F,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===F&&F.isField(e)}})});var _F,AF,xn,jh,kr,Gh=p(()=>{Vh();TT();ae();ht();Fe();$e();qr();_F=ii,AF=Ye,xn=class{static decode(e){e=new AF(D(e));let t=sr.getRootAsFooter(e),n=Y.decode(t.schema(),new Map,t.version());return new jh(n,t)}static encode(e){let t=new _F,n=Y.encode(t,e.schema);sr.startRecordBatchesVector(t,e.numRecordBatches);for(let o of[...e.recordBatches()].slice().reverse())kr.encode(t,o);let s=t.endVector();sr.startDictionariesVector(t,e.numDictionaries);for(let o of[...e.dictionaryBatches()].slice().reverse())kr.encode(t,o);let i=t.endVector();return sr.startFooter(t),sr.addSchema(t,n),sr.addVersion(t,me.V5),sr.addRecordBatches(t,s),sr.addDictionaries(t,i),sr.finishFooterBuffer(t,sr.endFooter(t)),t.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(e,t=me.V5,n,s){this.schema=e,this.version=t,n&&(this._recordBatches=n),s&&(this._dictionaryBatches=s)}*recordBatches(){for(let e,t=-1,n=this.numRecordBatches;++t<n;)(e=this.getRecordBatch(t))&&(yield e)}*dictionaryBatches(){for(let e,t=-1,n=this.numDictionaries;++t<n;)(e=this.getDictionaryBatch(t))&&(yield e)}getRecordBatch(e){return e>=0&&e<this.numRecordBatches&&this._recordBatches[e]||null}getDictionaryBatch(e){return e>=0&&e<this.numDictionaries&&this._dictionaryBatches[e]||null}},jh=class extends xn{get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}constructor(e,t){super(e,t.version()),this._footer=t}getRecordBatch(e){if(e>=0&&e<this.numRecordBatches){let t=this._footer.recordBatches(e);if(t)return kr.decode(t)}return null}getDictionaryBatch(e){if(e>=0&&e<this.numDictionaries){let t=this._footer.dictionaries(e);if(t)return kr.decode(t)}return null}},kr=class r{static decode(e){return new r(e.metaDataLength(),e.bodyLength(),e.offset())}static encode(e,t){let{metaDataLength:n}=t,s=BigInt(t.offset),i=BigInt(t.bodyLength);return pi.createBlock(e,s,n,i)}constructor(e,t,n){this.metaDataLength=e,this.offset=ee(n),this.bodyLength=ee(t)}}});var ir,vT=p(()=>{ae();vo();Ru();Su();ir=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMessage(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMessage(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):me.V1}headerType(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):ne.NONE}header(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__union(e,this.bb_pos+t):null}bodyLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,12);return n?(t||new Be).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startMessage(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,me.V1)}static addHeaderType(e,t){e.addFieldInt8(1,t,ne.NONE)}static addHeader(e,t){e.addFieldOffset(2,t,0)}static addBodyLength(e,t){e.addFieldInt64(3,t,BigInt("0"))}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endMessage(e){return e.endObject()}static finishMessageBuffer(e,t){e.finish(t)}static finishSizePrefixedMessageBuffer(e,t){e.finish(t,void 0,!0)}static createMessage(e,t,n,s,i,o){return r.startMessage(e),r.addVersion(e,t),r.addHeaderType(e,n),r.addHeader(e,s),r.addBodyLength(e,i),r.addCustomMetadata(e,o),r.endMessage(e)}}});var zh,pf,IT=p(()=>{Nt();Kw();Ou();oh();Pw();jw();zw();Gw();Hw();Jw();$w();rh();th();uh();fh();ah();nh();qw();Ww();Xw();lh();eh();sh();ih();ch();zh=class extends R{visit(e,t){return e==null||t==null?void 0:super.visit(e,t)}visitNull(e,t){return Ka.startNull(t),Ka.endNull(t)}visitInt(e,t){return Sr.startInt(t),Sr.addBitWidth(t,e.bitWidth),Sr.addIsSigned(t,e.isSigned),Sr.endInt(t)}visitFloat(e,t){return Qn.startFloatingPoint(t),Qn.addPrecision(t,e.precision),Qn.endFloatingPoint(t)}visitBinary(e,t){return Pa.startBinary(t),Pa.endBinary(t)}visitBinaryView(e,t){return ja.startBinaryView(t),ja.endBinaryView(t)}visitLargeBinary(e,t){return za.startLargeBinary(t),za.endLargeBinary(t)}visitBool(e,t){return Ga.startBool(t),Ga.endBool(t)}visitUtf8(e,t){return Ha.startUtf8(t),Ha.endUtf8(t)}visitUtf8View(e,t){return Ja.startUtf8View(t),Ja.endUtf8View(t)}visitLargeUtf8(e,t){return $a.startLargeUtf8(t),$a.endLargeUtf8(t)}visitDecimal(e,t){return $r.startDecimal(t),$r.addScale(t,e.scale),$r.addPrecision(t,e.precision),$r.addBitWidth(t,e.bitWidth),$r.endDecimal(t)}visitDate(e,t){return Xn.startDate(t),Xn.addUnit(t,e.unit),Xn.endDate(t)}visitTime(e,t){return mn.startTime(t),mn.addUnit(t,e.unit),mn.addBitWidth(t,e.bitWidth),mn.endTime(t)}visitTimestamp(e,t){let n=e.timezone&&t.createString(e.timezone)||void 0;return bn.startTimestamp(t),bn.addUnit(t,e.unit),n!==void 0&&bn.addTimezone(t,n),bn.endTimestamp(t)}visitInterval(e,t){return Zn.startInterval(t),Zn.addUnit(t,e.unit),Zn.endInterval(t)}visitDuration(e,t){return Hn.startDuration(t),Hn.addUnit(t,e.unit),Hn.endDuration(t)}visitList(e,t){return qa.startList(t),qa.endList(t)}visitLargeList(e,t){return Wa.startLargeList(t),Wa.endLargeList(t)}visitStruct(e,t){return Xa.startStruct_(t),Xa.endStruct_(t)}visitUnion(e,t){Er.startTypeIdsVector(t,e.typeIds.length);let n=Er.createTypeIdsVector(t,e.typeIds);return Er.startUnion(t),Er.addMode(t,e.mode),Er.addTypeIds(t,n),Er.endUnion(t)}visitDictionary(e,t){let n=this.visit(e.indices,t);return Wr.startDictionaryEncoding(t),Wr.addId(t,BigInt(e.id)),Wr.addIsOrdered(t,e.isOrdered),n!==void 0&&Wr.addIndexType(t,n),Wr.endDictionaryEncoding(t)}visitFixedSizeBinary(e,t){return Jn.startFixedSizeBinary(t),Jn.addByteWidth(t,e.byteWidth),Jn.endFixedSizeBinary(t)}visitFixedSizeList(e,t){return Yn.startFixedSizeList(t),Yn.addListSize(t,e.listSize),Yn.endFixedSizeList(t)}visitMap(e,t){return es.startMap(t),es.addKeysSorted(t,e.keysSorted),es.endMap(t)}},pf=new zh});function BT(r,e=new Map){return new Y(vF(r,e),mf(r.metadata),e)}function Wh(r){return new ze(r.count,OT(r.columns),MT(r.columns),null,RT(r.columns))}function FT(r){return new pt(Wh(r.data),r.id,r.isDelta)}function vF(r,e){return(r.fields||[]).filter(Boolean).map(t=>F.fromJSON(t,e))}function ST(r,e){return(r.children||[]).filter(Boolean).map(t=>F.fromJSON(t,e))}function OT(r){return(r||[]).reduce((e,t)=>[...e,new gr(t.count,IF(t.VALIDITY)),...OT(t.children)],[])}function MT(r,e=[]){for(let t=-1,n=(r||[]).length;++t<n;){let s=r[t];if(s.VALIDITY&&e.push(new Ne(e.length,s.VALIDITY.length)),s.TYPE_ID&&e.push(new Ne(e.length,s.TYPE_ID.length)),s.OFFSET&&e.push(new Ne(e.length,s.OFFSET.length)),s.DATA&&e.push(new Ne(e.length,s.DATA.length)),s.VIEWS&&e.push(new Ne(e.length,s.VIEWS.length)),s.VARIADIC_DATA_BUFFERS)for(let i of s.VARIADIC_DATA_BUFFERS)e.push(new Ne(e.length,i.length));e=MT(s.children,e)}return e}function IF(r){return(r||[]).reduce((e,t)=>e+ +(t===0),0)}function RT(r){return(r||[]).reduce((e,t)=>[...e,...t.VARIADIC_DATA_BUFFERS?[t.VARIADIC_DATA_BUFFERS.length]:[],...RT(t.children)],[])}function DT(r,e){let t,n,s,i,o,a;return!e||!(i=r.dictionary)?(o=LT(r,ST(r,e)),s=new F(r.name,o,r.nullable,mf(r.metadata))):e.has(t=i.id)?(n=(n=i.indexType)?ET(n):new Ce,a=new Pe(e.get(t),n,t,i.isOrdered),s=new F(r.name,a,r.nullable,mf(r.metadata))):(n=(n=i.indexType)?ET(n):new Ce,e.set(t,o=LT(r,ST(r,e))),a=new Pe(o,n,t,i.isOrdered),s=new F(r.name,a,r.nullable,mf(r.metadata))),s||null}function mf(r=[]){return new Map(r.map(({key:e,value:t})=>[e,t]))}function ET(r){return new Le(r.isSigned,r.bitWidth)}function LT(r,e){let t=r.type.name;switch(t){case"NONE":return new De;case"null":return new De;case"binary":return new Mt;case"largebinary":return new Mr;case"binaryview":return new Q;case"utf8":return new at;case"largeutf8":return new Rr;case"utf8view":return new Tt;case"bool":return new ct;case"list":return new Ve((e||[])[0]);case"largelist":return new tr((e||[])[0]);case"struct":return new he(e||[]);case"struct_":return new he(e||[])}switch(t){case"int":{let n=r.type;return new Le(n.isSigned,n.bitWidth)}case"floatingpoint":{let n=r.type;return new ot(ue[n.precision])}case"decimal":{let n=r.type;return new Rt(n.scale,n.precision,n.bitWidth)}case"date":{let n=r.type;return new _t(ge[n.unit])}case"time":{let n=r.type;return new Ze(E[n.unit],n.bitWidth)}case"timestamp":{let n=r.type;return new et(E[n.unit],n.timezone)}case"interval":{let n=r.type;return new ut(oe[n.unit])}case"duration":{let n=r.type;return new At(E[n.unit])}case"union":{let n=r.type,[s,...i]=(n.mode+"").toLowerCase(),o=s.toUpperCase()+i.join("");return new vt(de[o],n.typeIds||[],e||[])}case"fixedsizebinary":{let n=r.type;return new Dt(n.byteWidth)}case"fixedsizelist":{let n=r.type;return new Ee(n.listSize,(e||[])[0])}case"map":{let n=r.type;return new ft((e||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${t}"`)}var NT=p(()=>{ht();ye();gs();Fe()});function LF(r,e){return(()=>{switch(e){case ne.Schema:return Y.fromJSON(r);case ne.RecordBatch:return ze.fromJSON(r);case ne.DictionaryBatch:return pt.fromJSON(r)}throw new Error(`Unrecognized Message type: { name: ${ne[e]}, type: ${e} }`)})}function BF(r,e){return(()=>{switch(e){case ne.Schema:return Y.decode(r.header(new Ot),new Map,r.version());case ne.RecordBatch:return ze.decode(r.header(new st),r.version());case ne.DictionaryBatch:return pt.decode(r.header(new pn),r.version())}throw new Error(`Unrecognized Message type: { name: ${ne[e]}, type: ${e} }`)})}function FF(r,e=new Map,t=me.V5){let n=UF(r,e);return new Y(n,bf(r),e,t)}function OF(r,e=me.V5){return new ze(r.length(),NF(r),kF(r,e),VT(r.compression()),CF(r))}function MF(r,e=me.V5){return new pt(ze.decode(r.data(),e),r.id(),r.isDelta())}function RF(r){return new Ne(r.offset(),r.length())}function DF(r){return new gr(r.length(),r.nullCount())}function NF(r){let e=[];for(let t,n=-1,s=-1,i=r.nodesLength();++n<i;)(t=r.nodes(n))&&(e[++s]=gr.decode(t));return e}function kF(r,e){let t=[];for(let n,s=-1,i=-1,o=r.buffersLength();++s<o;)(n=r.buffers(s))&&(e<me.V4&&(n.bb_pos+=8*(s+1)),t[++i]=Ne.decode(n));return t}function CF(r){let e=[],t=Math.trunc(r.variadicBufferCountsLength());for(let n=0;n<t;++n)e.push(ee(r.variadicBufferCounts(n)));return e}function UF(r,e){let t=[];for(let n,s=-1,i=-1,o=r.fieldsLength();++s<o;)(n=r.fields(s))&&(t[++i]=F.decode(n,e));return t}function kT(r,e){let t=[];for(let n,s=-1,i=-1,o=r.childrenLength();++s<o;)(n=r.children(s))&&(t[++i]=F.decode(n,e));return t}function VF(r,e){let t,n,s,i,o,a;return!e||!(a=r.dictionary())?(s=UT(r,kT(r,e)),n=new F(r.name(),s,r.nullable(),bf(r))):e.has(t=ee(a.id()))?(i=(i=a.indexType())?CT(i):new Ce,o=new Pe(e.get(t),i,t,a.isOrdered()),n=new F(r.name(),o,r.nullable(),bf(r))):(i=(i=a.indexType())?CT(i):new Ce,e.set(t,s=UT(r,kT(r,e))),o=new Pe(s,i,t,a.isOrdered()),n=new F(r.name(),o,r.nullable(),bf(r))),n||null}function bf(r){let e=new Map;if(r)for(let t,n,s=-1,i=Math.trunc(r.customMetadataLength());++s<i;)(t=r.customMetadata(s))&&(n=t.key())!=null&&e.set(n,t.value());return e}function PF(r){let e=new Map;for(let t,n,s=-1,i=Math.trunc(r.customMetadataLength());++s<i;)(t=r.customMetadata(s))&&(n=t.key())!=null&&e.set(n,t.value());return e}function CT(r){return new Le(r.isSigned(),r.bitWidth())}function UT(r,e){let t=r.typeType();switch(t){case G.NONE:return new De;case G.Null:return new De;case G.Binary:return new Mt;case G.LargeBinary:return new Mr;case G.BinaryView:return new Q;case G.Utf8:return new at;case G.LargeUtf8:return new Rr;case G.Utf8View:return new Tt;case G.Bool:return new ct;case G.List:return new Ve((e||[])[0]);case G.LargeList:return new tr((e||[])[0]);case G.Struct_:return new he(e||[])}switch(t){case G.Int:{let n=r.type(new Sr);return new Le(n.isSigned(),n.bitWidth())}case G.FloatingPoint:{let n=r.type(new Qn);return new ot(n.precision())}case G.Decimal:{let n=r.type(new $r);return new Rt(n.scale(),n.precision(),n.bitWidth())}case G.Date:{let n=r.type(new Xn);return new _t(n.unit())}case G.Time:{let n=r.type(new mn);return new Ze(n.unit(),n.bitWidth())}case G.Timestamp:{let n=r.type(new bn);return new et(n.unit(),n.timezone())}case G.Interval:{let n=r.type(new Zn);return new ut(n.unit())}case G.Duration:{let n=r.type(new Hn);return new At(n.unit())}case G.Union:{let n=r.type(new Er);return new vt(n.mode(),n.typeIdsArray()||[],e||[])}case G.FixedSizeBinary:{let n=r.type(new Jn);return new Dt(n.byteWidth())}case G.FixedSizeList:{let n=r.type(new Yn);return new Ee(n.listSize(),(e||[])[0])}case G.Map:{let n=r.type(new es);return new ft((e||[])[0],n.keysSorted())}}throw new Error(`Unrecognized type: "${G[t]}" (${t})`)}function VT(r){return r?new mi(r.codec(),r.method()):null}function jF(r,e){let t=e.fields.map(i=>F.encode(r,i));Ot.startFieldsVector(r,t.length);let n=Ot.createFieldsVector(r,t),s=e.metadata&&e.metadata.size>0?Ot.createCustomMetadataVector(r,[...e.metadata].map(([i,o])=>{let a=r.createString(`${i}`),c=r.createString(`${o}`);return Be.startKeyValue(r),Be.addKey(r,a),Be.addValue(r,c),Be.endKeyValue(r)})):-1;return Ot.startSchema(r),Ot.addFields(r,n),Ot.addEndianness(r,KF?Kn.Little:Kn.Big),s!==-1&&Ot.addCustomMetadata(r,s),Ot.endSchema(r)}function GF(r,e){let t=-1,n=-1,s=-1,i=e.type,o=e.typeId;S.isDictionary(i)?(o=i.dictionary.typeId,s=pf.visit(i,r),n=pf.visit(i.dictionary,r)):n=pf.visit(i,r);let a=(i.children||[]).map(f=>F.encode(r,f)),c=it.createChildrenVector(r,a),u=e.metadata&&e.metadata.size>0?it.createCustomMetadataVector(r,[...e.metadata].map(([f,l])=>{let d=r.createString(`${f}`),h=r.createString(`${l}`);return Be.startKeyValue(r),Be.addKey(r,d),Be.addValue(r,h),Be.endKeyValue(r)})):-1;return e.name&&(t=r.createString(e.name)),it.startField(r),it.addType(r,n),it.addTypeType(r,o),it.addChildren(r,c),it.addNullable(r,!!e.nullable),t!==-1&&it.addName(r,t),s!==-1&&it.addDictionary(r,s),u!==-1&&it.addCustomMetadata(r,u),it.endField(r)}function zF(r,e){let t=e.nodes||[],n=e.buffers||[],s=e.variadicBufferCounts||[];st.startNodesVector(r,t.length);for(let u of t.slice().reverse())gr.encode(r,u);let i=r.endVector();st.startBuffersVector(r,n.length);for(let u of n.slice().reverse())Ne.encode(r,u);let o=r.endVector(),a=null;e.compression!==null&&(a=PT(r,e.compression));let c=-1;return s.length>0&&(c=st.createVariadicBufferCountsVector(r,s.map(BigInt))),st.startRecordBatch(r),st.addLength(r,BigInt(e.length)),st.addNodes(r,i),st.addBuffers(r,o),e.compression!==null&&a&&st.addCompression(r,a),c!==-1&&st.addVariadicBufferCounts(r,c),st.endRecordBatch(r)}function PT(r,e){return hn.startBodyCompression(r),hn.addCodec(r,e.type),hn.addMethod(r,e.method),hn.endBodyCompression(r)}function WF(r,e){let t=ze.encode(r,e.data);return pn.startDictionaryBatch(r),pn.addId(r,BigInt(e.id)),pn.addIsDelta(r,e.isDelta),pn.addData(r,t),pn.endDictionaryBatch(r)}function $F(r,e){return Ao.createFieldNode(r,BigInt(e.length),BigInt(e.nullCount))}function qF(r,e){return _o.createBuffer(r,BigInt(e.offset),BigInt(e.length))}var SF,EF,mt,ze,pt,Ne,gr,mi,KF,gs=p(()=>{ae();hh();Ou();Qd();Uw();Jd();dh();Yd();Mu();vo();Zd();oh();rh();th();uh();fh();ah();nh();lh();sh();ih();ch();vT();Hd();Xd();ht();$e();qr();Fe();IT();NT();ye();SF=ii,EF=Ye,mt=class r{static fromJSON(e,t){let n=new r(0,me.V5,t);return n._createHeader=LF(e,t),n}static decode(e){e=new EF(D(e));let t=ir.getRootAsMessage(e),n=t.bodyLength(),s=t.version(),i=t.headerType(),o=PF(t),a=new r(n,s,i,void 0,o);return a._createHeader=BF(t,i),a}static encode(e){let t=new SF,n=-1;e.isSchema()?n=Y.encode(t,e.header()):e.isRecordBatch()?n=ze.encode(t,e.header()):e.isDictionaryBatch()&&(n=pt.encode(t,e.header()));let s=e.metadata&&e.metadata.size>0?ir.createCustomMetadataVector(t,[...e.metadata].map(([i,o])=>{let a=t.createString(`${i}`),c=t.createString(`${o}`);return Be.startKeyValue(t),Be.addKey(t,a),Be.addValue(t,c),Be.endKeyValue(t)})):-1;return ir.startMessage(t),ir.addVersion(t,me.V5),ir.addHeader(t,n),ir.addHeaderType(t,e.headerType),ir.addBodyLength(t,BigInt(e.bodyLength)),s!==-1&&ir.addCustomMetadata(t,s),ir.finishMessageBuffer(t,ir.endMessage(t)),t.asUint8Array()}static from(e,t=0){if(e instanceof Y)return new r(0,me.V5,ne.Schema,e);if(e instanceof ze)return new r(t,me.V5,ne.RecordBatch,e,e.metadata);if(e instanceof pt)return new r(t,me.V5,ne.DictionaryBatch,e);throw new Error(`Unrecognized Message header: ${e}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get compression(){return this._compression}get bodyLength(){return this._bodyLength}get metadata(){return this._metadata}header(){return this._createHeader()}isSchema(){return this.headerType===ne.Schema}isRecordBatch(){return this.headerType===ne.RecordBatch}isDictionaryBatch(){return this.headerType===ne.DictionaryBatch}constructor(e,t,n,s,i){this._version=t,this._headerType=n,this.body=new Uint8Array(0),this._compression=s?.compression,s&&(this._createHeader=()=>s),this._bodyLength=ee(e),this._metadata=i||new Map}},ze=class{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}get compression(){return this._compression}get variadicBufferCounts(){return this._variadicBufferCounts}get metadata(){return this._metadata}constructor(e,t,n,s,i=[],o){this._nodes=t,this._buffers=n,this._length=ee(e),this._compression=s,this._variadicBufferCounts=i,this._metadata=o||new Map}},pt=class{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(e,t,n=!1){this._data=e,this._isDelta=n,this._id=ee(t)}},Ne=class{constructor(e,t){this.offset=ee(e),this.length=ee(t)}},gr=class{constructor(e,t){this.length=ee(e),this.nullCount=ee(t)}},mi=class{constructor(e,t=oi.BUFFER){this.type=e,this.method=t}};F.encode=GF;F.decode=VF;F.fromJSON=DT;Y.encode=jF;Y.decode=FF;Y.fromJSON=BT;ze.encode=zF;ze.decode=OF;ze.fromJSON=Wh;pt.encode=WF;pt.decode=MF;pt.fromJSON=FT;gr.encode=$F;gr.decode=DF;Ne.encode=qF;Ne.decode=RF;mi.encode=PT;mi.decode=VT;KF=(()=>{let r=new ArrayBuffer(2);return new DataView(r).setInt16(0,256,!0),new Int16Array(r)[0]===256})()});var Ie,lc,bi,gf,dc=p(()=>{Ft();ka();Ie=Object.freeze({done:!0,value:void 0}),lc=class{constructor(e){this._json=e}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}},bi=class{tee(){return this._getDOMStream().tee()}pipe(e,t){return this._getNodeStream().pipe(e,t)}pipeTo(e,t){return this._getDOMStream().pipeTo(e,t)}pipeThrough(e,t){return this._getDOMStream().pipeThrough(e,t)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}},gf=class extends bi{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}get closed(){return this._closedPromise}cancel(e){return B(this,void 0,void 0,function*(){yield this.return(e)})}write(e){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(e):this.resolvers.shift().resolve({done:!1,value:e}))}abort(e){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:e}:this.resolvers.shift().reject({done:!0,value:e}))}close(){if(this._closedPromiseResolve){let{resolvers:e}=this;for(;e.length>0;)e.shift().resolve(Ie);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(e){return Je.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,e)}toNodeStream(e){return Je.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,e)}throw(e){return B(this,void 0,void 0,function*(){return yield this.abort(e),Ie})}return(e){return B(this,void 0,void 0,function*(){return yield this.close(),Ie})}read(e){return B(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return B(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(...e){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((t,n)=>{this.resolvers.push({resolve:t,reject:n})}):Promise.resolve(Ie)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}});var yr,wr,Ct,$h,Tn,ys=p(()=>{Ft();ka();dn();dc();$e();qn();yr=class extends gf{write(e){if((e=D(e)).byteLength>0)return super.write(e)}toString(e=!1){return e?wo(this.toUint8Array(!0)):this.toUint8Array(!1).then(wo)}toUint8Array(e=!1){return e?Xt(this._values)[0]:B(this,void 0,void 0,function*(){var t,n,s,i;let o=[],a=0;try{for(var c=!0,u=$t(this),f;f=yield u.next(),t=f.done,!t;c=!0){i=f.value,c=!1;let l=i;o.push(l),a+=l.byteLength}}catch(l){n={error:l}}finally{try{!c&&!t&&(s=u.return)&&(yield s.call(u))}finally{if(n)throw n.error}}return Xt(o,a)[0]})}},wr=class{constructor(e){e&&(this.source=new $h(Je.fromIterable(e)))}[Symbol.iterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}},Ct=class r{constructor(e){e instanceof r?this.source=e.source:e instanceof yr?this.source=new Tn(Je.fromAsyncIterable(e)):Au(e)?this.source=new Tn(Je.fromNodeStream(e)):Ra(e)?this.source=new Tn(Je.fromDOMStream(e)):Tu(e)?this.source=new Tn(Je.fromDOMStream(e.body)):Ar(e)?this.source=new Tn(Je.fromIterable(e)):Kt(e)?this.source=new Tn(Je.fromAsyncIterable(e)):hr(e)&&(this.source=new Tn(Je.fromAsyncIterable(e)))}[Symbol.asyncIterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}get closed(){return this.source.closed}cancel(e){return this.source.cancel(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}},$h=class{constructor(e){this.source=e}cancel(e){this.return(e)}peek(e){return this.next(e,"peek").value}read(e){return this.next(e,"read").value}next(e,t="read"){return this.source.next({cmd:t,size:e})}throw(e){return Object.create(this.source.throw&&this.source.throw(e)||Ie)}return(e){return Object.create(this.source.return&&this.source.return(e)||Ie)}},Tn=class{constructor(e){this.source=e,this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}cancel(e){return B(this,void 0,void 0,function*(){yield this.return(e)})}get closed(){return this._closedPromise}read(e){return B(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return B(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(e){return B(this,arguments,void 0,function*(t,n="read"){return yield this.source.next({cmd:n,size:t})})}throw(e){return B(this,void 0,void 0,function*(){let t=this.source.throw&&(yield this.source.throw(e))||Ie;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}return(e){return B(this,void 0,void 0,function*(){let t=this.source.return&&(yield this.source.return(e))||Ie;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}}});var hc,ws,qh=p(()=>{Ft();ys();$e();hc=class extends wr{constructor(e,t){super(),this.position=0,this.buffer=D(e),this.size=t===void 0?this.buffer.byteLength:t}readInt32(e){let{buffer:t,byteOffset:n}=this.readAt(e,4);return new DataView(t,n).getInt32(0,!0)}seek(e){return this.position=Math.min(e,this.size),e<this.size}read(e){let{buffer:t,size:n,position:s}=this;return t&&s<n?(typeof e!="number"&&(e=Number.POSITIVE_INFINITY),this.position=Math.min(n,s+Math.min(n-s,e)),t.subarray(s,this.position)):null}readAt(e,t){let n=this.buffer,s=Math.min(this.size,e+t);return n?n.subarray(e,s):new Uint8Array(t)}close(){this.buffer&&(this.buffer=null)}throw(e){return this.close(),{done:!0,value:e}}return(e){return this.close(),{done:!0,value:e}}},ws=class extends Ct{constructor(e,t){super(),this.position=0,this._handle=e,typeof t=="number"?this.size=t:this._pending=B(this,void 0,void 0,function*(){this.size=(yield e.stat()).size,delete this._pending})}readInt32(e){return B(this,void 0,void 0,function*(){let{buffer:t,byteOffset:n}=yield this.readAt(e,4);return new DataView(t,n).getInt32(0,!0)})}seek(e){return B(this,void 0,void 0,function*(){return this._pending&&(yield this._pending),this.position=Math.min(e,this.size),e<this.size})}read(e){return B(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:t,size:n,position:s}=this;if(t&&s<n){typeof e!="number"&&(e=Number.POSITIVE_INFINITY);let i=s,o=0,a=0,c=Math.min(n,i+Math.min(n-i,e)),u=new Uint8Array(Math.max(0,(this.position=c)-i));for(;(i+=a)<c&&(o+=a)<u.byteLength;)({bytesRead:a}=yield t.read(u,o,u.byteLength-o,i));return u}return null})}readAt(e,t){return B(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:n,size:s}=this;if(n&&e+t<s){let i=Math.min(s,e+t),o=new Uint8Array(i-e);return(yield n.read(o,0,t,e)).buffer}return new Uint8Array(t)})}close(){return B(this,void 0,void 0,function*(){let e=this._handle;this._handle=null,e&&(yield e.close())})}throw(e){return B(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:e}})}return(e){return B(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:e}})}}});var Xh={};J(Xh,{BaseInt64:()=>pc,Int128:()=>mc,Int64:()=>_n,Uint64:()=>Oe});function Vo(r){return r<0&&(r=4294967295+r+1),`0x${r.toString(16)}`}var Po,Kh,pc,Oe,_n,mc,Hh=p(()=>{Po=8,Kh=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],pc=class{constructor(e){this.buffer=e}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(e){let t=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([e.buffer[1]>>>16,e.buffer[1]&65535,e.buffer[0]>>>16,e.buffer[0]&65535]),s=t[3]*n[3];this.buffer[0]=s&65535;let i=s>>>16;return s=t[2]*n[3],i+=s,s=t[3]*n[2]>>>0,i+=s,this.buffer[0]+=i<<16,this.buffer[1]=i>>>0<s?65536:0,this.buffer[1]+=i>>>16,this.buffer[1]+=t[1]*n[3]+t[2]*n[2]+t[3]*n[1],this.buffer[1]+=t[0]*n[3]+t[1]*n[2]+t[2]*n[1]+t[3]*n[0]<<16,this}_plus(e){let t=this.buffer[0]+e.buffer[0]>>>0;this.buffer[1]+=e.buffer[1],t<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=t}lessThan(e){return this.buffer[1]<e.buffer[1]||this.buffer[1]===e.buffer[1]&&this.buffer[0]<e.buffer[0]}equals(e){return this.buffer[1]===e.buffer[1]&&this.buffer[0]==e.buffer[0]}greaterThan(e){return e.lessThan(this)}hex(){return`${Vo(this.buffer[1])} ${Vo(this.buffer[0])}`}},Oe=class r extends pc{times(e){return this._times(e),this}plus(e){return this._plus(e),this}static from(e,t=new Uint32Array(2)){return r.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(2)){return r.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(2)){let n=e.length,s=new r(t);for(let i=0;i<n;){let o=Po<n-i?Po:n-i,a=new r(new Uint32Array([Number.parseInt(e.slice(i,i+o),10),0])),c=new r(new Uint32Array([Kh[o],0]));s.times(c),s.plus(a),i+=o}return s}static convertArray(e){let t=new Uint32Array(e.length*2);for(let n=-1,s=e.length;++n<s;)r.from(e[n],new Uint32Array(t.buffer,t.byteOffset+2*n*4,2));return t}static multiply(e,t){return new r(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new r(new Uint32Array(e.buffer)).plus(t)}},_n=class r extends pc{negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[0]==0&&++this.buffer[1],this}times(e){return this._times(e),this}plus(e){return this._plus(e),this}lessThan(e){let t=this.buffer[1]<<0,n=e.buffer[1]<<0;return t<n||t===n&&this.buffer[0]<e.buffer[0]}static from(e,t=new Uint32Array(2)){return r.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(2)){return r.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(2)){let n=e.startsWith("-"),s=e.length,i=new r(t);for(let o=n?1:0;o<s;){let a=Po<s-o?Po:s-o,c=new r(new Uint32Array([Number.parseInt(e.slice(o,o+a),10),0])),u=new r(new Uint32Array([Kh[a],0]));i.times(u),i.plus(c),o+=a}return n?i.negate():i}static convertArray(e){let t=new Uint32Array(e.length*2);for(let n=-1,s=e.length;++n<s;)r.from(e[n],new Uint32Array(t.buffer,t.byteOffset+2*n*4,2));return t}static multiply(e,t){return new r(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new r(new Uint32Array(e.buffer)).plus(t)}},mc=class r{constructor(e){this.buffer=e}high(){return new _n(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new _n(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset,2))}negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[2]=~this.buffer[2],this.buffer[3]=~this.buffer[3],this.buffer[0]==0&&++this.buffer[1],this.buffer[1]==0&&++this.buffer[2],this.buffer[2]==0&&++this.buffer[3],this}times(e){let t=new Oe(new Uint32Array([this.buffer[3],0])),n=new Oe(new Uint32Array([this.buffer[2],0])),s=new Oe(new Uint32Array([this.buffer[1],0])),i=new Oe(new Uint32Array([this.buffer[0],0])),o=new Oe(new Uint32Array([e.buffer[3],0])),a=new Oe(new Uint32Array([e.buffer[2],0])),c=new Oe(new Uint32Array([e.buffer[1],0])),u=new Oe(new Uint32Array([e.buffer[0],0])),f=Oe.multiply(i,u);this.buffer[0]=f.low();let l=new Oe(new Uint32Array([f.high(),0]));return f=Oe.multiply(s,u),l.plus(f),f=Oe.multiply(i,c),l.plus(f),this.buffer[1]=l.low(),this.buffer[3]=l.lessThan(f)?1:0,this.buffer[2]=l.high(),new Oe(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(Oe.multiply(n,u)).plus(Oe.multiply(s,c)).plus(Oe.multiply(i,a)),this.buffer[3]+=Oe.multiply(t,u).plus(Oe.multiply(n,c)).plus(Oe.multiply(s,a)).plus(Oe.multiply(i,o)).low(),this}plus(e){let t=new Uint32Array(4);return t[3]=this.buffer[3]+e.buffer[3]>>>0,t[2]=this.buffer[2]+e.buffer[2]>>>0,t[1]=this.buffer[1]+e.buffer[1]>>>0,t[0]=this.buffer[0]+e.buffer[0]>>>0,t[0]<this.buffer[0]>>>0&&++t[1],t[1]<this.buffer[1]>>>0&&++t[2],t[2]<this.buffer[2]>>>0&&++t[3],this.buffer[3]=t[3],this.buffer[2]=t[2],this.buffer[1]=t[1],this.buffer[0]=t[0],this}hex(){return`${Vo(this.buffer[3])} ${Vo(this.buffer[2])} ${Vo(this.buffer[1])} ${Vo(this.buffer[0])}`}static multiply(e,t){return new r(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new r(new Uint32Array(e.buffer)).plus(t)}static from(e,t=new Uint32Array(4)){return r.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(4)){return r.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(4)){let n=e.startsWith("-"),s=e.length,i=new r(t);for(let o=n?1:0;o<s;){let a=Po<s-o?Po:s-o,c=new r(new Uint32Array([Number.parseInt(e.slice(o,o+a),10),0,0,0])),u=new r(new Uint32Array([Kh[a],0,0,0]));i.times(u),i.plus(c),o+=a}return n?i.negate():i}static convertArray(e){let t=new Uint32Array(e.length*4);for(let n=-1,s=e.length;++n<s;)r.from(e[n],new Uint32Array(t.buffer,t.byteOffset+16*n,4));return t}}});var ep={};J(ep,{toIntervalDayTimeInt32Array:()=>Jh,toIntervalDayTimeObjects:()=>Qh,toIntervalMonthDayNanoInt32Array:()=>Yh,toIntervalMonthDayNanoObjects:()=>Zh});function Jh(r){var e,t;let n=r.length,s=new Int32Array(n*2);for(let i=0,o=0;i<n;i++){let a=r[i];s[o++]=(e=a.days)!==null&&e!==void 0?e:0,s[o++]=(t=a.milliseconds)!==null&&t!==void 0?t:0}return s}function Yh(r){var e,t;let n=r.length,s=new Int32Array(n*4);for(let i=0,o=0;i<n;i++){let a=r[i];s[o++]=(e=a.months)!==null&&e!==void 0?e:0,s[o++]=(t=a.days)!==null&&t!==void 0?t:0;let c=a.nanoseconds;if(c){let u=BigInt(c);s[o++]=Number(u&BigInt(4294967295))>>>0,s[o++]=Number(u>>BigInt(32))>>>0}else o+=2}return s}function Qh(r){let e=r.length,t=new Array(e/2);for(let n=0,s=0;n<e;n+=2)t[s++]={days:r[n],milliseconds:r[n+1]};return t}function Zh(r,e){let t=r.length,n=new Array(t/4);for(let s=0,i=0;s<t;s+=4){let o=BigInt(r[s+3])<<BigInt(32)|BigInt(r[s+2]>>>0);n[i++]={months:r[s],days:r[s+1],nanoseconds:e?`${o}`:o}}return n}var yf=p(()=>{});function GT(r){let e=new Uint8Array(r.length/2);for(let t=0;t<r.length;t+=2)e[t>>1]=Number.parseInt(r.slice(t,t+2),16);return e}function XF(r){return GT(r.join(""))}function zT(r,e){let t=new Uint8Array(r.length*16),n=new DataView(t.buffer);for(let[s,i]of r.entries()){let o=s*16,a=i.SIZE;if(n.setInt32(o,a,!0),i.INLINED!==void 0){let c=e(i.INLINED);for(let u=0;u<c.length&&u<12;u++)t[o+4+u]=c[u]}else{let c=i.PREFIX_HEX;for(let u=0;u<8&&u<c.length;u+=2)t[o+4+(u>>1)]=Number.parseInt(c.slice(u,u+2),16);n.setInt32(o+8,i.BUFFER_INDEX,!0),n.setInt32(o+12,i.OFFSET,!0)}}return t}function HF(r){return zT(r,e=>{let t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)t[n>>1]=Number.parseInt(e.slice(n,n+2),16);return t})}function JF(r){return zT(r,e=>new TextEncoder().encode(e))}var jo,wf,xf,WT=p(()=>{br();ht();ye();Nt();di();dn();Hh();Fe();$e();yf();jo=class extends R{constructor(e,t,n,s,i=me.V5,o=[]){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.variadicBufferIndex=-1,this.bytes=e,this.nodes=t,this.buffers=n,this.dictionaries=s,this.metadataVersion=i,this.variadicBufferCounts=o}visit(e){return super.visit(e instanceof F?e.type:e)}visitNull(e,{length:t}=this.nextFieldNode()){return M({type:e,length:t})}visitBool(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitInt(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitFloat(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitUtf8(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitLargeUtf8(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitUtf8View(e,{length:t,nullCount:n}=this.nextFieldNode()){let s=this.readNullBitmap(e,n),i=this.readData(e),o=this.readVariadicBuffers(this.nextVariadicBufferCount());return M({type:e,length:t,nullCount:n,nullBitmap:s,views:i,variadicBuffers:o})}visitBinary(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitLargeBinary(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitBinaryView(e,{length:t,nullCount:n}=this.nextFieldNode()){let s=this.readNullBitmap(e,n),i=this.readData(e),o=this.readVariadicBuffers(this.nextVariadicBufferCount());return M({type:e,length:t,nullCount:n,nullBitmap:s,views:i,variadicBuffers:o})}visitFixedSizeBinary(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitDate(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitTimestamp(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitTime(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitDecimal(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitList(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),child:this.visit(e.children[0])})}visitLargeList(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),child:this.visit(e.children[0])})}visitStruct(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),children:this.visitMany(e.children)})}visitUnion(e,{length:t,nullCount:n}=this.nextFieldNode()){return this.metadataVersion<me.V5&&this.readNullBitmap(e,n),e.mode===de.Sparse?this.visitSparseUnion(e,{length:t,nullCount:n}):this.visitDenseUnion(e,{length:t,nullCount:n})}visitDenseUnion(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,typeIds:this.readTypeIds(e),valueOffsets:this.readOffsets(e),children:this.visitMany(e.children)})}visitSparseUnion(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,typeIds:this.readTypeIds(e),children:this.visitMany(e.children)})}visitDictionary(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e.indices),dictionary:this.readDictionary(e)})}visitInterval(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitDuration(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitFixedSizeList(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),child:this.visit(e.children[0])})}visitMap(e,{length:t,nullCount:n}=this.nextFieldNode()){return M({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),child:this.visit(e.children[0])})}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(e,t,n=this.nextBufferRange()){return t>0&&this.readData(e,n)||new Uint8Array(0)}readOffsets(e,t){return this.readData(e,t)}readTypeIds(e,t){return this.readData(e,t)}readData(e,{length:t,offset:n}=this.nextBufferRange()){return this.bytes.subarray(n,n+t)}readVariadicBuffers(e){return Array.from({length:e},()=>this.readData(null))}nextVariadicBufferCount(){var e;return(e=this.variadicBufferCounts[++this.variadicBufferIndex])!==null&&e!==void 0?e:0}readDictionary(e){return this.dictionaries.get(e.id)}},wf=class extends jo{constructor(e,t,n,s,i,o=[]){super(new Uint8Array(0),t,n,s,i,o),this.sources=e}readNullBitmap(e,t,{offset:n}=this.nextBufferRange()){return t<=0?new Uint8Array(0):li(this.sources[n])}readOffsets(e,{offset:t}=this.nextBufferRange()){return Z(Uint8Array,Z(e.OffsetArrayType,this.sources[t]))}readTypeIds(e,{offset:t}=this.nextBufferRange()){return Z(Uint8Array,Z(e.ArrayType,this.sources[t]))}readData(e,{offset:t}=this.nextBufferRange()){let{sources:n}=this;if(S.isTimestamp(e))return Z(Uint8Array,_n.convertArray(n[t]));if((S.isInt(e)||S.isTime(e))&&e.bitWidth===64||S.isDuration(e))return Z(Uint8Array,_n.convertArray(n[t]));if(S.isDate(e)&&e.unit===ge.MILLISECOND)return Z(Uint8Array,_n.convertArray(n[t]));if(S.isDecimal(e))return Z(Uint8Array,mc.convertArray(n[t]));if(S.isBinary(e)||S.isLargeBinary(e)||S.isFixedSizeBinary(e))return XF(n[t]);if(S.isBinaryView(e))return HF(n[t]);if(S.isUtf8View(e))return JF(n[t]);if(S.isBool(e))return li(n[t]);if(S.isUtf8(e)||S.isLargeUtf8(e))return qt(n[t].join(""));if(S.isInterval(e))switch(e.unit){case oe.DAY_TIME:return Jh(n[t]);case oe.MONTH_DAY_NANO:return Yh(n[t]);default:break}return Z(Uint8Array,Z(e.ArrayType,n[t].map(s=>+s)))}readVariadicBuffers(e){let t=[];for(let n=0;n<e;n++){let{offset:s}=this.nextBufferRange(),i=this.sources[s];t.push(GT(i))}return t}};xf=class extends jo{constructor(e,t,n,s,i,o=[]){super(new Uint8Array(0),t,n,s,i,o),this.bodyChunks=e}readData(e,t=this.nextBufferRange()){return this.bodyChunks[this.buffersIndex]}}});var An,Tf=p(()=>{Nr();ve();$e();An=class extends dt{constructor(e){super(e),this._values=new kt(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,t){return super.setValue(e,D(t))}_flushPending(e,t){let n=this._offsets,s=this._values.reserve(t).buffer,i=0;for(let[o,a]of e)if(a===void 0)n.set(o,0);else{let c=a.length;s.set(a,i),n.set(o,c),i+=c}}}});var vn,_f=p(()=>{$e();Nr();ve();vn=class extends dt{constructor(e){super(e),this._values=new kt(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,t){return super.setValue(e,D(t))}_flushPending(e,t){let n=this._offsets,s=this._values.reserve(t).buffer,i=0;for(let[o,a]of e)if(a===void 0)n.set(o,BigInt(0));else{let c=a.length;s.set(a,i),n.set(o,BigInt(c)),i+=c}}}});var gi,tp=p(()=>{Nr();ve();gi=class extends xe{constructor(e){super(e),this._values=new Uo}setValue(e,t){this._values.set(e,+t)}}});var Yr,xs,Ts,rp=p(()=>{ve();nr();Yr=class extends Ge{};Yr.prototype._setValue=_h;xs=class extends Yr{};xs.prototype._setValue=ku;Ts=class extends Yr{};Ts.prototype._setValue=Cu});var _s,np=p(()=>{ve();nr();_s=class extends Ge{};_s.prototype._setValue=Ih});var yi,sp=p(()=>{ye();ve();bc();yi=class extends xe{constructor({type:e,nullValues:t,dictionaryHashFunction:n}){super({type:new Pe(e.dictionary,e.indices,e.id,e.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=Cr({type:this.type.indices,nullValues:t}),this.dictionary=Cr({type:this.type.dictionary,nullValues:null}),typeof n=="function"&&(this.valueToKey=n)}get values(){return this.indices.values}get nullCount(){return this.indices.nullCount}get nullBitmap(){return this.indices.nullBitmap}get byteLength(){return this.indices.byteLength+this.dictionary.byteLength}get reservedLength(){return this.indices.reservedLength+this.dictionary.reservedLength}get reservedByteLength(){return this.indices.reservedByteLength+this.dictionary.reservedByteLength}isValid(e){return this.indices.isValid(e)}setValid(e,t){let n=this.indices;return t=n.setValid(e,t),this.length=n.length,t}setValue(e,t){let n=this._keysToIndices,s=this.valueToKey(t),i=n[s];return i===void 0&&(n[s]=i=this._dictionaryOffset+this.dictionary.append(t).length-1),this.indices.setValue(e,i)}flush(){let e=this.type,t=this._dictionary,n=this.dictionary.toVector(),s=this.indices.flush().clone(e);return s.dictionary=t?t.concat(n):n,this.finished||(this._dictionaryOffset+=n.length),this._dictionary=s.dictionary,this.clear(),s}finish(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),super.finish()}clear(){return this.indices.clear(),this.dictionary.clear(),super.clear()}valueToKey(e){return typeof e=="string"?e:`${e}`}}});var As,ip=p(()=>{ve();nr();As=class extends Ge{};As.prototype._setValue=Th});var wi,op=p(()=>{ht();ve();ye();wi=class extends xe{setValue(e,t){let[n]=this.children,s=e*this.stride;for(let i=-1,o=this.stride;++i<o;)n.set(s+i,t[i])}setValid(e,t){return super.setValid(e,t)||this.children[0].setValid((e+1)*this.stride-1,!1),t}addChild(e,t="0"){if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");let n=this.children.push(e);return this.type=new Ee(this.type.listSize,new F(t,e.type,!0)),n}}});var Qr,xi,Ti,_i,ap=p(()=>{ic();ve();Qr=class extends Ge{setValue(e,t){this._values.set(e,t)}},xi=class extends Qr{setValue(e,t){super.setValue(e,sc(t))}},Ti=class extends Qr{},_i=class extends Qr{}});var Ur,vs,Is,Ss,cp=p(()=>{ve();nr();Ur=class extends Ge{};Ur.prototype._setValue=Sh;vs=class extends Ur{};vs.prototype._setValue=qu;Is=class extends Ur{};Is.prototype._setValue=Ku;Ss=class extends Ur{};Ss.prototype._setValue=Xu});var xr,Es,Ls,Bs,Fs,up=p(()=>{ve();nr();xr=class extends Ge{};xr.prototype._setValue=Eh;Es=class extends xr{};Es.prototype._setValue=Hu;Ls=class extends xr{};Ls.prototype._setValue=Ju;Bs=class extends xr{};Bs.prototype._setValue=Yu;Fs=class extends xr{};Fs.prototype._setValue=Qu});var It,Ai,vi,Ii,Si,Ei,Li,Bi,Fi,fp=p(()=>{ve();It=class extends Ge{setValue(e,t){this._values.set(e,t)}},Ai=class extends It{},vi=class extends It{},Ii=class extends It{},Si=class extends It{},Ei=class extends It{},Li=class extends It{},Bi=class extends It{},Fi=class extends It{}});var Oi,lp=p(()=>{ht();ye();Nr();ve();Oi=class extends dt{constructor(e){super(e),this._offsets=new bs(e.type)}addChild(e,t="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new Ve(new F(t,e.type,!0)),this.numChildren-1}_flushPending(e){let t=this._offsets,[n]=this.children;for(let[s,i]of e)if(typeof i>"u")t.set(s,0);else{let o=i,a=o.length,c=t.set(s,a).buffer[s];for(let u=-1;++u<a;)n.set(c+u,o[u])}}}});var Mi,dp=p(()=>{ht();ye();Nr();qr();ve();Mi=class extends dt{constructor(e){super(e),this._offsets=new bs(e.type)}addChild(e,t="0"){if(this.numChildren>0)throw new Error("LargeListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new tr(new F(t,e.type,!0)),this.numChildren-1}_flushPending(e){let t=this._offsets,[n]=this.children;for(let[s,i]of e)if(typeof i>"u")t.set(s,BigInt(0));else{let o=i,a=o.length,c=ee(t.set(s,BigInt(a)).buffer[s]);for(let u=-1;++u<a;)n.set(c+u,o[u])}}}});var Ri,hp=p(()=>{ht();ye();ve();Ri=class extends dt{set(e,t){return super.set(e,t)}setValue(e,t){let n=t instanceof Map?t:new Map(Object.entries(t)),s=this._pending||(this._pending=new Map),i=s.get(e);i&&(this._pendingLength-=i.size),this._pendingLength+=n.size,s.set(e,n)}addChild(e,t=`${this.numChildren}`){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new ft(new F(t,e.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(e){let t=this._offsets,[n]=this.children;for(let[s,i]of e)if(i===void 0)t.set(s,0);else{let{[s]:o,[s+1]:a}=t.set(s,i.size).buffer;for(let c of i.entries())if(n.set(o,c),++o>=a)break}}}});var Di,pp=p(()=>{ve();Di=class extends xe{setValue(e,t){}setValid(e,t){return this.length=Math.max(e+1,this.length),t}}});var Ni,mp=p(()=>{ht();ve();ye();Ni=class extends xe{setValue(e,t){let{children:n,type:s}=this;switch(Array.isArray(t)||t.constructor){case!0:return s.children.forEach((i,o)=>n[o].set(e,t[o]));case Map:return s.children.forEach((i,o)=>n[o].set(e,t.get(i.name)));default:return s.children.forEach((i,o)=>n[o].set(e,t[i.name]))}}setValid(e,t){return super.setValid(e,t)||this.children.forEach(n=>n.setValid(e,t)),t}addChild(e,t=`${this.numChildren}`){let n=this.children.push(e);return this.type=new he([...this.type.children,new F(t,e.type,!0)]),n}}});var Tr,Os,Ms,Rs,Ds,bp=p(()=>{ve();nr();Tr=class extends Ge{};Tr.prototype._setValue=Ah;Os=class extends Tr{};Os.prototype._setValue=Uu;Ms=class extends Tr{};Ms.prototype._setValue=Vu;Rs=class extends Tr{};Rs.prototype._setValue=Pu;Ds=class extends Tr{};Ds.prototype._setValue=ju});var _r,Ns,ks,Cs,Us,gp=p(()=>{ve();nr();_r=class extends Ge{};_r.prototype._setValue=vh;Ns=class extends _r{};Ns.prototype._setValue=Gu;ks=class extends _r{};ks.prototype._setValue=zu;Cs=class extends _r{};Cs.prototype._setValue=Wu;Us=class extends _r{};Us.prototype._setValue=$u});var In,ki,Ci,yp=p(()=>{ht();Nr();ve();ye();In=class extends xe{constructor(e){super(e),this._typeIds=new wn(Int8Array,0,1),typeof e.valueToChildTypeId=="function"&&(this._valueToChildTypeId=e.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(e,t){return this.set(this.length,e,t)}set(e,t,n){return n===void 0&&(n=this._valueToChildTypeId(this,t,e)),this.setValue(e,t,n),this}setValue(e,t,n){this._typeIds.set(e,n);let s=this.type.typeIdToChildIndex[n],i=this.children[s];i?.set(e,t),this.length=Math.max(e+1,this.length)}addChild(e,t=`${this.children.length}`){let n=this.children.push(e),{type:{children:s,mode:i,typeIds:o}}=this,a=[...s,new F(t,e.type)];return this.type=new vt(i,[...o,n],a),n}_valueToChildTypeId(e,t,n){throw new Error("Cannot map UnionBuilder value to child typeId. Pass the `childTypeId` as the second argument to unionBuilder.append(), or supply a `valueToChildTypeId` function as part of the UnionBuilder constructor options.")}},ki=class extends In{},Ci=class extends In{constructor(e){super(e),this._offsets=new wn(Int32Array)}setValue(e,t,n){let s=this._typeIds.set(e,n).buffer[e],i=this.getChildAt(this.type.typeIdToChildIndex[s]),o=this._offsets.set(e,i.length).buffer[e];i?.set(o,t),this.length=Math.max(e+1,this.length)}}});var Vs,wp=p(()=>{dn();Tf();Nr();ve();Vs=class extends dt{constructor(e){super(e),this._values=new kt(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,t){return super.setValue(e,qt(t))}_flushPending(e,t){}};Vs.prototype._flushPending=An.prototype._flushPending});var Ps,xp=p(()=>{dn();Nr();ve();_f();Ps=class extends dt{constructor(e){super(e),this._values=new kt(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,t){return super.setValue(e,qt(t))}_flushPending(e,t){}};Ps.prototype._flushPending=vn.prototype._flushPending});var Sn,Af=p(()=>{ye();ve();Nr();$e();br();Sn=class extends xe{constructor(e){super(e),this._variadicBuffers=[],this._currentBuffer=null,this._currentBufferIndex=0,this._currentBufferOffset=0,this._bufferSize=32*1024*1024,this._views=new kt(Uint8Array)}get byteLength(){let e=0;this._views&&(e+=this._views.byteLength),this._nulls&&(e+=this._nulls.byteLength);for(let t of this._variadicBuffers)e+=t.byteLength;return this._currentBuffer&&(e+=this._currentBuffer.byteLength),e}setValue(e,t){return this.writeBinaryValue(e,this.encodeValue(t))}writeBinaryValue(e,t){let n=t.length,s=(e+1)*Q.ELEMENT_WIDTH,i=this._views.length;s>i&&this._views.reserve(s-i);let o=this._views.buffer,a=e*Q.ELEMENT_WIDTH,c=new DataView(o.buffer,o.byteOffset+a,Q.ELEMENT_WIDTH);if(c.setInt32(Q.LENGTH_OFFSET,n,!0),n<=Q.INLINE_CAPACITY){o.set(t,a+Q.INLINE_OFFSET);for(let u=n;u<Q.INLINE_CAPACITY;u++)o[a+Q.INLINE_OFFSET+u]=0}else{let u=new DataView(t.buffer,t.byteOffset,Math.min(4,n));c.setUint32(Q.INLINE_OFFSET,u.getUint32(0,!0),!0),(!this._currentBuffer||this._currentBufferOffset+n>this._bufferSize)&&(this._currentBuffer&&this._variadicBuffers.push(this._currentBuffer.buffer.slice(0,this._currentBufferOffset)),this._currentBuffer=new kt(Uint8Array),this._currentBufferIndex=this._variadicBuffers.length,this._currentBufferOffset=0),this._currentBuffer.reserve(n).buffer.set(t,this._currentBufferOffset),c.setInt32(Q.BUFFER_INDEX_OFFSET,this._currentBufferIndex,!0),c.setInt32(Q.BUFFER_OFFSET_OFFSET,this._currentBufferOffset,!0),this._currentBufferOffset+=n}return this}encodeValue(e){return D(e)}setValid(e,t){let n=(e+1)*Q.ELEMENT_WIDTH,s=this._views.length;n>s&&this._views.reserve(n-s);let i=super.setValid(e,t);if(!i){let o=this._views.buffer,a=e*Q.ELEMENT_WIDTH;for(let c=0;c<Q.ELEMENT_WIDTH;c++)o[a+c]=0}return i}clear(){return this._variadicBuffers=[],this._currentBuffer=null,this._currentBufferIndex=0,this._currentBufferOffset=0,this._views.clear(),super.clear()}flush(){let{type:e,length:t,nullCount:n,_views:s,_nulls:i}=this;this._currentBuffer&&this._currentBufferOffset>0&&(this._variadicBuffers.push(this._currentBuffer.buffer.slice(0,this._currentBufferOffset)),this._currentBuffer=null,this._currentBufferOffset=0);let o=s.flush(t*Q.ELEMENT_WIDTH),a=n>0?i.flush(t):void 0,c=this._variadicBuffers.slice();return this._variadicBuffers=[],this._currentBufferIndex=0,this.clear(),M({type:e,length:t,nullCount:n,nullBitmap:a,views:o,variadicBuffers:c})}finish(){return this.finished=!0,this}}});var Ui,Tp=p(()=>{Af();dn();Ui=class extends Sn{constructor(e){super(e)}setValue(e,t){return this.writeBinaryValue(e,qt(t))}}});var _p,$T,qT=p(()=>{Nt();Tf();_f();tp();rp();np();sp();ip();op();ap();cp();up();fp();lp();dp();hp();pp();mp();bp();gp();yp();wp();xp();Af();Tp();_p=class extends R{visitNull(){return Di}visitBool(){return gi}visitInt(){return It}visitInt8(){return Ai}visitInt16(){return vi}visitInt32(){return Ii}visitInt64(){return Si}visitUint8(){return Ei}visitUint16(){return Li}visitUint32(){return Bi}visitUint64(){return Fi}visitFloat(){return Qr}visitFloat16(){return xi}visitFloat32(){return Ti}visitFloat64(){return _i}visitUtf8(){return Vs}visitLargeUtf8(){return Ps}visitBinary(){return An}visitLargeBinary(){return vn}visitFixedSizeBinary(){return As}visitDate(){return Yr}visitDateDay(){return xs}visitDateMillisecond(){return Ts}visitTimestamp(){return Tr}visitTimestampSecond(){return Os}visitTimestampMillisecond(){return Ms}visitTimestampMicrosecond(){return Rs}visitTimestampNanosecond(){return Ds}visitTime(){return _r}visitTimeSecond(){return Ns}visitTimeMillisecond(){return ks}visitTimeMicrosecond(){return Cs}visitTimeNanosecond(){return Us}visitDecimal(){return _s}visitList(){return Oi}visitLargeList(){return Mi}visitStruct(){return Ni}visitUnion(){return In}visitDenseUnion(){return Ci}visitSparseUnion(){return ki}visitDictionary(){return yi}visitInterval(){return Ur}visitIntervalDayTime(){return vs}visitIntervalYearMonth(){return Is}visitIntervalMonthDayNano(){return Ss}visitDuration(){return xr}visitDurationSecond(){return Es}visitDurationMillisecond(){return Ls}visitDurationMicrosecond(){return Bs}visitDurationNanosecond(){return Fs}visitFixedSizeList(){return wi}visitMap(){return Ri}visitBinaryView(){return Sn}visitUtf8View(){return Ui}},$T=new _p});function St(r,e){return e instanceof r.constructor}function En(r,e){return r===e||St(r,e)}function Ln(r,e){return r===e||St(r,e)&&r.bitWidth===e.bitWidth&&r.isSigned===e.isSigned}function vf(r,e){return r===e||St(r,e)&&r.precision===e.precision}function YF(r,e){return r===e||St(r,e)&&r.byteWidth===e.byteWidth}function Ap(r,e){return r===e||St(r,e)&&r.unit===e.unit}function gc(r,e){return r===e||St(r,e)&&r.unit===e.unit&&r.timezone===e.timezone}function yc(r,e){return r===e||St(r,e)&&r.unit===e.unit&&r.bitWidth===e.bitWidth}function KT(r,e){return r===e||St(r,e)&&r.children.length===e.children.length&&Zr.compareManyFields(r.children,e.children)}function QF(r,e){return r===e||St(r,e)&&r.children.length===e.children.length&&Zr.compareManyFields(r.children,e.children)}function vp(r,e){return r===e||St(r,e)&&r.mode===e.mode&&r.typeIds.every((t,n)=>t===e.typeIds[n])&&Zr.compareManyFields(r.children,e.children)}function ZF(r,e){return r===e||St(r,e)&&r.id===e.id&&r.isOrdered===e.isOrdered&&Zr.visit(r.indices,e.indices)&&Zr.visit(r.dictionary,e.dictionary)}function If(r,e){return r===e||St(r,e)&&r.unit===e.unit}function wc(r,e){return r===e||St(r,e)&&r.unit===e.unit}function eO(r,e){return r===e||St(r,e)&&r.listSize===e.listSize&&r.children.length===e.children.length&&Zr.compareManyFields(r.children,e.children)}function tO(r,e){return r===e||St(r,e)&&r.keysSorted===e.keysSorted&&r.children.length===e.children.length&&Zr.compareManyFields(r.children,e.children)}function Vi(r,e){return Zr.compareSchemas(r,e)}function XT(r,e){return Zr.compareFields(r,e)}function Sf(r,e){return Zr.visit(r,e)}var P,Zr,xc=p(()=>{Nt();P=class extends R{compareSchemas(e,t){return e===t||t instanceof e.constructor&&this.compareManyFields(e.fields,t.fields)}compareManyFields(e,t){return e===t||Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((n,s)=>this.compareFields(n,t[s]))}compareFields(e,t){return e===t||t instanceof e.constructor&&e.name===t.name&&e.nullable===t.nullable&&this.visit(e.type,t.type)}};P.prototype.visitNull=En;P.prototype.visitBool=En;P.prototype.visitInt=Ln;P.prototype.visitInt8=Ln;P.prototype.visitInt16=Ln;P.prototype.visitInt32=Ln;P.prototype.visitInt64=Ln;P.prototype.visitUint8=Ln;P.prototype.visitUint16=Ln;P.prototype.visitUint32=Ln;P.prototype.visitUint64=Ln;P.prototype.visitFloat=vf;P.prototype.visitFloat16=vf;P.prototype.visitFloat32=vf;P.prototype.visitFloat64=vf;P.prototype.visitUtf8=En;P.prototype.visitLargeUtf8=En;P.prototype.visitUtf8View=En;P.prototype.visitBinary=En;P.prototype.visitLargeBinary=En;P.prototype.visitBinaryView=En;P.prototype.visitFixedSizeBinary=YF;P.prototype.visitDate=Ap;P.prototype.visitDateDay=Ap;P.prototype.visitDateMillisecond=Ap;P.prototype.visitTimestamp=gc;P.prototype.visitTimestampSecond=gc;P.prototype.visitTimestampMillisecond=gc;P.prototype.visitTimestampMicrosecond=gc;P.prototype.visitTimestampNanosecond=gc;P.prototype.visitTime=yc;P.prototype.visitTimeSecond=yc;P.prototype.visitTimeMillisecond=yc;P.prototype.visitTimeMicrosecond=yc;P.prototype.visitTimeNanosecond=yc;P.prototype.visitDecimal=En;P.prototype.visitList=KT;P.prototype.visitLargeList=KT;P.prototype.visitStruct=QF;P.prototype.visitUnion=vp;P.prototype.visitDenseUnion=vp;P.prototype.visitSparseUnion=vp;P.prototype.visitDictionary=ZF;P.prototype.visitInterval=If;P.prototype.visitIntervalDayTime=If;P.prototype.visitIntervalYearMonth=If;P.prototype.visitIntervalMonthDayNano=If;P.prototype.visitDuration=wc;P.prototype.visitDurationSecond=wc;P.prototype.visitDurationMillisecond=wc;P.prototype.visitDurationMicrosecond=wc;P.prototype.visitDurationNanosecond=wc;P.prototype.visitFixedSizeList=eO;P.prototype.visitMap=tO;Zr=new P});function Cr(r){let e=r.type,t=new($T.getVisitFn(e)())(r);if(e.children&&e.children.length>0){let n=r.children||[],s={nullValues:r.nullValues},i=Array.isArray(n)?((o,a)=>n[a]||s):(({name:o})=>n[o]||s);for(let[o,a]of e.children.entries()){let{type:c}=a,u=i(a,o);t.children.push(Cr(Object.assign(Object.assign({},u),{type:c})))}}return t}function Go(r,e){if(r instanceof k||r instanceof L||r.type instanceof S||ArrayBuffer.isView(r))return Jr(r);let t={type:e??Ef(r),nullValues:[null]},n=[...Lf(t)(r)],s=n.length===1?n[0]:n.reduce((i,o)=>i.concat(o));return S.isDictionary(s.type)?s.memoize():s}function Ip(r){let e=Go(r),t=new le(new Y(e.type.children),e.data[0]);return new be(t)}function Ef(r){if(r.length===0)return new De;let e=0,t=0,n=0,s=0,i=0,o=0,a=0,c=0;for(let u of r){if(u==null){++e;continue}switch(typeof u){case"bigint":++o;continue;case"boolean":++a;continue;case"number":++s;continue;case"string":++i;continue;case"object":Array.isArray(u)?++t:Object.prototype.toString.call(u)==="[object Date]"?++c:++n;continue}throw new TypeError("Unable to infer Vector type from input values, explicit type declaration expected.")}if(s+e===r.length)return new er;if(i+e===r.length)return new Pe(new at,new Ce);if(o+e===r.length)return new Yt;if(a+e===r.length)return new ct;if(c+e===r.length)return new Kr;if(t+e===r.length){let u=r,f=Ef(u[u.findIndex(l=>l!=null)]);if(u.every(l=>l==null||Sf(f,Ef(l))))return new Ve(new F("",f,!0))}else if(n+e===r.length){let u=new Map;for(let f of r)for(let l of Object.keys(f))!u.has(l)&&f[l]!=null&&u.set(l,new F(l,Ef([f[l]]),!0));return new he([...u.values()])}throw new TypeError("Unable to infer Vector type from input values, explicit type declaration expected.")}function Lf(r){let{["queueingStrategy"]:e="count"}=r,{["highWaterMark"]:t=e!=="bytes"?Number.POSITIVE_INFINITY:Math.pow(2,14)}=r,n=e!=="bytes"?"length":"byteLength";return function*(s){let i=0,o=Cr(r);for(let a of s)o.append(a)[n]>=t&&++i&&(yield o.toVector());(o.finish().length>0||i===0)&&(yield o.toVector())}}function Sp(r){let{["queueingStrategy"]:e="count"}=r,{["highWaterMark"]:t=e!=="bytes"?Number.POSITIVE_INFINITY:Math.pow(2,14)}=r,n=e!=="bytes"?"length":"byteLength";return function(s){return gt(this,arguments,function*(){var i,o,a,c;let u=0,f=Cr(r);try{for(var l=!0,d=$t(s),h;h=yield H(d.next()),i=h.done,!i;l=!0){c=h.value,l=!1;let m=c;f.append(m)[n]>=t&&++u&&(yield yield H(f.toVector()))}}catch(m){o={error:m}}finally{try{!l&&!i&&(a=d.return)&&(yield H(a.call(d)))}finally{if(o)throw o.error}}(f.finish().length>0||u===0)&&(yield yield H(f.toVector()))})}}var bc=p(()=>{Ft();ht();ye();br();lt();qT();Pi();Bn();xc()});function Bf(r,e){return rO(r,e.map(t=>t.data.concat()))}function rO(r,e){let t=[...r.fields],n=[],s={numBatches:e.reduce((l,d)=>Math.max(l,d.length),0)},i=0,o=0,a=-1,c=e.length,u,f=[];for(;s.numBatches-- >0;){for(o=Number.POSITIVE_INFINITY,a=-1;++a<c;)f[a]=u=e[a].shift(),o=Math.min(o,u?u.length:o);Number.isFinite(o)&&(f=nO(t,o,f,e,s),o>0&&(n[i++]=M({type:new he(t),length:o,nullCount:0,children:f.slice()})))}return[r=r.assign(t),n.map(l=>new le(r,l))]}function nO(r,e,t,n,s){var i;let o=(e+63&-64)>>3;for(let a=-1,c=n.length;++a<c;){let u=t[a],f=u?.length;if(f>=e)f===e?t[a]=u:(t[a]=u.slice(0,e),s.numBatches=Math.max(s.numBatches,n[a].unshift(u.slice(e,f-e))));else{let l=r[a];r[a]=l.clone({nullable:!0}),t[a]=(i=u?._changeLengthAndBackfillNullBitmap(e))!==null&&i!==void 0?i:M({type:l.type,length:e,nullCount:e,nullBitmap:new Uint8Array(o)})}}return t}var HT=p(()=>{br();ye();Bn()});function Ep(r){let e={},t=Object.entries(r);for(let[n,s]of t)e[n]=Jr(s);return new be(e)}function Lp(r){let e={},t=Object.entries(r);for(let[n,s]of t)e[n]=Go(s);return new be(e)}var JT,YT,be,Pi=p(()=>{Fe();br();bc();lt();ht();ye();xc();HT();uf();ci();nr();ff();lf();Do();Bn();YT=Symbol.for("apache-arrow/Table"),be=class r{static isTable(e){return e?.[YT]===!0}constructor(...e){var t,n;if(e.length===0)return this.batches=[],this.schema=new Y([]),this._offsets=[0],this;let s,i;e[0]instanceof Y&&(s=e.shift()),e.at(-1)instanceof Uint32Array&&(i=e.pop());let o=c=>{if(c){if(c instanceof le)return[c];if(c instanceof r)return c.batches;if(c instanceof k){if(c.type instanceof he)return[new le(new Y(c.type.children),c)]}else{if(Array.isArray(c))return c.flatMap(u=>o(u));if(typeof c[Symbol.iterator]=="function")return[...c].flatMap(u=>o(u));if(typeof c=="object"){let u=Object.keys(c),f=u.map(h=>new L([c[h]])),l=s??new Y(u.map((h,m)=>new F(String(h),f[m].type,f[m].nullable))),[,d]=Bf(l,f);return d.length===0?[new le(c)]:d}}}return[]},a=e.flatMap(c=>o(c));if(s=(n=s??((t=a[0])===null||t===void 0?void 0:t.schema))!==null&&n!==void 0?n:new Y([]),!(s instanceof Y))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(let c of a){if(!(c instanceof le))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!Vi(s,c.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=s,this.batches=a,this._offsets=i??sf(this.data)}get data(){return this.batches.map(({data:e})=>e)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((e,t)=>e+t.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=nf(this.data)),this._nullCount}isValid(e){return!1}get(e){return null}at(e){return this.get(ui(e,this.numRows))}set(e,t){}indexOf(e,t){return-1}[Symbol.iterator](){return this.batches.length>0?Co.visit(new L(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[
|
|
18
|
+
return true;`)}function _O(r){return typeof r!="bigint"?Rr(r):`${Rr(r)}n`}var e0=p(()=>{tc()});function np(r,e){let t=Math.ceil(r)*e-1;return(t-t%64+64||64)/e}function t0(r,e=0){return r.length>=e?r.subarray(0,e):Ua(new r.constructor(e),r,0)}var jt,vn,zo,Ts,jr=p(()=>{Ke();jt=class{constructor(e,t=0,n=1){this.length=Math.ceil(t/n),this.buffer=new e(this.length),this.stride=n,this.BYTES_PER_ELEMENT=e.BYTES_PER_ELEMENT,this.ArrayType=e}get byteLength(){return Math.ceil(this.length*this.stride)*this.BYTES_PER_ELEMENT}get reservedLength(){return this.buffer.length/this.stride}get reservedByteLength(){return this.buffer.byteLength}set(e,t){return this}append(e){return this.set(this.length,e)}reserve(e){if(e>0){this.length+=e;let t=this.stride,n=this.length*t,s=this.buffer.length;n>=s&&this._resize(s===0?np(n*1,this.BYTES_PER_ELEMENT):np(n*2,this.BYTES_PER_ELEMENT))}return this}flush(e=this.length){e=np(e*this.stride,this.BYTES_PER_ELEMENT);let t=t0(this.buffer,e);return this.clear(),t}clear(){return this.length=0,this.buffer=new this.ArrayType,this}_resize(e){return this.buffer=t0(this.buffer,e)}},vn=class extends jt{last(){return this.get(this.length-1)}get(e){return this.buffer[e]}set(e,t){return this.reserve(e-this.length+1),this.buffer[e*this.stride]=t,this}},zo=class extends vn{constructor(){super(Uint8Array,0,1/8),this.numValid=0}get numInvalid(){return this.length-this.numValid}get(e){return this.buffer[e>>3]>>e%8&1}set(e,t){let{buffer:n}=this.reserve(e-this.length+1),s=e>>3,i=e%8,o=n[s]>>i&1;return t?o===0&&(n[s]|=1<<i,++this.numValid):o===1&&(n[s]&=~(1<<i),--this.numValid),this}clear(){return this.numValid=0,super.clear()}},Ts=class extends vn{constructor(e){super(e.OffsetArrayType,1,1)}append(e){return this.set(this.length-1,e)}set(e,t){let n=this.length-1,s=this.reserve(e-n+1).buffer;return n<e++&&n>=0&&s.fill(s[n],n,e),s[e]=s[e-1]+t,this}flush(e=this.length-1){return e>this.length&&this.set(e-1,this.BYTES_PER_ELEMENT>4?BigInt(0):0),super.flush(e+1)}}});var Te,We,pt,Se=p(()=>{ht();wr();lc();we();e0();jr();Te=class{static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e){throw new Error('"throughDOM" not available in this environment')}constructor({type:e,nullValues:t}){this.length=0,this.finished=!1,this.type=e,this.children=[],this.nullValues=t,this.stride=or(e),this._nulls=new zo,t&&t.length>0&&(this._isValid=ZT(t))}toVector(){return new B([this.flush()])}get ArrayType(){return this.type.ArrayType}get nullCount(){return this._nulls.numInvalid}get numChildren(){return this.children.length}get byteLength(){let e=0,{_offsets:t,_values:n,_nulls:s,_typeIds:i,children:o}=this;return t&&(e+=t.byteLength),n&&(e+=n.byteLength),s&&(e+=s.byteLength),i&&(e+=i.byteLength),o.reduce((a,c)=>a+c.byteLength,e)}get reservedLength(){return this._nulls.reservedLength}get reservedByteLength(){let e=0;return this._offsets&&(e+=this._offsets.reservedByteLength),this._values&&(e+=this._values.reservedByteLength),this._nulls&&(e+=this._nulls.reservedByteLength),this._typeIds&&(e+=this._typeIds.reservedByteLength),this.children.reduce((t,n)=>t+n.reservedByteLength,e)}get valueOffsets(){return this._offsets?this._offsets.buffer:null}get values(){return this._values?this._values.buffer:null}get nullBitmap(){return this._nulls?this._nulls.buffer:null}get typeIds(){return this._typeIds?this._typeIds.buffer:null}append(e){return this.set(this.length,e)}isValid(e){return this._isValid(e)}set(e,t){return this.setValid(e,this.isValid(t))&&this.setValue(e,t),this}setValue(e,t){this._setValue(this,e,t)}setValid(e,t){return this.length=this._nulls.set(e,+t).length,t}addChild(e,t=`${this.numChildren}`){throw new Error(`Cannot append children to non-nested type "${this.type}"`)}getChildAt(e){return this.children[e]||null}flush(){let e,t,n,s,{type:i,length:o,nullCount:a,_typeIds:c,_offsets:u,_values:l,_nulls:f}=this;(t=c?.flush(o))?s=u?.flush(o):(s=u?.flush(o))?e=l?.flush(u.last()):e=l?.flush(o),a>0&&(n=f?.flush(o));let d=this.children.map(h=>h.flush());return this.clear(),D({type:i,length:o,nullCount:a,children:d,child:d[0],data:e,typeIds:t,nullBitmap:n,valueOffsets:s})}finish(){this.finished=!0;for(let e of this.children)e.finish();return this}clear(){var e,t,n,s;this.length=0,(e=this._nulls)===null||e===void 0||e.clear(),(t=this._values)===null||t===void 0||t.clear(),(n=this._offsets)===null||n===void 0||n.clear(),(s=this._typeIds)===null||s===void 0||s.clear();for(let i of this.children)i.clear();return this}};Te.prototype.length=1;Te.prototype.stride=1;Te.prototype.children=null;Te.prototype.finished=!1;Te.prototype.nullValues=null;Te.prototype._isValid=()=>!0;We=class extends Te{constructor(e){super(e),this._values=new vn(this.ArrayType,0,this.stride)}setValue(e,t){let n=this._values;return n.reserve(e-n.length+1),super.setValue(e,t)}},pt=class extends Te{constructor(e){super(e),this._pendingLength=0,this._offsets=new Ts(e.type)}setValue(e,t){let n=this._pending||(this._pending=new Map),s=n.get(e);s&&(this._pendingLength-=s.length),this._pendingLength+=t instanceof yr?t[ws].length:t.length,n.set(e,t)}setValid(e,t){return super.setValid(e,t)?!0:((this._pending||(this._pending=new Map)).set(e,void 0),!1)}clear(){return this._pendingLength=0,this._pending=void 0,super.clear()}flush(){return this._flush(),super.flush()}finish(){return this._flush(),super.finish()}_flush(){let e=this._pending,t=this._pendingLength;return this._pendingLength=0,this._pending=void 0,e&&e.size>0&&this._flushPending(e,t),this}}});var wi,sp=p(()=>{wi=class{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}offset(){return this.bb.readInt64(this.bb_pos)}metaDataLength(){return this.bb.readInt32(this.bb_pos+8)}bodyLength(){return this.bb.readInt64(this.bb_pos+16)}static sizeOf(){return 24}static createBlock(e,t,n,s){return e.prep(8,24),e.writeInt64(BigInt(s??0)),e.pad(4),e.writeInt32(n),e.writeInt64(BigInt(t??0)),e.offset()}}});var cr,r0=p(()=>{ce();sp();Bo();ku();Mh();cr=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsFooter(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsFooter(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):ge.V1}schema(e){let t=this.bb.__offset(this.bb_pos,6);return t?(e||new Nt).__init(this.bb.__indirect(this.bb_pos+t),this.bb):null}dictionaries(e,t){let n=this.bb.__offset(this.bb_pos,8);return n?(t||new wi).__init(this.bb.__vector(this.bb_pos+n)+e*24,this.bb):null}dictionariesLength(){let e=this.bb.__offset(this.bb_pos,8);return e?this.bb.__vector_len(this.bb_pos+e):0}recordBatches(e,t){let n=this.bb.__offset(this.bb_pos,10);return n?(t||new wi).__init(this.bb.__vector(this.bb_pos+n)+e*24,this.bb):null}recordBatchesLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.__vector_len(this.bb_pos+e):0}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,12);return n?(t||new Oe).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startFooter(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,ge.V1)}static addSchema(e,t){e.addFieldOffset(1,t,0)}static addDictionaries(e,t){e.addFieldOffset(2,t,0)}static startDictionariesVector(e,t){e.startVector(24,t,8)}static addRecordBatches(e,t){e.addFieldOffset(3,t,0)}static startRecordBatchesVector(e,t){e.startVector(24,t,8)}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endFooter(e){return e.endObject()}static finishFooterBuffer(e,t){e.finish(t)}static finishSizePrefixedFooterBuffer(e,t){e.finish(t,void 0,!0)}}});function Tl(r,e){return new Map([...r||new Map,...e||new Map])}function ip(r,e=new Map){for(let t=-1,n=r.length;++t<n;){let i=r[t].type;if(E.isDictionary(i)){if(!e.has(i.id))e.set(i.id,i.dictionary);else if(e.get(i.id)!==i.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}i.children&&i.children.length>0&&ip(i.children,e)}return e}var n0,s0,Q,O,mt=p(()=>{Me();we();n0=Symbol.for("apache-arrow/Schema"),s0=Symbol.for("apache-arrow/Field"),Q=class r{static isSchema(e){return e?.[n0]===!0}constructor(e=[],t,n,s=ge.V5){this.fields=e||[],this.metadata=t||new Map,n||(n=ip(this.fields)),this.dictionaries=n,this.metadataVersion=s}get[Symbol.toStringTag](){return"Schema"}get names(){return this.fields.map(e=>e.name)}toString(){return`Schema<{ ${this.fields.map((e,t)=>`${t}: ${e}`).join(", ")} }>`}select(e){let t=new Set(e),n=this.fields.filter(s=>t.has(s.name));return new r(n,this.metadata)}selectAt(e){let t=e.map(n=>this.fields[n]).filter(Boolean);return new r(t,this.metadata)}assign(...e){let t=e[0]instanceof r?e[0]:Array.isArray(e[0])?new r(e[0]):new r(e),n=[...this.fields],s=Tl(Tl(new Map,this.metadata),t.metadata),i=t.fields.filter(a=>{let c=n.findIndex(u=>u.name===a.name);return~c?(n[c]=a.clone({metadata:Tl(Tl(new Map,n[c].metadata),a.metadata)}))&&!1:!0}),o=ip(i,new Map);return new r([...n,...i],s,new Map([...this.dictionaries,...o]))}};Q.prototype.fields=null;Q.prototype.metadata=null;Q.prototype.dictionaries=null;Q.prototype[n0]=!0;Object.defineProperty(Q,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===Q&&Q.isSchema(e)}});O=class r{static isField(e){return e?.[s0]===!0}static new(...e){let[t,n,s,i]=e;return e[0]&&typeof e[0]=="object"&&({name:t}=e[0],n===void 0&&(n=e[0].type),s===void 0&&(s=e[0].nullable),i===void 0&&(i=e[0].metadata)),new r(`${t}`,n,s,i)}constructor(e,t,n=!1,s){this.name=e,this.type=t,this.nullable=n,this.metadata=s||new Map}get typeId(){return this.type.typeId}get[Symbol.toStringTag](){return"Field"}toString(){return`${this.name}: ${this.type}`}clone(...e){let[t,n,s,i]=e;return!e[0]||typeof e[0]!="object"?[t=this.name,n=this.type,s=this.nullable,i=this.metadata]=e:{name:t=this.name,type:n=this.type,nullable:s=this.nullable,metadata:i=this.metadata}=e[0],r.new(t,n,s,i)}};O.prototype.type=null;O.prototype.name=null;O.prototype.nullable=null;O.prototype.metadata=null;O.prototype[s0]=!0;Object.defineProperty(O,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===O&&O.isField(e)}})});var AO,vO,In,op,Gr,ap=p(()=>{sp();r0();ce();mt();Me();Ke();Qr();AO=li,vO=Ze,In=class{static decode(e){e=new vO(k(e));let t=cr.getRootAsFooter(e),n=Q.decode(t.schema(),new Map,t.version());return new op(n,t)}static encode(e){let t=new AO,n=Q.encode(t,e.schema);cr.startRecordBatchesVector(t,e.numRecordBatches);for(let o of[...e.recordBatches()].slice().reverse())Gr.encode(t,o);let s=t.endVector();cr.startDictionariesVector(t,e.numDictionaries);for(let o of[...e.dictionaryBatches()].slice().reverse())Gr.encode(t,o);let i=t.endVector();return cr.startFooter(t),cr.addSchema(t,n),cr.addVersion(t,ge.V5),cr.addRecordBatches(t,s),cr.addDictionaries(t,i),cr.finishFooterBuffer(t,cr.endFooter(t)),t.asUint8Array()}get numRecordBatches(){return this._recordBatches.length}get numDictionaries(){return this._dictionaryBatches.length}constructor(e,t=ge.V5,n,s){this.schema=e,this.version=t,n&&(this._recordBatches=n),s&&(this._dictionaryBatches=s)}*recordBatches(){for(let e,t=-1,n=this.numRecordBatches;++t<n;)(e=this.getRecordBatch(t))&&(yield e)}*dictionaryBatches(){for(let e,t=-1,n=this.numDictionaries;++t<n;)(e=this.getDictionaryBatch(t))&&(yield e)}getRecordBatch(e){return e>=0&&e<this.numRecordBatches&&this._recordBatches[e]||null}getDictionaryBatch(e){return e>=0&&e<this.numDictionaries&&this._dictionaryBatches[e]||null}},op=class extends In{get numRecordBatches(){return this._footer.recordBatchesLength()}get numDictionaries(){return this._footer.dictionariesLength()}constructor(e,t){super(e,t.version()),this._footer=t}getRecordBatch(e){if(e>=0&&e<this.numRecordBatches){let t=this._footer.recordBatches(e);if(t)return Gr.decode(t)}return null}getDictionaryBatch(e){if(e>=0&&e<this.numDictionaries){let t=this._footer.dictionaries(e);if(t)return Gr.decode(t)}return null}},Gr=class r{static decode(e){return new r(e.metaDataLength(),e.bodyLength(),e.offset())}static encode(e,t){let{metaDataLength:n}=t,s=BigInt(t.offset),i=BigInt(t.bodyLength);return wi.createBlock(e,s,n,i)}constructor(e,t,n){this.metaDataLength=e,this.offset=te(n),this.bodyLength=te(t)}}});var ur,i0=p(()=>{ce();Bo();Gu();ku();ur=class r{constructor(){this.bb=null,this.bb_pos=0}__init(e,t){return this.bb_pos=e,this.bb=t,this}static getRootAsMessage(e,t){return(t||new r).__init(e.readInt32(e.position())+e.position(),e)}static getSizePrefixedRootAsMessage(e,t){return e.setPosition(e.position()+4),(t||new r).__init(e.readInt32(e.position())+e.position(),e)}version(){let e=this.bb.__offset(this.bb_pos,4);return e?this.bb.readInt16(this.bb_pos+e):ge.V1}headerType(){let e=this.bb.__offset(this.bb_pos,6);return e?this.bb.readUint8(this.bb_pos+e):se.NONE}header(e){let t=this.bb.__offset(this.bb_pos,8);return t?this.bb.__union(e,this.bb_pos+t):null}bodyLength(){let e=this.bb.__offset(this.bb_pos,10);return e?this.bb.readInt64(this.bb_pos+e):BigInt("0")}customMetadata(e,t){let n=this.bb.__offset(this.bb_pos,12);return n?(t||new Oe).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos+n)+e*4),this.bb):null}customMetadataLength(){let e=this.bb.__offset(this.bb_pos,12);return e?this.bb.__vector_len(this.bb_pos+e):0}static startMessage(e){e.startObject(5)}static addVersion(e,t){e.addFieldInt16(0,t,ge.V1)}static addHeaderType(e,t){e.addFieldInt8(1,t,se.NONE)}static addHeader(e,t){e.addFieldOffset(2,t,0)}static addBodyLength(e,t){e.addFieldInt64(3,t,BigInt("0"))}static addCustomMetadata(e,t){e.addFieldOffset(4,t,0)}static createCustomMetadataVector(e,t){e.startVector(4,t.length,4);for(let n=t.length-1;n>=0;n--)e.addOffset(t[n]);return e.endVector()}static startCustomMetadataVector(e,t){e.startVector(4,t,4)}static endMessage(e){return e.endObject()}static finishMessageBuffer(e,t){e.finish(t)}static finishSizePrefixedMessageBuffer(e,t){e.finish(t,void 0,!0)}static createMessage(e,t,n,s,i,o){return r.startMessage(e),r.addVersion(e,t),r.addHeaderType(e,n),r.addHeader(e,s),r.addBodyLength(e,i),r.addCustomMetadata(e,o),r.endMessage(e)}}});var cp,_l,o0=p(()=>{Vt();Lx();Vu();Ih();Tx();_x();vx();Ax();Fx();Ox();Sx();Th();xh();Lh();Bh();Sh();_h();Ex();Ix();Bx();Fh();wh();Ah();vh();Eh();cp=class extends R{visit(e,t){return e==null||t==null?void 0:super.visit(e,t)}visitNull(e,t){return Ya.startNull(t),Ya.endNull(t)}visitInt(e,t){return Mr.startInt(t),Mr.addBitWidth(t,e.bitWidth),Mr.addIsSigned(t,e.isSigned),Mr.endInt(t)}visitFloat(e,t){return ns.startFloatingPoint(t),ns.addPrecision(t,e.precision),ns.endFloatingPoint(t)}visitBinary(e,t){return Wa.startBinary(t),Wa.endBinary(t)}visitBinaryView(e,t){return $a.startBinaryView(t),$a.endBinaryView(t)}visitLargeBinary(e,t){return Ka.startLargeBinary(t),Ka.endLargeBinary(t)}visitBool(e,t){return qa.startBool(t),qa.endBool(t)}visitUtf8(e,t){return Za.startUtf8(t),Za.endUtf8(t)}visitUtf8View(e,t){return ec.startUtf8View(t),ec.endUtf8View(t)}visitLargeUtf8(e,t){return Ha.startLargeUtf8(t),Ha.endLargeUtf8(t)}visitDecimal(e,t){return Yr.startDecimal(t),Yr.addScale(t,e.scale),Yr.addPrecision(t,e.precision),Yr.addBitWidth(t,e.bitWidth),Yr.endDecimal(t)}visitDate(e,t){return Zn.startDate(t),Zn.addUnit(t,e.unit),Zn.endDate(t)}visitTime(e,t){return xn.startTime(t),xn.addUnit(t,e.unit),xn.addBitWidth(t,e.bitWidth),xn.endTime(t)}visitTimestamp(e,t){let n=e.timezone&&t.createString(e.timezone)||void 0;return Tn.startTimestamp(t),Tn.addUnit(t,e.unit),n!==void 0&&Tn.addTimezone(t,n),Tn.endTimestamp(t)}visitInterval(e,t){return ss.startInterval(t),ss.addUnit(t,e.unit),ss.endInterval(t)}visitDuration(e,t){return es.startDuration(t),es.addUnit(t,e.unit),es.endDuration(t)}visitList(e,t){return Ja.startList(t),Ja.endList(t)}visitLargeList(e,t){return Xa.startLargeList(t),Xa.endLargeList(t)}visitStruct(e,t){return Qa.startStruct_(t),Qa.endStruct_(t)}visitUnion(e,t){Dr.startTypeIdsVector(t,e.typeIds.length);let n=Dr.createTypeIdsVector(t,e.typeIds);return Dr.startUnion(t),Dr.addMode(t,e.mode),Dr.addTypeIds(t,n),Dr.endUnion(t)}visitDictionary(e,t){let n=this.visit(e.indices,t);return Jr.startDictionaryEncoding(t),Jr.addId(t,BigInt(e.id)),Jr.addIsOrdered(t,e.isOrdered),n!==void 0&&Jr.addIndexType(t,n),Jr.endDictionaryEncoding(t)}visitFixedSizeBinary(e,t){return ts.startFixedSizeBinary(t),ts.addByteWidth(t,e.byteWidth),ts.endFixedSizeBinary(t)}visitFixedSizeList(e,t){return rs.startFixedSizeList(t),rs.addListSize(t,e.listSize),rs.endFixedSizeList(t)}visitMap(e,t){return is.startMap(t),is.addKeysSorted(t,e.keysSorted),is.endMap(t)}},_l=new cp});function l0(r,e=new Map){return new Q(IO(r,e),Al(r.metadata),e)}function up(r){return new $e(r.count,d0(r.columns),h0(r.columns),null,p0(r.columns))}function f0(r){return new bt(up(r.data),r.id,r.isDelta)}function IO(r,e){return(r.fields||[]).filter(Boolean).map(t=>O.fromJSON(t,e))}function a0(r,e){return(r.children||[]).filter(Boolean).map(t=>O.fromJSON(t,e))}function d0(r){return(r||[]).reduce((e,t)=>[...e,new xr(t.count,SO(t.VALIDITY)),...d0(t.children)],[])}function h0(r,e=[]){for(let t=-1,n=(r||[]).length;++t<n;){let s=r[t];if(s.VALIDITY&&e.push(new Ce(e.length,s.VALIDITY.length)),s.TYPE_ID&&e.push(new Ce(e.length,s.TYPE_ID.length)),s.OFFSET&&e.push(new Ce(e.length,s.OFFSET.length)),s.DATA&&e.push(new Ce(e.length,s.DATA.length)),s.VIEWS&&e.push(new Ce(e.length,s.VIEWS.length)),s.VARIADIC_DATA_BUFFERS)for(let i of s.VARIADIC_DATA_BUFFERS)e.push(new Ce(e.length,i.length));e=h0(s.children,e)}return e}function SO(r){return(r||[]).reduce((e,t)=>e+ +(t===0),0)}function p0(r){return(r||[]).reduce((e,t)=>[...e,...t.VARIADIC_DATA_BUFFERS?[t.VARIADIC_DATA_BUFFERS.length]:[],...p0(t.children)],[])}function m0(r,e){let t,n,s,i,o,a;return!e||!(i=r.dictionary)?(o=u0(r,a0(r,e)),s=new O(r.name,o,r.nullable,Al(r.metadata))):e.has(t=i.id)?(n=(n=i.indexType)?c0(n):new Pe,a=new Ge(e.get(t),n,t,i.isOrdered),s=new O(r.name,a,r.nullable,Al(r.metadata))):(n=(n=i.indexType)?c0(n):new Pe,e.set(t,o=u0(r,a0(r,e))),a=new Ge(o,n,t,i.isOrdered),s=new O(r.name,a,r.nullable,Al(r.metadata))),s||null}function Al(r=[]){return new Map(r.map(({key:e,value:t})=>[e,t]))}function c0(r){return new Fe(r.isSigned,r.bitWidth)}function u0(r,e){let t=r.type.name;switch(t){case"NONE":return new Ne;case"null":return new Ne;case"binary":return new Ct;case"largebinary":return new Ur;case"binaryview":return new Z;case"utf8":return new ut;case"largeutf8":return new Pr;case"utf8view":return new St;case"bool":return new lt;case"list":return new je((e||[])[0]);case"largelist":return new ir((e||[])[0]);case"struct":return new pe(e||[]);case"struct_":return new pe(e||[])}switch(t){case"int":{let n=r.type;return new Fe(n.isSigned,n.bitWidth)}case"floatingpoint":{let n=r.type;return new ct(le[n.precision])}case"decimal":{let n=r.type;return new Ut(n.scale,n.precision,n.bitWidth)}case"date":{let n=r.type;return new Et(ye[n.unit])}case"time":{let n=r.type;return new tt(L[n.unit],n.bitWidth)}case"timestamp":{let n=r.type;return new rt(L[n.unit],n.timezone)}case"interval":{let n=r.type;return new ft(ae[n.unit])}case"duration":{let n=r.type;return new Lt(L[n.unit])}case"union":{let n=r.type,[s,...i]=(n.mode+"").toLowerCase(),o=s.toUpperCase()+i.join("");return new Bt(he[o],n.typeIds||[],e||[])}case"fixedsizebinary":{let n=r.type;return new Pt(n.byteWidth)}case"fixedsizelist":{let n=r.type;return new Be(n.listSize,(e||[])[0])}case"map":{let n=r.type;return new dt((e||[])[0],n.keysSorted)}}throw new Error(`Unrecognized type: "${t}"`)}var b0=p(()=>{mt();we();_s();Me()});function BO(r,e){return(()=>{switch(e){case se.Schema:return Q.fromJSON(r);case se.RecordBatch:return $e.fromJSON(r);case se.DictionaryBatch:return bt.fromJSON(r)}throw new Error(`Unrecognized Message type: { name: ${se[e]}, type: ${e} }`)})}function FO(r,e){return(()=>{switch(e){case se.Schema:return Q.decode(r.header(new Nt),new Map,r.version());case se.RecordBatch:return $e.decode(r.header(new ot),r.version());case se.DictionaryBatch:return bt.decode(r.header(new wn),r.version())}throw new Error(`Unrecognized Message type: { name: ${se[e]}, type: ${e} }`)})}function OO(r,e=new Map,t=ge.V5){let n=PO(r,e);return new Q(n,vl(r),e,t)}function MO(r,e=ge.V5){return new $e(r.length(),NO(r),CO(r,e),x0(r.compression()),UO(r))}function DO(r,e=ge.V5){return new bt($e.decode(r.data(),e),r.id(),r.isDelta())}function RO(r){return new Ce(r.offset(),r.length())}function kO(r){return new xr(r.length(),r.nullCount())}function NO(r){let e=[];for(let t,n=-1,s=-1,i=r.nodesLength();++n<i;)(t=r.nodes(n))&&(e[++s]=xr.decode(t));return e}function CO(r,e){let t=[];for(let n,s=-1,i=-1,o=r.buffersLength();++s<o;)(n=r.buffers(s))&&(e<ge.V4&&(n.bb_pos+=8*(s+1)),t[++i]=Ce.decode(n));return t}function UO(r){let e=[],t=Math.trunc(r.variadicBufferCountsLength());for(let n=0;n<t;++n)e.push(te(r.variadicBufferCounts(n)));return e}function PO(r,e){let t=[];for(let n,s=-1,i=-1,o=r.fieldsLength();++s<o;)(n=r.fields(s))&&(t[++i]=O.decode(n,e));return t}function g0(r,e){let t=[];for(let n,s=-1,i=-1,o=r.childrenLength();++s<o;)(n=r.children(s))&&(t[++i]=O.decode(n,e));return t}function VO(r,e){let t,n,s,i,o,a;return!e||!(a=r.dictionary())?(s=w0(r,g0(r,e)),n=new O(r.name(),s,r.nullable(),vl(r))):e.has(t=te(a.id()))?(i=(i=a.indexType())?y0(i):new Pe,o=new Ge(e.get(t),i,t,a.isOrdered()),n=new O(r.name(),o,r.nullable(),vl(r))):(i=(i=a.indexType())?y0(i):new Pe,e.set(t,s=w0(r,g0(r,e))),o=new Ge(s,i,t,a.isOrdered()),n=new O(r.name(),o,r.nullable(),vl(r))),n||null}function vl(r){let e=new Map;if(r)for(let t,n,s=-1,i=Math.trunc(r.customMetadataLength());++s<i;)(t=r.customMetadata(s))&&(n=t.key())!=null&&e.set(n,t.value());return e}function jO(r){let e=new Map;for(let t,n,s=-1,i=Math.trunc(r.customMetadataLength());++s<i;)(t=r.customMetadata(s))&&(n=t.key())!=null&&e.set(n,t.value());return e}function y0(r){return new Fe(r.isSigned(),r.bitWidth())}function w0(r,e){let t=r.typeType();switch(t){case z.NONE:return new Ne;case z.Null:return new Ne;case z.Binary:return new Ct;case z.LargeBinary:return new Ur;case z.BinaryView:return new Z;case z.Utf8:return new ut;case z.LargeUtf8:return new Pr;case z.Utf8View:return new St;case z.Bool:return new lt;case z.List:return new je((e||[])[0]);case z.LargeList:return new ir((e||[])[0]);case z.Struct_:return new pe(e||[])}switch(t){case z.Int:{let n=r.type(new Mr);return new Fe(n.isSigned(),n.bitWidth())}case z.FloatingPoint:{let n=r.type(new ns);return new ct(n.precision())}case z.Decimal:{let n=r.type(new Yr);return new Ut(n.scale(),n.precision(),n.bitWidth())}case z.Date:{let n=r.type(new Zn);return new Et(n.unit())}case z.Time:{let n=r.type(new xn);return new tt(n.unit(),n.bitWidth())}case z.Timestamp:{let n=r.type(new Tn);return new rt(n.unit(),n.timezone())}case z.Interval:{let n=r.type(new ss);return new ft(n.unit())}case z.Duration:{let n=r.type(new es);return new Lt(n.unit())}case z.Union:{let n=r.type(new Dr);return new Bt(n.mode(),n.typeIdsArray()||[],e||[])}case z.FixedSizeBinary:{let n=r.type(new ts);return new Pt(n.byteWidth())}case z.FixedSizeList:{let n=r.type(new rs);return new Be(n.listSize(),(e||[])[0])}case z.Map:{let n=r.type(new is);return new dt((e||[])[0],n.keysSorted())}}throw new Error(`Unrecognized type: "${z[t]}" (${t})`)}function x0(r){return r?new xi(r.codec(),r.method()):null}function GO(r,e){let t=e.fields.map(i=>O.encode(r,i));Nt.startFieldsVector(r,t.length);let n=Nt.createFieldsVector(r,t),s=e.metadata&&e.metadata.size>0?Nt.createCustomMetadataVector(r,[...e.metadata].map(([i,o])=>{let a=r.createString(`${i}`),c=r.createString(`${o}`);return Oe.startKeyValue(r),Oe.addKey(r,a),Oe.addValue(r,c),Oe.endKeyValue(r)})):-1;return Nt.startSchema(r),Nt.addFields(r,n),Nt.addEndianness(r,XO?Qn.Little:Qn.Big),s!==-1&&Nt.addCustomMetadata(r,s),Nt.endSchema(r)}function zO(r,e){let t=-1,n=-1,s=-1,i=e.type,o=e.typeId;E.isDictionary(i)?(o=i.dictionary.typeId,s=_l.visit(i,r),n=_l.visit(i.dictionary,r)):n=_l.visit(i,r);let a=(i.children||[]).map(l=>O.encode(r,l)),c=at.createChildrenVector(r,a),u=e.metadata&&e.metadata.size>0?at.createCustomMetadataVector(r,[...e.metadata].map(([l,f])=>{let d=r.createString(`${l}`),h=r.createString(`${f}`);return Oe.startKeyValue(r),Oe.addKey(r,d),Oe.addValue(r,h),Oe.endKeyValue(r)})):-1;return e.name&&(t=r.createString(e.name)),at.startField(r),at.addType(r,n),at.addTypeType(r,o),at.addChildren(r,c),at.addNullable(r,!!e.nullable),t!==-1&&at.addName(r,t),s!==-1&&at.addDictionary(r,s),u!==-1&&at.addCustomMetadata(r,u),at.endField(r)}function WO(r,e){let t=e.nodes||[],n=e.buffers||[],s=e.variadicBufferCounts||[];ot.startNodesVector(r,t.length);for(let u of t.slice().reverse())xr.encode(r,u);let i=r.endVector();ot.startBuffersVector(r,n.length);for(let u of n.slice().reverse())Ce.encode(r,u);let o=r.endVector(),a=null;e.compression!==null&&(a=T0(r,e.compression));let c=-1;return s.length>0&&(c=ot.createVariadicBufferCountsVector(r,s.map(BigInt))),ot.startRecordBatch(r),ot.addLength(r,BigInt(e.length)),ot.addNodes(r,i),ot.addBuffers(r,o),e.compression!==null&&a&&ot.addCompression(r,a),c!==-1&&ot.addVariadicBufferCounts(r,c),ot.endRecordBatch(r)}function T0(r,e){return yn.startBodyCompression(r),yn.addCodec(r,e.type),yn.addMethod(r,e.method),yn.endBodyCompression(r)}function $O(r,e){let t=$e.encode(r,e.data);return wn.startDictionaryBatch(r),wn.addId(r,BigInt(e.id)),wn.addIsDelta(r,e.isDelta),wn.addData(r,t),wn.endDictionaryBatch(r)}function qO(r,e){return Lo.createFieldNode(r,BigInt(e.length),BigInt(e.nullCount))}function KO(r,e){return Eo.createBuffer(r,BigInt(e.offset),BigInt(e.length))}var EO,LO,gt,$e,bt,Ce,xr,xi,XO,_s=p(()=>{ce();Mh();Vu();gh();wx();mh();Oh();bh();ju();Bo();yh();Ih();Th();xh();Lh();Bh();Sh();_h();Fh();Ah();vh();Eh();i0();ph();hh();mt();Ke();Qr();Me();o0();b0();we();EO=li,LO=Ze,gt=class r{static fromJSON(e,t){let n=new r(0,ge.V5,t);return n._createHeader=BO(e,t),n}static decode(e){e=new LO(k(e));let t=ur.getRootAsMessage(e),n=t.bodyLength(),s=t.version(),i=t.headerType(),o=jO(t),a=new r(n,s,i,void 0,o);return a._createHeader=FO(t,i),a}static encode(e){let t=new EO,n=-1;e.isSchema()?n=Q.encode(t,e.header()):e.isRecordBatch()?n=$e.encode(t,e.header()):e.isDictionaryBatch()&&(n=bt.encode(t,e.header()));let s=e.metadata&&e.metadata.size>0?ur.createCustomMetadataVector(t,[...e.metadata].map(([i,o])=>{let a=t.createString(`${i}`),c=t.createString(`${o}`);return Oe.startKeyValue(t),Oe.addKey(t,a),Oe.addValue(t,c),Oe.endKeyValue(t)})):-1;return ur.startMessage(t),ur.addVersion(t,ge.V5),ur.addHeader(t,n),ur.addHeaderType(t,e.headerType),ur.addBodyLength(t,BigInt(e.bodyLength)),s!==-1&&ur.addCustomMetadata(t,s),ur.finishMessageBuffer(t,ur.endMessage(t)),t.asUint8Array()}static from(e,t=0){if(e instanceof Q)return new r(0,ge.V5,se.Schema,e);if(e instanceof $e)return new r(t,ge.V5,se.RecordBatch,e,e.metadata);if(e instanceof bt)return new r(t,ge.V5,se.DictionaryBatch,e);throw new Error(`Unrecognized Message header: ${e}`)}get type(){return this.headerType}get version(){return this._version}get headerType(){return this._headerType}get compression(){return this._compression}get bodyLength(){return this._bodyLength}get metadata(){return this._metadata}header(){return this._createHeader()}isSchema(){return this.headerType===se.Schema}isRecordBatch(){return this.headerType===se.RecordBatch}isDictionaryBatch(){return this.headerType===se.DictionaryBatch}constructor(e,t,n,s,i){this._version=t,this._headerType=n,this.body=new Uint8Array(0),this._compression=s?.compression,s&&(this._createHeader=()=>s),this._bodyLength=te(e),this._metadata=i||new Map}},$e=class{get nodes(){return this._nodes}get length(){return this._length}get buffers(){return this._buffers}get compression(){return this._compression}get variadicBufferCounts(){return this._variadicBufferCounts}get metadata(){return this._metadata}constructor(e,t,n,s,i=[],o){this._nodes=t,this._buffers=n,this._length=te(e),this._compression=s,this._variadicBufferCounts=i,this._metadata=o||new Map}},bt=class{get id(){return this._id}get data(){return this._data}get isDelta(){return this._isDelta}get length(){return this.data.length}get nodes(){return this.data.nodes}get buffers(){return this.data.buffers}constructor(e,t,n=!1){this._data=e,this._isDelta=n,this._id=te(t)}},Ce=class{constructor(e,t){this.offset=te(e),this.length=te(t)}},xr=class{constructor(e,t){this.length=te(e),this.nullCount=te(t)}},xi=class{constructor(e,t=fi.BUFFER){this.type=e,this.method=t}};O.encode=zO;O.decode=VO;O.fromJSON=m0;Q.encode=GO;Q.decode=OO;Q.fromJSON=l0;$e.encode=WO;$e.decode=MO;$e.fromJSON=up;bt.encode=$O;bt.decode=DO;bt.fromJSON=f0;xr.encode=qO;xr.decode=kO;Ce.encode=KO;Ce.decode=RO;xi.encode=T0;xi.decode=x0;XO=(()=>{let r=new ArrayBuffer(2);return new DataView(r).setInt16(0,256,!0),new Int16Array(r)[0]===256})()});var Ee,mc,Ti,Il,bc=p(()=>{kt();Va();Ee=Object.freeze({done:!0,value:void 0}),mc=class{constructor(e){this._json=e}get schema(){return this._json.schema}get batches(){return this._json.batches||[]}get dictionaries(){return this._json.dictionaries||[]}},Ti=class{tee(){return this._getDOMStream().tee()}pipe(e,t){return this._getNodeStream().pipe(e,t)}pipeTo(e,t){return this._getDOMStream().pipeTo(e,t)}pipeThrough(e,t){return this._getDOMStream().pipeThrough(e,t)}_getDOMStream(){return this._DOMStream||(this._DOMStream=this.toDOMStream())}_getNodeStream(){return this._nodeStream||(this._nodeStream=this.toNodeStream())}},Il=class extends Ti{constructor(){super(),this._values=[],this.resolvers=[],this._closedPromise=new Promise(e=>this._closedPromiseResolve=e)}get closed(){return this._closedPromise}cancel(e){return F(this,void 0,void 0,function*(){yield this.return(e)})}write(e){this._ensureOpen()&&(this.resolvers.length<=0?this._values.push(e):this.resolvers.shift().resolve({done:!1,value:e}))}abort(e){this._closedPromiseResolve&&(this.resolvers.length<=0?this._error={error:e}:this.resolvers.shift().reject({done:!0,value:e}))}close(){if(this._closedPromiseResolve){let{resolvers:e}=this;for(;e.length>0;)e.shift().resolve(Ee);this._closedPromiseResolve(),this._closedPromiseResolve=void 0}}[Symbol.asyncIterator](){return this}toDOMStream(e){return Qe.toDOMStream(this._closedPromiseResolve||this._error?this:this._values,e)}toNodeStream(e){return Qe.toNodeStream(this._closedPromiseResolve||this._error?this:this._values,e)}throw(e){return F(this,void 0,void 0,function*(){return yield this.abort(e),Ee})}return(e){return F(this,void 0,void 0,function*(){return yield this.close(),Ee})}read(e){return F(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return F(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(...e){return this._values.length>0?Promise.resolve({done:!1,value:this._values.shift()}):this._error?Promise.reject({done:!0,value:this._error.error}):this._closedPromiseResolve?new Promise((t,n)=>{this.resolvers.push({resolve:t,reject:n})}):Promise.resolve(Ee)}_ensureOpen(){if(this._closedPromiseResolve)return!0;throw new Error("AsyncQueue is closed")}}});var Tr,_r,Gt,lp,Sn,As=p(()=>{kt();Va();gn();bc();Ke();Yn();Tr=class extends Il{write(e){if((e=k(e)).byteLength>0)return super.write(e)}toString(e=!1){return e?vo(this.toUint8Array(!0)):this.toUint8Array(!1).then(vo)}toUint8Array(e=!1){return e?Qt(this._values)[0]:F(this,void 0,void 0,function*(){var t,n,s,i;let o=[],a=0;try{for(var c=!0,u=Ht(this),l;l=yield u.next(),t=l.done,!t;c=!0){i=l.value,c=!1;let f=i;o.push(f),a+=f.byteLength}}catch(f){n={error:f}}finally{try{!c&&!t&&(s=u.return)&&(yield s.call(u))}finally{if(n)throw n.error}}return Qt(o,a)[0]})}},_r=class{constructor(e){e&&(this.source=new lp(Qe.fromIterable(e)))}[Symbol.iterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}},Gt=class r{constructor(e){e instanceof r?this.source=e.source:e instanceof Tr?this.source=new Sn(Qe.fromAsyncIterable(e)):Mu(e)?this.source=new Sn(Qe.fromNodeStream(e)):Ca(e)?this.source=new Sn(Qe.fromDOMStream(e)):Fu(e)?this.source=new Sn(Qe.fromDOMStream(e.body)):Br(e)?this.source=new Sn(Qe.fromIterable(e)):Yt(e)?this.source=new Sn(Qe.fromAsyncIterable(e)):br(e)&&(this.source=new Sn(Qe.fromAsyncIterable(e)))}[Symbol.asyncIterator](){return this}next(e){return this.source.next(e)}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}get closed(){return this.source.closed}cancel(e){return this.source.cancel(e)}peek(e){return this.source.peek(e)}read(e){return this.source.read(e)}},lp=class{constructor(e){this.source=e}cancel(e){this.return(e)}peek(e){return this.next(e,"peek").value}read(e){return this.next(e,"read").value}next(e,t="read"){return this.source.next({cmd:t,size:e})}throw(e){return Object.create(this.source.throw&&this.source.throw(e)||Ee)}return(e){return Object.create(this.source.return&&this.source.return(e)||Ee)}},Sn=class{constructor(e){this.source=e,this._closedPromise=new Promise(t=>this._closedPromiseResolve=t)}cancel(e){return F(this,void 0,void 0,function*(){yield this.return(e)})}get closed(){return this._closedPromise}read(e){return F(this,void 0,void 0,function*(){return(yield this.next(e,"read")).value})}peek(e){return F(this,void 0,void 0,function*(){return(yield this.next(e,"peek")).value})}next(e){return F(this,arguments,void 0,function*(t,n="read"){return yield this.source.next({cmd:n,size:t})})}throw(e){return F(this,void 0,void 0,function*(){let t=this.source.throw&&(yield this.source.throw(e))||Ee;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}return(e){return F(this,void 0,void 0,function*(){let t=this.source.return&&(yield this.source.return(e))||Ee;return this._closedPromiseResolve&&this._closedPromiseResolve(),this._closedPromiseResolve=void 0,Object.create(t)})}}});var gc,vs,fp=p(()=>{kt();As();Ke();gc=class extends _r{constructor(e,t){super(),this.position=0,this.buffer=k(e),this.size=t===void 0?this.buffer.byteLength:t}readInt32(e){let{buffer:t,byteOffset:n}=this.readAt(e,4);return new DataView(t,n).getInt32(0,!0)}seek(e){return this.position=Math.min(e,this.size),e<this.size}read(e){let{buffer:t,size:n,position:s}=this;return t&&s<n?(typeof e!="number"&&(e=Number.POSITIVE_INFINITY),this.position=Math.min(n,s+Math.min(n-s,e)),t.subarray(s,this.position)):null}readAt(e,t){let n=this.buffer,s=Math.min(this.size,e+t);return n?n.subarray(e,s):new Uint8Array(t)}close(){this.buffer&&(this.buffer=null)}throw(e){return this.close(),{done:!0,value:e}}return(e){return this.close(),{done:!0,value:e}}},vs=class extends Gt{constructor(e,t){super(),this.position=0,this._handle=e,typeof t=="number"?this.size=t:this._pending=F(this,void 0,void 0,function*(){this.size=(yield e.stat()).size,delete this._pending})}readInt32(e){return F(this,void 0,void 0,function*(){let{buffer:t,byteOffset:n}=yield this.readAt(e,4);return new DataView(t,n).getInt32(0,!0)})}seek(e){return F(this,void 0,void 0,function*(){return this._pending&&(yield this._pending),this.position=Math.min(e,this.size),e<this.size})}read(e){return F(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:t,size:n,position:s}=this;if(t&&s<n){typeof e!="number"&&(e=Number.POSITIVE_INFINITY);let i=s,o=0,a=0,c=Math.min(n,i+Math.min(n-i,e)),u=new Uint8Array(Math.max(0,(this.position=c)-i));for(;(i+=a)<c&&(o+=a)<u.byteLength;)({bytesRead:a}=yield t.read(u,o,u.byteLength-o,i));return u}return null})}readAt(e,t){return F(this,void 0,void 0,function*(){this._pending&&(yield this._pending);let{_handle:n,size:s}=this;if(n&&e+t<s){let i=Math.min(s,e+t),o=new Uint8Array(i-e);return(yield n.read(o,0,t,e)).buffer}return new Uint8Array(t)})}close(){return F(this,void 0,void 0,function*(){let e=this._handle;this._handle=null,e&&(yield e.close())})}throw(e){return F(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:e}})}return(e){return F(this,void 0,void 0,function*(){return yield this.close(),{done:!0,value:e}})}}});var hp={};J(hp,{BaseInt64:()=>yc,Int128:()=>wc,Int64:()=>En,Uint64:()=>De});function Wo(r){return r<0&&(r=4294967295+r+1),`0x${r.toString(16)}`}var $o,dp,yc,De,En,wc,pp=p(()=>{$o=8,dp=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8],yc=class{constructor(e){this.buffer=e}high(){return this.buffer[1]}low(){return this.buffer[0]}_times(e){let t=new Uint32Array([this.buffer[1]>>>16,this.buffer[1]&65535,this.buffer[0]>>>16,this.buffer[0]&65535]),n=new Uint32Array([e.buffer[1]>>>16,e.buffer[1]&65535,e.buffer[0]>>>16,e.buffer[0]&65535]),s=t[3]*n[3];this.buffer[0]=s&65535;let i=s>>>16;return s=t[2]*n[3],i+=s,s=t[3]*n[2]>>>0,i+=s,this.buffer[0]+=i<<16,this.buffer[1]=i>>>0<s?65536:0,this.buffer[1]+=i>>>16,this.buffer[1]+=t[1]*n[3]+t[2]*n[2]+t[3]*n[1],this.buffer[1]+=t[0]*n[3]+t[1]*n[2]+t[2]*n[1]+t[3]*n[0]<<16,this}_plus(e){let t=this.buffer[0]+e.buffer[0]>>>0;this.buffer[1]+=e.buffer[1],t<this.buffer[0]>>>0&&++this.buffer[1],this.buffer[0]=t}lessThan(e){return this.buffer[1]<e.buffer[1]||this.buffer[1]===e.buffer[1]&&this.buffer[0]<e.buffer[0]}equals(e){return this.buffer[1]===e.buffer[1]&&this.buffer[0]==e.buffer[0]}greaterThan(e){return e.lessThan(this)}hex(){return`${Wo(this.buffer[1])} ${Wo(this.buffer[0])}`}},De=class r extends yc{times(e){return this._times(e),this}plus(e){return this._plus(e),this}static from(e,t=new Uint32Array(2)){return r.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(2)){return r.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(2)){let n=e.length,s=new r(t);for(let i=0;i<n;){let o=$o<n-i?$o:n-i,a=new r(new Uint32Array([Number.parseInt(e.slice(i,i+o),10),0])),c=new r(new Uint32Array([dp[o],0]));s.times(c),s.plus(a),i+=o}return s}static convertArray(e){let t=new Uint32Array(e.length*2);for(let n=-1,s=e.length;++n<s;)r.from(e[n],new Uint32Array(t.buffer,t.byteOffset+2*n*4,2));return t}static multiply(e,t){return new r(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new r(new Uint32Array(e.buffer)).plus(t)}},En=class r extends yc{negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[0]==0&&++this.buffer[1],this}times(e){return this._times(e),this}plus(e){return this._plus(e),this}lessThan(e){let t=this.buffer[1]<<0,n=e.buffer[1]<<0;return t<n||t===n&&this.buffer[0]<e.buffer[0]}static from(e,t=new Uint32Array(2)){return r.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(2)){return r.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(2)){let n=e.startsWith("-"),s=e.length,i=new r(t);for(let o=n?1:0;o<s;){let a=$o<s-o?$o:s-o,c=new r(new Uint32Array([Number.parseInt(e.slice(o,o+a),10),0])),u=new r(new Uint32Array([dp[a],0]));i.times(u),i.plus(c),o+=a}return n?i.negate():i}static convertArray(e){let t=new Uint32Array(e.length*2);for(let n=-1,s=e.length;++n<s;)r.from(e[n],new Uint32Array(t.buffer,t.byteOffset+2*n*4,2));return t}static multiply(e,t){return new r(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new r(new Uint32Array(e.buffer)).plus(t)}},wc=class r{constructor(e){this.buffer=e}high(){return new En(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2))}low(){return new En(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset,2))}negate(){return this.buffer[0]=~this.buffer[0]+1,this.buffer[1]=~this.buffer[1],this.buffer[2]=~this.buffer[2],this.buffer[3]=~this.buffer[3],this.buffer[0]==0&&++this.buffer[1],this.buffer[1]==0&&++this.buffer[2],this.buffer[2]==0&&++this.buffer[3],this}times(e){let t=new De(new Uint32Array([this.buffer[3],0])),n=new De(new Uint32Array([this.buffer[2],0])),s=new De(new Uint32Array([this.buffer[1],0])),i=new De(new Uint32Array([this.buffer[0],0])),o=new De(new Uint32Array([e.buffer[3],0])),a=new De(new Uint32Array([e.buffer[2],0])),c=new De(new Uint32Array([e.buffer[1],0])),u=new De(new Uint32Array([e.buffer[0],0])),l=De.multiply(i,u);this.buffer[0]=l.low();let f=new De(new Uint32Array([l.high(),0]));return l=De.multiply(s,u),f.plus(l),l=De.multiply(i,c),f.plus(l),this.buffer[1]=f.low(),this.buffer[3]=f.lessThan(l)?1:0,this.buffer[2]=f.high(),new De(new Uint32Array(this.buffer.buffer,this.buffer.byteOffset+8,2)).plus(De.multiply(n,u)).plus(De.multiply(s,c)).plus(De.multiply(i,a)),this.buffer[3]+=De.multiply(t,u).plus(De.multiply(n,c)).plus(De.multiply(s,a)).plus(De.multiply(i,o)).low(),this}plus(e){let t=new Uint32Array(4);return t[3]=this.buffer[3]+e.buffer[3]>>>0,t[2]=this.buffer[2]+e.buffer[2]>>>0,t[1]=this.buffer[1]+e.buffer[1]>>>0,t[0]=this.buffer[0]+e.buffer[0]>>>0,t[0]<this.buffer[0]>>>0&&++t[1],t[1]<this.buffer[1]>>>0&&++t[2],t[2]<this.buffer[2]>>>0&&++t[3],this.buffer[3]=t[3],this.buffer[2]=t[2],this.buffer[1]=t[1],this.buffer[0]=t[0],this}hex(){return`${Wo(this.buffer[3])} ${Wo(this.buffer[2])} ${Wo(this.buffer[1])} ${Wo(this.buffer[0])}`}static multiply(e,t){return new r(new Uint32Array(e.buffer)).times(t)}static add(e,t){return new r(new Uint32Array(e.buffer)).plus(t)}static from(e,t=new Uint32Array(4)){return r.fromString(typeof e=="string"?e:e.toString(),t)}static fromNumber(e,t=new Uint32Array(4)){return r.fromString(e.toString(),t)}static fromString(e,t=new Uint32Array(4)){let n=e.startsWith("-"),s=e.length,i=new r(t);for(let o=n?1:0;o<s;){let a=$o<s-o?$o:s-o,c=new r(new Uint32Array([Number.parseInt(e.slice(o,o+a),10),0,0,0])),u=new r(new Uint32Array([dp[a],0,0,0]));i.times(u),i.plus(c),o+=a}return n?i.negate():i}static convertArray(e){let t=new Uint32Array(e.length*4);for(let n=-1,s=e.length;++n<s;)r.from(e[n],new Uint32Array(t.buffer,t.byteOffset+16*n,4));return t}}});var wp={};J(wp,{toIntervalDayTimeInt32Array:()=>mp,toIntervalDayTimeObjects:()=>gp,toIntervalMonthDayNanoInt32Array:()=>bp,toIntervalMonthDayNanoObjects:()=>yp});function mp(r){var e,t;let n=r.length,s=new Int32Array(n*2);for(let i=0,o=0;i<n;i++){let a=r[i];s[o++]=(e=a.days)!==null&&e!==void 0?e:0,s[o++]=(t=a.milliseconds)!==null&&t!==void 0?t:0}return s}function bp(r){var e,t;let n=r.length,s=new Int32Array(n*4);for(let i=0,o=0;i<n;i++){let a=r[i];s[o++]=(e=a.months)!==null&&e!==void 0?e:0,s[o++]=(t=a.days)!==null&&t!==void 0?t:0;let c=a.nanoseconds;if(c){let u=BigInt(c);s[o++]=Number(u&BigInt(4294967295))>>>0,s[o++]=Number(u>>BigInt(32))>>>0}else o+=2}return s}function gp(r){let e=r.length,t=new Array(e/2);for(let n=0,s=0;n<e;n+=2)t[s++]={days:r[n],milliseconds:r[n+1]};return t}function yp(r,e){let t=r.length,n=new Array(t/4);for(let s=0,i=0;s<t;s+=4){let o=BigInt(r[s+3])<<BigInt(32)|BigInt(r[s+2]>>>0);n[i++]={months:r[s],days:r[s+1],nanoseconds:e?`${o}`:o}}return n}var Sl=p(()=>{});function A0(r){let e=new Uint8Array(r.length/2);for(let t=0;t<r.length;t+=2)e[t>>1]=Number.parseInt(r.slice(t,t+2),16);return e}function HO(r){return A0(r.join(""))}function v0(r,e){let t=new Uint8Array(r.length*16),n=new DataView(t.buffer);for(let[s,i]of r.entries()){let o=s*16,a=i.SIZE;if(n.setInt32(o,a,!0),i.INLINED!==void 0){let c=e(i.INLINED);for(let u=0;u<c.length&&u<12;u++)t[o+4+u]=c[u]}else{let c=i.PREFIX_HEX;for(let u=0;u<8&&u<c.length;u+=2)t[o+4+(u>>1)]=Number.parseInt(c.slice(u,u+2),16);n.setInt32(o+8,i.BUFFER_INDEX,!0),n.setInt32(o+12,i.OFFSET,!0)}}return t}function JO(r){return v0(r,e=>{let t=new Uint8Array(e.length/2);for(let n=0;n<e.length;n+=2)t[n>>1]=Number.parseInt(e.slice(n,n+2),16);return t})}function YO(r){return v0(r,e=>new TextEncoder().encode(e))}var qo,El,Ll,I0=p(()=>{wr();mt();we();Vt();gi();gn();pp();Me();Ke();Sl();qo=class extends R{constructor(e,t,n,s,i=ge.V5,o=[]){super(),this.nodesIndex=-1,this.buffersIndex=-1,this.variadicBufferIndex=-1,this.bytes=e,this.nodes=t,this.buffers=n,this.dictionaries=s,this.metadataVersion=i,this.variadicBufferCounts=o}visit(e){return super.visit(e instanceof O?e.type:e)}visitNull(e,{length:t}=this.nextFieldNode()){return D({type:e,length:t})}visitBool(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitInt(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitFloat(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitUtf8(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitLargeUtf8(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitUtf8View(e,{length:t,nullCount:n}=this.nextFieldNode()){let s=this.readNullBitmap(e,n),i=this.readData(e),o=this.readVariadicBuffers(this.nextVariadicBufferCount());return D({type:e,length:t,nullCount:n,nullBitmap:s,views:i,variadicBuffers:o})}visitBinary(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitLargeBinary(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),data:this.readData(e)})}visitBinaryView(e,{length:t,nullCount:n}=this.nextFieldNode()){let s=this.readNullBitmap(e,n),i=this.readData(e),o=this.readVariadicBuffers(this.nextVariadicBufferCount());return D({type:e,length:t,nullCount:n,nullBitmap:s,views:i,variadicBuffers:o})}visitFixedSizeBinary(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitDate(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitTimestamp(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitTime(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitDecimal(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitList(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),child:this.visit(e.children[0])})}visitLargeList(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),child:this.visit(e.children[0])})}visitStruct(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),children:this.visitMany(e.children)})}visitUnion(e,{length:t,nullCount:n}=this.nextFieldNode()){return this.metadataVersion<ge.V5&&this.readNullBitmap(e,n),e.mode===he.Sparse?this.visitSparseUnion(e,{length:t,nullCount:n}):this.visitDenseUnion(e,{length:t,nullCount:n})}visitDenseUnion(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({type:e,length:t,nullCount:n,typeIds:this.readTypeIds(e),valueOffsets:this.readOffsets(e),children:this.visitMany(e.children)})}visitSparseUnion(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({type:e,length:t,nullCount:n,typeIds:this.readTypeIds(e),children:this.visitMany(e.children)})}visitDictionary(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e.indices),dictionary:this.readDictionary(e)})}visitInterval(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitDuration(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),data:this.readData(e)})}visitFixedSizeList(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),child:this.visit(e.children[0])})}visitMap(e,{length:t,nullCount:n}=this.nextFieldNode()){return D({type:e,length:t,nullCount:n,nullBitmap:this.readNullBitmap(e,n),valueOffsets:this.readOffsets(e),child:this.visit(e.children[0])})}nextFieldNode(){return this.nodes[++this.nodesIndex]}nextBufferRange(){return this.buffers[++this.buffersIndex]}readNullBitmap(e,t,n=this.nextBufferRange()){return t>0&&this.readData(e,n)||new Uint8Array(0)}readOffsets(e,t){return this.readData(e,t)}readTypeIds(e,t){return this.readData(e,t)}readData(e,{length:t,offset:n}=this.nextBufferRange()){return this.bytes.subarray(n,n+t)}readVariadicBuffers(e){return Array.from({length:e},()=>this.readData(null))}nextVariadicBufferCount(){var e;return(e=this.variadicBufferCounts[++this.variadicBufferIndex])!==null&&e!==void 0?e:0}readDictionary(e){return this.dictionaries.get(e.id)}},El=class extends qo{constructor(e,t,n,s,i,o=[]){super(new Uint8Array(0),t,n,s,i,o),this.sources=e}readNullBitmap(e,t,{offset:n}=this.nextBufferRange()){return t<=0?new Uint8Array(0):bi(this.sources[n])}readOffsets(e,{offset:t}=this.nextBufferRange()){return ee(Uint8Array,ee(e.OffsetArrayType,this.sources[t]))}readTypeIds(e,{offset:t}=this.nextBufferRange()){return ee(Uint8Array,ee(e.ArrayType,this.sources[t]))}readData(e,{offset:t}=this.nextBufferRange()){let{sources:n}=this;if(E.isTimestamp(e))return ee(Uint8Array,En.convertArray(n[t]));if((E.isInt(e)||E.isTime(e))&&e.bitWidth===64||E.isDuration(e))return ee(Uint8Array,En.convertArray(n[t]));if(E.isDate(e)&&e.unit===ye.MILLISECOND)return ee(Uint8Array,En.convertArray(n[t]));if(E.isDecimal(e))return ee(Uint8Array,wc.convertArray(n[t]));if(E.isBinary(e)||E.isLargeBinary(e)||E.isFixedSizeBinary(e))return HO(n[t]);if(E.isBinaryView(e))return JO(n[t]);if(E.isUtf8View(e))return YO(n[t]);if(E.isBool(e))return bi(n[t]);if(E.isUtf8(e)||E.isLargeUtf8(e))return Jt(n[t].join(""));if(E.isInterval(e))switch(e.unit){case ae.DAY_TIME:return mp(n[t]);case ae.MONTH_DAY_NANO:return bp(n[t]);default:break}return ee(Uint8Array,ee(e.ArrayType,n[t].map(s=>+s)))}readVariadicBuffers(e){let t=[];for(let n=0;n<e;n++){let{offset:s}=this.nextBufferRange(),i=this.sources[s];t.push(A0(i))}return t}};Ll=class extends qo{constructor(e,t,n,s,i,o=[]){super(new Uint8Array(0),t,n,s,i,o),this.bodyChunks=e}readData(e,t=this.nextBufferRange()){return this.bodyChunks[this.buffersIndex]}}});var Ln,Bl=p(()=>{jr();Se();Ke();Ln=class extends pt{constructor(e){super(e),this._values=new jt(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,t){return super.setValue(e,k(t))}_flushPending(e,t){let n=this._offsets,s=this._values.reserve(t).buffer,i=0;for(let[o,a]of e)if(a===void 0)n.set(o,0);else{let c=a.length;s.set(a,i),n.set(o,c),i+=c}}}});var Bn,Fl=p(()=>{Ke();jr();Se();Bn=class extends pt{constructor(e){super(e),this._values=new jt(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,t){return super.setValue(e,k(t))}_flushPending(e,t){let n=this._offsets,s=this._values.reserve(t).buffer,i=0;for(let[o,a]of e)if(a===void 0)n.set(o,BigInt(0));else{let c=a.length;s.set(a,i),n.set(o,BigInt(c)),i+=c}}}});var _i,xp=p(()=>{jr();Se();_i=class extends Te{constructor(e){super(e),this._values=new zo}setValue(e,t){this._values.set(e,+t)}}});var nn,Is,Ss,Tp=p(()=>{Se();ar();nn=class extends We{};nn.prototype._setValue=jh;Is=class extends nn{};Is.prototype._setValue=$u;Ss=class extends nn{};Ss.prototype._setValue=qu});var Es,_p=p(()=>{Se();ar();Es=class extends We{};Es.prototype._setValue=Wh});var Ai,Ap=p(()=>{we();Se();xc();Ai=class extends Te{constructor({type:e,nullValues:t,dictionaryHashFunction:n}){super({type:new Ge(e.dictionary,e.indices,e.id,e.isOrdered)}),this._nulls=null,this._dictionaryOffset=0,this._keysToIndices=Object.create(null),this.indices=zr({type:this.type.indices,nullValues:t}),this.dictionary=zr({type:this.type.dictionary,nullValues:null}),typeof n=="function"&&(this.valueToKey=n)}get values(){return this.indices.values}get nullCount(){return this.indices.nullCount}get nullBitmap(){return this.indices.nullBitmap}get byteLength(){return this.indices.byteLength+this.dictionary.byteLength}get reservedLength(){return this.indices.reservedLength+this.dictionary.reservedLength}get reservedByteLength(){return this.indices.reservedByteLength+this.dictionary.reservedByteLength}isValid(e){return this.indices.isValid(e)}setValid(e,t){let n=this.indices;return t=n.setValid(e,t),this.length=n.length,t}setValue(e,t){let n=this._keysToIndices,s=this.valueToKey(t),i=n[s];return i===void 0&&(n[s]=i=this._dictionaryOffset+this.dictionary.append(t).length-1),this.indices.setValue(e,i)}flush(){let e=this.type,t=this._dictionary,n=this.dictionary.toVector(),s=this.indices.flush().clone(e);return s.dictionary=t?t.concat(n):n,this.finished||(this._dictionaryOffset+=n.length),this._dictionary=s.dictionary,this.clear(),s}finish(){return this.indices.finish(),this.dictionary.finish(),this._dictionaryOffset=0,this._keysToIndices=Object.create(null),super.finish()}clear(){return this.indices.clear(),this.dictionary.clear(),super.clear()}valueToKey(e){return typeof e=="string"?e:`${e}`}}});var Ls,vp=p(()=>{Se();ar();Ls=class extends We{};Ls.prototype._setValue=Vh});var vi,Ip=p(()=>{mt();Se();we();vi=class extends Te{setValue(e,t){let[n]=this.children,s=e*this.stride;for(let i=-1,o=this.stride;++i<o;)n.set(s+i,t[i])}setValid(e,t){return super.setValid(e,t)||this.children[0].setValid((e+1)*this.stride-1,!1),t}addChild(e,t="0"){if(this.numChildren>0)throw new Error("FixedSizeListBuilder can only have one child.");let n=this.children.push(e);return this.type=new Be(this.type.listSize,new O(t,e.type,!0)),n}}});var sn,Ii,Si,Ei,Sp=p(()=>{uc();Se();sn=class extends We{setValue(e,t){this._values.set(e,t)}},Ii=class extends sn{setValue(e,t){super.setValue(e,cc(t))}},Si=class extends sn{},Ei=class extends sn{}});var Wr,Bs,Fs,Os,Ep=p(()=>{Se();ar();Wr=class extends We{};Wr.prototype._setValue=$h;Bs=class extends Wr{};Bs.prototype._setValue=tl;Fs=class extends Wr{};Fs.prototype._setValue=rl;Os=class extends Wr{};Os.prototype._setValue=nl});var Ar,Ms,Ds,Rs,ks,Lp=p(()=>{Se();ar();Ar=class extends We{};Ar.prototype._setValue=qh;Ms=class extends Ar{};Ms.prototype._setValue=sl;Ds=class extends Ar{};Ds.prototype._setValue=il;Rs=class extends Ar{};Rs.prototype._setValue=ol;ks=class extends Ar{};ks.prototype._setValue=al});var Ft,Li,Bi,Fi,Oi,Mi,Di,Ri,ki,Bp=p(()=>{Se();Ft=class extends We{setValue(e,t){this._values.set(e,t)}},Li=class extends Ft{},Bi=class extends Ft{},Fi=class extends Ft{},Oi=class extends Ft{},Mi=class extends Ft{},Di=class extends Ft{},Ri=class extends Ft{},ki=class extends Ft{}});var Ni,Fp=p(()=>{mt();we();jr();Se();Ni=class extends pt{constructor(e){super(e),this._offsets=new Ts(e.type)}addChild(e,t="0"){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new je(new O(t,e.type,!0)),this.numChildren-1}_flushPending(e){let t=this._offsets,[n]=this.children;for(let[s,i]of e)if(typeof i>"u")t.set(s,0);else{let o=i,a=o.length,c=t.set(s,a).buffer[s];for(let u=-1;++u<a;)n.set(c+u,o[u])}}}});var Ci,Op=p(()=>{mt();we();jr();Qr();Se();Ci=class extends pt{constructor(e){super(e),this._offsets=new Ts(e.type)}addChild(e,t="0"){if(this.numChildren>0)throw new Error("LargeListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new ir(new O(t,e.type,!0)),this.numChildren-1}_flushPending(e){let t=this._offsets,[n]=this.children;for(let[s,i]of e)if(typeof i>"u")t.set(s,BigInt(0));else{let o=i,a=o.length,c=te(t.set(s,BigInt(a)).buffer[s]);for(let u=-1;++u<a;)n.set(c+u,o[u])}}}});var Ui,Mp=p(()=>{mt();we();Se();Ui=class extends pt{set(e,t){return super.set(e,t)}setValue(e,t){let n=t instanceof Map?t:new Map(Object.entries(t)),s=this._pending||(this._pending=new Map),i=s.get(e);i&&(this._pendingLength-=i.size),this._pendingLength+=n.size,s.set(e,n)}addChild(e,t=`${this.numChildren}`){if(this.numChildren>0)throw new Error("ListBuilder can only have one child.");return this.children[this.numChildren]=e,this.type=new dt(new O(t,e.type,!0),this.type.keysSorted),this.numChildren-1}_flushPending(e){let t=this._offsets,[n]=this.children;for(let[s,i]of e)if(i===void 0)t.set(s,0);else{let{[s]:o,[s+1]:a}=t.set(s,i.size).buffer;for(let c of i.entries())if(n.set(o,c),++o>=a)break}}}});var Pi,Dp=p(()=>{Se();Pi=class extends Te{setValue(e,t){}setValid(e,t){return this.length=Math.max(e+1,this.length),t}}});var Vi,Rp=p(()=>{mt();Se();we();Vi=class extends Te{setValue(e,t){let{children:n,type:s}=this;switch(Array.isArray(t)||t.constructor){case!0:return s.children.forEach((i,o)=>n[o].set(e,t[o]));case Map:return s.children.forEach((i,o)=>n[o].set(e,t.get(i.name)));default:return s.children.forEach((i,o)=>n[o].set(e,t[i.name]))}}setValid(e,t){return super.setValid(e,t)||this.children.forEach(n=>n.setValid(e,t)),t}addChild(e,t=`${this.numChildren}`){let n=this.children.push(e);return this.type=new pe([...this.type.children,new O(t,e.type,!0)]),n}}});var vr,Ns,Cs,Us,Ps,kp=p(()=>{Se();ar();vr=class extends We{};vr.prototype._setValue=Gh;Ns=class extends vr{};Ns.prototype._setValue=Ku;Cs=class extends vr{};Cs.prototype._setValue=Xu;Us=class extends vr{};Us.prototype._setValue=Hu;Ps=class extends vr{};Ps.prototype._setValue=Ju});var Ir,Vs,js,Gs,zs,Np=p(()=>{Se();ar();Ir=class extends We{};Ir.prototype._setValue=zh;Vs=class extends Ir{};Vs.prototype._setValue=Yu;js=class extends Ir{};js.prototype._setValue=Qu;Gs=class extends Ir{};Gs.prototype._setValue=Zu;zs=class extends Ir{};zs.prototype._setValue=el});var Fn,ji,Gi,Cp=p(()=>{mt();jr();Se();we();Fn=class extends Te{constructor(e){super(e),this._typeIds=new vn(Int8Array,0,1),typeof e.valueToChildTypeId=="function"&&(this._valueToChildTypeId=e.valueToChildTypeId)}get typeIdToChildIndex(){return this.type.typeIdToChildIndex}append(e,t){return this.set(this.length,e,t)}set(e,t,n){return n===void 0&&(n=this._valueToChildTypeId(this,t,e)),this.setValue(e,t,n),this}setValue(e,t,n){this._typeIds.set(e,n);let s=this.type.typeIdToChildIndex[n],i=this.children[s];i?.set(e,t),this.length=Math.max(e+1,this.length)}addChild(e,t=`${this.children.length}`){let n=this.children.push(e),{type:{children:s,mode:i,typeIds:o}}=this,a=[...s,new O(t,e.type)];return this.type=new Bt(i,[...o,n],a),n}_valueToChildTypeId(e,t,n){throw new Error("Cannot map UnionBuilder value to child typeId. Pass the `childTypeId` as the second argument to unionBuilder.append(), or supply a `valueToChildTypeId` function as part of the UnionBuilder constructor options.")}},ji=class extends Fn{},Gi=class extends Fn{constructor(e){super(e),this._offsets=new vn(Int32Array)}setValue(e,t,n){let s=this._typeIds.set(e,n).buffer[e],i=this.getChildAt(this.type.typeIdToChildIndex[s]),o=this._offsets.set(e,i.length).buffer[e];i?.set(o,t),this.length=Math.max(e+1,this.length)}}});var Ws,Up=p(()=>{gn();Bl();jr();Se();Ws=class extends pt{constructor(e){super(e),this._values=new jt(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,t){return super.setValue(e,Jt(t))}_flushPending(e,t){}};Ws.prototype._flushPending=Ln.prototype._flushPending});var $s,Pp=p(()=>{gn();jr();Se();Fl();$s=class extends pt{constructor(e){super(e),this._values=new jt(Uint8Array)}get byteLength(){let e=this._pendingLength+this.length*4;return this._offsets&&(e+=this._offsets.byteLength),this._values&&(e+=this._values.byteLength),this._nulls&&(e+=this._nulls.byteLength),e}setValue(e,t){return super.setValue(e,Jt(t))}_flushPending(e,t){}};$s.prototype._flushPending=Bn.prototype._flushPending});var On,Ol=p(()=>{we();Se();jr();Ke();wr();On=class extends Te{constructor(e){super(e),this._variadicBuffers=[],this._currentBuffer=null,this._currentBufferIndex=0,this._currentBufferOffset=0,this._bufferSize=32*1024*1024,this._views=new jt(Uint8Array)}get byteLength(){let e=0;this._views&&(e+=this._views.byteLength),this._nulls&&(e+=this._nulls.byteLength);for(let t of this._variadicBuffers)e+=t.byteLength;return this._currentBuffer&&(e+=this._currentBuffer.byteLength),e}setValue(e,t){return this.writeBinaryValue(e,this.encodeValue(t))}writeBinaryValue(e,t){let n=t.length,s=(e+1)*Z.ELEMENT_WIDTH,i=this._views.length;s>i&&this._views.reserve(s-i);let o=this._views.buffer,a=e*Z.ELEMENT_WIDTH,c=new DataView(o.buffer,o.byteOffset+a,Z.ELEMENT_WIDTH);if(c.setInt32(Z.LENGTH_OFFSET,n,!0),n<=Z.INLINE_CAPACITY){o.set(t,a+Z.INLINE_OFFSET);for(let u=n;u<Z.INLINE_CAPACITY;u++)o[a+Z.INLINE_OFFSET+u]=0}else{let u=new DataView(t.buffer,t.byteOffset,Math.min(4,n));c.setUint32(Z.INLINE_OFFSET,u.getUint32(0,!0),!0),(!this._currentBuffer||this._currentBufferOffset+n>this._bufferSize)&&(this._currentBuffer&&this._variadicBuffers.push(this._currentBuffer.buffer.slice(0,this._currentBufferOffset)),this._currentBuffer=new jt(Uint8Array),this._currentBufferIndex=this._variadicBuffers.length,this._currentBufferOffset=0),this._currentBuffer.reserve(n).buffer.set(t,this._currentBufferOffset),c.setInt32(Z.BUFFER_INDEX_OFFSET,this._currentBufferIndex,!0),c.setInt32(Z.BUFFER_OFFSET_OFFSET,this._currentBufferOffset,!0),this._currentBufferOffset+=n}return this}encodeValue(e){return k(e)}setValid(e,t){let n=(e+1)*Z.ELEMENT_WIDTH,s=this._views.length;n>s&&this._views.reserve(n-s);let i=super.setValid(e,t);if(!i){let o=this._views.buffer,a=e*Z.ELEMENT_WIDTH;for(let c=0;c<Z.ELEMENT_WIDTH;c++)o[a+c]=0}return i}clear(){return this._variadicBuffers=[],this._currentBuffer=null,this._currentBufferIndex=0,this._currentBufferOffset=0,this._views.clear(),super.clear()}flush(){let{type:e,length:t,nullCount:n,_views:s,_nulls:i}=this;this._currentBuffer&&this._currentBufferOffset>0&&(this._variadicBuffers.push(this._currentBuffer.buffer.slice(0,this._currentBufferOffset)),this._currentBuffer=null,this._currentBufferOffset=0);let o=s.flush(t*Z.ELEMENT_WIDTH),a=n>0?i.flush(t):void 0,c=this._variadicBuffers.slice();return this._variadicBuffers=[],this._currentBufferIndex=0,this.clear(),D({type:e,length:t,nullCount:n,nullBitmap:a,views:o,variadicBuffers:c})}finish(){return this.finished=!0,this}}});var zi,Vp=p(()=>{Ol();gn();zi=class extends On{constructor(e){super(e)}setValue(e,t){return this.writeBinaryValue(e,Jt(t))}}});var jp,S0,E0=p(()=>{Vt();Bl();Fl();xp();Tp();_p();Ap();vp();Ip();Sp();Ep();Lp();Bp();Fp();Op();Mp();Dp();Rp();kp();Np();Cp();Up();Pp();Ol();Vp();jp=class extends R{visitNull(){return Pi}visitBool(){return _i}visitInt(){return Ft}visitInt8(){return Li}visitInt16(){return Bi}visitInt32(){return Fi}visitInt64(){return Oi}visitUint8(){return Mi}visitUint16(){return Di}visitUint32(){return Ri}visitUint64(){return ki}visitFloat(){return sn}visitFloat16(){return Ii}visitFloat32(){return Si}visitFloat64(){return Ei}visitUtf8(){return Ws}visitLargeUtf8(){return $s}visitBinary(){return Ln}visitLargeBinary(){return Bn}visitFixedSizeBinary(){return Ls}visitDate(){return nn}visitDateDay(){return Is}visitDateMillisecond(){return Ss}visitTimestamp(){return vr}visitTimestampSecond(){return Ns}visitTimestampMillisecond(){return Cs}visitTimestampMicrosecond(){return Us}visitTimestampNanosecond(){return Ps}visitTime(){return Ir}visitTimeSecond(){return Vs}visitTimeMillisecond(){return js}visitTimeMicrosecond(){return Gs}visitTimeNanosecond(){return zs}visitDecimal(){return Es}visitList(){return Ni}visitLargeList(){return Ci}visitStruct(){return Vi}visitUnion(){return Fn}visitDenseUnion(){return Gi}visitSparseUnion(){return ji}visitDictionary(){return Ai}visitInterval(){return Wr}visitIntervalDayTime(){return Bs}visitIntervalYearMonth(){return Fs}visitIntervalMonthDayNano(){return Os}visitDuration(){return Ar}visitDurationSecond(){return Ms}visitDurationMillisecond(){return Ds}visitDurationMicrosecond(){return Rs}visitDurationNanosecond(){return ks}visitFixedSizeList(){return vi}visitMap(){return Ui}visitBinaryView(){return On}visitUtf8View(){return zi}},S0=new jp});function Ot(r,e){return e instanceof r.constructor}function Mn(r,e){return r===e||Ot(r,e)}function Dn(r,e){return r===e||Ot(r,e)&&r.bitWidth===e.bitWidth&&r.isSigned===e.isSigned}function Ml(r,e){return r===e||Ot(r,e)&&r.precision===e.precision}function QO(r,e){return r===e||Ot(r,e)&&r.byteWidth===e.byteWidth}function Gp(r,e){return r===e||Ot(r,e)&&r.unit===e.unit}function Tc(r,e){return r===e||Ot(r,e)&&r.unit===e.unit&&r.timezone===e.timezone}function _c(r,e){return r===e||Ot(r,e)&&r.unit===e.unit&&r.bitWidth===e.bitWidth}function L0(r,e){return r===e||Ot(r,e)&&r.children.length===e.children.length&&on.compareManyFields(r.children,e.children)}function ZO(r,e){return r===e||Ot(r,e)&&r.children.length===e.children.length&&on.compareManyFields(r.children,e.children)}function zp(r,e){return r===e||Ot(r,e)&&r.mode===e.mode&&r.typeIds.every((t,n)=>t===e.typeIds[n])&&on.compareManyFields(r.children,e.children)}function eM(r,e){return r===e||Ot(r,e)&&r.id===e.id&&r.isOrdered===e.isOrdered&&on.visit(r.indices,e.indices)&&on.visit(r.dictionary,e.dictionary)}function Dl(r,e){return r===e||Ot(r,e)&&r.unit===e.unit}function Ac(r,e){return r===e||Ot(r,e)&&r.unit===e.unit}function tM(r,e){return r===e||Ot(r,e)&&r.listSize===e.listSize&&r.children.length===e.children.length&&on.compareManyFields(r.children,e.children)}function rM(r,e){return r===e||Ot(r,e)&&r.keysSorted===e.keysSorted&&r.children.length===e.children.length&&on.compareManyFields(r.children,e.children)}function Wi(r,e){return on.compareSchemas(r,e)}function B0(r,e){return on.compareFields(r,e)}function Rl(r,e){return on.visit(r,e)}var V,on,vc=p(()=>{Vt();V=class extends R{compareSchemas(e,t){return e===t||t instanceof e.constructor&&this.compareManyFields(e.fields,t.fields)}compareManyFields(e,t){return e===t||Array.isArray(e)&&Array.isArray(t)&&e.length===t.length&&e.every((n,s)=>this.compareFields(n,t[s]))}compareFields(e,t){return e===t||t instanceof e.constructor&&e.name===t.name&&e.nullable===t.nullable&&this.visit(e.type,t.type)}};V.prototype.visitNull=Mn;V.prototype.visitBool=Mn;V.prototype.visitInt=Dn;V.prototype.visitInt8=Dn;V.prototype.visitInt16=Dn;V.prototype.visitInt32=Dn;V.prototype.visitInt64=Dn;V.prototype.visitUint8=Dn;V.prototype.visitUint16=Dn;V.prototype.visitUint32=Dn;V.prototype.visitUint64=Dn;V.prototype.visitFloat=Ml;V.prototype.visitFloat16=Ml;V.prototype.visitFloat32=Ml;V.prototype.visitFloat64=Ml;V.prototype.visitUtf8=Mn;V.prototype.visitLargeUtf8=Mn;V.prototype.visitUtf8View=Mn;V.prototype.visitBinary=Mn;V.prototype.visitLargeBinary=Mn;V.prototype.visitBinaryView=Mn;V.prototype.visitFixedSizeBinary=QO;V.prototype.visitDate=Gp;V.prototype.visitDateDay=Gp;V.prototype.visitDateMillisecond=Gp;V.prototype.visitTimestamp=Tc;V.prototype.visitTimestampSecond=Tc;V.prototype.visitTimestampMillisecond=Tc;V.prototype.visitTimestampMicrosecond=Tc;V.prototype.visitTimestampNanosecond=Tc;V.prototype.visitTime=_c;V.prototype.visitTimeSecond=_c;V.prototype.visitTimeMillisecond=_c;V.prototype.visitTimeMicrosecond=_c;V.prototype.visitTimeNanosecond=_c;V.prototype.visitDecimal=Mn;V.prototype.visitList=L0;V.prototype.visitLargeList=L0;V.prototype.visitStruct=ZO;V.prototype.visitUnion=zp;V.prototype.visitDenseUnion=zp;V.prototype.visitSparseUnion=zp;V.prototype.visitDictionary=eM;V.prototype.visitInterval=Dl;V.prototype.visitIntervalDayTime=Dl;V.prototype.visitIntervalYearMonth=Dl;V.prototype.visitIntervalMonthDayNano=Dl;V.prototype.visitDuration=Ac;V.prototype.visitDurationSecond=Ac;V.prototype.visitDurationMillisecond=Ac;V.prototype.visitDurationMicrosecond=Ac;V.prototype.visitDurationNanosecond=Ac;V.prototype.visitFixedSizeList=tM;V.prototype.visitMap=rM;on=new V});function zr(r){let e=r.type,t=new(S0.getVisitFn(e)())(r);if(e.children&&e.children.length>0){let n=r.children||[],s={nullValues:r.nullValues},i=Array.isArray(n)?((o,a)=>n[a]||s):(({name:o})=>n[o]||s);for(let[o,a]of e.children.entries()){let{type:c}=a,u=i(a,o);t.children.push(zr(Object.assign(Object.assign({},u),{type:c})))}}return t}function Ko(r,e){if(r instanceof G||r instanceof B||r.type instanceof E||ArrayBuffer.isView(r))return rn(r);let t={type:e??kl(r),nullValues:[null]},n=[...Nl(t)(r)],s=n.length===1?n[0]:n.reduce((i,o)=>i.concat(o));return E.isDictionary(s.type)?s.memoize():s}function Wp(r){let e=Ko(r),t=new de(new Q(e.type.children),e.data[0]);return new me(t)}function kl(r){if(r.length===0)return new Ne;let e=0,t=0,n=0,s=0,i=0,o=0,a=0,c=0;for(let u of r){if(u==null){++e;continue}switch(typeof u){case"bigint":++o;continue;case"boolean":++a;continue;case"number":++s;continue;case"string":++i;continue;case"object":Array.isArray(u)?++t:Object.prototype.toString.call(u)==="[object Date]"?++c:++n;continue}throw new TypeError("Unable to infer Vector type from input values, explicit type declaration expected.")}if(s+e===r.length)return new sr;if(i+e===r.length)return new Ge(new ut,new Pe);if(o+e===r.length)return new tr;if(a+e===r.length)return new lt;if(c+e===r.length)return new Zr;if(t+e===r.length){let u=r,l=kl(u[u.findIndex(f=>f!=null)]);if(u.every(f=>f==null||Rl(l,kl(f))))return new je(new O("",l,!0))}else if(n+e===r.length){let u=new Map;for(let l of r)for(let f of Object.keys(l))!u.has(f)&&l[f]!=null&&u.set(f,new O(f,kl([l[f]]),!0));return new pe([...u.values()])}throw new TypeError("Unable to infer Vector type from input values, explicit type declaration expected.")}function Nl(r){let{["queueingStrategy"]:e="count"}=r,{["highWaterMark"]:t=e!=="bytes"?Number.POSITIVE_INFINITY:Math.pow(2,14)}=r,n=e!=="bytes"?"length":"byteLength";return function*(s){let i=0,o=zr(r);for(let a of s)o.append(a)[n]>=t&&++i&&(yield o.toVector());(o.finish().length>0||i===0)&&(yield o.toVector())}}function $p(r){let{["queueingStrategy"]:e="count"}=r,{["highWaterMark"]:t=e!=="bytes"?Number.POSITIVE_INFINITY:Math.pow(2,14)}=r,n=e!=="bytes"?"length":"byteLength";return function(s){return _t(this,arguments,function*(){var i,o,a,c;let u=0,l=zr(r);try{for(var f=!0,d=Ht(s),h;h=yield Y(d.next()),i=h.done,!i;f=!0){c=h.value,f=!1;let m=c;l.append(m)[n]>=t&&++u&&(yield yield Y(l.toVector()))}}catch(m){o={error:m}}finally{try{!f&&!i&&(a=d.return)&&(yield Y(a.call(d)))}finally{if(o)throw o.error}}(l.finish().length>0||u===0)&&(yield yield Y(l.toVector()))})}}var xc=p(()=>{kt();mt();we();wr();ht();E0();$i();Rn();vc()});function Cl(r,e){return nM(r,e.map(t=>t.data.concat()))}function nM(r,e){let t=[...r.fields],n=[],s={numBatches:e.reduce((f,d)=>Math.max(f,d.length),0)},i=0,o=0,a=-1,c=e.length,u,l=[];for(;s.numBatches-- >0;){for(o=Number.POSITIVE_INFINITY,a=-1;++a<c;)l[a]=u=e[a].shift(),o=Math.min(o,u?u.length:o);Number.isFinite(o)&&(l=sM(t,o,l,e,s),o>0&&(n[i++]=D({type:new pe(t),length:o,nullCount:0,children:l.slice()})))}return[r=r.assign(t),n.map(f=>new de(r,f))]}function sM(r,e,t,n,s){var i;let o=(e+63&-64)>>3;for(let a=-1,c=n.length;++a<c;){let u=t[a],l=u?.length;if(l>=e)l===e?t[a]=u:(t[a]=u.slice(0,e),s.numBatches=Math.max(s.numBatches,n[a].unshift(u.slice(e,l-e))));else{let f=r[a];r[a]=f.clone({nullable:!0}),t[a]=(i=u?._changeLengthAndBackfillNullBitmap(e))!==null&&i!==void 0?i:D({type:f.type,length:e,nullCount:e,nullBitmap:new Uint8Array(o)})}}return t}var F0=p(()=>{wr();we();Rn()});function qp(r){let e={},t=Object.entries(r);for(let[n,s]of t)e[n]=rn(s);return new me(e)}function Kp(r){let e={},t=Object.entries(r);for(let[n,s]of t)e[n]=Ko(s);return new me(e)}var O0,M0,me,$i=p(()=>{Me();wr();xc();ht();mt();we();vc();F0();gl();hi();ar();yl();wl();Po();Rn();M0=Symbol.for("apache-arrow/Table"),me=class r{static isTable(e){return e?.[M0]===!0}constructor(...e){var t,n;if(e.length===0)return this.batches=[],this.schema=new Q([]),this._offsets=[0],this;let s,i;e[0]instanceof Q&&(s=e.shift()),e.at(-1)instanceof Uint32Array&&(i=e.pop());let o=c=>{if(c){if(c instanceof de)return[c];if(c instanceof r)return c.batches;if(c instanceof G){if(c.type instanceof pe)return[new de(new Q(c.type.children),c)]}else{if(Array.isArray(c))return c.flatMap(u=>o(u));if(typeof c[Symbol.iterator]=="function")return[...c].flatMap(u=>o(u));if(typeof c=="object"){let u=Object.keys(c),l=u.map(h=>new B([c[h]])),f=s??new Q(u.map((h,m)=>new O(String(h),l[m].type,l[m].nullable))),[,d]=Cl(f,l);return d.length===0?[new de(c)]:d}}}return[]},a=e.flatMap(c=>o(c));if(s=(n=s??((t=a[0])===null||t===void 0?void 0:t.schema))!==null&&n!==void 0?n:new Q([]),!(s instanceof Q))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");for(let c of a){if(!(c instanceof de))throw new TypeError("Table constructor expects a [Schema, RecordBatch[]] pair.");if(!Wi(s,c.schema))throw new TypeError("Table and inner RecordBatch schemas must be equivalent.")}this.schema=s,this.batches=a,this._offsets=i??hl(this.data)}get data(){return this.batches.map(({data:e})=>e)}get numCols(){return this.schema.fields.length}get numRows(){return this.data.reduce((e,t)=>e+t.length,0)}get nullCount(){return this._nullCount===-1&&(this._nullCount=dl(this.data)),this._nullCount}isValid(e){return!1}get(e){return null}at(e){return this.get(pi(e,this.numRows))}set(e,t){}indexOf(e,t){return-1}[Symbol.iterator](){return this.batches.length>0?Go.visit(new B(this.data)):new Array(0)[Symbol.iterator]()}toArray(){return[...this]}toString(){return`[
|
|
19
19
|
${this.toArray().join(`,
|
|
20
20
|
`)}
|
|
21
|
-
]`}concat(...e){let t=this.schema,n=this.data.concat(e.flatMap(({data:s})=>s));return new r(t,n.map(s=>new le(t,s)))}slice(e,t){let n=this.schema;[e,t]=ac({length:this.numRows},e,t);let s=of(this.data,this._offsets,e,t);return new r(n,s.map(i=>new le(n,i)))}getChild(e){return this.getChildAt(this.schema.fields.findIndex(t=>t.name===e))}getChildAt(e){if(e>-1&&e<this.schema.fields.length){let t=this.data.map(n=>n.children[e]);if(t.length===0){let{type:n}=this.schema.fields[e],s=M({type:n,length:0,nullCount:0});t.push(s._changeLengthAndBackfillNullBitmap(this.numRows))}return new L(t)}return null}setChild(e,t){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(s=>s.name===e),t)}setChildAt(e,t){let n=this.schema,s=[...this.batches];if(e>-1&&e<this.numCols){t||(t=new L([M({type:new De,length:this.numRows})]));let i=n.fields.slice(),o=i[e].clone({type:t.type}),a=this.schema.fields.map((c,u)=>this.getChildAt(u));[i[e],a[e]]=[o,t],[n,s]=Bf(n,a)}return new r(n,s)}select(e){let t=this.schema.fields.reduce((n,s,i)=>n.set(s.name,i),new Map);return this.selectAt(e.map(n=>t.get(n)).filter(n=>n>-1))}selectAt(e){let t=this.schema.selectAt(e),n=this.batches.map(s=>s.selectAt(e));return new r(t,n)}assign(e){let t=this.schema.fields,[n,s]=e.schema.fields.reduce((a,c,u)=>{let[f,l]=a,d=t.findIndex(h=>h.name===c.name);return~d?l[d]=u:f.push(u),a},[[],[]]),i=this.schema.assign(e.schema),o=[...t.map((a,c)=>[c,s[c]]).map(([a,c])=>c===void 0?this.getChildAt(a):e.getChildAt(c)),...n.map(a=>e.getChildAt(a))].filter(Boolean);return new r(...Bf(i,o))}};JT=Symbol.toStringTag;be[JT]=(r=>(r.schema=null,r.batches=[],r._offsets=new Uint32Array([0]),r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,r[YT]=!0,r.isValid=ko(fc),r.get=ko(je.getVisitFn(y.Struct)),r.set=af(tt.getVisitFn(y.Struct)),r.indexOf=cf(hi.getVisitFn(y.Struct)),"Table"))(be.prototype);Object.defineProperty(be,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===be&&be.isTable(e)}})});function QT(r,e,t=e.reduce((n,s)=>Math.max(n,s.length),0)){var n;let s=[...r.fields],i=[...e],o=(t+63&-64)>>3;for(let[a,c]of r.fields.entries()){let u=e[a];(!u||u.length!==t)&&(s[a]=c.clone({nullable:!0}),i[a]=(n=u?._changeLengthAndBackfillNullBitmap(t))!==null&&n!==void 0?n:M({type:c.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)}))}return[r.assign(s),M({type:new he(s),length:t,children:i})]}function t0(r,e,t=new Map){var n,s;if(((n=r?.length)!==null&&n!==void 0?n:0)>0&&r?.length===e?.length)for(let i=-1,o=r.length;++i<o;){let{type:a}=r[i],c=e[i];for(let u of[c,...((s=c?.dictionary)===null||s===void 0?void 0:s.data)||[]])t0(a.children,u?.children,t);if(S.isDictionary(a)){let{id:u}=a;if(!t.has(u))c?.dictionary&&t.set(u,c.dictionary);else if(t.get(u)!==c.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}}return t}var ZT,e0,le,ji,Bn=p(()=>{br();Pi();lt();ht();ye();Do();ci();nr();ff();lf();e0=Symbol.for("apache-arrow/RecordBatch"),le=class r{static isRecordBatch(e){return e?.[e0]===!0}constructor(...e){switch(e.length){case 3:case 2:{if([this.schema]=e,!(this.schema instanceof Y))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=M({nullCount:0,type:new he(this.schema.fields),children:this.schema.fields.map(t=>M({type:t.type,nullCount:0}))}),this._metadata=new Map]=e,!(this.data instanceof k))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=QT(this.schema,this.data.children,this.data.length);break}case 1:{let[t]=e,{fields:n,children:s,length:i}=Object.keys(t).reduce((c,u,f)=>(c.children[f]=t[u],c.length=Math.max(c.length,t[u].length),c.fields[f]=F.new({name:u,type:t[u].type,nullable:!0}),c),{length:0,fields:new Array,children:new Array}),o=new Y(n),a=M({type:new he(n),length:i,children:s,nullCount:0});[this.schema,this.data]=QT(o,a.children,i),this._metadata=new Map;break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get metadata(){return this._metadata}get dictionaries(){return this._dictionaries||(this._dictionaries=t0(this.schema.fields,this.data.children))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(e){return this.data.getValid(e)}get(e){return je.visit(this.data,e)}at(e){return this.get(ui(e,this.numRows))}set(e,t){return tt.visit(this.data,e,t)}indexOf(e,t){return hi.visit(this.data,e,t)}[Symbol.iterator](){return Co.visit(new L([this.data]))}toArray(){return[...this]}concat(...e){return new be(this.schema,[this,...e])}slice(e,t){let[n]=new L([this.data]).slice(e,t).data;return new r(this.schema,n,this._metadata)}getChild(e){var t;return this.getChildAt((t=this.schema.fields)===null||t===void 0?void 0:t.findIndex(n=>n.name===e))}getChildAt(e){return e>-1&&e<this.schema.fields.length?new L([this.data.children[e]]):null}setChild(e,t){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(s=>s.name===e),t)}setChildAt(e,t){let n=this.schema,s=this.data;if(e>-1&&e<this.numCols){t||(t=new L([M({type:new De,length:this.numRows})]));let i=n.fields.slice(),o=s.children.slice(),a=i[e].clone({type:t.type});[i[e],o[e]]=[a,t.data[0]],n=new Y(i,new Map(this.schema.metadata)),s=M({type:new he(i),length:s.length,children:o})}return new r(n,s,this._metadata)}select(e){let t=this.schema.select(e),n=new he(t.fields),s=[];for(let i of e){let o=this.schema.fields.findIndex(a=>a.name===i);~o&&(s[o]=this.data.children[o])}return new r(t,M({type:n,length:this.numRows,children:s}),this._metadata)}selectAt(e){let t=this.schema.selectAt(e),n=e.map(i=>this.data.children[i]).filter(Boolean),s=M({type:new he(t.fields),length:this.numRows,children:n});return new r(t,s,this._metadata)}};ZT=Symbol.toStringTag;le[ZT]=(r=>(r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,r[e0]=!0,"RecordBatch"))(le.prototype);Object.defineProperty(le,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===le&&le.isRecordBatch(e)}});ji=class extends le{constructor(e,t){let n=e.fields.map(i=>M({type:i.type})),s=M({type:new he(e.fields),length:0,nullCount:0,children:n});super(e,s,t||new Map)}}});function Of(r,e=0){for(let t=-1,n=zo.length;++t<n;)if(zo[t]!==r[e+t])return!1;return!0}var Fp,Op,r0,n0,js,Gi,zi,Ff,Bp,zo,Wo,Mp,s0,Mf=p(()=>{Ft();Fe();ae();gs();qn();qh();$e();ys();dc();Fp=r=>`Expected ${ne[r]} Message in stream, but was null or length 0.`,Op=r=>`Header pointer of flatbuffer-encoded ${ne[r]} Message is null or length 0.`,r0=(r,e)=>`Expected to read ${r} metadata bytes, but only read ${e}.`,n0=(r,e)=>`Expected to read ${r} bytes for message body, but only read ${e}.`,js=class{constructor(e){this.source=e instanceof wr?e:new wr(e)}[Symbol.iterator](){return this}next(){let e;return(e=this.readMetadataLength()).done?Ie:e.value===-1&&(e=this.readMetadataLength()).done?Ie:(e=this.readMetadata(e.value)).done?Ie:e}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(Fp(e));return t.value}readMessageBody(e){if(e<=0)return new Uint8Array(0);let t=D(this.source.read(e));if(t.byteLength<e)throw new Error(n0(e,t.byteLength));return t.byteOffset%8===0&&t.byteOffset+t.byteLength<=t.buffer.byteLength?t:t.slice()}readSchema(e=!1){let t=ne.Schema,n=this.readMessage(t),s=n?.header();if(e&&!s)throw new Error(Op(t));return s}readMetadataLength(){let e=this.source.read(Ff),t=e&&new Ye(e),n=t?.readInt32(0)||0;return{done:n===0,value:n}}readMetadata(e){let t=this.source.read(e);if(!t)return Ie;if(t.byteLength<e)throw new Error(r0(e,t.byteLength));return{done:!1,value:mt.decode(t)}}},Gi=class{constructor(e,t){this.source=e instanceof Ct?e:xu(e)?new ws(e,t):new Ct(e)}[Symbol.asyncIterator](){return this}next(){return B(this,void 0,void 0,function*(){let e;return(e=yield this.readMetadataLength()).done?Ie:e.value===-1&&(e=yield this.readMetadataLength()).done?Ie:(e=yield this.readMetadata(e.value)).done?Ie:e})}throw(e){return B(this,void 0,void 0,function*(){return yield this.source.throw(e)})}return(e){return B(this,void 0,void 0,function*(){return yield this.source.return(e)})}readMessage(e){return B(this,void 0,void 0,function*(){let t;if((t=yield this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(Fp(e));return t.value})}readMessageBody(e){return B(this,void 0,void 0,function*(){if(e<=0)return new Uint8Array(0);let t=D(yield this.source.read(e));if(t.byteLength<e)throw new Error(n0(e,t.byteLength));return t.byteOffset%8===0&&t.byteOffset+t.byteLength<=t.buffer.byteLength?t:t.slice()})}readSchema(){return B(this,arguments,void 0,function*(e=!1){let t=ne.Schema,n=yield this.readMessage(t),s=n?.header();if(e&&!s)throw new Error(Op(t));return s})}readMetadataLength(){return B(this,void 0,void 0,function*(){let e=yield this.source.read(Ff),t=e&&new Ye(e),n=t?.readInt32(0)||0;return{done:n===0,value:n}})}readMetadata(e){return B(this,void 0,void 0,function*(){let t=yield this.source.read(e);if(!t)return Ie;if(t.byteLength<e)throw new Error(r0(e,t.byteLength));return{done:!1,value:mt.decode(t)}})}},zi=class extends js{constructor(e){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=e instanceof lc?e:new lc(e)}next(){let{_json:e}=this;if(!this._schema)return this._schema=!0,{done:!1,value:mt.fromJSON(e.schema,ne.Schema)};if(this._dictionaryIndex<e.dictionaries.length){let t=e.dictionaries[this._dictionaryIndex++];return this._body=t.data.columns,{done:!1,value:mt.fromJSON(t,ne.DictionaryBatch)}}if(this._batchIndex<e.batches.length){let t=e.batches[this._batchIndex++];return this._body=t.columns,{done:!1,value:mt.fromJSON(t,ne.RecordBatch)}}return this._body=[],Ie}readMessageBody(e){return t(this._body);function t(n){return(n||[]).reduce((s,i)=>[...s,...i.VALIDITY&&[i.VALIDITY]||[],...i.TYPE_ID&&[i.TYPE_ID]||[],...i.OFFSET&&[i.OFFSET]||[],...i.DATA&&[i.DATA]||[],...i.VIEWS&&[i.VIEWS]||[],...i.VARIADIC_DATA_BUFFERS||[],...t(i.children)],[])}}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(Fp(e));return t.value}readSchema(){let e=ne.Schema,t=this.readMessage(e),n=t?.header();if(!t||!n)throw new Error(Op(e));return n}},Ff=4,Bp="ARROW1",zo=new Uint8Array(Bp.length);for(let r=0;r<Bp.length;r+=1)zo[r]=Bp.codePointAt(r);Wo=zo.length,Mp=Wo+Ff,s0=Wo*2+Ff});var Rp,Dp,i0,o0=p(()=>{To();Rp=class{constructor(){this.LZ4_FRAME_MAGIC=new Uint8Array([4,34,77,24]),this.MIN_HEADER_LENGTH=7}isValidCodecEncode(e){let t=new Uint8Array([1,2,3,4,5,6,7,8]),n=e.encode(t);return this._isValidCompressed(n)}_isValidCompressed(e){return this._hasMinimumLength(e)&&this._hasValidMagicNumber(e)&&this._hasValidVersion(e)}_hasMinimumLength(e){return e.length>=this.MIN_HEADER_LENGTH}_hasValidMagicNumber(e){return this.LZ4_FRAME_MAGIC.every((t,n)=>e[n]===t)}_hasValidVersion(e){return(e[4]&192)>>6===1}},Dp=class{constructor(){this.ZSTD_MAGIC=new Uint8Array([40,181,47,253]),this.MIN_HEADER_LENGTH=6}isValidCodecEncode(e){let t=new Uint8Array([1,2,3,4,5,6,7,8]),n=e.encode(t);return this._isValidCompressed(n)}_isValidCompressed(e){return this._hasMinimumLength(e)&&this._hasValidMagicNumber(e)}_hasMinimumLength(e){return e.length>=this.MIN_HEADER_LENGTH}_hasValidMagicNumber(e){return this.ZSTD_MAGIC.every((t,n)=>e[n]===t)}},i0={[Qe.LZ4_FRAME]:new Rp,[Qe.ZSTD]:new Dp}});var Np,Gs,Rf=p(()=>{To();o0();Np=class{constructor(){this.registry={}}set(e,t){if(t?.encode&&typeof t.encode=="function"&&!i0[e].isValidCodecEncode(t))throw new Error(`Encoder for ${Qe[e]} is not valid.`);this.registry[e]=t}get(e){var t;return((t=this.registry)===null||t===void 0?void 0:t[e])||null}},Gs=new Np});function f0(r,e){return e&&typeof e.autoDestroy=="boolean"?e.autoDestroy:r.autoDestroy}function*a0(r){let e=Et.from(r);try{if(!e.open({autoDestroy:!1}).closed)do yield e;while(!e.reset().open().closed)}finally{e.cancel()}}function c0(r){return gt(this,arguments,function*(){let t=yield H(Et.from(r));try{if(!(yield H(t.open({autoDestroy:!1}))).closed)do yield yield H(t);while(!(yield H(t.reset().open())).closed)}finally{yield H(t.cancel())}})}function iO(r){return new Vr(new Cp(r))}function oO(r){let e=r.peek(Wo+7&-8);return e&&e.byteLength>=4?Of(e)?new On(new Nf(r.read())):new Vr(new qo(r)):new Vr(new qo((function*(){})()))}function aO(r){return B(this,void 0,void 0,function*(){let e=yield r.peek(Wo+7&-8);return e&&e.byteLength>=4?Of(e)?new On(new Nf(yield r.read())):new Fn(new Ko(r)):new Fn(new Ko((function(){return gt(this,arguments,function*(){})})()))})}function cO(r){return B(this,void 0,void 0,function*(){let{size:e}=yield r.stat(),t=new ws(r,e);return e>=s0&&Of(yield t.readAt(0,Wo+7&-8))?new $o(new kp(t)):new Fn(new Ko(t))})}var Et,Vr,Fn,On,$o,Df,qo,Ko,Nf,kp,Cp,Tc=p(()=>{Ft();br();lt();ye();Fe();Gh();ka();gs();ys();qh();WT();Bn();dc();Mf();qn();Rf();qr();ae();Et=class r extends bi{constructor(e){super(),this._impl=e}get closed(){return this._impl.closed}get schema(){return this._impl.schema}get autoDestroy(){return this._impl.autoDestroy}get dictionaries(){return this._impl.dictionaries}get numDictionaries(){return this._impl.numDictionaries}get numRecordBatches(){return this._impl.numRecordBatches}get footer(){return this._impl.isFile()?this._impl.footer:null}isSync(){return this._impl.isSync()}isAsync(){return this._impl.isAsync()}isFile(){return this._impl.isFile()}isStream(){return this._impl.isStream()}next(){return this._impl.next()}throw(e){return this._impl.throw(e)}return(e){return this._impl.return(e)}cancel(){return this._impl.cancel()}reset(e){return this._impl.reset(e),this._DOMStream=void 0,this._nodeStream=void 0,this}open(e){let t=this._impl.open(e);return Kt(t)?t.then(()=>this):this}readRecordBatch(e){return this._impl.isFile()?this._impl.readRecordBatch(e):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return Je.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return Je.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e,t){throw new Error('"throughDOM" not available in this environment')}static from(e){return e instanceof r?e:yu(e)?iO(e):xu(e)?cO(e):Kt(e)?B(this,void 0,void 0,function*(){return yield r.from(yield e)}):Tu(e)||Ra(e)||Au(e)||hr(e)?aO(new Ct(e)):oO(new wr(e))}static readAll(e){return e instanceof r?e.isSync()?a0(e):c0(e):yu(e)||ArrayBuffer.isView(e)||Ar(e)||wu(e)?a0(e):c0(e)}},Vr=class extends Et{constructor(e){super(e),this._impl=e}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return gt(this,arguments,function*(){yield H(yield*yo($t(this[Symbol.iterator]())))})}},Fn=class extends Et{constructor(e){super(e),this._impl=e}readAll(){return B(this,void 0,void 0,function*(){var e,t,n,s;let i=new Array;try{for(var o=!0,a=$t(this),c;c=yield a.next(),e=c.done,!e;o=!0){s=c.value,o=!1;let u=s;i.push(u)}}catch(u){t={error:u}}finally{try{!o&&!e&&(n=a.return)&&(yield n.call(a))}finally{if(t)throw t.error}}return i})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},On=class extends Vr{constructor(e){super(e),this._impl=e}},$o=class extends Fn{constructor(e){super(e),this._impl=e}},Df=class{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(e=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=e}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(e){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=e,this.dictionaries=new Map,this}_loadRecordBatch(e,t,n){let s;if(e.compression!=null){let o=Gs.get(e.compression.type);if(o?.decode&&typeof o.decode=="function"){let{decommpressedBody:a,buffers:c}=this._decompressBuffers(e,t,o);s=this._loadCompressedVectors(e,a,this.schema.fields),e=new ze(e.length,e.nodes,c,null)}else throw new Error("Record batch is compressed but codec not found")}else s=this._loadVectors(e,t,this.schema.fields);let i=M({type:new he(this.schema.fields),length:e.length,children:s});return new le(this.schema,i,n)}_loadDictionaryBatch(e,t){let{id:n,isDelta:s}=e,{dictionaries:i,schema:o}=this,a=i.get(n),c=o.dictionaries.get(n),u;if(e.data.compression!=null){let f=Gs.get(e.data.compression.type);if(f?.decode&&typeof f.decode=="function"){let{decommpressedBody:l,buffers:d}=this._decompressBuffers(e.data,t,f);u=this._loadCompressedVectors(e.data,l,[c]),e=new pt(new ze(e.data.length,e.data.nodes,d,null,e.data.variadicBufferCounts),n,s)}else throw new Error("Dictionary batch is compressed but codec not found")}else u=this._loadVectors(e.data,t,[c]);return(a&&s?a.concat(new L(u)):new L(u)).memoize()}_loadVectors(e,t,n){return new jo(t,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion,e.variadicBufferCounts).visitMany(n)}_loadCompressedVectors(e,t,n){return new xf(t,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion,e.variadicBufferCounts).visitMany(n)}_decompressBuffers(e,t,n){let s=[],i=[],o=0;for(let{offset:a,length:c}of e.buffers){if(c===0){s.push(new Uint8Array(0)),i.push(new Ne(o,0));continue}let u=new Ye(t.subarray(a,a+c)),f=ee(u.readInt64(0)),l=u.bytes().subarray(8),d=f===-1?l:n.decode(l);s.push(d);let h=(o+7&-8)-o;o+=h,i.push(new Ne(o,d.length)),o+=d.length}return{decommpressedBody:s,buffers:i}}},qo=class extends Df{constructor(e,t){super(t),this._reader=yu(e)?new zi(this._handle=e):new js(this._handle=e)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(e){return this.closed||(this.autoDestroy=f0(this,e),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(e):Ie}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):Ie}next(){if(this.closed)return Ie;let e,{_reader:t}=this;for(;e=this._readNextMessageAndValidate();)if(e.isSchema())this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),s=t.readMessageBody(e.bodyLength);return{done:!1,value:this._loadRecordBatch(n,s,e.metadata)}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),s=t.readMessageBody(e.bodyLength),i=this._loadDictionaryBatch(n,s);this.dictionaries.set(n.id,i)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new ji(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}},Ko=class extends Df{constructor(e,t){super(t),this._reader=new Gi(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return B(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(e){return B(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=f0(this,e),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(e){return B(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(e):Ie})}return(e){return B(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(e):Ie})}next(){return B(this,void 0,void 0,function*(){if(this.closed)return Ie;let e,{_reader:t}=this;for(;e=yield this._readNextMessageAndValidate();)if(e.isSchema())yield this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),s=yield t.readMessageBody(e.bodyLength);return{done:!1,value:this._loadRecordBatch(n,s,e.metadata)}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),s=yield t.readMessageBody(e.bodyLength),i=this._loadDictionaryBatch(n,s);this.dictionaries.set(n.id,i)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new ji(this.schema)}):yield this.return()})}_readNextMessageAndValidate(e){return B(this,void 0,void 0,function*(){return yield this._reader.readMessage(e)})}},Nf=class extends qo{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(e,t){super(e instanceof hc?e:new hc(e),t)}isSync(){return!0}isFile(){return!0}open(e){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(let t of this._footer.dictionaryBatches())t&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(e)}readRecordBatch(e){var t;if(this.closed)return null;this._footer||this.open();let n=(t=this._footer)===null||t===void 0?void 0:t.getRecordBatch(e);if(n&&this._handle.seek(n.offset)){let s=this._reader.readMessage(ne.RecordBatch);if(s?.isRecordBatch()){let i=s.header(),o=this._reader.readMessageBody(s.bodyLength);return this._loadRecordBatch(i,o,s.metadata)}}return null}_readDictionaryBatch(e){var t;let n=(t=this._footer)===null||t===void 0?void 0:t.getDictionaryBatch(e);if(n&&this._handle.seek(n.offset)){let s=this._reader.readMessage(ne.DictionaryBatch);if(s?.isDictionaryBatch()){let i=s.header(),o=this._reader.readMessageBody(s.bodyLength),a=this._loadDictionaryBatch(i,o);this.dictionaries.set(i.id,a)}}}_readFooter(){let{_handle:e}=this,t=e.size-Mp,n=e.readInt32(t),s=e.readAt(t-n,n);return xn.decode(s)}_readNextMessageAndValidate(e){var t;if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){let n=(t=this._footer)===null||t===void 0?void 0:t.getRecordBatch(this._recordBatchIndex);if(n&&this._handle.seek(n.offset))return this._reader.readMessage(e)}return null}},kp=class extends Ko{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(e,...t){let n=typeof t[0]!="number"?t.shift():void 0,s=t[0]instanceof Map?t.shift():void 0;super(e instanceof ws?e:new ws(e,n),s)}isFile(){return!0}isAsync(){return!0}open(e){let t=Object.create(null,{open:{get:()=>super.open}});return B(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let n of this._footer.dictionaryBatches())n&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield t.open.call(this,e)})}readRecordBatch(e){return B(this,void 0,void 0,function*(){var t;if(this.closed)return null;this._footer||(yield this.open());let n=(t=this._footer)===null||t===void 0?void 0:t.getRecordBatch(e);if(n&&(yield this._handle.seek(n.offset))){let s=yield this._reader.readMessage(ne.RecordBatch);if(s?.isRecordBatch()){let i=s.header(),o=yield this._reader.readMessageBody(s.bodyLength);return this._loadRecordBatch(i,o,s.metadata)}}return null})}_readDictionaryBatch(e){return B(this,void 0,void 0,function*(){var t;let n=(t=this._footer)===null||t===void 0?void 0:t.getDictionaryBatch(e);if(n&&(yield this._handle.seek(n.offset))){let s=yield this._reader.readMessage(ne.DictionaryBatch);if(s?.isDictionaryBatch()){let i=s.header(),o=yield this._reader.readMessageBody(s.bodyLength),a=this._loadDictionaryBatch(i,o);this.dictionaries.set(i.id,a)}}})}_readFooter(){return B(this,void 0,void 0,function*(){let{_handle:e}=this;e._pending&&(yield e._pending);let t=e.size-Mp,n=yield e.readInt32(t),s=yield e.readAt(t-n,n);return xn.decode(s)})}_readNextMessageAndValidate(e){return B(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){let t=this._footer.getRecordBatch(this._recordBatchIndex);if(t&&(yield this._handle.seek(t.offset)))return yield this._reader.readMessage(e)}return null})}},Cp=class extends qo{constructor(e,t){super(e,t)}_loadVectors(e,t,n){return new wf(t,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion,e.variadicBufferCounts).visitMany(n)}}});function or(r){let e=r.byteLength+7&-8;return this.buffers.push(r),this.bufferRegions.push(new Ne(this._byteLength,e)),this._byteLength+=e,this}function uO(r){var e;let{type:t,length:n,typeIds:s,valueOffsets:i}=r;if(or.call(this,s),t.mode===de.Sparse)return Up.call(this,r);if(t.mode===de.Dense){if(r.offset<=0)return or.call(this,i),Up.call(this,r);{let o=new Int32Array(n),a=Object.create(null),c=Object.create(null);for(let u,f,l=-1;++l<n;)(u=s[l])!==void 0&&((f=a[u])===void 0&&(f=a[u]=i[l]),o[l]=i[l]-f,c[u]=((e=c[u])!==null&&e!==void 0?e:0)+1);or.call(this,o),this.visitMany(r.children.map((u,f)=>{let l=t.typeIds[f],d=a[l],h=c[l];return u.slice(d,Math.min(n,h))}))}}return this}function fO(r){let e;return r.nullCount>=r.length?or.call(this,new Uint8Array(r.length+7>>3)):(e=r.values)instanceof Uint8Array?or.call(this,fi(r.offset,r.length,e)):or.call(this,li(r.values))}function Mn(r){return or.call(this,r.values.subarray(0,r.length*r.stride))}function kf(r){let{length:e,values:t,valueOffsets:n}=r,s=ee(n[0]),i=ee(n[e]),o=Math.min(i-s,t.byteLength-s);return or.call(this,vu(-s,e+1,n)),or.call(this,t.subarray(s,s+o)),this}function l0(r){let{offset:e,length:t,stride:n,values:s,variadicBuffers:i=[]}=r;if(!s)throw new Error("BinaryView data is missing view buffer");let o=e*n,a=o+t*n;or.call(this,s.subarray(o,a));for(let c of i)or.call(this,c);return this._variadicBufferCounts.push(i.length),this}function Cf(r){let{length:e,valueOffsets:t}=r;if(t){let n=ee(t[0]),s=ee(t[e]);return or.call(this,vu(-n,e+1,t)),this.visit(r.children[0].slice(n,s-n))}return this.visit(r.children[0])}function Up(r){return this.visitMany(r.type.children.map((e,t)=>r.children[t]).filter(Boolean))[0]}var Se,d0=p(()=>{lt();Nt();Fe();Bn();$e();di();gs();ye();qr();Se=class r extends R{static assemble(...e){let t=s=>s.flatMap(i=>Array.isArray(i)?t(i):i instanceof le?i.data.children:i.data),n=new r;return n.visitMany(t(e)),n}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[],this._variadicBufferCounts=[]}visit(e){if(e instanceof L)return this.visitMany(e.data),this;let{type:t}=e;if(!S.isDictionary(t)){let{length:n}=e;if(n>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(S.isUnion(t))this.nodes.push(new gr(n,0));else{let{nullCount:s}=e;S.isNull(t)||or.call(this,s<=0?new Uint8Array(0):fi(e.offset,n,e.nullBitmap)),this.nodes.push(new gr(n,s))}}return super.visit(e)}visitNull(e){return this}visitDictionary(e){return this.visit(e.clone(e.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}get variadicBufferCounts(){return this._variadicBufferCounts}};Se.prototype.visitBool=fO;Se.prototype.visitInt=Mn;Se.prototype.visitFloat=Mn;Se.prototype.visitUtf8=kf;Se.prototype.visitLargeUtf8=kf;Se.prototype.visitUtf8View=l0;Se.prototype.visitBinary=kf;Se.prototype.visitLargeBinary=kf;Se.prototype.visitBinaryView=l0;Se.prototype.visitFixedSizeBinary=Mn;Se.prototype.visitDate=Mn;Se.prototype.visitTimestamp=Mn;Se.prototype.visitTime=Mn;Se.prototype.visitDecimal=Mn;Se.prototype.visitList=Cf;Se.prototype.visitLargeList=Cf;Se.prototype.visitStruct=Up;Se.prototype.visitUnion=uO;Se.prototype.visitInterval=Mn;Se.prototype.visitDuration=Mn;Se.prototype.visitFixedSizeList=Cf;Se.prototype.visitMap=Cf});var Uf,h0=p(()=>{Nt();Mu();Fe();Uf=class extends R{visit(e){return e==null?void 0:super.visit(e)}visitNull({typeId:e}){return{name:G[e].toLowerCase()}}visitInt({typeId:e,bitWidth:t,isSigned:n}){return{name:G[e].toLowerCase(),bitWidth:t,isSigned:n}}visitFloat({typeId:e,precision:t}){return{name:G[e].toLowerCase(),precision:ue[t]}}visitBinary({typeId:e}){return{name:G[e].toLowerCase()}}visitLargeBinary({typeId:e}){return{name:G[e].toLowerCase()}}visitBinaryView({typeId:e}){return{name:G[e].toLowerCase()}}visitBool({typeId:e}){return{name:G[e].toLowerCase()}}visitUtf8({typeId:e}){return{name:G[e].toLowerCase()}}visitLargeUtf8({typeId:e}){return{name:G[e].toLowerCase()}}visitUtf8View({typeId:e}){return{name:G[e].toLowerCase()}}visitDecimal({typeId:e,scale:t,precision:n,bitWidth:s}){return{name:G[e].toLowerCase(),scale:t,precision:n,bitWidth:s}}visitDate({typeId:e,unit:t}){return{name:G[e].toLowerCase(),unit:ge[t]}}visitTime({typeId:e,unit:t,bitWidth:n}){return{name:G[e].toLowerCase(),unit:E[t],bitWidth:n}}visitTimestamp({typeId:e,timezone:t,unit:n}){return{name:G[e].toLowerCase(),unit:E[n],timezone:t}}visitInterval({typeId:e,unit:t}){return{name:G[e].toLowerCase(),unit:oe[t]}}visitDuration({typeId:e,unit:t}){return{name:G[e].toLocaleLowerCase(),unit:E[t]}}visitList({typeId:e}){return{name:G[e].toLowerCase()}}visitLargeList({typeId:e}){return{name:G[e].toLowerCase()}}visitStruct({typeId:e}){return{name:G[e].toLowerCase()}}visitUnion({typeId:e,mode:t,typeIds:n}){return{name:G[e].toLowerCase(),mode:de[t].toUpperCase(),typeIds:[...n]}}visitDictionary(e){return this.visit(e.dictionary)}visitFixedSizeBinary({typeId:e,byteWidth:t}){return{name:G[e].toLowerCase(),byteWidth:t}}visitFixedSizeList({typeId:e,listSize:t}){return{name:G[e].toLowerCase(),listSize:t}}visitMap({typeId:e,keysSorted:t}){return{name:G[e].toLowerCase(),keysSorted:t}}}});function*Vp(r){for(let e of r)yield e.reduce((t,n)=>`${t}${("0"+(n&255).toString(16)).slice(-2)}`,"").toUpperCase()}function*Rn(r,e){let t=new Uint32Array(r.buffer,r.byteOffset,r.byteLength/Uint32Array.BYTES_PER_ELEMENT);for(let n=-1,s=t.length/e;++n<s;)yield`${ai.new(t.subarray((n+0)*e,(n+1)*e),!1)}`}function p0(r,e){let n=r.values,s=new DataView(n.buffer,n.byteOffset,n.byteLength),i=n.byteLength/16,o=d=>Array.from(d).map(h=>("0"+(h&255).toString(16)).slice(-2)).join("").toUpperCase(),a=Array.from({length:i},(d,h)=>{let m=h*16,b=s.getInt32(m,!0);return[m,b]}).map(([d,h])=>h>12?{SIZE:h,PREFIX_HEX:o(n.subarray(d+4,d+8)),BUFFER_INDEX:s.getInt32(d+8,!0),OFFSET:s.getInt32(d+12,!0)}:{SIZE:h,INLINED:e(n.subarray(d+4,d+4+h))}),c=[...new Set(a.map(d=>d.BUFFER_INDEX).filter(d=>d!==void 0))],u=c.map(d=>o(r.variadicBuffers[d])),f=new Map(c.map((d,h)=>[d,h]));return{VIEWS:a.map(d=>d.BUFFER_INDEX!==void 0?Object.assign(Object.assign({},d),{BUFFER_INDEX:f.get(d.BUFFER_INDEX)}):d),VARIADIC_DATA_BUFFERS:u}}var _c,m0=p(()=>{Du();lt();Nt();Fe();Fe();di();yf();ye();_c=class r extends R{static assemble(...e){let t=new r;return e.map(({schema:n,data:s})=>t.visitMany(n.fields,s.children))}visit({name:e},t){let{length:n}=t,{offset:s,nullCount:i,nullBitmap:o}=t,a=S.isDictionary(t.type)?t.type.indices:t.type,c=Object.assign([],t.buffers,{[te.VALIDITY]:void 0});return Object.assign({name:e,count:n,VALIDITY:S.isNull(a)||S.isUnion(a)?void 0:i<=0?Array.from({length:n},()=>1):[...new Hr(o,s,n,null,rf)]},super.visit(t.clone(a,s,n,0,c)))}visitNull(){return{}}visitBool({values:e,offset:t,length:n}){return{DATA:[...new Hr(e,t,n,null,No)]}}visitInt(e){return{DATA:e.type.bitWidth<64?[...e.values]:[...Rn(e.values,2)]}}visitFloat(e){return{DATA:[...e.values]}}visitUtf8(e){return{DATA:[...new L([e])],OFFSET:[...e.valueOffsets]}}visitLargeUtf8(e){return{DATA:[...new L([e])],OFFSET:[...Rn(e.valueOffsets,2)]}}visitBinary(e){return{DATA:[...Vp(new L([e]))],OFFSET:[...e.valueOffsets]}}visitLargeBinary(e){return{DATA:[...Vp(new L([e]))],OFFSET:[...Rn(e.valueOffsets,2)]}}visitBinaryView(e){return p0(e,t=>Array.from(t).map(n=>("0"+(n&255).toString(16)).slice(-2)).join("").toUpperCase())}visitUtf8View(e){return p0(e,t=>Array.from(t).map(n=>String.fromCodePoint(n)).join(""))}visitFixedSizeBinary(e){return{DATA:[...Vp(new L([e]))]}}visitDate(e){return{DATA:e.type.unit===ge.DAY?[...e.values]:[...Rn(e.values,2)]}}visitTimestamp(e){return{DATA:[...Rn(e.values,2)]}}visitTime(e){return{DATA:e.type.unit<E.MICROSECOND?[...e.values]:[...Rn(e.values,2)]}}visitDecimal(e){return{DATA:[...Rn(e.values,4)]}}visitList(e){return{OFFSET:[...e.valueOffsets],children:this.visitMany(e.type.children,e.children)}}visitLargeList(e){return{OFFSET:[...Rn(e.valueOffsets,2)],children:this.visitMany(e.type.children,e.children)}}visitStruct(e){return{children:this.visitMany(e.type.children,e.children)}}visitUnion(e){return{TYPE_ID:[...e.typeIds],OFFSET:e.type.mode===de.Dense?[...e.valueOffsets]:void 0,children:this.visitMany(e.type.children,e.children)}}visitInterval(e){switch(e.type.unit){case oe.YEAR_MONTH:return{DATA:[...e.values]};case oe.DAY_TIME:return{DATA:Qh(e.values)};case oe.MONTH_DAY_NANO:return{DATA:Zh(e.values,!0)}}}visitDuration(e){return{DATA:[...Rn(e.values,2)]}}visitFixedSizeList(e){return{children:this.visitMany(e.type.children,e.children)}}visitMap(e){return{OFFSET:[...e.valueOffsets],children:this.visitMany(e.type.children,e.children)}}}});function Pp(r,e){let t=e;e instanceof be&&(t=e.batches,r.reset(void 0,e.schema));for(let n of t)r.write(n);return r.finish()}function jp(r,e){return B(this,void 0,void 0,function*(){var t,n,s,i,o,a,c;try{for(t=!0,n=$t(e);s=yield n.next(),i=s.done,!i;t=!0){c=s.value,t=!1;let u=c;r.write(u)}}catch(u){o={error:u}}finally{try{!t&&!i&&(a=n.return)&&(yield a.call(n))}finally{if(o)throw o.error}}return r.finish()})}function b0({name:r,type:e,nullable:t}){let n=new Uf;return{name:r,nullable:t,type:n.visit(e),children:(e.children||[]).map(s=>b0(s)),dictionary:S.isDictionary(e)?{id:e.id,isOrdered:e.isOrdered,indexType:n.visit(e.indices)}:void 0}}function lO(r,e,t=!1){let[n]=_c.assemble(new le({[e]:r}));return JSON.stringify({id:e,isDelta:t,data:{count:r.length,columns:n}},null,2)}function dO(r){let[e]=_c.assemble(r);return JSON.stringify({count:r.numRows,columns:e},null,2)}var en,Dn,Nn,Ac,Vf=p(()=>{Ft();Pi();Mf();lt();ye();gs();gs();Gh();Fe();xc();ys();d0();h0();m0();$e();Bn();dc();qn();To();Rf();ae();en=class extends bi{static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e,t){throw new Error('"throughDOM" not available in this environment')}constructor(e){if(super(),this._position=0,this._started=!1,this._compression=null,this._sink=new yr,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,yt(e)||(e={autoDestroy:!0,writeLegacyIpcFormat:!1,compressionType:null}),this._autoDestroy=typeof e.autoDestroy=="boolean"?e.autoDestroy:!0,this._writeLegacyIpcFormat=typeof e.writeLegacyIpcFormat=="boolean"?e.writeLegacyIpcFormat:!1,e.compressionType!=null){if(this._writeLegacyIpcFormat)throw new Error("Legacy IPC format does not support columnar compression. Use modern IPC format (writeLegacyIpcFormat=false).");if(Object.values(Qe).includes(e.compressionType))this._compression=new mi(e.compressionType);else{let t=Object.values(Qe).filter(n=>typeof n=="string");throw new Error(`Unsupported compressionType: ${e.compressionType} Available types: ${t.join(", ")}`)}}else this._compression=null}toString(e=!1){return this._sink.toString(e)}toUint8Array(e=!1){return this._sink.toUint8Array(e)}writeAll(e){return Kt(e)?e.then(t=>this.writeAll(t)):hr(e)?jp(this,e):Pp(this,e)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(e){return this._sink.toDOMStream(e)}toNodeStream(e){return this._sink.toNodeStream(e)}close(){return this.reset()._sink.close()}abort(e){return this.reset()._sink.abort(e)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(e=this._sink,t=null){return e===this._sink||e instanceof yr?this._sink=e:(this._sink=new yr,e&&Dw(e)?this.toDOMStream({type:"bytes"}).pipeTo(e):e&&Nw(e)&&this.toNodeStream({objectMode:!1}).pipe(e)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!t||!Vi(t,this._schema))&&(t==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=t,this._writeSchema(t))),this}write(e){let t=null;if(this._sink){if(e==null)return this.finish()&&void 0;if(e instanceof be&&!(t=e.schema))return this.finish()&&void 0;if(e instanceof le&&!(t=e.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(t&&!Vi(t,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,t)}e instanceof le?e instanceof ji||this._writeRecordBatch(e):e instanceof be?this.writeAll(e.batches):Ar(e)&&this.writeAll(e)}_writeMessage(e,t=8){let n=t-1,s=mt.encode(e),i=s.byteLength,o=this._writeLegacyIpcFormat?4:8,a=i+o+n&~n,c=a-i-o;return e.headerType===ne.RecordBatch?this._recordBatchBlocks.push(new kr(a,e.bodyLength,this._position)):e.headerType===ne.DictionaryBatch&&this._dictionaryBlocks.push(new kr(a,e.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-o)),i>0&&this._write(s),this._writePadding(c)}_write(e){if(this._started){let t=D(e);t&&t.byteLength>0&&(this._sink.write(t),this._position+=t.byteLength)}return this}_writeSchema(e){return this._writeMessage(mt.from(e))}_writeFooter(e){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(zo)}_writePadding(e){return e>0?this._write(new Uint8Array(e)):this}_writeRecordBatch(e){let{byteLength:t,nodes:n,bufferRegions:s,buffers:i,variadicBufferCounts:o}=this._assembleRecordBatch(e),a=new ze(e.numRows,n,s,this._compression,o,e.metadata),c=mt.from(a,t);return this._writeDictionaries(e)._writeMessage(c)._writeBodyBuffers(i)}_assembleRecordBatch(e){let{byteLength:t,nodes:n,bufferRegions:s,buffers:i,variadicBufferCounts:o}=Se.assemble(e);return this._compression!=null&&({byteLength:t,bufferRegions:s,buffers:i}=this._compressBodyBuffers(i)),{byteLength:t,nodes:n,bufferRegions:s,buffers:i,variadicBufferCounts:o}}_compressBodyBuffers(e){let t=Gs.get(this._compression.type);if(!t?.encode||typeof t.encode!="function")throw new Error(`Codec for compression type "${Qe[this._compression.type]}" has invalid encode method`);let n=0,s=[],i=[];for(let a of e){let c=D(a);if(c.length===0){s.push(new Uint8Array(0),new Uint8Array(0)),i.push(new Ne(n,0));continue}let u=t.encode(c),f=u.length<c.length,l=f?u:c,d=f?l.length:-1,h=new Ye(new Uint8Array(8));h.writeInt64(0,BigInt(d)),s.push(h.bytes(),new Uint8Array(l));let m=(n+7&-8)-n;n+=m;let b=8+l.length;i.push(new Ne(n,b)),n+=b}let o=(n+7&-8)-n;return n+=o,{byteLength:n,bufferRegions:i,buffers:s}}_writeDictionaryBatch(e,t,n=!1){let{byteLength:s,nodes:i,bufferRegions:o,buffers:a,variadicBufferCounts:c}=this._assembleRecordBatch(new L([e])),u=new ze(e.length,i,o,this._compression,c),f=new pt(u,t,n),l=mt.from(f,s);return this._writeMessage(l)._writeBodyBuffers(a)}_writeBodyBuffers(e){let t=this._compression!=null?2:1,n=new Array(t);for(let s=0;s<e.length;s+=t){let i=0;for(let a=-1;++a<t;)n[a]=e[s+a],i+=n[a].byteLength;if(i===0)continue;for(let a of n)this._write(a);let o=(i+7&-8)-i;o>0&&this._writePadding(o)}return this}_writeDictionaries(e){var t,n;for(let[s,i]of e.dictionaries){let o=(t=i?.data)!==null&&t!==void 0?t:[],a=this._seenDictionaries.get(s),c=(n=this._dictionaryDeltaOffsets.get(s))!==null&&n!==void 0?n:0;if(!a||a.data[0]!==o[0])for(let[u,f]of o.entries())this._writeDictionaryBatch(f,s,u>0);else if(c<o.length)for(let u of o.slice(c))this._writeDictionaryBatch(u,s,!0);this._seenDictionaries.set(s,i),this._dictionaryDeltaOffsets.set(s,o.length)}return this}},Dn=class r extends en{static writeAll(e,t){let n=new r(t);return Kt(e)?e.then(s=>n.writeAll(s)):hr(e)?jp(n,e):Pp(n,e)}},Nn=class r extends en{static writeAll(e,t){let n=new r(t);return Kt(e)?e.then(s=>n.writeAll(s)):hr(e)?jp(n,e):Pp(n,e)}constructor(e){super(e),this._autoDestroy=!0,this._writeLegacyIpcFormat=!1}_writeSchema(e){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(e,t,n=!1){if(!n&&this._seenDictionaries.has(t))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(e,t,n)}_writeFooter(e){let t=xn.encode(new xn(e,me.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(e)._write(t)._write(Int32Array.of(t.byteLength))._writeMagic()}},Ac=class r extends en{static writeAll(e){return new r().writeAll(e)}constructor(){super(),this._autoDestroy=!0,this._recordBatches=[],this._recordBatchesWithDictionaries=[]}_writeMessage(){return this}_writeFooter(e){return this}_writeSchema(e){return this._write(`{
|
|
22
|
-
"schema": ${JSON.stringify({fields:e.fields.map(t=>
|
|
23
|
-
`),this._write(
|
|
21
|
+
]`}concat(...e){let t=this.schema,n=this.data.concat(e.flatMap(({data:s})=>s));return new r(t,n.map(s=>new de(t,s)))}slice(e,t){let n=this.schema;[e,t]=fc({length:this.numRows},e,t);let s=pl(this.data,this._offsets,e,t);return new r(n,s.map(i=>new de(n,i)))}getChild(e){return this.getChildAt(this.schema.fields.findIndex(t=>t.name===e))}getChildAt(e){if(e>-1&&e<this.schema.fields.length){let t=this.data.map(n=>n.children[e]);if(t.length===0){let{type:n}=this.schema.fields[e],s=D({type:n,length:0,nullCount:0});t.push(s._changeLengthAndBackfillNullBitmap(this.numRows))}return new B(t)}return null}setChild(e,t){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(s=>s.name===e),t)}setChildAt(e,t){let n=this.schema,s=[...this.batches];if(e>-1&&e<this.numCols){t||(t=new B([D({type:new Ne,length:this.numRows})]));let i=n.fields.slice(),o=i[e].clone({type:t.type}),a=this.schema.fields.map((c,u)=>this.getChildAt(u));[i[e],a[e]]=[o,t],[n,s]=Cl(n,a)}return new r(n,s)}select(e){let t=this.schema.fields.reduce((n,s,i)=>n.set(s.name,i),new Map);return this.selectAt(e.map(n=>t.get(n)).filter(n=>n>-1))}selectAt(e){let t=this.schema.selectAt(e),n=this.batches.map(s=>s.selectAt(e));return new r(t,n)}assign(e){let t=this.schema.fields,[n,s]=e.schema.fields.reduce((a,c,u)=>{let[l,f]=a,d=t.findIndex(h=>h.name===c.name);return~d?f[d]=u:l.push(u),a},[[],[]]),i=this.schema.assign(e.schema),o=[...t.map((a,c)=>[c,s[c]]).map(([a,c])=>c===void 0?this.getChildAt(a):e.getChildAt(c)),...n.map(a=>e.getChildAt(a))].filter(Boolean);return new r(...Cl(i,o))}};O0=Symbol.toStringTag;me[O0]=(r=>(r.schema=null,r.batches=[],r._offsets=new Uint32Array([0]),r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,r[M0]=!0,r.isValid=jo(pc),r.get=jo(ze.getVisitFn(w.Struct)),r.set=ml(nt.getVisitFn(w.Struct)),r.indexOf=bl(yi.getVisitFn(w.Struct)),"Table"))(me.prototype);Object.defineProperty(me,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===me&&me.isTable(e)}})});function D0(r,e,t=e.reduce((n,s)=>Math.max(n,s.length),0)){var n;let s=[...r.fields],i=[...e],o=(t+63&-64)>>3;for(let[a,c]of r.fields.entries()){let u=e[a];(!u||u.length!==t)&&(s[a]=c.clone({nullable:!0}),i[a]=(n=u?._changeLengthAndBackfillNullBitmap(t))!==null&&n!==void 0?n:D({type:c.type,length:t,nullCount:t,nullBitmap:new Uint8Array(o)}))}return[r.assign(s),D({type:new pe(s),length:t,children:i})]}function N0(r,e,t=new Map){var n,s;if(((n=r?.length)!==null&&n!==void 0?n:0)>0&&r?.length===e?.length)for(let i=-1,o=r.length;++i<o;){let{type:a}=r[i],c=e[i];for(let u of[c,...((s=c?.dictionary)===null||s===void 0?void 0:s.data)||[]])N0(a.children,u?.children,t);if(E.isDictionary(a)){let{id:u}=a;if(!t.has(u))c?.dictionary&&t.set(u,c.dictionary);else if(t.get(u)!==c.dictionary)throw new Error("Cannot create Schema containing two different dictionaries with the same Id")}}return t}var R0,k0,de,qi,Rn=p(()=>{wr();$i();ht();mt();we();Po();hi();ar();yl();wl();k0=Symbol.for("apache-arrow/RecordBatch"),de=class r{static isRecordBatch(e){return e?.[k0]===!0}constructor(...e){switch(e.length){case 3:case 2:{if([this.schema]=e,!(this.schema instanceof Q))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");if([,this.data=D({nullCount:0,type:new pe(this.schema.fields),children:this.schema.fields.map(t=>D({type:t.type,nullCount:0}))}),this._metadata=new Map]=e,!(this.data instanceof G))throw new TypeError("RecordBatch constructor expects a [Schema, Data] pair.");[this.schema,this.data]=D0(this.schema,this.data.children,this.data.length);break}case 1:{let[t]=e,{fields:n,children:s,length:i}=Object.keys(t).reduce((c,u,l)=>(c.children[l]=t[u],c.length=Math.max(c.length,t[u].length),c.fields[l]=O.new({name:u,type:t[u].type,nullable:!0}),c),{length:0,fields:new Array,children:new Array}),o=new Q(n),a=D({type:new pe(n),length:i,children:s,nullCount:0});[this.schema,this.data]=D0(o,a.children,i),this._metadata=new Map;break}default:throw new TypeError("RecordBatch constructor expects an Object mapping names to child Data, or a [Schema, Data] pair.")}}get metadata(){return this._metadata}get dictionaries(){return this._dictionaries||(this._dictionaries=N0(this.schema.fields,this.data.children))}get numCols(){return this.schema.fields.length}get numRows(){return this.data.length}get nullCount(){return this.data.nullCount}isValid(e){return this.data.getValid(e)}get(e){return ze.visit(this.data,e)}at(e){return this.get(pi(e,this.numRows))}set(e,t){return nt.visit(this.data,e,t)}indexOf(e,t){return yi.visit(this.data,e,t)}[Symbol.iterator](){return Go.visit(new B([this.data]))}toArray(){return[...this]}concat(...e){return new me(this.schema,[this,...e])}slice(e,t){let[n]=new B([this.data]).slice(e,t).data;return new r(this.schema,n,this._metadata)}getChild(e){var t;return this.getChildAt((t=this.schema.fields)===null||t===void 0?void 0:t.findIndex(n=>n.name===e))}getChildAt(e){return e>-1&&e<this.schema.fields.length?new B([this.data.children[e]]):null}setChild(e,t){var n;return this.setChildAt((n=this.schema.fields)===null||n===void 0?void 0:n.findIndex(s=>s.name===e),t)}setChildAt(e,t){let n=this.schema,s=this.data;if(e>-1&&e<this.numCols){t||(t=new B([D({type:new Ne,length:this.numRows})]));let i=n.fields.slice(),o=s.children.slice(),a=i[e].clone({type:t.type});[i[e],o[e]]=[a,t.data[0]],n=new Q(i,new Map(this.schema.metadata)),s=D({type:new pe(i),length:s.length,children:o})}return new r(n,s,this._metadata)}select(e){let t=this.schema.select(e),n=new pe(t.fields),s=[];for(let i of e){let o=this.schema.fields.findIndex(a=>a.name===i);~o&&(s[o]=this.data.children[o])}return new r(t,D({type:n,length:this.numRows,children:s}),this._metadata)}selectAt(e){let t=this.schema.selectAt(e),n=e.map(i=>this.data.children[i]).filter(Boolean),s=D({type:new pe(t.fields),length:this.numRows,children:n});return new r(t,s,this._metadata)}};R0=Symbol.toStringTag;de[R0]=(r=>(r._nullCount=-1,r[Symbol.isConcatSpreadable]=!0,r[k0]=!0,"RecordBatch"))(de.prototype);Object.defineProperty(de,Symbol.hasInstance,{value:function(e){return Function.prototype[Symbol.hasInstance].call(this,e)||this===de&&de.isRecordBatch(e)}});qi=class extends de{constructor(e,t){let n=e.fields.map(i=>D({type:i.type})),s=D({type:new pe(e.fields),length:0,nullCount:0,children:n});super(e,s,t||new Map)}}});function Pl(r,e=0){for(let t=-1,n=Xo.length;++t<n;)if(Xo[t]!==r[e+t])return!1;return!0}var Hp,Jp,C0,U0,qs,Ki,Xi,Ul,Xp,Xo,Ho,Yp,P0,Vl=p(()=>{kt();Me();ce();_s();Yn();fp();Ke();As();bc();Hp=r=>`Expected ${se[r]} Message in stream, but was null or length 0.`,Jp=r=>`Header pointer of flatbuffer-encoded ${se[r]} Message is null or length 0.`,C0=(r,e)=>`Expected to read ${r} metadata bytes, but only read ${e}.`,U0=(r,e)=>`Expected to read ${r} bytes for message body, but only read ${e}.`,qs=class{constructor(e){this.source=e instanceof _r?e:new _r(e)}[Symbol.iterator](){return this}next(){let e;return(e=this.readMetadataLength()).done?Ee:e.value===-1&&(e=this.readMetadataLength()).done?Ee:(e=this.readMetadata(e.value)).done?Ee:e}throw(e){return this.source.throw(e)}return(e){return this.source.return(e)}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(Hp(e));return t.value}readMessageBody(e){if(e<=0)return new Uint8Array(0);let t=k(this.source.read(e));if(t.byteLength<e)throw new Error(U0(e,t.byteLength));return t.byteOffset%8===0&&t.byteOffset+t.byteLength<=t.buffer.byteLength?t:t.slice()}readSchema(e=!1){let t=se.Schema,n=this.readMessage(t),s=n?.header();if(e&&!s)throw new Error(Jp(t));return s}readMetadataLength(){let e=this.source.read(Ul),t=e&&new Ze(e),n=t?.readInt32(0)||0;return{done:n===0,value:n}}readMetadata(e){let t=this.source.read(e);if(!t)return Ee;if(t.byteLength<e)throw new Error(C0(e,t.byteLength));return{done:!1,value:gt.decode(t)}}},Ki=class{constructor(e,t){this.source=e instanceof Gt?e:Bu(e)?new vs(e,t):new Gt(e)}[Symbol.asyncIterator](){return this}next(){return F(this,void 0,void 0,function*(){let e;return(e=yield this.readMetadataLength()).done?Ee:e.value===-1&&(e=yield this.readMetadataLength()).done?Ee:(e=yield this.readMetadata(e.value)).done?Ee:e})}throw(e){return F(this,void 0,void 0,function*(){return yield this.source.throw(e)})}return(e){return F(this,void 0,void 0,function*(){return yield this.source.return(e)})}readMessage(e){return F(this,void 0,void 0,function*(){let t;if((t=yield this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(Hp(e));return t.value})}readMessageBody(e){return F(this,void 0,void 0,function*(){if(e<=0)return new Uint8Array(0);let t=k(yield this.source.read(e));if(t.byteLength<e)throw new Error(U0(e,t.byteLength));return t.byteOffset%8===0&&t.byteOffset+t.byteLength<=t.buffer.byteLength?t:t.slice()})}readSchema(){return F(this,arguments,void 0,function*(e=!1){let t=se.Schema,n=yield this.readMessage(t),s=n?.header();if(e&&!s)throw new Error(Jp(t));return s})}readMetadataLength(){return F(this,void 0,void 0,function*(){let e=yield this.source.read(Ul),t=e&&new Ze(e),n=t?.readInt32(0)||0;return{done:n===0,value:n}})}readMetadata(e){return F(this,void 0,void 0,function*(){let t=yield this.source.read(e);if(!t)return Ee;if(t.byteLength<e)throw new Error(C0(e,t.byteLength));return{done:!1,value:gt.decode(t)}})}},Xi=class extends qs{constructor(e){super(new Uint8Array(0)),this._schema=!1,this._body=[],this._batchIndex=0,this._dictionaryIndex=0,this._json=e instanceof mc?e:new mc(e)}next(){let{_json:e}=this;if(!this._schema)return this._schema=!0,{done:!1,value:gt.fromJSON(e.schema,se.Schema)};if(this._dictionaryIndex<e.dictionaries.length){let t=e.dictionaries[this._dictionaryIndex++];return this._body=t.data.columns,{done:!1,value:gt.fromJSON(t,se.DictionaryBatch)}}if(this._batchIndex<e.batches.length){let t=e.batches[this._batchIndex++];return this._body=t.columns,{done:!1,value:gt.fromJSON(t,se.RecordBatch)}}return this._body=[],Ee}readMessageBody(e){return t(this._body);function t(n){return(n||[]).reduce((s,i)=>[...s,...i.VALIDITY&&[i.VALIDITY]||[],...i.TYPE_ID&&[i.TYPE_ID]||[],...i.OFFSET&&[i.OFFSET]||[],...i.DATA&&[i.DATA]||[],...i.VIEWS&&[i.VIEWS]||[],...i.VARIADIC_DATA_BUFFERS||[],...t(i.children)],[])}}readMessage(e){let t;if((t=this.next()).done)return null;if(e!=null&&t.value.headerType!==e)throw new Error(Hp(e));return t.value}readSchema(){let e=se.Schema,t=this.readMessage(e),n=t?.header();if(!t||!n)throw new Error(Jp(e));return n}},Ul=4,Xp="ARROW1",Xo=new Uint8Array(Xp.length);for(let r=0;r<Xp.length;r+=1)Xo[r]=Xp.codePointAt(r);Ho=Xo.length,Yp=Ho+Ul,P0=Ho*2+Ul});var Qp,Zp,V0,j0=p(()=>{So();Qp=class{constructor(){this.LZ4_FRAME_MAGIC=new Uint8Array([4,34,77,24]),this.MIN_HEADER_LENGTH=7}isValidCodecEncode(e){let t=new Uint8Array([1,2,3,4,5,6,7,8]),n=e.encode(t);return this._isValidCompressed(n)}_isValidCompressed(e){return this._hasMinimumLength(e)&&this._hasValidMagicNumber(e)&&this._hasValidVersion(e)}_hasMinimumLength(e){return e.length>=this.MIN_HEADER_LENGTH}_hasValidMagicNumber(e){return this.LZ4_FRAME_MAGIC.every((t,n)=>e[n]===t)}_hasValidVersion(e){return(e[4]&192)>>6===1}},Zp=class{constructor(){this.ZSTD_MAGIC=new Uint8Array([40,181,47,253]),this.MIN_HEADER_LENGTH=6}isValidCodecEncode(e){let t=new Uint8Array([1,2,3,4,5,6,7,8]),n=e.encode(t);return this._isValidCompressed(n)}_isValidCompressed(e){return this._hasMinimumLength(e)&&this._hasValidMagicNumber(e)}_hasMinimumLength(e){return e.length>=this.MIN_HEADER_LENGTH}_hasValidMagicNumber(e){return this.ZSTD_MAGIC.every((t,n)=>e[n]===t)}},V0={[et.LZ4_FRAME]:new Qp,[et.ZSTD]:new Zp}});var em,Ks,jl=p(()=>{So();j0();em=class{constructor(){this.registry={}}set(e,t){if(t?.encode&&typeof t.encode=="function"&&!V0[e].isValidCodecEncode(t))throw new Error(`Encoder for ${et[e]} is not valid.`);this.registry[e]=t}get(e){var t;return((t=this.registry)===null||t===void 0?void 0:t[e])||null}},Ks=new em});function $0(r,e){return e&&typeof e.autoDestroy=="boolean"?e.autoDestroy:r.autoDestroy}function*G0(r){let e=Mt.from(r);try{if(!e.open({autoDestroy:!1}).closed)do yield e;while(!e.reset().open().closed)}finally{e.cancel()}}function z0(r){return _t(this,arguments,function*(){let t=yield Y(Mt.from(r));try{if(!(yield Y(t.open({autoDestroy:!1}))).closed)do yield yield Y(t);while(!(yield Y(t.reset().open())).closed)}finally{yield Y(t.cancel())}})}function oM(r){return new $r(new rm(r))}function aM(r){let e=r.peek(Ho+7&-8);return e&&e.byteLength>=4?Pl(e)?new Nn(new zl(r.read())):new $r(new Yo(r)):new $r(new Yo((function*(){})()))}function cM(r){return F(this,void 0,void 0,function*(){let e=yield r.peek(Ho+7&-8);return e&&e.byteLength>=4?Pl(e)?new Nn(new zl(yield r.read())):new kn(new Qo(r)):new kn(new Qo((function(){return _t(this,arguments,function*(){})})()))})}function uM(r){return F(this,void 0,void 0,function*(){let{size:e}=yield r.stat(),t=new vs(r,e);return e>=P0&&Pl(yield t.readAt(0,Ho+7&-8))?new Jo(new tm(t)):new kn(new Qo(t))})}var Mt,$r,kn,Nn,Jo,Gl,Yo,Qo,zl,tm,rm,Ic=p(()=>{kt();wr();ht();we();Me();ap();Va();_s();As();fp();I0();Rn();bc();Vl();Yn();jl();Qr();ce();Mt=class r extends Ti{constructor(e){super(),this._impl=e}get closed(){return this._impl.closed}get schema(){return this._impl.schema}get autoDestroy(){return this._impl.autoDestroy}get dictionaries(){return this._impl.dictionaries}get numDictionaries(){return this._impl.numDictionaries}get numRecordBatches(){return this._impl.numRecordBatches}get footer(){return this._impl.isFile()?this._impl.footer:null}isSync(){return this._impl.isSync()}isAsync(){return this._impl.isAsync()}isFile(){return this._impl.isFile()}isStream(){return this._impl.isStream()}next(){return this._impl.next()}throw(e){return this._impl.throw(e)}return(e){return this._impl.return(e)}cancel(){return this._impl.cancel()}reset(e){return this._impl.reset(e),this._DOMStream=void 0,this._nodeStream=void 0,this}open(e){let t=this._impl.open(e);return Yt(t)?t.then(()=>this):this}readRecordBatch(e){return this._impl.isFile()?this._impl.readRecordBatch(e):null}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}toDOMStream(){return Qe.toDOMStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this})}toNodeStream(){return Qe.toNodeStream(this.isSync()?{[Symbol.iterator]:()=>this}:{[Symbol.asyncIterator]:()=>this},{objectMode:!0})}static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e,t){throw new Error('"throughDOM" not available in this environment')}static from(e){return e instanceof r?e:Eu(e)?oM(e):Bu(e)?uM(e):Yt(e)?F(this,void 0,void 0,function*(){return yield r.from(yield e)}):Fu(e)||Ca(e)||Mu(e)||br(e)?cM(new Gt(e)):aM(new _r(e))}static readAll(e){return e instanceof r?e.isSync()?G0(e):z0(e):Eu(e)||ArrayBuffer.isView(e)||Br(e)||Lu(e)?G0(e):z0(e)}},$r=class extends Mt{constructor(e){super(e),this._impl=e}readAll(){return[...this]}[Symbol.iterator](){return this._impl[Symbol.iterator]()}[Symbol.asyncIterator](){return _t(this,arguments,function*(){yield Y(yield*Ao(Ht(this[Symbol.iterator]())))})}},kn=class extends Mt{constructor(e){super(e),this._impl=e}readAll(){return F(this,void 0,void 0,function*(){var e,t,n,s;let i=new Array;try{for(var o=!0,a=Ht(this),c;c=yield a.next(),e=c.done,!e;o=!0){s=c.value,o=!1;let u=s;i.push(u)}}catch(u){t={error:u}}finally{try{!o&&!e&&(n=a.return)&&(yield n.call(a))}finally{if(t)throw t.error}}return i})}[Symbol.iterator](){throw new Error("AsyncRecordBatchStreamReader is not Iterable")}[Symbol.asyncIterator](){return this._impl[Symbol.asyncIterator]()}},Nn=class extends $r{constructor(e){super(e),this._impl=e}},Jo=class extends kn{constructor(e){super(e),this._impl=e}},Gl=class{get numDictionaries(){return this._dictionaryIndex}get numRecordBatches(){return this._recordBatchIndex}constructor(e=new Map){this.closed=!1,this.autoDestroy=!0,this._dictionaryIndex=0,this._recordBatchIndex=0,this.dictionaries=e}isSync(){return!1}isAsync(){return!1}isFile(){return!1}isStream(){return!1}reset(e){return this._dictionaryIndex=0,this._recordBatchIndex=0,this.schema=e,this.dictionaries=new Map,this}_loadRecordBatch(e,t,n){let s;if(e.compression!=null){let o=Ks.get(e.compression.type);if(o?.decode&&typeof o.decode=="function"){let{decommpressedBody:a,buffers:c}=this._decompressBuffers(e,t,o);s=this._loadCompressedVectors(e,a,this.schema.fields),e=new $e(e.length,e.nodes,c,null)}else throw new Error("Record batch is compressed but codec not found")}else s=this._loadVectors(e,t,this.schema.fields);let i=D({type:new pe(this.schema.fields),length:e.length,children:s});return new de(this.schema,i,n)}_loadDictionaryBatch(e,t){let{id:n,isDelta:s}=e,{dictionaries:i,schema:o}=this,a=i.get(n),c=o.dictionaries.get(n),u;if(e.data.compression!=null){let l=Ks.get(e.data.compression.type);if(l?.decode&&typeof l.decode=="function"){let{decommpressedBody:f,buffers:d}=this._decompressBuffers(e.data,t,l);u=this._loadCompressedVectors(e.data,f,[c]),e=new bt(new $e(e.data.length,e.data.nodes,d,null,e.data.variadicBufferCounts),n,s)}else throw new Error("Dictionary batch is compressed but codec not found")}else u=this._loadVectors(e.data,t,[c]);return(a&&s?a.concat(new B(u)):new B(u)).memoize()}_loadVectors(e,t,n){return new qo(t,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion,e.variadicBufferCounts).visitMany(n)}_loadCompressedVectors(e,t,n){return new Ll(t,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion,e.variadicBufferCounts).visitMany(n)}_decompressBuffers(e,t,n){let s=[],i=[],o=0;for(let{offset:a,length:c}of e.buffers){if(c===0){s.push(new Uint8Array(0)),i.push(new Ce(o,0));continue}let u=new Ze(t.subarray(a,a+c)),l=te(u.readInt64(0)),f=u.bytes().subarray(8),d=l===-1?f:n.decode(f);s.push(d);let h=(o+7&-8)-o;o+=h,i.push(new Ce(o,d.length)),o+=d.length}return{decommpressedBody:s,buffers:i}}},Yo=class extends Gl{constructor(e,t){super(t),this._reader=Eu(e)?new Xi(this._handle=e):new qs(this._handle=e)}isSync(){return!0}isStream(){return!0}[Symbol.iterator](){return this}cancel(){!this.closed&&(this.closed=!0)&&(this.reset()._reader.return(),this._reader=null,this.dictionaries=null)}open(e){return this.closed||(this.autoDestroy=$0(this,e),this.schema||(this.schema=this._reader.readSchema())||this.cancel()),this}throw(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.throw(e):Ee}return(e){return!this.closed&&this.autoDestroy&&(this.closed=!0)?this.reset()._reader.return(e):Ee}next(){if(this.closed)return Ee;let e,{_reader:t}=this;for(;e=this._readNextMessageAndValidate();)if(e.isSchema())this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),s=t.readMessageBody(e.bodyLength);return{done:!1,value:this._loadRecordBatch(n,s,e.metadata)}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),s=t.readMessageBody(e.bodyLength),i=this._loadDictionaryBatch(n,s);this.dictionaries.set(n.id,i)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new qi(this.schema)}):this.return()}_readNextMessageAndValidate(e){return this._reader.readMessage(e)}},Qo=class extends Gl{constructor(e,t){super(t),this._reader=new Ki(this._handle=e)}isAsync(){return!0}isStream(){return!0}[Symbol.asyncIterator](){return this}cancel(){return F(this,void 0,void 0,function*(){!this.closed&&(this.closed=!0)&&(yield this.reset()._reader.return(),this._reader=null,this.dictionaries=null)})}open(e){return F(this,void 0,void 0,function*(){return this.closed||(this.autoDestroy=$0(this,e),this.schema||(this.schema=yield this._reader.readSchema())||(yield this.cancel())),this})}throw(e){return F(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.throw(e):Ee})}return(e){return F(this,void 0,void 0,function*(){return!this.closed&&this.autoDestroy&&(this.closed=!0)?yield this.reset()._reader.return(e):Ee})}next(){return F(this,void 0,void 0,function*(){if(this.closed)return Ee;let e,{_reader:t}=this;for(;e=yield this._readNextMessageAndValidate();)if(e.isSchema())yield this.reset(e.header());else if(e.isRecordBatch()){this._recordBatchIndex++;let n=e.header(),s=yield t.readMessageBody(e.bodyLength);return{done:!1,value:this._loadRecordBatch(n,s,e.metadata)}}else if(e.isDictionaryBatch()){this._dictionaryIndex++;let n=e.header(),s=yield t.readMessageBody(e.bodyLength),i=this._loadDictionaryBatch(n,s);this.dictionaries.set(n.id,i)}return this.schema&&this._recordBatchIndex===0?(this._recordBatchIndex++,{done:!1,value:new qi(this.schema)}):yield this.return()})}_readNextMessageAndValidate(e){return F(this,void 0,void 0,function*(){return yield this._reader.readMessage(e)})}},zl=class extends Yo{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(e,t){super(e instanceof gc?e:new gc(e),t)}isSync(){return!0}isFile(){return!0}open(e){if(!this.closed&&!this._footer){this.schema=(this._footer=this._readFooter()).schema;for(let t of this._footer.dictionaryBatches())t&&this._readDictionaryBatch(this._dictionaryIndex++)}return super.open(e)}readRecordBatch(e){var t;if(this.closed)return null;this._footer||this.open();let n=(t=this._footer)===null||t===void 0?void 0:t.getRecordBatch(e);if(n&&this._handle.seek(n.offset)){let s=this._reader.readMessage(se.RecordBatch);if(s?.isRecordBatch()){let i=s.header(),o=this._reader.readMessageBody(s.bodyLength);return this._loadRecordBatch(i,o,s.metadata)}}return null}_readDictionaryBatch(e){var t;let n=(t=this._footer)===null||t===void 0?void 0:t.getDictionaryBatch(e);if(n&&this._handle.seek(n.offset)){let s=this._reader.readMessage(se.DictionaryBatch);if(s?.isDictionaryBatch()){let i=s.header(),o=this._reader.readMessageBody(s.bodyLength),a=this._loadDictionaryBatch(i,o);this.dictionaries.set(i.id,a)}}}_readFooter(){let{_handle:e}=this,t=e.size-Yp,n=e.readInt32(t),s=e.readAt(t-n,n);return In.decode(s)}_readNextMessageAndValidate(e){var t;if(this._footer||this.open(),this._footer&&this._recordBatchIndex<this.numRecordBatches){let n=(t=this._footer)===null||t===void 0?void 0:t.getRecordBatch(this._recordBatchIndex);if(n&&this._handle.seek(n.offset))return this._reader.readMessage(e)}return null}},tm=class extends Qo{get footer(){return this._footer}get numDictionaries(){return this._footer?this._footer.numDictionaries:0}get numRecordBatches(){return this._footer?this._footer.numRecordBatches:0}constructor(e,...t){let n=typeof t[0]!="number"?t.shift():void 0,s=t[0]instanceof Map?t.shift():void 0;super(e instanceof vs?e:new vs(e,n),s)}isFile(){return!0}isAsync(){return!0}open(e){let t=Object.create(null,{open:{get:()=>super.open}});return F(this,void 0,void 0,function*(){if(!this.closed&&!this._footer){this.schema=(this._footer=yield this._readFooter()).schema;for(let n of this._footer.dictionaryBatches())n&&(yield this._readDictionaryBatch(this._dictionaryIndex++))}return yield t.open.call(this,e)})}readRecordBatch(e){return F(this,void 0,void 0,function*(){var t;if(this.closed)return null;this._footer||(yield this.open());let n=(t=this._footer)===null||t===void 0?void 0:t.getRecordBatch(e);if(n&&(yield this._handle.seek(n.offset))){let s=yield this._reader.readMessage(se.RecordBatch);if(s?.isRecordBatch()){let i=s.header(),o=yield this._reader.readMessageBody(s.bodyLength);return this._loadRecordBatch(i,o,s.metadata)}}return null})}_readDictionaryBatch(e){return F(this,void 0,void 0,function*(){var t;let n=(t=this._footer)===null||t===void 0?void 0:t.getDictionaryBatch(e);if(n&&(yield this._handle.seek(n.offset))){let s=yield this._reader.readMessage(se.DictionaryBatch);if(s?.isDictionaryBatch()){let i=s.header(),o=yield this._reader.readMessageBody(s.bodyLength),a=this._loadDictionaryBatch(i,o);this.dictionaries.set(i.id,a)}}})}_readFooter(){return F(this,void 0,void 0,function*(){let{_handle:e}=this;e._pending&&(yield e._pending);let t=e.size-Yp,n=yield e.readInt32(t),s=yield e.readAt(t-n,n);return In.decode(s)})}_readNextMessageAndValidate(e){return F(this,void 0,void 0,function*(){if(this._footer||(yield this.open()),this._footer&&this._recordBatchIndex<this.numRecordBatches){let t=this._footer.getRecordBatch(this._recordBatchIndex);if(t&&(yield this._handle.seek(t.offset)))return yield this._reader.readMessage(e)}return null})}},rm=class extends Yo{constructor(e,t){super(e,t)}_loadVectors(e,t,n){return new El(t,e.nodes,e.buffers,this.dictionaries,this.schema.metadataVersion,e.variadicBufferCounts).visitMany(n)}}});function lr(r){let e=r.byteLength+7&-8;return this.buffers.push(r),this.bufferRegions.push(new Ce(this._byteLength,e)),this._byteLength+=e,this}function lM(r){var e;let{type:t,length:n,typeIds:s,valueOffsets:i}=r;if(lr.call(this,s),t.mode===he.Sparse)return nm.call(this,r);if(t.mode===he.Dense){if(r.offset<=0)return lr.call(this,i),nm.call(this,r);{let o=new Int32Array(n),a=Object.create(null),c=Object.create(null);for(let u,l,f=-1;++f<n;)(u=s[f])!==void 0&&((l=a[u])===void 0&&(l=a[u]=i[f]),o[f]=i[f]-l,c[u]=((e=c[u])!==null&&e!==void 0?e:0)+1);lr.call(this,o),this.visitMany(r.children.map((u,l)=>{let f=t.typeIds[l],d=a[f],h=c[f];return u.slice(d,Math.min(n,h))}))}}return this}function fM(r){let e;return r.nullCount>=r.length?lr.call(this,new Uint8Array(r.length+7>>3)):(e=r.values)instanceof Uint8Array?lr.call(this,mi(r.offset,r.length,e)):lr.call(this,bi(r.values))}function Cn(r){return lr.call(this,r.values.subarray(0,r.length*r.stride))}function Wl(r){let{length:e,values:t,valueOffsets:n}=r,s=te(n[0]),i=te(n[e]),o=Math.min(i-s,t.byteLength-s);return lr.call(this,Du(-s,e+1,n)),lr.call(this,t.subarray(s,s+o)),this}function q0(r){let{offset:e,length:t,stride:n,values:s,variadicBuffers:i=[]}=r;if(!s)throw new Error("BinaryView data is missing view buffer");let o=e*n,a=o+t*n;lr.call(this,s.subarray(o,a));for(let c of i)lr.call(this,c);return this._variadicBufferCounts.push(i.length),this}function $l(r){let{length:e,valueOffsets:t}=r;if(t){let n=te(t[0]),s=te(t[e]);return lr.call(this,Du(-n,e+1,t)),this.visit(r.children[0].slice(n,s-n))}return this.visit(r.children[0])}function nm(r){return this.visitMany(r.type.children.map((e,t)=>r.children[t]).filter(Boolean))[0]}var Le,K0=p(()=>{ht();Vt();Me();Rn();Ke();gi();_s();we();Qr();Le=class r extends R{static assemble(...e){let t=s=>s.flatMap(i=>Array.isArray(i)?t(i):i instanceof de?i.data.children:i.data),n=new r;return n.visitMany(t(e)),n}constructor(){super(),this._byteLength=0,this._nodes=[],this._buffers=[],this._bufferRegions=[],this._variadicBufferCounts=[]}visit(e){if(e instanceof B)return this.visitMany(e.data),this;let{type:t}=e;if(!E.isDictionary(t)){let{length:n}=e;if(n>2147483647)throw new RangeError("Cannot write arrays larger than 2^31 - 1 in length");if(E.isUnion(t))this.nodes.push(new xr(n,0));else{let{nullCount:s}=e;E.isNull(t)||lr.call(this,s<=0?new Uint8Array(0):mi(e.offset,n,e.nullBitmap)),this.nodes.push(new xr(n,s))}}return super.visit(e)}visitNull(e){return this}visitDictionary(e){return this.visit(e.clone(e.type.indices))}get nodes(){return this._nodes}get buffers(){return this._buffers}get byteLength(){return this._byteLength}get bufferRegions(){return this._bufferRegions}get variadicBufferCounts(){return this._variadicBufferCounts}};Le.prototype.visitBool=fM;Le.prototype.visitInt=Cn;Le.prototype.visitFloat=Cn;Le.prototype.visitUtf8=Wl;Le.prototype.visitLargeUtf8=Wl;Le.prototype.visitUtf8View=q0;Le.prototype.visitBinary=Wl;Le.prototype.visitLargeBinary=Wl;Le.prototype.visitBinaryView=q0;Le.prototype.visitFixedSizeBinary=Cn;Le.prototype.visitDate=Cn;Le.prototype.visitTimestamp=Cn;Le.prototype.visitTime=Cn;Le.prototype.visitDecimal=Cn;Le.prototype.visitList=$l;Le.prototype.visitLargeList=$l;Le.prototype.visitStruct=nm;Le.prototype.visitUnion=lM;Le.prototype.visitInterval=Cn;Le.prototype.visitDuration=Cn;Le.prototype.visitFixedSizeList=$l;Le.prototype.visitMap=$l});var ql,X0=p(()=>{Vt();ju();Me();ql=class extends R{visit(e){return e==null?void 0:super.visit(e)}visitNull({typeId:e}){return{name:z[e].toLowerCase()}}visitInt({typeId:e,bitWidth:t,isSigned:n}){return{name:z[e].toLowerCase(),bitWidth:t,isSigned:n}}visitFloat({typeId:e,precision:t}){return{name:z[e].toLowerCase(),precision:le[t]}}visitBinary({typeId:e}){return{name:z[e].toLowerCase()}}visitLargeBinary({typeId:e}){return{name:z[e].toLowerCase()}}visitBinaryView({typeId:e}){return{name:z[e].toLowerCase()}}visitBool({typeId:e}){return{name:z[e].toLowerCase()}}visitUtf8({typeId:e}){return{name:z[e].toLowerCase()}}visitLargeUtf8({typeId:e}){return{name:z[e].toLowerCase()}}visitUtf8View({typeId:e}){return{name:z[e].toLowerCase()}}visitDecimal({typeId:e,scale:t,precision:n,bitWidth:s}){return{name:z[e].toLowerCase(),scale:t,precision:n,bitWidth:s}}visitDate({typeId:e,unit:t}){return{name:z[e].toLowerCase(),unit:ye[t]}}visitTime({typeId:e,unit:t,bitWidth:n}){return{name:z[e].toLowerCase(),unit:L[t],bitWidth:n}}visitTimestamp({typeId:e,timezone:t,unit:n}){return{name:z[e].toLowerCase(),unit:L[n],timezone:t}}visitInterval({typeId:e,unit:t}){return{name:z[e].toLowerCase(),unit:ae[t]}}visitDuration({typeId:e,unit:t}){return{name:z[e].toLocaleLowerCase(),unit:L[t]}}visitList({typeId:e}){return{name:z[e].toLowerCase()}}visitLargeList({typeId:e}){return{name:z[e].toLowerCase()}}visitStruct({typeId:e}){return{name:z[e].toLowerCase()}}visitUnion({typeId:e,mode:t,typeIds:n}){return{name:z[e].toLowerCase(),mode:he[t].toUpperCase(),typeIds:[...n]}}visitDictionary(e){return this.visit(e.dictionary)}visitFixedSizeBinary({typeId:e,byteWidth:t}){return{name:z[e].toLowerCase(),byteWidth:t}}visitFixedSizeList({typeId:e,listSize:t}){return{name:z[e].toLowerCase(),listSize:t}}visitMap({typeId:e,keysSorted:t}){return{name:z[e].toLowerCase(),keysSorted:t}}}});function*sm(r){for(let e of r)yield e.reduce((t,n)=>`${t}${("0"+(n&255).toString(16)).slice(-2)}`,"").toUpperCase()}function*Un(r,e){let t=new Uint32Array(r.buffer,r.byteOffset,r.byteLength/Uint32Array.BYTES_PER_ELEMENT);for(let n=-1,s=t.length/e;++n<s;)yield`${di.new(t.subarray((n+0)*e,(n+1)*e),!1)}`}function H0(r,e){let n=r.values,s=new DataView(n.buffer,n.byteOffset,n.byteLength),i=n.byteLength/16,o=d=>Array.from(d).map(h=>("0"+(h&255).toString(16)).slice(-2)).join("").toUpperCase(),a=Array.from({length:i},(d,h)=>{let m=h*16,b=s.getInt32(m,!0);return[m,b]}).map(([d,h])=>h>12?{SIZE:h,PREFIX_HEX:o(n.subarray(d+4,d+8)),BUFFER_INDEX:s.getInt32(d+8,!0),OFFSET:s.getInt32(d+12,!0)}:{SIZE:h,INLINED:e(n.subarray(d+4,d+4+h))}),c=[...new Set(a.map(d=>d.BUFFER_INDEX).filter(d=>d!==void 0))],u=c.map(d=>o(r.variadicBuffers[d])),l=new Map(c.map((d,h)=>[d,h]));return{VIEWS:a.map(d=>d.BUFFER_INDEX!==void 0?Object.assign(Object.assign({},d),{BUFFER_INDEX:l.get(d.BUFFER_INDEX)}):d),VARIADIC_DATA_BUFFERS:u}}var Sc,J0=p(()=>{zu();ht();Vt();Me();Me();gi();Sl();we();Sc=class r extends R{static assemble(...e){let t=new r;return e.map(({schema:n,data:s})=>t.visitMany(n.fields,s.children))}visit({name:e},t){let{length:n}=t,{offset:s,nullCount:i,nullBitmap:o}=t,a=E.isDictionary(t.type)?t.type.indices:t.type,c=Object.assign([],t.buffers,{[re.VALIDITY]:void 0});return Object.assign({name:e,count:n,VALIDITY:E.isNull(a)||E.isUnion(a)?void 0:i<=0?Array.from({length:n},()=>1):[...new tn(o,s,n,null,fl)]},super.visit(t.clone(a,s,n,0,c)))}visitNull(){return{}}visitBool({values:e,offset:t,length:n}){return{DATA:[...new tn(e,t,n,null,Vo)]}}visitInt(e){return{DATA:e.type.bitWidth<64?[...e.values]:[...Un(e.values,2)]}}visitFloat(e){return{DATA:[...e.values]}}visitUtf8(e){return{DATA:[...new B([e])],OFFSET:[...e.valueOffsets]}}visitLargeUtf8(e){return{DATA:[...new B([e])],OFFSET:[...Un(e.valueOffsets,2)]}}visitBinary(e){return{DATA:[...sm(new B([e]))],OFFSET:[...e.valueOffsets]}}visitLargeBinary(e){return{DATA:[...sm(new B([e]))],OFFSET:[...Un(e.valueOffsets,2)]}}visitBinaryView(e){return H0(e,t=>Array.from(t).map(n=>("0"+(n&255).toString(16)).slice(-2)).join("").toUpperCase())}visitUtf8View(e){return H0(e,t=>Array.from(t).map(n=>String.fromCodePoint(n)).join(""))}visitFixedSizeBinary(e){return{DATA:[...sm(new B([e]))]}}visitDate(e){return{DATA:e.type.unit===ye.DAY?[...e.values]:[...Un(e.values,2)]}}visitTimestamp(e){return{DATA:[...Un(e.values,2)]}}visitTime(e){return{DATA:e.type.unit<L.MICROSECOND?[...e.values]:[...Un(e.values,2)]}}visitDecimal(e){return{DATA:[...Un(e.values,4)]}}visitList(e){return{OFFSET:[...e.valueOffsets],children:this.visitMany(e.type.children,e.children)}}visitLargeList(e){return{OFFSET:[...Un(e.valueOffsets,2)],children:this.visitMany(e.type.children,e.children)}}visitStruct(e){return{children:this.visitMany(e.type.children,e.children)}}visitUnion(e){return{TYPE_ID:[...e.typeIds],OFFSET:e.type.mode===he.Dense?[...e.valueOffsets]:void 0,children:this.visitMany(e.type.children,e.children)}}visitInterval(e){switch(e.type.unit){case ae.YEAR_MONTH:return{DATA:[...e.values]};case ae.DAY_TIME:return{DATA:gp(e.values)};case ae.MONTH_DAY_NANO:return{DATA:yp(e.values,!0)}}}visitDuration(e){return{DATA:[...Un(e.values,2)]}}visitFixedSizeList(e){return{children:this.visitMany(e.type.children,e.children)}}visitMap(e){return{OFFSET:[...e.valueOffsets],children:this.visitMany(e.type.children,e.children)}}}});function im(r,e){let t=e;e instanceof me&&(t=e.batches,r.reset(void 0,e.schema));for(let n of t)r.write(n);return r.finish()}function om(r,e){return F(this,void 0,void 0,function*(){var t,n,s,i,o,a,c;try{for(t=!0,n=Ht(e);s=yield n.next(),i=s.done,!i;t=!0){c=s.value,t=!1;let u=c;r.write(u)}}catch(u){o={error:u}}finally{try{!t&&!i&&(a=n.return)&&(yield a.call(n))}finally{if(o)throw o.error}}return r.finish()})}function Y0({name:r,type:e,nullable:t}){let n=new ql;return{name:r,nullable:t,type:n.visit(e),children:(e.children||[]).map(s=>Y0(s)),dictionary:E.isDictionary(e)?{id:e.id,isOrdered:e.isOrdered,indexType:n.visit(e.indices)}:void 0}}function dM(r,e,t=!1){let[n]=Sc.assemble(new de({[e]:r}));return JSON.stringify({id:e,isDelta:t,data:{count:r.length,columns:n}},null,2)}function hM(r){let[e]=Sc.assemble(r);return JSON.stringify({count:r.numRows,columns:e},null,2)}var an,Pn,Vn,Ec,Kl=p(()=>{kt();$i();Vl();ht();we();_s();_s();ap();Me();vc();As();K0();X0();J0();Ke();Rn();bc();Yn();So();jl();ce();an=class extends Ti{static throughNode(e){throw new Error('"throughNode" not available in this environment')}static throughDOM(e,t){throw new Error('"throughDOM" not available in this environment')}constructor(e){if(super(),this._position=0,this._started=!1,this._compression=null,this._sink=new Tr,this._schema=null,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,At(e)||(e={autoDestroy:!0,writeLegacyIpcFormat:!1,compressionType:null}),this._autoDestroy=typeof e.autoDestroy=="boolean"?e.autoDestroy:!0,this._writeLegacyIpcFormat=typeof e.writeLegacyIpcFormat=="boolean"?e.writeLegacyIpcFormat:!1,e.compressionType!=null){if(this._writeLegacyIpcFormat)throw new Error("Legacy IPC format does not support columnar compression. Use modern IPC format (writeLegacyIpcFormat=false).");if(Object.values(et).includes(e.compressionType))this._compression=new xi(e.compressionType);else{let t=Object.values(et).filter(n=>typeof n=="string");throw new Error(`Unsupported compressionType: ${e.compressionType} Available types: ${t.join(", ")}`)}}else this._compression=null}toString(e=!1){return this._sink.toString(e)}toUint8Array(e=!1){return this._sink.toUint8Array(e)}writeAll(e){return Yt(e)?e.then(t=>this.writeAll(t)):br(e)?om(this,e):im(this,e)}get closed(){return this._sink.closed}[Symbol.asyncIterator](){return this._sink[Symbol.asyncIterator]()}toDOMStream(e){return this._sink.toDOMStream(e)}toNodeStream(e){return this._sink.toNodeStream(e)}close(){return this.reset()._sink.close()}abort(e){return this.reset()._sink.abort(e)}finish(){return this._autoDestroy?this.close():this.reset(this._sink,this._schema),this}reset(e=this._sink,t=null){return e===this._sink||e instanceof Tr?this._sink=e:(this._sink=new Tr,e&&mx(e)?this.toDOMStream({type:"bytes"}).pipeTo(e):e&&bx(e)&&this.toNodeStream({objectMode:!1}).pipe(e)),this._started&&this._schema&&this._writeFooter(this._schema),this._started=!1,this._dictionaryBlocks=[],this._recordBatchBlocks=[],this._seenDictionaries=new Map,this._dictionaryDeltaOffsets=new Map,(!t||!Wi(t,this._schema))&&(t==null?(this._position=0,this._schema=null):(this._started=!0,this._schema=t,this._writeSchema(t))),this}write(e){let t=null;if(this._sink){if(e==null)return this.finish()&&void 0;if(e instanceof me&&!(t=e.schema))return this.finish()&&void 0;if(e instanceof de&&!(t=e.schema))return this.finish()&&void 0}else throw new Error("RecordBatchWriter is closed");if(t&&!Wi(t,this._schema)){if(this._started&&this._autoDestroy)return this.close();this.reset(this._sink,t)}e instanceof de?e instanceof qi||this._writeRecordBatch(e):e instanceof me?this.writeAll(e.batches):Br(e)&&this.writeAll(e)}_writeMessage(e,t=8){let n=t-1,s=gt.encode(e),i=s.byteLength,o=this._writeLegacyIpcFormat?4:8,a=i+o+n&~n,c=a-i-o;return e.headerType===se.RecordBatch?this._recordBatchBlocks.push(new Gr(a,e.bodyLength,this._position)):e.headerType===se.DictionaryBatch&&this._dictionaryBlocks.push(new Gr(a,e.bodyLength,this._position)),this._writeLegacyIpcFormat||this._write(Int32Array.of(-1)),this._write(Int32Array.of(a-o)),i>0&&this._write(s),this._writePadding(c)}_write(e){if(this._started){let t=k(e);t&&t.byteLength>0&&(this._sink.write(t),this._position+=t.byteLength)}return this}_writeSchema(e){return this._writeMessage(gt.from(e))}_writeFooter(e){return this._writeLegacyIpcFormat?this._write(Int32Array.of(0)):this._write(Int32Array.of(-1,0))}_writeMagic(){return this._write(Xo)}_writePadding(e){return e>0?this._write(new Uint8Array(e)):this}_writeRecordBatch(e){let{byteLength:t,nodes:n,bufferRegions:s,buffers:i,variadicBufferCounts:o}=this._assembleRecordBatch(e),a=new $e(e.numRows,n,s,this._compression,o,e.metadata),c=gt.from(a,t);return this._writeDictionaries(e)._writeMessage(c)._writeBodyBuffers(i)}_assembleRecordBatch(e){let{byteLength:t,nodes:n,bufferRegions:s,buffers:i,variadicBufferCounts:o}=Le.assemble(e);return this._compression!=null&&({byteLength:t,bufferRegions:s,buffers:i}=this._compressBodyBuffers(i)),{byteLength:t,nodes:n,bufferRegions:s,buffers:i,variadicBufferCounts:o}}_compressBodyBuffers(e){let t=Ks.get(this._compression.type);if(!t?.encode||typeof t.encode!="function")throw new Error(`Codec for compression type "${et[this._compression.type]}" has invalid encode method`);let n=0,s=[],i=[];for(let a of e){let c=k(a);if(c.length===0){s.push(new Uint8Array(0),new Uint8Array(0)),i.push(new Ce(n,0));continue}let u=t.encode(c),l=u.length<c.length,f=l?u:c,d=l?f.length:-1,h=new Ze(new Uint8Array(8));h.writeInt64(0,BigInt(d)),s.push(h.bytes(),new Uint8Array(f));let m=(n+7&-8)-n;n+=m;let b=8+f.length;i.push(new Ce(n,b)),n+=b}let o=(n+7&-8)-n;return n+=o,{byteLength:n,bufferRegions:i,buffers:s}}_writeDictionaryBatch(e,t,n=!1){let{byteLength:s,nodes:i,bufferRegions:o,buffers:a,variadicBufferCounts:c}=this._assembleRecordBatch(new B([e])),u=new $e(e.length,i,o,this._compression,c),l=new bt(u,t,n),f=gt.from(l,s);return this._writeMessage(f)._writeBodyBuffers(a)}_writeBodyBuffers(e){let t=this._compression!=null?2:1,n=new Array(t);for(let s=0;s<e.length;s+=t){let i=0;for(let a=-1;++a<t;)n[a]=e[s+a],i+=n[a].byteLength;if(i===0)continue;for(let a of n)this._write(a);let o=(i+7&-8)-i;o>0&&this._writePadding(o)}return this}_writeDictionaries(e){var t,n;for(let[s,i]of e.dictionaries){let o=(t=i?.data)!==null&&t!==void 0?t:[],a=this._seenDictionaries.get(s),c=(n=this._dictionaryDeltaOffsets.get(s))!==null&&n!==void 0?n:0;if(!a||a.data[0]!==o[0])for(let[u,l]of o.entries())this._writeDictionaryBatch(l,s,u>0);else if(c<o.length)for(let u of o.slice(c))this._writeDictionaryBatch(u,s,!0);this._seenDictionaries.set(s,i),this._dictionaryDeltaOffsets.set(s,o.length)}return this}},Pn=class r extends an{static writeAll(e,t){let n=new r(t);return Yt(e)?e.then(s=>n.writeAll(s)):br(e)?om(n,e):im(n,e)}},Vn=class r extends an{static writeAll(e,t){let n=new r(t);return Yt(e)?e.then(s=>n.writeAll(s)):br(e)?om(n,e):im(n,e)}constructor(e){super(e),this._autoDestroy=!0,this._writeLegacyIpcFormat=!1}_writeSchema(e){return this._writeMagic()._writePadding(2)}_writeDictionaryBatch(e,t,n=!1){if(!n&&this._seenDictionaries.has(t))throw new Error("The Arrow File format does not support replacement dictionaries. ");return super._writeDictionaryBatch(e,t,n)}_writeFooter(e){let t=In.encode(new In(e,ge.V5,this._recordBatchBlocks,this._dictionaryBlocks));return super._writeFooter(e)._write(t)._write(Int32Array.of(t.byteLength))._writeMagic()}},Ec=class r extends an{static writeAll(e){return new r().writeAll(e)}constructor(){super(),this._autoDestroy=!0,this._recordBatches=[],this._recordBatchesWithDictionaries=[]}_writeMessage(){return this}_writeFooter(e){return this}_writeSchema(e){return this._write(`{
|
|
22
|
+
"schema": ${JSON.stringify({fields:e.fields.map(t=>Y0(t))},null,2)}`)}_writeDictionaries(e){return e.dictionaries.size>0&&this._recordBatchesWithDictionaries.push(e),this}_writeDictionaryBatch(e,t,n=!1){return this._write(this._dictionaryBlocks.length===0?" ":`,
|
|
23
|
+
`),this._write(dM(e,t,n)),this._dictionaryBlocks.push(new Gr(0,0,0)),this}_writeRecordBatch(e){return this._writeDictionaries(e),this._recordBatches.push(e),this}close(){if(this._recordBatchesWithDictionaries.length>0){this._write(`,
|
|
24
24
|
"dictionaries": [
|
|
25
25
|
`);for(let e of this._recordBatchesWithDictionaries)super._writeDictionaries(e);this._write(`
|
|
26
26
|
]`)}if(this._recordBatches.length>0){for(let e=-1,t=this._recordBatches.length;++e<t;)this._write(e===0?`,
|
|
27
27
|
"batches": [
|
|
28
28
|
`:`,
|
|
29
|
-
`),this._write(
|
|
29
|
+
`),this._write(hM(this._recordBatches[e])),this._recordBatchBlocks.push(new Gr(0,0,0));this._write(`
|
|
30
30
|
]`)}return this._schema&&this._write(`
|
|
31
|
-
}`),this._recordBatchesWithDictionaries=[],this._recordBatches=[],super.close()}}});function g0(r,e){if(hr(r))return pO(r,e);if(Ar(r))return hO(r,e);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function hO(r,e){let t=null,n=e?.type==="bytes"||!1,s=e?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(o){i(o,t||(t=r[Symbol.iterator]()))},pull(o){t?i(o,t):o.close()},cancel(){t?.return&&t.return(),t=null}}),Object.assign({highWaterMark:n?s:void 0},e));function i(o,a){let c,u=null,f=o.desiredSize||null;for(;!(u=a.next(n?f:null)).done;)if(ArrayBuffer.isView(u.value)&&(c=D(u.value))&&(f!=null&&n&&(f=f-c.byteLength+1),u.value=c),o.enqueue(u.value),f!=null&&--f<=0)return;o.close()}}function pO(r,e){let t=null,n=e?.type==="bytes"||!1,s=e?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(o){return B(this,void 0,void 0,function*(){yield i(o,t||(t=r[Symbol.asyncIterator]()))})},pull(o){return B(this,void 0,void 0,function*(){t?yield i(o,t):o.close()})},cancel(){return B(this,void 0,void 0,function*(){t?.return&&(yield t.return()),t=null})}}),Object.assign({highWaterMark:n?s:void 0},e));function i(o,a){return B(this,void 0,void 0,function*(){let c,u=null,f=o.desiredSize||null;for(;!(u=yield a.next(n?f:null)).done;)if(ArrayBuffer.isView(u.value)&&(c=D(u.value))&&(f!=null&&n&&(f=f-c.byteLength+1),u.value=c),o.enqueue(u.value),f!=null&&--f<=0)return;o.close()})}}var y0=p(()=>{Ft();$e();qn()});function T0(r){return new Gp(r)}var Gp,w0,x0,_0=p(()=>{Ft();bc();Gp=class{constructor(e){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:t,["writableStrategy"]:n,["queueingStrategy"]:s="count"}=e,i=Ow(e,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=Cr(i),this._getSize=s!=="bytes"?w0:x0;let{["highWaterMark"]:o=s==="bytes"?Math.pow(2,14):1e3}=Object.assign({},t),{["highWaterMark"]:a=s==="bytes"?Math.pow(2,14):1e3}=Object.assign({},n);this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:c=>{this._maybeFlush(this._builder,this._controller=c)},start:c=>{this._maybeFlush(this._builder,this._controller=c)}},{highWaterMark:o,size:s!=="bytes"?w0:x0}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:a,size:c=>this._writeValueAndReturnChunkSize(c)})}_writeValueAndReturnChunkSize(e){let t=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(e)),this._bufferedSize-t}_maybeFlush(e,t){t!=null&&(this._bufferedSize>=t.desiredSize&&++this._numChunks&&this._enqueue(t,e.toVector()),e.finished&&((e.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(t,e.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(t,null)))}_enqueue(e,t){this._bufferedSize=0,this._controller=null,t==null?e.close():e.enqueue(t)}},w0=r=>{var e;return(e=r?.length)!==null&&e!==void 0?e:0},x0=r=>{var e;return(e=r?.byteLength)!==null&&e!==void 0?e:0}});function Pf(r,e){let t=new yr,n=null,s=new ReadableStream({cancel(){return B(this,void 0,void 0,function*(){yield t.close()})},start(a){return B(this,void 0,void 0,function*(){yield o(a,n||(n=yield i()))})},pull(a){return B(this,void 0,void 0,function*(){n?yield o(a,n):a.close()})}});return{writable:new WritableStream(t,Object.assign({highWaterMark:Math.pow(2,14)},r)),readable:s};function i(){return B(this,void 0,void 0,function*(){return yield(yield Et.from(t)).open(e)})}function o(a,c){return B(this,void 0,void 0,function*(){let u=a.desiredSize,f=null;for(;!(f=yield c.next()).done;)if(a.enqueue(f.value),u!=null&&--u<=0)return;a.close()})}}var A0=p(()=>{Ft();ys();Tc()});function jf(r,e){let t=new this(r),n=new Ct(t),s=new ReadableStream({cancel(){return B(this,void 0,void 0,function*(){yield n.cancel()})},pull(o){return B(this,void 0,void 0,function*(){yield i(o)})},start(o){return B(this,void 0,void 0,function*(){yield i(o)})}},Object.assign({highWaterMark:Math.pow(2,14)},e));return{writable:new WritableStream(t,r),readable:s};function i(o){return B(this,void 0,void 0,function*(){let a=null,c=o.desiredSize;for(;a=yield n.read(c||null);)if(o.enqueue(a),c!=null&&(c-=a.byteLength)<=0)return;o.close()})}}var v0=p(()=>{Ft();ys()});function vc(r){let e=Et.from(r);return Kt(e)?e.then(t=>vc(t)):e.isAsync()?e.readAll().then(t=>new be(t)):new be(e.readAll())}function Gf(r,e="stream",t=null){let n={compressionType:t};return(e==="stream"?Dn:Nn).writeAll(r,n).toUint8Array(!0)}var I0=p(()=>{Pi();qn();Tc();Vf()});var zp={};J(zp,{isArrowData:()=>qf,isArrowDataType:()=>$f,isArrowField:()=>Wf,isArrowRecordBatch:()=>Xf,isArrowSchema:()=>zf,isArrowTable:()=>Hf,isArrowVector:()=>Kf});function zf(r){return Y.isSchema(r)}function Wf(r){return F.isField(r)}function $f(r){return S.isDataType(r)}function qf(r){return k.isData(r)}function Kf(r){return L.isVector(r)}function Xf(r){return le.isRecordBatch(r)}function Hf(r){return be.isTable(r)}var Wp=p(()=>{ht();ye();br();lt();Bn();Pi()});var S0,$p=p(()=>{Ru();To();Fe();br();ye();Pi();lt();Nt();ht();oc();Zu();ve();bc();tp();pp();rp();np();sp();ip();ap();fp();gp();bp();cp();up();wp();Tp();xp();Tf();Af();_f();lp();dp();op();hp();mp();yp();ys();Tc();Vf();I0();Rf();Mf();gs();Bn();Wp();Du();Hh();di();ic();$e();Do();Ya();yf();Wp();xc();S0=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},yh),Xh),Dh),wh),Ud),Rh),ph),ep),zp),{compareSchemas:Vi,compareFields:XT,compareTypes:Sf})});var kn={};J(kn,{AsyncByteQueue:()=>yr,AsyncByteStream:()=>Ct,AsyncMessageReader:()=>Gi,AsyncRecordBatchFileReader:()=>$o,AsyncRecordBatchStreamReader:()=>Fn,Binary:()=>Mt,BinaryBuilder:()=>An,BinaryView:()=>Q,BinaryViewBuilder:()=>Sn,Bool:()=>ct,BoolBuilder:()=>gi,BufferType:()=>te,Builder:()=>xe,ByteStream:()=>wr,CompressionType:()=>Qe,Data:()=>k,DataType:()=>S,DateBuilder:()=>Yr,DateDay:()=>ts,DateDayBuilder:()=>xs,DateMillisecond:()=>rs,DateMillisecondBuilder:()=>Ts,DateUnit:()=>ge,Date_:()=>_t,Decimal:()=>Rt,DecimalBuilder:()=>_s,DenseUnion:()=>gn,DenseUnionBuilder:()=>Ci,Dictionary:()=>Pe,DictionaryBuilder:()=>yi,Duration:()=>At,DurationBuilder:()=>xr,DurationMicrosecond:()=>rc,DurationMicrosecondBuilder:()=>Bs,DurationMillisecond:()=>tc,DurationMillisecondBuilder:()=>Ls,DurationNanosecond:()=>nc,DurationNanosecondBuilder:()=>Fs,DurationSecond:()=>ec,DurationSecondBuilder:()=>Es,Field:()=>F,FixedSizeBinary:()=>Dt,FixedSizeBinaryBuilder:()=>As,FixedSizeList:()=>Ee,FixedSizeListBuilder:()=>wi,Float:()=>ot,Float16:()=>Or,Float16Builder:()=>xi,Float32:()=>xt,Float32Builder:()=>Ti,Float64:()=>er,Float64Builder:()=>_i,FloatBuilder:()=>Qr,Int:()=>Le,Int16:()=>Jt,Int16Builder:()=>vi,Int32:()=>Ce,Int32Builder:()=>Ii,Int64:()=>Yt,Int64Builder:()=>Si,Int8:()=>Ht,Int8Builder:()=>Ai,IntBuilder:()=>It,Interval:()=>ut,IntervalBuilder:()=>Ur,IntervalDayTime:()=>fs,IntervalDayTimeBuilder:()=>vs,IntervalMonthDayNano:()=>Za,IntervalMonthDayNanoBuilder:()=>Ss,IntervalUnit:()=>oe,IntervalYearMonth:()=>ls,IntervalYearMonthBuilder:()=>Is,JSONMessageReader:()=>zi,LargeBinary:()=>Mr,LargeBinaryBuilder:()=>vn,LargeList:()=>tr,LargeListBuilder:()=>Mi,LargeUtf8:()=>Rr,LargeUtf8Builder:()=>Ps,List:()=>Ve,ListBuilder:()=>Oi,MapBuilder:()=>Ri,MapRow:()=>mr,Map_:()=>ft,Message:()=>mt,MessageHeader:()=>ne,MessageReader:()=>js,MetadataVersion:()=>me,Null:()=>De,NullBuilder:()=>Di,Precision:()=>ue,RecordBatch:()=>le,RecordBatchFileReader:()=>On,RecordBatchFileWriter:()=>Nn,RecordBatchJSONWriter:()=>Ac,RecordBatchReader:()=>Et,RecordBatchStreamReader:()=>Vr,RecordBatchStreamWriter:()=>Dn,RecordBatchWriter:()=>en,Schema:()=>Y,SparseUnion:()=>ds,SparseUnionBuilder:()=>ki,Struct:()=>he,StructBuilder:()=>Ni,StructRow:()=>Xr,Table:()=>be,Time:()=>Ze,TimeBuilder:()=>_r,TimeMicrosecond:()=>is,TimeMicrosecondBuilder:()=>Cs,TimeMillisecond:()=>ss,TimeMillisecondBuilder:()=>ks,TimeNanosecond:()=>os,TimeNanosecondBuilder:()=>Us,TimeSecond:()=>ns,TimeSecondBuilder:()=>Ns,TimeUnit:()=>E,Timestamp:()=>et,TimestampBuilder:()=>Tr,TimestampMicrosecond:()=>cs,TimestampMicrosecondBuilder:()=>Rs,TimestampMillisecond:()=>Kr,TimestampMillisecondBuilder:()=>Ms,TimestampNanosecond:()=>us,TimestampNanosecondBuilder:()=>Ds,TimestampSecond:()=>as,TimestampSecondBuilder:()=>Os,Type:()=>y,Uint16:()=>Zt,Uint16Builder:()=>Li,Uint32:()=>wt,Uint32Builder:()=>Bi,Uint64:()=>Fr,Uint64Builder:()=>Fi,Uint8:()=>Qt,Uint8Builder:()=>Ei,Union:()=>vt,UnionBuilder:()=>In,UnionMode:()=>de,Utf8:()=>at,Utf8Builder:()=>Vs,Utf8View:()=>Tt,Utf8ViewBuilder:()=>Ui,Vector:()=>L,Visitor:()=>R,builderThroughAsyncIterable:()=>Sp,builderThroughIterable:()=>Lf,compressionRegistry:()=>Gs,isArrowData:()=>qf,isArrowDataType:()=>$f,isArrowField:()=>Wf,isArrowRecordBatch:()=>Xf,isArrowSchema:()=>zf,isArrowTable:()=>Hf,isArrowVector:()=>Kf,makeBuilder:()=>Cr,makeData:()=>M,makeTable:()=>Ep,makeVector:()=>Jr,tableFromArrays:()=>Lp,tableFromIPC:()=>vc,tableFromJSON:()=>Ip,tableToIPC:()=>Gf,util:()=>S0,vectorFromArray:()=>Go});var zs=p(()=>{ka();ve();Tc();Vf();y0();_0();A0();v0();$p();$p();Je.toDOMStream=g0;xe.throughDOM=T0;Et.throughDOM=Pf;On.throughDOM=Pf;Vr.throughDOM=Pf;en.throughDOM=jf;Nn.throughDOM=jf;Dn.throughDOM=jf});function Xo(r){return{fields:r.fields.map(e=>Wi(e)),metadata:O0(r.metadata)}}function F0(r,e){return new Y(r.fields.map(t=>tn(t,e)),Jf(r.metadata))}function O0(r){return Object.fromEntries(r)}function Jf(r){return r?new Map(Object.entries(r)):new Map}function Wi(r){return{name:r.name,type:Yf(r.type),nullable:r.nullable,metadata:O0(r.metadata)}}function tn(r,e){return new F(r.name,Ho(r.type,e),r.nullable,Jf(r.metadata))}function Yf(r){if(E0(r,"BinaryView"))return"binary-view";if(E0(r,"Utf8View"))return"utf8-view";if(mO(r,"LargeList"))return{type:"large-list",children:[Wi(r.valueField)]};switch(r.constructor){case De:return"null";case Mt:return"binary";case Dt:return{type:"fixed-size-binary",byteWidth:r.byteWidth};case ct:return"bool";case Le:let e=r;return`${e.isSigned?"":"u"}int${e.bitWidth}`;case Ht:return"int8";case Jt:return"int16";case Ce:return"int32";case Yt:return"int64";case Qt:return"uint8";case Zt:return"uint16";case wt:return"uint32";case Fr:return"uint64";case ot:switch(r.precision){case ue.HALF:return"float16";case ue.SINGLE:return"float32";case ue.DOUBLE:return"float64";default:return"float16"}case Or:return"float16";case xt:return"float32";case er:return"float64";case at:return"utf8";case Rt:let n=r;return{type:"decimal",bitWidth:n.bitWidth,precision:n.precision,scale:n.scale};case _t:return r.unit===ge.DAY?"date-day":"date-millisecond";case ts:return"date-day";case rs:return"date-millisecond";case Ze:switch(r.unit){case E.SECOND:return"time-second";case E.MILLISECOND:return"time-millisecond";case E.MICROSECOND:return"time-microsecond";case E.NANOSECOND:return"time-nanosecond";default:return"time-second"}case ss:return"time-millisecond";case ns:return"time-second";case is:return"time-microsecond";case os:return"time-nanosecond";case et:switch(r.unit){case E.SECOND:return"timestamp-second";case E.MILLISECOND:return"timestamp-millisecond";case E.MICROSECOND:return"timestamp-microsecond";case E.NANOSECOND:return"timestamp-nanosecond";default:return"timestamp-second"}case as:return"timestamp-second";case Kr:return"timestamp-millisecond";case cs:return"timestamp-microsecond";case us:return"timestamp-nanosecond";case ut:switch(r.unit){case oe.DAY_TIME:return"interval-daytime";case oe.YEAR_MONTH:return"interval-yearmonth";default:return"interval-daytime"}case fs:return"interval-daytime";case ls:return"interval-yearmonth";case ft:let c=r;return{type:"map",keysSorted:c.keysSorted,children:c.children.map(b=>Wi(b))};case Ve:let f=r.valueField;return{type:"list",children:[Wi(f)]};case Ee:let l=r;return{type:"fixed-size-list",listSize:l.listSize,children:[Wi(l.children[0])]};case he:return{type:"struct",children:r.children.map(b=>Wi(b))};case ds:case gn:let h=r;return{type:h instanceof gn?"dense-union":"sparse-union",typeIds:h.typeIds,children:h.children.map(b=>Wi(b)),typeIdToChildIndex:{...h.typeIdToChildIndex}};case Pe:let m=r;return{type:"dictionary",id:m.id,indices:bO(m.indices),dictionary:Yf(m.dictionary),isOrdered:m.isOrdered};default:throw new Error(`arrow type not supported: ${r.constructor.name}`)}}function Ho(r,e){if(typeof r=="object")switch(r.type){case"decimal":return new Rt(r.scale,r.precision,r.bitWidth);case"map":{let t=r.children.map(n=>tn(n,e));return new ft(t[0],r.keysSorted)}case"list":{let t=tn(r.children[0],e);return new Ve(t)}case"large-list":{let t=tn(r.children[0],e),n=Ic("LargeList");if(!n)throw new Error("LargeList requires an Apache Arrow runtime that exports the LargeList constructor");return new n(t)}case"fixed-size-list":{let t=tn(r.children[0],e);return new Ee(r.listSize,t)}case"fixed-size-binary":return new Dt(r.byteWidth);case"struct":{let t=r.children.map(n=>tn(n,e));return new he(t)}case"sparse-union":case"dense-union":{let t=r.children.map(n=>tn(n,e));return r.type==="dense-union"?new gn(r.typeIds,t):new ds(r.typeIds,t)}case"dictionary":return new Pe(Ho(r.dictionary,e),yO(r.indices),r.id,r.isOrdered);default:throw new Error("array type not supported")}switch(r){case"null":return new De;case"binary":return L0("BinaryView",new Mt,e);case"binary-view":return B0("BinaryView");case"bool":return new ct;case"int8":return new Ht;case"int16":return new Jt;case"int32":return new Ce;case"int64":return new Yt;case"uint8":return new Qt;case"uint16":return new Zt;case"uint32":return new wt;case"uint64":return new Fr;case"float16":return new Or;case"float32":return new xt;case"float64":return new er;case"utf8":return L0("Utf8View",new at,e);case"utf8-view":return B0("Utf8View");case"date-day":return new ts;case"date-millisecond":return new rs;case"time-second":return new ns;case"time-millisecond":return new ss;case"time-microsecond":return new is;case"time-nanosecond":return new os;case"timestamp-second":return new as;case"timestamp-millisecond":return new Kr;case"timestamp-microsecond":return new cs;case"timestamp-nanosecond":return new us;case"interval-daytime":return new fs;case"interval-yearmonth":return new ls;default:throw new Error("array type not supported")}}function Ic(r){return kn[r]}function E0(r,e){let t=Ic(e);if(t&&r instanceof t)return!0;let n=S;return!!(e==="BinaryView"?n.isBinaryView:n.isUtf8View)?.(r)}function mO(r,e){let t=Ic(e);return!!(t&&r instanceof t)}function L0(r,e,t){let n=t?.viewTypes||"never";if(n==="never")return e;let s=Ic(r);if(s)return new s;if(n==="require")throw new Error(`${r} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`);return e}function B0(r){let e=Ic(r);if(!e)throw new Error(`${r} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`);return new e}function bO(r){if(r instanceof Le){let t=`${r.isSigned?"int":"uint"}${r.bitWidth}`;if(gO(t))return t}switch(r.constructor){case Ht:return"int8";case Jt:return"int16";case Ce:return"int32";case Qt:return"uint8";case Zt:return"uint16";case wt:return"uint32";default:throw new Error(`arrow dictionary index type not supported: ${r.constructor.name}`)}}function gO(r){return["int8","int16","int32","uint8","uint16","uint32"].includes(r)}function yO(r){switch(r){case"int8":return new Ht;case"int16":return new Jt;case"int32":return new Ce;case"uint8":return new Qt;case"uint16":return new Zt;case"uint32":return new wt;default:throw new Error(`schema dictionary index type not supported: ${r}`)}}var Sc=p(()=>{"use strict";zs()});function M0(r,e={}){let t={...e,copies:new WeakMap};return wO(r)?_O(r,t):xO(r)?R0(r,t):TO(r)?D0(r,t):Zf(r,t)}function wO(r){return"batches"in r}function xO(r){return"schema"in r&&"data"in r&&!Array.isArray(r.data)}function TO(r){return"data"in r&&Array.isArray(r.data)}function _O(r,e){let t=r.batches.map(n=>R0(n,e));return new be(r.schema,t)}function R0(r,e){return new le(r.schema,Zf(r.data,e))}function Zf(r,e){let t=r.children.map(i=>Zf(i,e)),n=r.dictionary?D0(r.dictionary,e):void 0,s={[te.OFFSET]:Qf(r.buffers[te.OFFSET],e),[te.DATA]:Qf(r.buffers[te.DATA],e),[te.VALIDITY]:Qf(r.buffers[te.VALIDITY],e),[te.TYPE]:Qf(r.buffers[te.TYPE],e)};return new k(r.type,r.offset,r.length,r._nullCount,s,t,n)}function D0(r,e){return new L(r.data.map(t=>Zf(t,e)))}function Qf(r,e){if(!AO(r)||e.copy==="none"||e.copy!=="all"&&r.byteOffset===0&&r.byteLength===r.buffer.byteLength)return r;let t=e.copies.get(r);return t||(t=r.slice(),e.copies.set(r,t)),t}function AO(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}var qp=p(()=>{"use strict";zs()});function N0(r,e){let t=M0(r,e);return{shape:"arrow-table",transport:"arrow-js",schema:Xo(t.schema),batches:t.batches.map(n=>vO(n))}}function k0(r){let e=F0(r.schema),t=r.batches.map(n=>new le(e,Hp(n.data)));return new be(e,t)}function $i(r){if(!C0(r))throw new Error("Workers require Arrow table output");let{data:e,...t}=r;return{...structuredClone(t),data:N0(e,{copy:"all"})}}function Kp(r){if(!U0(r))throw new Error("Workers require Arrow column transport");return{...r,data:k0(r.data)}}function el(r,e){if(!C0(r))return r;let t=e,n=t?.core?.workerTransferBufferCopy??t?.workerTransferBufferCopy;return{...r,data:N0(r.data,n?{copy:n}:void 0)}}function tl(r){return U0(r)?{...r,data:k0(r.data)}:r}function C0(r){let e=r;return!!(e&&e.shape==="arrow-table"&&e.data&&typeof e.data=="object"&&"batches"in e.data)}function U0(r){let e=r;return!!(e&&e.shape==="arrow-table"&&e.data&&e.data.transport==="arrow-js"&&Array.isArray(e.data.batches))}function vO(r){return{data:Xp(r.data)}}function Xp(r){return{type:Yf(r.type),offset:r.offset,length:r.length,nullCount:r._nullCount,buffers:{[te.OFFSET]:r.buffers[te.OFFSET],[te.DATA]:r.buffers[te.DATA],[te.VALIDITY]:r.buffers[te.VALIDITY],[te.TYPE]:r.buffers[te.TYPE]},children:r.children.map(e=>Xp(e)),dictionary:r.dictionary?IO(r.dictionary):void 0}}function IO(r){return{data:r.data.map(e=>Xp(e))}}function Hp(r){let e=r.children.map(n=>Hp(n)),t=r.dictionary?SO(r.dictionary):void 0;return new k(Ho(r.type),r.offset,r.length,r.nullCount,r.buffers,e,t)}function SO(r){return new L(r.data.map(e=>Hp(e)))}var V0=p(()=>{"use strict";zs();Sc();qp()});var Jo=p(()=>{"use strict";V0();qp()});async function Ws(r,e,t,n){return n._parse(r,e,t,n)}var P0=p(()=>{"use strict"});function ar(r,e){if(!r)throw new Error(e||"loader assertion failed.")}var Jp=p(()=>{"use strict"});var rn,EO,LO,BO,FO,Cn,j0,OO,Yp=p(()=>{"use strict";rn={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},EO=rn.self||rn.window||rn.global||{},LO=rn.window||rn.self||rn.global||{},BO=rn.global||rn.self||rn.window||{},FO=rn.document||{},Cn=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),j0=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),OO=j0&&parseFloat(j0[1])||0});var G0,z0=p(()=>{"use strict";G0=r=>typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer});function qi(r,e){return new Promise((t,n)=>{let s=!1;function i(a){s||(s=!0,n(a))}function o(a){if(!s){s=!0;try{t(e(a))}catch(c){n(c)}}}try{r(o,i)?.then(o,i)}catch(a){i(a)}})}var W0=p(()=>{"use strict"});function Qp(r){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,r)}function Zp(r){return globalThis.loaders?.modules?.[r]||null}var em=p(()=>{"use strict"});var $0,Y$,Q$,tm,q0=p(()=>{"use strict";$0="master",Y$=`https://raw.githubusercontent.com/visgl/loaders.gl/${$0}/`,Q$=`https://github.com/visgl/loaders.gl/raw/${$0}/`,tm="beta"});var K0=p(()=>{"use strict";q0()});function MO(){let r="5.0.0-beta.4";return globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version||=r,r}var X0,H0=p(()=>{"use strict";X0=MO()});function rl(r,e){if(!r)throw new Error(e||"loaders.gl assertion failed.")}var rm=p(()=>{"use strict"});var nn,s5,i5,o5,a5,qe,Ki,Y0,J0,c5,Ec=p(()=>{"use strict";nn={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},s5=nn.self||nn.window||nn.global||{},i5=nn.window||nn.self||nn.global||{},o5=nn.global||nn.self||nn.window||{},a5=nn.document||{},qe=typeof process!="object"||String(process)!=="[object process]"||process.browser,Ki=typeof importScripts=="function",Y0=typeof window<"u"&&typeof window.orientation<"u",J0=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),c5=J0&&parseFloat(J0[1])||0});var nl,nm=p(()=>{nl="latest"});function RO(){return typeof __VERSION__>"u"?nl:__VERSION__}var sm,Q0=p(()=>{nm();sm=RO()});function Xi(r,e){if(!r)throw new Error(e||"loaders.gl assertion failed.")}var sl=p(()=>{});var sn,p5,m5,b5,g5,Ut,e_,Z0,y5,Yo=p(()=>{sn={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},p5=sn.self||sn.window||sn.global||{},m5=sn.window||sn.self||sn.global||{},b5=sn.global||sn.self||sn.window||{},g5=sn.document||{},Ut=typeof process!="object"||String(process)!=="[object process]"||process.browser,e_=typeof window<"u"&&typeof window.orientation<"u",Z0=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),y5=Z0&&parseFloat(Z0[1])||0});function t_(r){let e=new Error(r);return e.name="AbortError",e}var Lc,r_=p(()=>{Lc=class{constructor(e,t){this.isRunning=!0,this.isCancelled=!1,this.failed=!1,this.postMessageMs=0,this.complete=()=>{},this.processStarted=!1,this._resolve=()=>{},this._reject=()=>{},this.name=e,this.workerThread=t,this.completion=new Promise(n=>{this.complete=n}),this.result=new Promise((n,s)=>{this._resolve=n,this._reject=s})}postMessage(e,t,n){if(!this.isRunning||this.isCancelled)return;let s=performance.now();(e==="process"||e==="process-in-batches"||e==="preload")&&(this.processStarted=!0);try{this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t},n)}finally{this.postMessageMs+=performance.now()-s}}done(e){this.isRunning&&(this.isRunning=!1,this.executionMs=e?.executionMs,clearTimeout(this.cancellationTimer),this.complete(),this.isCancelled||this._resolve(e))}error(e){this.isRunning&&(this.isRunning=!1,this.failed=!0,this.sharedState?.snapshot.cancelled&&(this.isCancelled=!0),clearTimeout(this.cancellationTimer),this.complete(),this._reject(e))}cancel(e,t=1e3){if(!this.isRunning||this.isCancelled)return;if(!Number.isFinite(t)||t<0){this.abort(new RangeError("cancellationTimeout must be finite and nonnegative"));return}this.isCancelled=!0,this.sharedState?.cancel();let n=arguments.length?e:t_(`Worker job "${this.name}" was cancelled`);if(!this.processStarted){this.error(n);return}this._reject(n);try{this.workerThread.postMessage({source:"loaders.gl",type:"cancel",payload:{}},[]),this.cancellationTimer=setTimeout(()=>this.abort(e),t)}catch(s){this.abort(s)}}abort(e){this.isRunning&&(this.isCancelled=!0,this.sharedState?.cancel(),this.workerThread.destroy(),this.error(arguments.length?e:t_(`Worker job "${this.name}" was aborted`)))}}});var Qo,T5,n_=p(()=>{Qo=class{constructor(...e){let n=globalThis.process?.getBuiltinModule?.("node:worker_threads").Worker;if(n)return new n(...e)}terminate(){}},T5=globalThis.process?.getBuiltinModule?.("node:worker_threads")?.parentPort??null});function s_(r){if(Xi(r.source&&!r.url||!r.source&&r.url),r.url&&r.workerType==="module"){let t=globalThis.document?.baseURI??globalThis.location?.href;if(!t)return r.url;let n=new URL(r.url,t),s=globalThis.location?.origin;return/^https?:$/.test(n.protocol)&&n.origin!==s?om(`import ${JSON.stringify(n.href)};`):r.url}let e=im.get(r.source||r.url);return e||(r.url&&(e=DO(r.url),im.set(r.url,e)),r.source&&(e=om(r.source),im.set(r.source,e))),Xi(e),e}function DO(r){if(!r.startsWith("http"))return r;let e=NO(r);return om(e)}function om(r){let e=new Blob([r],{type:"application/javascript"});return URL.createObjectURL(e)}function NO(r){return`try {
|
|
31
|
+
}`),this._recordBatchesWithDictionaries=[],this._recordBatches=[],super.close()}}});function Q0(r,e){if(br(r))return mM(r,e);if(Br(r))return pM(r,e);throw new Error("toDOMStream() must be called with an Iterable or AsyncIterable")}function pM(r,e){let t=null,n=e?.type==="bytes"||!1,s=e?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(o){i(o,t||(t=r[Symbol.iterator]()))},pull(o){t?i(o,t):o.close()},cancel(){t?.return&&t.return(),t=null}}),Object.assign({highWaterMark:n?s:void 0},e));function i(o,a){let c,u=null,l=o.desiredSize||null;for(;!(u=a.next(n?l:null)).done;)if(ArrayBuffer.isView(u.value)&&(c=k(u.value))&&(l!=null&&n&&(l=l-c.byteLength+1),u.value=c),o.enqueue(u.value),l!=null&&--l<=0)return;o.close()}}function mM(r,e){let t=null,n=e?.type==="bytes"||!1,s=e?.highWaterMark||Math.pow(2,24);return new ReadableStream(Object.assign(Object.assign({},e),{start(o){return F(this,void 0,void 0,function*(){yield i(o,t||(t=r[Symbol.asyncIterator]()))})},pull(o){return F(this,void 0,void 0,function*(){t?yield i(o,t):o.close()})},cancel(){return F(this,void 0,void 0,function*(){t?.return&&(yield t.return()),t=null})}}),Object.assign({highWaterMark:n?s:void 0},e));function i(o,a){return F(this,void 0,void 0,function*(){let c,u=null,l=o.desiredSize||null;for(;!(u=yield a.next(n?l:null)).done;)if(ArrayBuffer.isView(u.value)&&(c=k(u.value))&&(l!=null&&n&&(l=l-c.byteLength+1),u.value=c),o.enqueue(u.value),l!=null&&--l<=0)return;o.close()})}}var Z0=p(()=>{kt();Ke();Yn()});function r_(r){return new am(r)}var am,e_,t_,n_=p(()=>{kt();xc();am=class{constructor(e){this._numChunks=0,this._finished=!1,this._bufferedSize=0;let{["readableStrategy"]:t,["writableStrategy"]:n,["queueingStrategy"]:s="count"}=e,i=dx(e,["readableStrategy","writableStrategy","queueingStrategy"]);this._controller=null,this._builder=zr(i),this._getSize=s!=="bytes"?e_:t_;let{["highWaterMark"]:o=s==="bytes"?Math.pow(2,14):1e3}=Object.assign({},t),{["highWaterMark"]:a=s==="bytes"?Math.pow(2,14):1e3}=Object.assign({},n);this.readable=new ReadableStream({cancel:()=>{this._builder.clear()},pull:c=>{this._maybeFlush(this._builder,this._controller=c)},start:c=>{this._maybeFlush(this._builder,this._controller=c)}},{highWaterMark:o,size:s!=="bytes"?e_:t_}),this.writable=new WritableStream({abort:()=>{this._builder.clear()},write:()=>{this._maybeFlush(this._builder,this._controller)},close:()=>{this._maybeFlush(this._builder.finish(),this._controller)}},{highWaterMark:a,size:c=>this._writeValueAndReturnChunkSize(c)})}_writeValueAndReturnChunkSize(e){let t=this._bufferedSize;return this._bufferedSize=this._getSize(this._builder.append(e)),this._bufferedSize-t}_maybeFlush(e,t){t!=null&&(this._bufferedSize>=t.desiredSize&&++this._numChunks&&this._enqueue(t,e.toVector()),e.finished&&((e.length>0||this._numChunks===0)&&++this._numChunks&&this._enqueue(t,e.toVector()),!this._finished&&(this._finished=!0)&&this._enqueue(t,null)))}_enqueue(e,t){this._bufferedSize=0,this._controller=null,t==null?e.close():e.enqueue(t)}},e_=r=>{var e;return(e=r?.length)!==null&&e!==void 0?e:0},t_=r=>{var e;return(e=r?.byteLength)!==null&&e!==void 0?e:0}});function Xl(r,e){let t=new Tr,n=null,s=new ReadableStream({cancel(){return F(this,void 0,void 0,function*(){yield t.close()})},start(a){return F(this,void 0,void 0,function*(){yield o(a,n||(n=yield i()))})},pull(a){return F(this,void 0,void 0,function*(){n?yield o(a,n):a.close()})}});return{writable:new WritableStream(t,Object.assign({highWaterMark:Math.pow(2,14)},r)),readable:s};function i(){return F(this,void 0,void 0,function*(){return yield(yield Mt.from(t)).open(e)})}function o(a,c){return F(this,void 0,void 0,function*(){let u=a.desiredSize,l=null;for(;!(l=yield c.next()).done;)if(a.enqueue(l.value),u!=null&&--u<=0)return;a.close()})}}var s_=p(()=>{kt();As();Ic()});function Hl(r,e){let t=new this(r),n=new Gt(t),s=new ReadableStream({cancel(){return F(this,void 0,void 0,function*(){yield n.cancel()})},pull(o){return F(this,void 0,void 0,function*(){yield i(o)})},start(o){return F(this,void 0,void 0,function*(){yield i(o)})}},Object.assign({highWaterMark:Math.pow(2,14)},e));return{writable:new WritableStream(t,r),readable:s};function i(o){return F(this,void 0,void 0,function*(){let a=null,c=o.desiredSize;for(;a=yield n.read(c||null);)if(o.enqueue(a),c!=null&&(c-=a.byteLength)<=0)return;o.close()})}}var i_=p(()=>{kt();As()});function Zo(r){let e=Mt.from(r);return Yt(e)?e.then(t=>Zo(t)):e.isAsync()?e.readAll().then(t=>new me(t)):new me(e.readAll())}function Lc(r,e="stream",t=null){let n={compressionType:t};return(e==="stream"?Pn:Vn).writeAll(r,n).toUint8Array(!0)}var o_=p(()=>{$i();Yn();Ic();Kl()});var cm={};J(cm,{isArrowData:()=>Zl,isArrowDataType:()=>Ql,isArrowField:()=>Yl,isArrowRecordBatch:()=>tf,isArrowSchema:()=>Jl,isArrowTable:()=>rf,isArrowVector:()=>ef});function Jl(r){return Q.isSchema(r)}function Yl(r){return O.isField(r)}function Ql(r){return E.isDataType(r)}function Zl(r){return G.isData(r)}function ef(r){return B.isVector(r)}function tf(r){return de.isRecordBatch(r)}function rf(r){return me.isTable(r)}var um=p(()=>{mt();we();wr();ht();Rn();$i()});var a_,lm=p(()=>{Gu();So();Me();wr();we();$i();ht();Vt();mt();lc();cl();Se();xc();xp();Dp();Tp();_p();Ap();vp();Sp();Bp();Np();kp();Ep();Lp();Up();Vp();Pp();Bl();Ol();Fl();Fp();Op();Ip();Mp();Rp();Cp();As();Ic();Kl();o_();jl();Vl();_s();Rn();um();zu();pp();gi();uc();Ke();Po();tc();Sl();um();vc();a_=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Ch),hp),Zh),Uh),nh),Qh),Dh),wp),cm),{compareSchemas:Wi,compareFields:B0,compareTypes:Rl})});var cn={};J(cn,{AsyncByteQueue:()=>Tr,AsyncByteStream:()=>Gt,AsyncMessageReader:()=>Ki,AsyncRecordBatchFileReader:()=>Jo,AsyncRecordBatchStreamReader:()=>kn,Binary:()=>Ct,BinaryBuilder:()=>Ln,BinaryView:()=>Z,BinaryViewBuilder:()=>On,Bool:()=>lt,BoolBuilder:()=>_i,BufferType:()=>re,Builder:()=>Te,ByteStream:()=>_r,CompressionType:()=>et,Data:()=>G,DataType:()=>E,DateBuilder:()=>nn,DateDay:()=>os,DateDayBuilder:()=>Is,DateMillisecond:()=>as,DateMillisecondBuilder:()=>Ss,DateUnit:()=>ye,Date_:()=>Et,Decimal:()=>Ut,DecimalBuilder:()=>Es,DenseUnion:()=>_n,DenseUnionBuilder:()=>Gi,Dictionary:()=>Ge,DictionaryBuilder:()=>Ai,Duration:()=>Lt,DurationBuilder:()=>Ar,DurationMicrosecond:()=>oc,DurationMicrosecondBuilder:()=>Rs,DurationMillisecond:()=>ic,DurationMillisecondBuilder:()=>Ds,DurationNanosecond:()=>ac,DurationNanosecondBuilder:()=>ks,DurationSecond:()=>sc,DurationSecondBuilder:()=>Ms,Field:()=>O,FixedSizeBinary:()=>Pt,FixedSizeBinaryBuilder:()=>Ls,FixedSizeList:()=>Be,FixedSizeListBuilder:()=>vi,Float:()=>ct,Float16:()=>Cr,Float16Builder:()=>Ii,Float32:()=>It,Float32Builder:()=>Si,Float64:()=>sr,Float64Builder:()=>Ei,FloatBuilder:()=>sn,Int:()=>Fe,Int16:()=>er,Int16Builder:()=>Bi,Int32:()=>Pe,Int32Builder:()=>Fi,Int64:()=>tr,Int64Builder:()=>Oi,Int8:()=>Zt,Int8Builder:()=>Li,IntBuilder:()=>Ft,Interval:()=>ft,IntervalBuilder:()=>Wr,IntervalDayTime:()=>ms,IntervalDayTimeBuilder:()=>Bs,IntervalMonthDayNano:()=>nc,IntervalMonthDayNanoBuilder:()=>Os,IntervalUnit:()=>ae,IntervalYearMonth:()=>bs,IntervalYearMonthBuilder:()=>Fs,JSONMessageReader:()=>Xi,LargeBinary:()=>Ur,LargeBinaryBuilder:()=>Bn,LargeList:()=>ir,LargeListBuilder:()=>Ci,LargeUtf8:()=>Pr,LargeUtf8Builder:()=>$s,List:()=>je,ListBuilder:()=>Ni,MapBuilder:()=>Ui,MapRow:()=>yr,Map_:()=>dt,Message:()=>gt,MessageHeader:()=>se,MessageReader:()=>qs,MetadataVersion:()=>ge,Null:()=>Ne,NullBuilder:()=>Pi,Precision:()=>le,RecordBatch:()=>de,RecordBatchFileReader:()=>Nn,RecordBatchFileWriter:()=>Vn,RecordBatchJSONWriter:()=>Ec,RecordBatchReader:()=>Mt,RecordBatchStreamReader:()=>$r,RecordBatchStreamWriter:()=>Pn,RecordBatchWriter:()=>an,Schema:()=>Q,SparseUnion:()=>gs,SparseUnionBuilder:()=>ji,Struct:()=>pe,StructBuilder:()=>Vi,StructRow:()=>en,Table:()=>me,Time:()=>tt,TimeBuilder:()=>Ir,TimeMicrosecond:()=>ls,TimeMicrosecondBuilder:()=>Gs,TimeMillisecond:()=>us,TimeMillisecondBuilder:()=>js,TimeNanosecond:()=>fs,TimeNanosecondBuilder:()=>zs,TimeSecond:()=>cs,TimeSecondBuilder:()=>Vs,TimeUnit:()=>L,Timestamp:()=>rt,TimestampBuilder:()=>vr,TimestampMicrosecond:()=>hs,TimestampMicrosecondBuilder:()=>Us,TimestampMillisecond:()=>Zr,TimestampMillisecondBuilder:()=>Cs,TimestampNanosecond:()=>ps,TimestampNanosecondBuilder:()=>Ps,TimestampSecond:()=>ds,TimestampSecondBuilder:()=>Ns,Type:()=>w,Uint16:()=>nr,Uint16Builder:()=>Di,Uint32:()=>vt,Uint32Builder:()=>Ri,Uint64:()=>Nr,Uint64Builder:()=>ki,Uint8:()=>rr,Uint8Builder:()=>Mi,Union:()=>Bt,UnionBuilder:()=>Fn,UnionMode:()=>he,Utf8:()=>ut,Utf8Builder:()=>Ws,Utf8View:()=>St,Utf8ViewBuilder:()=>zi,Vector:()=>B,Visitor:()=>R,builderThroughAsyncIterable:()=>$p,builderThroughIterable:()=>Nl,compressionRegistry:()=>Ks,isArrowData:()=>Zl,isArrowDataType:()=>Ql,isArrowField:()=>Yl,isArrowRecordBatch:()=>tf,isArrowSchema:()=>Jl,isArrowTable:()=>rf,isArrowVector:()=>ef,makeBuilder:()=>zr,makeData:()=>D,makeTable:()=>qp,makeVector:()=>rn,tableFromArrays:()=>Kp,tableFromIPC:()=>Zo,tableFromJSON:()=>Wp,tableToIPC:()=>Lc,util:()=>a_,vectorFromArray:()=>Ko});var jn=p(()=>{Va();Se();Ic();Kl();Z0();n_();s_();i_();lm();lm();Qe.toDOMStream=Q0;Te.throughDOM=r_;Mt.throughDOM=Xl;Nn.throughDOM=Xl;$r.throughDOM=Xl;an.throughDOM=Hl;Vn.throughDOM=Hl;Pn.throughDOM=Hl});function nf(r){return r.variadicBuffers??[]}function sf(r,e,t,n,s,i,o,a){return Reflect.construct(G,[r,e,t,n,s,i,o,a])}var fm=p(()=>{jn()});function c_(r,e={}){let t={...e,copies:new WeakMap};return bM(r)?wM(r,t):gM(r)?u_(r,t):yM(r)?l_(r,t):of(r,t)}function bM(r){return"batches"in r}function gM(r){return"schema"in r&&"data"in r&&!Array.isArray(r.data)}function yM(r){return"data"in r&&Array.isArray(r.data)}function wM(r,e){let t=r.batches.map(n=>u_(n,e));return new me(r.schema,t)}function u_(r,e){return new de(r.schema,of(r.data,e))}function of(r,e){let t=r.children.map(i=>of(i,e)),n=r.dictionary?l_(r.dictionary,e):void 0,s={[re.OFFSET]:Bc(r.buffers[re.OFFSET],e),[re.DATA]:Bc(r.buffers[re.DATA],e),[re.VALIDITY]:Bc(r.buffers[re.VALIDITY],e),[re.TYPE]:Bc(r.buffers[re.TYPE],e)};return sf(r.type,r.offset,r.length,r._nullCount,s,t,n,nf(r).map(i=>Bc(i,e)))}function l_(r,e){return new B(r.data.map(t=>of(t,e)))}function Bc(r,e){if(!xM(r)||e.copy==="none"||e.copy!=="all"&&r.byteOffset===0&&r.byteLength===r.buffer.byteLength)return r;let t=e.copies.get(r);return t||(t=r instanceof Uint8Array?new Uint8Array(r):r.slice(),e.copies.set(r,t)),t}function xM(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}var dm=p(()=>{jn();fm()});var f_=p(()=>{});var d_=p(()=>{});var h_=p(()=>{});var p_=p(()=>{});function mm(r,e){let t=c_(r,e);return{transport:"arrow-js",version:1,schema:Lc(new me(t.schema,[])),metadataVersion:t.schema.metadataVersion,batches:t.batches.map(n=>hm(n.data))}}function bm(r){if(r.transport!=="arrow-js"||r.version!==1)throw new Error("Unsupported Arrow column-buffer transport protocol.");let e=Zo(r.schema).schema,t=new Q(e.fields,e.metadata,e.dictionaries,r.metadataVersion),n=new pe(t.fields),s=r.batches.map(i=>new de(t,pm(i,n)));return new me(t,s)}function hm(r){return{offset:r.offset,length:r.length,nullCount:r.nullCount,buffers:{[re.OFFSET]:r.buffers[re.OFFSET],[re.DATA]:r.buffers[re.DATA],[re.VALIDITY]:r.buffers[re.VALIDITY],[re.TYPE]:r.buffers[re.TYPE]},children:r.children.map(e=>hm(e)),variadicBuffers:nf(r),dictionary:r.dictionary?.data.map(e=>hm(e))}}function pm(r,e){let t=r.children.map((s,i)=>pm(s,e.children[i].type)),n=r.dictionary&&E.isDictionary(e)?new B(r.dictionary.map(s=>pm(s,e.dictionary))):void 0;return sf(e,r.offset,r.length,r.nullCount,r.buffers,t,n,r.variadicBuffers)}var m_=p(()=>{jn();fm();dm()});var b_=p(()=>{d_();f_();h_();p_();dm();m_()});var g_=p(()=>{b_()});function Hi(r){if(!y_(r))throw new Error("Workers require Arrow table output");let{data:e,...t}=r;return{...structuredClone(t),data:mm(e,{copy:"all"})}}function gm(r){if(!w_(r))throw new Error("Workers require Arrow column transport");return{...r,data:bm(r.data)}}function af(r,e){if(!y_(r))return r;let t=e,n=t?.core?.workerTransferBufferCopy??t?.workerTransferBufferCopy;return{...r,data:mm(r.data,n?{copy:n}:void 0)}}function cf(r){return w_(r)?{...r,data:bm(r.data)}:r}function y_(r){let e=r;return!!(e&&e.shape==="arrow-table"&&e.data&&typeof e.data=="object"&&"batches"in e.data)}function w_(r){let e=r;return!!(e&&e.shape==="arrow-table"&&e.data&&e.data.transport==="arrow-js"&&Array.isArray(e.data.batches))}var ea=p(()=>{"use strict";g_()});async function Xs(r,e,t,n){return n._parse(r,e,t,n)}var x_=p(()=>{"use strict"});function fr(r,e){if(!r)throw new Error(e||"loader assertion failed.")}var ym=p(()=>{"use strict"});var un,TM,_M,AM,vM,Gn,T_,IM,wm=p(()=>{"use strict";un={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},TM=un.self||un.window||un.global||{},_M=un.window||un.self||un.global||{},AM=un.global||un.self||un.window||{},vM=un.document||{},Gn=!!(typeof process!="object"||String(process)!=="[object process]"||process.browser),T_=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),IM=T_&&parseFloat(T_[1])||0});var __,A_=p(()=>{"use strict";__=r=>typeof SharedArrayBuffer<"u"&&r instanceof SharedArrayBuffer});function Ji(r,e){return new Promise((t,n)=>{let s=!1;function i(a){s||(s=!0,n(a))}function o(a){if(!s){s=!0;try{t(e(a))}catch(c){n(c)}}}try{r(o,i)?.then(o,i)}catch(a){i(a)}})}var v_=p(()=>{"use strict"});function xm(r){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,r)}function Tm(r){return globalThis.loaders?.modules?.[r]||null}var _m=p(()=>{"use strict"});var I_,wq,xq,Am,S_=p(()=>{"use strict";I_="master",wq=`https://raw.githubusercontent.com/visgl/loaders.gl/${I_}/`,xq=`https://github.com/visgl/loaders.gl/raw/${I_}/`,Am="beta"});var E_=p(()=>{"use strict";S_()});function SM(){let r="5.0.0-beta.6";return globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version||=r,r}var L_,B_=p(()=>{"use strict";L_=SM()});function uf(r,e){if(!r)throw new Error(e||"loaders.gl assertion failed.")}var vm=p(()=>{"use strict"});var ln,Sq,Eq,Lq,Bq,Xe,Yi,O_,F_,Fq,Fc=p(()=>{"use strict";ln={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Sq=ln.self||ln.window||ln.global||{},Eq=ln.window||ln.self||ln.global||{},Lq=ln.global||ln.self||ln.window||{},Bq=ln.document||{},Xe=typeof process!="object"||String(process)!=="[object process]"||process.browser,Yi=typeof importScripts=="function",O_=typeof window<"u"&&typeof window.orientation<"u",F_=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Fq=F_&&parseFloat(F_[1])||0});var lf,Im=p(()=>{lf="latest"});function EM(){return typeof __VERSION__>"u"?lf:__VERSION__}var Sm,M_=p(()=>{Im();Sm=EM()});function Qi(r,e){if(!r)throw new Error(e||"loaders.gl assertion failed.")}var ff=p(()=>{});var fn,Nq,Cq,Uq,Pq,zt,R_,D_,Vq,ta=p(()=>{fn={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Nq=fn.self||fn.window||fn.global||{},Cq=fn.window||fn.self||fn.global||{},Uq=fn.global||fn.self||fn.window||{},Pq=fn.document||{},zt=typeof process!="object"||String(process)!=="[object process]"||process.browser,R_=typeof window<"u"&&typeof window.orientation<"u",D_=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Vq=D_&&parseFloat(D_[1])||0});function k_(r){let e=new Error(r);return e.name="AbortError",e}var Oc,N_=p(()=>{Oc=class{constructor(e,t){this.isRunning=!0,this.isCancelled=!1,this.failed=!1,this.postMessageMs=0,this.complete=()=>{},this.processStarted=!1,this._resolve=()=>{},this._reject=()=>{},this.name=e,this.workerThread=t,this.completion=new Promise(n=>{this.complete=n}),this.result=new Promise((n,s)=>{this._resolve=n,this._reject=s})}postMessage(e,t,n){if(!this.isRunning||this.isCancelled)return;let s=performance.now();(e==="process"||e==="process-in-batches"||e==="preload")&&(this.processStarted=!0);try{this.workerThread.postMessage({source:"loaders.gl",type:e,payload:t},n)}finally{this.postMessageMs+=performance.now()-s}}done(e){this.isRunning&&(this.isRunning=!1,this.executionMs=e?.executionMs,clearTimeout(this.cancellationTimer),this.complete(),this.isCancelled||this._resolve(e))}error(e){this.isRunning&&(this.isRunning=!1,this.failed=!0,this.sharedState?.snapshot.cancelled&&(this.isCancelled=!0),clearTimeout(this.cancellationTimer),this.complete(),this._reject(e))}cancel(e,t=1e3){if(!this.isRunning||this.isCancelled)return;if(!Number.isFinite(t)||t<0){this.abort(new RangeError("cancellationTimeout must be finite and nonnegative"));return}this.isCancelled=!0,this.sharedState?.cancel();let n=arguments.length?e:k_(`Worker job "${this.name}" was cancelled`);if(!this.processStarted){this.error(n);return}this._reject(n);try{this.workerThread.postMessage({source:"loaders.gl",type:"cancel",payload:{}},[]),this.cancellationTimer=setTimeout(()=>this.abort(e),t)}catch(s){this.abort(s)}}abort(e){this.isRunning&&(this.isCancelled=!0,this.sharedState?.cancel(),this.workerThread.destroy(),this.error(arguments.length?e:k_(`Worker job "${this.name}" was aborted`)))}}});var ra,zq,C_=p(()=>{ra=class{constructor(...e){let n=globalThis.process?.getBuiltinModule?.("node:worker_threads").Worker;if(n)return new n(...e)}terminate(){}},zq=globalThis.process?.getBuiltinModule?.("node:worker_threads")?.parentPort??null});function U_(r){if(Qi(r.source&&!r.url||!r.source&&r.url),r.url&&r.workerType==="module"){let t=globalThis.document?.baseURI??globalThis.location?.href;if(!t)return r.url;let n=new URL(r.url,t),s=globalThis.location?.origin;return/^https?:$/.test(n.protocol)&&n.origin!==s?Lm(`import ${JSON.stringify(n.href)};`):r.url}let e=Em.get(r.source||r.url);return e||(r.url&&(e=LM(r.url),Em.set(r.url,e)),r.source&&(e=Lm(r.source),Em.set(r.source,e))),Qi(e),e}function LM(r){if(!r.startsWith("http"))return r;let e=BM(r);return Lm(e)}function Lm(r){let e=new Blob([r],{type:"application/javascript"});return URL.createObjectURL(e)}function BM(r){return`try {
|
|
32
32
|
importScripts('${r}');
|
|
33
33
|
} catch (error) {
|
|
34
34
|
console.error(error);
|
|
35
35
|
throw error;
|
|
36
|
-
}`}var im,i_=p(()=>{sl();im=new Map});function cr(r,e=!0,t){let n=t||new Set,s=new Set;function i(o){if(!(!o||typeof o!="object"||s.has(o))){if(s.add(o),am(o))n.add(o);else if(ArrayBuffer.isView(o))am(o.buffer)&&n.add(o.buffer);else if(e&&typeof MessageChannel<"u"&&o instanceof MessageChannel)i(o.port1),i(o.port2);else if(e&&o instanceof Map)for(let[a,c]of o)i(a),i(c);else if(e&&o instanceof Set)for(let a of o)i(a);else if(e)for(let a of Object.keys(o))i(o[a])}}return i(r),t===void 0?Array.from(n):[]}function am(r){return r?r instanceof ArrayBuffer||typeof MessagePort<"u"&&r instanceof MessagePort||typeof ImageBitmap<"u"&&r instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&r instanceof OffscreenCanvas:!1}function Zo(r){let e=new Map;function t(n){if(typeof n=="function"||n instanceof RegExp)return{};if(!n||typeof n!="object")return n;if(e.has(n))return e.get(n);if(ArrayBuffer.isView(n)||n instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&n instanceof SharedArrayBuffer||n instanceof Date||typeof WebAssembly<"u"&&n instanceof WebAssembly.Module||am(n))return n;let s=n instanceof Map?new Map:n instanceof Set?new Set:Array.isArray(n)?[]:{};if(e.set(n,s),n instanceof Map)for(let[i,o]of n)s.set(t(i),t(o));else if(n instanceof Set)for(let i of n)s.add(t(i));else for(let i of Object.keys(n))Object.defineProperty(s,i,{value:t(n[i]),enumerable:!0,writable:!0,configurable:!0});return s}return r===null?{}:t(r)}var il=p(()=>{});var cm,on,ol=p(()=>{n_();Yo();sl();i_();il();cm=()=>{},on=class{static isSupported(){return typeof Worker<"u"&&Ut||typeof Qo<"u"&&!Ut}constructor(e){this.terminated=!1,this.createdAt=performance.now(),this._loadableURL="";let{name:t,source:n,url:s,getUrl:i,loadWorker:o}=e;Xi(n||s||i||o),this.name=t,this.source=n,this.url=s,this.workerType=e.workerType??"classic",this.getUrl=i,this.loadWorker=o,this.onMessage=cm,this.onError=c=>console.log(c);let a=performance.now();this.worker=Ut?this._createBrowserWorker():this._createNodeWorker(),this.creationTimeMs=performance.now()-a}destroy(){return this.onMessage=cm,this.onError=cm,this.terminated?this.termination??Promise.resolve():(this.terminated=!0,this.termination=Promise.resolve(this.worker.terminate()).then(()=>{}).finally(()=>this.releaseModuleWorkerURL()),this.termination.catch(()=>{}),this.termination)}unref(){!Ut&&typeof this.worker.unref=="function"&&this.worker.unref()}ref(){!Ut&&typeof this.worker.ref=="function"&&this.worker.ref()}get isRunning(){return!!this.onMessage}postMessage(e,t){t=t||cr(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+=`worker ${this.name} from ${this.url||"built-in worker factory"}. `,e.message&&(t+=`${e.message} in `),e.lineno&&(t+=`:${e.lineno}:${e.colno}`),new Error(t)}_createBrowserWorker(){if(this.loadWorker)try{let t=this.loadWorker();if(t)return this._initializeBrowserWorker(t)}catch(t){if(!this.source&&!this.url&&!this.getUrl)throw t}let e=this.url||this.getUrl?.();this._loadableURL=s_({source:this.source,url:e,workerType:this.workerType}),this.workerType==="module"&&e&&this._loadableURL!==e&&this._loadableURL.startsWith("blob:")&&(this.ownedModuleWorkerURL=this._loadableURL);try{let t=new Worker(this._loadableURL,{name:this.name,type:this.workerType});return this._initializeBrowserWorker(t)}catch(t){throw this.releaseModuleWorkerURL(),t}}releaseModuleWorkerURL(){this.ownedModuleWorkerURL&&(URL.revokeObjectURL(this.ownedModuleWorkerURL),this.ownedModuleWorkerURL=void 0)}_initializeBrowserWorker(e){return e.onmessage=t=>{t.data?t.data.type==="ready"?this.startupTimeMs=performance.now()-this.createdAt:this.onMessage(t.data):this.onError(new Error("No data received"))},e.onerror=t=>{let n=this.onError,s=this._getErrorFromErrorEvent(t);this.destroy(),n(s)},e.onmessageerror=()=>{let t=this.onError;this.destroy(),t(new Error("Worker message could not be deserialized"))},e}_createNodeWorker(){let e;if(this.url){let n=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`,s=n.startsWith("file:")?new URL(n):n,i=this.url.endsWith(".ts")||this.url.endsWith(".mjs")?"module":"commonjs";e=new Qo(s,{eval:!1,type:i})}else if(this.source)e=new Qo(this.source,{eval:!0});else throw new Error("no worker");return e.on("message",t=>{t?.type==="ready"?this.startupTimeMs=performance.now()-this.createdAt:this.onMessage(t)}),e.on("error",t=>{this.terminated=!0,this.onError(t)}),this.termination=new Promise(t=>e.on("exit",()=>t())),e.on("exit",t=>{this.terminated||(this.terminated=!0,this.onError(new Error(`Worker ${this.name} exited unexpectedly (code ${t})`)))}),e}}});var $s,um=p(()=>{Yo();ol();r_();$s=class{get stats(){return{...this.totals,queuedJobs:this.jobQueue.length,activeJobs:this.activeJobs.size,queuedBytes:this.queuedBytes+this.reservedBytes,inFlightBytes:this.inFlightBytes,pendingAdmissions:this.admissions.length,reservations:this.reservations.size}}reserve(e,t={}){let{signal:n}=t;return n?.aborted?Promise.reject(n.reason):this.isDestroyed?Promise.reject(new Error("Worker pool was destroyed")):this.isClosing?Promise.reject(new Error("Worker pool is closing")):!Number.isSafeInteger(e)||e<0||e>this.maxQueuedBytes||e>this.maxInFlightBytes?Promise.reject(new RangeError("Reservation exceeds worker byte budgets")):this.maxQueuedJobs<1||this.admissions.length>=this.maxPendingAdmissions?Promise.reject(new RangeError("Worker admission queue is full")):new Promise((s,i)=>{let o=()=>{let c=this.admissions.indexOf(a);c>=0&&this.admissions.splice(c,1),a.cleanup(),i(n?.reason),this._admit()},a={inputBytes:e,resolve:s,reject:i,cleanup:()=>n?.removeEventListener("abort",o)};this.admissions.push(a),n?.addEventListener("abort",o,{once:!0}),this._admit()})}_admit(){for(;!this.isDestroyed&&!this.isClosing&&this.admissions.length;){let e=this.admissions[0];if(e.inputBytes>this.maxQueuedBytes||e.inputBytes>this.maxInFlightBytes){this.admissions.shift(),e.cleanup(),e.reject(new RangeError("Reservation exceeds worker byte budgets"));continue}if(this.jobQueue.length+this.reservations.size>=this.maxQueuedJobs||e.inputBytes>this.maxQueuedBytes-this.queuedBytes-this.reservedBytes)return;this.admissions.shift(),e.cleanup();let t={inputBytes:e.inputBytes,release:()=>{this.reservations.delete(t)&&(this.reservedBytes-=t.inputBytes,this._admit())}};this.reservations.add(t),this.reservedBytes+=t.inputBytes,this.totals.peakQueuedBytes=Math.max(this.totals.peakQueuedBytes,this.queuedBytes+this.reservedBytes),e.resolve(t)}}static isSupported(){return on.isSupported()}constructor(e){this.name="unnamed",this.maxConcurrency=1,this.maxMobileConcurrency=1,this.onDebug=()=>{},this.reuseWorkers=!0,this.props={},this.jobQueue=[],this.idleQueue=[],this.activeJobs=new Set,this.startingJobs=0,this.count=0,this.workers=new Set,this.queuedBytes=0,this.inFlightBytes=0,this.maxQueuedBytes=1/0,this.maxInFlightBytes=1/0,this.isDestroyed=!1,this.isClosing=!1,this.maxQueuedJobs=1/0,this.maxPendingAdmissions=128,this.priorityAgingMs=1e3,this.reservations=new Set,this.admissions=[],this.reservedBytes=0,this.totals={peakQueuedBytes:0,peakInFlightBytes:0,workersCreated:0,workerRestarts:0,completed:0,failed:0,cancelled:0},this.source=e.source,this.url=e.url,this.workerType=e.workerType,this.getUrl=e.getUrl,this.loadWorker=e.loadWorker,this.setProps(e)}close(e={}){if(this.closing)return this.closing;if(this.isDestroyed)return this.destroy();if(e.timeout!==void 0&&(!Number.isFinite(e.timeout)||e.timeout<0||e.timeout>2147483647))return Promise.reject(new RangeError("Close timeout must be between 0 and 2147483647 ms"));this.isClosing=!0;let t=new Error("Worker pool is closing");this.admissions.splice(0).forEach(o=>{o.cleanup(),o.reject(t)}),this.reservations.clear(),this.reservedBytes=0;let n,s=new Promise(o=>{this.onDrained=o}),i=e.timeout===void 0?s:Promise.race([s,new Promise(o=>{n=setTimeout(o,e.timeout)})]);return this.closing=i.then(async()=>{clearTimeout(n),await this.destroy()}),this._checkDrained(),this.closing}_checkDrained(){this.isClosing&&!this.jobQueue.length&&!this.activeJobs.size&&!this.startingJobs&&this.onDrained?.()}destroy(e=new Error("Worker pool was destroyed")){if(this.destruction)return this.destruction;let t=[...this.workers];this.isDestroyed=!0,this.onDrained?.(),this.activeJobs.forEach(s=>s.abort(e)),this.admissions.splice(0).forEach(s=>{s.cleanup(),s.reject(e)}),this.reservations.clear(),this.reservedBytes=0;let n=this.jobQueue.splice(0);return this.queuedBytes=0,n.forEach(s=>{s.removeAbortListener(),s.onReject(e)}),this.idleQueue.splice(0).forEach(s=>{s.destroy(),this.count--}),this.isDestroyed=!0,this.destruction=Promise.all(t.map(s=>s.destroy())).then(()=>{this.workers.clear()}),this.destruction.catch(()=>{}),this.destruction}setProps(e){for(let t of["maxQueuedBytes","maxInFlightBytes","maxQueuedJobs","maxPendingAdmissions"]){let n=e[t];if(n!==void 0&&(!(n>=0)||n!==1/0&&!Number.isSafeInteger(n)))throw new RangeError(`${t} must be a nonnegative safe integer or Infinity`)}if(e.priorityAgingMs!==void 0&&(!Number.isFinite(e.priorityAgingMs)||e.priorityAgingMs<=0))throw new RangeError("priorityAgingMs must be positive and finite");this.maxQueuedJobs=e.maxQueuedJobs??this.maxQueuedJobs,this.maxPendingAdmissions=e.maxPendingAdmissions??this.maxPendingAdmissions,this.priorityAgingMs=e.priorityAgingMs??this.priorityAgingMs,this.maxQueuedBytes=e.maxQueuedBytes??this.maxQueuedBytes,this.maxInFlightBytes=e.maxInFlightBytes??this.maxInFlightBytes,this.props={...this.props,...e},e.name!==void 0&&(this.name=e.name),e.maxConcurrency!==void 0&&(this.maxConcurrency=e.maxConcurrency),e.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=e.maxMobileConcurrency),e.reuseWorkers!==void 0&&(this.reuseWorkers=e.reuseWorkers),e.onDebug!==void 0&&(this.onDebug=e.onDebug);for(let t of[...this.jobQueue])t.inputBytes>this.maxInFlightBytes&&(this.jobQueue.splice(this.jobQueue.indexOf(t),1),this.queuedBytes-=t.inputBytes,t.removeAbortListener(),t.onReject(new RangeError("Worker job exceeds maxInFlightBytes")));this._admit(),this._startQueuedJob(),this._checkDrained()}get requiresInputBytes(){return this.maxQueuedBytes!==1/0||this.maxInFlightBytes!==1/0}async startJob(e,t=(o,a,c)=>o.done(c),n=(o,a)=>o.error(a),s,i={}){if(i.cancellationMode!==void 0&&!["terminate","cooperative"].includes(i.cancellationMode))throw new Error("Invalid worker cancellation mode");if(i.cancellationTimeout!==void 0&&(!Number.isFinite(i.cancellationTimeout)||i.cancellationTimeout<0))throw new RangeError("cancellationTimeout must be finite and nonnegative");if(s?.aborted)throw s.reason;if(this.isDestroyed)return Promise.reject(new Error("Worker pool was destroyed"));if(this.isClosing)return Promise.reject(new Error("Worker pool is closing"));let{inputBytes:o=0,priority:a=0}=i;if(!Number.isSafeInteger(o)||o<0||!Number.isFinite(a))throw new RangeError("Invalid worker scheduling inputBytes or priority");if(o>this.maxInFlightBytes)throw new RangeError("Worker job exceeds maxInFlightBytes");let c=i.admission;if(c&&(!this.reservations.has(c)||c.inputBytes!==o))throw new Error("Invalid or consumed worker admission");let u=!this.jobQueue.length&&this.activeJobs.size<this._getMaxConcurrency()&&this.inFlightBytes+o<=this.maxInFlightBytes;if(!c&&!u&&(this.jobQueue.length+this.reservations.size>=this.maxQueuedJobs||o>this.maxQueuedBytes-this.queuedBytes-this.reservedBytes))throw new RangeError("Worker queue exceeds maxQueuedBytes or maxQueuedJobs");c&&(this.reservations.delete(c),this.reservedBytes-=c.inputBytes);let f=new Promise((l,d)=>{let h=()=>{let w=this.jobQueue.indexOf(m);w>=0&&(this.jobQueue.splice(w,1),this.queuedBytes-=m.inputBytes,this._admit(),this._startQueuedJob(),m.removeAbortListener(),d(s?.reason),this._checkDrained())},m={name:e,inputBytes:o,priority:a,queuedAt:performance.now(),sharedState:i.sharedState,cancellationMode:i.cancellationMode,cancellationTimeout:i.cancellationTimeout,onMessage:t,onError:n,onStart:l,onReject:d,signal:s,removeAbortListener:()=>s?.removeEventListener("abort",h)},b=this.jobQueue.findIndex(w=>w.priority<a);return this.jobQueue.splice(b<0?this.jobQueue.length:b,0,m),this.queuedBytes+=o,u||(this.totals.peakQueuedBytes=Math.max(this.totals.peakQueuedBytes,this.queuedBytes+this.reservedBytes)),s?.addEventListener("abort",h,{once:!0}),this});return this._startQueuedJob(),await f}async _startQueuedJob(){if(!this.jobQueue.length)return;let e=performance.now();if(this.jobQueue.sort((s,i)=>i.priority+Math.floor((e-i.queuedAt)/this.priorityAgingMs)-(s.priority+Math.floor((e-s.queuedAt)/this.priorityAgingMs))),this.jobQueue[0].inputBytes>this.maxInFlightBytes-this.inFlightBytes)return;let t;try{t=this._getAvailableWorker()}catch(s){let i=this.jobQueue.shift();i&&(this.queuedBytes-=i.inputBytes),this._admit(),i?.removeAbortListener(),i?.onReject(s),this._startQueuedJob(),this._checkDrained();return}if(!t)return;let n=this.jobQueue.shift();if(n){this.startingJobs++,this.queuedBytes-=n.inputBytes,this.inFlightBytes+=n.inputBytes,this.totals.peakInFlightBytes=Math.max(this.totals.peakInFlightBytes,this.inFlightBytes),this._admit();let s=performance.now();try{this.onDebug({message:"Starting job",name:n.name,workerThread:t,backlog:this.jobQueue.length})}catch{}if(this.isDestroyed||t.terminated){this.startingJobs--,this.inFlightBytes-=n.inputBytes,n.removeAbortListener(),n.onReject(new Error("Worker pool was destroyed before job start")),this.returnWorkerToQueue(t);return}let i=new Lc(n.name,t);i.sharedState=n.sharedState,n.removeAbortListener();let o=()=>{n.cancellationMode==="cooperative"?i.cancel(n.signal?.reason,n.cancellationTimeout):i.abort(n.signal?.reason)};n.signal?.addEventListener("abort",o,{once:!0}),n.signal?.aborted&&o(),this.activeJobs.add(i),this.startingJobs--,t.ref(),t.onMessage=a=>{try{i.isRunning&&n.onMessage(i,a.type,a.payload)}catch(c){i.abort(c)}},t.onError=a=>{try{n.onError(i,a)}catch(c){i.abort(c)}},i.result.catch(()=>{}),n.onStart(i),this._startQueuedJob();try{await i.completion}catch{}finally{n.signal?.removeEventListener("abort",o),this.activeJobs.delete(i),this.inFlightBytes-=n.inputBytes;let a=i.isCancelled?"cancelled":i.failed?"failed":"completed";this.totals[a]++;let c={name:i.name,outcome:a,queueWaitMs:s-n.queuedAt,durationMs:performance.now()-s,workerCreationMs:t.creationTimeMs,workerStartupMs:t.startupTimeMs,postMessageMs:i.postMessageMs,executionMs:i.executionMs,inputBytes:n.inputBytes};try{this.props.onMetrics?.(c),this.props.performanceMarks&&typeof performance.measure=="function"&&performance.measure(`math.gl.worker:${i.name}`,{start:n.queuedAt,end:performance.now(),detail:c})}catch{}this._admit(),this.returnWorkerToQueue(t)}}else this.returnWorkerToQueue(t)}returnWorkerToQueue(e){e.terminated||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.terminated&&!this.isDestroyed&&this.totals.workerRestarts++,e.terminated||e.destroy(),e.destroy().then(()=>this.workers.delete(e)),this.count--):(e.unref(),this.idleQueue.push(e)),this.isDestroyed||this._startQueuedJob(),this._checkDrained()}_getAvailableWorker(){for(;this.idleQueue.length>0;){let e=this.idleQueue.shift();if(e&&(e.terminated||this.count>this._getMaxConcurrency()))e.terminated&&this.totals.workerRestarts++,e.destroy().then(()=>this.workers.delete(e)),this.count--;else if(e)return e}if(this.count<this._getMaxConcurrency()){this.count++;let e=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;try{let t=new on({name:e,source:this.source,url:this.url,workerType:this.workerType,getUrl:this.getUrl,loadWorker:this.loadWorker});return this.totals.workersCreated++,this.workers.add(t),t}catch(t){throw this.count--,t}}return null}_getMaxConcurrency(){return e_?this.maxMobileConcurrency:this.maxConcurrency}}});function CO(r){let{name:e,source:t,url:n,urlKey:s,loadWorker:i,workerType:o}=r,a=t?`source:${t}`:"",c=n||s?`url:${n||s}`:"",u=i?`loadWorker:${UO(i)}`:"";return[e,a,c,u,`type:${o||"classic"}`].filter(Boolean).join("|")}function UO(r){let e=a_.get(r);return e||(e=kO++,a_.set(r,e)),e}var o_,a_,kO,ea,c_=p(()=>{um();ol();o_={maxQueuedJobs:1/0,maxPendingAdmissions:128,priorityAgingMs:1e3,onMetrics:()=>{},performanceMarks:!1,maxQueuedBytes:1/0,maxInFlightBytes:1/0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},a_=new WeakMap,kO=1,ea=class r{static isSupported(){return on.isSupported()}static getWorkerFarm(e={}){return r._workerFarm=r._workerFarm||new r({}),r._workerFarm.setProps(e),r._workerFarm}constructor(e){this.workerPools=new Map,this.props={...o_},this.setProps(e),this.workerPools=new Map}destroy(e){let t=[...this.workerPools.values()];return this.workerPools.clear(),Promise.all(t.map(n=>n.destroy(e))).then(()=>{})}setProps(e){let t={};for(let n of Object.keys(o_))e[n]!==void 0&&(t[n]=e[n]);this.props={...this.props,...t};for(let n of this.workerPools.values())n.setProps(this._getWorkerPoolProps())}getWorkerPool(e){let{name:t,source:n,url:s,getUrl:i,loadWorker:o,workerType:a}=e,c=CO(e),u=this.workerPools.get(c);return u||(u=new $s({name:t,source:n,url:s,getUrl:i,loadWorker:o,workerType:a}),u.setProps(this._getWorkerPoolProps()),this.workerPools.set(c,u)),u}_getWorkerPoolProps(){return{maxQueuedJobs:this.props.maxQueuedJobs,maxPendingAdmissions:this.props.maxPendingAdmissions,priorityAgingMs:this.props.priorityAgingMs,onMetrics:this.props.onMetrics,performanceMarks:this.props.performanceMarks,maxQueuedBytes:this.props.maxQueuedBytes,maxInFlightBytes:this.props.maxInFlightBytes,maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}});var Bc,u_=p(()=>{Bc=class{constructor(){this._values=[],this._settlers=[],this._closed=!1}[Symbol.asyncIterator](){return this}push(e){return this.enqueue(e)}enqueue(e){if(this._closed)throw new Error("Closed");if(this._settlers.length>0){if(this._values.length>0)throw new Error("Illegal internal state");let t=this._settlers.shift();e instanceof Error?t.reject(e):t.resolve({value:e})}else this._values.push(e)}close(){for(;this._settlers.length>0;)this._settlers.shift().resolve({done:!0});this._closed=!0}next(){if(this._values.length>0){let e=this._values.shift();return e instanceof Error?Promise.reject(e):Promise.resolve({done:!1,value:e})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0,value:void 0})}return new Promise((e,t)=>{this._settlers.push({resolve:e,reject:t})})}}});function fm(r){let e=r.version!==sm?` (worker-utils@${sm})`:"";return`${r.name}@${r.version}${e}`}function lm(r,e={}){let t=Ut?r.workerFile||`${r.id}-worker.js`:r.workerNode||`${r.id}-worker-node.js`,n=l_(r,e),s=e._workerType||e?.core?._workerType;if(!n&&s==="test")if(Ut)n=`modules/${r.module}/dist/${t}`;else{let i=r.module==="core"&&r.workerNode?.startsWith("worker-utils/")?"worker-utils/workers":"workers",o=r.workerSourceNode||`${i}/${r.id}-worker-node.ts`;n=`modules/${r.module}/src/${o}`}return n||null}function l_(r,e={}){return(e[r.id]||{}).workerUrl||(r.id==="compression"?e.workerUrl:null)||null}function dm(r,e={}){let t=lm(r,e),n=typeof r.worker=="string"?r.worker:null,s=t||n||hm(r,!0);return Xi(s),s}function hm(r,e=!1){let t=Ut?r.workerFile||`${r.id}-worker.js`:r.workerNode||`${r.id}-worker-node.js`,n=r.version;n==="latest"&&(n=nl);let s=n?`@${n}`:"",o=`https://unpkg.com/${r.packageName||`@loaders.gl/${r.module}`}${s}/dist/${t}`;return e&&VO(r,o),o}function VO(r,e){if(r.version!=="latest")return;let t=`${r.module}:${r.id}`;f_.has(t)||(f_.add(t),console.warn(`loaders.gl: ${r.name} loader worker version is "latest" because __VERSION__ was not injected. Fetching ${e} from CDN.`))}var f_,d_=p(()=>{sl();Yo();Q0();nm();f_=new Set});function h_(){let r=typeof globalThis.crossOriginIsolated=="boolean"?globalThis.crossOriginIsolated:void 0,e={workers:on.isSupported(),sharedMemory:!1,crossOriginIsolated:r};if(Ut&&r!==!0)e.sharedMemoryUnavailableReason="cross-origin-isolation";else if(typeof SharedArrayBuffer>"u"||typeof Atomics>"u"||typeof structuredClone!="function")e.sharedMemoryUnavailableReason="unsupported";else try{let t=new SharedArrayBuffer(4),n=structuredClone(t);Atomics.store(new Int32Array(t),0,17),e.sharedMemory=Atomics.load(new Int32Array(n),0)===17,e.sharedMemory||(e.sharedMemoryUnavailableReason="blocked")}catch{e.sharedMemoryUnavailableReason="blocked"}return e}function PO(){if(!h_().sharedMemory)return null;let r=new Hi(new SharedArrayBuffer(16));return r.setProgress(0),r}function pm(r){if(r.sharedState===void 0&&r.cancellationMode==="cooperative"){let e=PO();return e?{...r,sharedState:e.buffer}:r}if(r.sharedState){if(!h_().sharedMemory)throw new Error("Shared worker memory is unavailable");new Hi(r.sharedState).throwIfCancelled()}return r}var Hi,p_=p(()=>{ol();Yo();Hi=class{constructor(e){if(typeof SharedArrayBuffer>"u"||!(e instanceof SharedArrayBuffer)||e.byteLength!==16)throw new Error("Expected a 16-byte shared worker control buffer");this.buffer=e,this.values=new Int32Array(e)}get snapshot(){return{cancelled:Atomics.load(this.values,0)!==0,completed:Atomics.load(this.values,1),total:Atomics.load(this.values,2),revision:Atomics.load(this.values,3)}}cancel(){Atomics.store(this.values,0,1),Atomics.add(this.values,3,1),Atomics.notify(this.values,0)}throwIfCancelled(){if(Atomics.load(this.values,0)!==0){let e=new Error("Shared worker task was cancelled");throw e.name="AbortError",e}}setProgress(e,t=-1){if(!Number.isInteger(e)||e<0||e>2147483647||!Number.isInteger(t)||t<-1||t>2147483647)throw new RangeError("Shared progress requires nonnegative int32 counts (or total -1)");Atomics.store(this.values,1,e),Atomics.store(this.values,2,t),Atomics.add(this.values,3,1)}}});function al(r){let e=new Set,t=0;function n(s){if(!(!s||typeof s!="object"||e.has(s)))if(e.add(s),ArrayBuffer.isView(s))n(s.buffer);else if(s instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&s instanceof SharedArrayBuffer)t+=s.byteLength;else if(s instanceof Map)for(let[i,o]of s)n(i),n(o);else if(s instanceof Set)for(let i of s)n(i);else for(let i of Object.keys(s))n(s[i])}return n(r),t}var m_=p(()=>{});function mm(r){if(r!==void 0&&r!=="copy"&&r!=="transfer")throw new Error("Invalid worker output ownership")}var b_=p(()=>{});async function gm(r,e,t={},n={},s={}){if(mm(t.outputOwnership),t.inputOwnership!==void 0&&!["copy","transfer","share"].includes(t.inputOwnership))throw new Error("Invalid worker input ownership");t=pm(t),g_(t.signal),bm(t,[e,Fc(t),s]);let i=fm(r),o=t.workerPool??ea.getWorkerFarm(t).getWorkerPool(x_(r,t,i)),a=t.jobName||r.name,c=await o.startJob(a,T_.bind(null,n,t),void 0,t.signal,{inputBytes:al([e,A_(t),s]),priority:t.priority,admission:t.admission,sharedState:t.sharedState?new Hi(t.sharedState):void 0,cancellationMode:t.cancellationMode,cancellationTimeout:t.cancellationTimeout});try{t.signal?.aborted&&!c.isCancelled&&c.abort(y_(t.signal));let u=Fc(t),f=Zo(u),l=Zo(s);return c.isRunning&&c.postMessage("process",{input:e,options:f,context:l},t.inputOwnership==="copy"||t.inputOwnership==="share"?[]:void 0),(await c.result).result}catch(u){throw c.isCancelled||c.abort(u),u}}function ym(r,e,t={},n={},s={}){if(mm(t.outputOwnership),t.inputOwnership!==void 0&&!["copy","transfer","share"].includes(t.inputOwnership))throw new Error("Invalid worker input ownership");return jO(r,e,t,n,s)}async function*jO(r,e,t,n,s){t=pm(t),g_(t.signal);let i=fm(r),o=t.workerPool??ea.getWorkerFarm(t).getWorkerPool(x_(r,t,i));bm(t,[Fc(t),s]);let a=al([A_(t),s]),c=t.inputBytes??a;if(o.requiresInputBytes&&t.inputBytes===void 0)throw new Error("Byte-bounded batch sessions require inputBytes");if(!Number.isSafeInteger(c)||c<a)throw new RangeError("Batch inputBytes must cover options and context buffers");let u=new Bc,f=GO(e),l=!1,d=!1,h=!1,m=Promise.resolve(),b=new Error("Worker batch job failed"),w=()=>{!d&&!h&&(h=!0,zO(f))},g=()=>{l||(l=!0,u.close())},x=_=>{l||(l=!0,u.enqueue(b),u.close())},T=await o.startJob(t.jobName||r.name,(_,v,I)=>{if(!(_.isCancelled&&v!=="done"&&v!=="error"))switch(v){case"progress":__(_,t,I);break;case"input-request":m=m.then(async()=>{if(!_.isRunning)return;let N=await f.next();if(_.isRunning)if(N.done)d=!0,_.postMessage("input-done",{});else{if(bm(t,N.value),t.inputBytes!==void 0&&al(N.value)+a>c)throw new RangeError("Worker batch exceeds reserved inputBytes");_.postMessage("input-batch",{input:N.value},t.inputOwnership==="copy"||t.inputOwnership==="share"?[]:void 0)}}).catch(N=>{_.isCancelled||_.abort(N)});break;case"output-batch":u.push(I.result);break;case"done":_.done(I),g();break;case"error":{let N=new Error(I.error||"Worker batch processing failed");N.name=I.errorName||"Error",_.error(N),x(N);break}case"process":T_(n,t,_,v,I);break;default:{let N=new Error(`Unexpected worker batch message: ${v}`);_.error(N),x(N);break}}},void 0,t.signal,{inputBytes:c,priority:t.priority,admission:t.admission,sharedState:t.sharedState?new Hi(t.sharedState):void 0,cancellationMode:t.cancellationMode,cancellationTimeout:t.cancellationTimeout}).catch(_=>{throw w(),_});T.result.catch(_=>{x(_),w()});try{let _=Fc(t);T.isRunning&&T.postMessage("process-in-batches",{options:Zo(_),context:Zo(s)},t.inputOwnership==="copy"||t.inputOwnership==="share"?[]:void 0);try{for await(let v of u)yield v,T.isRunning&&T.postMessage("output-ack",{})}catch(v){throw v===b&&await T.result,v}await T.result}finally{T.isRunning&&!T.isCancelled&&T.abort(w_("Worker batch iterator was closed")),w()}}function g_(r){if(r?.aborted)throw y_(r)}function y_(r){return r?r.reason:w_("Worker job was aborted")}function w_(r){let e=new Error(r);return e.name="AbortError",e}function GO(r){return Symbol.asyncIterator in r?r[Symbol.asyncIterator]():(async function*(){yield*r})()}function zO(r){try{Promise.resolve(r.return?.()).catch(()=>{})}catch{}}function x_(r,e,t){if(e.source)return{name:t,source:e.source,workerType:e.workerType};let n=lm(r,e);return n?{name:t,url:n,workerType:e.workerType}:Ut&&r.loadWorker?{name:t,workerType:e.workerType,loadWorker:r.loadWorker,getUrl:()=>dm(r,e),urlKey:hm(r)}:{name:t,url:dm(r,e),workerType:e.workerType}}async function T_(r,e,t,n,s){if(!(t.isCancelled&&n!=="done"&&n!=="error"))switch(n){case"progress":__(t,e,s);break;case"done":t.done(s);break;case"error":let i=new Error(s.error);i.name=s.errorName||"Error",t.error(i);break;case"process":let{id:o,input:a,options:c}=s;try{if(!r.process){t.postMessage("error",{id:o,error:"Worker not set up to process on main thread"});return}let u=await r.process(a,{...c,signal:e.signal,onProgress:e.onProgress},void 0,s.context||{});t.postMessage("done",{id:o,result:u})}catch(u){let f=u instanceof Error?u.message:"unknown error";t.postMessage("error",{id:o,error:f})}break;default:console.warn(`process-on-worker: unknown message ${n}`)}}function __(r,e,t){if(!(!r.isRunning||r.isCancelled||!t.progress))try{e.onProgress?.(t.progress)}catch(n){r.abort(n)}}function Fc(r){let{signal:e,onProgress:t,onMetrics:n,workerPool:s,admission:i,workerType:o,...a}=r;return a}function bm(r,e){if(r.inputOwnership==="share"&&cr(e).length)throw new Error("Share ownership requires SharedArrayBuffer storage; ordinary transferables are not allowed")}function A_(r){let{sharedState:e,...t}=Fc(r);return t}var v_=p(()=>{u_();c_();d_();il();p_();Yo();m_();b_()});var WO,wm,cq,cl=p(()=>{um();v_();il();WO={},wm=typeof __filename=="string"?__filename.replace(/\\/g,"/"):"",cq=wm?`file://${wm.startsWith("/")?"":"/"}${encodeURI(wm).replace(/#/g,"%23").replace(/\?/g,"%3F")}`:WO.url});function S_(r,e){if(!r.preload)return Promise.resolve();let t=xm.get(r);return t||(t=Promise.resolve().then(()=>r.preload()).then(()=>{I_.add(r)}),xm.set(r,t),t.catch(()=>xm.delete(r))),$O(t,e)}function E_(r){return!r.preload||I_.has(r)}function $O(r,e){return e?new Promise((t,n)=>{let s=()=>{e.removeEventListener("abort",s),n(e.reason)};e.addEventListener("abort",s,{once:!0}),e.aborted&&s(),r.then(i=>{e.removeEventListener("abort",s),t(i)},i=>{e.removeEventListener("abort",s),n(i)})}):r}var xm,I_,Tm=p(()=>{xm=new WeakMap,I_=new WeakSet});function an(r){if(!r||typeof r!="object"||Object.getPrototypeOf(r)!==Object.prototype)throw new TypeError("Task payloads must be plain objects with named fields")}function Vt(r,e="copy"){if(an(r),!["copy","transfer","share"].includes(e))throw new TypeError("Invalid input ownership");let t=cr(r);if(e==="share"&&t.length)throw new TypeError("Share requires shared storage");return structuredClone(r,{transfer:e==="transfer"?t:[]})}function Oc(r,e={}){let t=e.signal??new AbortController().signal;return{state:r,signal:t,throwIfAborted:()=>{t.throwIfAborted(),e.throwIfAborted?.()},reportProgress:n=>e.reportProgress?.({...n,phase:n.phase??"process",unit:n.unit??"items"})}}function Mc(r){return{signal:r.signal,reportProgress:e=>r.onProgress?.(e)}}var ul,_m=p(()=>{cl();Tm();ul=class{constructor(e){this.task=e,this.initialized=!1}async initialize(e,t={}){if(this.initialized)throw new Error("Task is already initialized");return an(e),await S_(this.task,t.signal),t.signal?.throwIfAborted(),this.state=await this.task.initialize?.(e,Oc(void 0,t)),this.initialized=!0,{}}async destroy(){if(this.initialized){this.initialized=!1;let e=this.state;this.state=void 0,this.task.initialize&&await this.task.destroy?.(e)}return{}}async process(e,t,n={}){if(!this.initialized)throw new Error("Task is not initialized");if(!this.task.process)throw new Error("Task has no atomic processor");an(e);let s=await this.task.process(e,t,Oc(this.state,n));return an(s),s}async*stream(e,t,n={}){if(!this.initialized)throw new Error("Task is not initialized");if(!this.task.processInBatches)throw new Error("Task has no streaming processor");for await(let s of this.task.processInBatches(e,t,Oc(this.state,n)))an(s),yield s}}});function L_(r,e,t={}){if(!E_(r))throw new Error("Preload task on the main thread before runTaskSync");if("execution"in t)throw new TypeError("runTaskSync always runs on the calling thread");if(!r.process)throw new TypeError("Task has no atomic processor");for(let l of[r.initialize,r.process,r.destroy])if(l&&Object.prototype.toString.call(l)==="[object AsyncFunction]")throw new TypeError("runTaskSync requires synchronous lifecycle hooks");if(t.outputOwnership&&!["copy","transfer"].includes(t.outputOwnership))throw new TypeError("Invalid output ownership");let n=Oc(void 0,Mc(t));n.throwIfAborted();let s=t.options??{};if(t.inputOwnership==="transfer"){let l=new Set(cr(s));if(cr(e).some(d=>l.has(d)))throw new Error("Transferred input aliases reusable options; use inputOwnership: copy")}let i=Vt(s),o=Vt(t.initialization??{},t.initializationOwnership),a=!1,c,u=!1,f;try{let l=r.initialize?.(o,n);if(Am(l))throw Promise.resolve(l).then(m=>r.destroy?.(m)).catch(()=>{}),new TypeError("runTaskSync initialize returned a promise");n.state=l,a=!0,n.throwIfAborted();let d=Vt(e,t.inputOwnership),h=r.process(d,i,n);if(Am(h))throw a=!1,Promise.resolve(h).catch(()=>{}).then(()=>{if(r.initialize)return r.destroy?.(n.state)}).catch(()=>{}),new TypeError("runTaskSync process returned a promise");an(h),n.throwIfAborted(),f=Vt(h,t.outputOwnership??"transfer")}catch(l){u=!0,c=l}finally{if(a&&r.initialize)try{let l=r.destroy?.(n.state);if(Am(l))throw Promise.resolve(l).catch(()=>{}),new TypeError("runTaskSync destroy returned a promise")}catch(l){throw u?new AggregateError([c,l],"Task processing and destruction failed"):l}}if(u)throw c;return f}function Am(r){return!!(r&&(typeof r=="object"||typeof r=="function")&&typeof r.then=="function")}var B_=p(()=>{Tm();cl();_m()});async function qO(r,e){let t;try{t=await e()}catch(n){try{await r.close()}catch(s){throw new AggregateError([n,s],"Task processing and destruction failed")}throw n}return await r.close(),t}async function*Im(r,e){let t=Symbol.asyncIterator in r?r[Symbol.asyncIterator]():r[Symbol.iterator](),n=!1,s=!1;try{for(;;){let i=await new Promise((o,a)=>{let c=()=>e?.removeEventListener("abort",u),u=()=>{c(),a(e?.reason)};if(e?.addEventListener("abort",u,{once:!0}),e?.aborted){u();return}try{s=!0,Promise.resolve(t.next()).then(f=>{s=!1,c(),o(f)},f=>{s=!1,c(),a(f)})}catch(f){s=!1,c(),a(f)}});if(i.done){n=!0;return}yield i.value}}finally{if(!n)if(s)try{Promise.resolve(t.return?.()).catch(()=>{})}catch{}else await t.return?.()}}function F_(r,e,t){if(t==="transfer"){let n=new Set(cr(e));if(cr(r).some(s=>n.has(s)))throw new Error("Transferred input aliases reusable options; use inputOwnership: copy")}}var vm,Rc,O_=p(()=>{cl();_m();B_();vm=class{constructor(e,t,n){this.task=e,this.release=t,this.tail=Promise.resolve(),this.closed=!1,this.streams=new Set,this.invalid=!1,this.controller=new AbortController,this.runtime=new ul(e);let s=n.execution??"auto";if(!["auto","main-thread","worker"].includes(s))throw new TypeError("Invalid execution mode");if(s==="worker"&&!e.worker)throw new Error("Task has no worker");if(s!=="main-thread"&&e.worker){let i=e.worker;if(!!i.url==!!i.create)throw new Error("Supply exactly one worker URL or factory");this.pool=new $s({name:e.id,url:i.url?.toString(),loadWorker:i.create,workerType:"module",maxConcurrency:1,maxMobileConcurrency:1}),this.descriptor={id:e.id,name:e.id,module:"core",version:"prototype",options:{},worker:i.url?.toString()??!0,loadWorker:i.create,workerInBatches:i.capabilities.streaming}}}async initialize(e,t){try{an(e),await this.enqueue(()=>this.invoke("initialize",e,{},t))}catch(n){throw await this.terminate(n),n}}runTask(e,...t){return this.enqueue(async()=>(this.checkCapability("atomic"),this.invoke("process",e,t[0]?.options??{},t[0])))}async*runTasks(e,...t){yield*this.serialStream(async function*(n){n.checkCapability("atomic");for await(let s of Im(e,n.controls(t[0]).signal))yield await n.invoke("process",s,t[0]?.options??{},t[0])})}async*runTaskInBatches(e,...t){yield*this.serialStream(async function*(n){n.checkCapability("streaming");let s=n.controls(t[0]),i=Vt(t[0]?.options??{});async function*o(){for await(let c of Im(e,s.signal))s.signal?.throwIfAborted(),F_(c,t[0]?.options??{},s.inputOwnership),yield Vt(c,s.inputOwnership)}let a=!1;try{if(n.pool)await n.invoke("stream-options",{},i,s),yield*ym(n.descriptor,o(),{...n.workerOptions(s),inputOwnership:"transfer",workerInBatches:!0});else for await(let c of n.runtime.stream(o(),i,Mc(s)))s.signal?.throwIfAborted(),yield Vt(c,s.outputOwnership??"transfer");a=!0}catch(c){throw n.pool&&(n.invalid=!0,await n.pool.destroy(c)),c}finally{n.pool&&!a&&(n.invalid=!0)}})}close(){return this.closing||(this.closed=!0,this.closing=(async()=>{try{await this.tail,this.invalid||await this.invoke("destroy",{},{})}finally{try{await this.pool?.destroy()}finally{this.release()}}})()),this.closing}async terminate(e=new Error("Task terminated")){this.controller.abort(e),this.pool&&(this.invalid=!0,await this.pool.destroy(e)),await Promise.allSettled([...this.streams].map(t=>t())),await this.close()}checkCapability(e){if(this.pool?!this.task.worker?.capabilities[e]:!(e==="atomic"?this.task.process:this.task.processInBatches))throw new Error(`Task has no ${e} processor for this execution route`)}controls(e={}){if(e.outputOwnership&&!["copy","transfer"].includes(e.outputOwnership))throw new TypeError("Invalid output ownership");return{...e,signal:e.signal?AbortSignal.any([e.signal,this.controller.signal]):this.controller.signal}}workerOptions(e){return{workerPool:this.pool,workerType:"module",inputOwnership:e.inputOwnership??"copy",outputOwnership:e.outputOwnership??"transfer",signal:e.signal,onProgress:e.onProgress,cancellationMode:"terminate"}}async invoke(e,t,n,s={}){if(this.invalid)throw new Error("Initialized task is invalid; initialize a new instance");let i=e==="destroy"?{}:this.controls(s);i.signal?.throwIfAborted(),an(t),F_(t,n,i.inputOwnership);let o=Vt(n);if(this.pool)try{return await gm(this.descriptor,{operation:e,input:Vt(t,i.inputOwnership),options:o},this.workerOptions({...i,inputOwnership:"transfer"}))}catch(f){throw this.invalid=!0,await this.pool.destroy(f),f}if(e==="destroy")return this.runtime.destroy();let a=Vt(t,i.inputOwnership),c=Mc(i);if(e==="initialize"){let f=await this.runtime.initialize(a,c);return i.signal?.throwIfAborted(),f}let u=await this.runtime.process(a,o,c);return i.signal?.throwIfAborted(),Vt(u,i.outputOwnership??"transfer")}enqueue(e){if(this.closed)return Promise.reject(new Error("Initialized task is closed"));let t=this.tail.then(e);return this.tail=t.catch(()=>{}),t}async*serialStream(e){if(this.closed)throw new Error("Initialized task is closed");let t=this.tail,n;if(this.tail=new Promise(a=>{n=a}),await t,this.controller.signal.aborted)throw n(),this.controller.signal.reason;let s=e(this)[Symbol.asyncIterator](),i,o=()=>(i??(i=(async()=>{try{await s.return?.()}finally{this.streams.delete(o),n()}})()),i);this.streams.add(o);try{for(;;){this.controller.signal.throwIfAborted();let a=await s.next();if(a.done)return;yield a.value}}finally{await o()}}},Rc=class{constructor(e={}){if(this.active=new Set,this.count=0,this.waiters=[],this.closed=!1,this.initializing=new Set,this.iterations=new Set,this.maxConcurrency=e.maxConcurrency??1,!Number.isSafeInteger(this.maxConcurrency)||this.maxConcurrency<1)throw new RangeError("maxConcurrency must be a positive safe integer")}runTaskSync(e,t,...n){if(this.closed)throw new Error("Task runner is closed");if(this.count>=this.maxConcurrency)throw new Error("Task runner has no synchronous capacity");this.count++;try{return L_(e,t,n[0])}finally{let s=this.waiters.shift();s?s.resolve():this.count--}}initializeTask(e,t,n={}){let s=this.open(e,t,n);return this.initializing.add(s),s.then(()=>this.initializing.delete(s),()=>this.initializing.delete(s)),s}async runTask(e,t,...n){let s=n[0]??{},i=await this.initializeTask(e,s.initialization??{},{...s,inputOwnership:s.initializationOwnership??"copy"});return qO(i,()=>i.runTask(t,s))}async*runTasks(e,t,...n){let s=n[0]??{};if(this.closed)throw new Error("Task runner is closed");if(s.initializationOwnership==="transfer")throw new TypeError("runTasks initialization is a reusable template; use copy or share");let i=s.concurrency??1;if(!Number.isSafeInteger(i)||i<1||i>this.maxConcurrency)throw new RangeError("concurrency must be between 1 and maxConcurrency");let o=[],a=new Set,c=[],u=new AbortController;this.iterations.add(u);let f=s.signal?AbortSignal.any([s.signal,u.signal]):u.signal,l=Im(t,f)[Symbol.asyncIterator](),d=!1,h;try{for(;!d||c.length;){f.throwIfAborted(),!d&&!h&&c.length<i&&(h=l.next().then(g=>({kind:"input",next:g})));let m=await Promise.race([...c.length?[c[0]]:[],...h?[h]:[]]);if(m.kind==="result"){if(c.shift(),a.delete(m.handle),m.failed)throw m.error;yield m.value;continue}if(h=void 0,m.next.done){d=!0;continue}let b=o.find(g=>!a.has(g));if(!b&&(o.length===0||this.count<this.maxConcurrency)&&(b=await this.initializeTask(e,Vt(s.initialization??{},s.initializationOwnership),{...s,signal:f,inputOwnership:s.initializationOwnership??"copy"}),o.push(b)),!b){let g=await c.shift();if(a.delete(g.handle),g.failed)throw g.error;yield g.value,b=g.handle}a.add(b);let w=b;c.push(b.runTask(m.next.value,{...s,signal:f}).then(g=>({kind:"result",handle:w,value:g}),g=>({kind:"result",handle:w,failed:!0,error:g})))}}finally{this.iterations.delete(u),u.abort(new Error("Task iteration closed"));try{h&&await h.catch(()=>{}),d||await l.return?.()}finally{await Promise.all(c),await Promise.all(o.map(m=>m.close()))}}}async*runTaskInBatches(e,t,...n){let s=n[0]??{},i=await this.initializeTask(e,s.initialization??{},{...s,inputOwnership:s.initializationOwnership??"copy"});try{yield*i.runTaskInBatches(t,s)}finally{await i.close()}}close(){if(!this.closing){this.closed=!0;for(let e of this.waiters.splice(0))e.reject(new Error("Task runner is closed"));this.closing=(async()=>{await Promise.allSettled(this.initializing);let t=(await Promise.allSettled([...this.active].map(n=>n.close()))).find(n=>n.status==="rejected");if(t?.status==="rejected")throw t.reason})()}return this.closing}async terminate(e=new Error("Task runner terminated")){for(let n of this.iterations)n.abort(e);let t=this.close();await Promise.allSettled([...this.active].map(n=>n.terminate(e))),await t}async open(e,t,n){if(this.closed)throw new Error("Task runner is closed");n.signal?.throwIfAborted(),this.count>=this.maxConcurrency?await new Promise((a,c)=>{let u={resolve:()=>{l(),a()},reject:d=>{l(),c(d)}},f=()=>{this.waiters=this.waiters.filter(d=>d!==u),u.reject(n.signal?.reason)},l=()=>n.signal?.removeEventListener("abort",f);this.waiters.push(u),n.signal?.addEventListener("abort",f,{once:!0}),n.signal?.aborted&&f()}):this.count++;let s,i=!1,o=()=>{if(i)return;i=!0,s&&this.active.delete(s);let a=this.waiters.shift();a?a.resolve():this.count--};try{if(this.closed)throw new Error("Task runner is closed");return s=new vm(e,o,n),this.active.add(s),await s.initialize(t,n),s}catch(a){throw o(),a}}}});var M_=p(()=>{O_()});function R_(r){return{...r,phase:r.phase??"process",unit:r.unit??"items"}}var D_=p(()=>{"use strict"});function Sm(r,e={}){let t=qe?r.workerFile||`${r.id}-worker.js`:r.workerNode||`${r.id}-worker-node.js`,n=Em(r,e),s=e._workerType||e?.core?._workerType;if(!n&&s==="test")if(qe)n=`modules/${r.module}/dist/${t}`;else{let i=r.module==="core"&&r.workerNode?.startsWith("worker-utils/")?"worker-utils/workers":"workers",o=r.workerSourceNode||`${i}/${r.id}-worker-node.ts`;n=`modules/${r.module}/src/${o}`}return n||null}function Em(r,e={}){return(e[r.id]||{}).workerUrl||(r.id==="compression"?e.workerUrl:null)||null}function k_(r,e={}){let t=Sm(r,e),n=typeof r.worker=="string"?r.worker:null,s=t||n||KO(r,!0);return rl(s),s}function KO(r,e=!1){let t=qe?r.workerFile||`${r.id}-worker.js`:r.workerNode||`${r.id}-worker-node.js`,n=r.version;n==="latest"&&(n=tm);let s=n?`@${n}`:"",i=`https://unpkg.com/@loaders.gl/${r.module}${s}/dist/${t}`;return e&&XO(r,i),i}function XO(r,e){if(r.version!=="latest")return;let t=`${r.module}:${r.id}`;N_.has(t)||(N_.add(t),console.warn(`loaders.gl: ${r.name} loader worker version is "latest" because __VERSION__ was not injected. Fetching ${e} from CDN.`))}var N_,C_=p(()=>{"use strict";rm();Ec();K0();N_=new Set});function Lm(r,e=!0,t){let n=t||new Set;if(r){if(U_(r))n.add(r);else if(U_(r.buffer))n.add(r.buffer);else if(!ArrayBuffer.isView(r)){if(e&&typeof r=="object")for(let s in r)Lm(r[s],e,n)}}return t===void 0?Array.from(n):[]}function U_(r){return r?r instanceof ArrayBuffer||typeof MessagePort<"u"&&r instanceof MessagePort||typeof ImageBitmap<"u"&&r instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&r instanceof OffscreenCanvas:!1}function Bm(r){if(r===null)return{};let e=Object.assign({},r);return Object.keys(e).forEach(t=>{r[t]!==null&&typeof r[t]=="object"&&!ArrayBuffer.isView(r[t])&&!(r[t]instanceof Array)?e[t]=Bm(r[t]):typeof e[t]=="function"||e[t]instanceof RegExp?e[t]={}:e[t]=r[t]}),e}var V_=p(()=>{"use strict"});function Fm(r,e={}){return!!((qe?typeof Worker<"u":!!e._nodeWorkers)&&e.worker&&(r.worker||r.loadWorker||Em(r,e)))}async function*Om(r,e,t={},n={},s={}){let i=QO(e),o;try{o=await YO(r,t,n,s);for await(let a of o.handle.runTaskInBatches(i,{...z_(t),options:JO(t)}))yield a.value}finally{i.return?.()?.catch(()=>{}),await o?.close()}}function HO(r,e){if(e.source||e.core?.source)throw new Error("Inline legacy worker source is unsupported; use a TaskRunner worker URL or factory");let t=!Sm(r,e)&&qe?r.loadWorker:void 0,n=k_(r,e);return{id:`${r.module}:${r.id}`,initialize:s=>s,worker:{...t?{create:()=>t()??ZO(n)}:{url:n},capabilities:{atomic:!0,streaming:!0}}}}function z_(r){return{execution:"worker",signal:r.signal,inputOwnership:r.inputOwnership??"transfer",outputOwnership:r.outputOwnership??"transfer",onProgress:r.onProgress?e=>r.onProgress?.(R_(e)):void 0}}function JO(r){let{signal:e,onProgress:t,...n}=r;return Bm(n)}async function YO(r,e,t,n){e.signal?.throwIfAborted();let s=HO(r,e),i=P_.get(r);i||(i={runner:new Rc({maxConcurrency:Y0?e.maxMobileConcurrency??1:e.maxConcurrency??3}),requests:0},P_.set(r,i));let o=i,a=t.process?new MessageChannel:void 0,c=new AbortController,u=!1,f=()=>c.abort(e.signal?.reason);e.signal?.addEventListener("abort",f,{once:!0});let l=()=>{u=!0,e.signal?.removeEventListener("abort",f),c.abort(),a?.port1.close(),a?.port2.close()};a&&(a.port1.onmessage=async({data:b})=>{try{let w=await t.process(b.input,b.options,{signal:c.signal,throwIfAborted:()=>c.signal.throwIfAborted()},b.context);!u&&!c.signal.aborted&&a.port1.postMessage({identifier:b.identifier,value:w},Lm(w))}catch(w){if(u||c.signal.aborted)return;a.port1.postMessage({identifier:b.identifier,error:{name:w instanceof Error?w.name:"Error",message:w instanceof Error?w.message:String(w)}})}},a.port1.start()),o.requests++,j_.add(o);let d=!1,h=()=>{d||(d=!0,o.requests--,o.requests||j_.delete(o))},m;try{m=await o.runner.initializeTask(s,{context:structuredClone(n),...a?{port:a.port2}:{}},{...z_(e),inputOwnership:"transfer"})}catch(b){throw h(),l(),b}return{handle:m,async close(){try{await m.close()}finally{l(),h()}}}}function QO(r){let e=Symbol.asyncIterator in r?r[Symbol.asyncIterator]():r[Symbol.iterator](),t=!1;return{[Symbol.asyncIterator](){return this},async next(){if(t)return{done:!0,value:void 0};let n=await e.next();return n.done||t?(t=!0,{done:!0,value:void 0}):{done:!1,value:{value:n.value}}},async return(){return t||(t=!0,await e.return?.()),{done:!0,value:void 0}}}}function ZO(r){let e=new URL(r,globalThis.document?.baseURI??globalThis.location.href),t=e.href;if(/^https?:$/.test(e.protocol)&&e.origin!==globalThis.location.origin){let n=G_.get(e.href);n||(n=URL.createObjectURL(new Blob([`import ${JSON.stringify(e.href)};`],{type:"application/javascript"})),G_.set(e.href,n)),t=n}return new Worker(t,{type:"module"})}var P_,j_,G_,W_=p(()=>{"use strict";M_();C_();D_();V_();Ec();P_=new WeakMap,j_=new Set,G_=new Map});function cn(r={}){let e=r.useLocalLibraries??r.core?.useLocalLibraries,t=eM(r.CDN,r.core?.CDN),n=r.modules;return{...e!==void 0?{useLocalLibraries:e}:{},...t!==void 0?{CDN:t}:{},...n!==void 0?{modules:n}:{}}}function eM(r,e){if(typeof r=="string"||r===null)return r;if(typeof e=="string"||e===null)return e}async function ta(r,e=null,t={},n=null,s=null){let i=r;if(e){let a=n||r,c=t.modules?.[a];if(c!==void 0&&typeof c!="string")return c;r=Rm(r,e,t,n),i=s&&(!(typeof c=="string")||typeof t.modules?.[s]=="string")?Rm(s,e,t,s):r}let o=tM(r,i,Ki);return Mm[o]=Mm[o]||rM(r,i),await Mm[o]}function tM(r,e,t){return t?JSON.stringify([r,e]):r}function Rm(r,e,t={},n=null){if(t?.core)throw new Error("loadLibrary: options.core must be pre-normalized");n=n||r;let s=t.modules||{};if(typeof s[n]=="string")return s[n];if(!t.useLocalLibraries&&r.startsWith("http"))return r;if(!qe)return`modules/${e}/dist/libs/${n}`;if(t.CDN){if(typeof t.CDN!="string")throw new Error("loadLibrary: options.CDN must be a string or null");return rl(t.CDN.startsWith("http")),`${t.CDN}/${e}@${X0}/dist/libs/${n}`}return Ki?n.endsWith(".mjs")?`./libs/${n}`:`../src/libs/${n}`:`modules/${e}/src/libs/${n}`}async function rM(r,e){if(r.endsWith("wasm"))return await iM(r);if(!qe){let{requireFromFile:n}=globalThis.loaders||{};try{let s=await n?.(r);return s||!r.includes("/dist/libs/")?s:await n?.(r.replace("/dist/libs/","/src/libs/"))}catch(s){if(r.includes("/dist/libs/"))try{return await n?.(r.replace("/dist/libs/","/src/libs/"))}catch{}return console.error(s),null}}if(Ki)return nM(r,e);let t=await oM(r);return sM(t,r)}async function nM(r,e=r){try{importScripts()}catch{let n=await import(new URL(e,globalThis.location.href).href);return n.default??n}return importScripts(r)}function sM(r,e){let t=document.createElement("script");t.id=e;try{t.appendChild(document.createTextNode(r))}catch{t.text=r}return document.body.appendChild(t),null}async function iM(r){let{readFileAsArrayBuffer:e}=globalThis.loaders||{};if(qe||!e||r.startsWith("http"))return await(await fetch(r)).arrayBuffer();try{return await e(r)}catch{if(r.includes("/dist/libs/"))return await e(r.replace("/dist/libs/","/src/libs/"));throw new Error(`Failed to load ArrayBuffer from ${r}`)}}async function oM(r){let{readFileAsText:e}=globalThis.loaders||{};if(qe||!e||r.startsWith("http"))return await(await fetch(r)).text();try{return await e(r)}catch{if(r.includes("/dist/libs/"))return await e(r.replace("/dist/libs/","/src/libs/"));throw new Error(`Failed to load text from ${r}`)}}var Mm,$_=p(()=>{"use strict";Ec();rm();H0();Mm={}});var qs=p(()=>{"use strict";Ec();W_();$_()});function Dm(r,e){let t=e?._nodeWorkers??e?.core?._nodeWorkers,n=e?.worker??e?.core?.worker;return!Cn&&!t?!1:Fm({...r,options:r.options||{}},{worker:!!n,_nodeWorkers:!!t})}var q_=p(()=>{"use strict";qs();Yp()});function X_(r,e=5){return typeof r=="string"?r.slice(0,e):ArrayBuffer.isView(r)?K_(r.buffer,r.byteOffset,e):r instanceof ArrayBuffer?K_(r,0,e):""}function K_(r,e,t){if(r.byteLength<=e+t)return"";let n=new DataView(r),s="";for(let i=0;i<t;i++)s+=String.fromCharCode(n.getUint8(e+i));return s}var H_=p(()=>{"use strict"});function Nm(r){try{return JSON.parse(r)}catch{throw new Error(`Failed to parse JSON from data starting with "${X_(r)}"`)}}var J_=p(()=>{"use strict";H_()});function km(...r){return Y_(r)}function Y_(r){let e=r.map(i=>i instanceof ArrayBuffer?new Uint8Array(i):i),t=e.reduce((i,o)=>i+o.byteLength,0),n=new Uint8Array(t),s=0;for(let i of e)n.set(i,s),s+=i.byteLength;return n.buffer}function Ji(r,e,t){let n=t!==void 0?new Uint8Array(r).subarray(e,e+t):new Uint8Array(r).subarray(e);return new Uint8Array(n).buffer}var Cm=p(()=>{"use strict"});function Te(r,e){return ar(r>=0),ar(e>0),r+(e-1)&~(e-1)}function Yi(r,e,t){let n;if(r instanceof ArrayBuffer)n=new Uint8Array(r);else{let s=r.byteOffset,i=r.byteLength;n=new Uint8Array(r.buffer||r.arrayBuffer,s,i)}return e.set(n,t),t+Te(n.byteLength,4)}var Um=p(()=>{"use strict";Jp()});function Dc(r,e,t,n){let s=Te(t.byteLength,n),i=s-t.byteLength;if(r){let o=new Uint8Array(r.buffer,r.byteOffset+e,t.byteLength),a=new Uint8Array(t);o.set(a);for(let c=0;c<i;++c)r.setUint8(e+t.byteLength+c,32)}return e+=s,e}function fl(r,e,t,n){let i=new TextEncoder().encode(t);return e=Dc(r,e,i,n),e}var Q_=p(()=>{"use strict";Um()});function Vm(r){let e=new Uint8Array(r),t=[],n=3*4096;for(let s=0;s<e.length;s+=n)t.push(btoa(String.fromCharCode(...e.subarray(s,s+n))));return t.join("")}var Z_=p(()=>{"use strict"});async function*Pm(r,e={}){let t=new TextDecoder(void 0,e);for await(let n of r)yield typeof n=="string"?n:t.decode(n,{stream:!0})}async function*jm(r){let e="";for await(let t of r){e+=t;let n;for(n=e.indexOf(`
|
|
36
|
+
}`}var Em,P_=p(()=>{ff();Em=new Map});function yt(r,e=!0,t){let n=t||new Set,s=new Set;function i(o){if(!(!o||typeof o!="object"||s.has(o))){if(s.add(o),Bm(o))n.add(o);else if(ArrayBuffer.isView(o))Bm(o.buffer)&&n.add(o.buffer);else if(e&&typeof MessageChannel<"u"&&o instanceof MessageChannel)i(o.port1),i(o.port2);else if(e&&o instanceof Map)for(let[a,c]of o)i(a),i(c);else if(e&&o instanceof Set)for(let a of o)i(a);else if(e)for(let a of Object.keys(o))i(o[a])}}return i(r),t===void 0?Array.from(n):[]}function Bm(r){return r?r instanceof ArrayBuffer||typeof MessagePort<"u"&&r instanceof MessagePort||typeof ImageBitmap<"u"&&r instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&r instanceof OffscreenCanvas:!1}function na(r){let e=new Map;function t(n){if(typeof n=="function"||n instanceof RegExp)return{};if(!n||typeof n!="object")return n;if(e.has(n))return e.get(n);if(ArrayBuffer.isView(n)||n instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&n instanceof SharedArrayBuffer||n instanceof Date||typeof WebAssembly<"u"&&n instanceof WebAssembly.Module||Bm(n))return n;let s=n instanceof Map?new Map:n instanceof Set?new Set:Array.isArray(n)?[]:{};if(e.set(n,s),n instanceof Map)for(let[i,o]of n)s.set(t(i),t(o));else if(n instanceof Set)for(let i of n)s.add(t(i));else for(let i of Object.keys(n))Object.defineProperty(s,i,{value:t(n[i]),enumerable:!0,writable:!0,configurable:!0});return s}return r===null?{}:t(r)}var df=p(()=>{});var Fm,Sr,Mc=p(()=>{C_();ta();ff();P_();df();Fm=()=>{},Sr=class{static isSupported(){return typeof Worker<"u"&&zt||typeof ra<"u"&&!zt}constructor(e){this.terminated=!1,this.createdAt=performance.now(),this._loadableURL="";let{name:t,source:n,url:s,getUrl:i,loadWorker:o}=e;Qi(n||s||i||o),this.name=t,this.source=n,this.url=s,this.workerType=e.workerType??"classic",this.getUrl=i,this.loadWorker=o,this.onMessage=Fm,this.onError=c=>console.log(c);let a=performance.now();this.worker=zt?this._createBrowserWorker():this._createNodeWorker(),this.creationTimeMs=performance.now()-a}destroy(){return this.onMessage=Fm,this.onError=Fm,this.terminated?this.termination??Promise.resolve():(this.terminated=!0,this.termination=Promise.resolve(this.worker.terminate()).then(()=>{}).finally(()=>this.releaseModuleWorkerURL()),this.termination.catch(()=>{}),this.termination)}unref(){!zt&&typeof this.worker.unref=="function"&&this.worker.unref()}ref(){!zt&&typeof this.worker.ref=="function"&&this.worker.ref()}get isRunning(){return!!this.onMessage}postMessage(e,t){t=t||yt(e),this.worker.postMessage(e,t)}_getErrorFromErrorEvent(e){let t="Failed to load ";return t+=`worker ${this.name} from ${this.url||"built-in worker factory"}. `,e.message&&(t+=`${e.message} in `),e.lineno&&(t+=`:${e.lineno}:${e.colno}`),new Error(t)}_createBrowserWorker(){if(this.loadWorker)try{let t=this.loadWorker();if(t)return this._initializeBrowserWorker(t)}catch(t){if(!this.source&&!this.url&&!this.getUrl)throw t}let e=this.url||this.getUrl?.();this._loadableURL=U_({source:this.source,url:e,workerType:this.workerType}),this.workerType==="module"&&e&&this._loadableURL!==e&&this._loadableURL.startsWith("blob:")&&(this.ownedModuleWorkerURL=this._loadableURL);try{let t=new Worker(this._loadableURL,{name:this.name,type:this.workerType});return this._initializeBrowserWorker(t)}catch(t){throw this.releaseModuleWorkerURL(),t}}releaseModuleWorkerURL(){this.ownedModuleWorkerURL&&(URL.revokeObjectURL(this.ownedModuleWorkerURL),this.ownedModuleWorkerURL=void 0)}_initializeBrowserWorker(e){return e.onmessage=t=>{t.data?t.data.type==="ready"?this.startupTimeMs=performance.now()-this.createdAt:this.onMessage(t.data):this.onError(new Error("No data received"))},e.onerror=t=>{let n=this.onError,s=this._getErrorFromErrorEvent(t);this.destroy(),n(s)},e.onmessageerror=()=>{let t=this.onError;this.destroy(),t(new Error("Worker message could not be deserialized"))},e}_createNodeWorker(){let e;if(this.url){let n=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`,s=n.startsWith("file:")?new URL(n):n,i=this.url.endsWith(".ts")||this.url.endsWith(".mjs")?"module":"commonjs";e=new ra(s,{eval:!1,type:i})}else if(this.source)e=new ra(this.source,{eval:!0});else throw new Error("no worker");return e.on("message",t=>{t?.type==="ready"?this.startupTimeMs=performance.now()-this.createdAt:this.onMessage(t)}),e.on("error",t=>{this.terminated=!0,this.onError(t)}),this.termination=new Promise(t=>e.on("exit",()=>t())),e.on("exit",t=>{this.terminated||(this.terminated=!0,this.onError(new Error(`Worker ${this.name} exited unexpectedly (code ${t})`)))}),e}}});var Hs,Om=p(()=>{ta();Mc();N_();Hs=class{get stats(){return{...this.totals,queuedJobs:this.jobQueue.length,activeJobs:this.activeJobs.size,queuedBytes:this.queuedBytes+this.reservedBytes,inFlightBytes:this.inFlightBytes,pendingAdmissions:this.admissions.length,reservations:this.reservations.size}}reserve(e,t={}){let{signal:n}=t;return n?.aborted?Promise.reject(n.reason):this.isDestroyed?Promise.reject(new Error("Worker pool was destroyed")):this.isClosing?Promise.reject(new Error("Worker pool is closing")):!Number.isSafeInteger(e)||e<0||e>this.maxQueuedBytes||e>this.maxInFlightBytes?Promise.reject(new RangeError("Reservation exceeds worker byte budgets")):this.maxQueuedJobs<1||this.admissions.length>=this.maxPendingAdmissions?Promise.reject(new RangeError("Worker admission queue is full")):new Promise((s,i)=>{let o=()=>{let c=this.admissions.indexOf(a);c>=0&&this.admissions.splice(c,1),a.cleanup(),i(n?.reason),this._admit()},a={inputBytes:e,resolve:s,reject:i,cleanup:()=>n?.removeEventListener("abort",o)};this.admissions.push(a),n?.addEventListener("abort",o,{once:!0}),this._admit()})}_admit(){for(;!this.isDestroyed&&!this.isClosing&&this.admissions.length;){let e=this.admissions[0];if(e.inputBytes>this.maxQueuedBytes||e.inputBytes>this.maxInFlightBytes){this.admissions.shift(),e.cleanup(),e.reject(new RangeError("Reservation exceeds worker byte budgets"));continue}if(this.jobQueue.length+this.reservations.size>=this.maxQueuedJobs||e.inputBytes>this.maxQueuedBytes-this.queuedBytes-this.reservedBytes)return;this.admissions.shift(),e.cleanup();let t={inputBytes:e.inputBytes,release:()=>{this.reservations.delete(t)&&(this.reservedBytes-=t.inputBytes,this._admit())}};this.reservations.add(t),this.reservedBytes+=t.inputBytes,this.totals.peakQueuedBytes=Math.max(this.totals.peakQueuedBytes,this.queuedBytes+this.reservedBytes),e.resolve(t)}}static isSupported(){return Sr.isSupported()}constructor(e){this.name="unnamed",this.maxConcurrency=1,this.maxMobileConcurrency=1,this.onDebug=()=>{},this.reuseWorkers=!0,this.props={},this.jobQueue=[],this.idleQueue=[],this.activeJobs=new Set,this.startingJobs=0,this.count=0,this.workers=new Set,this.queuedBytes=0,this.inFlightBytes=0,this.maxQueuedBytes=1/0,this.maxInFlightBytes=1/0,this.isDestroyed=!1,this.isClosing=!1,this.maxQueuedJobs=1/0,this.maxPendingAdmissions=128,this.priorityAgingMs=1e3,this.reservations=new Set,this.admissions=[],this.reservedBytes=0,this.totals={peakQueuedBytes:0,peakInFlightBytes:0,workersCreated:0,workerRestarts:0,completed:0,failed:0,cancelled:0},this.source=e.source,this.url=e.url,this.workerType=e.workerType,this.getUrl=e.getUrl,this.loadWorker=e.loadWorker,this.setProps(e)}close(e={}){if(this.closing)return this.closing;if(this.isDestroyed)return this.destroy();if(e.timeout!==void 0&&(!Number.isFinite(e.timeout)||e.timeout<0||e.timeout>2147483647))return Promise.reject(new RangeError("Close timeout must be between 0 and 2147483647 ms"));this.isClosing=!0;let t=new Error("Worker pool is closing");this.admissions.splice(0).forEach(o=>{o.cleanup(),o.reject(t)}),this.reservations.clear(),this.reservedBytes=0;let n,s=new Promise(o=>{this.onDrained=o}),i=e.timeout===void 0?s:Promise.race([s,new Promise(o=>{n=setTimeout(o,e.timeout)})]);return this.closing=i.then(async()=>{clearTimeout(n),await this.destroy()}),this._checkDrained(),this.closing}_checkDrained(){this.isClosing&&!this.jobQueue.length&&!this.activeJobs.size&&!this.startingJobs&&this.onDrained?.()}destroy(e=new Error("Worker pool was destroyed")){if(this.destruction)return this.destruction;let t=[...this.workers];this.isDestroyed=!0,this.onDrained?.(),this.activeJobs.forEach(s=>s.abort(e)),this.admissions.splice(0).forEach(s=>{s.cleanup(),s.reject(e)}),this.reservations.clear(),this.reservedBytes=0;let n=this.jobQueue.splice(0);return this.queuedBytes=0,n.forEach(s=>{s.removeAbortListener(),s.onReject(e)}),this.idleQueue.splice(0).forEach(s=>{s.destroy(),this.count--}),this.isDestroyed=!0,this.destruction=Promise.all(t.map(s=>s.destroy())).then(()=>{this.workers.clear()}),this.destruction.catch(()=>{}),this.destruction}setProps(e){for(let t of["maxQueuedBytes","maxInFlightBytes","maxQueuedJobs","maxPendingAdmissions"]){let n=e[t];if(n!==void 0&&(!(n>=0)||n!==1/0&&!Number.isSafeInteger(n)))throw new RangeError(`${t} must be a nonnegative safe integer or Infinity`)}if(e.priorityAgingMs!==void 0&&(!Number.isFinite(e.priorityAgingMs)||e.priorityAgingMs<=0))throw new RangeError("priorityAgingMs must be positive and finite");this.maxQueuedJobs=e.maxQueuedJobs??this.maxQueuedJobs,this.maxPendingAdmissions=e.maxPendingAdmissions??this.maxPendingAdmissions,this.priorityAgingMs=e.priorityAgingMs??this.priorityAgingMs,this.maxQueuedBytes=e.maxQueuedBytes??this.maxQueuedBytes,this.maxInFlightBytes=e.maxInFlightBytes??this.maxInFlightBytes,this.props={...this.props,...e},e.name!==void 0&&(this.name=e.name),e.maxConcurrency!==void 0&&(this.maxConcurrency=e.maxConcurrency),e.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=e.maxMobileConcurrency),e.reuseWorkers!==void 0&&(this.reuseWorkers=e.reuseWorkers),e.onDebug!==void 0&&(this.onDebug=e.onDebug);for(let t of[...this.jobQueue])t.inputBytes>this.maxInFlightBytes&&(this.jobQueue.splice(this.jobQueue.indexOf(t),1),this.queuedBytes-=t.inputBytes,t.removeAbortListener(),t.onReject(new RangeError("Worker job exceeds maxInFlightBytes")));this._admit(),this._startQueuedJob(),this._checkDrained()}get requiresInputBytes(){return this.maxQueuedBytes!==1/0||this.maxInFlightBytes!==1/0}async startJob(e,t=(o,a,c)=>o.done(c),n=(o,a)=>o.error(a),s,i={}){if(i.cancellationMode!==void 0&&!["terminate","cooperative"].includes(i.cancellationMode))throw new Error("Invalid worker cancellation mode");if(i.cancellationTimeout!==void 0&&(!Number.isFinite(i.cancellationTimeout)||i.cancellationTimeout<0))throw new RangeError("cancellationTimeout must be finite and nonnegative");if(s?.aborted)throw s.reason;if(this.isDestroyed)return Promise.reject(new Error("Worker pool was destroyed"));if(this.isClosing)return Promise.reject(new Error("Worker pool is closing"));let{inputBytes:o=0,priority:a=0}=i;if(!Number.isSafeInteger(o)||o<0||!Number.isFinite(a))throw new RangeError("Invalid worker scheduling inputBytes or priority");if(o>this.maxInFlightBytes)throw new RangeError("Worker job exceeds maxInFlightBytes");let c=i.admission;if(c&&(!this.reservations.has(c)||c.inputBytes!==o))throw new Error("Invalid or consumed worker admission");let u=!this.jobQueue.length&&this.activeJobs.size<this._getMaxConcurrency()&&this.inFlightBytes+o<=this.maxInFlightBytes;if(!c&&!u&&(this.jobQueue.length+this.reservations.size>=this.maxQueuedJobs||o>this.maxQueuedBytes-this.queuedBytes-this.reservedBytes))throw new RangeError("Worker queue exceeds maxQueuedBytes or maxQueuedJobs");c&&(this.reservations.delete(c),this.reservedBytes-=c.inputBytes);let l=new Promise((f,d)=>{let h=()=>{let g=this.jobQueue.indexOf(m);g>=0&&(this.jobQueue.splice(g,1),this.queuedBytes-=m.inputBytes,this._admit(),this._startQueuedJob(),m.removeAbortListener(),d(s?.reason),this._checkDrained())},m={name:e,inputBytes:o,priority:a,queuedAt:performance.now(),sharedState:i.sharedState,cancellationMode:i.cancellationMode,cancellationTimeout:i.cancellationTimeout,onMessage:t,onError:n,onStart:f,onReject:d,signal:s,removeAbortListener:()=>s?.removeEventListener("abort",h)},b=this.jobQueue.findIndex(g=>g.priority<a);return this.jobQueue.splice(b<0?this.jobQueue.length:b,0,m),this.queuedBytes+=o,u||(this.totals.peakQueuedBytes=Math.max(this.totals.peakQueuedBytes,this.queuedBytes+this.reservedBytes)),s?.addEventListener("abort",h,{once:!0}),this});return this._startQueuedJob(),await l}async _startQueuedJob(){if(!this.jobQueue.length)return;let e=performance.now();if(this.jobQueue.sort((s,i)=>i.priority+Math.floor((e-i.queuedAt)/this.priorityAgingMs)-(s.priority+Math.floor((e-s.queuedAt)/this.priorityAgingMs))),this.jobQueue[0].inputBytes>this.maxInFlightBytes-this.inFlightBytes)return;let t;try{t=this._getAvailableWorker()}catch(s){let i=this.jobQueue.shift();i&&(this.queuedBytes-=i.inputBytes),this._admit(),i?.removeAbortListener(),i?.onReject(s),this._startQueuedJob(),this._checkDrained();return}if(!t)return;let n=this.jobQueue.shift();if(n){this.startingJobs++,this.queuedBytes-=n.inputBytes,this.inFlightBytes+=n.inputBytes,this.totals.peakInFlightBytes=Math.max(this.totals.peakInFlightBytes,this.inFlightBytes),this._admit();let s=performance.now();try{this.onDebug({message:"Starting job",name:n.name,workerThread:t,backlog:this.jobQueue.length})}catch{}if(this.isDestroyed||t.terminated){this.startingJobs--,this.inFlightBytes-=n.inputBytes,n.removeAbortListener(),n.onReject(new Error("Worker pool was destroyed before job start")),this.returnWorkerToQueue(t);return}let i=new Oc(n.name,t);i.sharedState=n.sharedState,n.removeAbortListener();let o=()=>{n.cancellationMode==="cooperative"?i.cancel(n.signal?.reason,n.cancellationTimeout):i.abort(n.signal?.reason)};n.signal?.addEventListener("abort",o,{once:!0}),n.signal?.aborted&&o(),this.activeJobs.add(i),this.startingJobs--,t.ref(),t.onMessage=a=>{try{i.isRunning&&n.onMessage(i,a.type,a.payload)}catch(c){i.abort(c)}},t.onError=a=>{try{n.onError(i,a)}catch(c){i.abort(c)}},i.result.catch(()=>{}),n.onStart(i),this._startQueuedJob();try{await i.completion}catch{}finally{n.signal?.removeEventListener("abort",o),this.activeJobs.delete(i),this.inFlightBytes-=n.inputBytes;let a=i.isCancelled?"cancelled":i.failed?"failed":"completed";this.totals[a]++;let c={name:i.name,outcome:a,queueWaitMs:s-n.queuedAt,durationMs:performance.now()-s,workerCreationMs:t.creationTimeMs,workerStartupMs:t.startupTimeMs,postMessageMs:i.postMessageMs,executionMs:i.executionMs,inputBytes:n.inputBytes};try{this.props.onMetrics?.(c),this.props.performanceMarks&&typeof performance.measure=="function"&&performance.measure(`math.gl.worker:${i.name}`,{start:n.queuedAt,end:performance.now(),detail:c})}catch{}this._admit(),this.returnWorkerToQueue(t)}}else this.returnWorkerToQueue(t)}returnWorkerToQueue(e){e.terminated||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.terminated&&!this.isDestroyed&&this.totals.workerRestarts++,e.terminated||e.destroy(),e.destroy().then(()=>this.workers.delete(e)),this.count--):(e.unref(),this.idleQueue.push(e)),this.isDestroyed||this._startQueuedJob(),this._checkDrained()}_getAvailableWorker(){for(;this.idleQueue.length>0;){let e=this.idleQueue.shift();if(e&&(e.terminated||this.count>this._getMaxConcurrency()))e.terminated&&this.totals.workerRestarts++,e.destroy().then(()=>this.workers.delete(e)),this.count--;else if(e)return e}if(this.count<this._getMaxConcurrency()){this.count++;let e=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;try{let t=new Sr({name:e,source:this.source,url:this.url,workerType:this.workerType,getUrl:this.getUrl,loadWorker:this.loadWorker});return this.totals.workersCreated++,this.workers.add(t),t}catch(t){throw this.count--,t}}return null}_getMaxConcurrency(){return R_?this.maxMobileConcurrency:this.maxConcurrency}}});function OM(r){let{name:e,source:t,url:n,urlKey:s,loadWorker:i,workerType:o}=r,a=t?`source:${t}`:"",c=n||s?`url:${n||s}`:"",u=i?`loadWorker:${MM(i)}`:"";return[e,a,c,u,`type:${o||"classic"}`].filter(Boolean).join("|")}function MM(r){let e=j_.get(r);return e||(e=FM++,j_.set(r,e)),e}var V_,j_,FM,sa,G_=p(()=>{Om();Mc();V_={maxQueuedJobs:1/0,maxPendingAdmissions:128,priorityAgingMs:1e3,onMetrics:()=>{},performanceMarks:!1,maxQueuedBytes:1/0,maxInFlightBytes:1/0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},j_=new WeakMap,FM=1,sa=class r{static isSupported(){return Sr.isSupported()}static getWorkerFarm(e={}){return r._workerFarm=r._workerFarm||new r({}),r._workerFarm.setProps(e),r._workerFarm}constructor(e){this.workerPools=new Map,this.props={...V_},this.setProps(e),this.workerPools=new Map}destroy(e){let t=[...this.workerPools.values()];return this.workerPools.clear(),Promise.all(t.map(n=>n.destroy(e))).then(()=>{})}setProps(e){let t={};for(let n of Object.keys(V_))e[n]!==void 0&&(t[n]=e[n]);this.props={...this.props,...t};for(let n of this.workerPools.values())n.setProps(this._getWorkerPoolProps())}getWorkerPool(e){let{name:t,source:n,url:s,getUrl:i,loadWorker:o,workerType:a}=e,c=OM(e),u=this.workerPools.get(c);return u||(u=new Hs({name:t,source:n,url:s,getUrl:i,loadWorker:o,workerType:a}),u.setProps(this._getWorkerPoolProps()),this.workerPools.set(c,u)),u}_getWorkerPoolProps(){return{maxQueuedJobs:this.props.maxQueuedJobs,maxPendingAdmissions:this.props.maxPendingAdmissions,priorityAgingMs:this.props.priorityAgingMs,onMetrics:this.props.onMetrics,performanceMarks:this.props.performanceMarks,maxQueuedBytes:this.props.maxQueuedBytes,maxInFlightBytes:this.props.maxInFlightBytes,maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}});var Dc,z_=p(()=>{Dc=class{constructor(){this._values=[],this._settlers=[],this._closed=!1}[Symbol.asyncIterator](){return this}push(e){return this.enqueue(e)}enqueue(e){if(this._closed)throw new Error("Closed");if(this._settlers.length>0){if(this._values.length>0)throw new Error("Illegal internal state");let t=this._settlers.shift();e instanceof Error?t.reject(e):t.resolve({value:e})}else this._values.push(e)}close(){for(;this._settlers.length>0;)this._settlers.shift().resolve({done:!0});this._closed=!0}next(){if(this._values.length>0){let e=this._values.shift();return e instanceof Error?Promise.reject(e):Promise.resolve({done:!1,value:e})}if(this._closed){if(this._settlers.length>0)throw new Error("Illegal internal state");return Promise.resolve({done:!0,value:void 0})}return new Promise((e,t)=>{this._settlers.push({resolve:e,reject:t})})}}});function Mm(r){let e=r.version!==Sm?` (worker-utils@${Sm})`:"";return`${r.name}@${r.version}${e}`}function Dm(r,e={}){let t=zt?r.workerFile||`${r.id}-worker.js`:r.workerNode||`${r.id}-worker-node.js`,n=$_(r,e),s=e._workerType||e?.core?._workerType;if(!n&&s==="test")if(zt)n=`modules/${r.module}/dist/${t}`;else{let i=r.module==="tasks"&&r.workerNode?.startsWith("worker-utils/")?"worker-utils/workers":"workers",o=r.workerSourceNode||`${i}/${r.id}-worker-node.ts`;n=`modules/${r.module}/src/${o}`}return n||null}function $_(r,e={}){return(e[r.id]||{}).workerUrl||(r.id==="compression"?e.workerUrl:null)||null}function Rm(r,e={}){let t=Dm(r,e),n=typeof r.worker=="string"?r.worker:null,s=t||n||km(r,!0);return Qi(s),s}function km(r,e=!1){let t=zt?r.workerFile||`${r.id}-worker.js`:r.workerNode||`${r.id}-worker-node.js`,n=r.version;n==="latest"&&(n=lf);let s=n?`@${n}`:"",o=`https://unpkg.com/${r.packageName||`@loaders.gl/${r.module}`}${s}/dist/${t}`;return e&&DM(r,o),o}function DM(r,e){if(r.version!=="latest")return;let t=`${r.module}:${r.id}`;W_.has(t)||(W_.add(t),console.warn(`loaders.gl: ${r.name} loader worker version is "latest" because __VERSION__ was not injected. Fetching ${e} from CDN.`))}var W_,q_=p(()=>{ff();ta();M_();Im();W_=new Set});function K_(){let r=typeof globalThis.crossOriginIsolated=="boolean"?globalThis.crossOriginIsolated:void 0,e={workers:Sr.isSupported(),sharedMemory:!1,crossOriginIsolated:r};if(zt&&r!==!0)e.sharedMemoryUnavailableReason="cross-origin-isolation";else if(typeof SharedArrayBuffer>"u"||typeof Atomics>"u"||typeof structuredClone!="function")e.sharedMemoryUnavailableReason="unsupported";else try{let t=new SharedArrayBuffer(4),n=structuredClone(t);Atomics.store(new Int32Array(t),0,17),e.sharedMemory=Atomics.load(new Int32Array(n),0)===17,e.sharedMemory||(e.sharedMemoryUnavailableReason="blocked")}catch{e.sharedMemoryUnavailableReason="blocked"}return e}function RM(){if(!K_().sharedMemory)return null;let r=new Zi(new SharedArrayBuffer(16));return r.setProgress(0),r}function Nm(r){if(r.sharedState===void 0&&r.cancellationMode==="cooperative"){let e=RM();return e?{...r,sharedState:e.buffer}:r}if(r.sharedState){if(!K_().sharedMemory)throw new Error("Shared worker memory is unavailable");new Zi(r.sharedState).throwIfCancelled()}return r}var Zi,X_=p(()=>{Mc();ta();Zi=class{constructor(e){if(typeof SharedArrayBuffer>"u"||!(e instanceof SharedArrayBuffer)||e.byteLength!==16)throw new Error("Expected a 16-byte shared worker control buffer");this.buffer=e,this.values=new Int32Array(e)}get snapshot(){return{cancelled:Atomics.load(this.values,0)!==0,completed:Atomics.load(this.values,1),total:Atomics.load(this.values,2),revision:Atomics.load(this.values,3)}}cancel(){Atomics.store(this.values,0,1),Atomics.add(this.values,3,1),Atomics.notify(this.values,0)}throwIfCancelled(){if(Atomics.load(this.values,0)!==0){let e=new Error("Shared worker task was cancelled");throw e.name="AbortError",e}}setProgress(e,t=-1){if(!Number.isInteger(e)||e<0||e>2147483647||!Number.isInteger(t)||t<-1||t>2147483647)throw new RangeError("Shared progress requires nonnegative int32 counts (or total -1)");Atomics.store(this.values,1,e),Atomics.store(this.values,2,t),Atomics.add(this.values,3,1)}}});function hf(r){let e=new Set,t=0;function n(s){if(!(!s||typeof s!="object"||e.has(s)))if(e.add(s),ArrayBuffer.isView(s))n(s.buffer);else if(s instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&s instanceof SharedArrayBuffer)t+=s.byteLength;else if(s instanceof Map)for(let[i,o]of s)n(i),n(o);else if(s instanceof Set)for(let i of s)n(i);else for(let i of Object.keys(s))n(s[i])}return n(r),t}var H_=p(()=>{});function Cm(r){if(r!==void 0&&r!=="copy"&&r!=="transfer")throw new Error("Invalid worker output ownership")}var J_=p(()=>{});async function Pm(r,e,t={},n={},s={}){if(Cm(t.outputOwnership),t.inputOwnership!==void 0&&!["copy","transfer","share"].includes(t.inputOwnership))throw new Error("Invalid worker input ownership");t=Nm(t),Y_(t.signal),Um(t,[e,Rc(t),s]);let i=Mm(r),o=t.workerPool??sa.getWorkerFarm(t).getWorkerPool(eA(r,t,i)),a=t.jobName||r.name,c=await o.startJob(a,tA.bind(null,n,t),void 0,t.signal,{inputBytes:hf([e,nA(t),s]),priority:t.priority,admission:t.admission,sharedState:t.sharedState?new Zi(t.sharedState):void 0,cancellationMode:t.cancellationMode,cancellationTimeout:t.cancellationTimeout});try{t.signal?.aborted&&!c.isCancelled&&c.abort(Q_(t.signal));let u=Rc(t),l=na(u),f=na(s);return c.isRunning&&c.postMessage("process",{input:e,options:l,context:f},t.inputOwnership==="copy"||t.inputOwnership==="share"?[]:void 0),(await c.result).result}catch(u){throw c.isCancelled||c.abort(u),u}}function Vm(r,e,t={},n={},s={}){if(Cm(t.outputOwnership),t.inputOwnership!==void 0&&!["copy","transfer","share"].includes(t.inputOwnership))throw new Error("Invalid worker input ownership");return kM(r,e,t,n,s)}async function*kM(r,e,t,n,s){t=Nm(t),Y_(t.signal);let i=Mm(r),o=t.workerPool??sa.getWorkerFarm(t).getWorkerPool(eA(r,t,i));Um(t,[Rc(t),s]);let a=hf([nA(t),s]),c=t.inputBytes??a;if(o.requiresInputBytes&&t.inputBytes===void 0)throw new Error("Byte-bounded batch sessions require inputBytes");if(!Number.isSafeInteger(c)||c<a)throw new RangeError("Batch inputBytes must cover options and context buffers");let u=new Dc,l=NM(e),f=!1,d=!1,h=!1,m=Promise.resolve(),b=new Error("Worker batch job failed"),g=()=>{!d&&!h&&(h=!0,CM(l))},y=()=>{f||(f=!0,u.close())},x=_=>{f||(f=!0,u.enqueue(b),u.close())},T=await o.startJob(t.jobName||r.name,(_,v,I)=>{if(!(_.isCancelled&&v!=="done"&&v!=="error"))switch(v){case"progress":rA(_,t,I);break;case"input-request":m=m.then(async()=>{if(!_.isRunning)return;let N=await l.next();if(_.isRunning)if(N.done)d=!0,_.postMessage("input-done",{});else{if(Um(t,N.value),t.inputBytes!==void 0&&hf(N.value)+a>c)throw new RangeError("Worker batch exceeds reserved inputBytes");_.postMessage("input-batch",{input:N.value},t.inputOwnership==="copy"||t.inputOwnership==="share"?[]:void 0)}}).catch(N=>{_.isCancelled||_.abort(N)});break;case"output-batch":u.push(I.result);break;case"done":_.done(I),y();break;case"error":{let N=new Error(I.error||"Worker batch processing failed");N.name=I.errorName||"Error",_.error(N),x(N);break}case"process":tA(n,t,_,v,I);break;default:{let N=new Error(`Unexpected worker batch message: ${v}`);_.error(N),x(N);break}}},void 0,t.signal,{inputBytes:c,priority:t.priority,admission:t.admission,sharedState:t.sharedState?new Zi(t.sharedState):void 0,cancellationMode:t.cancellationMode,cancellationTimeout:t.cancellationTimeout}).catch(_=>{throw g(),_});T.result.catch(_=>{x(_),g()});try{let _=Rc(t);T.isRunning&&T.postMessage("process-in-batches",{options:na(_),context:na(s)},t.inputOwnership==="copy"||t.inputOwnership==="share"?[]:void 0);try{for await(let v of u)yield v,T.isRunning&&T.postMessage("output-ack",{})}catch(v){throw v===b&&await T.result,v}await T.result}finally{T.isRunning&&!T.isCancelled&&T.abort(Z_("Worker batch iterator was closed")),g()}}function Y_(r){if(r?.aborted)throw Q_(r)}function Q_(r){return r?r.reason:Z_("Worker job was aborted")}function Z_(r){let e=new Error(r);return e.name="AbortError",e}function NM(r){return Symbol.asyncIterator in r?r[Symbol.asyncIterator]():(async function*(){yield*r})()}function CM(r){try{Promise.resolve(r.return?.()).catch(()=>{})}catch{}}function eA(r,e,t){if(e.source)return{name:t,source:e.source,workerType:e.workerType};let n=Dm(r,e);return n?{name:t,url:n,workerType:e.workerType}:zt&&r.loadWorker?{name:t,workerType:e.workerType,loadWorker:r.loadWorker,getUrl:()=>Rm(r,e),urlKey:km(r)}:{name:t,url:Rm(r,e),workerType:e.workerType}}async function tA(r,e,t,n,s){if(!(t.isCancelled&&n!=="done"&&n!=="error"))switch(n){case"progress":rA(t,e,s);break;case"done":t.done(s);break;case"error":let i=new Error(s.error);i.name=s.errorName||"Error",t.error(i);break;case"process":let{id:o,input:a,options:c}=s;try{if(!r.process){t.postMessage("error",{id:o,error:"Worker not set up to process on main thread"});return}let u=await r.process(a,{...c,signal:e.signal,onProgress:e.onProgress},void 0,s.context||{});t.postMessage("done",{id:o,result:u})}catch(u){let l=u instanceof Error?u.message:"unknown error";t.postMessage("error",{id:o,error:l})}break;default:console.warn(`process-on-worker: unknown message ${n}`)}}function rA(r,e,t){if(!(!r.isRunning||r.isCancelled||!t.progress))try{e.onProgress?.(t.progress)}catch(n){r.abort(n)}}function Rc(r){let{signal:e,onProgress:t,onMetrics:n,workerPool:s,admission:i,workerType:o,...a}=r;return a}function Um(r,e){if(r.inputOwnership==="share"&&yt(e).length)throw new Error("Share ownership requires SharedArrayBuffer storage; ordinary transferables are not allowed")}function nA(r){let{sharedState:e,...t}=Rc(r);return t}var sA=p(()=>{z_();G_();q_();df();X_();ta();H_();J_()});var UM,jm,FK,pf=p(()=>{Om();sA();df();UM={},jm=typeof __filename=="string"?__filename.replace(/\\/g,"/"):"",FK=jm?`file://${jm.startsWith("/")?"":"/"}${encodeURI(jm).replace(/#/g,"%23").replace(/\?/g,"%3F")}`:UM.url});function oA(r,e){if(!r.preload)return Promise.resolve();let t=Gm.get(r);return t||(t=Promise.resolve().then(()=>r.preload()).then(()=>{iA.add(r)}),Gm.set(r,t),t.catch(()=>Gm.delete(r))),PM(t,e)}function aA(r){return!r.preload||iA.has(r)}function PM(r,e){return e?new Promise((t,n)=>{let s=()=>{e.removeEventListener("abort",s),n(e.reason)};e.addEventListener("abort",s,{once:!0}),e.aborted&&s(),r.then(i=>{e.removeEventListener("abort",s),t(i)},i=>{e.removeEventListener("abort",s),n(i)})}):r}var Gm,iA,zm=p(()=>{Gm=new WeakMap,iA=new WeakSet});var kc,mf,Wm=p(()=>{kc=class extends Error{},mf=class{constructor(e){this.options=e,this.nextId=1,this.pending=new Map,this.incoming=new Map}request(e,t,n,s=[]){if(this.failure)return Promise.reject(this.failure.reason);if(n?.aborted)return Promise.reject(n.reason);let i=this.nextId++;return new Promise((o,a)=>{let c=()=>{let u=this.pending.get(i);u&&(this.pending.delete(i),u.cleanup(),a(n?.reason),this.send({source:"math.gl/tasks",kind:"cancel",id:i}))};this.pending.set(i,{resolve:o,reject:a,cleanup:()=>n?.removeEventListener("abort",c)}),n?.addEventListener("abort",c,{once:!0}),this.send({source:"math.gl/tasks",kind:"request",id:i,operation:e,value:t},s)})}emit(e,t,n=[]){if(this.failure)throw this.failure.reason;this.send({source:"math.gl/tasks",kind:"event",id:0,operation:e,value:t},n)}receive(e){if(!(this.failure||e?.source!=="math.gl/tasks")){if(e.kind==="failure"){let t=new Error(e.error?.message??"Task channel failed");this.close(t),this.options.onFailure?.(t)}else if(e.kind==="result"||e.kind==="error"){let t=this.pending.get(e.id);if(!t)return;if(this.pending.delete(e.id),t.cleanup(),e.kind==="result")t.resolve(e.value);else{let n=new kc(e.error?.message??"Task request failed");n.name=e.error?.name??"Error",t.reject(n)}}else if(e.kind==="cancel")this.incoming.get(e.id)?.abort(new DOMException("Task request cancelled","AbortError"));else if(e.kind==="event")try{this.options.handleEvent?.(e.operation,e.value)}catch(t){this.fail(t)}else if(e.kind==="request"){if(this.incoming.has(e.id)){this.fail(new Error("Duplicate task request identifier"));return}let t=new AbortController;this.incoming.set(e.id,t),Promise.resolve().then(()=>(t.signal.throwIfAborted(),this.options.handleRequest(e.operation,e.value,t.signal))).then(n=>{!t.signal.aborted&&!this.failure&&this.send({source:"math.gl/tasks",kind:"result",id:e.id,value:n},this.options.getResultTransferList?.(n,e.value))}).catch(n=>{!t.signal.aborted&&!this.failure&&this.send({source:"math.gl/tasks",kind:"error",id:e.id,error:{name:n instanceof Error?n.name:"Error",message:n instanceof Error?n.message:String(n)}})}).finally(()=>this.incoming.delete(e.id))}}}close(e=new Error("Task channel closed")){if(!this.failure){this.failure={reason:e};for(let t of this.pending.values())t.cleanup(),t.reject(e);this.pending.clear();for(let t of this.incoming.values())t.abort(e);this.incoming.clear()}}send(e,t=[]){if(!this.failure)try{this.options.send(e,t)}catch(n){this.fail(n)}}fail(e){if(!this.failure){this.close(e);try{this.options.send({source:"math.gl/tasks",kind:"failure",id:0,error:{name:e instanceof Error?e.name:"Error",message:e instanceof Error?e.message:String(e)}},[])}catch{}this.options.onFailure?.(e)}}}});function dn(r){if(!r||typeof r!="object"||Object.getPrototypeOf(r)!==Object.prototype)throw new TypeError("Task payloads must be plain objects with named fields")}function wt(r,e="copy"){if(dn(r),!["copy","transfer","share"].includes(e))throw new TypeError("Invalid input ownership");let t=yt(r);if(e==="share"&&t.length)throw new TypeError("Share requires shared storage");return structuredClone(r,{transfer:e==="transfer"?t:[]})}function Nc(r,e={}){let t=e.signal??new AbortController().signal;return{state:r,signal:t,requestHost:async(n,s,i)=>{if(t.throwIfAborted(),!e.requestHost)throw new Error("No host request handler configured");return e.requestHost(n,s,i)},emitHost:(n,s)=>{t.throwIfAborted(),e.emitHost?.(n,s)},throwIfAborted:()=>{t.throwIfAborted(),e.throwIfAborted?.()},reportProgress:n=>e.reportProgress?.({...n,phase:n.phase??"process",unit:n.unit??"items"})}}function gf(r){return{signal:r.signal,reportProgress:e=>r.onProgress?.(e)}}var bf,$m=p(()=>{pf();zm();bf=class{constructor(e){this.task=e,this.initialized=!1}async initialize(e,t={}){if(this.initialized)throw new Error("Task is already initialized");return dn(e),await oA(this.task,t.signal),t.signal?.throwIfAborted(),this.state=await this.task.initialize?.(e,Nc(void 0,t)),this.initialized=!0,{}}async destroy(){if(this.initialized){this.initialized=!1;let e=this.state;this.state=void 0,this.task.initialize&&await this.task.destroy?.(e)}return{}}async process(e,t,n={}){if(!this.initialized)throw new Error("Task is not initialized");if(!this.task.process)throw new Error("Task has no atomic processor");dn(e);let s=await this.task.process(e,t,Nc(this.state,n));return dn(s),s}async*stream(e,t,n={}){if(!this.initialized)throw new Error("Task is not initialized");if(!this.task.processInBatches)throw new Error("Task has no streaming processor");for await(let s of this.task.processInBatches(e,t,Nc(this.state,n)))dn(s),yield s}}});function cA(r,e,t={}){if(!aA(r))throw new Error("Preload task on the main thread before runTaskSync");if("execution"in t)throw new TypeError("runTaskSync always runs on the calling thread");if(!r.process)throw new TypeError("Task has no atomic processor");for(let f of[r.initialize,r.process,r.destroy])if(f&&Object.prototype.toString.call(f)==="[object AsyncFunction]")throw new TypeError("runTaskSync requires synchronous lifecycle hooks");if(t.outputOwnership&&!["copy","transfer"].includes(t.outputOwnership))throw new TypeError("Invalid output ownership");let n=Nc(void 0,gf(t));n.throwIfAborted();let s=t.options??{};if(t.inputOwnership==="transfer"){let f=new Set(yt(s));if(yt(e).some(d=>f.has(d)))throw new Error("Transferred input aliases reusable options; use inputOwnership: copy")}let i=wt(s),o=wt(t.initialization??{},t.initializationOwnership),a=!1,c,u=!1,l;try{let f=r.initialize?.(o,n);if(qm(f))throw Promise.resolve(f).then(m=>r.destroy?.(m)).catch(()=>{}),new TypeError("runTaskSync initialize returned a promise");n.state=f,a=!0,n.throwIfAborted();let d=wt(e,t.inputOwnership),h=r.process(d,i,n);if(qm(h))throw a=!1,Promise.resolve(h).catch(()=>{}).then(()=>{if(r.initialize)return r.destroy?.(n.state)}).catch(()=>{}),new TypeError("runTaskSync process returned a promise");dn(h),n.throwIfAborted(),l=wt(h,t.outputOwnership??"transfer")}catch(f){u=!0,c=f}finally{if(a&&r.initialize)try{let f=r.destroy?.(n.state);if(qm(f))throw Promise.resolve(f).catch(()=>{}),new TypeError("runTaskSync destroy returned a promise")}catch(f){throw u?new AggregateError([c,f],"Task processing and destruction failed"):f}}if(u)throw c;return l}function qm(r){return!!(r&&(typeof r=="object"||typeof r=="function")&&typeof r.then=="function")}var uA=p(()=>{zm();pf();$m()});var yf,lA=p(()=>{yf=class{constructor(e){if(this.maxConcurrency=e,this.pending=[],this.active=0,this.exclusive=!1,this.closed=!1,this.idleWaiters=new Set,!Number.isSafeInteger(e)||e<1)throw new RangeError("maxConcurrency must be a positive safe integer")}run(e,t,n){return this.closed?Promise.reject(new Error("Task operation queue is closed")):e!=="parallel"&&e!=="exclusive"?Promise.reject(new TypeError("Invalid operation mode")):n?.aborted?Promise.reject(n.reason):new Promise((s,i)=>{let o=()=>{let c=this.pending.indexOf(a);c>=0&&(this.pending.splice(c,1),a.cancel(n?.reason),this.pump())},a={mode:e,cancel:c=>{n?.removeEventListener("abort",o),i(c)},start:()=>{n?.removeEventListener("abort",o),this.active++,e==="exclusive"&&(this.exclusive=!0),Promise.resolve().then(()=>(n?.throwIfAborted(),t())).then(s,i).finally(()=>{this.active--,e==="exclusive"&&(this.exclusive=!1),this.pump()})}};this.pending.push(a),n?.addEventListener("abort",o,{once:!0}),n?.aborted?o():this.pump()})}cancelPending(e){this.closed=!0;for(let t of this.pending.splice(0))t.cancel(e);this.pump()}close(){return this.closed=!0,this.whenIdle()}whenIdle(){return!this.active&&!this.pending.length?Promise.resolve():new Promise(e=>this.idleWaiters.add(e))}pump(){for(;!this.exclusive&&this.pending.length&&this.active<this.maxConcurrency;){let e=this.pending[0];if(e.mode==="exclusive"&&this.active||(this.pending.shift(),e.start(),e.mode==="exclusive"))break}if(!this.active&&!this.pending.length){for(let e of this.idleWaiters)e();this.idleWaiters.clear()}}}});var wf,fA=p(()=>{Mc();Wm();wf=class{constructor(e,t,n){this.thread=new Sr({name:e,url:t.url?.toString(),loadWorker:t.create,workerType:"module"}),this.channel=new mf({...n,send:(s,i)=>this.thread.postMessage({source:"loaders.gl/tasks",type:"task-channel",payload:s},i)}),this.thread.onMessage=s=>{s?.type==="task-channel"&&this.channel.receive(s.payload)},this.thread.onError=s=>{this.channel.close(s),n.onFailure?.(s)}}async destroy(e){this.channel.close(e),await this.thread.destroy()}}});async function VM(r,e){let t;try{t=await e()}catch(n){try{await r.close()}catch(s){throw new AggregateError([n,s],"Task processing and destruction failed")}throw n}return await r.close(),t}async function*Xm(r,e){let t=Symbol.asyncIterator in r?r[Symbol.asyncIterator]():r[Symbol.iterator](),n=!1,s=!1;try{for(;;){let i=await new Promise((o,a)=>{let c=()=>e?.removeEventListener("abort",u),u=()=>{c(),a(e?.reason)};if(e?.addEventListener("abort",u,{once:!0}),e?.aborted){u();return}try{s=!0,Promise.resolve(t.next()).then(l=>{s=!1,c(),o(l)},l=>{s=!1,c(),a(l)})}catch(l){s=!1,c(),a(l)}});if(i.done){n=!0;return}yield i.value}}finally{if(!n)if(s)try{Promise.resolve(t.return?.()).catch(()=>{})}catch{}else await t.return?.()}}function dA(r,e,t){if(t==="transfer"){let n=new Set(yt(e));if(yt(r).some(s=>n.has(s)))throw new Error("Transferred input aliases reusable options; use inputOwnership: copy")}}var Km,Cc,hA=p(()=>{pf();$m();uA();lA();fA();Wm();Km=class{constructor(e,t,n){this.task=e,this.release=t,this.initializationControls=n,this.nextProgressId=1,this.progressCallbacks=new Map,this.callbackFailures=new Map,this.closed=!1,this.finalized=!1,this.streams=new Set,this.invalid=!1,this.controller=new AbortController;let s=n;this.runtime=new bf(e);let i=s.operationConcurrency??1,o=e.concurrency?.maxConcurrency??1;if(!Number.isSafeInteger(o)||o<1||!Number.isSafeInteger(i)||i<1||i>o)throw new RangeError("Task concurrency must be between 1 and the task maximum");this.operationQueue=new yf(i),this.concurrent=i>1;let a=s.execution??"auto";if(!["auto","main-thread","worker"].includes(a))throw new TypeError("Invalid execution mode");if(a==="worker"&&!e.worker)throw new Error("Task has no worker");if(a!=="main-thread"&&e.worker){let c=e.worker;if(!!c.url==!!c.create)throw new Error("Supply exactly one worker URL or factory");if(this.concurrent||s.onRequest||s.onEvent){this.workerChannel=new wf(e.id,c,{handleRequest:async(u,l,f)=>{if(u==="task:next-input"){if(!this.channelInputs)throw new Error("No active task stream");return this.channelInputs.next()}if(!s.onRequest)throw new Error("No host request handler configured");let d=l;if(u!=="task:host-request")throw new Error("Unknown host request");return s.onRequest(d.operation,d.payload,f)},getResultTransferList:(u,l)=>l.outputOwnership==="transfer"?yt(u):[],handleEvent:(u,l)=>{let{id:f}=l;try{if(u==="task:progress"){let d=l;(this.progressCallbacks.get(d.id)??this.streamProgress)?.(d.progress)}else if(u==="task:host-event"){let d=l;s.onEvent?.(d.operation,d.payload)}}catch(d){(this.progressCallbacks.has(f)||this.streamProgressId===f)&&(this.callbackFailures.has(f)||this.callbackFailures.set(f,{reason:d}))}},onFailure:u=>{this.invalid=!0,this.operationQueue.cancelPending(u),this.controller.abort(u)}});return}this.pool=new Hs({name:e.id,url:c.url?.toString(),loadWorker:c.create,workerType:"module",maxConcurrency:1,maxMobileConcurrency:1}),this.descriptor={id:e.id,name:e.id,module:"tasks",version:"prototype",options:{},worker:c.url?.toString()??!0,loadWorker:c.create,workerInBatches:c.capabilities.streaming}}}async initialize(e,t){try{dn(e),await this.enqueue(()=>this.invoke("initialize",e,{},t))}catch(n){throw await this.terminate(n),n}}runTask(e,...t){if(this.invalid)return Promise.reject(new Error("Initialized task is invalid; initialize a new instance"));if(this.closed)return Promise.reject(new Error("Initialized task is closed"));let n=t[0]?.timeout;if(n!==void 0&&(!Number.isSafeInteger(n)||n<0||n>4294967295))return Promise.reject(new RangeError("Invalid task timeout"));let s=n===void 0?void 0:AbortSignal.timeout(n),i=s&&t[0]?.signal?AbortSignal.any([s,t[0].signal]):s??t[0]?.signal,o={...t[0],signal:i},a=this.task.concurrency?.getSchedulingMode?.(e)??"exclusive";return this.operationQueue.run(a,async()=>{i?.throwIfAborted(),this.checkCapability("atomic");let c=()=>{this.concurrent&&(this.invalid=!0,this.operationQueue.cancelPending(i?.reason),this.controller.abort(i?.reason))};i?.addEventListener("abort",c,{once:!0});try{return await this.invoke("process",e,t[0]?.options??{},o)}finally{i?.removeEventListener("abort",c)}},i)}runTasks(e,...t){return this.serialStream(async function*(n){n.checkCapability("atomic");for await(let s of Xm(e,n.controls(t[0]).signal))yield await n.invoke("process",s,t[0]?.options??{},t[0])},t[0]?.signal)}runTaskInBatches(e,...t){return this.serialStream(async function*(n){n.checkCapability("streaming");let s=n.controls(t[0]),i=wt(t[0]?.options??{});async function*o(){for await(let c of Xm(e,s.signal))s.signal?.throwIfAborted(),dA(c,t[0]?.options??{},s.inputOwnership),yield wt(c,s.inputOwnership)}let a=!1;try{if(n.workerChannel){n.channelInputs=o()[Symbol.asyncIterator](),n.streamProgress=s.onProgress;try{for(await n.invoke("stream-open",{},i,s);;){let c=await n.invoke("stream-next",{},{},s);if(c.done)break;yield c.value}}finally{try{n.invalid||await n.invoke("stream-close",{},{},s)}finally{await n.channelInputs.return?.(),n.channelInputs=void 0,n.streamProgress=void 0,n.streamProgressId!==void 0&&n.callbackFailures.delete(n.streamProgressId),n.streamProgressId=void 0}}}else if(n.pool)await n.invoke("stream-options",{},i,s),yield*Vm(n.descriptor,o(),{...n.workerOptions(s),inputOwnership:"transfer",workerInBatches:!0});else for await(let c of n.runtime.stream(o(),i,n.runtimeContext(s)))s.signal?.throwIfAborted(),yield wt(c,s.outputOwnership??"transfer");a=!0}catch(c){throw n.workerChannel&&(n.invalid=!0,n.operationQueue.cancelPending(c),n.controller.abort(c),await n.workerChannel.destroy(c)),n.pool&&(n.invalid=!0,await n.pool.destroy(c)),c}finally{if(n.pool&&!a&&(n.invalid=!0),n.workerChannel&&!a&&!n.invalid){let c=new Error("Worker stream ended before completion");n.invalid=!0,n.operationQueue.cancelPending(c),n.controller.abort(c),await n.workerChannel.destroy(c)}}},t[0]?.signal)}get state(){return this.invalid?"invalid":this.finalized?"closed":this.closed?"closing":"ready"}close(){return this.closing||(this.closed=!0,this.closing=(async()=>{try{await this.operationQueue.close(),this.invalid?!this.pool&&!this.workerChannel&&await this.runtime.destroy():await this.invoke("destroy",{},{})}finally{try{await this.pool?.destroy(),await this.workerChannel?.destroy()}finally{this.finalized=!0,this.release()}}})()),this.closing}async terminate(e=new Error("Task terminated")){this.operationQueue.cancelPending(e),this.controller.abort(e),this.workerChannel&&(this.invalid=!0,await this.workerChannel.destroy(e)),this.pool&&(this.invalid=!0,await this.pool.destroy(e)),await Promise.allSettled([...this.streams].map(t=>t())),await this.close()}checkCapability(e){if(this.pool||this.workerChannel?!this.task.worker?.capabilities[e]:!(e==="atomic"?this.task.process:this.task.processInBatches))throw new Error(`Task has no ${e} processor for this execution route`)}controls(e={}){if(e.outputOwnership&&!["copy","transfer"].includes(e.outputOwnership))throw new TypeError("Invalid output ownership");return{...e,signal:e.signal?AbortSignal.any([e.signal,this.controller.signal]):this.controller.signal}}workerOptions(e){return{workerPool:this.pool,workerType:"module",inputOwnership:e.inputOwnership??"copy",outputOwnership:e.outputOwnership??"transfer",signal:e.signal,onProgress:e.onProgress,cancellationMode:"terminate"}}async invoke(e,t,n,s={}){if(this.invalid)throw new Error("Initialized task is invalid; initialize a new instance");let i=e==="destroy"?{}:this.controls(s);i.signal?.throwIfAborted(),dn(t),dA(t,n,i.inputOwnership);let o=wt(n);if(this.workerChannel){let l=this.nextProgressId++,f={input:wt(t,i.inputOwnership),options:o,outputOwnership:i.outputOwnership??"transfer",progressId:l};e==="stream-open"&&(this.streamProgressId=l),this.progressCallbacks.set(l,i.onProgress);let d;try{let h=await this.workerChannel.channel.request(e,f,i.signal,yt(f));if(d=this.callbackFailures.get(l)??(e.startsWith("stream-")&&this.streamProgressId!==void 0?this.callbackFailures.get(this.streamProgressId):void 0),d)throw d.reason;return h}catch(h){throw e==="process"&&!i.signal?.aborted&&(h instanceof kc||d)||(this.invalid=!0,this.operationQueue.cancelPending(h),this.controller.abort(h),await this.workerChannel.destroy(h)),h}finally{this.progressCallbacks.delete(l),this.streamProgressId!==l&&this.callbackFailures.delete(l)}}if(this.pool)try{return await Pm(this.descriptor,{operation:e,input:wt(t,i.inputOwnership),options:o},this.workerOptions({...i,inputOwnership:"transfer"}))}catch(l){throw this.invalid=!0,await this.pool.destroy(l),l}if(e==="destroy")return this.runtime.destroy();let a=wt(t,i.inputOwnership),c=this.runtimeContext(i);if(e==="initialize"){let l=await this.runtime.initialize(a,c);return i.signal?.throwIfAborted(),l}let u=await this.runtime.process(a,o,c);return i.signal?.throwIfAborted(),wt(u,i.outputOwnership??"transfer")}runtimeContext(e){return{...gf(e),requestHost:async(t,n,s={})=>{let i=e.signal??this.controller.signal;i.throwIfAborted();let o=this.initializationControls.onRequest;if(!o)throw new Error("No host request handler configured");let a=await o(t,wt(n,s.inputOwnership),i);return i.throwIfAborted(),structuredClone(a,{transfer:s.outputOwnership==="transfer"?yt(a):[]})},emitHost:(t,n)=>this.initializationControls.onEvent?.(t,structuredClone(n))}}enqueue(e){return this.closed?Promise.reject(new Error("Initialized task is closed")):this.operationQueue.run("exclusive",e)}serialStream(e,t){let n=new AbortController,s=AbortSignal.any([n.signal,this.controller.signal,t].filter(c=>!!c)),i=!1,o=this.acquireStream(e,s,()=>{i=!0}),a=()=>{i||n.abort(new Error("Stream returned before execution"))};return{[Symbol.asyncIterator](){return this},next:()=>o.next(),return:async()=>(a(),o.return(void 0)),throw:async c=>(a(),o.throw(c))}}async*acquireStream(e,t,n){if(this.closed)throw new Error("Initialized task is closed");let s,i=new Promise(d=>{s=d}),o,a=new Promise(d=>{o=d}),c=this.operationQueue.run("exclusive",async()=>{s(),await a},t);if(await Promise.race([i,c]),t.aborted)throw o(),t.reason;n();let u=e(this)[Symbol.asyncIterator](),l,f=()=>(l??(l=(async()=>{try{await u.return?.()}finally{this.streams.delete(f),o()}})()),l);this.streams.add(f);try{for(;;){this.controller.signal.throwIfAborted();let d=await u.next();if(d.done)return;yield d.value}}finally{await f()}}},Cc=class{constructor(e={}){if(this.active=new Set,this.count=0,this.waiters=[],this.closed=!1,this.initializing=new Set,this.iterations=new Set,this.maxConcurrency=e.maxConcurrency??1,!Number.isSafeInteger(this.maxConcurrency)||this.maxConcurrency<1)throw new RangeError("maxConcurrency must be a positive safe integer")}runTaskSync(e,t,...n){if(this.closed)throw new Error("Task runner is closed");if(this.count>=this.maxConcurrency)throw new Error("Task runner has no synchronous capacity");this.count++;try{return cA(e,t,n[0])}finally{let s=this.waiters.shift();s?s.resolve():this.count--}}initializeTask(e,t,n={}){let s=this.open(e,t,n);return this.initializing.add(s),s.then(()=>this.initializing.delete(s),()=>this.initializing.delete(s)),s}async runTask(e,t,...n){let s=n[0]??{},i=await this.initializeTask(e,s.initialization??{},{...s,inputOwnership:s.initializationOwnership??"copy"});return VM(i,()=>i.runTask(t,s))}async*runTasks(e,t,...n){let s=n[0]??{};if(this.closed)throw new Error("Task runner is closed");if(s.initializationOwnership==="transfer")throw new TypeError("runTasks initialization is a reusable template; use copy or share");let i=s.concurrency??1;if(!Number.isSafeInteger(i)||i<1||i>this.maxConcurrency)throw new RangeError("concurrency must be between 1 and maxConcurrency");let o=[],a=new Set,c=[],u=new AbortController;this.iterations.add(u);let l=s.signal?AbortSignal.any([s.signal,u.signal]):u.signal,f=Xm(t,l)[Symbol.asyncIterator](),d=!1,h;try{for(;!d||c.length;){l.throwIfAborted(),!d&&!h&&c.length<i&&(h=f.next().then(y=>({kind:"input",next:y})));let m=await Promise.race([...c.length?[c[0]]:[],...h?[h]:[]]);if(m.kind==="result"){if(c.shift(),a.delete(m.handle),m.failed)throw m.error;yield m.value;continue}if(h=void 0,m.next.done){d=!0;continue}let b=o.find(y=>!a.has(y));if(!b&&(o.length===0||this.count<this.maxConcurrency)&&(b=await this.initializeTask(e,wt(s.initialization??{},s.initializationOwnership),{...s,signal:l,inputOwnership:s.initializationOwnership??"copy"}),o.push(b)),!b){let y=await c.shift();if(a.delete(y.handle),y.failed)throw y.error;yield y.value,b=y.handle}a.add(b);let g=b;c.push(b.runTask(m.next.value,{...s,signal:l}).then(y=>({kind:"result",handle:g,value:y}),y=>({kind:"result",handle:g,failed:!0,error:y})))}}finally{this.iterations.delete(u),u.abort(new Error("Task iteration closed"));try{h&&await h.catch(()=>{}),d||await f.return?.()}finally{await Promise.all(c),await Promise.all(o.map(m=>m.close()))}}}async*runTaskInBatches(e,t,...n){let s=n[0]??{},i=await this.initializeTask(e,s.initialization??{},{...s,inputOwnership:s.initializationOwnership??"copy"});try{yield*i.runTaskInBatches(t,s)}finally{await i.close()}}close(){if(!this.closing){this.closed=!0;for(let e of this.waiters.splice(0))e.reject(new Error("Task runner is closed"));this.closing=(async()=>{await Promise.allSettled(this.initializing);let t=(await Promise.allSettled([...this.active].map(n=>n.close()))).find(n=>n.status==="rejected");if(t?.status==="rejected")throw t.reason})()}return this.closing}async terminate(e=new Error("Task runner terminated")){for(let n of this.iterations)n.abort(e);let t=this.close();await Promise.allSettled([...this.active].map(n=>n.terminate(e))),await t}async open(e,t,n){if(this.closed)throw new Error("Task runner is closed");n.signal?.throwIfAborted(),this.count>=this.maxConcurrency?await new Promise((a,c)=>{let u={resolve:()=>{f(),a()},reject:d=>{f(),c(d)}},l=()=>{this.waiters=this.waiters.filter(d=>d!==u),u.reject(n.signal?.reason)},f=()=>n.signal?.removeEventListener("abort",l);this.waiters.push(u),n.signal?.addEventListener("abort",l,{once:!0}),n.signal?.aborted&&l()}):this.count++;let s,i=!1,o=()=>{if(i)return;i=!0,s&&this.active.delete(s);let a=this.waiters.shift();a?a.resolve():this.count--};try{if(this.closed)throw new Error("Task runner is closed");return s=new Km(e,o,n),this.active.add(s),await s.initialize(t,n),s}catch(a){throw o(),a}}}});var pA=p(()=>{hA()});var mA=p(()=>{pA()});function Hm(r,e={}){let t=Xe?r.workerFile||`${r.id}-worker.js`:r.workerNode||`${r.id}-worker-node.js`,n=Jm(r,e),s=e._workerType||e?.core?._workerType;if(!n&&s==="test")if(Xe)n=`modules/${r.module}/dist/${t}`;else{let i=r.module==="core"&&r.workerNode?.startsWith("worker-utils/")?"worker-utils/workers":"workers",o=r.workerSourceNode||`${i}/${r.id}-worker-node.ts`;n=`modules/${r.module}/src/${o}`}return n||null}function Jm(r,e={}){return(e[r.id]||{}).workerUrl||(r.id==="compression"?e.workerUrl:null)||null}function gA(r,e={}){let t=Hm(r,e),n=typeof r.worker=="string"?r.worker:null,s=t||n||jM(r,!0);return uf(s),s}function jM(r,e=!1){let t=Xe?r.workerFile||`${r.id}-worker.js`:r.workerNode||`${r.id}-worker-node.js`,n=r.version;n==="latest"&&(n=Am);let s=n?`@${n}`:"",i=`https://unpkg.com/@loaders.gl/${r.module}${s}/dist/${t}`;return e&&GM(r,i),i}function GM(r,e){if(r.version!=="latest")return;let t=`${r.module}:${r.id}`;bA.has(t)||(bA.add(t),console.warn(`loaders.gl: ${r.name} loader worker version is "latest" because __VERSION__ was not injected. Fetching ${e} from CDN.`))}var bA,yA=p(()=>{"use strict";vm();Fc();E_();bA=new Set});function wA(r){return{...r,phase:r.phase??"process",unit:r.unit??"items"}}var xA=p(()=>{"use strict"});function Ym(r,e=!0,t){let n=t||new Set;if(r){if(TA(r))n.add(r);else if(TA(r.buffer))n.add(r.buffer);else if(!ArrayBuffer.isView(r)){if(e&&typeof r=="object")for(let s in r)Ym(r[s],e,n)}}return t===void 0?Array.from(n):[]}function TA(r){return r?r instanceof ArrayBuffer||typeof MessagePort<"u"&&r instanceof MessagePort||typeof ImageBitmap<"u"&&r instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&r instanceof OffscreenCanvas:!1}function Qm(r){if(r===null)return{};let e=Object.assign({},r);return Object.keys(e).forEach(t=>{r[t]!==null&&typeof r[t]=="object"&&!ArrayBuffer.isView(r[t])&&!(r[t]instanceof Array)?e[t]=Qm(r[t]):typeof e[t]=="function"||e[t]instanceof RegExp?e[t]={}:e[t]=r[t]}),e}var _A=p(()=>{"use strict"});function Zm(r,e={}){return!!((Xe?typeof Worker<"u":!!e._nodeWorkers)&&e.worker&&(r.worker||r.loadWorker||Jm(r,e)))}async function*eb(r,e,t={},n={},s={}){let i=qM(e),o;try{o=await $M(r,t,n,s);for await(let a of o.handle.runTaskInBatches(i,{...SA(t),options:WM(t)}))yield a.value}finally{i.return?.()?.catch(()=>{}),await o?.close()}}function zM(r,e){if(e.source||e.core?.source)throw new Error("Inline legacy worker source is unsupported; use a TaskRunner worker URL or factory");let t=!Hm(r,e)&&Xe?r.loadWorker:void 0,n=gA(r,e);return{id:`${r.module}:${r.id}`,initialize:s=>s,worker:{...t?{create:()=>t()??KM(n)}:{url:n},capabilities:{atomic:!0,streaming:!0}}}}function SA(r){return{execution:"worker",signal:r.signal,inputOwnership:r.inputOwnership??"transfer",outputOwnership:r.outputOwnership??"transfer",onProgress:r.onProgress?e=>r.onProgress?.(wA(e)):void 0}}function WM(r){let{signal:e,onProgress:t,...n}=r;return Qm(n)}async function $M(r,e,t,n){e.signal?.throwIfAborted();let s=zM(r,e),i=AA.get(r);i||(i={runner:new Cc({maxConcurrency:O_?e.maxMobileConcurrency??1:e.maxConcurrency??3}),requests:0},AA.set(r,i));let o=i,a=t.process?new MessageChannel:void 0,c=new AbortController,u=!1,l=()=>c.abort(e.signal?.reason);e.signal?.addEventListener("abort",l,{once:!0});let f=()=>{u=!0,e.signal?.removeEventListener("abort",l),c.abort(),a?.port1.close(),a?.port2.close()};a&&(a.port1.onmessage=async({data:b})=>{try{let g=await t.process(b.input,b.options,{signal:c.signal,throwIfAborted:()=>c.signal.throwIfAborted()},b.context);!u&&!c.signal.aborted&&a.port1.postMessage({identifier:b.identifier,value:g},Ym(g))}catch(g){if(u||c.signal.aborted)return;a.port1.postMessage({identifier:b.identifier,error:{name:g instanceof Error?g.name:"Error",message:g instanceof Error?g.message:String(g)}})}},a.port1.start()),o.requests++,vA.add(o);let d=!1,h=()=>{d||(d=!0,o.requests--,o.requests||vA.delete(o))},m;try{m=await o.runner.initializeTask(s,{context:structuredClone(n),...a?{port:a.port2}:{}},{...SA(e),inputOwnership:"transfer"})}catch(b){throw h(),f(),b}return{handle:m,async close(){try{await m.close()}finally{f(),h()}}}}function qM(r){let e=Symbol.asyncIterator in r?r[Symbol.asyncIterator]():r[Symbol.iterator](),t=!1;return{[Symbol.asyncIterator](){return this},async next(){if(t)return{done:!0,value:void 0};let n=await e.next();return n.done||t?(t=!0,{done:!0,value:void 0}):{done:!1,value:{value:n.value}}},async return(){return t||(t=!0,await e.return?.()),{done:!0,value:void 0}}}}function KM(r){let e=new URL(r,globalThis.document?.baseURI??globalThis.location.href),t=e.href;if(/^https?:$/.test(e.protocol)&&e.origin!==globalThis.location.origin){let n=IA.get(e.href);n||(n=URL.createObjectURL(new Blob([`import ${JSON.stringify(e.href)};`],{type:"application/javascript"})),IA.set(e.href,n)),t=n}return new Worker(t,{type:"module"})}var AA,vA,IA,EA=p(()=>{"use strict";mA();yA();xA();_A();Fc();AA=new WeakMap,vA=new Set,IA=new Map});function hn(r={}){let e=r.useLocalLibraries??r.core?.useLocalLibraries,t=XM(r.CDN,r.core?.CDN),n=r.modules;return{...e!==void 0?{useLocalLibraries:e}:{},...t!==void 0?{CDN:t}:{},...n!==void 0?{modules:n}:{}}}function XM(r,e){if(typeof r=="string"||r===null)return r;if(typeof e=="string"||e===null)return e}async function ia(r,e=null,t={},n=null,s=null){let i=r;if(e){let a=n||r,c=t.modules?.[a];if(c!==void 0&&typeof c!="string")return c;r=rb(r,e,t,n),i=s&&(!(typeof c=="string")||typeof t.modules?.[s]=="string")?rb(s,e,t,s):r}let o=HM(r,i,Yi);return tb[o]=tb[o]||JM(r,i),await tb[o]}function HM(r,e,t){return t?JSON.stringify([r,e]):r}function rb(r,e,t={},n=null){if(t?.core)throw new Error("loadLibrary: options.core must be pre-normalized");n=n||r;let s=t.modules||{};if(typeof s[n]=="string")return s[n];if(!t.useLocalLibraries&&r.startsWith("http"))return r;if(!Xe)return`modules/${e}/dist/libs/${n}`;if(t.CDN){if(typeof t.CDN!="string")throw new Error("loadLibrary: options.CDN must be a string or null");return uf(t.CDN.startsWith("http")),`${t.CDN}/${e}@${L_}/dist/libs/${n}`}return Yi?n.endsWith(".mjs")?`./libs/${n}`:`../src/libs/${n}`:`modules/${e}/src/libs/${n}`}async function JM(r,e){if(r.endsWith("wasm"))return await ZM(r);if(!Xe){let{requireFromFile:n}=globalThis.loaders||{};try{let s=await n?.(r);return s||!r.includes("/dist/libs/")?s:await n?.(r.replace("/dist/libs/","/src/libs/"))}catch(s){if(r.includes("/dist/libs/"))try{return await n?.(r.replace("/dist/libs/","/src/libs/"))}catch{}return console.error(s),null}}if(Yi)return YM(r,e);let t=await e2(r);return QM(t,r)}async function YM(r,e=r){try{importScripts()}catch{let n=await import(new URL(e,globalThis.location.href).href);return n.default??n}return importScripts(r)}function QM(r,e){let t=document.createElement("script");t.id=e;try{t.appendChild(document.createTextNode(r))}catch{t.text=r}return document.body.appendChild(t),null}async function ZM(r){let{readFileAsArrayBuffer:e}=globalThis.loaders||{};if(Xe||!e||r.startsWith("http"))return await(await fetch(r)).arrayBuffer();try{return await e(r)}catch{if(r.includes("/dist/libs/"))return await e(r.replace("/dist/libs/","/src/libs/"));throw new Error(`Failed to load ArrayBuffer from ${r}`)}}async function e2(r){let{readFileAsText:e}=globalThis.loaders||{};if(Xe||!e||r.startsWith("http"))return await(await fetch(r)).text();try{return await e(r)}catch{if(r.includes("/dist/libs/"))return await e(r.replace("/dist/libs/","/src/libs/"));throw new Error(`Failed to load text from ${r}`)}}var tb,LA=p(()=>{"use strict";Fc();vm();B_();tb={}});var Js=p(()=>{"use strict";Fc();EA();LA()});function nb(r,e){let t=e?._nodeWorkers??e?.core?._nodeWorkers,n=e?.worker??e?.core?.worker;return!Gn&&!t?!1:Zm({...r,options:r.options||{}},{worker:!!n,_nodeWorkers:!!t})}var BA=p(()=>{"use strict";Js();wm()});function OA(r,e=5){return typeof r=="string"?r.slice(0,e):ArrayBuffer.isView(r)?FA(r.buffer,r.byteOffset,e):r instanceof ArrayBuffer?FA(r,0,e):""}function FA(r,e,t){if(r.byteLength<=e+t)return"";let n=new DataView(r),s="";for(let i=0;i<t;i++)s+=String.fromCharCode(n.getUint8(e+i));return s}var MA=p(()=>{"use strict"});function sb(r){try{return JSON.parse(r)}catch{throw new Error(`Failed to parse JSON from data starting with "${OA(r)}"`)}}var DA=p(()=>{"use strict";MA()});function ib(...r){return RA(r)}function RA(r){let e=r.map(i=>i instanceof ArrayBuffer?new Uint8Array(i):i),t=e.reduce((i,o)=>i+o.byteLength,0),n=new Uint8Array(t),s=0;for(let i of e)n.set(i,s),s+=i.byteLength;return n.buffer}function eo(r,e,t){let n=t!==void 0?new Uint8Array(r).subarray(e,e+t):new Uint8Array(r).subarray(e);return new Uint8Array(n).buffer}var ob=p(()=>{"use strict"});function _e(r,e){return fr(r>=0),fr(e>0),r+(e-1)&~(e-1)}function to(r,e,t){let n;if(r instanceof ArrayBuffer)n=new Uint8Array(r);else{let s=r.byteOffset,i=r.byteLength;n=new Uint8Array(r.buffer||r.arrayBuffer,s,i)}return e.set(n,t),t+_e(n.byteLength,4)}var ab=p(()=>{"use strict";ym()});function Uc(r,e,t,n){let s=_e(t.byteLength,n),i=s-t.byteLength;if(r){let o=new Uint8Array(r.buffer,r.byteOffset+e,t.byteLength),a=new Uint8Array(t);o.set(a);for(let c=0;c<i;++c)r.setUint8(e+t.byteLength+c,32)}return e+=s,e}function xf(r,e,t,n){let i=new TextEncoder().encode(t);return e=Uc(r,e,i,n),e}var kA=p(()=>{"use strict";ab()});function cb(r){let e=new Uint8Array(r),t=[],n=3*4096;for(let s=0;s<e.length;s+=n)t.push(btoa(String.fromCharCode(...e.subarray(s,s+n))));return t.join("")}var NA=p(()=>{"use strict"});async function*ub(r,e={}){let t=new TextDecoder(void 0,e);for await(let n of r)yield typeof n=="string"?n:t.decode(n,{stream:!0})}async function*lb(r){let e="";for await(let t of r){e+=t;let n;for(n=e.indexOf(`
|
|
37
37
|
`);n>=0;){let s=e.slice(0,n+1);e=e.slice(n+1),yield s,n=e.indexOf(`
|
|
38
|
-
`)}}e.length>0&&(yield e)}var eA=p(()=>{"use strict"});async function Gm(r){let e=[];for await(let t of r)e.push(aM(t));return km(...e)}function aM(r){if(r instanceof ArrayBuffer)return r;if(ArrayBuffer.isView(r)){let{buffer:e,byteOffset:t,byteLength:n}=r;return tA(e,t,n)}return tA(r)}function tA(r,e=0,t=r.byteLength-e){let n=new Uint8Array(r,e,t),s=new Uint8Array(n.length);return s.set(n),s.buffer}var rA=p(()=>{"use strict";Cm()});function Qi(r){if(r instanceof ArrayBuffer)return r;if(G0(r))return zm(r);let{buffer:e,byteOffset:t,byteLength:n}=r;return e instanceof ArrayBuffer&&t===0&&n===e.byteLength?e:zm(e,t,n)}function zm(r,e=0,t=r.byteLength-e){let n=new Uint8Array(r,e,t),s=new Uint8Array(n.length);return s.set(n),s.buffer}var nA=p(()=>{"use strict";z0()});function Wm(r){return{...r,batchType:"data",length:r.data.numRows}}var sA=p(()=>{"use strict"});var yK,wK,xK,TK,iA=p(()=>{yK=Math.PI/2,wK=Math.PI/4,xK=Math.PI/6,TK=Math.PI*2});function oA(r,{precision:e=rt.precision}={}){return r=fM(r),`${parseFloat(r.toPrecision(e))}`}function ra(r){return Array.isArray(r)||ArrayBuffer.isView(r)&&!(r instanceof DataView)}function $m(r,e,t){let n=rt.EPSILON;t&&(rt.EPSILON=t);try{if(r===e)return!0;if(ra(r)&&ra(e)){if(r.length!==e.length)return!1;for(let s=0;s<r.length;++s)if(!$m(r[s],e[s]))return!1;return!0}return r&&r.equals?r.equals(e):e&&e.equals?e.equals(r):typeof r=="number"&&typeof e=="number"?Math.abs(r-e)<=rt.EPSILON*Math.max(1,Math.abs(r),Math.abs(e)):!1}finally{rt.EPSILON=n}}function fM(r){return Math.round(r/rt.EPSILON)*rt.EPSILON}var _K,AK,uM,rt,Nc=p(()=>{_K=1/Math.PI*180,AK=1/180*Math.PI,uM={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...uM}};rt=globalThis.mathgl.config});var Ks,ll=p(()=>{Nc();Ks=class extends Array{clone(){return new this.constructor().copy(this)}fromArray(e,t=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=e[n+t];return this.check()}toArray(e=[],t=0){for(let n=0;n<this.ELEMENTS;++n)e[t+n]=this[n];return e}toObject(e){return e}from(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}to(e){return e===this?this:ra(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toString(){return this.formatString(rt)}formatString(e){let t="";for(let n=0;n<this.ELEMENTS;++n)t+=(n>0?", ":"")+oA(this[n],e);return`${e.printTypes?this.constructor.name:""}[${t}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(!$m(this[t],e[t]))return!1;return!0}exactEquals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(this[t]!==e[t])return!1;return!0}negate(){for(let e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}lerp(e,t,n){if(n===void 0)return this.lerp(this,e,t);for(let s=0;s<this.ELEMENTS;++s){let i=e[s],o=typeof t=="number"?t:t[s];this[s]=i+n*(o-i)}return this.check()}min(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.min(e[t],this[t]);return this.check()}max(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.max(e[t],this[t]);return this.check()}clamp(e,t){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e[n]),t[n]);return this.check()}add(...e){for(let t of e)for(let n=0;n<this.ELEMENTS;++n)this[n]+=t[n];return this.check()}subtract(...e){for(let t of e)for(let n=0;n<this.ELEMENTS;++n)this[n]-=t[n];return this.check()}scale(e){if(typeof e=="number")for(let t=0;t<this.ELEMENTS;++t)this[t]*=e;else for(let t=0;t<this.ELEMENTS&&t<e.length;++t)this[t]*=e[t];return this.check()}multiplyByScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}check(){if(rt.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let e=this.length===this.ELEMENTS;for(let t=0;t<this.ELEMENTS;++t)e=e&&Number.isFinite(this[t]);return e}}});function lM(r,e){if(r.length!==e)return!1;for(let t=0;t<r.length;++t)if(!Number.isFinite(r[t]))return!1;return!0}function Ue(r){if(!Number.isFinite(r))throw new Error(`Invalid number ${JSON.stringify(r)}`);return r}function na(r,e,t=""){if(rt.debug&&!lM(r,e))throw new Error(`math.gl: ${t} some fields set to invalid numbers'`);return r}var Zi=p(()=>{Nc()});var sa,qm=p(()=>{ll();Zi();Nc();sa=class extends Ks{toString(){let e="[";if(rt.printRowMajor){e+="row-major:";for(let t=0;t<this.RANK;++t)for(let n=0;n<this.RANK;++n)e+=` ${this[n*this.RANK+t]}`}else{e+="column-major:";for(let t=0;t<this.ELEMENTS;++t)e+=` ${this[t]}`}return e+="]",e}getElementIndex(e,t){return t*this.RANK+e}getElement(e,t){return this[t*this.RANK+e]}setElement(e,t,n){return this[t*this.RANK+e]=Ue(n),this}getColumn(e,t=new Array(this.RANK).fill(-0)){let n=e*this.RANK;for(let s=0;s<this.RANK;++s)t[s]=this[n+s];return t}setColumn(e,t){let n=e*this.RANK;for(let s=0;s<this.RANK;++s)this[n+s]=t[s];return this}}});function Km(r,e){if(!r)throw new Error(`math.gl assertion ${e}`)}var aA=p(()=>{});var dl,cA=p(()=>{ll();Zi();aA();dl=class extends Ks{get x(){return this[0]}set x(e){this[0]=Ue(e)}get y(){return this[1]}set y(e){this[1]=Ue(e)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let e=0;for(let t=0;t<this.ELEMENTS;++t)e+=this[t]*this[t];return e}magnitudeSquared(){return this.lengthSquared()}distance(e){return Math.sqrt(this.distanceSquared(e))}distanceSquared(e){let t=0;for(let n=0;n<this.ELEMENTS;++n){let s=this[n]-e[n];t+=s*s}return Ue(t)}dot(e){let t=0;for(let n=0;n<this.ELEMENTS;++n)t+=this[n]*e[n];return Ue(t)}normalize(){let e=this.magnitude();if(e!==0)for(let t=0;t<this.ELEMENTS;++t)this[t]/=e;return this.check()}multiply(...e){for(let t of e)for(let n=0;n<this.ELEMENTS;++n)this[n]*=t[n];return this.check()}divide(...e){for(let t of e)for(let n=0;n<this.ELEMENTS;++n)this[n]/=t[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(e){return this.distance(e)}distanceToSquared(e){return this.distanceSquared(e)}getComponent(e){return Km(e>=0&&e<this.ELEMENTS,"index is out of range"),Ue(this[e])}setComponent(e,t){return Km(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=t,this.check()}addVectors(e,t){return this.copy(e).add(t)}subVectors(e,t){return this.copy(e).subtract(t)}multiplyVectors(e,t){return this.copy(e).multiply(t)}addScaledVector(e,t){for(let n=0;n<this.ELEMENTS;++n)this[n]+=e[n]*t;return this.check()}}});var hl,UK,uA=p(()=>{hl=typeof Float32Array<"u"?Float32Array:Array,UK=Math.PI/180});function fA(r,e,t){let n=e[0],s=e[1];return r[0]=t[0]*n+t[3]*s+t[6],r[1]=t[1]*n+t[4]*s+t[7],r}function lA(r,e,t){let n=e[0],s=e[1];return r[0]=t[0]*n+t[4]*s+t[12],r[1]=t[1]*n+t[5]*s+t[13],r}var pl=p(()=>{});function dA(r,e,t){let n=e[0],s=e[1],i=t[3]*n+t[7]*s||1;return r[0]=(t[0]*n+t[4]*s)/i,r[1]=(t[1]*n+t[5]*s)/i,r}function ml(r,e,t){let n=e[0],s=e[1],i=e[2],o=t[3]*n+t[7]*s+t[11]*i||1;return r[0]=(t[0]*n+t[4]*s+t[8]*i)/o,r[1]=(t[1]*n+t[5]*s+t[9]*i)/o,r[2]=(t[2]*n+t[6]*s+t[10]*i)/o,r}function hA(r,e,t){let n=e[0],s=e[1];return r[0]=t[0]*n+t[2]*s,r[1]=t[1]*n+t[3]*s,r[2]=e[2],r}function pA(r,e,t){let n=e[0],s=e[1],i=e[2];return r[0]=t[0]*n+t[3]*s+t[6]*i,r[1]=t[1]*n+t[4]*s+t[7]*i,r[2]=t[2]*n+t[5]*s+t[8]*i,r[3]=e[3],r}var bl=p(()=>{});function mA(){let r=new hl(3);return hl!==Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r}function hM(r){let e=r[0],t=r[1],n=r[2];return Math.sqrt(e*e+t*t+n*n)}function Xm(r,e,t){let n=new hl(3);return n[0]=r,n[1]=e,n[2]=t,n}function bA(r,e){let t=e[0],n=e[1],s=e[2],i=t*t+n*n+s*s;return i>0&&(i=1/Math.sqrt(i)),r[0]=e[0]*i,r[1]=e[1]*i,r[2]=e[2]*i,r}function Hm(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]}function ia(r,e,t){let n=e[0],s=e[1],i=e[2],o=t[0],a=t[1],c=t[2];return r[0]=s*c-i*a,r[1]=i*o-n*c,r[2]=n*a-s*o,r}function gl(r,e,t){let n=e[0],s=e[1],i=e[2],o=t[3]*n+t[7]*s+t[11]*i+t[15];return o=o||1,r[0]=(t[0]*n+t[4]*s+t[8]*i+t[12])/o,r[1]=(t[1]*n+t[5]*s+t[9]*i+t[13])/o,r[2]=(t[2]*n+t[6]*s+t[10]*i+t[14])/o,r}function yl(r,e,t){let n=e[0],s=e[1],i=e[2];return r[0]=n*t[0]+s*t[3]+i*t[6],r[1]=n*t[1]+s*t[4]+i*t[7],r[2]=n*t[2]+s*t[5]+i*t[8],r}function gA(r,e,t){let n=t[0],s=t[1],i=t[2],o=t[3],a=e[0],c=e[1],u=e[2],f=s*u-i*c,l=i*a-n*u,d=n*c-s*a,h=s*d-i*l,m=i*f-n*d,b=n*l-s*f,w=o*2;return f*=w,l*=w,d*=w,h*=2,m*=2,b*=2,r[0]=a+f+h,r[1]=c+l+m,r[2]=u+d+b,r}function yA(r,e,t,n){let s=[],i=[];return s[0]=e[0]-t[0],s[1]=e[1]-t[1],s[2]=e[2]-t[2],i[0]=s[0],i[1]=s[1]*Math.cos(n)-s[2]*Math.sin(n),i[2]=s[1]*Math.sin(n)+s[2]*Math.cos(n),r[0]=i[0]+t[0],r[1]=i[1]+t[1],r[2]=i[2]+t[2],r}function wA(r,e,t,n){let s=[],i=[];return s[0]=e[0]-t[0],s[1]=e[1]-t[1],s[2]=e[2]-t[2],i[0]=s[2]*Math.sin(n)+s[0]*Math.cos(n),i[1]=s[1],i[2]=s[2]*Math.cos(n)-s[0]*Math.sin(n),r[0]=i[0]+t[0],r[1]=i[1]+t[1],r[2]=i[2]+t[2],r}function xA(r,e,t,n){let s=[],i=[];return s[0]=e[0]-t[0],s[1]=e[1]-t[1],s[2]=e[2]-t[2],i[0]=s[0]*Math.cos(n)-s[1]*Math.sin(n),i[1]=s[0]*Math.sin(n)+s[1]*Math.cos(n),i[2]=s[2],r[0]=i[0]+t[0],r[1]=i[1]+t[1],r[2]=i[2]+t[2],r}function TA(r,e){let t=r[0],n=r[1],s=r[2],i=e[0],o=e[1],a=e[2],c=Math.sqrt((t*t+n*n+s*s)*(i*i+o*o+a*a)),u=c&&Hm(r,e)/c;return Math.acos(Math.min(Math.max(u,-1),1))}var _A,oa=p(()=>{uA();_A=hM});var Jm,wl,Cc,AA=p(()=>{cA();Nc();Zi();oa();bl();Jm=[0,0,0],Cc=class r extends dl{static get ZERO(){return wl||(wl=new r(0,0,0),Object.freeze(wl)),wl}constructor(e=0,t=0,n=0){super(-0,-0,-0),arguments.length===1&&ra(e)?this.copy(e):(rt.debug&&(Ue(e),Ue(t),Ue(n)),this[0]=e,this[1]=t,this[2]=n)}set(e,t,n){return this[0]=e,this[1]=t,this[2]=n,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}fromObject(e){return rt.debug&&(Ue(e.x),Ue(e.y),Ue(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}get ELEMENTS(){return 3}get z(){return this[2]}set z(e){this[2]=Ue(e)}angle(e){return TA(this,e)}cross(e){return ia(this,this,e),this.check()}rotateX({radians:e,origin:t=Jm}){return yA(this,this,t,e),this.check()}rotateY({radians:e,origin:t=Jm}){return wA(this,this,t,e),this.check()}rotateZ({radians:e,origin:t=Jm}){return xA(this,this,t,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return gl(this,this,e),this.check()}transformAsVector(e){return ml(this,this,e),this.check()}transformByMatrix3(e){return yl(this,this,e),this.check()}transformByMatrix2(e){return hA(this,this,e),this.check()}transformByQuaternion(e){return gA(this,this,e),this.check()}}});function vA(r,e){if(r===e){let t=e[1],n=e[2],s=e[5];r[1]=e[3],r[2]=e[6],r[3]=t,r[5]=e[7],r[6]=n,r[7]=s}else r[0]=e[0],r[1]=e[3],r[2]=e[6],r[3]=e[1],r[4]=e[4],r[5]=e[7],r[6]=e[2],r[7]=e[5],r[8]=e[8];return r}function IA(r,e){let t=e[0],n=e[1],s=e[2],i=e[3],o=e[4],a=e[5],c=e[6],u=e[7],f=e[8],l=f*o-a*u,d=-f*i+a*c,h=u*i-o*c,m=t*l+n*d+s*h;return m?(m=1/m,r[0]=l*m,r[1]=(-f*n+s*u)*m,r[2]=(a*n-s*o)*m,r[3]=d*m,r[4]=(f*t-s*c)*m,r[5]=(-a*t+s*i)*m,r[6]=h*m,r[7]=(-u*t+n*c)*m,r[8]=(o*t-n*i)*m,r):null}function SA(r){let e=r[0],t=r[1],n=r[2],s=r[3],i=r[4],o=r[5],a=r[6],c=r[7],u=r[8];return e*(u*i-o*c)+t*(-u*s+o*a)+n*(c*s-i*a)}function Ym(r,e,t){let n=e[0],s=e[1],i=e[2],o=e[3],a=e[4],c=e[5],u=e[6],f=e[7],l=e[8],d=t[0],h=t[1],m=t[2],b=t[3],w=t[4],g=t[5],x=t[6],T=t[7],_=t[8];return r[0]=d*n+h*o+m*u,r[1]=d*s+h*a+m*f,r[2]=d*i+h*c+m*l,r[3]=b*n+w*o+g*u,r[4]=b*s+w*a+g*f,r[5]=b*i+w*c+g*l,r[6]=x*n+T*o+_*u,r[7]=x*s+T*a+_*f,r[8]=x*i+T*c+_*l,r}function EA(r,e,t){let n=e[0],s=e[1],i=e[2],o=e[3],a=e[4],c=e[5],u=e[6],f=e[7],l=e[8],d=t[0],h=t[1];return r[0]=n,r[1]=s,r[2]=i,r[3]=o,r[4]=a,r[5]=c,r[6]=d*n+h*o+u,r[7]=d*s+h*a+f,r[8]=d*i+h*c+l,r}function LA(r,e,t){let n=e[0],s=e[1],i=e[2],o=e[3],a=e[4],c=e[5],u=e[6],f=e[7],l=e[8],d=Math.sin(t),h=Math.cos(t);return r[0]=h*n+d*o,r[1]=h*s+d*a,r[2]=h*i+d*c,r[3]=h*o-d*n,r[4]=h*a-d*s,r[5]=h*c-d*i,r[6]=u,r[7]=f,r[8]=l,r}function Qm(r,e,t){let n=t[0],s=t[1];return r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=s*e[3],r[4]=s*e[4],r[5]=s*e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r}function BA(r,e){let t=e[0],n=e[1],s=e[2],i=e[3],o=t+t,a=n+n,c=s+s,u=t*o,f=n*o,l=n*a,d=s*o,h=s*a,m=s*c,b=i*o,w=i*a,g=i*c;return r[0]=1-l-m,r[3]=f-g,r[6]=d+w,r[1]=f+g,r[4]=1-u-m,r[7]=h-b,r[2]=d-w,r[5]=h+b,r[8]=1-u-l,r}var Zm=p(()=>{});function bM(){return xl||(xl=new Un([0,0,0,0,0,0,0,0,0]),Object.freeze(xl)),xl}function gM(){return Tl||(Tl=new Un,Object.freeze(Tl)),Tl}var eb,mM,Un,xl,Tl,FA=p(()=>{qm();Zi();bl();Zm();pl();oa();(function(r){r[r.COL0ROW0=0]="COL0ROW0",r[r.COL0ROW1=1]="COL0ROW1",r[r.COL0ROW2=2]="COL0ROW2",r[r.COL1ROW0=3]="COL1ROW0",r[r.COL1ROW1=4]="COL1ROW1",r[r.COL1ROW2=5]="COL1ROW2",r[r.COL2ROW0=6]="COL2ROW0",r[r.COL2ROW1=7]="COL2ROW1",r[r.COL2ROW2=8]="COL2ROW2"})(eb||(eb={}));mM=Object.freeze([1,0,0,0,1,0,0,0,1]),Un=class extends sa{static get IDENTITY(){return gM()}static get ZERO(){return bM()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return eb}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this.check()}identity(){return this.copy(mM)}fromObject(e){return this.check()}fromQuaternion(e){return BA(this,e),this.check()}fromMatrix4(e){return this.set(e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10])}set(e,t,n,s,i,o,a,c,u){return this[0]=e,this[1]=t,this[2]=n,this[3]=s,this[4]=i,this[5]=o,this[6]=a,this[7]=c,this[8]=u,this.check()}setRowMajor(e,t,n,s,i,o,a,c,u){return this[0]=e,this[1]=s,this[2]=a,this[3]=t,this[4]=i,this[5]=c,this[6]=n,this[7]=o,this[8]=u,this.check()}determinant(){return SA(this)}transpose(){return vA(this,this),this.check()}invert(){return IA(this,this),this.check()}multiplyLeft(e){return Ym(this,e,this),this.check()}multiplyRight(e){return Ym(this,this,e),this.check()}rotate(e){return LA(this,this,e),this.check()}scale(e){return Array.isArray(e)?Qm(this,this,e):Qm(this,this,[e,e]),this.check()}translate(e){return EA(this,this,e),this.check()}transform(e,t){let n;switch(e.length){case 2:n=fA(t||[-0,-0],e,this);break;case 3:n=yl(t||[-0,-0,-0],e,this);break;case 4:n=pA(t||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return na(n,e.length),n}},Tl=null});function yM(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function OA(r,e){if(r===e){let t=e[1],n=e[2],s=e[3],i=e[6],o=e[7],a=e[11];r[1]=e[4],r[2]=e[8],r[3]=e[12],r[4]=t,r[6]=e[9],r[7]=e[13],r[8]=n,r[9]=i,r[11]=e[14],r[12]=s,r[13]=o,r[14]=a}else r[0]=e[0],r[1]=e[4],r[2]=e[8],r[3]=e[12],r[4]=e[1],r[5]=e[5],r[6]=e[9],r[7]=e[13],r[8]=e[2],r[9]=e[6],r[10]=e[10],r[11]=e[14],r[12]=e[3],r[13]=e[7],r[14]=e[11],r[15]=e[15];return r}function MA(r,e){let t=e[0],n=e[1],s=e[2],i=e[3],o=e[4],a=e[5],c=e[6],u=e[7],f=e[8],l=e[9],d=e[10],h=e[11],m=e[12],b=e[13],w=e[14],g=e[15],x=t*a-n*o,T=t*c-s*o,_=t*u-i*o,v=n*c-s*a,I=n*u-i*a,N=s*u-i*c,q=f*b-l*m,re=f*w-d*m,pe=f*g-h*m,Me=l*w-d*b,Re=l*g-h*b,ce=d*g-h*w,ie=x*ce-T*Re+_*Me+v*pe-I*re+N*q;return ie?(ie=1/ie,r[0]=(a*ce-c*Re+u*Me)*ie,r[1]=(s*Re-n*ce-i*Me)*ie,r[2]=(b*N-w*I+g*v)*ie,r[3]=(d*I-l*N-h*v)*ie,r[4]=(c*pe-o*ce-u*re)*ie,r[5]=(t*ce-s*pe+i*re)*ie,r[6]=(w*_-m*N-g*T)*ie,r[7]=(f*N-d*_+h*T)*ie,r[8]=(o*Re-a*pe+u*q)*ie,r[9]=(n*pe-t*Re-i*q)*ie,r[10]=(m*I-b*_+g*x)*ie,r[11]=(l*_-f*I-h*x)*ie,r[12]=(a*re-o*Me-c*q)*ie,r[13]=(t*Me-n*re+s*q)*ie,r[14]=(b*T-m*v-w*x)*ie,r[15]=(f*v-l*T+d*x)*ie,r):null}function RA(r){let e=r[0],t=r[1],n=r[2],s=r[3],i=r[4],o=r[5],a=r[6],c=r[7],u=r[8],f=r[9],l=r[10],d=r[11],h=r[12],m=r[13],b=r[14],w=r[15],g=e*o-t*i,x=e*a-n*i,T=t*a-n*o,_=u*m-f*h,v=u*b-l*h,I=f*b-l*m,N=e*I-t*v+n*_,q=i*I-o*v+a*_,re=u*T-f*x+l*g,pe=h*T-m*x+b*g;return c*N-s*q+w*re-d*pe}function tb(r,e,t){let n=e[0],s=e[1],i=e[2],o=e[3],a=e[4],c=e[5],u=e[6],f=e[7],l=e[8],d=e[9],h=e[10],m=e[11],b=e[12],w=e[13],g=e[14],x=e[15],T=t[0],_=t[1],v=t[2],I=t[3];return r[0]=T*n+_*a+v*l+I*b,r[1]=T*s+_*c+v*d+I*w,r[2]=T*i+_*u+v*h+I*g,r[3]=T*o+_*f+v*m+I*x,T=t[4],_=t[5],v=t[6],I=t[7],r[4]=T*n+_*a+v*l+I*b,r[5]=T*s+_*c+v*d+I*w,r[6]=T*i+_*u+v*h+I*g,r[7]=T*o+_*f+v*m+I*x,T=t[8],_=t[9],v=t[10],I=t[11],r[8]=T*n+_*a+v*l+I*b,r[9]=T*s+_*c+v*d+I*w,r[10]=T*i+_*u+v*h+I*g,r[11]=T*o+_*f+v*m+I*x,T=t[12],_=t[13],v=t[14],I=t[15],r[12]=T*n+_*a+v*l+I*b,r[13]=T*s+_*c+v*d+I*w,r[14]=T*i+_*u+v*h+I*g,r[15]=T*o+_*f+v*m+I*x,r}function DA(r,e,t){let n=t[0],s=t[1],i=t[2],o,a,c,u,f,l,d,h,m,b,w,g;return e===r?(r[12]=e[0]*n+e[4]*s+e[8]*i+e[12],r[13]=e[1]*n+e[5]*s+e[9]*i+e[13],r[14]=e[2]*n+e[6]*s+e[10]*i+e[14],r[15]=e[3]*n+e[7]*s+e[11]*i+e[15]):(o=e[0],a=e[1],c=e[2],u=e[3],f=e[4],l=e[5],d=e[6],h=e[7],m=e[8],b=e[9],w=e[10],g=e[11],r[0]=o,r[1]=a,r[2]=c,r[3]=u,r[4]=f,r[5]=l,r[6]=d,r[7]=h,r[8]=m,r[9]=b,r[10]=w,r[11]=g,r[12]=o*n+f*s+m*i+e[12],r[13]=a*n+l*s+b*i+e[13],r[14]=c*n+d*s+w*i+e[14],r[15]=u*n+h*s+g*i+e[15]),r}function NA(r,e,t){let n=t[0],s=t[1],i=t[2];return r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3]*n,r[4]=e[4]*s,r[5]=e[5]*s,r[6]=e[6]*s,r[7]=e[7]*s,r[8]=e[8]*i,r[9]=e[9]*i,r[10]=e[10]*i,r[11]=e[11]*i,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r}function kA(r,e,t,n){let s=n[0],i=n[1],o=n[2],a=Math.sqrt(s*s+i*i+o*o),c,u,f,l,d,h,m,b,w,g,x,T,_,v,I,N,q,re,pe,Me,Re,ce,ie,we;return a<1e-6?null:(a=1/a,s*=a,i*=a,o*=a,u=Math.sin(t),c=Math.cos(t),f=1-c,l=e[0],d=e[1],h=e[2],m=e[3],b=e[4],w=e[5],g=e[6],x=e[7],T=e[8],_=e[9],v=e[10],I=e[11],N=s*s*f+c,q=i*s*f+o*u,re=o*s*f-i*u,pe=s*i*f-o*u,Me=i*i*f+c,Re=o*i*f+s*u,ce=s*o*f+i*u,ie=i*o*f-s*u,we=o*o*f+c,r[0]=l*N+b*q+T*re,r[1]=d*N+w*q+_*re,r[2]=h*N+g*q+v*re,r[3]=m*N+x*q+I*re,r[4]=l*pe+b*Me+T*Re,r[5]=d*pe+w*Me+_*Re,r[6]=h*pe+g*Me+v*Re,r[7]=m*pe+x*Me+I*Re,r[8]=l*ce+b*ie+T*we,r[9]=d*ce+w*ie+_*we,r[10]=h*ce+g*ie+v*we,r[11]=m*ce+x*ie+I*we,e!==r&&(r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r)}function CA(r,e,t){let n=Math.sin(t),s=Math.cos(t),i=e[4],o=e[5],a=e[6],c=e[7],u=e[8],f=e[9],l=e[10],d=e[11];return e!==r&&(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[4]=i*s+u*n,r[5]=o*s+f*n,r[6]=a*s+l*n,r[7]=c*s+d*n,r[8]=u*s-i*n,r[9]=f*s-o*n,r[10]=l*s-a*n,r[11]=d*s-c*n,r}function UA(r,e,t){let n=Math.sin(t),s=Math.cos(t),i=e[0],o=e[1],a=e[2],c=e[3],u=e[8],f=e[9],l=e[10],d=e[11];return e!==r&&(r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[0]=i*s-u*n,r[1]=o*s-f*n,r[2]=a*s-l*n,r[3]=c*s-d*n,r[8]=i*n+u*s,r[9]=o*n+f*s,r[10]=a*n+l*s,r[11]=c*n+d*s,r}function VA(r,e,t){let n=Math.sin(t),s=Math.cos(t),i=e[0],o=e[1],a=e[2],c=e[3],u=e[4],f=e[5],l=e[6],d=e[7];return e!==r&&(r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[0]=i*s+u*n,r[1]=o*s+f*n,r[2]=a*s+l*n,r[3]=c*s+d*n,r[4]=u*s-i*n,r[5]=f*s-o*n,r[6]=l*s-a*n,r[7]=d*s-c*n,r}function PA(r,e){let t=e[0],n=e[1],s=e[2],i=e[3],o=t+t,a=n+n,c=s+s,u=t*o,f=n*o,l=n*a,d=s*o,h=s*a,m=s*c,b=i*o,w=i*a,g=i*c;return r[0]=1-l-m,r[1]=f+g,r[2]=d-w,r[3]=0,r[4]=f-g,r[5]=1-u-m,r[6]=h+b,r[7]=0,r[8]=d+w,r[9]=h-b,r[10]=1-u-l,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function jA(r,e,t,n,s,i,o){let a=1/(t-e),c=1/(s-n),u=1/(i-o);return r[0]=i*2*a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=i*2*c,r[6]=0,r[7]=0,r[8]=(t+e)*a,r[9]=(s+n)*c,r[10]=(o+i)*u,r[11]=-1,r[12]=0,r[13]=0,r[14]=o*i*2*u,r[15]=0,r}function wM(r,e,t,n,s){let i=1/Math.tan(e/2);if(r[0]=i/t,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=i,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,s!=null&&s!==1/0){let o=1/(n-s);r[10]=(s+n)*o,r[14]=2*s*n*o}else r[10]=-1,r[14]=-2*n;return r}function xM(r,e,t,n,s,i,o){let a=1/(e-t),c=1/(n-s),u=1/(i-o);return r[0]=-2*a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*c,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*u,r[11]=0,r[12]=(e+t)*a,r[13]=(s+n)*c,r[14]=(o+i)*u,r[15]=1,r}function WA(r,e,t,n){let s,i,o,a,c,u,f,l,d,h,m=e[0],b=e[1],w=e[2],g=n[0],x=n[1],T=n[2],_=t[0],v=t[1],I=t[2];return Math.abs(m-_)<1e-6&&Math.abs(b-v)<1e-6&&Math.abs(w-I)<1e-6?yM(r):(l=m-_,d=b-v,h=w-I,s=1/Math.sqrt(l*l+d*d+h*h),l*=s,d*=s,h*=s,i=x*h-T*d,o=T*l-g*h,a=g*d-x*l,s=Math.sqrt(i*i+o*o+a*a),s?(s=1/s,i*=s,o*=s,a*=s):(i=0,o=0,a=0),c=d*a-h*o,u=h*i-l*a,f=l*o-d*i,s=Math.sqrt(c*c+u*u+f*f),s?(s=1/s,c*=s,u*=s,f*=s):(c=0,u=0,f=0),r[0]=i,r[1]=c,r[2]=l,r[3]=0,r[4]=o,r[5]=u,r[6]=d,r[7]=0,r[8]=a,r[9]=f,r[10]=h,r[11]=0,r[12]=-(i*m+o*b+a*w),r[13]=-(c*m+u*b+f*w),r[14]=-(l*m+d*b+h*w),r[15]=1,r)}var GA,zA,rb=p(()=>{GA=wM;zA=xM});function $A(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r}function qA(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r}function KA(r){let e=r[0],t=r[1],n=r[2],s=r[3];return Math.sqrt(e*e+t*t+n*n+s*s)}function XA(r){let e=r[0],t=r[1],n=r[2],s=r[3];return e*e+t*t+n*n+s*s}function HA(r,e){let t=e[0],n=e[1],s=e[2],i=e[3],o=t*t+n*n+s*s+i*i;return o>0&&(o=1/Math.sqrt(o)),r[0]=t*o,r[1]=n*o,r[2]=s*o,r[3]=i*o,r}function JA(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]+r[3]*e[3]}function YA(r,e,t,n){let s=e[0],i=e[1],o=e[2],a=e[3];return r[0]=s+n*(t[0]-s),r[1]=i+n*(t[1]-i),r[2]=o+n*(t[2]-o),r[3]=a+n*(t[3]-a),r}function QA(r,e,t){let n=e[0],s=e[1],i=e[2],o=e[3];return r[0]=t[0]*n+t[4]*s+t[8]*i+t[12]*o,r[1]=t[1]*n+t[5]*s+t[9]*i+t[13]*o,r[2]=t[2]*n+t[6]*s+t[10]*i+t[14]*o,r[3]=t[3]*n+t[7]*s+t[11]*i+t[15]*o,r}var _l=p(()=>{});function IM(){return Al||(Al=new Xs([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Al)),Al}function SM(){return vl||(vl=new Xs,Object.freeze(vl)),vl}function ZA(r){if(r>Math.PI*2)throw Error("expected radians")}function EM(r,e,t,n,s,i){let o=2*i/(t-e),a=2*i/(s-n),c=(t+e)/(t-e),u=(s+n)/(s-n),f=-1,l=-1,d=-2*i;return r[0]=o,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=c,r[9]=u,r[10]=f,r[11]=l,r[12]=0,r[13]=0,r[14]=d,r[15]=0,r}var ib,_M,AM,nb,sb,vM,Xs,Al,vl,e1=p(()=>{qm();Zi();bl();rb();pl();oa();_l();(function(r){r[r.COL0ROW0=0]="COL0ROW0",r[r.COL0ROW1=1]="COL0ROW1",r[r.COL0ROW2=2]="COL0ROW2",r[r.COL0ROW3=3]="COL0ROW3",r[r.COL1ROW0=4]="COL1ROW0",r[r.COL1ROW1=5]="COL1ROW1",r[r.COL1ROW2=6]="COL1ROW2",r[r.COL1ROW3=7]="COL1ROW3",r[r.COL2ROW0=8]="COL2ROW0",r[r.COL2ROW1=9]="COL2ROW1",r[r.COL2ROW2=10]="COL2ROW2",r[r.COL2ROW3=11]="COL2ROW3",r[r.COL3ROW0=12]="COL3ROW0",r[r.COL3ROW1=13]="COL3ROW1",r[r.COL3ROW2=14]="COL3ROW2",r[r.COL3ROW3=15]="COL3ROW3"})(ib||(ib={}));_M=45*Math.PI/180,AM=1,nb=.1,sb=500,vM=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Xs=class extends sa{static get IDENTITY(){return SM()}static get ZERO(){return IM()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return ib}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}set(e,t,n,s,i,o,a,c,u,f,l,d,h,m,b,w){return this[0]=e,this[1]=t,this[2]=n,this[3]=s,this[4]=i,this[5]=o,this[6]=a,this[7]=c,this[8]=u,this[9]=f,this[10]=l,this[11]=d,this[12]=h,this[13]=m,this[14]=b,this[15]=w,this.check()}setRowMajor(e,t,n,s,i,o,a,c,u,f,l,d,h,m,b,w){return this[0]=e,this[1]=i,this[2]=u,this[3]=h,this[4]=t,this[5]=o,this[6]=f,this[7]=m,this[8]=n,this[9]=a,this[10]=l,this[11]=b,this[12]=s,this[13]=c,this[14]=d,this[15]=w,this.check()}toRowMajor(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}identity(){return this.copy(vM)}fromObject(e){return this.check()}fromQuaternion(e){return PA(this,e),this.check()}fromMatrix3(e){return this.set(e[0],e[1],e[2],0,e[3],e[4],e[5],0,e[6],e[7],e[8],0,0,0,0,1)}frustum(e){let{left:t,right:n,bottom:s,top:i,near:o=nb,far:a=sb}=e;return a===1/0?EM(this,t,n,s,i,o):jA(this,t,n,s,i,o,a),this.check()}lookAt(e){let{eye:t,center:n=[0,0,0],up:s=[0,1,0]}=e;return WA(this,t,n,s),this.check()}ortho(e){let{left:t,right:n,bottom:s,top:i,near:o=nb,far:a=sb}=e;return zA(this,t,n,s,i,o,a),this.check()}orthographic(e){let{fovy:t=_M,aspect:n=AM,focalDistance:s=1,near:i=nb,far:o=sb}=e;ZA(t);let a=t/2,c=s*Math.tan(a),u=c*n;return this.ortho({left:-u,right:u,bottom:-c,top:c,near:i,far:o})}perspective(e){let{fovy:t=45*Math.PI/180,aspect:n=1,near:s=.1,far:i=500}=e;return ZA(t),GA(this,t,n,s,i),this.check()}determinant(){return RA(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e,t){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],t=t||[-0,-0,-0];let n=this.getScale(t),s=1/n[0],i=1/n[1],o=1/n[2];return e[0]=this[0]*s,e[1]=this[1]*i,e[2]=this[2]*o,e[3]=0,e[4]=this[4]*s,e[5]=this[5]*i,e[6]=this[6]*o,e[7]=0,e[8]=this[8]*s,e[9]=this[9]*i,e[10]=this[10]*o,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e,t){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0],t=t||[-0,-0,-0];let n=this.getScale(t),s=1/n[0],i=1/n[1],o=1/n[2];return e[0]=this[0]*s,e[1]=this[1]*i,e[2]=this[2]*o,e[3]=this[4]*s,e[4]=this[5]*i,e[5]=this[6]*o,e[6]=this[8]*s,e[7]=this[9]*i,e[8]=this[10]*o,e}transpose(){return OA(this,this),this.check()}invert(){return MA(this,this),this.check()}multiplyLeft(e){return tb(this,e,this),this.check()}multiplyRight(e){return tb(this,this,e),this.check()}rotateX(e){return CA(this,this,e),this.check()}rotateY(e){return UA(this,this,e),this.check()}rotateZ(e){return VA(this,this,e),this.check()}rotateXYZ(e){return this.rotateX(e[0]).rotateY(e[1]).rotateZ(e[2])}rotateAxis(e,t){return kA(this,this,e,t),this.check()}scale(e){return NA(this,this,Array.isArray(e)?e:[e,e,e]),this.check()}translate(e){return DA(this,this,e),this.check()}transform(e,t){return e.length===4?(t=QA(t||[-0,-0,-0,-0],e,this),na(t,4),t):this.transformAsPoint(e,t)}transformAsPoint(e,t){let{length:n}=e,s;switch(n){case 2:s=lA(t||[-0,-0],e,this);break;case 3:s=gl(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return na(s,e.length),s}transformAsVector(e,t){let n;switch(e.length){case 2:n=dA(t||[-0,-0],e,this);break;case 3:n=ml(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return na(n,e.length),n}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,t,n){return this.identity().translate([e,t,n])}}});function t1(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r}function ob(r,e,t){t=t*.5;let n=Math.sin(t);return r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=Math.cos(t),r}function ab(r,e,t){let n=e[0],s=e[1],i=e[2],o=e[3],a=t[0],c=t[1],u=t[2],f=t[3];return r[0]=n*f+o*a+s*u-i*c,r[1]=s*f+o*c+i*a-n*u,r[2]=i*f+o*u+n*c-s*a,r[3]=o*f-n*a-s*c-i*u,r}function r1(r,e,t){t*=.5;let n=e[0],s=e[1],i=e[2],o=e[3],a=Math.sin(t),c=Math.cos(t);return r[0]=n*c+o*a,r[1]=s*c+i*a,r[2]=i*c-s*a,r[3]=o*c-n*a,r}function n1(r,e,t){t*=.5;let n=e[0],s=e[1],i=e[2],o=e[3],a=Math.sin(t),c=Math.cos(t);return r[0]=n*c-i*a,r[1]=s*c+o*a,r[2]=i*c+n*a,r[3]=o*c-s*a,r}function s1(r,e,t){t*=.5;let n=e[0],s=e[1],i=e[2],o=e[3],a=Math.sin(t),c=Math.cos(t);return r[0]=n*c+s*a,r[1]=s*c-n*a,r[2]=i*c+o*a,r[3]=o*c-i*a,r}function i1(r,e){let t=e[0],n=e[1],s=e[2];return r[0]=t,r[1]=n,r[2]=s,r[3]=Math.sqrt(Math.abs(1-t*t-n*n-s*s)),r}function o1(r,e,t,n){let s=e[0],i=e[1],o=e[2],a=e[3],c=t[0],u=t[1],f=t[2],l=t[3],d,h,m,b,w;return d=s*c+i*u+o*f+a*l,d<0&&(d=-d,c=-c,u=-u,f=-f,l=-l),1-d>1e-6?(h=Math.acos(d),w=Math.sin(h),m=Math.sin((1-n)*h)/w,b=Math.sin(n*h)/w):(m=1-n,b=n),r[0]=m*s+b*c,r[1]=m*i+b*u,r[2]=m*o+b*f,r[3]=m*a+b*l,r}function a1(r,e){let t=e[0],n=e[1],s=e[2],i=e[3],o=t*t+n*n+s*s+i*i,a=o?1/o:0;return r[0]=-t*a,r[1]=-n*a,r[2]=-s*a,r[3]=i*a,r}function c1(r,e){return r[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r[3]=e[3],r}function u1(r,e){let t=e[0]+e[4]+e[8],n;if(t>0)n=Math.sqrt(t+1),r[3]=.5*n,n=.5/n,r[0]=(e[5]-e[7])*n,r[1]=(e[6]-e[2])*n,r[2]=(e[1]-e[3])*n;else{let s=0;e[4]>e[0]&&(s=1),e[8]>e[s*3+s]&&(s=2);let i=(s+1)%3,o=(s+2)%3;n=Math.sqrt(e[s*3+s]-e[i*3+i]-e[o*3+o]+1),r[s]=.5*n,n=.5/n,r[3]=(e[i*3+o]-e[o*3+i])*n,r[i]=(e[i*3+s]+e[s*3+i])*n,r[o]=(e[o*3+s]+e[s*3+o])*n}return r}var f1,l1,d1,h1,p1,m1,LM,b1,cb=p(()=>{oa();_l();f1=$A,l1=qA,d1=JA,h1=YA,p1=KA,m1=XA,LM=HA,b1=(function(){let r=mA(),e=Xm(1,0,0),t=Xm(0,1,0);return function(n,s,i){let o=Hm(s,i);return o<-.999999?(ia(r,e,s),_A(r)<1e-6&&ia(r,t,s),bA(r,r),ob(n,r,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(ia(r,s,i),n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=1+o,LM(n,n))}})()});var Uc,g1=p(()=>{ll();Zi();cb();Uc=class extends Ks{constructor(e=0,t=0,n=0,s=1){super(-0,-0,-0,-0),Array.isArray(e)&&arguments.length===1?this.copy(e):this.set(e,t,n,s)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,t,n,s){return this[0]=e,this[1]=t,this[2]=n,this[3]=s,this.check()}fromObject(e){return this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this.check()}fromMatrix3(e){return u1(this,e),this.check()}fromEuler(e){switch(this.identity(),e.order){case"xyz":return this.rotateX(e.x).rotateY(e.y).rotateZ(e.z);case"yxz":return this.rotateY(e.y).rotateX(e.x).rotateZ(e.z);case"zxy":return this.rotateZ(e.z).rotateX(e.x).rotateY(e.y);case"zyx":return this.rotateZ(e.z).rotateY(e.y).rotateX(e.x);case"yzx":return this.rotateY(e.y).rotateZ(e.z).rotateX(e.x);case"xzy":return this.rotateX(e.x).rotateZ(e.z).rotateY(e.y);default:throw new Error("Unknown Euler angle order")}}fromAxisRotation(e,t){return ob(this,e,t),this.check()}identity(){return t1(this),this.check()}setAxisAngle(e,t){return this.fromAxisRotation(e,t)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=Ue(e)}get y(){return this[1]}set y(e){this[1]=Ue(e)}get z(){return this[2]}set z(e){this[2]=Ue(e)}get w(){return this[3]}set w(e){this[3]=Ue(e)}len(){return p1(this)}lengthSquared(){return m1(this)}dot(e){return d1(this,e)}rotationTo(e,t){return b1(this,e,t),this.check()}add(e){return f1(this,this,e),this.check()}calculateW(){return i1(this,this),this.check()}conjugate(){return c1(this,this),this.check()}invert(){return a1(this,this),this.check()}lerp(e,t,n){return n===void 0?this.lerp(this,e,t):(h1(this,e,t,n),this.check())}multiplyRight(e){return ab(this,this,e),this.check()}multiplyLeft(e){return ab(this,e,this),this.check()}normalize(){let e=this.len(),t=e>0?1/e:0;return this[0]=this[0]*t,this[1]=this[1]*t,this[2]=this[2]*t,this[3]=this[3]*t,e===0&&(this[3]=1),this.check()}rotateX(e){return r1(this,this,e),this.check()}rotateY(e){return n1(this,this,e),this.check()}rotateZ(e){return s1(this,this,e),this.check()}scale(e){return l1(this,this,e),this.check()}slerp(e,t,n){let s,i,o;return arguments.length===2?(s=this,i=e,o=t):(s=e,i=t,o=n),o1(this,s,i,o),this.check()}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,t){return this.setAxisAngle(e,t)}premultiply(e){return this.multiplyLeft(e)}multiply(e){return this.multiplyRight(e)}}});function Il(){return aa??Uint16Array}var aa,y1=p(()=>{aa=globalThis.Float16Array});var w1=p(()=>{y1()});var x1=p(()=>{w1()});var T1=p(()=>{Zm()});var _1=p(()=>{rb()});var A1=p(()=>{cb()});var v1=p(()=>{pl()});var I1=p(()=>{oa()});var S1=p(()=>{_l()});var Sl=p(()=>{AA();FA();e1();g1();iA();x1();T1();_1();A1();v1();I1();S1()});var ke=p(()=>{"use strict";P0();Jp();Yp();W0();em();em();q_();J_();Cm();Um();Q_();Z_();eA();rA();nA();sA()});function CM(r,e="float32"){return r instanceof Date?"date-millisecond":typeof r=="number"?e:typeof r=="boolean"?"bool":typeof r=="string"?"utf8":"null"}function Vc(r){let e=ub(r);return e!=="null"?{type:e,nullable:!1}:r.length>0?(e=CM(r[0]),{type:e,nullable:!0}):{type:"null",nullable:!0}}function ub(r){if(typeof Float16Array<"u"&&r instanceof Float16Array)return"float16";switch(r.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case BigInt64Array:return"int64";case BigUint64Array:return"uint64";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}var El=p(()=>{"use strict"});function un(r){let e=r?.POSITION;if(!e||!("value"in e)||!e.value.length)return null;let t=1/0,n=1/0,s=1/0,i=-1/0,o=-1/0,a=-1/0,c=e.value,u=c.length;for(let f=0;f<u;f+=3){let l=c[f],d=c[f+1],h=c[f+2];t=l<t?l:t,n=d<n?d:n,s=h<s?h:s,i=l>i?l:i,o=d>o?d:o,a=h>a?h:a}return[[t,n,s],[i,o,a]]}var fb=p(()=>{"use strict"});function lb(r){let e=Il();return new e(r)}function Hs(r){return!!(aa&&r instanceof aa)}function db(r,e,t){Hs(r)?r[e]=t:r[e]=E1(t)}function hb(r,e){return Hs(r)?r[e]:UM(r[e])}function Pc(r){return Hs(r)?new Uint16Array(r.buffer,r.byteOffset,r.length):r}function E1(r){if(!Number.isFinite(r))return r===1/0?31744:r===-1/0?64512:32256;let e=r<0||Object.is(r,-0)?32768:0,t=Math.abs(r);if(t===0)return e;if(t>=65520)return e|31744;if(t>=65504)return e|31743;let n=Math.floor(Math.log2(t));if(n<-14)return e|Math.round(t/2**-24);let s=n+15,i=Math.round((t/2**n-1)*1024);return i===1024?e|s+1<<10:e|s<<10|i}function UM(r){let e=r&32768?-1:1,t=r>>10&31,n=r&1023;return t===0?e*n*2**-24:t===31?n?NaN:e*(1/0):e*(1+n/1024)*2**(t-15)}var L1=p(()=>{"use strict";Sl()});var Ll,pb,B1=p(()=>{"use strict";zs();Ll=new Y([new F("POSITION",new Ee(3,new F("value",new xt,!1)),!1)]),pb=new Y([...Ll.fields,new F("indices",new Ve(new F("item",new wt,!1)),!0)])});var jc=p(()=>{"use strict";L1();B1()});function F1(r){return r.type instanceof Ee?r.type.listSize:1}function mb(r,e,t){let n=VM(r,e,t);return new L([n])}function VM(r,e,t){let n=PM(r,e,t),s=n.children[0].type,i=t==="float16"&&Hs(r)?Pc(r):r,o={[te.DATA]:i},a=new k(s,0,i.length,0,o);return new k(n,0,i.length/e,0,void 0,[a])}function PM(r,e,t){let n=t||Vc(r).type,s=Ho(n);return new Ee(e,new F("value",s,!1))}var bb=p(()=>{"use strict";jc();zs();El();Sc()});function Js(r,e){switch(e){case"columnar-table":return jM(r);case"arrow-table":return GM(r);default:throw new Error(e)}}function jM(r){let e={},t=R1(r);for(let[n,s]of Object.entries(r.attributes))e[n]=s.value;return{shape:"columnar-table",schema:r.schema,data:e,topology:r.topology,indices:t?r.indices:void 0}}function GM(r,e){return M1(r.attributes,{schema:r.schema,topology:r.topology,mode:r.mode,boundingBox:r.header?.boundingBox,indices:R1(r)?r.indices:void 0})}function M1(r,e={}){let t=[],n={},s=WM(r);for(let c of s){let u=r[c],{value:f,size:l=1}=u,d=zM(f,l,u.componentType);if(n[c]=d,t.push($M(e.schema,c,d,u.componentType)),c==="POSITION"&&e.indices?.value?.length){let h=pb.fields.find(m=>m.name==="indices");n.indices=KM(e.indices.value,d.length,h.type),t.push(h)}}let i=new Y(t,XM(e)),o=n[s[0]]?.length===0?new be(i):new be(i,n);return{shape:"arrow-table",schema:Xo(o.schema),data:o,topology:e.topology||"point-list",indices:e.indices}}function zM(r,e,t){if(t==="float16"){let n=Hs(r)?Pc(r):r;if(e===1){let s=new k(new Or,0,n.length,0,{[te.DATA]:n});return new L([s])}return mb(r,e,t)}return e===1?Jr(r):mb(r,e)}function WM(r){let e=Object.keys(r),t=O1.filter(s=>s in r),n=e.filter(s=>!O1.includes(s));return[...t,...n]}function R1(r){return!!r.indices?.value?.length}function $M(r,e,t,n){if(e==="POSITION"&&qM(t)){let i=Ll.fields[0],o=r?.fields.find(c=>c.name===e);if(!o?.metadata)return i;let a=new Map(i.metadata);for(let[c,u]of Object.entries(o.metadata))a.set(c,u);return new F(i.name,i.type,i.nullable,a)}let s=r?.fields.find(i=>i.name===e);if(n==="float16"){let i=new Map(Object.entries(s?.metadata||{}));return i.set("componentType","float16"),new F(e,t.type,!1,i)}if(s&&s.type.toString()!==t.type.toString()){let i=tn(s);return new F(e,t.type,i.nullable,i.metadata)}return s?tn(s):new F(e,t.type,!1)}function qM(r){return r.type instanceof Ee&&r.type.listSize===3&&r.type.children[0].type instanceof xt}function KM(r,e,t){let n=t,s=r instanceof Uint32Array?r:Uint32Array.from(r),i=new Int32Array(e+1);e>0&&i.fill(s.length,1);let o=new Uint8Array(Math.ceil(e/8));e>0&&(o[0]=1);let a=new k(n.children[0].type,0,s.length,0,{[te.DATA]:s}),c=new k(n,0,e,Math.max(0,e-1),{[te.OFFSET]:i,[te.VALIDITY]:o},[a]);return new L([c])}function XM(r){let e={...r.schema?.metadata};return r.topology&&(e.topology||=r.topology),Number.isFinite(r.mode)&&(e.mode||=String(r.mode)),r.boundingBox&&(e.boundingBox||=JSON.stringify(r.boundingBox)),Jf(e)}var O1,D1=p(()=>{"use strict";jc();jc();zs();bb();Sc();O1=["POSITION"]});function fn(r){if(r.shape==="arrow-table")return HM(r);throw new Error(r.shape)}function HM(r){let e=r.data,t=Xo(e.schema),n=t.fields,s={},i=[];for(let f of n){let{name:l}=f;if(l==="indices")continue;let d=e.getChild(l),h=F1(d),m=e2(d,h),b=YM(f.metadata),w=b.componentType==="float16"?t2(m):m,g=i.find(x=>x.data.length===d.data.length&&s[x.name].value.constructor===w.constructor&&x.data.every((T,_)=>N1(T,d.data[_])));s[l]={value:g?s[g.name].value:w,size:h,...b},g||i.push({name:l,data:d.data})}ZM(t);let o=t.metadata.topology,a=r2(t),c=n2(e),u=s.POSITION?.transform?.type==="quantization"?JM(t)||un(s):un(s);return{schema:t,attributes:s,topology:o,mode:a,indices:c,header:{vertexCount:e.numRows,boundingBox:u??void 0}}}function JM(r){let e=r.metadata?.boundingBox;if(!e)return null;try{let t=JSON.parse(e);if(Array.isArray(t)&&t.length===2&&t.every(n=>Array.isArray(n)&&n.length===3&&n.every(s=>typeof s=="number")))return t}catch{}return null}function YM(r={}){let e={};if(r.byteOffset!==void 0&&(e.byteOffset=Number(r.byteOffset)),r.byteStride!==void 0&&(e.byteStride=Number(r.byteStride)),r.normalized!==void 0&&(e.normalized=r.normalized==="true"),r.componentType==="float16"&&(e.componentType="float16"),r["loaders.gl.transform"])try{let t=JSON.parse(r["loaders.gl.transform"]);QM(t)&&(e.transform=t)}catch{}return e}function QM(r){if(!r||typeof r!="object"||!("type"in r))return!1;let e=r;return e.type==="octahedron"?Number.isInteger(e.bits)&&e.bits>=1&&e.bits<=30:e.type==="quantization"&&Number.isInteger(e.bits)&&e.bits>=1&&e.bits<=30&&Array.isArray(e.origin)&&e.origin.every(t=>typeof t=="number")&&typeof e.range=="number"}function ZM(r){r.metadata||={},r.metadata.topology||="point-list",r.metadata.mode||="0"}function e2(r,e){if(!(r.type instanceof Ee))return r.toArray();let n=r.data[0].children[0].values.constructor,s=new n(r.length*e),i=0;for(let o of r.data){let a=o.children[0],c=o.length*e,u=a.offset||o.offset*e,f=u+c<=a.values.length?u:0,l=a.values.subarray(f,f+c);s.set(l,i),i+=c}return s}function t2(r){let e=lb(r.length);for(let t=0;t<r.length;t++)db(e,t,hb(r,t));return e}function r2(r){let e=Number(r.metadata?.mode);return Number.isFinite(e)?e:0}function n2(r){let e=r.getChild("indices");if(!e?.isValid(0))return;let t=e.data[0],n=t.valueOffsets,s=n[t.offset],i=n[t.offset+1];return{value:t.children[0].values.subarray(s,i),size:1}}function N1(r,e){let t=Object.values(e.buffers);return r.type.toString()===e.type.toString()&&r.offset===e.offset&&r.length===e.length&&r.nullCount===e.nullCount&&r.dictionary===e.dictionary&&Object.values(r.buffers).every((n,s)=>{let i=t[s];return n===i||!!(n&&i&&n.buffer===i.buffer&&n.byteOffset===i.byteOffset&&n.byteLength===i.byteLength)})&&r.children.length===e.children.length&&r.children.every((n,s)=>N1(n,e.children[s]))}var k1=p(()=>{"use strict";jc();zs();bb();Sc();fb()});function gb(r,e,t){let n=e.componentType||ub(e.value),s=t||Bl(e),i=e.size===1?n:{type:"fixed-size-list",listSize:e.size,children:[{name:"value",type:n}]};return{name:r,type:i,nullable:!1,metadata:s}}function Bl(r){let e={};return"byteOffset"in r&&(e.byteOffset=r.byteOffset.toString(10)),"byteStride"in r&&(e.byteStride=r.byteStride.toString(10)),"normalized"in r&&(e.normalized=r.normalized.toString()),r.componentType&&(e.componentType=r.componentType),r.transform&&(e["loaders.gl.transform"]=JSON.stringify(r.transform)),e}var C1=p(()=>{"use strict";El()});var Vn=p(()=>{"use strict";El();fb();D1();k1();C1()});function Fl(r,e={}){let t={};for(let s in e)s!=="value"&&(t[s]=JSON.stringify(e[s]));let n=[];for(let s in r){let i=r[s],o=s2(s,i);n.push(o)}return{fields:n,metadata:t}}function s2(r,e){let t={};for(let i in e)i!=="value"&&(t[i]=JSON.stringify(e[i]));let{type:n}=Vc(e.value);return e.size===1||e.size===void 0||(n={type:"fixed-size-list",listSize:e.size,children:[{name:"values",type:n}]}),{name:r,type:n,nullable:!1,metadata:t}}var yb=p(()=>{"use strict";Vn()});function V1(r){let e=new Tb;r.indexOf(`\r
|
|
38
|
+
`)}}e.length>0&&(yield e)}var CA=p(()=>{"use strict"});async function fb(r){let e=[];for await(let t of r)e.push(t2(t));return ib(...e)}function t2(r){if(r instanceof ArrayBuffer)return r;if(ArrayBuffer.isView(r)){let{buffer:e,byteOffset:t,byteLength:n}=r;return UA(e,t,n)}return UA(r)}function UA(r,e=0,t=r.byteLength-e){let n=new Uint8Array(r,e,t),s=new Uint8Array(n.length);return s.set(n),s.buffer}var PA=p(()=>{"use strict";ob()});function ro(r){if(r instanceof ArrayBuffer)return r;if(__(r))return db(r);let{buffer:e,byteOffset:t,byteLength:n}=r;return e instanceof ArrayBuffer&&t===0&&n===e.byteLength?e:db(e,t,n)}function db(r,e=0,t=r.byteLength-e){let n=new Uint8Array(r,e,t),s=new Uint8Array(n.length);return s.set(n),s.buffer}var VA=p(()=>{"use strict";A_()});function hb(r){return{...r,batchType:"data",length:r.data.numRows}}var jA=p(()=>{"use strict"});var JX,YX,QX,ZX,GA=p(()=>{JX=Math.PI/2,YX=Math.PI/4,QX=Math.PI/6,ZX=Math.PI*2});function zA(r,{precision:e=st.precision}={}){return r=s2(r),`${parseFloat(r.toPrecision(e))}`}function oa(r){return Array.isArray(r)||ArrayBuffer.isView(r)&&!(r instanceof DataView)}function pb(r,e,t){let n=st.EPSILON;t&&(st.EPSILON=t);try{if(r===e)return!0;if(oa(r)&&oa(e)){if(r.length!==e.length)return!1;for(let s=0;s<r.length;++s)if(!pb(r[s],e[s]))return!1;return!0}return r&&r.equals?r.equals(e):e&&e.equals?e.equals(r):typeof r=="number"&&typeof e=="number"?Math.abs(r-e)<=st.EPSILON*Math.max(1,Math.abs(r),Math.abs(e)):!1}finally{st.EPSILON=n}}function s2(r){return Math.round(r/st.EPSILON)*st.EPSILON}var eH,tH,n2,st,Pc=p(()=>{eH=1/Math.PI*180,tH=1/180*Math.PI,n2={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...n2}};st=globalThis.mathgl.config});var Ys,Tf=p(()=>{Pc();Ys=class extends Array{clone(){return new this.constructor().copy(this)}fromArray(e,t=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=e[n+t];return this.check()}toArray(e=[],t=0){for(let n=0;n<this.ELEMENTS;++n)e[t+n]=this[n];return e}toObject(e){return e}from(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}to(e){return e===this?this:oa(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toString(){return this.formatString(st)}formatString(e){let t="";for(let n=0;n<this.ELEMENTS;++n)t+=(n>0?", ":"")+zA(this[n],e);return`${e.printTypes?this.constructor.name:""}[${t}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(!pb(this[t],e[t]))return!1;return!0}exactEquals(e){if(!e||this.length!==e.length)return!1;for(let t=0;t<this.ELEMENTS;++t)if(this[t]!==e[t])return!1;return!0}negate(){for(let e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}lerp(e,t,n){if(n===void 0)return this.lerp(this,e,t);for(let s=0;s<this.ELEMENTS;++s){let i=e[s],o=typeof t=="number"?t:t[s];this[s]=i+n*(o-i)}return this.check()}min(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.min(e[t],this[t]);return this.check()}max(e){for(let t=0;t<this.ELEMENTS;++t)this[t]=Math.max(e[t],this[t]);return this.check()}clamp(e,t){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e[n]),t[n]);return this.check()}add(...e){for(let t of e)for(let n=0;n<this.ELEMENTS;++n)this[n]+=t[n];return this.check()}subtract(...e){for(let t of e)for(let n=0;n<this.ELEMENTS;++n)this[n]-=t[n];return this.check()}scale(e){if(typeof e=="number")for(let t=0;t<this.ELEMENTS;++t)this[t]*=e;else for(let t=0;t<this.ELEMENTS&&t<e.length;++t)this[t]*=e[t];return this.check()}multiplyByScalar(e){for(let t=0;t<this.ELEMENTS;++t)this[t]*=e;return this.check()}check(){if(st.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let e=this.length===this.ELEMENTS;for(let t=0;t<this.ELEMENTS;++t)e=e&&Number.isFinite(this[t]);return e}}});function i2(r,e){if(r.length!==e)return!1;for(let t=0;t<r.length;++t)if(!Number.isFinite(r[t]))return!1;return!0}function Ve(r){if(!Number.isFinite(r))throw new Error(`Invalid number ${JSON.stringify(r)}`);return r}function aa(r,e,t=""){if(st.debug&&!i2(r,e))throw new Error(`math.gl: ${t} some fields set to invalid numbers'`);return r}var no=p(()=>{Pc()});var ca,mb=p(()=>{Tf();no();Pc();ca=class extends Ys{toString(){let e="[";if(st.printRowMajor){e+="row-major:";for(let t=0;t<this.RANK;++t)for(let n=0;n<this.RANK;++n)e+=` ${this[n*this.RANK+t]}`}else{e+="column-major:";for(let t=0;t<this.ELEMENTS;++t)e+=` ${this[t]}`}return e+="]",e}getElementIndex(e,t){return t*this.RANK+e}getElement(e,t){return this[t*this.RANK+e]}setElement(e,t,n){return this[t*this.RANK+e]=Ve(n),this}getColumn(e,t=new Array(this.RANK).fill(-0)){let n=e*this.RANK;for(let s=0;s<this.RANK;++s)t[s]=this[n+s];return t}setColumn(e,t){let n=e*this.RANK;for(let s=0;s<this.RANK;++s)this[n+s]=t[s];return this}}});function bb(r,e){if(!r)throw new Error(`math.gl assertion ${e}`)}var WA=p(()=>{});var _f,$A=p(()=>{Tf();no();WA();_f=class extends Ys{get x(){return this[0]}set x(e){this[0]=Ve(e)}get y(){return this[1]}set y(e){this[1]=Ve(e)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let e=0;for(let t=0;t<this.ELEMENTS;++t)e+=this[t]*this[t];return e}magnitudeSquared(){return this.lengthSquared()}distance(e){return Math.sqrt(this.distanceSquared(e))}distanceSquared(e){let t=0;for(let n=0;n<this.ELEMENTS;++n){let s=this[n]-e[n];t+=s*s}return Ve(t)}dot(e){let t=0;for(let n=0;n<this.ELEMENTS;++n)t+=this[n]*e[n];return Ve(t)}normalize(){let e=this.magnitude();if(e!==0)for(let t=0;t<this.ELEMENTS;++t)this[t]/=e;return this.check()}multiply(...e){for(let t of e)for(let n=0;n<this.ELEMENTS;++n)this[n]*=t[n];return this.check()}divide(...e){for(let t of e)for(let n=0;n<this.ELEMENTS;++n)this[n]/=t[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(e){return this.distance(e)}distanceToSquared(e){return this.distanceSquared(e)}getComponent(e){return bb(e>=0&&e<this.ELEMENTS,"index is out of range"),Ve(this[e])}setComponent(e,t){return bb(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=t,this.check()}addVectors(e,t){return this.copy(e).add(t)}subVectors(e,t){return this.copy(e).subtract(t)}multiplyVectors(e,t){return this.copy(e).multiply(t)}addScaledVector(e,t){for(let n=0;n<this.ELEMENTS;++n)this[n]+=e[n]*t;return this.check()}}});var Af,bH,qA=p(()=>{Af=typeof Float32Array<"u"?Float32Array:Array,bH=Math.PI/180});function KA(r,e,t){let n=e[0],s=e[1];return r[0]=t[0]*n+t[3]*s+t[6],r[1]=t[1]*n+t[4]*s+t[7],r}function XA(r,e,t){let n=e[0],s=e[1];return r[0]=t[0]*n+t[4]*s+t[12],r[1]=t[1]*n+t[5]*s+t[13],r}var vf=p(()=>{});function HA(r,e,t){let n=e[0],s=e[1],i=t[3]*n+t[7]*s||1;return r[0]=(t[0]*n+t[4]*s)/i,r[1]=(t[1]*n+t[5]*s)/i,r}function If(r,e,t){let n=e[0],s=e[1],i=e[2],o=t[3]*n+t[7]*s+t[11]*i||1;return r[0]=(t[0]*n+t[4]*s+t[8]*i)/o,r[1]=(t[1]*n+t[5]*s+t[9]*i)/o,r[2]=(t[2]*n+t[6]*s+t[10]*i)/o,r}function JA(r,e,t){let n=e[0],s=e[1];return r[0]=t[0]*n+t[2]*s,r[1]=t[1]*n+t[3]*s,r[2]=e[2],r}function YA(r,e,t){let n=e[0],s=e[1],i=e[2];return r[0]=t[0]*n+t[3]*s+t[6]*i,r[1]=t[1]*n+t[4]*s+t[7]*i,r[2]=t[2]*n+t[5]*s+t[8]*i,r[3]=e[3],r}var Sf=p(()=>{});function QA(){let r=new Af(3);return Af!==Float32Array&&(r[0]=0,r[1]=0,r[2]=0),r}function a2(r){let e=r[0],t=r[1],n=r[2];return Math.sqrt(e*e+t*t+n*n)}function gb(r,e,t){let n=new Af(3);return n[0]=r,n[1]=e,n[2]=t,n}function ZA(r,e){let t=e[0],n=e[1],s=e[2],i=t*t+n*n+s*s;return i>0&&(i=1/Math.sqrt(i)),r[0]=e[0]*i,r[1]=e[1]*i,r[2]=e[2]*i,r}function yb(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]}function ua(r,e,t){let n=e[0],s=e[1],i=e[2],o=t[0],a=t[1],c=t[2];return r[0]=s*c-i*a,r[1]=i*o-n*c,r[2]=n*a-s*o,r}function Ef(r,e,t){let n=e[0],s=e[1],i=e[2],o=t[3]*n+t[7]*s+t[11]*i+t[15];return o=o||1,r[0]=(t[0]*n+t[4]*s+t[8]*i+t[12])/o,r[1]=(t[1]*n+t[5]*s+t[9]*i+t[13])/o,r[2]=(t[2]*n+t[6]*s+t[10]*i+t[14])/o,r}function Lf(r,e,t){let n=e[0],s=e[1],i=e[2];return r[0]=n*t[0]+s*t[3]+i*t[6],r[1]=n*t[1]+s*t[4]+i*t[7],r[2]=n*t[2]+s*t[5]+i*t[8],r}function e1(r,e,t){let n=t[0],s=t[1],i=t[2],o=t[3],a=e[0],c=e[1],u=e[2],l=s*u-i*c,f=i*a-n*u,d=n*c-s*a,h=s*d-i*f,m=i*l-n*d,b=n*f-s*l,g=o*2;return l*=g,f*=g,d*=g,h*=2,m*=2,b*=2,r[0]=a+l+h,r[1]=c+f+m,r[2]=u+d+b,r}function t1(r,e,t,n){let s=[],i=[];return s[0]=e[0]-t[0],s[1]=e[1]-t[1],s[2]=e[2]-t[2],i[0]=s[0],i[1]=s[1]*Math.cos(n)-s[2]*Math.sin(n),i[2]=s[1]*Math.sin(n)+s[2]*Math.cos(n),r[0]=i[0]+t[0],r[1]=i[1]+t[1],r[2]=i[2]+t[2],r}function r1(r,e,t,n){let s=[],i=[];return s[0]=e[0]-t[0],s[1]=e[1]-t[1],s[2]=e[2]-t[2],i[0]=s[2]*Math.sin(n)+s[0]*Math.cos(n),i[1]=s[1],i[2]=s[2]*Math.cos(n)-s[0]*Math.sin(n),r[0]=i[0]+t[0],r[1]=i[1]+t[1],r[2]=i[2]+t[2],r}function n1(r,e,t,n){let s=[],i=[];return s[0]=e[0]-t[0],s[1]=e[1]-t[1],s[2]=e[2]-t[2],i[0]=s[0]*Math.cos(n)-s[1]*Math.sin(n),i[1]=s[0]*Math.sin(n)+s[1]*Math.cos(n),i[2]=s[2],r[0]=i[0]+t[0],r[1]=i[1]+t[1],r[2]=i[2]+t[2],r}function s1(r,e){let t=r[0],n=r[1],s=r[2],i=e[0],o=e[1],a=e[2],c=Math.sqrt((t*t+n*n+s*s)*(i*i+o*o+a*a)),u=c&&yb(r,e)/c;return Math.acos(Math.min(Math.max(u,-1),1))}var i1,la=p(()=>{qA();i1=a2});var wb,Bf,jc,o1=p(()=>{$A();Pc();no();la();Sf();wb=[0,0,0],jc=class r extends _f{static get ZERO(){return Bf||(Bf=new r(0,0,0),Object.freeze(Bf)),Bf}constructor(e=0,t=0,n=0){super(-0,-0,-0),arguments.length===1&&oa(e)?this.copy(e):(st.debug&&(Ve(e),Ve(t),Ve(n)),this[0]=e,this[1]=t,this[2]=n)}set(e,t,n){return this[0]=e,this[1]=t,this[2]=n,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}fromObject(e){return st.debug&&(Ve(e.x),Ve(e.y),Ve(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}get ELEMENTS(){return 3}get z(){return this[2]}set z(e){this[2]=Ve(e)}angle(e){return s1(this,e)}cross(e){return ua(this,this,e),this.check()}rotateX({radians:e,origin:t=wb}){return t1(this,this,t,e),this.check()}rotateY({radians:e,origin:t=wb}){return r1(this,this,t,e),this.check()}rotateZ({radians:e,origin:t=wb}){return n1(this,this,t,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return Ef(this,this,e),this.check()}transformAsVector(e){return If(this,this,e),this.check()}transformByMatrix3(e){return Lf(this,this,e),this.check()}transformByMatrix2(e){return JA(this,this,e),this.check()}transformByQuaternion(e){return e1(this,this,e),this.check()}}});function a1(r,e){if(r===e){let t=e[1],n=e[2],s=e[5];r[1]=e[3],r[2]=e[6],r[3]=t,r[5]=e[7],r[6]=n,r[7]=s}else r[0]=e[0],r[1]=e[3],r[2]=e[6],r[3]=e[1],r[4]=e[4],r[5]=e[7],r[6]=e[2],r[7]=e[5],r[8]=e[8];return r}function c1(r,e){let t=e[0],n=e[1],s=e[2],i=e[3],o=e[4],a=e[5],c=e[6],u=e[7],l=e[8],f=l*o-a*u,d=-l*i+a*c,h=u*i-o*c,m=t*f+n*d+s*h;return m?(m=1/m,r[0]=f*m,r[1]=(-l*n+s*u)*m,r[2]=(a*n-s*o)*m,r[3]=d*m,r[4]=(l*t-s*c)*m,r[5]=(-a*t+s*i)*m,r[6]=h*m,r[7]=(-u*t+n*c)*m,r[8]=(o*t-n*i)*m,r):null}function u1(r){let e=r[0],t=r[1],n=r[2],s=r[3],i=r[4],o=r[5],a=r[6],c=r[7],u=r[8];return e*(u*i-o*c)+t*(-u*s+o*a)+n*(c*s-i*a)}function xb(r,e,t){let n=e[0],s=e[1],i=e[2],o=e[3],a=e[4],c=e[5],u=e[6],l=e[7],f=e[8],d=t[0],h=t[1],m=t[2],b=t[3],g=t[4],y=t[5],x=t[6],T=t[7],_=t[8];return r[0]=d*n+h*o+m*u,r[1]=d*s+h*a+m*l,r[2]=d*i+h*c+m*f,r[3]=b*n+g*o+y*u,r[4]=b*s+g*a+y*l,r[5]=b*i+g*c+y*f,r[6]=x*n+T*o+_*u,r[7]=x*s+T*a+_*l,r[8]=x*i+T*c+_*f,r}function l1(r,e,t){let n=e[0],s=e[1],i=e[2],o=e[3],a=e[4],c=e[5],u=e[6],l=e[7],f=e[8],d=t[0],h=t[1];return r[0]=n,r[1]=s,r[2]=i,r[3]=o,r[4]=a,r[5]=c,r[6]=d*n+h*o+u,r[7]=d*s+h*a+l,r[8]=d*i+h*c+f,r}function f1(r,e,t){let n=e[0],s=e[1],i=e[2],o=e[3],a=e[4],c=e[5],u=e[6],l=e[7],f=e[8],d=Math.sin(t),h=Math.cos(t);return r[0]=h*n+d*o,r[1]=h*s+d*a,r[2]=h*i+d*c,r[3]=h*o-d*n,r[4]=h*a-d*s,r[5]=h*c-d*i,r[6]=u,r[7]=l,r[8]=f,r}function Tb(r,e,t){let n=t[0],s=t[1];return r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=s*e[3],r[4]=s*e[4],r[5]=s*e[5],r[6]=e[6],r[7]=e[7],r[8]=e[8],r}function d1(r,e){let t=e[0],n=e[1],s=e[2],i=e[3],o=t+t,a=n+n,c=s+s,u=t*o,l=n*o,f=n*a,d=s*o,h=s*a,m=s*c,b=i*o,g=i*a,y=i*c;return r[0]=1-f-m,r[3]=l-y,r[6]=d+g,r[1]=l+y,r[4]=1-u-m,r[7]=h-b,r[2]=d-g,r[5]=h+b,r[8]=1-u-f,r}var _b=p(()=>{});function l2(){return Ff||(Ff=new zn([0,0,0,0,0,0,0,0,0]),Object.freeze(Ff)),Ff}function f2(){return Of||(Of=new zn,Object.freeze(Of)),Of}var Ab,u2,zn,Ff,Of,h1=p(()=>{mb();no();Sf();_b();vf();la();(function(r){r[r.COL0ROW0=0]="COL0ROW0",r[r.COL0ROW1=1]="COL0ROW1",r[r.COL0ROW2=2]="COL0ROW2",r[r.COL1ROW0=3]="COL1ROW0",r[r.COL1ROW1=4]="COL1ROW1",r[r.COL1ROW2=5]="COL1ROW2",r[r.COL2ROW0=6]="COL2ROW0",r[r.COL2ROW1=7]="COL2ROW1",r[r.COL2ROW2=8]="COL2ROW2"})(Ab||(Ab={}));u2=Object.freeze([1,0,0,0,1,0,0,0,1]),zn=class extends ca{static get IDENTITY(){return f2()}static get ZERO(){return l2()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return Ab}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this.check()}identity(){return this.copy(u2)}fromObject(e){return this.check()}fromQuaternion(e){return d1(this,e),this.check()}fromMatrix4(e){return this.set(e[0],e[1],e[2],e[4],e[5],e[6],e[8],e[9],e[10])}set(e,t,n,s,i,o,a,c,u){return this[0]=e,this[1]=t,this[2]=n,this[3]=s,this[4]=i,this[5]=o,this[6]=a,this[7]=c,this[8]=u,this.check()}setRowMajor(e,t,n,s,i,o,a,c,u){return this[0]=e,this[1]=s,this[2]=a,this[3]=t,this[4]=i,this[5]=c,this[6]=n,this[7]=o,this[8]=u,this.check()}determinant(){return u1(this)}transpose(){return a1(this,this),this.check()}invert(){return c1(this,this),this.check()}multiplyLeft(e){return xb(this,e,this),this.check()}multiplyRight(e){return xb(this,this,e),this.check()}rotate(e){return f1(this,this,e),this.check()}scale(e){return Array.isArray(e)?Tb(this,this,e):Tb(this,this,[e,e]),this.check()}translate(e){return l1(this,this,e),this.check()}transform(e,t){let n;switch(e.length){case 2:n=KA(t||[-0,-0],e,this);break;case 3:n=Lf(t||[-0,-0,-0],e,this);break;case 4:n=YA(t||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return aa(n,e.length),n}},Of=null});function d2(r){return r[0]=1,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=1,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function p1(r,e){if(r===e){let t=e[1],n=e[2],s=e[3],i=e[6],o=e[7],a=e[11];r[1]=e[4],r[2]=e[8],r[3]=e[12],r[4]=t,r[6]=e[9],r[7]=e[13],r[8]=n,r[9]=i,r[11]=e[14],r[12]=s,r[13]=o,r[14]=a}else r[0]=e[0],r[1]=e[4],r[2]=e[8],r[3]=e[12],r[4]=e[1],r[5]=e[5],r[6]=e[9],r[7]=e[13],r[8]=e[2],r[9]=e[6],r[10]=e[10],r[11]=e[14],r[12]=e[3],r[13]=e[7],r[14]=e[11],r[15]=e[15];return r}function m1(r,e){let t=e[0],n=e[1],s=e[2],i=e[3],o=e[4],a=e[5],c=e[6],u=e[7],l=e[8],f=e[9],d=e[10],h=e[11],m=e[12],b=e[13],g=e[14],y=e[15],x=t*a-n*o,T=t*c-s*o,_=t*u-i*o,v=n*c-s*a,I=n*u-i*a,N=s*u-i*c,K=l*b-f*m,ne=l*g-d*m,be=l*y-h*m,Re=f*g-d*b,ke=f*y-h*b,ue=d*y-h*g,oe=x*ue-T*ke+_*Re+v*be-I*ne+N*K;return oe?(oe=1/oe,r[0]=(a*ue-c*ke+u*Re)*oe,r[1]=(s*ke-n*ue-i*Re)*oe,r[2]=(b*N-g*I+y*v)*oe,r[3]=(d*I-f*N-h*v)*oe,r[4]=(c*be-o*ue-u*ne)*oe,r[5]=(t*ue-s*be+i*ne)*oe,r[6]=(g*_-m*N-y*T)*oe,r[7]=(l*N-d*_+h*T)*oe,r[8]=(o*ke-a*be+u*K)*oe,r[9]=(n*be-t*ke-i*K)*oe,r[10]=(m*I-b*_+y*x)*oe,r[11]=(f*_-l*I-h*x)*oe,r[12]=(a*ne-o*Re-c*K)*oe,r[13]=(t*Re-n*ne+s*K)*oe,r[14]=(b*T-m*v-g*x)*oe,r[15]=(l*v-f*T+d*x)*oe,r):null}function b1(r){let e=r[0],t=r[1],n=r[2],s=r[3],i=r[4],o=r[5],a=r[6],c=r[7],u=r[8],l=r[9],f=r[10],d=r[11],h=r[12],m=r[13],b=r[14],g=r[15],y=e*o-t*i,x=e*a-n*i,T=t*a-n*o,_=u*m-l*h,v=u*b-f*h,I=l*b-f*m,N=e*I-t*v+n*_,K=i*I-o*v+a*_,ne=u*T-l*x+f*y,be=h*T-m*x+b*y;return c*N-s*K+g*ne-d*be}function vb(r,e,t){let n=e[0],s=e[1],i=e[2],o=e[3],a=e[4],c=e[5],u=e[6],l=e[7],f=e[8],d=e[9],h=e[10],m=e[11],b=e[12],g=e[13],y=e[14],x=e[15],T=t[0],_=t[1],v=t[2],I=t[3];return r[0]=T*n+_*a+v*f+I*b,r[1]=T*s+_*c+v*d+I*g,r[2]=T*i+_*u+v*h+I*y,r[3]=T*o+_*l+v*m+I*x,T=t[4],_=t[5],v=t[6],I=t[7],r[4]=T*n+_*a+v*f+I*b,r[5]=T*s+_*c+v*d+I*g,r[6]=T*i+_*u+v*h+I*y,r[7]=T*o+_*l+v*m+I*x,T=t[8],_=t[9],v=t[10],I=t[11],r[8]=T*n+_*a+v*f+I*b,r[9]=T*s+_*c+v*d+I*g,r[10]=T*i+_*u+v*h+I*y,r[11]=T*o+_*l+v*m+I*x,T=t[12],_=t[13],v=t[14],I=t[15],r[12]=T*n+_*a+v*f+I*b,r[13]=T*s+_*c+v*d+I*g,r[14]=T*i+_*u+v*h+I*y,r[15]=T*o+_*l+v*m+I*x,r}function g1(r,e,t){let n=t[0],s=t[1],i=t[2],o,a,c,u,l,f,d,h,m,b,g,y;return e===r?(r[12]=e[0]*n+e[4]*s+e[8]*i+e[12],r[13]=e[1]*n+e[5]*s+e[9]*i+e[13],r[14]=e[2]*n+e[6]*s+e[10]*i+e[14],r[15]=e[3]*n+e[7]*s+e[11]*i+e[15]):(o=e[0],a=e[1],c=e[2],u=e[3],l=e[4],f=e[5],d=e[6],h=e[7],m=e[8],b=e[9],g=e[10],y=e[11],r[0]=o,r[1]=a,r[2]=c,r[3]=u,r[4]=l,r[5]=f,r[6]=d,r[7]=h,r[8]=m,r[9]=b,r[10]=g,r[11]=y,r[12]=o*n+l*s+m*i+e[12],r[13]=a*n+f*s+b*i+e[13],r[14]=c*n+d*s+g*i+e[14],r[15]=u*n+h*s+y*i+e[15]),r}function y1(r,e,t){let n=t[0],s=t[1],i=t[2];return r[0]=e[0]*n,r[1]=e[1]*n,r[2]=e[2]*n,r[3]=e[3]*n,r[4]=e[4]*s,r[5]=e[5]*s,r[6]=e[6]*s,r[7]=e[7]*s,r[8]=e[8]*i,r[9]=e[9]*i,r[10]=e[10]*i,r[11]=e[11]*i,r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15],r}function w1(r,e,t,n){let s=n[0],i=n[1],o=n[2],a=Math.sqrt(s*s+i*i+o*o),c,u,l,f,d,h,m,b,g,y,x,T,_,v,I,N,K,ne,be,Re,ke,ue,oe,xe;return a<1e-6?null:(a=1/a,s*=a,i*=a,o*=a,u=Math.sin(t),c=Math.cos(t),l=1-c,f=e[0],d=e[1],h=e[2],m=e[3],b=e[4],g=e[5],y=e[6],x=e[7],T=e[8],_=e[9],v=e[10],I=e[11],N=s*s*l+c,K=i*s*l+o*u,ne=o*s*l-i*u,be=s*i*l-o*u,Re=i*i*l+c,ke=o*i*l+s*u,ue=s*o*l+i*u,oe=i*o*l-s*u,xe=o*o*l+c,r[0]=f*N+b*K+T*ne,r[1]=d*N+g*K+_*ne,r[2]=h*N+y*K+v*ne,r[3]=m*N+x*K+I*ne,r[4]=f*be+b*Re+T*ke,r[5]=d*be+g*Re+_*ke,r[6]=h*be+y*Re+v*ke,r[7]=m*be+x*Re+I*ke,r[8]=f*ue+b*oe+T*xe,r[9]=d*ue+g*oe+_*xe,r[10]=h*ue+y*oe+v*xe,r[11]=m*ue+x*oe+I*xe,e!==r&&(r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r)}function x1(r,e,t){let n=Math.sin(t),s=Math.cos(t),i=e[4],o=e[5],a=e[6],c=e[7],u=e[8],l=e[9],f=e[10],d=e[11];return e!==r&&(r[0]=e[0],r[1]=e[1],r[2]=e[2],r[3]=e[3],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[4]=i*s+u*n,r[5]=o*s+l*n,r[6]=a*s+f*n,r[7]=c*s+d*n,r[8]=u*s-i*n,r[9]=l*s-o*n,r[10]=f*s-a*n,r[11]=d*s-c*n,r}function T1(r,e,t){let n=Math.sin(t),s=Math.cos(t),i=e[0],o=e[1],a=e[2],c=e[3],u=e[8],l=e[9],f=e[10],d=e[11];return e!==r&&(r[4]=e[4],r[5]=e[5],r[6]=e[6],r[7]=e[7],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[0]=i*s-u*n,r[1]=o*s-l*n,r[2]=a*s-f*n,r[3]=c*s-d*n,r[8]=i*n+u*s,r[9]=o*n+l*s,r[10]=a*n+f*s,r[11]=c*n+d*s,r}function _1(r,e,t){let n=Math.sin(t),s=Math.cos(t),i=e[0],o=e[1],a=e[2],c=e[3],u=e[4],l=e[5],f=e[6],d=e[7];return e!==r&&(r[8]=e[8],r[9]=e[9],r[10]=e[10],r[11]=e[11],r[12]=e[12],r[13]=e[13],r[14]=e[14],r[15]=e[15]),r[0]=i*s+u*n,r[1]=o*s+l*n,r[2]=a*s+f*n,r[3]=c*s+d*n,r[4]=u*s-i*n,r[5]=l*s-o*n,r[6]=f*s-a*n,r[7]=d*s-c*n,r}function A1(r,e){let t=e[0],n=e[1],s=e[2],i=e[3],o=t+t,a=n+n,c=s+s,u=t*o,l=n*o,f=n*a,d=s*o,h=s*a,m=s*c,b=i*o,g=i*a,y=i*c;return r[0]=1-f-m,r[1]=l+y,r[2]=d-g,r[3]=0,r[4]=l-y,r[5]=1-u-m,r[6]=h+b,r[7]=0,r[8]=d+g,r[9]=h-b,r[10]=1-u-f,r[11]=0,r[12]=0,r[13]=0,r[14]=0,r[15]=1,r}function v1(r,e,t,n,s,i,o){let a=1/(t-e),c=1/(s-n),u=1/(i-o);return r[0]=i*2*a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=i*2*c,r[6]=0,r[7]=0,r[8]=(t+e)*a,r[9]=(s+n)*c,r[10]=(o+i)*u,r[11]=-1,r[12]=0,r[13]=0,r[14]=o*i*2*u,r[15]=0,r}function h2(r,e,t,n,s){let i=1/Math.tan(e/2);if(r[0]=i/t,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=i,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[11]=-1,r[12]=0,r[13]=0,r[15]=0,s!=null&&s!==1/0){let o=1/(n-s);r[10]=(s+n)*o,r[14]=2*s*n*o}else r[10]=-1,r[14]=-2*n;return r}function p2(r,e,t,n,s,i,o){let a=1/(e-t),c=1/(n-s),u=1/(i-o);return r[0]=-2*a,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=-2*c,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=2*u,r[11]=0,r[12]=(e+t)*a,r[13]=(s+n)*c,r[14]=(o+i)*u,r[15]=1,r}function E1(r,e,t,n){let s,i,o,a,c,u,l,f,d,h,m=e[0],b=e[1],g=e[2],y=n[0],x=n[1],T=n[2],_=t[0],v=t[1],I=t[2];return Math.abs(m-_)<1e-6&&Math.abs(b-v)<1e-6&&Math.abs(g-I)<1e-6?d2(r):(f=m-_,d=b-v,h=g-I,s=1/Math.sqrt(f*f+d*d+h*h),f*=s,d*=s,h*=s,i=x*h-T*d,o=T*f-y*h,a=y*d-x*f,s=Math.sqrt(i*i+o*o+a*a),s?(s=1/s,i*=s,o*=s,a*=s):(i=0,o=0,a=0),c=d*a-h*o,u=h*i-f*a,l=f*o-d*i,s=Math.sqrt(c*c+u*u+l*l),s?(s=1/s,c*=s,u*=s,l*=s):(c=0,u=0,l=0),r[0]=i,r[1]=c,r[2]=f,r[3]=0,r[4]=o,r[5]=u,r[6]=d,r[7]=0,r[8]=a,r[9]=l,r[10]=h,r[11]=0,r[12]=-(i*m+o*b+a*g),r[13]=-(c*m+u*b+l*g),r[14]=-(f*m+d*b+h*g),r[15]=1,r)}function Ib(r){if(r.length!==16||Array.from(r).some(s=>!Number.isFinite(s))||r[3]!==0||r[7]!==0||r[11]!==0||r[15]!==1)throw new RangeError("Expected a finite affine matrix");let e=[Math.hypot(r[0],r[1],r[2]),Math.hypot(r[4],r[5],r[6]),Math.hypot(r[8],r[9],r[10])];if(e.some(s=>s===0||!Number.isFinite(s)))throw new RangeError("Singular transform");let t=Array.from({length:9},(s,i)=>r[Math.floor(i/3)*4+i%3]/e[Math.floor(i/3)]);for(let[s,i]of[[0,3],[0,6],[3,6]])if(Math.abs(t[s]*t[i]+t[s+1]*t[i+1]+t[s+2]*t[i+2])>1e-7)throw new RangeError("Sheared transforms do not have a TRS decomposition");if(t[0]*(t[4]*t[8]-t[5]*t[7])-t[3]*(t[1]*t[8]-t[2]*t[7])+t[6]*(t[1]*t[5]-t[2]*t[4])<0){e[0]=-e[0];for(let s=0;s<3;s++)t[s]=-t[s]}return{rotation:t,scale:e,translation:[r[12],r[13],r[14]]}}var I1,S1,Mf=p(()=>{I1=h2;S1=p2});function L1(r,e,t){return r[0]=e[0]+t[0],r[1]=e[1]+t[1],r[2]=e[2]+t[2],r[3]=e[3]+t[3],r}function B1(r,e,t){return r[0]=e[0]*t,r[1]=e[1]*t,r[2]=e[2]*t,r[3]=e[3]*t,r}function F1(r){let e=r[0],t=r[1],n=r[2],s=r[3];return Math.sqrt(e*e+t*t+n*n+s*s)}function O1(r){let e=r[0],t=r[1],n=r[2],s=r[3];return e*e+t*t+n*n+s*s}function M1(r,e){let t=e[0],n=e[1],s=e[2],i=e[3],o=t*t+n*n+s*s+i*i;return o>0&&(o=1/Math.sqrt(o)),r[0]=t*o,r[1]=n*o,r[2]=s*o,r[3]=i*o,r}function D1(r,e){return r[0]*e[0]+r[1]*e[1]+r[2]*e[2]+r[3]*e[3]}function R1(r,e,t,n){let s=e[0],i=e[1],o=e[2],a=e[3];return r[0]=s+n*(t[0]-s),r[1]=i+n*(t[1]-i),r[2]=o+n*(t[2]-o),r[3]=a+n*(t[3]-a),r}function k1(r,e,t){let n=e[0],s=e[1],i=e[2],o=e[3];return r[0]=t[0]*n+t[4]*s+t[8]*i+t[12]*o,r[1]=t[1]*n+t[5]*s+t[9]*i+t[13]*o,r[2]=t[2]*n+t[6]*s+t[10]*i+t[14]*o,r[3]=t[3]*n+t[7]*s+t[11]*i+t[15]*o,r}var Df=p(()=>{});function w2(){return Rf||(Rf=new Qs([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Rf)),Rf}function x2(){return kf||(kf=new Qs,Object.freeze(kf)),kf}function N1(r){if(r>Math.PI*2)throw Error("expected radians")}function T2(r,e,t,n,s,i){let o=2*i/(t-e),a=2*i/(s-n),c=(t+e)/(t-e),u=(s+n)/(s-n),l=-1,f=-1,d=-2*i;return r[0]=o,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=c,r[9]=u,r[10]=l,r[11]=f,r[12]=0,r[13]=0,r[14]=d,r[15]=0,r}var Lb,b2,g2,Sb,Eb,y2,Qs,Rf,kf,C1=p(()=>{mb();Mf();no();Sf();Mf();vf();la();Df();(function(r){r[r.COL0ROW0=0]="COL0ROW0",r[r.COL0ROW1=1]="COL0ROW1",r[r.COL0ROW2=2]="COL0ROW2",r[r.COL0ROW3=3]="COL0ROW3",r[r.COL1ROW0=4]="COL1ROW0",r[r.COL1ROW1=5]="COL1ROW1",r[r.COL1ROW2=6]="COL1ROW2",r[r.COL1ROW3=7]="COL1ROW3",r[r.COL2ROW0=8]="COL2ROW0",r[r.COL2ROW1=9]="COL2ROW1",r[r.COL2ROW2=10]="COL2ROW2",r[r.COL2ROW3=11]="COL2ROW3",r[r.COL3ROW0=12]="COL3ROW0",r[r.COL3ROW1=13]="COL3ROW1",r[r.COL3ROW2=14]="COL3ROW2",r[r.COL3ROW3=15]="COL3ROW3"})(Lb||(Lb={}));b2=45*Math.PI/180,g2=1,Sb=.1,Eb=500,y2=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Qs=class extends ca{static get IDENTITY(){return x2()}static get ZERO(){return w2()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return Lb}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}set(e,t,n,s,i,o,a,c,u,l,f,d,h,m,b,g){return this[0]=e,this[1]=t,this[2]=n,this[3]=s,this[4]=i,this[5]=o,this[6]=a,this[7]=c,this[8]=u,this[9]=l,this[10]=f,this[11]=d,this[12]=h,this[13]=m,this[14]=b,this[15]=g,this.check()}setRowMajor(e,t,n,s,i,o,a,c,u,l,f,d,h,m,b,g){return this[0]=e,this[1]=i,this[2]=u,this[3]=h,this[4]=t,this[5]=o,this[6]=l,this[7]=m,this[8]=n,this[9]=a,this[10]=f,this[11]=b,this[12]=s,this[13]=c,this[14]=d,this[15]=g,this.check()}toRowMajor(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}identity(){return this.copy(y2)}fromObject(e){return this.check()}fromQuaternion(e){return A1(this,e),this.check()}fromMatrix3(e){return this.set(e[0],e[1],e[2],0,e[3],e[4],e[5],0,e[6],e[7],e[8],0,0,0,0,1)}frustum(e){let{left:t,right:n,bottom:s,top:i,near:o=Sb,far:a=Eb}=e;return a===1/0?T2(this,t,n,s,i,o):v1(this,t,n,s,i,o,a),this.check()}lookAt(e){let{eye:t,center:n=[0,0,0],up:s=[0,1,0]}=e;return E1(this,t,n,s),this.check()}ortho(e){let{left:t,right:n,bottom:s,top:i,near:o=Sb,far:a=Eb}=e;return S1(this,t,n,s,i,o,a),this.check()}orthographic(e){let{fovy:t=b2,aspect:n=g2,focalDistance:s=1,near:i=Sb,far:o=Eb}=e;N1(t);let a=t/2,c=s*Math.tan(a),u=c*n;return this.ortho({left:-u,right:u,bottom:-c,top:c,near:i,far:o})}perspective(e){let{fovy:t=45*Math.PI/180,aspect:n=1,near:s=.1,far:i=500}=e;return N1(t),I1(this,t,n,s,i),this.check()}determinant(){return b1(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e,t){let{rotation:n,scale:s}=Ib(this);if(e=e||new Array(16),t)for(let i=0;i<3;i++)t[i]=s[i];for(let i=0;i<16;i++)e[i]=0;for(let i=0;i<9;i++)e[Math.floor(i/3)*4+i%3]=n[i];return e[15]=1,e}getRotationMatrix3(e,t){let{rotation:n,scale:s}=Ib(this);if(e=e||new Array(9),t)for(let i=0;i<3;i++)t[i]=s[i];for(let i=0;i<9;i++)e[i]=n[i];return e}transpose(){return p1(this,this),this.check()}invert(){return m1(this,this),this.check()}multiplyLeft(e){return vb(this,e,this),this.check()}multiplyRight(e){return vb(this,this,e),this.check()}rotateX(e){return x1(this,this,e),this.check()}rotateY(e){return T1(this,this,e),this.check()}rotateZ(e){return _1(this,this,e),this.check()}rotateXYZ(e){return this.rotateX(e[0]).rotateY(e[1]).rotateZ(e[2])}rotateAxis(e,t){return w1(this,this,e,t),this.check()}scale(e){return y1(this,this,Array.isArray(e)?e:[e,e,e]),this.check()}translate(e){return g1(this,this,e),this.check()}transform(e,t){return e.length===4?(t=k1(t||[-0,-0,-0,-0],e,this),aa(t,4),t):this.transformAsPoint(e,t)}transformAsPoint(e,t){let{length:n}=e,s;switch(n){case 2:s=XA(t||[-0,-0],e,this);break;case 3:s=Ef(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return aa(s,e.length),s}transformAsVector(e,t){let n;switch(e.length){case 2:n=HA(t||[-0,-0],e,this);break;case 3:n=If(t||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return aa(n,e.length),n}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,t,n){return this.identity().translate([e,t,n])}}});function U1(r){return r[0]=0,r[1]=0,r[2]=0,r[3]=1,r}function Bb(r,e,t){t=t*.5;let n=Math.sin(t);return r[0]=n*e[0],r[1]=n*e[1],r[2]=n*e[2],r[3]=Math.cos(t),r}function Fb(r,e,t){let n=e[0],s=e[1],i=e[2],o=e[3],a=t[0],c=t[1],u=t[2],l=t[3];return r[0]=n*l+o*a+s*u-i*c,r[1]=s*l+o*c+i*a-n*u,r[2]=i*l+o*u+n*c-s*a,r[3]=o*l-n*a-s*c-i*u,r}function P1(r,e,t){t*=.5;let n=e[0],s=e[1],i=e[2],o=e[3],a=Math.sin(t),c=Math.cos(t);return r[0]=n*c+o*a,r[1]=s*c+i*a,r[2]=i*c-s*a,r[3]=o*c-n*a,r}function V1(r,e,t){t*=.5;let n=e[0],s=e[1],i=e[2],o=e[3],a=Math.sin(t),c=Math.cos(t);return r[0]=n*c-i*a,r[1]=s*c+o*a,r[2]=i*c+n*a,r[3]=o*c-s*a,r}function j1(r,e,t){t*=.5;let n=e[0],s=e[1],i=e[2],o=e[3],a=Math.sin(t),c=Math.cos(t);return r[0]=n*c+s*a,r[1]=s*c-n*a,r[2]=i*c+o*a,r[3]=o*c-i*a,r}function G1(r,e){let t=e[0],n=e[1],s=e[2];return r[0]=t,r[1]=n,r[2]=s,r[3]=Math.sqrt(Math.abs(1-t*t-n*n-s*s)),r}function Ob(r,e,t,n){let s=e[0],i=e[1],o=e[2],a=e[3],c=t[0],u=t[1],l=t[2],f=t[3],d,h,m,b,g;return d=s*c+i*u+o*l+a*f,d<0&&(d=-d,c=-c,u=-u,l=-l,f=-f),1-d>1e-6?(h=Math.acos(d),g=Math.sin(h),m=Math.sin((1-n)*h)/g,b=Math.sin(n*h)/g):(m=1-n,b=n),r[0]=m*s+b*c,r[1]=m*i+b*u,r[2]=m*o+b*l,r[3]=m*a+b*f,r}function z1(r,e){let t=e[0],n=e[1],s=e[2],i=e[3],o=t*t+n*n+s*s+i*i,a=o?1/o:0;return r[0]=-t*a,r[1]=-n*a,r[2]=-s*a,r[3]=i*a,r}function W1(r,e){return r[0]=-e[0],r[1]=-e[1],r[2]=-e[2],r[3]=e[3],r}function $1(r,e){let t=e[0]+e[4]+e[8],n;if(t>0)n=Math.sqrt(t+1),r[3]=.5*n,n=.5/n,r[0]=(e[5]-e[7])*n,r[1]=(e[6]-e[2])*n,r[2]=(e[1]-e[3])*n;else{let s=0;e[4]>e[0]&&(s=1),e[8]>e[s*3+s]&&(s=2);let i=(s+1)%3,o=(s+2)%3;n=Math.sqrt(e[s*3+s]-e[i*3+i]-e[o*3+o]+1),r[s]=.5*n,n=.5/n,r[3]=(e[i*3+o]-e[o*3+i])*n,r[i]=(e[i*3+s]+e[s*3+i])*n,r[o]=(e[o*3+s]+e[s*3+o])*n}return r}function Z1(r,e,t,n){if(e.length!==4||t.length!==4||[...Array.from(e),...Array.from(t),n].some(d=>!Number.isFinite(d)))throw new RangeError("Expected finite quaternions and step");if(e.length!==4||n<0)throw new RangeError("Expected quaternions and a nonnegative step");let s=Math.max(...Array.from(e,Math.abs)),i=Math.max(...Array.from(t,Math.abs));if(!s||!i)throw new RangeError("Zero quaternion");let o=Array.from(e,d=>d/s),a=Array.from(t,d=>d/i),c=Math.hypot(...o),u=Math.hypot(...a);for(let d=0;d<4;d++)o[d]/=c,a[d]/=u;let l=o.reduce((d,h,m)=>d+h*a[m],0),f=2*Math.acos(Math.min(1,Math.abs(l)));if(r.length<4)throw new RangeError("Result buffer is too short");return Ob(r,o,a,f===0?0:Math.min(1,n/f)),r}var q1,K1,X1,H1,J1,Y1,_2,Q1,Nf=p(()=>{la();Df();q1=L1,K1=B1,X1=D1,H1=R1,J1=F1,Y1=O1,_2=M1,Q1=(function(){let r=QA(),e=gb(1,0,0),t=gb(0,1,0);return function(n,s,i){let o=yb(s,i);return o<-.999999?(ua(r,e,s),i1(r)<1e-6&&ua(r,t,s),ZA(r,r),Bb(n,r,Math.PI),n):o>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(ua(r,s,i),n[0]=r[0],n[1]=r[1],n[2]=r[2],n[3]=1+o,_2(n,n))}})()});var Gc,ev=p(()=>{Nf();Tf();no();Nf();Gc=class extends Ys{constructor(e=0,t=0,n=0,s=1){super(-0,-0,-0,-0),Array.isArray(e)&&arguments.length===1?this.copy(e):this.set(e,t,n,s)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,t,n,s){return this[0]=e,this[1]=t,this[2]=n,this[3]=s,this.check()}fromObject(e){return this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this.check()}fromMatrix3(e){return $1(this,e),this.check()}fromEuler(e){switch(this.identity(),e.order){case"xyz":return this.rotateX(e.x).rotateY(e.y).rotateZ(e.z);case"yxz":return this.rotateY(e.y).rotateX(e.x).rotateZ(e.z);case"zxy":return this.rotateZ(e.z).rotateX(e.x).rotateY(e.y);case"zyx":return this.rotateZ(e.z).rotateY(e.y).rotateX(e.x);case"yzx":return this.rotateY(e.y).rotateZ(e.z).rotateX(e.x);case"xzy":return this.rotateX(e.x).rotateZ(e.z).rotateY(e.y);default:throw new Error("Unknown Euler angle order")}}fromAxisRotation(e,t){return Bb(this,e,t),this.check()}rotateTowards(e,t){return Z1(this,this,e,t)}identity(){return U1(this),this.check()}setAxisAngle(e,t){return this.fromAxisRotation(e,t)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=Ve(e)}get y(){return this[1]}set y(e){this[1]=Ve(e)}get z(){return this[2]}set z(e){this[2]=Ve(e)}get w(){return this[3]}set w(e){this[3]=Ve(e)}len(){return J1(this)}lengthSquared(){return Y1(this)}dot(e){return X1(this,e)}rotationTo(e,t){return Q1(this,e,t),this.check()}add(e){return q1(this,this,e),this.check()}calculateW(){return G1(this,this),this.check()}conjugate(){return W1(this,this),this.check()}invert(){return z1(this,this),this.check()}lerp(e,t,n){return n===void 0?this.lerp(this,e,t):(H1(this,e,t,n),this.check())}multiplyRight(e){return Fb(this,this,e),this.check()}multiplyLeft(e){return Fb(this,e,this),this.check()}normalize(){let e=this.len(),t=e>0?1/e:0;return this[0]=this[0]*t,this[1]=this[1]*t,this[2]=this[2]*t,this[3]=this[3]*t,e===0&&(this[3]=1),this.check()}rotateX(e){return P1(this,this,e),this.check()}rotateY(e){return V1(this,this,e),this.check()}rotateZ(e){return j1(this,this,e),this.check()}scale(e){return K1(this,this,e),this.check()}slerp(e,t,n){let s,i,o;return arguments.length===2?(s=this,i=e,o=t):(s=e,i=t,o=n),Ob(this,s,i,o),this.check()}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,t){return this.setAxisAngle(e,t)}premultiply(e){return this.multiplyLeft(e)}multiply(e){return this.multiplyRight(e)}}});function Cf(){return fa??Uint16Array}var fa,tv=p(()=>{fa=globalThis.Float16Array});var rv=p(()=>{tv()});var nv=p(()=>{rv()});var sv=p(()=>{_b()});var iv=p(()=>{Mf()});var ov=p(()=>{Nf()});var av=p(()=>{vf()});var cv=p(()=>{la()});var uv=p(()=>{Df()});var Uf=p(()=>{o1();h1();C1();ev();GA();nv();sv();iv();ov();av();cv();uv()});var Ue=p(()=>{"use strict";x_();ym();wm();v_();_m();_m();BA();DA();ob();ab();kA();NA();CA();PA();VA();jA()});function O2(r,e="float32"){return r instanceof Date?"date-millisecond":typeof r=="number"?e:typeof r=="boolean"?"bool":typeof r=="string"?"utf8":"null"}function zc(r){let e=Mb(r);return e!=="null"?{type:e,nullable:!1}:r.length>0?(e=O2(r[0]),{type:e,nullable:!0}):{type:"null",nullable:!0}}function Mb(r){if(typeof Float16Array<"u"&&r instanceof Float16Array)return"float16";switch(r.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case BigInt64Array:return"int64";case BigUint64Array:return"uint64";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}var Pf=p(()=>{"use strict"});function Vf(r){return{fields:r.fields.map(e=>so(e)),metadata:hv(r.metadata)}}function hv(r){return Object.fromEntries(r)}function Db(r){return r?new Map(Object.entries(r)):new Map}function so(r){return{name:r.name,type:pv(r.type),nullable:r.nullable,metadata:hv(r.metadata)}}function Wn(r,e){return new O(r.name,jf(r.type,e),r.nullable,Db(r.metadata))}function pv(r){if(lv(r,"BinaryView"))return"binary-view";if(lv(r,"Utf8View"))return"utf8-view";if(M2(r,"LargeList"))return{type:"large-list",children:[so(r.valueField)]};switch(r.constructor){case Ne:return"null";case Ct:return"binary";case Pt:return{type:"fixed-size-binary",byteWidth:r.byteWidth};case lt:return"bool";case Fe:let e=r;return`${e.isSigned?"":"u"}int${e.bitWidth}`;case Zt:return"int8";case er:return"int16";case Pe:return"int32";case tr:return"int64";case rr:return"uint8";case nr:return"uint16";case vt:return"uint32";case Nr:return"uint64";case ct:switch(r.precision){case le.HALF:return"float16";case le.SINGLE:return"float32";case le.DOUBLE:return"float64";default:return"float16"}case Cr:return"float16";case It:return"float32";case sr:return"float64";case ut:return"utf8";case Ut:let n=r;return{type:"decimal",bitWidth:n.bitWidth,precision:n.precision,scale:n.scale};case Et:return r.unit===ye.DAY?"date-day":"date-millisecond";case os:return"date-day";case as:return"date-millisecond";case tt:switch(r.unit){case L.SECOND:return"time-second";case L.MILLISECOND:return"time-millisecond";case L.MICROSECOND:return"time-microsecond";case L.NANOSECOND:return"time-nanosecond";default:return"time-second"}case us:return"time-millisecond";case cs:return"time-second";case ls:return"time-microsecond";case fs:return"time-nanosecond";case rt:switch(r.unit){case L.SECOND:return"timestamp-second";case L.MILLISECOND:return"timestamp-millisecond";case L.MICROSECOND:return"timestamp-microsecond";case L.NANOSECOND:return"timestamp-nanosecond";default:return"timestamp-second"}case ds:return"timestamp-second";case Zr:return"timestamp-millisecond";case hs:return"timestamp-microsecond";case ps:return"timestamp-nanosecond";case ft:switch(r.unit){case ae.DAY_TIME:return"interval-daytime";case ae.YEAR_MONTH:return"interval-yearmonth";default:return"interval-daytime"}case ms:return"interval-daytime";case bs:return"interval-yearmonth";case dt:let c=r;return{type:"map",keysSorted:c.keysSorted,children:c.children.map(b=>so(b))};case je:let l=r.valueField;return{type:"list",children:[so(l)]};case Be:let f=r;return{type:"fixed-size-list",listSize:f.listSize,children:[so(f.children[0])]};case pe:return{type:"struct",children:r.children.map(b=>so(b))};case gs:case _n:let h=r;return{type:h instanceof _n?"dense-union":"sparse-union",typeIds:h.typeIds,children:h.children.map(b=>so(b)),typeIdToChildIndex:{...h.typeIdToChildIndex}};case Ge:let m=r;return{type:"dictionary",id:m.id,indices:D2(m.indices),dictionary:pv(m.dictionary),isOrdered:m.isOrdered};default:throw new Error(`arrow type not supported: ${r.constructor.name}`)}}function jf(r,e){if(typeof r=="object")switch(r.type){case"decimal":return new Ut(r.scale,r.precision,r.bitWidth);case"map":{let t=r.children.map(n=>Wn(n,e));return new dt(t[0],r.keysSorted)}case"list":{let t=Wn(r.children[0],e);return new je(t)}case"large-list":{let t=Wn(r.children[0],e),n=Wc("LargeList");if(!n)throw new Error("LargeList requires an Apache Arrow runtime that exports the LargeList constructor");return new n(t)}case"fixed-size-list":{let t=Wn(r.children[0],e);return new Be(r.listSize,t)}case"fixed-size-binary":return new Pt(r.byteWidth);case"struct":{let t=r.children.map(n=>Wn(n,e));return new pe(t)}case"sparse-union":case"dense-union":{let t=r.children.map(n=>Wn(n,e));return r.type==="dense-union"?new _n(r.typeIds,t):new gs(r.typeIds,t)}case"dictionary":return new Ge(jf(r.dictionary,e),k2(r.indices),r.id,r.isOrdered);default:throw new Error("array type not supported")}switch(r){case"null":return new Ne;case"binary":return fv("BinaryView",new Ct,e);case"binary-view":return dv("BinaryView");case"bool":return new lt;case"int8":return new Zt;case"int16":return new er;case"int32":return new Pe;case"int64":return new tr;case"uint8":return new rr;case"uint16":return new nr;case"uint32":return new vt;case"uint64":return new Nr;case"float16":return new Cr;case"float32":return new It;case"float64":return new sr;case"utf8":return fv("Utf8View",new ut,e);case"utf8-view":return dv("Utf8View");case"date-day":return new os;case"date-millisecond":return new as;case"time-second":return new cs;case"time-millisecond":return new us;case"time-microsecond":return new ls;case"time-nanosecond":return new fs;case"timestamp-second":return new ds;case"timestamp-millisecond":return new Zr;case"timestamp-microsecond":return new hs;case"timestamp-nanosecond":return new ps;case"interval-daytime":return new ms;case"interval-yearmonth":return new bs;default:throw new Error("array type not supported")}}function Wc(r){return cn[r]}function lv(r,e){let t=Wc(e);if(t&&r instanceof t)return!0;let n=E;return!!(e==="BinaryView"?n.isBinaryView:n.isUtf8View)?.(r)}function M2(r,e){let t=Wc(e);return!!(t&&r instanceof t)}function fv(r,e,t){let n=t?.viewTypes||"never";if(n==="never")return e;let s=Wc(r);if(s)return new s;if(n==="require")throw new Error(`${r} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`);return e}function dv(r){let e=Wc(r);if(!e)throw new Error(`${r} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`);return new e}function D2(r){if(r instanceof Fe){let t=`${r.isSigned?"int":"uint"}${r.bitWidth}`;if(R2(t))return t}switch(r.constructor){case Zt:return"int8";case er:return"int16";case Pe:return"int32";case rr:return"uint8";case nr:return"uint16";case vt:return"uint32";default:throw new Error(`arrow dictionary index type not supported: ${r.constructor.name}`)}}function R2(r){return["int8","int16","int32","uint8","uint16","uint32"].includes(r)}function k2(r){switch(r){case"int8":return new Zt;case"int16":return new er;case"int32":return new Pe;case"uint8":return new rr;case"uint16":return new nr;case"uint32":return new vt;default:throw new Error(`schema dictionary index type not supported: ${r}`)}}var Gf=p(()=>{"use strict";jn()});function Er(r){let e=r?.POSITION;if(!e||!("value"in e)||!e.value.length)return null;let t=1/0,n=1/0,s=1/0,i=-1/0,o=-1/0,a=-1/0,c=e.value,u=c.length;for(let l=0;l<u;l+=3){let f=c[l],d=c[l+1],h=c[l+2];t=f<t?f:t,n=d<n?d:n,s=h<s?h:s,i=f>i?f:i,o=d>o?d:o,a=h>a?h:a}return[[t,n,s],[i,o,a]]}var Rb=p(()=>{"use strict"});function kb(r){let e=Cf();return new e(r)}function Zs(r){return!!(fa&&r instanceof fa)}function Nb(r,e,t){Zs(r)?r[e]=t:r[e]=mv(t)}function Cb(r,e){return Zs(r)?r[e]:N2(r[e])}function $c(r){return Zs(r)?new Uint16Array(r.buffer,r.byteOffset,r.length):r}function mv(r){if(!Number.isFinite(r))return r===1/0?31744:r===-1/0?64512:32256;let e=r<0||Object.is(r,-0)?32768:0,t=Math.abs(r);if(t===0)return e;if(t>=65520)return e|31744;if(t>=65504)return e|31743;let n=Math.floor(Math.log2(t));if(n<-14)return e|Math.round(t/2**-24);let s=n+15,i=Math.round((t/2**n-1)*1024);return i===1024?e|s+1<<10:e|s<<10|i}function N2(r){let e=r&32768?-1:1,t=r>>10&31,n=r&1023;return t===0?e*n*2**-24:t===31?n?NaN:e*(1/0):e*(1+n/1024)*2**(t-15)}var bv=p(()=>{"use strict";Uf()});var zf,Ub,gv=p(()=>{"use strict";jn();zf=new Q([new O("POSITION",new Be(3,new O("value",new It,!1)),!1)]),Ub=new Q([...zf.fields,new O("indices",new je(new O("item",new vt,!1)),!0)])});var qc=p(()=>{"use strict";bv();gv()});function yv(r){return r.type instanceof Be?r.type.listSize:1}function Pb(r,e,t){let n=C2(r,e,t);return new B([n])}function C2(r,e,t){let n=U2(r,e,t),s=n.children[0].type,i=t==="float16"&&Zs(r)?$c(r):r,o={[re.DATA]:i},a=new G(s,0,i.length,0,o);return new G(n,0,i.length/e,0,void 0,[a])}function U2(r,e,t){let n=t||zc(r).type,s=jf(n);return new Be(e,new O("value",s,!1))}var Vb=p(()=>{"use strict";qc();jn();Pf();Gf()});function ei(r,e){switch(e){case"columnar-table":return P2(r);case"arrow-table":return V2(r);default:throw new Error(e)}}function P2(r){let e={},t=Tv(r);for(let[n,s]of Object.entries(r.attributes))e[n]=s.value;return{shape:"columnar-table",schema:r.schema,data:e,topology:r.topology,indices:t?r.indices:void 0}}function V2(r,e){return xv(r.attributes,{schema:r.schema,topology:r.topology,mode:r.mode,boundingBox:r.header?.boundingBox,indices:Tv(r)?r.indices:void 0})}function xv(r,e={}){let t=[],n={},s=G2(r);for(let c of s){let u=r[c],{value:l,size:f=1}=u,d=j2(l,f,u.componentType);if(n[c]=d,t.push(z2(e.schema,c,d,u.componentType)),c==="POSITION"&&e.indices?.value?.length){let h=Ub.fields.find(m=>m.name==="indices");n.indices=$2(e.indices.value,d.length,h.type),t.push(h)}}let i=new Q(t,q2(e)),o=n[s[0]]?.length===0?new me(i):new me(i,n);return{shape:"arrow-table",schema:Vf(o.schema),data:o,topology:e.topology||"point-list",indices:e.indices}}function j2(r,e,t){if(t==="float16"){let n=Zs(r)?$c(r):r;if(e===1){let s=new G(new Cr,0,n.length,0,{[re.DATA]:n});return new B([s])}return Pb(r,e,t)}return e===1?rn(r):Pb(r,e)}function G2(r){let e=Object.keys(r),t=wv.filter(s=>s in r),n=e.filter(s=>!wv.includes(s));return[...t,...n]}function Tv(r){return!!r.indices?.value?.length}function z2(r,e,t,n){if(e==="POSITION"&&W2(t)){let i=zf.fields[0],o=r?.fields.find(c=>c.name===e);if(!o?.metadata)return i;let a=new Map(i.metadata);for(let[c,u]of Object.entries(o.metadata))a.set(c,u);return new O(i.name,i.type,i.nullable,a)}let s=r?.fields.find(i=>i.name===e);if(n==="float16"){let i=new Map(Object.entries(s?.metadata||{}));return i.set("componentType","float16"),new O(e,t.type,!1,i)}if(s&&s.type.toString()!==t.type.toString()){let i=Wn(s);return new O(e,t.type,i.nullable,i.metadata)}return s?Wn(s):new O(e,t.type,!1)}function W2(r){return r.type instanceof Be&&r.type.listSize===3&&r.type.children[0].type instanceof It}function $2(r,e,t){let n=t,s=r instanceof Uint32Array?r:Uint32Array.from(r),i=new Int32Array(e+1);e>0&&i.fill(s.length,1);let o=new Uint8Array(Math.ceil(e/8));e>0&&(o[0]=1);let a=new G(n.children[0].type,0,s.length,0,{[re.DATA]:s}),c=new G(n,0,e,Math.max(0,e-1),{[re.OFFSET]:i,[re.VALIDITY]:o},[a]);return new B([c])}function q2(r){let e={...r.schema?.metadata};return r.topology&&(e.topology||=r.topology),Number.isFinite(r.mode)&&(e.mode||=String(r.mode)),r.boundingBox&&(e.boundingBox||=JSON.stringify(r.boundingBox)),Db(e)}var wv,_v=p(()=>{"use strict";qc();qc();jn();Vb();Gf();wv=["POSITION"]});function pn(r){if(r.shape==="arrow-table")return K2(r);throw new Error(r.shape)}function K2(r){let e=r.data,t=Vf(e.schema),n=t.fields,s={},i=[];for(let l of n){let{name:f}=l;if(f==="indices")continue;let d=e.getChild(f),h=yv(d),m=Q2(d,h),b=H2(l.metadata),g=b.componentType==="float16"?Z2(m):m,y=i.find(x=>x.data.length===d.data.length&&s[x.name].value.constructor===g.constructor&&x.data.every((T,_)=>Av(T,d.data[_])));s[f]={value:y?s[y.name].value:g,size:h,...b},y||i.push({name:f,data:d.data})}Y2(t);let o=t.metadata.topology,a=eD(t),c=tD(e),u=s.POSITION?.transform?.type==="quantization"?X2(t)||Er(s):Er(s);return{schema:t,attributes:s,topology:o,mode:a,indices:c,header:{vertexCount:e.numRows,boundingBox:u??void 0}}}function X2(r){let e=r.metadata?.boundingBox;if(!e)return null;try{let t=JSON.parse(e);if(Array.isArray(t)&&t.length===2&&t.every(n=>Array.isArray(n)&&n.length===3&&n.every(s=>typeof s=="number")))return t}catch{}return null}function H2(r={}){let e={};if(r.byteOffset!==void 0&&(e.byteOffset=Number(r.byteOffset)),r.byteStride!==void 0&&(e.byteStride=Number(r.byteStride)),r.normalized!==void 0&&(e.normalized=r.normalized==="true"),r.componentType==="float16"&&(e.componentType="float16"),r["loaders.gl.transform"])try{let t=JSON.parse(r["loaders.gl.transform"]);J2(t)&&(e.transform=t)}catch{}return e}function J2(r){if(!r||typeof r!="object"||!("type"in r))return!1;let e=r;return e.type==="octahedron"?Number.isInteger(e.bits)&&e.bits>=1&&e.bits<=30:e.type==="quantization"&&Number.isInteger(e.bits)&&e.bits>=1&&e.bits<=30&&Array.isArray(e.origin)&&e.origin.every(t=>typeof t=="number")&&typeof e.range=="number"}function Y2(r){r.metadata||={},r.metadata.topology||="point-list",r.metadata.mode||="0"}function Q2(r,e){if(!(r.type instanceof Be))return r.toArray();let n=r.data[0].children[0].values.constructor,s=new n(r.length*e),i=0;for(let o of r.data){let a=o.children[0],c=o.length*e,u=a.offset||o.offset*e,l=u+c<=a.values.length?u:0,f=a.values.subarray(l,l+c);s.set(f,i),i+=c}return s}function Z2(r){let e=kb(r.length);for(let t=0;t<r.length;t++)Nb(e,t,Cb(r,t));return e}function eD(r){let e=Number(r.metadata?.mode);return Number.isFinite(e)?e:0}function tD(r){let e=r.getChild("indices");if(!e?.isValid(0))return;let t=e.data[0],n=t.valueOffsets,s=n[t.offset],i=n[t.offset+1];return{value:t.children[0].values.subarray(s,i),size:1}}function Av(r,e){let t=Object.values(e.buffers);return r.type.toString()===e.type.toString()&&r.offset===e.offset&&r.length===e.length&&r.nullCount===e.nullCount&&r.dictionary===e.dictionary&&Object.values(r.buffers).every((n,s)=>{let i=t[s];return n===i||!!(n&&i&&n.buffer===i.buffer&&n.byteOffset===i.byteOffset&&n.byteLength===i.byteLength)})&&r.children.length===e.children.length&&r.children.every((n,s)=>Av(n,e.children[s]))}var vv=p(()=>{"use strict";qc();jn();Vb();Gf();Rb()});function jb(r,e={}){return{fields:rD(r),metadata:e}}function Wf(r,e,t){let n=e.componentType||Mb(e.value),s=t||$f(e),i=e.size===1?n:{type:"fixed-size-list",listSize:e.size,children:[{name:"value",type:n}]};return{name:r,type:i,nullable:!1,metadata:s}}function rD(r){let e=[];for(let t in r){let n=r[t];e.push(Wf(t,n))}return e}function $f(r){let e={};return"byteOffset"in r&&(e.byteOffset=r.byteOffset.toString(10)),"byteStride"in r&&(e.byteStride=r.byteStride.toString(10)),"normalized"in r&&(e.normalized=r.normalized.toString()),r.componentType&&(e.componentType=r.componentType),r.transform&&(e["loaders.gl.transform"]=JSON.stringify(r.transform)),e}var Iv=p(()=>{"use strict";Pf()});var mn=p(()=>{"use strict";Pf();Rb();_v();vv();Iv()});function qf(r,e={}){let t={};for(let s in e)s!=="value"&&(t[s]=JSON.stringify(e[s]));let n=[];for(let s in r){let i=r[s],o=nD(s,i);n.push(o)}return{fields:n,metadata:t}}function nD(r,e){let t={};for(let i in e)i!=="value"&&(t[i]=JSON.stringify(e[i]));let{type:n}=zc(e.value);return e.size===1||e.size===void 0||(n={type:"fixed-size-list",listSize:e.size,children:[{name:"values",type:n}]}),{name:r,type:n,nullable:!1,metadata:t}}var Gb=p(()=>{"use strict";mn()});function Ev(r){let e=new $b;r.indexOf(`\r
|
|
39
39
|
`)!==-1&&(r=r.replace(/\r\n/g,`
|
|
40
40
|
`)),r.indexOf(`\\
|
|
41
41
|
`)!==-1&&(r=r.replace(/\\\n/g,""));let t=r.split(`
|
|
42
|
-
`),n="",s="",i=0,o=[],a=typeof"".trimLeft=="function";for(let
|
|
43
|
-
`);for(let i of s){if(i=i.trim(),i.length===0||i.charAt(0)==="#")continue;let o=i.indexOf(" "),a=o>=0?i.substring(0,o):i;a=a.toLowerCase();let c=o>=0?i.substring(o+1):"";switch(c=c.trim(),a){case"newmtl":n={name:c},t.push(n);break;case"ka":n.ambientColor=Rl(c);break;case"kd":n.diffuseColor=Rl(c);break;case"map_kd":n.diffuseTextureUrl=c;break;case"ks":n.specularColor=Rl(c);break;case"map_ks":n.specularTextureUrl=c;break;case"ke":n.emissiveColor=Rl(c);break;case"map_ke":n.emissiveTextureUrl=c;break;case"ns":n.shininess=parseFloat(c);break;case"map_ns":break;case"ni":n.refraction=parseFloat(c);break;case"illum":n.illumination=parseFloat(c);break;default:break}}return t}function Rl(r,e){let t=r.split(x2,3);return[parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2])]}var x2,X1=p(()=>{"use strict";x2=/\s+/});var O7,T2,M7,_2,A2,v2,H1=p(()=>{"use strict";X1();Sb();Sb();({preload:O7,...T2}=Dl),{preload:M7,..._2}=Dl,A2={...T2},v2={..._2,parse:async(r,e)=>Ib(new TextDecoder().decode(r),e?.mtl),parseTextSync:(r,e)=>Ib(r,e?.mtl)}});var Eb={};J(Eb,{MTLLoaderWithParser:()=>v2,MTLWorkerLoaderWithParser:()=>A2});var Lb=p(()=>{"use strict";H1()});async function S2(){let{MTLLoaderWithParser:r}=await Promise.resolve().then(()=>(Lb(),Eb));return r}var I2,Dl,Sb=p(()=>{"use strict";K1();I2="5.0.0-beta.4";Dl={...q1,dataType:null,batchType:null,version:I2,worker:!0,text:!0,testText:r=>r.includes("newmtl"),options:{mtl:{}},preload:S2}});var Nl,Bb=p(()=>{"use strict";Nl="5.0.0-beta.4"});var J1,Y1,Fb=p(()=>{"use strict";J1={name:"glTF",id:"gltf",module:"scene",encoding:"binary",format:"gltf",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"]},Y1={name:"GLB",id:"glb",module:"scene",encoding:"binary",format:"glb",extensions:["glb"],mimeTypes:["model/gltf-binary"],binary:!0,tests:["glTF"]}});function Q1(r){return!F2(r,"ftyp",4)||(r[8]&96)===0?null:E2(r)}function E2(r){switch(L2(r,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function L2(r,e,t){return String.fromCharCode(...r.slice(e,t))}function B2(r){return[...r].map(e=>e.charCodeAt(0))}function F2(r,e,t=0){let n=B2(e);for(let s=0;s<n.length;++s)if(n[s]!==r[s+t])return!1;return!0}var Z1=p(()=>{"use strict"});function Pn(r){let e=zc(r);return M2(e)||N2(e)||R2(e)||D2(e)||O2(e)}function O2(r){let e=new Uint8Array(r instanceof DataView?r.buffer:r),t=Q1(e);return t?{mimeType:t.mimeType,width:0,height:0}:null}function M2(r){let e=zc(r);return e.byteLength>=33&&e.getUint32(0,ur)===2303741511&&e.getUint32(4,ur)===218765834&&e.getUint32(8,ur)===13&&e.getUint32(12,ur)===1229472850?{mimeType:"image/png",width:e.getUint32(16,ur),height:e.getUint32(20,ur)}:null}function R2(r){let e=zc(r);return e.byteLength>=10&&e.getUint32(0,ur)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,Gc),height:e.getUint16(8,Gc)}:null}function D2(r){let e=zc(r);return e.byteLength>=14&&e.getUint16(0,ur)===16973&&e.getUint32(2,Gc)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,Gc),height:e.getUint32(22,Gc)}:null}function N2(r){let e=zc(r);if(!(e.byteLength>=3&&e.getUint16(0,ur)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:s}=k2(),i=2;for(;i+9<e.byteLength;){let o=e.getUint16(i,ur);if(s.has(o))return{mimeType:"image/jpeg",height:e.getUint16(i+5,ur),width:e.getUint16(i+7,ur)};if(!n.has(o))return null;i+=2,i+=e.getUint16(i,ur)}return null}function k2(){let r=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)r.add(t);return{tableMarkers:r,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function zc(r){if(r instanceof DataView)return r;if(ArrayBuffer.isView(r))return new DataView(r.buffer);if(r instanceof ArrayBuffer)return new DataView(r);throw new Error("toDataView")}var ur,Gc,kl=p(()=>{"use strict";Z1();ur=!1,Gc=!0});var C2,U2,V2,ev,tv=p(()=>{"use strict";kl();C2=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],U2=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],V2={id:"image",module:"images",name:"Images",encoding:"image",format:"image",mimeTypes:U2,extensions:C2,tests:[r=>!!Pn(new DataView(r))]},ev={...V2,id:"imagebitmap",name:"ImageBitmap",format:"image-bitmap"}});var Cl,Ob=p(()=>{"use strict";Cl="5.0.0-beta.4"});function ca(r){if(!r)return!1;if(P2.test(r))return!0;for(let e=r.indexOf(".svg");e>=0;e=r.indexOf(".svg",e+4)){let t=r[e+4];if(t===void 0||t==="?"||t==="#")return!0}return!1}function rv(r,e){if(ca(e)){let n=new TextDecoder().decode(r);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(i){throw new Error(i.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return Mb(r,e)}function Mb(r,e){if(ca(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(r)])}var P2,Ul=p(()=>{"use strict";P2=/^data:image\/svg\+xml/});async function nv(r,e,t){let n=rv(r,t),s=self.URL||self.webkitURL,i=typeof n!="string"&&s.createObjectURL(n);try{return await j2(i||n,e)}finally{i&&s.revokeObjectURL(i)}}async function j2(r,e){let t=new Image;return t.src=r,e?.image?.decode&&t.decode?(await t.decode(),t):await new Promise((n,s)=>{try{t.onload=()=>n(t),t.onerror=i=>{let o=i instanceof Error?i.message:"error";s(new Error(o))}}catch(i){s(i)}})}var sv=p(()=>{"use strict";Ul()});async function ov(r,e,t){let n;ca(t)?n=await nv(r,e,t):n=Mb(r,t);let s=e&&e.imagebitmap;return await cv(n,s)}async function av(r,e){let t=e&&e.imagebitmap;return await cv(r,t)}async function cv(r,e=null){if((G2(e)||!iv)&&(e=null),e)try{return await createImageBitmap(r,e)}catch(t){console.warn(t),iv=!1}return await createImageBitmap(r)}function G2(r){if(!r)return!0;for(let e in r)if(Object.prototype.hasOwnProperty.call(r,e))return!1;return!0}var iv,uv=p(()=>{"use strict";Ul();sv();iv=!0});async function fv(r,e){let{mimeType:t}=Pn(r)||{},n=globalThis.loaders?.parseImageNode;ar(n);let s=globalThis.loaders?.createImageBitmapNode;if(!s)throw new Error("Install '@loaders.gl/core/polyfills' to parse images under Node.js");let i=await n(r,t);return s(i)}var lv=p(()=>{"use strict";ke();kl()});async function Rb(r,e,t){e=e||{},pv(e);let n=!!globalThis.loaders?.parseImageNode;if(!Cn||n)return await fv(r,e);if(typeof ImageBitmap>"u"||typeof createImageBitmap!="function")throw new Error(dv);return await ov(r,e,t?.url)}async function hv(r,e,t){e=e||{},pv(e);let n=!!globalThis.loaders?.parseImageNode;if(!Cn||n||ca(t?.url)||r.type.startsWith("image/svg+xml"))return await Rb(await r.arrayBuffer(),e,t);if(typeof ImageBitmap>"u"||typeof createImageBitmap!="function")throw new Error(dv);return await av(r,e)}function pv(r){let e=r.image?.type;if(e&&e!=="imagebitmap")throw new Error(z2)}var z2,dv,mv=p(()=>{"use strict";ke();uv();Ul();lv();z2="@loaders.gl/images: ImageLoader only accepts options.image.type='imagebitmap'. Remove legacy image/data/auto values and call getImageData(image) if you need raw pixels.",dv="@loaders.gl/images: ImageLoader requires browser ImageBitmap support. Use a browser with createImageBitmap support or load images under Node.js with @loaders.gl/core/polyfills."});var bv={};J(bv,{ImageLoaderWithParser:()=>$2});var aJ,W2,$2,gv=p(()=>{"use strict";mv();Db();({preload:aJ,...W2}=Wc),$2={...W2,parse:Rb,parseBlob:hv}});async function K2(){let{ImageLoaderWithParser:r}=await Promise.resolve().then(()=>(gv(),bv));return r}var q2,Wc,Db=p(()=>{"use strict";Ob();tv();q2={image:{}};Wc={dataType:null,batchType:null,...ev,version:Cl,options:q2,preload:K2}});function wv(r){let e=Y2(r);if(!e)throw new Error("Not an image");return e}function $c(r){switch(wv(r)){case"data":return r;case"imagebitmap":return X2(r)?H2(r):yv(r);case"image":return yv(r);default:throw new Error("getImageData")}}function X2(r){let e=globalThis.loaders?.isImageBitmapNode;return!!e?.(r)}function H2(r){let e=globalThis.loaders?.getImageBitmapDataNode;if(!e)throw new Error("getImageData");return e(r)}function yv(r){let e=J2(r.width,r.height),t=e.getContext("2d");if(!t)throw new Error("getImageData");return e.width=r.width,e.height=r.height,t.drawImage(r,0,0),t.getImageData(0,0,r.width,r.height)}function J2(r,e){if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(r,e);if(typeof document<"u"){let t=document.createElement("canvas");return t.width=r,t.height=e,t}throw new Error("getImageData")}function Y2(r){return typeof ImageBitmap<"u"&&r instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&r instanceof Image?"image":r&&typeof r=="object"&&r.data&&r.width&&r.height?"data":null}var xv=p(()=>{"use strict"});async function kb(){return Vl?await Vl:(Vl=Z2(),await Vl)}async function Z2(){let r=new Set;for(let e of Q2)(Cn?await rR(e):Tv(e))&&r.add(e);return r}function Cb(r){if(Nb[r]===void 0){let e=Cn?eR(r):Tv(r);Nb[r]=e}return Nb[r]}function Tv(r){let e=["image/png","image/jpeg","image/gif"],t=globalThis.loaders?.imageFormatsNode||e;return!!globalThis.loaders?.parseImageNode&&t.includes(r)}function eR(r){switch(r){case"image/avif":case"image/webp":return nR(r);default:return!0}}async function rR(r){let e=tR[r];return e?await sR(e):!0}function nR(r){try{return document.createElement("canvas").toDataURL(r).indexOf(`data:${r}`)===0}catch{return!1}}async function sR(r){return new Promise(e=>{let t=new Image;t.src=r,t.onload=()=>e(t.height>0),t.onerror=()=>e(!1)})}var Q2,Vl,Nb,tR,Ub=p(()=>{"use strict";ke();Q2=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/tiff","image/svg","image/svg+xml","image/bmp","image/vnd.microsoft.icon"],Vl=null;Nb={};tR={"image/avif":"data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=","image/webp":"data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"}});var _v,Av=p(()=>{"use strict";_v={name:"Basis",id:"basis",module:"images",encoding:"image",format:"basis",extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],binary:!0,tests:["sB"]}});function Iv(r){if(!Pl){r=r||oR()||void 0,Pl=new Set;for(let e of iR)for(let t in vv)if(r&&r.getExtension(`${e}${t}`))for(let n of vv[t])Pl.add(n)}return Pl}function oR(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var iR,vv,Pl,Sv=p(()=>{"use strict";iR=["","WEBKIT_","MOZ_"],vv={WEBGL_compressed_texture_s3tc:["bc1-rgb-unorm-webgl","bc1-rgba-unorm","bc2-rgba-unorm","bc3-rgba-unorm"],WEBGL_compressed_texture_s3tc_srgb:["bc1-rgb-unorm-srgb-webgl","bc1-rgba-unorm-srgb","bc2-rgba-unorm-srgb","bc3-rgba-unorm-srgb"],EXT_texture_compression_rgtc:["bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm"],EXT_texture_compression_bptc:["bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb"],WEBGL_compressed_texture_etc1:["etc1-rgb-unorm-webgl"],WEBGL_compressed_texture_etc:["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","eac-r11unorm","eac-r11snorm","eac-rg11unorm","eac-rg11snorm"],WEBGL_compressed_texture_pvrtc:["pvrtc-rgb4unorm-webgl","pvrtc-rgba4unorm-webgl","pvrtc-rgb2unorm-webgl","pvrtc-rgba2unorm-webgl"],WEBGL_compressed_texture_atc:["atc-rgb-unorm-webgl","atc-rgba-unorm-webgl","atc-rgbai-unorm-webgl"],WEBGL_compressed_texture_astc:["astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"]},Pl=null});function Lv(r=Iv(),e,t={}){let n=new Set(r);if(!e)return cR(n);if(e.isHDR){let s=Ev(e);return t.astcHDR&&(s==="astc-4x4"||s==="astc-6x6")&&jl(n,s.slice(5))?s==="astc-4x4"?"astc-hdr-4x4":"astc-hdr-6x6":n.has("bc6h-rgb-ufloat")?"bc6h":"rgba16f"}if(e.codec==="xubc7")return Pb(n)?"bc7":"rgba32";if(e.codec.startsWith("xuastc-ldr-")||e.codec.startsWith("astc-ldr-")){let s=Ev(e);return s&&jl(n,s.slice(5))?s:Vb(n,e,["bc7","bc","etc2","atc"])}return e.codec==="uastc-ldr-4x4"?jl(n,"4x4")?"astc-4x4":Vb(n,e,["bc7","bc","etc2","etc1","pvrtc","atc"]):Vb(n,e,["etc2","etc1","bc7","bc","pvrtc","atc"])}function cR(r){return jl(r,"4x4")?"astc-4x4":Pb(r)?"bc7":Bv(r)?{alpha:"bc3",noAlpha:"bc1"}:Fv(r)?"etc2":r.has("etc1-rgb-unorm-webgl")?{alpha:"rgba32",noAlpha:"etc1"}:Ov(r)?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:Mv(r)?{alpha:"atc-rgba-interpolated-alpha",noAlpha:"atc-rgb"}:{alpha:"rgba32",noAlpha:"rgb565"}}function Vb(r,e,t){for(let n of t)switch(n){case"bc7":if(Pb(r))return"bc7";break;case"bc":if(Bv(r))return e.hasAlpha?"bc3":"bc1";break;case"etc2":if(Fv(r))return"etc2";break;case"etc1":if(!e.hasAlpha&&r.has("etc1-rgb-unorm-webgl"))return"etc1";break;case"pvrtc":if(Ov(r))return e.hasAlpha?"pvrtc1-4-rgba":"pvrtc1-4-rgb";break;case"atc":if(Mv(r))return e.hasAlpha?"atc-rgba-interpolated-alpha":"atc-rgb";break;default:break}return e.hasAlpha?"rgba32":"rgb565"}function Ev(r){let e=`${r.blockWidth}x${r.blockHeight}`;return aR.includes(e)?`astc-${e}`:null}function jl(r,e){return ua(r,[`astc-${e}-unorm`,`astc-${e}-unorm-srgb`])}function Pb(r){return ua(r,["bc7-rgba-unorm","bc7-rgba-unorm-srgb"])}function Bv(r){return ua(r,["bc1-rgb-unorm-webgl","bc1-rgb-unorm-srgb-webgl","bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb"])}function Fv(r){return ua(r,["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb"])}function Ov(r){return ua(r,["pvrtc-rgb4unorm-webgl","pvrtc-rgba4unorm-webgl","pvrtc-rgb2unorm-webgl","pvrtc-rgba2unorm-webgl"])}function Mv(r){return ua(r,["atc-rgb-unorm-webgl","atc-rgba-unorm-webgl","atc-rgbai-unorm-webgl"])}function ua(r,e){return e.some(t=>r.has(t))}var aR,Rv=p(()=>{"use strict";Sv();aR=["4x4","5x4","5x5","6x5","6x6","8x5","8x6","8x8","10x5","10x6","10x8","10x10","12x10","12x12"]});async function kv(r){Qp(r.modules);let e=Zp("basis");return e||(Nv||=uR(r),await Nv)}async function uR(r){let e=null,t=null;return[e,t]=await Promise.all([await ta(Dv.TRANSCODER,"images",r,null,"basis_transcoder.mjs"),await ta(Dv.TRANSCODER_WASM,"images",r)]),e=e||globalThis.BASIS,await fR(e,t)}function fR(r,e){let t={};return e&&(t.wasmBinary=e),qi(()=>r(t),n=>{let{BasisFile:s,KTX2File:i,getBasisTexFormatBlockHeight:o,getBasisTexFormatBlockWidth:a,initializeBasis:c,isFormatSupported:u}=n;return c(),{BasisFile:s,KTX2File:i,getBasisTexFormatBlockHeight:o,getBasisTexFormatBlockWidth:a,isFormatSupported:u}})}var Dv,Nv,Cv=p(()=>{"use strict";ke();qs();Dv={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"}});function Uv(r){if(r.byteLength<jb.byteLength)return!1;let e=new Uint8Array(r,0,jb.byteLength);return jb.every((t,n)=>e[n]===t)}var jb,Vv=p(()=>{"use strict";jb=new Uint8Array([171,75,84,88,32,50,48,187,13,10,26,10])});async function pR(r){let e=Pv,t;Pv=new Promise(n=>{t=n}),await e;try{return await r()}finally{t()}}async function Gv(r,e={}){return await pR(async()=>{let t=await kv(cn(e)),n=e.basis?.containerFormat||"auto";if(n==="ktx2"||n==="auto"&&Uv(r)){if(!t.KTX2File)throw new Error("The injected Basis transcoder module does not provide KTX2File");return bR(t,r,e)}return mR(t,r,e)})}function mR(r,e,t){let n=new r.BasisFile(new Uint8Array(e));try{let s=Wv(n,!1);if(!n.startTranscoding())throw new Error("Failed to start Basis transcoding");let i=[];for(let o=0;o<n.getNumImages();o++){let a=[];for(let c=0;c<n.getNumLevels(o);c++){let u=n.getImageWidth(o,c),f=n.getImageHeight(o,c);a.push(zv(n,s,u,f,t,l=>n.getImageTranscodedSizeInBytes(o,c,l),(l,d)=>n.transcodeImage(l,o,c,d,0,0)))}i.push(a)}return i}finally{n.close(),n.delete()}}function bR(r,e,t){let n=new r.KTX2File(new Uint8Array(e));try{if(!n.isValid())throw new Error("Invalid KTX2 texture");if(n.getHeader().pixelDepth>0)throw new Error("BasisLoader does not support 3D KTX2 textures");let i=Wv(n,!0);if(!n.startTranscoding())throw new Error("Failed to start KTX2 transcoding");let o=Math.max(1,n.getLayers()),a=Math.max(1,n.getFaces()),c=[];for(let u=0;u<o;u++)for(let f=0;f<a;f++){let l=[];for(let d=0;d<n.getLevels();d++){let h=n.getImageLevelInfo(d,u,f);l.push(zv(n,{...i,hasAlpha:!!h.alphaFlag},h.width,h.height,t,m=>n.getImageTranscodedSizeInBytes(d,u,f,m),(m,b)=>n.transcodeImage(m,d,u,f,b,0,-1,-1)))}c.push(l)}return c}finally{n.close(),n.delete()}}function zv(r,e,t,n,s,i,o){let a=yR(s,e);gR(e,Gb(s,e));let c=i(a.basisFormat),u=xR(c,a.dataType);if(!o(u,a.basisFormat))throw new Error(`Failed to transcode Basis texture to ${Gb(s,e)}`);let f=e.isSRGB&&a.srgbTextureFormat;return{shape:"texture-level",width:t,height:n,data:u,compressed:a.compressed,format:f&&a.srgbFormat||a.format,textureFormat:f?a.srgbTextureFormat:a.textureFormat,levelSize:c,hasAlpha:e.hasAlpha}}function gR(r,e){let t=e==="bc6h"||e==="rgba16f"||e==="rgb9e5"||e.startsWith("astc-hdr-");if(r.isHDR!==t)throw new Error(`Basis source codec ${r.codec} cannot be transcoded to ${e}`);if(r.codec==="xubc7"&&e!=="bc7"&&e!=="rgba32")throw new Error(`Basis source codec ${r.codec} cannot be transcoded to ${e}`)}function yR(r,e){let t=Gb(r,e),n=jv[t];if(!n)throw new Error(`Unknown Basis format ${t}`);return n}function Gb(r,e){let t=r.basis?.format||"auto";return t==="auto"&&(t=Lv(r.basis?.supportedTextureFormats,e,r.basis?.supportedTextureFeatures)),typeof t=="object"&&(t=e.hasAlpha?t.alpha:t.noAlpha),t.toLowerCase()}function Wv(r,e){let t=r.getBasisTexFormat(),n=wR[t];if(!n)throw new Error(`Unsupported Basis source texture format ${t}`);return{codec:n,isHDR:!!r.isHDR(),isSRGB:e?!!r.isSRGB():!1,hasAlpha:!!r.getHasAlpha(),blockWidth:r.getBlockWidth(),blockHeight:r.getBlockHeight()}}function xR(r,e){return e==="uint16"?new Uint16Array(r/Uint16Array.BYTES_PER_ELEMENT):e==="uint32"?new Uint32Array(r/Uint32Array.BYTES_PER_ELEMENT):new Uint8Array(r)}function nt(r,e,t){return{basisFormat:r,compressed:!0,format:e,textureFormat:t}}function fa(r,e,t,n,s){return{basisFormat:r,compressed:!1,format:e,textureFormat:t,srgbFormat:n,srgbTextureFormat:s}}function jt(r,e,t,n){return{...nt(r,e,`astc-${n}-unorm`),srgbFormat:t,srgbTextureFormat:`astc-${n}-unorm-srgb`}}var Pt,jv,TY,Pv,wR,$v=p(()=>{"use strict";qs();Rv();Cv();Vv();Pt={"4x4":jt(10,37808,37840,"4x4"),"5x4":jt(28,37809,37841,"5x4"),"5x5":jt(29,37810,37842,"5x5"),"6x5":jt(30,37811,37843,"6x5"),"6x6":jt(31,37812,37844,"6x6"),"8x5":jt(32,37813,37845,"8x5"),"8x6":jt(33,37814,37846,"8x6"),"8x8":jt(36,37815,37847,"8x8"),"10x5":jt(34,37816,37848,"10x5"),"10x6":jt(35,37817,37849,"10x6"),"10x8":jt(37,37818,37850,"10x8"),"10x10":jt(38,37819,37851,"10x10"),"12x10":jt(39,37820,37852,"12x10"),"12x12":jt(40,37821,37853,"12x12")},jv={etc1:nt(0,36196,"etc1-rgb-unorm-webgl"),etc2:{...nt(1,37493,"etc2-rgba8unorm"),srgbFormat:37495,srgbTextureFormat:"etc2-rgba8unorm-srgb"},bc1:{...nt(2,33776,"bc1-rgb-unorm-webgl"),srgbFormat:35916,srgbTextureFormat:"bc1-rgb-unorm-srgb-webgl"},bc3:{...nt(3,33779,"bc3-rgba-unorm"),srgbFormat:35919,srgbTextureFormat:"bc3-rgba-unorm-srgb"},bc4:nt(4,36283,"bc4-r-unorm"),bc5:nt(5,36285,"bc5-rg-unorm"),bc7:{...nt(6,36492,"bc7-rgba-unorm"),srgbFormat:36493,srgbTextureFormat:"bc7-rgba-unorm-srgb"},"pvrtc1-4-rgb":nt(8,35840,"pvrtc-rgb4unorm-webgl"),"pvrtc1-4-rgba":nt(9,35842,"pvrtc-rgba4unorm-webgl"),"astc-4x4":Pt["4x4"],"astc-5x4":Pt["5x4"],"astc-5x5":Pt["5x5"],"astc-6x5":Pt["6x5"],"astc-6x6":Pt["6x6"],"astc-8x5":Pt["8x5"],"astc-8x6":Pt["8x6"],"astc-8x8":Pt["8x8"],"astc-10x5":Pt["10x5"],"astc-10x6":Pt["10x6"],"astc-10x8":Pt["10x8"],"astc-10x10":Pt["10x10"],"astc-12x10":Pt["12x10"],"astc-12x12":Pt["12x12"],"atc-rgb":nt(11,35986,"atc-rgb-unorm-webgl"),"atc-rgba-interpolated-alpha":nt(12,34798,"atc-rgbai-unorm-webgl"),rgba32:fa(13,32856,"rgba8unorm",35907,"rgba8unorm-srgb"),rgb565:fa(14,36194,"rgb565unorm-webgl"),bgr565:fa(15,36194,"rgb565unorm-webgl"),rgba4444:fa(16,32854,"rgba4unorm-webgl"),"eac-r11":nt(20,37488,"eac-r11unorm"),"eac-rg11":nt(21,37490,"eac-rg11unorm"),bc6h:nt(22,36495,"bc6h-rgb-ufloat"),"astc-hdr-4x4":nt(23,37808,"astc-4x4-unorm"),rgba16f:{...fa(25,34842,"rgba16float"),dataType:"uint16"},rgb9e5:{...fa(26,35901,"rgb9e5ufloat"),dataType:"uint32"},"astc-hdr-6x6":nt(27,37812,"astc-6x6-unorm")},TY=Object.freeze(Object.keys(jv)),Pv=Promise.resolve();wR={0:"etc1s",1:"uastc-ldr-4x4",2:"uastc-hdr-4x4",3:"astc-hdr-6x6",4:"uastc-hdr-6x6",5:"xuastc-ldr-4x4",6:"xuastc-ldr-5x4",7:"xuastc-ldr-5x5",8:"xuastc-ldr-6x5",9:"xuastc-ldr-6x6",10:"xuastc-ldr-8x5",11:"xuastc-ldr-8x6",12:"xuastc-ldr-10x5",13:"xuastc-ldr-10x6",14:"xuastc-ldr-8x8",15:"xuastc-ldr-10x8",16:"xuastc-ldr-10x10",17:"xuastc-ldr-12x10",18:"xuastc-ldr-12x12",19:"astc-ldr-4x4",20:"astc-ldr-5x4",21:"astc-ldr-5x5",22:"astc-ldr-6x5",23:"astc-ldr-6x6",24:"astc-ldr-8x5",25:"astc-ldr-8x6",26:"astc-ldr-10x5",27:"astc-ldr-10x6",28:"astc-ldr-8x8",29:"astc-ldr-10x8",30:"astc-ldr-10x10",31:"astc-ldr-12x10",32:"astc-ldr-12x12",33:"xubc7"}});var qv={};J(qv,{BasisLoaderWithParser:()=>vR,BasisWorkerLoaderWithParser:()=>AR});var SY,TR,EY,_R,AR,vR,Kv=p(()=>{"use strict";$v();Gl();Gl();({preload:SY,...TR}=eo),{preload:EY,..._R}=eo,AR={...TR},vR={..._R,parse:Gv}});async function IR(){let{BasisLoaderWithParser:r}=await Promise.resolve().then(()=>(Kv(),qv));return r}var eo,Gl=p(()=>{"use strict";Av();Ob();eo={..._v,dataType:null,batchType:null,name:"Basis",id:"basis",module:"images",version:Cl,worker:!0,workerNode:"basis-worker-node.cjs",extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",containerFormat:"auto"}},preload:IR}});var jn=p(()=>{"use strict";Db();kl();xv();Ub();Ub();Gl()});function X(r,e){if(!r)throw new Error(e||"assert failed: gltf")}var to=p(()=>{"use strict"});function OR(r,e=0){return`${String.fromCharCode(r.getUint8(e+0))}${String.fromCharCode(r.getUint8(e+1))}${String.fromCharCode(r.getUint8(e+2))}${String.fromCharCode(r.getUint8(e+3))}`}function Yv(r,e=0,t={}){let n=new DataView(r),{magic:s=Xv}=t,i=n.getUint32(e,!1);return i===s||i===Xv}function $l(r,e,t=0,n={}){let s=new DataView(e),i=OR(s,t+0),o=s.getUint32(t+4,Ys),a=o===3?Zv(s,t+8,"GLB byte length"):s.getUint32(t+8,Ys);switch(Object.assign(r,{header:{byteOffset:t,byteLength:a,hasBinChunk:!1},type:i,version:o,json:{},jsonChunkIndex:-1,binChunks:[]}),r.version){case 1:return MR(r,s,t+zl);case 2:return RR(r,s,t+zl,n);case 3:return DR(r,s,t+Jv,n);default:throw new Error(`Invalid GLB version ${r.version}. Only supports versions 1, 2 and 3.`)}}function MR(r,e,t){ar(r.header.byteLength>zl+Wl);let n=r.header.byteOffset+r.header.byteLength;ar(n<=e.byteLength);let s=e.getUint32(t+0,Ys),i=e.getUint32(t+4,Ys);if(t+=Wl,ar(i===LR),t+s>n)throw new Error("GLB JSON content extends beyond the declared file length.");zb(r,e,t,s,0),t+=s;let o=n-t;return o>0&&Wb(r,e,t,o,1),n}function RR(r,e,t,n){return ar(r.header.byteLength>zl+Wl),Qv(r,e,t,Wl,n),r.header.byteOffset+r.header.byteLength}function DR(r,e,t,n){return ar(r.header.byteLength>=Jv+Hv),Qv(r,e,t,Hv,n),r.header.byteOffset+r.header.byteLength}function Qv(r,e,t,n,s){let i=r.header.byteOffset+r.header.byteLength;ar(i<=e.byteLength);let o=0;for(;t+n<=i;){let a=r.version===3,c=e.getUint32(t+(a?0:4),Ys),u=a?e.getUint32(t+4,Ys):0,f=a?Zv(e,t+8,"GLB chunk length"):e.getUint32(t+0,Ys);if(t+=n,u!==0)throw new Error(`Unsupported GLB chunk encoding ${u}.`);if(t+f>i)throw new Error("GLB chunk extends beyond the declared file length.");switch(c){case SR:(r.version!==3||r.jsonChunkIndex===-1)&&zb(r,e,t,f,o);break;case ER:Wb(r,e,t,f,o);break;case BR:s.strict||zb(r,e,t,f,o);break;case FR:s.strict||Wb(r,e,t,f,o);break;default:break}t+=$b(f),o++}return t}function zb(r,e,t,n,s){let i=new Uint8Array(e.buffer,t,n),a=new TextDecoder("utf8").decode(i);return r.json=JSON.parse(a),r.jsonChunkIndex=s,$b(n)}function Wb(r,e,t,n,s){return r.header.hasBinChunk=!0,r.binChunks.push({chunkIndex:s,byteOffset:t,byteLength:n,arrayBuffer:e.buffer}),$b(n)}function Zv(r,e,t){let n=r.getBigUint64(e,Ys);if(n>BigInt(Number.MAX_SAFE_INTEGER))throw new Error(`${t} exceeds JavaScript's safe integer range.`);return Number(n)}function $b(r){return Math.ceil(r/4)*4}var Ys,Xv,zl,Jv,Wl,Hv,SR,ER,LR,BR,FR,qb=p(()=>{"use strict";ke();Ys=!0,Xv=1735152710,zl=12,Jv=16,Wl=8,Hv=16,SR=1313821514,ER=5130562,LR=0,BR=0,FR=1});function Gn(r,e,t){if(r.startsWith("data:")||r.startsWith("http:")||r.startsWith("https:"))return ql(r);let s=t?.baseUrl||NR(e?.core?.baseUrl);if(!s)throw new Error(`'baseUrl' must be provided to resolve relative url ${r}`);let i=s.endsWith("/")?`${s}${r}`:`${s}/${r}`;return ql(i)}function ql(r){try{return new URL(r).href}catch{return r}}function NR(r){if(!r)return;if(r.endsWith("/"))return r;let e=r.lastIndexOf("/");return e>=0?r.slice(0,e+1):""}var qc=p(()=>{"use strict"});var Kl,Kc,Kb=p(()=>{"use strict";Kl={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Kc={5120:1,5121:1,5122:2,5123:2,5124:4,5125:4,5126:4,5130:8,5131:2,5134:8,5135:8}});function la(r){return eI[r-1]||eI[0]}function zn(r){let e=CR.get(r.constructor);if(!e)throw new Error("Illegal typed array");return e}function Xc(r,e){let t=PR[r.componentType],n=UR[r.type],s=VR[r.componentType],i=r.count*n,o=r.count*n*s;X(o>=0&&o<=e.byteLength);let a=Kc[r.componentType],c=Kl[r.type];return{ArrayType:t,length:i,byteLength:o,componentByteSize:a,numberOfComponentsInElement:c}}var eI,kR,CR,UR,VR,PR,Qs=p(()=>{"use strict";to();Kb();eI=["SCALAR","VEC2","VEC3","VEC4"],kR=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Int32Array,5124],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130],[BigInt64Array,5134],[BigUint64Array,5135]],CR=new Map(kR),UR={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},VR={5120:1,5121:1,5122:2,5123:2,5124:4,5125:4,5126:4,5130:8,5131:2,5134:8,5135:8},PR={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5124:Int32Array,5125:Uint32Array,5126:Float32Array,5130:Float64Array,5131:Uint16Array,5134:BigInt64Array,5135:BigUint64Array}});function fr(r,e,t){let n=typeof t=="number"?r.bufferViews[t]:t;X(n);let s=n.buffer,i=e[s];X(i),X((n.byteOffset||0)>=0&&n.byteLength>=0),X((n.byteOffset||0)+n.byteLength<=i.byteLength),X(i.byteOffset>=0&&i.byteOffset+i.byteLength<=i.arrayBuffer.byteLength);let o=(n.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,o,n.byteLength)}function tI(r,e,t){let n=r.images[t];return fr(r,e,n.bufferView)}function Xl(r,e,t){let n=typeof t=="number"?r.accessors?.[t]:t;if(!n)throw new Error(`No gltf accessor ${JSON.stringify(t)}`);X(Number.isSafeInteger(n.count)&&n.count>=0);let{ArrayType:s,length:i,numberOfComponentsInElement:o}=Xc(n,{byteLength:1/0}),a=n.value,c;ArrayBuffer.isView(a)?(X(a.length===i),c=a):n.bufferView===void 0?c=new s(i):c=Xb(r,e,n);let u=n.sparse;if(!u)return c;let f=new s(i);new Uint8Array(f.buffer).set(new Uint8Array(c.buffer,c.byteOffset,c.byteLength)),X(u.count>=0&&u.count<=n.count),X([5121,5123,5125].includes(u.indices.componentType));let l=Xb(r,e,{bufferView:u.indices.bufferView,byteOffset:u.indices.byteOffset,componentType:u.indices.componentType,count:u.count,type:"SCALAR"}),d=Xb(r,e,{bufferView:u.values.bufferView,byteOffset:u.values.byteOffset,componentType:n.componentType,count:u.count,type:n.type}),h=-1,m=new Uint8Array(f.buffer),b=o*s.BYTES_PER_ELEMENT,w=new Uint8Array(d.buffer,d.byteOffset,d.byteLength);for(let g=0;g<u.count;g++){let x=Number(l[g]);X(x>h&&x<n.count),m.set(w.subarray(g*b,(g+1)*b),x*b),h=x}return f}function Xb(r,e,t){let n=r.bufferViews?.[t.bufferView];if(!n)throw new Error(`No gltf buffer view for accessor ${n}`);let s=e[n.buffer];X(s);let{arrayBuffer:i,byteOffset:o}=s;X((n.byteOffset||0)>=0&&n.byteLength>=0),X((n.byteOffset||0)+n.byteLength<=s.byteLength),X(o>=0&&o+s.byteLength<=i.byteLength),X((t.byteOffset||0)>=0);let a=(o||0)+(t.byteOffset||0)+(n.byteOffset||0),{ArrayType:c,length:u,componentByteSize:f,numberOfComponentsInElement:l}=Xc(t,n),d=f*l,h=t.type.startsWith("MAT")?Number(t.type.slice(3)):1,m=Te(h*f,4),b=h>1?h*m:d,w=n.byteStride??b,g=h>1?(h-1)*m+h*f:d;if(X(w>=b),X((t.byteOffset||0)+(t.count===0?0:(t.count-1)*w+g)<=n.byteLength),t.count===0)return new c(0);if(h>1&&m!==h*f){let _=n.byteStride??h*m,v=(h-1)*m+h*f;X((t.byteOffset||0)+(t.count-1)*_+v<=n.byteLength);let I=new c(u),N=new Uint8Array(I.buffer,I.byteOffset,I.byteLength);for(let q=0;q<t.count;q++)for(let re=0;re<h;re++){let pe=new Uint8Array(i,a+q*_+re*m,h*f);N.set(pe,q*d+re*h*f)}return I}let x=n.byteStride||d;if(typeof n.byteStride>"u"||n.byteStride===d){if(a%f!==0){let v=new Uint8Array(i,a,u*f),I=new Uint8Array(v.byteLength);return I.set(v),new c(I.buffer,0,u)}return new c(i,a,u)}let T=new c(u);for(let _=0;_<t.count;_++){let v=a+_*x,I;if(v%f!==0){let N=new Uint8Array(i,v,d),q=new Uint8Array(d);q.set(N),I=new c(q.buffer,0,l)}else I=new c(i,v,l);T.set(I,_*l)}return T}var ro=p(()=>{"use strict";to();ke();Qs()});function Hb(r,e){let t=r.json.files||[],n=[];for(let s=0;s<t.length;s++){let i=t[s];(i.name===e||i.uri===e)&&n.push(s)}return X(n.length<=1,`glTF package file reference ${e} is ambiguous.`),n[0]??-1}async function Hl(r,e,t,n){let s=r.json.files||[],i=typeof e=="number"?e:Hb(r,e);X(Number.isInteger(i)&&i>=0&&i<s.length),r.files=r.files||new Array(s.length).fill(null);let o=r.files[i];if(o)return o;let a=s[i];X(a.mimeType,`glTF file ${i} must define mimeType.`);let c=a.uri!==void 0,u=a.bufferView!==void 0;X(c!==u,`glTF file ${i} must define exactly one of uri or bufferView.`);let f;if(a.uri!==void 0){let l=Gn(a.uri,t,n),d=await n.fetch(l);X(d?.ok,`Failed to fetch glTF file ${a.uri}: HTTP ${d?.status}.`);let h=await d.arrayBuffer();f={arrayBuffer:h,byteOffset:0,byteLength:h.byteLength,mimeType:a.mimeType,name:a.name,url:l}}else{let l=fr(r.json,r.buffers,a.bufferView);f={arrayBuffer:l.buffer,byteOffset:l.byteOffset,byteLength:l.byteLength,mimeType:a.mimeType,name:a.name}}return r.files[i]=f,f}var rI=p(()=>{"use strict";ro();qc();to()});var Jb={};J(Jb,{name:()=>no,preprocess:()=>jR});function jR(r){let{json:e}=r;if(!(!e.extensionsUsed?.includes(no)&&!e.extensionsRequired?.includes(no))){if(!e.extensionsUsed?.includes(no)||!e.extensionsRequired?.includes(no))throw new Error(`${no}: must be declared in extensionsUsed and extensionsRequired.`);for(let[t,n]of(e.accessors||[]).entries())if(n.componentType===5130&&n.normalized)throw new Error(`${no}: accessor ${t} must not be normalized.`)}}var no,nI=p(()=>{"use strict";no="KHR_accessor_float64"});function GR(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}var ln,Hc=p(()=>{"use strict";jn();ke();to();Qs();ro();ln=class{gltf;sourceBuffers;byteLength;constructor(e){this.gltf={json:e?.json||GR(),buffers:e?.buffers||[],images:e?.images||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=Te(this.gltf.buffers[0].byteLength,4),this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}hasExtension(e){let t=this.getUsedExtensions().find(s=>s===e),n=this.getRequiredExtensions().find(s=>s===e);return typeof t=="string"||typeof n=="string"}getExtension(e){let t=this.getUsedExtensions().find(s=>s===e),n=this.json.extensions||{};return t?n[e]:null}getRequiredExtension(e){return this.getRequiredExtensions().find(n=>n===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(e,t){return(e.extensions||{})[t]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,t){if(typeof t=="object")return t;let n=this.json[e]&&this.json[e][t];if(!n)throw new Error(`glTF file error: Could not find ${e}[${t}]`);return n}getTypedArrayForBufferView(e){return fr(this.gltf.json,this.gltf.buffers,e)}getTypedArrayForAccessor(e){return Xl(this.gltf.json,this.gltf.buffers,e)}getTypedArrayForImageData(e){e=this.getAccessor(e);let t=this.getBufferView(e.bufferView),s=this.getBuffer(t.buffer).data,i=t.byteOffset||0;return new Uint8Array(s,i,t.byteLength)}addApplicationData(e,t){return this.json[e]=t,this}addExtraData(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}addObjectExtension(e,t,n){return e.extensions=e.extensions||{},e.extensions[t]=n,this.registerUsedExtension(t),this}setObjectExtension(e,t,n){let s=e.extensions||{};s[t]=n}removeObjectExtension(e,t){let n=e?.extensions||{};if(n[t]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let s=this.json.extensionsRemoved;s.includes(t)||s.push(t)}delete n[t]}addExtension(e,t={}){return X(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return X(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(t=>t===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(t=>t===e)||this.json.extensionsRequired.push(e)}removeExtension(e){if(this.json.extensions?.[e]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let t=this.json.extensionsRemoved;t.includes(e)||t.push(e)}this.json.extensions&&delete this.json.extensions[e],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e)}setDefaultScene(e){this.json.scene=e}addScene(e){let{nodeIndices:t}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(e){let{meshIndex:t,matrix:n}=e;this.json.nodes=this.json.nodes||[];let s={mesh:t};return n&&(s.matrix=n),this.json.nodes.push(s),this.json.nodes.length-1}addMesh(e){let{attributes:t,indices:n,material:s,mode:i=4}=e,a={primitives:[{attributes:this._addAttributes(t),mode:i}]};if(n){let c=this._addIndices(n);a.primitives[0].indices=c}return Number.isFinite(s)&&(a.primitives[0].material=s),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(e){let n={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(n),this.json.meshes.length-1}addImage(e,t){let n=Pn(e),s=t||n?.mimeType,o={bufferView:this.addBufferView(e),mimeType:s};return this.json.images=this.json.images||[],this.json.images.push(o),this.json.images.length-1}addBufferView(e,t=0,n=this.byteLength){let s=e.byteLength;X(Number.isFinite(s)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);let i={buffer:t,byteOffset:n,byteLength:s};return this.byteLength+=Te(s,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}addAccessor(e,t){let n=t.normalized,s={bufferView:e,...n===void 0?{}:{normalized:n},type:la(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(s),this.json.accessors.length-1}addBinaryBuffer(e,t={size:3}){let n=this.addBufferView(e),s={min:t.min,max:t.max};(!s.min||!s.max)&&(s=this._getAccessorMinMax(e,t.size));let i={size:t.size,componentType:zn(e),count:Math.round(e.length/t.size),min:s.min,max:s.max};return this.addAccessor(n,Object.assign(i,t))}addTexture(e){let{imageIndex:t,samplerIndex:n}=e,s={source:t,...n===void 0?{}:{sampler:n}};return this.json.textures=this.json.textures||[],this.json.textures.push(s),this.json.textures.length-1}addSampler(e){return this.json.samplers=this.json.samplers||[],this.json.samplers.push({...e}),this.json.samplers.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){if(this.byteLength===0&&!this.json.buffers?.length){delete this.json.buffers,delete this.gltf.binary,this.sourceBuffers=[],this.gltf.buffers=[];return}let e=[0],t=this.byteLength;for(let o=1;o<this.gltf.buffers.length;o++){let a=this.gltf.buffers[o];a&&(e[o]=Te(t,8),t=e[o]+Te(a.byteLength,4))}let n=new ArrayBuffer(t),s=new Uint8Array(n),i=0;for(let o of this.sourceBuffers||[])i=Yi(o,s,i);for(let o=1;o<this.gltf.buffers.length;o++){let a=this.gltf.buffers[o];a&&Yi(a,s,e[o])}for(let o of this.json.bufferViews||[]){let a=e[o.buffer];X(a!==void 0),o.byteOffset=a+(o.byteOffset||0),o.buffer=0;for(let c of["EXT_meshopt_compression","KHR_meshopt_compression"]){let u=o.extensions?.[c];if(u){let f=e[u.buffer];X(f!==void 0),u.byteOffset=f+(u.byteOffset||0),u.buffer=0}}}this.byteLength=t,this.json.buffers=[{byteLength:t}],this.gltf.binary=n,this.sourceBuffers=[n],this.gltf.buffers=[{arrayBuffer:n,byteOffset:0,byteLength:n.byteLength}]}_removeStringFromArray(e,t){let n=!0;for(;n;){let s=e.indexOf(t);s>-1?e.splice(s,1):n=!1}}_addAttributes(e={}){let t={};for(let n in e){let s=e[n],i=this._getGltfAttributeName(n),o=s.value,a=o.BYTES_PER_ELEMENT*s.size,c=Te(a,4),u;if(c===a)u=this.addBinaryBuffer(o,s);else{let f=o.length/s.size,l=new Uint8Array(f*c),d=new Uint8Array(o.buffer,o.byteOffset,o.byteLength);for(let m=0;m<f;m++)l.set(d.subarray(m*a,(m+1)*a),m*c);let h=this.addBufferView(l);this.json.bufferViews[h].byteStride=c,u=this.addAccessor(h,{...this._getAccessorMinMax(o,s.size),...s,componentType:zn(o),count:f})}t[i]=u}return t}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,t){let n={min:null,max:null};if(e.length<t)return n;n.min=[],n.max=[];let s=e.subarray(0,t);for(let i of s)n.min.push(i),n.max.push(i);for(let i=t;i<e.length;i+=t)for(let o=0;o<t;o++)n.min[0+o]=Math.min(n.min[0+o],e[i+o]),n.max[0+o]=Math.max(n.max[0+o],e[i+o]);return n}}});function zR(r){switch(r.type){case"accessor":return{get bufferView(){return r.bufferView?.data}};case"animation":return{get channels(){return so(r.channels)},get samplers(){return so(r.samplers)}};case"animationChannel":return{get sampler(){return r.sampler.data},get target(){return r.target.data}};case"animationChannelTarget":return{get node(){return r.node?.data}};case"animationSampler":return{get input(){return r.input.data},get output(){return r.output.data}};case"bufferView":return{get buffer(){return r.buffer.data}};case"externalAsset":return{get file(){return r.file.data}};case"file":case"image":return{get bufferView(){return r.bufferView?.data}};case"material":return{get baseColorTexture(){return r.baseColorTexture?.data},get metallicRoughnessTexture(){return r.metallicRoughnessTexture?.data},get normalTexture(){return r.normalTexture?.data},get occlusionTexture(){return r.occlusionTexture?.data},get emissiveTexture(){return r.emissiveTexture?.data},get textures(){return so(r.textures)}};case"textureInfo":return{get texture(){return r.texture.data}};case"mesh":return{get primitives(){return so(r.primitives)}};case"primitive":return{get attributes(){return sI(r.attributes)},get indices(){return r.indices?.data},get material(){return r.material?.data},get targets(){return r.targets.map(sI)}};case"node":return{get camera(){return r.camera?.data},get children(){return so(r.children)},get skin(){return r.skin?.data},get mesh(){return r.mesh?.data},get externalAsset(){return r.externalAsset?.data}};case"scene":return{get nodes(){return so(r.nodes)}};case"skin":return{get inverseBindMatrices(){return r.inverseBindMatrices?.data},get skeleton(){return r.skeleton?.data},get joints(){return so(r.joints)}};case"texture":return{get sampler(){return r.sampler?.data},get source(){return r.source?.data}};default:return{}}}function io(r,e){return(function*(){for(let n=0;n<r.length;n++)yield e(r[n],n)})()}function so(r){return(function*(){for(let t of r)yield t.data})()}function sI(r){return new Map(Array.from(r,([e,t])=>[e,t.data]))}function WR(r){switch(r){case"bufferView":return"bufferViews";case"externalAsset":return"externalAssets";case"mesh":return"meshes";default:return`${r}s`}}function iI(r,e){if(r)for(let t=r.length-1;t>=0;t--)r[t]===e&&r.splice(t,1)}var Xe,Zs,Yb,Qb,Zb,eg,Jl,tg,rg,ng,sg,ig,og,ag,cg,ug,fg,lg,dg,hg,pg,mg,se,Ke=p(()=>{"use strict";ro();Qs();Xe=class{gltf;type;index;data;path;iterator;constructor(e,t,n,s,i){this.iterator=e,this.gltf=e.gltf,this.type=t,this.index=n,this.data=s,this.path=i}},Zs=class extends Xe{parent;constructor(e,t,n,s,i,o){super(e,t,n,s,i),this.parent=o}},Yb=class extends Xe{get bufferView(){return this.data.bufferView===void 0?void 0:this.iterator.resolveBufferView(this.data.bufferView,`${this.path}.bufferView`)}},Qb=class extends Xe{get channels(){return io(this.data.channels,(e,t)=>this.iterator.getOrCreateNested(e,()=>new Zb(this.iterator,"animationChannel",t,e,`${this.path}.channels[${t}]`,this)))}get samplers(){return io(this.data.samplers,(e,t)=>this.iterator.getOrCreateNested(e,()=>new Jl(this.iterator,"animationSampler",t,e,`${this.path}.samplers[${t}]`,this)))}},Zb=class extends Zs{get sampler(){let t=this.parent.data.samplers[this.data.sampler];if(!t)throw new Error(`Invalid glTF reference at ${this.path}.sampler: animation sampler index ${this.data.sampler} is out of range`);return this.iterator.getOrCreateNested(t,()=>new Jl(this.iterator,"animationSampler",this.data.sampler,t,`${this.parent.path}.samplers[${this.data.sampler}]`,this.parent))}get target(){return this.iterator.getOrCreateNested(this.data.target,()=>new eg(this.iterator,"animationChannelTarget",0,this.data.target,`${this.path}.target`,this))}},eg=class extends Zs{get node(){return this.data.node===void 0?void 0:this.iterator.resolveNode(this.data.node,`${this.path}.node`)}},Jl=class extends Zs{get input(){return this.iterator.resolveAccessor(this.data.input,`${this.path}.input`)}get output(){return this.iterator.resolveAccessor(this.data.output,`${this.path}.output`)}},tg=class extends Xe{get loadedBuffer(){return this.gltf.buffers[this.index]}},rg=class extends Xe{get buffer(){return this.iterator.resolveBuffer(this.data.buffer,`${this.path}.buffer`)}get loadedBufferView(){let e=this.buffer.loadedBuffer;if(!e)return;let t=e.byteOffset+(this.data.byteOffset||0);return new Uint8Array(e.arrayBuffer,t,this.data.byteLength)}},ng=class extends Xe{},sg=class extends Xe{get file(){return this.iterator.resolveFile(this.data.file,`${this.path}.file`)}get loadedAsset(){return this.gltf.externalAssets?.[this.index]}},ig=class extends Xe{get bufferView(){return this.data.bufferView===void 0?void 0:this.iterator.resolveBufferView(this.data.bufferView,`${this.path}.bufferView`)}get loadedFile(){return this.gltf.files?.[this.index]}},og=class extends Xe{get bufferView(){return this.data.bufferView===void 0?void 0:this.iterator.resolveBufferView(this.data.bufferView,`${this.path}.bufferView`)}get loadedImage(){return this.gltf.images?.[this.index]}},ag=class extends Xe{get baseColorTexture(){return this.getTextureInfo(this.data.pbrMetallicRoughness?.baseColorTexture,0,"pbrMetallicRoughness.baseColorTexture")}get metallicRoughnessTexture(){return this.getTextureInfo(this.data.pbrMetallicRoughness?.metallicRoughnessTexture,1,"pbrMetallicRoughness.metallicRoughnessTexture")}get normalTexture(){return this.getTextureInfo(this.data.normalTexture,2,"normalTexture")}get occlusionTexture(){return this.getTextureInfo(this.data.occlusionTexture,3,"occlusionTexture")}get emissiveTexture(){return this.getTextureInfo(this.data.emissiveTexture,4,"emissiveTexture")}get textures(){return[this.baseColorTexture,this.metallicRoughnessTexture,this.normalTexture,this.occlusionTexture,this.emissiveTexture].filter(t=>!!t).values()}getTextureInfo(e,t,n){return e?this.iterator.getOrCreateNested(e,()=>new cg(this.iterator,"textureInfo",t,e,`${this.path}.${n}`,this)):void 0}},cg=class extends Zs{get texture(){return this.iterator.resolveTexture(this.data.index,`${this.path}.index`)}},ug=class extends Xe{get primitives(){return io(this.data.primitives,(e,t)=>this.iterator.getOrCreateNested(e,()=>new fg(this.iterator,"primitive",t,e,`${this.path}.primitives[${t}]`,this)))}},fg=class extends Zs{get attributes(){return new Map(Object.entries(this.data.attributes).map(([e,t])=>[e,this.iterator.resolveAccessor(t,`${this.path}.attributes.${e}`)]))}get indices(){return this.data.indices===void 0?void 0:this.iterator.resolveAccessor(this.data.indices,`${this.path}.indices`)}get material(){return this.data.material===void 0?void 0:this.iterator.resolveMaterial(this.data.material,`${this.path}.material`)}get targets(){return(this.data.targets||[]).map((e,t)=>new Map(Object.entries(e).map(([n,s])=>[n,this.iterator.resolveAccessor(s,`${this.path}.targets[${t}].${n}`)])))}},lg=class extends Xe{get camera(){return this.data.camera===void 0?void 0:this.iterator.resolveCamera(this.data.camera,`${this.path}.camera`)}get children(){return io(this.data.children||[],(e,t)=>this.iterator.resolveNode(e,`${this.path}.children[${t}]`))}get skin(){return this.data.skin===void 0?void 0:this.iterator.resolveSkin(this.data.skin,`${this.path}.skin`)}get mesh(){return this.data.mesh===void 0?void 0:this.iterator.resolveMesh(this.data.mesh,`${this.path}.mesh`)}get externalAsset(){return this.data.externalAsset===void 0?void 0:this.iterator.resolveExternalAsset(this.data.externalAsset,`${this.path}.externalAsset`)}},dg=class extends Xe{},hg=class extends Xe{get nodes(){return io(this.data.nodes||[],(e,t)=>this.iterator.resolveNode(e,`${this.path}.nodes[${t}]`))}},pg=class extends Xe{get inverseBindMatrices(){return this.data.inverseBindMatrices===void 0?void 0:this.iterator.resolveAccessor(this.data.inverseBindMatrices,`${this.path}.inverseBindMatrices`)}get skeleton(){return this.data.skeleton===void 0?void 0:this.iterator.resolveNode(this.data.skeleton,`${this.path}.skeleton`)}get joints(){return io(this.data.joints,(e,t)=>this.iterator.resolveNode(e,`${this.path}.joints[${t}]`))}},mg=class extends Xe{get sampler(){return this.data.sampler===void 0?void 0:this.iterator.resolveSampler(this.data.sampler,`${this.path}.sampler`)}get source(){return this.data.source===void 0?void 0:this.iterator.resolveImage(this.data.source,`${this.path}.source`)}},se=class{gltf;objectCache=new WeakMap;referencesCache=new WeakMap;constructor(e){this.gltf=e}get data(){return this.gltf.json}getTypedArrayForBufferView(e){return fr(this.data,this.gltf.buffers,e)}getTypedArrayForAccessor(e){return Xl(this.data,this.gltf.buffers,e)}getTypedArrayForImageData(e){return tI(this.data,this.gltf.buffers,e)}getLoadedBuffer(e){let t=this.getMetadata(e);return this.gltf.buffers[t.index]}getLoadedBufferView(e){let t=this.getReferences(e).buffer,n=this.getLoadedBuffer(t);if(!n)return;let s=n.byteOffset+(e.byteOffset||0);return new Uint8Array(n.arrayBuffer,s,e.byteLength)}getLoadedImage(e){return this.gltf.images?.[this.getMetadata(e).index]}getLoadedFile(e){return this.gltf.files?.[this.getMetadata(e).index]}getLoadedExternalAsset(e){return this.gltf.externalAssets?.[this.getMetadata(e).index]}addBuffer(e){let t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return this.gltf.buffers.push({arrayBuffer:t,byteOffset:0,byteLength:e.byteLength}),this.data.buffers||=[],this.data.buffers.push({byteLength:e.byteLength}),this.data.buffers.length-1}addBufferView(e,t,n=0){return this.data.bufferViews||=[],this.data.bufferViews.push({buffer:e,byteOffset:n,byteLength:t}),this.data.bufferViews.length-1}addAccessor(e,t){return this.data.accessors||=[],this.data.accessors.push({bufferView:e,type:la(t.size),componentType:t.componentType,count:t.count,min:t.min,max:t.max}),this.data.accessors.length-1}getReferences(e){let t=this.referencesCache.get(e);if(t)return t;let n=this.getObjectIterator(e),s=zR(n);return this.referencesCache.set(e,s),s}getMetadata(e){let t=this.getObjectIterator(e),n=t instanceof Zs?t.parent.data:void 0;return{gltf:this.gltf,type:t.type,index:t.index,parent:n,path:t.path}}get scene(){return this.data.scene===void 0?void 0:this.resolveScene(this.data.scene,"scene").data}get thumbnail(){return this.data.asset.thumbnail===void 0?void 0:this.resolveImage(this.data.asset.thumbnail,"asset.thumbnail").data}get accessors(){return this.iterateCollectionData("accessor")}get animations(){return this.iterateCollectionData("animation")}get buffers(){return this.iterateCollectionData("buffer")}get bufferViews(){return this.iterateCollectionData("bufferView")}get cameras(){return this.iterateCollectionData("camera")}get externalAssets(){return this.iterateCollectionData("externalAsset")}get files(){return this.iterateCollectionData("file")}get images(){return this.iterateCollectionData("image")}get materials(){return this.iterateCollectionData("material")}get meshes(){return this.iterateCollectionData("mesh")}get nodes(){return this.iterateCollectionData("node")}get samplers(){return this.iterateCollectionData("sampler")}get scenes(){return this.iterateCollectionData("scene")}get skins(){return this.iterateCollectionData("skin")}get textures(){return this.iterateCollectionData("texture")}hasExtension(e){return!!this.data.extensionsUsed?.includes(e)||!!this.data.extensionsRequired?.includes(e)}isExtensionRequired(e){return!!this.data.extensionsRequired?.includes(e)}getExtension(e,t){let n=typeof e=="string"?this.data:e,s=typeof e=="string"?e:t;return n.extensions?.[s]}setExtension(e,t,n){let s=typeof e=="string",i=s?this.data:e,o=s?e:t,a=s?t:n,c=s?!!n:!1;i.extensions||={},i.extensions[o]=a,this.registerUsedExtension(o),c&&this.registerRequiredExtension(o)}registerUsedExtension(e){this.data.extensionsUsed||=[],this.data.extensionsUsed.includes(e)||this.data.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.data.extensionsRequired||=[],this.data.extensionsRequired.includes(e)||this.data.extensionsRequired.push(e)}removeExtension(e,t){let n=typeof e=="string",s=n?this.data:e,i=n?e:t;s.extensions?.[i]!==void 0&&(this.recordRemovedExtension(i),delete s.extensions[i]),n&&(iI(this.data.extensionsUsed,i),iI(this.data.extensionsRequired,i))}recordRemovedExtension(e){let t=this.data;t.extensionsRemoved||=[],t.extensionsRemoved.includes(e)||t.extensionsRemoved.push(e)}resolveAccessor(e,t){return this.resolveCollectionObject("accessor",e,t)}resolveBuffer(e,t){return this.resolveCollectionObject("buffer",e,t)}resolveBufferView(e,t){return this.resolveCollectionObject("bufferView",e,t)}resolveCamera(e,t){return this.resolveCollectionObject("camera",e,t)}resolveExternalAsset(e,t){return this.resolveCollectionObject("externalAsset",e,t)}resolveFile(e,t){return this.resolveCollectionObject("file",e,t)}resolveImage(e,t){return this.resolveCollectionObject("image",e,t)}resolveMaterial(e,t){return this.resolveCollectionObject("material",e,t)}resolveMesh(e,t){return this.resolveCollectionObject("mesh",e,t)}resolveNode(e,t){return this.resolveCollectionObject("node",e,t)}resolveSampler(e,t){return this.resolveCollectionObject("sampler",e,t)}resolveScene(e,t){return this.resolveCollectionObject("scene",e,t)}resolveSkin(e,t){return this.resolveCollectionObject("skin",e,t)}resolveTexture(e,t){return this.resolveCollectionObject("texture",e,t)}getOrCreateNested(e,t){return this.getOrCreate(e,t)}iterateCollection(e){let t=this.getCollection(e);return io(t,(n,s)=>this.resolveCollectionObject(e,s,e))}iterateCollectionData(e){return(function*(n){for(let s of n.iterateCollection(e))yield s.data})(this)}getObjectIterator(e){let t=this.objectCache.get(e);if(!t)throw new Error("glTF object is not registered with this iterator");return t}resolveCollectionObject(e,t,n){let i=this.getCollection(e)[t];if(!i)throw new Error(`Invalid glTF reference at ${n}: ${e} index ${t} is out of range`);return this.getOrCreate(i,()=>this.createCollectionObject(e,t,i))}getCollection(e){switch(e){case"accessor":return this.data.accessors||[];case"animation":return this.data.animations||[];case"buffer":return this.data.buffers||[];case"bufferView":return this.data.bufferViews||[];case"camera":return this.data.cameras||[];case"externalAsset":return this.data.externalAssets||[];case"file":return this.data.files||[];case"image":return this.data.images||[];case"material":return this.data.materials||[];case"mesh":return this.data.meshes||[];case"node":return this.data.nodes||[];case"sampler":return this.data.samplers||[];case"scene":return this.data.scenes||[];case"skin":return this.data.skins||[];case"texture":return this.data.textures||[]}}createCollectionObject(e,t,n){let s=`${WR(e)}[${t}]`;switch(e){case"accessor":return new Yb(this,e,t,n,s);case"animation":return new Qb(this,e,t,n,s);case"buffer":return new tg(this,e,t,n,s);case"bufferView":return new rg(this,e,t,n,s);case"camera":return new ng(this,e,t,n,s);case"externalAsset":return new sg(this,e,t,n,s);case"file":return new ig(this,e,t,n,s);case"image":return new og(this,e,t,n,s);case"material":return new ag(this,e,t,n,s);case"mesh":return new ug(this,e,t,n,s);case"node":return new lg(this,e,t,n,s);case"sampler":return new dg(this,e,t,n,s);case"scene":return new hg(this,e,t,n,s);case"skin":return new pg(this,e,t,n,s);case"texture":return new mg(this,e,t,n,s)}}getOrCreate(e,t){let n=this.objectCache.get(e);if(n)return n;let s=t();return this.objectCache.set(e,s),s}}});function oI(r){return(r%1+1)%1}function Jc(r,e){return cI[e]*aI[r]}function da(r,e,t,n){if(t!=="UINT8"&&t!=="UINT16"&&t!=="UINT32"&&t!=="UINT64")return null;let s=r.getTypedArrayForBufferView(e),i=ha(s,"SCALAR",t,n+1);if(i instanceof BigInt64Array||i instanceof BigUint64Array){let o=new Float64Array(i.length),a=BigInt(Number.MAX_SAFE_INTEGER);for(let c=0;c<i.length;c++){let u=i[c];if(u<0n||u>a)throw new Error("EXT_structural_metadata: UINT64 offset exceeds the safe integer range");o[c]=Number(u)}return o}return i}function ha(r,e,t,n=1){let s=aI[e],i=$R[t],o=cI[t],a=n*s,c=a*o,u=r.buffer,f=r.byteOffset;return f%o!==0&&(u=new Uint8Array(u).slice(f,f+c).buffer,f=0),new i(Qi(u),f,a)}function pa(r,e,t){let n=`TEXCOORD_${e.texCoord||0}`,s=t.attributes[n],i=r.getTypedArrayForAccessor(s),o=r.gltf.json,a=e.index,c=o.textures?.[a]?.source;if(typeof c<"u"){let u=o.images?.[c]?.mimeType,f=r.gltf.images?.[c];if(f&&typeof f.width<"u"&&!("compressed"in f&&f.compressed)){let l=[];for(let d=0;d<i.length;d+=2){let h=qR(f,u,i,d,e.channels);l.push(h)}return l}}return[]}function Yl(r,e,t,n,s){if(!t?.length)return;let i=[];for(let l of t){let d=n.findIndex(h=>h===l);d===-1&&(d=n.push(l)-1),i.push(d)}let o=new Uint32Array(i),a=r instanceof se?r:new se(r.gltf),c=a.addBuffer(o),u=a.addBufferView(c,o.byteLength),f=a.addAccessor(u,{size:1,componentType:zn(o),count:o.length});s.attributes[e]=f}function qR(r,e,t,n,s=[0]){let i={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},o=t[n],a=t[n+1],c=1;e&&(e.indexOf("image/jpeg")!==-1||e.indexOf("image/png")!==-1)&&(c=4);let u=KR(o,a,r,c),f=0;for(let l of s){let d=typeof l=="number"?Object.values(i)[l]:i[l],h=u+d.offset,m=$c(r);if(m.data.length<=h)throw new Error(`${m.data.length} <= ${h}`);let b=m.data[h];f|=b<<d.shift}return f}function KR(r,e,t,n=1){let s=t.width,i=oI(r)*(s-1),o=Math.round(i),a=t.height,c=oI(e)*(a-1),u=Math.round(c),f=t.components?t.components:n;return(u*s+o)*f}function Yc(r,e,t,n=1){let s=[];for(let i=0;i<e;i++){let o=Number(t[i]),a=Number(t[i+1])-o;if(!Number.isInteger(o)||!Number.isInteger(a)||o<0||a<0||(o+a)*n>r.length)break;let c=o*n,u=a*n;s.push(r.slice(c,c+u))}return s}function Qc(r,e,t,n=1){let s=[],i=t*n;for(let o=0;o<e;o++){let a=o*i;s.push(r.slice(a,a+i))}return s}function Ql(r,e,t,n,s){let i=new TextDecoder("utf8");if(t){if(!n)throw new Error("stringOffsets is required for variable-length string arrays");let o=[];for(let a=0;a<r;a++){let c=t[a],u=t[a+1],f=[];for(let l=c;l<u;l++){let d=n[l],h=n[l+1],m=e.subarray(d,h);f.push(i.decode(m))}o.push(f)}return o}if(n){let o=[],a=r*(s||1);for(let c=0;c<a;c++){let u=Number(n[c]),f=Number(n[c+1]);u>=0&&f>=u&&f<=e.length&&o.push(i.decode(e.subarray(u,f)))}return s?Array.from({length:r},(c,u)=>o.slice(u*s,(u+1)*s)):o}return[]}var aI,$R,cI,Zl=p(()=>{"use strict";Ke();Qs();jn();ke();aI={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},$R={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},cI={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8}});var bg={};J(bg,{createExtMeshFeatures:()=>eD,decode:()=>HR,encode:()=>JR,name:()=>XR});async function HR(r,e){let t=new se(r);YR(t,e)}function JR(r,e){let t=new ln(r);return ZR(t,e),t.createBinaryChunk(),t.gltf}function YR(r,e){for(let t of r.meshes)for(let n of r.getReferences(t).primitives)QR(r,n,e)}function QR(r,e,t){let s=r.getExtension(e,ma)?.featureIds||[];if(s)for(let i of s){let o;if(typeof i.attribute<"u"){if(!t?.gltf?.loadBuffers)continue;let a=`_FEATURE_ID_${i.attribute}`,c=e.attributes[a];o=r.getTypedArrayForAccessor(c)}else if(typeof i.texture<"u"){if(!t?.gltf?.loadImages)continue;o=pa(r,i.texture,e)}else{let a=e.attributes.POSITION,c=typeof a=="number"?r.data.accessors?.[a]?.count:a?.count;if(typeof c!="number"||!Number.isInteger(c)||c<0)throw new Error("EXT_mesh_features: implicit feature IDs require a POSITION accessor");if(i.featureCount!==c)throw new Error(`EXT_mesh_features: implicit featureCount ${i.featureCount} does not match vertex count ${c}`);delete i.data,Object.defineProperty(i,"implicit",{configurable:!0,enumerable:!1,writable:!0,value:{start:0,count:c}})}o&&(i.data=o,delete i.implicit)}}function ZR(r,e){let t=r.gltf.json.meshes;if(t)for(let n of t)for(let s of n.primitives)tD(r,s)}function eD(r,e,t,n){e.extensions||(e.extensions={});let s=e.extensions[ma];s||(s={featureIds:[]},e.extensions[ma]=s);let{featureIds:i}=s,o={featureCount:t.length,propertyTable:n,data:t};i.push(o),r.addObjectExtension(e,ma,s)}function tD(r,e){let t=e.extensions?.[ma];if(!t)return;let n=t.featureIds;n.forEach((s,i)=>{if(s.data){let{accessorKey:o,index:a}=rD(e.attributes),c=new Uint32Array(s.data);n[i]={featureCount:c.length,propertyTable:s.propertyTable,attribute:a};let u=r.addBufferView(c),f=r.addAccessor(u,{size:1,componentType:zn(c),count:c.length});e.attributes[o]=f}})}function rD(r){let e="_FEATURE_ID_",t=Object.keys(r).filter(i=>i.indexOf(e)===0),n=-1;for(let i of t){let o=Number(i.substring(e.length));o>n&&(n=o)}return n++,{accessorKey:`${e}${n}`,index:n}}var ma,XR,uI=p(()=>{"use strict";Hc();Ke();Zl();Qs();ma="EXT_mesh_features",XR=ma});var xg={};J(xg,{createExtStructuralMetadata:()=>ED,decode:()=>sD,encode:()=>iD,name:()=>nD});async function sD(r,e,t){let n=new se(r),s=n.getExtension(oo);if(e.gltf?.loadBuffers&&s?.schemaUri&&!s.schema){if(!t?.fetch)throw new Error("EXT_structural_metadata: a loader context is required to load schemaUri");let i=Gn(s.schemaUri,e,t),o=await t.fetch(i);if(!o.ok)throw new Error(`EXT_structural_metadata: failed to load schemaUri ${i} (${o.status})`);s.schema=await o.json()}oD(n,e)}function iD(r,e){let t=new ln(r);return ID(t,e),t.createBinaryChunk(),t.gltf}function oD(r,e){if(!e.gltf?.loadBuffers)return;let t=r.getExtension(oo);t&&(e.gltf?.loadImages&&aD(r,t),cD(r,t))}function aD(r,e){let t=e.propertyTextures,n=r.data;if(t&&n.meshes)for(let s of n.meshes)for(let i of s.primitives)uD(r,t,i,e)}function cD(r,e){let t=e.schema;if(!t)return;let n=t.classes,s=e.propertyTables;if(n&&s)for(let i of s)i.class&&n[i.class]&&lD(r,t,i)}function uD(r,e,t,n){if(!e)return;let i=t.extensions?.[oo]?.propertyTextures;if(i)for(let o of i){let a=e[o];fD(r,a,t,n)}}function fD(r,e,t,n){if(!e.properties)return;n.dataAttributeNames||(n.dataAttributeNames=[]);let s=e.class;for(let i in e.properties){let o=`${s}_${i}`,a=e.properties?.[i];if(!a)continue;a.data||(a.data=[]);let c=a.data,u=pa(r,a,t);u!==null&&(Yl(r,o,u,c,t),a.data=c,n.dataAttributeNames.push(o))}}function lD(r,e,t){let n=e.classes?.[t.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${t.class}`);let s=t.count;for(let i in n.properties){let o=n.properties[i],a=t.properties?.[i];if(a){let c={},u=dD(r,e,o,s,a,c);a.data=u,c.value!==void 0&&Object.defineProperty(a,"rawData",{value:c.value,configurable:!0,enumerable:!1,writable:!0})}}}function dD(r,e,t,n,s,i){let o=[],a=s.values,c=r.getTypedArrayForBufferView(a),u=pD(r,t,s,n),f=mD(r,t,s,n,u);switch(t.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{let l=bD(t,s,n,c,u);o=l.data,i&&(i.value=l.rawData);break}case"BOOLEAN":{o=hD(t,n,c,u);break}case"STRING":{o=Ql(n,c,u,f,t.array?t.count:void 0);break}case"ENUM":{o=xD(e,t,n,c,u);break}default:throw new Error(`Unknown classProperty type ${t.type}`)}return o}function hD(r,e,t,n){return r.array?n?Array.from({length:e},(s,i)=>{let o=Number(n[i]),a=Number(n[i+1]);if(!Number.isInteger(o)||!Number.isInteger(a)||o<0||a<o)throw new Error("EXT_structural_metadata: invalid BOOLEAN array offsets");return gg(t,o,a-o)}):r.count===void 0?[]:Array.from({length:e},(s,i)=>gg(t,i*r.count,r.count)):gg(t,0,e)}function gg(r,e,t){if(e+t>r.byteLength*8)throw new Error("EXT_structural_metadata: BOOLEAN values exceed their buffer view");return Array.from({length:t},(n,s)=>{let i=e+s;return!!(r[Math.floor(i/8)]&1<<i%8)})}function pD(r,e,t,n){return e.array&&typeof e.count>"u"&&typeof t.arrayOffsets<"u"?da(r,t.arrayOffsets,t.arrayOffsetType||"UINT32",n):null}function mD(r,e,t,n,s){if(typeof t.stringOffsets<"u"){let i=s?Number(s[n]):n*(e.array&&e.count||1);return da(r,t.stringOffsets,t.stringOffsetType||"UINT32",i)}return null}function bD(r,e,t,n,s){let i=r.array,o=r.count,a={VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16}[r.type]||1,c=Jc(r.type,r.componentType),u=n.byteLength/c,f;r.componentType?f=ha(n,r.type,r.componentType,u):f=n;let l=f,d=e.offset??r.offset,h=e.scale??r.scale,m=r.normalized||d!==void 0||h!==void 0?gD(l,r.componentType,r.type,r.normalized,d,h):l;return i?s?{data:Yc(m,t,s,a),rawData:Yc(l,t,s,a)}:o?{data:Qc(m,t,o,a),rawData:Qc(l,t,o,a)}:{data:[],rawData:[]}:{data:m,rawData:l}}function gD(r,e,t,n,s,i){let o=wD(e),a=!!(n&&o!==void 0);if(!a&&s===void 0&&i===void 0)return r;let c=yD(t),u=new Float64Array(r.length);for(let f=0;f<r.length;f++){let l=Number(r[f]);a&&(l=e?.startsWith("INT")?Math.max(l/o,-1):l/o);let d=f%c,h=Array.isArray(s)?s[d]??0:s??0,m=Array.isArray(i)?i[d]??1:i??1;u[f]=l*m+h}return u}function yD(r){switch(r){case"VEC2":return 2;case"VEC3":return 3;case"VEC4":return 4;case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16;default:return 1}}function wD(r){switch(r){case"INT8":return 127;case"UINT8":return 255;case"INT16":return 32767;case"UINT16":return 65535;case"INT32":return 2147483647;case"UINT32":return 4294967295;case"INT64":return 2**63-1;case"UINT64":return 2**64-1;default:return}}function xD(r,e,t,n,s){let i=e.enumType;if(!i)throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");let o=r.enums?.[i];if(!o)throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${i}`);let a=o.valueType||"UINT16",c=Jc(e.type,a),u=n.byteLength/c,f=ha(n,e.type,a,u);if(f||(f=n),e.array){if(s)return TD({valuesData:f,numberOfElements:t,arrayOffsets:s,enumEntry:o});let l=e.count;return l?_D(f,t,l,o):[]}return wg(f,0,t,o)}function TD(r){let{valuesData:e,numberOfElements:t,arrayOffsets:n,enumEntry:s}=r,i=[];for(let o=0;o<t;o++){let a=Number(n[o]),c=Number(n[o+1])-a;if(!Number.isInteger(a)||!Number.isInteger(c)||a<0||c<0||a+c>e.length)break;let u=wg(e,a,c,s);i.push(u)}return i}function _D(r,e,t,n){let s=[];for(let i=0;i<e;i++){let o=t*i,a=wg(r,o,t,n);s.push(a)}return s}function wg(r,e,t,n){let s=[];for(let i=0;i<t;i++){let o=r[e+i],a=AD(n,o);a?s.push(a.name):s.push("")}return s}function AD(r,e){for(let t of r.values)if(typeof e=="bigint"?Number.isSafeInteger(t.value)&&BigInt(t.value)===e:t.value===e)return t;return null}function ID(r,e){let t=r.getExtension(oo);if(t&&t.propertyTables)for(let n of t.propertyTables){let s=n.class,i=t.schema?.classes?.[s];n.properties&&i&&SD(n,i,r)}}function SD(r,e,t){for(let n in r.properties){let s=r.properties[n].data;if(s){let i=e.properties[n];if(i){let o=FD(s,i,t);r.properties[n]=o}}}}function ED(r,e,t=vD){let n=r.getExtension(oo);n||(n=r.addExtension(oo)),n.schema=LD(e,t,n.schema);let s=BD(e,t,n.schema);return n.propertyTables||(n.propertyTables=[]),n.propertyTables.push(s)-1}function LD(r,e,t){let n=t??{id:"schema_id"},s={properties:{}};for(let i of r){let o={type:i.elementType,componentType:i.componentType};s.properties[i.name]=o}return n.classes={},n.classes[e]=s,n}function BD(r,e,t){let n={class:e,count:0},s=0,i=t.classes?.[e];for(let o of r){if(s===0&&(s=o.values.length),s!==o.values.length&&o.values.length)throw new Error("Illegal values in attributes");i?.properties[o.name]&&(n.properties||(n.properties={}),n.properties[o.name]={values:0,data:o.values})}return n.count=s,n}function FD(r,e,t){let n={values:0};if(e.type==="STRING"){let{stringData:s,stringOffsets:i}=RD(r);n.stringOffsets=yg(i,t),n.values=yg(s,t)}else if(e.type==="SCALAR"&&e.componentType){let s=MD(r,e.componentType);n.values=yg(s,t)}return n}function MD(r,e){let t=[];for(let s of r)t.push(Number(s));let n=OD[e];if(!n)throw new Error("Illegal component type");return new n(t)}function RD(r){let e=new TextEncoder,t=[],n=0;for(let c of r){let u=e.encode(c);n+=u.length,t.push(u)}let s=new Uint8Array(n),i=[],o=0;for(let c of t)s.set(c,o),i.push(o),o+=c.length;i.push(o);let a=new Uint32Array(i);return{stringData:s,stringOffsets:a}}function yg(r,e){return e.addBufferView(r)}var oo,nD,vD,OD,fI=p(()=>{"use strict";Hc();Ke();Zl();qc();oo="EXT_structural_metadata",nD=oo;vD="schemaClassId";OD={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:Int32Array,UINT64:Uint32Array,FLOAT32:Float32Array,FLOAT64:Float64Array}});var _g={};J(_g,{SPZ_COMPRESSION_EXTENSION_NAME:()=>ed,decode:()=>ND,getGaussianSplatPrimitives:()=>lI,name:()=>Tg});async function ND(r,e,t){let n=t?.loaders?.find(o=>o.extensions?.includes("spz")),s=lI(r),i=new se(r);for(let[o,a]of(r.json.meshes||[]).entries())for(let[c,u]of a.primitives.entries()){let f=u.extensions?.[Tg];if(!f)continue;CD(r.json,u,f,o,c,i);let l=f.extensions?.[ed];if(l){let d=s.find(h=>h.meshIndex===o&&h.primitiveIndex===c);if(d){let h=e?.gltf?.splatDecoder,m=r.json.bufferViews?.[l.bufferView];if(m&&r.buffers[m.buffer])d.compressedBytes=kD(r,l.bufferView);else if(h||n)throw new Error(`KHR_gaussian_splatting: bufferView ${l.bufferView} is not loaded for SPZ2 decoding.`);n&&t&&d.compressedBytes?d.decoded=await Ws(d.compressedBytes.buffer,n,{...e,splats:{...e.splats,sourceCoordinateSystem:"LUF"}},t):h&&d.compressedBytes&&(d.decoded=await h(d.compressedBytes.buffer,{sourceCoordinateSystem:"LUF"}))}}}s.length&&(r.gaussianSplatPrimitives=s)}function kD(r,e){let t=r.json.bufferViews?.[e];if(!t)throw new Error(`KHR_gaussian_splatting: bufferView ${e} is not defined.`);let n=r.buffers[t.buffer];if(!n)throw new Error(`KHR_gaussian_splatting: buffer ${t.buffer} is not loaded for SPZ2 payload.`);let s=n.byteOffset+(t.byteOffset||0);return new Uint8Array(n.arrayBuffer,s,t.byteLength).slice()}function lI(r){let e="json"in r?r.json:r,t=[];for(let[n,s]of(e.meshes||[]).entries())for(let[i,o]of s.primitives.entries()){let a=o.extensions?.[Tg];if(!a)continue;let c=a.extensions?.[ed]?.bufferView;t.push({meshIndex:n,primitiveIndex:i,attributes:{...o.attributes},extension:a,compressedBufferView:c})}return t}function CD(r,e,t,n,s,i){if((e.mode??4)!==0)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} must use POINTS mode.`);if(typeof t.kernel!="string"||t.kernel.length===0)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} is missing kernel.`);if(typeof t.colorSpace!="string"||t.colorSpace.length===0)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} is missing colorSpace.`);let o=t.extensions?.[ed]?.bufferView;if(o!==void 0){if(!Number.isInteger(o)||o<0||o>=(r.bufferViews||[]).length)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} has an invalid SPZ bufferView.`)}else for(let a of DD)if(e.attributes[a]===void 0)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} is missing ${a}.`);for(let[a,c]of Object.entries(e.attributes))if(!Number.isInteger(c)||c<0||c>=(r.accessors||[]).length)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} has invalid accessor ${a}.`);UD(r,e,i,n,s);for(let a=1;a<=3;a++){let c=a*2+1,u=Array.from({length:c},(f,l)=>e.attributes[`KHR_gaussian_splatting:SH_DEGREE_${a}_COEF_${l}`]!==void 0);if(u.some(Boolean)&&!u.every(Boolean))throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} has incomplete SH degree ${a}.`);if(u.some(Boolean)&&a>1){let f=a-1,l=f*2+1;for(let d=0;d<l;d++)if(e.attributes[`KHR_gaussian_splatting:SH_DEGREE_${f}_COEF_${d}`]===void 0)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} skips SH degree ${f}.`)}}}function UD(r,e,t,n,s){let i=e.attributes["KHR_gaussian_splatting:SCALE"],o=e.attributes["KHR_gaussian_splatting:OPACITY"];for(let[a,c,u]of[["KHR_gaussian_splatting:SCALE",i,f=>f>=0],["KHR_gaussian_splatting:OPACITY",o,f=>f>=0&&f<=1]]){if(c===void 0||!VD(r,t,c))continue;let f=t.getTypedArrayForAccessor(c);for(let l=0;l<f.length;l++)if(!u(Number(f[l])))throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} has an invalid ${a} value.`)}}function VD(r,e,t){let n=r.accessors?.[t],s=n?.bufferView===void 0?void 0:r.bufferViews?.[n.bufferView];return!!(s&&e.gltf.buffers[s.buffer])}var Tg,ed,DD,dI=p(()=>{"use strict";ke();Ke();Tg="KHR_gaussian_splatting",ed="KHR_gaussian_splatting_compression_spz_2",DD=["POSITION","KHR_gaussian_splatting:ROTATION","KHR_gaussian_splatting:SCALE","KHR_gaussian_splatting:OPACITY","KHR_gaussian_splatting:SH_DEGREE_0_COEF_0"]});var vg={};J(vg,{decode:()=>PD,getVoxelPrimitives:()=>jD,name:()=>Ag});async function PD(r){for(let[e,t]of(r.json.meshes||[]).entries())for(let[n,s]of t.primitives.entries()){let i=s.extensions?.[Ag];i&&GD(r.json,s,i,e,n)}}function jD(r){let e="json"in r?r.json:r,t=[];for(let[n,s]of(e.meshes||[]).entries())for(let[i,o]of s.primitives.entries()){let a=o.extensions?.[Ag];a&&t.push({meshIndex:n,primitiveIndex:i,attributes:{...o.attributes},extension:a})}return t}function GD(r,e,t,n,s){if(!Number.isInteger(t.shape)||t.shape<0)throw new Error(`EXT_primitive_voxels: mesh ${n} primitive ${s} has invalid shape.`);if(!Array.isArray(t.dimensions)||t.dimensions.length!==3||t.dimensions.some(i=>!Number.isInteger(i)||i<=0))throw new Error(`EXT_primitive_voxels: mesh ${n} primitive ${s} must provide three positive dimensions.`);if(e.mode!==void 0&&e.mode!==2147483647)throw new Error(`EXT_primitive_voxels: mesh ${n} primitive ${s} must use voxel mode.`);for(let i of Object.keys(e.attributes)){let o=e.attributes[i];if(!Number.isInteger(o)||o<0||o>=(r.accessors||[]).length)throw new Error(`EXT_primitive_voxels: mesh ${n} primitive ${s} has invalid accessor ${i}.`)}}var Ag,hI=p(()=>{"use strict";Ag="EXT_primitive_voxels"});var Ig={};J(Ig,{decode:()=>WD,getPrimitiveRestartRanges:()=>td,name:()=>ei});async function WD(r,e){if(!r.json.extensionsUsed?.includes(ei))return;if(!r.json.extensionsRequired?.includes(ei))throw new Error(`${ei} must be declared in extensionsRequired`);if(!e.gltf?.loadBuffers)return;let t=new se(r);for(let n of t.meshes)for(let s of t.getReferences(n).primitives)$D(t,s)}function $D(r,e){if(e.indices===void 0)return;let t=e.indices,n=typeof t=="number"?r.data.accessors?.[t]:t;if(!n)throw new Error(`${ei}: primitive references missing indices accessor ${e.indices}`);let s=qD(n),i=r.getTypedArrayForAccessor(e.indices),o=Array.prototype.includes.call(i,s);if(!zD.has(e.mode??4)){if(o)throw new Error(`${ei}: primitive restart is not valid for mode ${e.mode??4}`);return}Object.defineProperty(e,"primitiveRestart",{configurable:!0,enumerable:!1,writable:!0,value:{restartIndex:s,ranges:td(i,s)}})}function qD(r){if(r.type!=="SCALAR")throw new Error(`${ei}: indices accessor must have SCALAR type`);switch(r.componentType){case 5121:return 255;case 5123:return 65535;case 5125:return 4294967295;default:throw new Error(`${ei}: indices accessor must use an unsigned integer component type`)}}function td(r,e){let t=[],n=0;for(let s=0;s<=r.length;s++)(s===r.length||r[s]===e)&&(s>n&&t.push({offset:n,count:s-n}),n=s+1);return t}var ei,zD,Sg=p(()=>{"use strict";Ke();ei="KHR_mesh_primitive_restart",zD=new Set([2,3,5,6])});var Eg={};J(Eg,{decode:()=>KD,name:()=>Gt});async function KD(r,e){if(!e.gltf?.loadBuffers)return;let t=new se(r);for(let n of t.meshes)for(let s of t.getReferences(n).primitives){let i=t.getExtension(s,Gt);i&&Object.defineProperty(i,"data",{configurable:!0,enumerable:!1,writable:!0,value:XD(t,s,i)})}}function XD(r,e,t){if(!Number.isInteger(t.count)||t.count<1)throw new Error(`${Gt}: count must be a positive integer`);if((e.mode??4)!==4||e.indices===void 0)throw new Error(`${Gt}: primitive must use TRIANGLES mode with indices`);let n=rd(r,e.indices,"indices"),s=rd(r,t.indicesOffsets,"indicesOffsets",t.count),i=rd(r,t.loopIndices,"loopIndices"),o=rd(r,t.loopIndicesOffsets,"loopIndicesOffsets",t.count),a=r.data.accessors?.[t.loopIndices],c=HD(a.componentType);pI(s,n.length,"indicesOffsets"),pI(o,i.length,"loopIndicesOffsets");let u=[];for(let f=0;f<t.count;f++){let l=Number(s[f]),d=f+1<t.count?Number(s[f+1]):n.length,h=Number(o[f]),m=f+1<t.count?Number(o[f+1]):i.length,b=Array.from(i).slice(h,m),w=td(b,c).map(g=>({offset:g.offset+h,count:g.count}));if((d-l)%3!==0)throw new Error(`${Gt}: polygon ${f} triangle range must contain complete triangles`);if(w.length===0)throw new Error(`${Gt}: polygon ${f} must contain at least one loop`);if(w.some(g=>g.count<3))throw new Error(`${Gt}: polygon ${f} loops must contain at least three indices`);u.push({triangleRange:{offset:l,count:d-l},loopRanges:w})}return{indicesOffsets:s,loopIndices:i,loopIndicesOffsets:o,polygons:u}}function rd(r,e,t,n){if(typeof e=="number"&&(!Number.isInteger(e)||e<0))throw new Error(`${Gt}: ${t} must reference an accessor`);let s=typeof e=="number"?r.data.accessors?.[e]:e;if(!s)throw new Error(`${Gt}: ${t} references missing accessor ${e}`);if(s.type!=="SCALAR"||![5121,5123,5125].includes(s.componentType))throw new Error(`${Gt}: ${t} must be an unsigned integer SCALAR accessor`);if(n!==void 0&&s.count!==n)throw new Error(`${Gt}: ${t} count must equal polygon count ${n}`);return r.getTypedArrayForAccessor(e)}function pI(r,e,t){if(Number(r[0])!==0)throw new Error(`${Gt}: ${t} must begin at zero`);let n=-1;for(let s=0;s<r.length;s++){let i=Number(r[s]);if(!Number.isInteger(i)||i<0||i>=e||i<=n)throw new Error(`${Gt}: ${t} must contain increasing in-bounds offsets`);n=i}}function HD(r){switch(r){case 5121:return 255;case 5123:return 65535;case 5125:return 4294967295;default:throw new Error(`${Gt}: unsupported loop index component type ${r}`)}}var Gt,mI=p(()=>{"use strict";Ke();Sg();Gt="EXT_mesh_polygon"});var Lg={};J(Lg,{decode:()=>JD,getSpatialAudio:()=>bI,name:()=>ba});function bI(r){let e="asset"in r?r:r.json,t=[],n=e.extensions?.[ba];n&&t.push({nodeIndex:null,extension:n});for(let[s,i]of(e.nodes||[]).entries()){let o=i.extensions?.[ba];o&&t.push({nodeIndex:s,extension:o})}return t}async function JD(r){let e=bI(r);for(let{extension:t,nodeIndex:n}of e){let s=n===null?"root":`node ${n}`;for(let i of t.sources||[]){if(!Array.isArray(i.accessors)||i.accessors.length===0)throw new Error(`${ba}: ${s} source ${i.id} requires audio accessors.`);for(let o of i.accessors)if(!Number.isInteger(o)||o<0||!r.json.accessors?.[o])throw new Error(`${ba}: ${s} source ${i.id} has invalid accessor ${o}.`);if(i.reverbFeedGain&&i.reverbFeedGain.length!==(i.reverbFeed?.length||0))throw new Error(`${ba}: ${s} source ${i.id} has mismatched reverb feed gains.`)}}e.length&&(r.spatialAudio=e)}var ba,gI=p(()=>{"use strict";ba="MPEG_audio_spatial"});var Bg={};J(Bg,{decode:()=>YD,name:()=>zt});async function YD(r,e,t){let n=r.json.extensions?.[zt],s=(n?.audio||[]).map(c=>({audio:c})),i=n?.sources||[],o=n?.emitters||[];for(let c of i)c.audio!==void 0&&nd(s,c.audio,"audio");for(let c of o){if(c.type!=="global"&&c.type!=="positional")throw new Error(`${zt}: invalid emitter type ${c.type}.`);if(c.type==="global"&&c.positional!==void 0)throw new Error(`${zt}: global emitters cannot have positional settings.`);for(let u of c.sources||[])nd(i,u,"source")}let a=[];for(let c of["nodes","scenes"])for(let[u,f]of(r.json[c]||[]).entries()){let l=f.extensions?.[zt];if(l){if(!Array.isArray(l.emitters)||!l.emitters.length)throw new Error(`${zt}: ${c} ${u} requires emitters.`);for(let d of l.emitters){let h=nd(o,d,"emitter");if(c==="scenes"&&h.type!=="global")throw new Error(`${zt}: scenes may only reference global emitters.`);a.push({emitterIndex:d,nodeIndex:c==="nodes"?u:null,sceneIndex:c==="scenes"?u:null,emitter:h,sources:(h.sources||[]).map(m=>{let b=i[m];return{sourceIndex:m,source:b,clip:b.audio===void 0?void 0:s[b.audio]}})})}}}if(n){for(let c of s)QD(r,c);e.gltf?.loadAudio!==!1&&await Promise.all(s.map(c=>ZD(r,c,e,t))),r.audioClips=s,r.audioEmitters=a}}function nd(r,e,t){if(!Number.isInteger(e)||e<0||!r[e])throw new Error(`${zt}: invalid ${t} index ${e}.`);return r[e]}function QD(r,e){let{audio:t}=e;if(t.bufferView!==void 0){if(nd(r.json.bufferViews||[],t.bufferView,"bufferView"),!t.mimeType)throw new Error(`${zt}: buffer-view audio requires mimeType.`)}else if(!t.uri)throw new Error(`${zt}: audio requires a uri or bufferView.`)}async function ZD(r,e,t,n){let{audio:s}=e;if(s.bufferView!==void 0){let a=r.json.bufferViews[s.bufferView],c=r.buffers[a.buffer];if(!c){if(t.gltf?.loadBuffers===!1)return;throw new Error(`${zt}: audio buffer ${a.buffer} is not loaded.`)}let u=a.byteOffset??0,f=a.byteLength;if(!Number.isSafeInteger(u)||u<0||!Number.isSafeInteger(f)||f<0||u+f>c.byteLength||c.byteOffset+u+f>c.arrayBuffer.byteLength)throw new Error(`${zt}: audio bufferView exceeds its buffer.`);e.data=new Uint8Array(c.arrayBuffer,c.byteOffset+u,f);return}if(!n?.fetch)throw new Error(`${zt}: a loader context is required to load audio.`);let i=Gn(s.uri,t,n),o=await n.fetch(i);if(!o.ok)throw new Error(`${zt}: failed to load audio ${i} (${o.status}).`);e.url=i,e.data=new Uint8Array(await o.arrayBuffer())}var zt,yI=p(()=>{"use strict";qc();zt="KHR_audio_emitter"});var wI={};J(wI,{MeshoptDecoder:()=>eN});var eN,xI=p(()=>{"use strict";eN=(function(){var r="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuixkbeeeddddillviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WboY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbrl79IV9Rbwq;X8:kdbk:kYi5ud9:du8Jjjjjbcjq9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaicefhxcj;abad9Uc;WFbGcjdadca0EhmaialfgPar9Rgoadfhsavaoadz:jjjjbgzceVhHcbhOdndninaeaO9nmeaPax9RaD6mdamaeaO9RaOamfgoae6EgAcsfglc9WGhCaAcethXaxaDfhiaOaeaoaeao6E9RhQalcl4cifcd4hLazcjdfaAfhKcbhYabaOad2fg8AhEaHh3incbh5dnawTmbaxaYcd4fRbbh5kcbh8Eazcjdfhqinaih8Fdndndndna5a8Ecet4ciGgoc9:fPdebdkaPa8F9RaA6mrazcjdfa8EaA2fa8FaAz:jjjjb8Aa8FaAfhixdkazcjdfa8EaA2fcbaAz:kjjjb8Aa8FhixekaPa8F9RaL6mva8FaLfhidnaCTmbaPai9RcK6mbaocdtc:q:G:cjbfcj:G:cjbawEhaczhrcbhlinargoc9Wfghaqfhrdndndndndndnaaa8Fahco4fRbbalcoG4ciGcdtfydbPDbedvivvvlvkar9cb83bwar9cb83bbxlkarcbaiRbdai8Xbb9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbaqaofgrcGfcbaicdfa8J9c8N1:NfghRbbag9cjjjjjw:dg8J9qE86bbarcVfcbaha8J9c8M1:NfghRbbag9cjjjjjl:dg8J9qE86bbarc7fcbaha8J9c8L1:NfghRbbag9cjjjjjd:dg8J9qE86bbarctfcbaha8J9c8K1:NfghRbbag9cjjjjje:dg8J9qE86bbarc91fcbaha8J9c8J1:NfghRbbag9cjjjj;ab:dg8J9qE86bbarc4fcbaha8J9cg1:NfghRbbag9cjjjja:dg8J9qE86bbarc93fcbaha8J9ch1:NfghRbbag9cjjjjz:dgg9qE86bbarc94fcbahag9ca1:NfghRbbai8Xbe9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbarc95fcbaha8J9c8N1:NfgiRbbag9cjjjjjw:dg8J9qE86bbarc96fcbaia8J9c8M1:NfgiRbbag9cjjjjjl:dg8J9qE86bbarc97fcbaia8J9c8L1:NfgiRbbag9cjjjjjd:dg8J9qE86bbarc98fcbaia8J9c8K1:NfgiRbbag9cjjjjje:dg8J9qE86bbarc99fcbaia8J9c8J1:NfgiRbbag9cjjjj;ab:dg8J9qE86bbarc9:fcbaia8J9cg1:NfgiRbbag9cjjjja:dg8J9qE86bbarcufcbaia8J9ch1:NfgiRbbag9cjjjjz:dgg9qE86bbaiag9ca1:NfhixikaraiRblaiRbbghco4g8Ka8KciSg8KE86bbaqaofgrcGfaiclfa8Kfg8KRbbahcl4ciGg8La8LciSg8LE86bbarcVfa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc7fa8Ka8Lfg8KRbbahciGghahciSghE86bbarctfa8Kahfg8KRbbaiRbeghco4g8La8LciSg8LE86bbarc91fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc4fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc93fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc94fa8Kahfg8KRbbaiRbdghco4g8La8LciSg8LE86bbarc95fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc96fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc97fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc98fa8KahfghRbbaiRbigico4g8Ka8KciSg8KE86bbarc99faha8KfghRbbaicl4ciGg8Ka8KciSg8KE86bbarc9:faha8KfghRbbaicd4ciGg8Ka8KciSg8KE86bbarcufaha8KfgrRbbaiciGgiaiciSgiE86bbaraifhixdkaraiRbwaiRbbghcl4g8Ka8KcsSg8KE86bbaqaofgrcGfaicwfa8Kfg8KRbbahcsGghahcsSghE86bbarcVfa8KahfghRbbaiRbeg8Kcl4g8La8LcsSg8LE86bbarc7faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarctfaha8KfghRbbaiRbdg8Kcl4g8La8LcsSg8LE86bbarc91faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc4faha8KfghRbbaiRbig8Kcl4g8La8LcsSg8LE86bbarc93faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc94faha8KfghRbbaiRblg8Kcl4g8La8LcsSg8LE86bbarc95faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc96faha8KfghRbbaiRbvg8Kcl4g8La8LcsSg8LE86bbarc97faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc98faha8KfghRbbaiRbog8Kcl4g8La8LcsSg8LE86bbarc99faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc9:faha8KfghRbbaiRbrgicl4g8Ka8KcsSg8KE86bbarcufaha8KfgrRbbaicsGgiaicsSgiE86bbaraifhixekarai8Pbw83bwarai8Pbb83bbaiczfhikdnaoaC9pmbalcdfhlaoczfhraPai9RcL0mekkaoaC6moaimexokaCmva8FTmvkaqaAfhqa8Ecefg8Ecl9hmbkdndndndnawTmbasaYcd4fRbbgociGPlbedrbkaATmdazaYfh8Fazcjdfhhcbh8EaEhaina8FRbbhraahocbhlinaoahalfRbbgqce4cbaqceG9R7arfgr86bbaoadfhoaAalcefgl9hmbkaacefhaa8Fcefh8FahaAfhha8Ecefg8Ecl9hmbxikkaATmeazaYfhaazcjdfhhcbhoceh8EaKh8FinaEaofhlaa8Vbbhrcbhoinala8FaofRbbcwtahaofRbbgqVc;:FiGce4cbaqceG9R7arfgr87bbaladfhlaQaocefgofmbka8FaXfh8FcdhoaacdfhaahaXfhha8EceGhlcbh8EalmbxdkkaATmbaocl4h8EazaYfRbbhqcwhoa3hlinalRbbaotaqVhqalcefhlaocwfgoca9hmbkcbhhaEh8FaKhainazcjdfahfRbbhrcwhoaahlinalRbbaotarVhralaAfhlaocwfgoca9hmbkara8E94aq7hqcbhoa8Fhlinalaqao486bbalcefhlaocwfgoca9hmbka8Fadfh8FaacefhaahcefghaA9hmbkkaEclfhEa3clfh3aYclfgYad6mbkaza8AaAcufad2fadz:jjjjb8AaAaOfhOaihxaimbkc9:hoxdkcbc99aPax9RakSEhoxekc9:hokavcjqf8Kjjjjbaok:bsesu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecjez:kjjjb8Aav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhDaicefgiarfhqdndnaeci9pmbaqhexekcmcsawceSEhkcbhxcbhmaqhecbhlcbhoindndnaiRbbgrc;Ve0mbavc;abfaoarcu7gPcl4fcsGcitfgwydlhsawydbhzdndnarcsGgwak9pmbavalaPfcsGcdtfydbaxawEhraxawTgHfhxxekdnaeaD9nmbc9:hoxokdndnawcsSmbcehHamawcetfcWfhrxekaecefhrae8SbbgwcFeGhPdndnawcu9mmbarhexekaecvfheaPcFbGhPcrhwdninar8SbbgHcFbGawtaPVhPaHcu9kmearcefhrawcrfgwc8J9hmbxdkkarcefhekcehHaPce4cbaPceG9R7amfhrkarhmkavc;abfaocitfgwarBdbawasBdlavalcdtfarBdbavc;abfaocefcsGcitfgwazBdbawarBdlaocdfhoaHalfhldnadcd9hmbabar87elabas87edabaz87ebabcofhbxdkabarBdwabasBdlabazBdbabcxfhbxekdnarcpe0mbavalaDarcsGfRbbgwcl4gP9RcsGcdtfydbaxcefgsaPEhravalaw9RcsGcdtfydbasaPTgzfgsawcsGgPEhwaPThPdndnadcd9hmbabaw87elabar87edabax87ebcohHxekabawBdwabarBdlabaxBdbcxhHkavalcdtfaxBdbavc;abfaocitfgOarBdbaOaxBdlavalcefglcsGcdtfarBdbavc;abfaocefcsGcitfgOawBdbaOarBdlavalazfglcsGcdtfawBdbavc;abfaocdfcsGcitfgraxBdbarawBdlaocifhoabaHfhbalaPfhlasaPfhxxekdnaeaD9nmbc9:hoxlkaxcbaeRbbgwEgHarc;:eSgrfhsawcsGhOdndnawcl4gAmbascefhzxekashzavalaA9RcsGcdtfydbhskdndnaOmbazcefhxxekazhxavalaw9RcsGcdtfydbhzkdndnarTmbaecefhrxekaecdfhrae8SbegPcFeGhwdnaPcu9kmbaecofhHawcFbGhwcrhedninar8SbbgPcFbGaetawVhwaPcu9kmearcefhraecrfgec8J9hmbkaHhrxekarcefhrkawce4cbawceG9R7amfgmhHkdndnaAcsSmbarhwxekarcefhwar8SbbgecFeGhPdnaecu9kmbarcvfhsaPcFbGhPcrhedninaw8SbbgrcFbGaetaPVhParcu9kmeawcefhwaecrfgec8J9hmbkashwxekawcefhwkaPce4cbaPceG9R7amfgmhskdndnaOcsSmbawhexekawcefheaw8SbbgrcFeGhPdnarcu9kmbawcvfhzaPcFbGhPcrhrdninae8SbbgwcFbGartaPVhPawcu9kmeaecefhearcrfgrc8J9hmbkazhexekaecefhekaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabaz87elabas87edabaH87ebcohrxekabazBdwabasBdlabaHBdbcxhrkavc;abfaocitfgwasBdbawaHBdlavalcdtfaHBdbavc;abfaocefcsGcitfgwazBdbawasBdlavalcefglcsGcdtfasBdbavc;abfaocdfcsGcitfgwaHBdbawazBdlavalaATaAcsSVfglcsGcdtfazBdbalaOTaOcsSVfhlaocifhoabarfhbkaocsGhoalcsGhlaicefgiaq6mbkkcbc99aeaDSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk:4ioiue99dud99dud99dnaeTmbcbhiabhlindndnal8Uebgv:YgoJ:ji:1Salcof8UebgrciVgw:Y:vgDNJbbbZJbbb:;avcu9kEMgq:lJbbb9p9DTmbaq:Ohkxekcjjjj94hkkalclf8Uebhvalcdf8UebhxalarcefciGcetfak87ebdndnax:YgqaDNJbbbZJbbb:;axcu9kEMgm:lJbbb9p9DTmbam:Ohxxekcjjjj94hxkabaiarciGgkfcd7cetfax87ebdndnav:YgmaDNJbbbZJbbb:;avcu9kEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkalarcufciGcetfav87ebdndnawaw2:ZgPaPMaoaoN:taqaqN:tamamN:tgoJbbbbaoJbbbb9GE:raDNJbbbZMgD:lJbbb9p9DTmbaD:Ohrxekcjjjj94hrkalakcetfar87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk:Tvirud99eudndnadcl9hmbaeTmeindndnabRbbgiabcefgl8Sbbgvabcdfgo8Sbbgrf9R:YJbbuJabcifgwRbbgdce4adVgDcd4aDVgDcl4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax86bbdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao86bbdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai86bbdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad86bbabclfhbaecufgembxdkkaeTmbindndnab8Vebgiabcdfgl8Uebgvabclfgo8Uebgrf9R:YJbFu9habcofgw8Vebgdce4adVgDcd4aDVgDcl4aDVgDcw4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax87ebdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao87ebdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai87ebdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad87ebabcwfhbaecufgembkkk9teiucbcbyd:K:G:cjbgeabcifc98GfgbBd:K:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkk83dbcj:Gdk8Kbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbc:K:Gdkl8W:qbb",e="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuixkbbebeeddddilve9Weeeviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WbwY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbDl79IV9Rbqq:I9Dklbzik94evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaeai86b:q:W:cjbaecitab8Piw83i:q:G:cjbaecefgecjd9hmbkk:SBlEud97dur978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaialfgxar9RhodnadTgmmbavaoad;8qbbkaicefhPcj;abad9Uc;WFbGcjdadca0EhsdndndnadTmbaoadfhzcbhHinaeaH9nmdaxaP9RaD6miabaHad2fgOavcjdfasaeaH9RaHasfae6EgAaAcsfgoc9WGgCSEhXaPaDfhQaocl4cifcd4hLavcj;cbfaCcetfhKavcj;cbfaCci2fhYavcj;cbfaCfh8AcbhEaoc;ab6h3incbh5dnawTmbaPaEcd4fRbbh5kcbh8Eavcj;cbfh8Findndndndna5a8Ecet4ciGgoc9:fPdebdkaxaQ9RaC6mwdnaCTmbavcj;cbfa8EaC2faQaC;8qbbkaQaAfhQxdkaCTmeavcj;cbfa8EaC2fcbaC;8kbxekaxaQ9RaL6moaoclVcbawEhraQaLfhocbhidna3mbaxao9Rc;Gb6mbcbhlina8FalfhidndndndndndnaQalco4fRbbgqciGarfPDbedibledibkaipxbbbbbbbbbbbbbbbbpklbxlkaiaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiaopbbbpklbaoczfhoxekaiaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcd4ciGarfPDbedibledibkaiczfpxbbbbbbbbbbbbbbbbpklbxlkaiczfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiczfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiczfaopbbbpklbaoczfhoxekaiczfaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcl4ciGarfPDbedibledibkaicafpxbbbbbbbbbbbbbbbbpklbxlkaicafaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaicafaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaicafaopbbbpklbaoczfhoxekaicafaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqco4arfPDbedibledibkaic8Wfpxbbbbbbbbbbbbbbbbpklbxlkaic8Wfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaoclffaqRb:q:W:cjbfhoxikaic8Wfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaocwffaqRb:q:W:cjbfhoxdkaic8Wfaopbbbpklbaoczfhoxekaic8WfaopbbdaoRbbgicitpbi:q:G:cjbaiRb:q:W:cjbgipsaoRbegqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbaiaocdffaqRb:q:W:cjbfhokalc;abfhialcjefaC0meaihlaxao9Rc;Fb0mbkkdnaiaC9pmbaici4hlinaxao9RcK6mwa8FaifhqdndndndndndnaQaico4fRbbalcoG4ciGarfPDbedibledibkaqpxbbbbbbbbbbbbbbbbpkbbxlkaqaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spkbbagaoclffa8JRb:q:W:cjbfhoxikaqaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spkbbagaocwffa8JRb:q:W:cjbfhoxdkaqaopbbbpkbbaoczfhoxekaqaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpkbbagaocdffa8JRb:q:W:cjbfhokalcdfhlaiczfgiaC6mbkkaohQaoTmoka8FaCfh8Fa8Ecefg8Ecl9hmbkdndndndnawTmbazaEcd4fRbbglciGPlbedwbkaCTmdaXaEfhlavaEfpbdbh8Kcbhoinalavcj;cbfaofpblbg8La8Aaofpblbg8MpmbzeHdOiAlCvXoQrLg8NaKaofpblbgyaYaofpblbg8PpmbzeHdOiAlCvXoQrLgIpmbezHdiOAlvCXorQLgacep9Taapxeeeeeeeeeeeeeeeeghp9op9Hp9rgaa8Kp9Ug8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp9Ug8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp9Ug8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9Abbbaladfgla8Ka8NaIpmwDKYqk8AExm35Ps8E8Fgacep9Taaahp9op9Hp9rgap9Ug8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp9Ug8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp9Ug8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9Abbbaladfgla8Ka8La8MpmwKDYq8AkEx3m5P8Es8Fg8Laya8PpmwKDYq8AkEx3m5P8Es8Fg8MpmbezHdiOAlvCXorQLgacep9Taaahp9op9Hp9rgap9Ug8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp9Ug8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp9Ug8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9Abbbaladfgla8Ka8La8MpmwDKYqk8AExm35Ps8E8Fgacep9Taaahp9op9Hp9rgap9Ughp9Abbbaladfglahaaaapmlvorlvorlvorlvorp9Ughp9AbbbaladfglahaaaapmwDqkwDqkwDqkwDqkp9Ughp9AbbbaladfglahaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9AbbbaladfhlaoczfgoaC6mbxikkaCTmeaXaEfhlavaEfpbdbh8Kcbhoinalavcj;cbfaofpblbg8La8Aaofpblbg8MpmbzeHdOiAlCvXoQrLg8NaKaofpblbgyaYaofpblbg8PpmbzeHdOiAlCvXoQrLgIpmbezHdiOAlvCXorQLgacep:neaapxebebebebebebebebghp9op:bep9rgaa8Kp:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8NaIpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwKDYq8AkEx3m5P8Es8Fg8Laya8PpmwKDYq8AkEx3m5P8Es8Fg8MpmbezHdiOAlvCXorQLgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeghp9Abbbaladfglahaaaapmlvorlvorlvorlvorp:oeghp9AbbbaladfglahaaaapmwDqkwDqkwDqkwDqkp:oeghp9AbbbaladfglahaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9AbbbaladfhlaoczfgoaC6mbxdkkaCTmbaXaEfhrcbhocbalcl4gl9Rc8FGhiavaEfpbdbhhinaravcj;cbfaofpblbg8Ka8Aaofpblbg8LpmbzeHdOiAlCvXoQrLg8MaKaofpblbg8NaYaofpblbgypmbzeHdOiAlCvXoQrLg8PpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgaahp9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ma8PpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwKDYq8AkEx3m5P8Es8Fg8Ka8NaypmwKDYq8AkEx3m5P8Es8Fg8LpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9AbbbaradfhraoczfgoaC6mbkkaEclfgEad6mbkdnaXavcjdf9hmbaAad2goTmbaOavcjdfao;8qbbkdnammbavaXaAcufad2fad;8qbbkaAaHfhHc9:hoaQhPaQmbxlkkaeTmbaDalfhrcbhocuhlinaralaD9RglfaD6mdasaeao9Raoasfae6Eaofgoae6mbkaial9RhPkcbc99axaP9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaokwbz:bjjjbkpPesu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecje;8kbav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhDaicefgiarfhqdndnaeci9pmbaqhexekcmcsawceSEhkcbhxcbhmaqhecbhlcbhoindndnaiRbbgrc;Ve0mbavc;abfaoarcu7gPcl4fcsGcitfgwydlhsawydbhzdndnarcsGgwak9pmbavalaPfcsGcdtfydbaxawEhraxawTgHfhxxekdnaeaD9nmbc9:hoxokdndnawcsSmbcehHamawcetfcWfhrxekaecefhrae8SbbgwcFeGhPdndnawcu9mmbarhexekaecvfheaPcFbGhPcrhwdninar8SbbgHcFbGawtaPVhPaHcu9kmearcefhrawcrfgwc8J9hmbxdkkarcefhekcehHaPce4cbaPceG9R7amfhrkarhmkavc;abfaocitfgwarBdbawasBdlavalcdtfarBdbavc;abfaocefcsGcitfgwazBdbawarBdlaocdfhoaHalfhldnadcd9hmbabar87elabas87edabaz87ebabcofhbxdkabarBdwabasBdlabazBdbabcxfhbxekdnarcpe0mbavalaDarcsGfRbbgwcl4gP9RcsGcdtfydbaxcefgsaPEhravalaw9RcsGcdtfydbasaPTgzfgsawcsGgPEhwaPThPdndnadcd9hmbabaw87elabar87edabax87ebcohHxekabawBdwabarBdlabaxBdbcxhHkavalcdtfaxBdbavc;abfaocitfgOarBdbaOaxBdlavalcefglcsGcdtfarBdbavc;abfaocefcsGcitfgOawBdbaOarBdlavalazfglcsGcdtfawBdbavc;abfaocdfcsGcitfgraxBdbarawBdlaocifhoabaHfhbalaPfhlasaPfhxxekdnaeaD9nmbc9:hoxlkaxcbaeRbbgwEgHarc;:eSgrfhsawcsGhOdndnawcl4gAmbascefhzxekashzavalaA9RcsGcdtfydbhskdndnaOmbazcefhxxekazhxavalaw9RcsGcdtfydbhzkdndnarTmbaecefhrxekaecdfhrae8SbegPcFeGhwdnaPcu9kmbaecofhHawcFbGhwcrhedninar8SbbgPcFbGaetawVhwaPcu9kmearcefhraecrfgec8J9hmbkaHhrxekarcefhrkawce4cbawceG9R7amfgmhHkdndnaAcsSmbarhwxekarcefhwar8SbbgecFeGhPdnaecu9kmbarcvfhsaPcFbGhPcrhedninaw8SbbgrcFbGaetaPVhParcu9kmeawcefhwaecrfgec8J9hmbkashwxekawcefhwkaPce4cbaPceG9R7amfgmhskdndnaOcsSmbawhexekawcefheaw8SbbgrcFeGhPdnarcu9kmbawcvfhzaPcFbGhPcrhrdninae8SbbgwcFbGartaPVhPawcu9kmeaecefhearcrfgrc8J9hmbkazhexekaecefhekaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabaz87elabas87edabaH87ebcohrxekabazBdwabasBdlabaHBdbcxhrkavc;abfaocitfgwasBdbawaHBdlavalcdtfaHBdbavc;abfaocefcsGcitfgwazBdbawasBdlavalcefglcsGcdtfasBdbavc;abfaocdfcsGcitfgwaHBdbawazBdlavalaATaAcsSVfglcsGcdtfazBdbalaOTaOcsSVfhlaocifhoabarfhbkaocsGhoalcsGhlaicefgiaq6mbkkcbc99aeaDSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk;Toio97eue97aec98Ghedndnadcl9hmbaeTmecbhdinababpbbbgicKp:RecKp:Sep;6eglaicwp:RecKp:Sep;6ealp;Geaiczp:RecKp:Sep;6egvp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgwp9op9rp;Keglpxbb;:9cbb;:9cbb;:9cbb;:9calalp;Meaoaop;Meavaravawp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFbbbFbbbFbbbFbbbp9oaipxbbbFbbbFbbbFbbbFp9op9qalavp;Mearp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaoavp;Mearp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgDaDpbbbgipxbbbbbbFFbbbbbbFFgwp9oabpbbbgoaipmbediwDqkzHOAKY8AEgvczp:Reczp:Sep;6eglaoaipmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eavczp:Sep;6egvp;Gealp;Gep;Kep;Legipxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgqp9op9rp;Keglpxb;:FSb;:FSb;:FSb;:FSalalp;Meaiaip;Meavaravaqp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbp9oaiavp;Mearp;Keczp:Rep9qgialavp;Mearp;KepxFFbbFFbbFFbbFFbbp9oglpmwDKYqk8AExm35Ps8E8Fp9qpkbbabaoawp9oaialpmbezHdiOAlvCXorQLp9qpkbbabcafhbadclfgdae6mbkkk;2ileue97euo97dnaec98GgiTmbcbheinabcKfpx:ji:1S:ji:1S:ji:1S:ji:1SabpbbbglabczfgvpbbbgopmlvorxmPsCXQL358E8Fgrczp:Segwpxibbbibbbibbbibbbp9qp;6egDp;NegqaDaDp;MegDaDp;KealaopmbediwDqkzHOAKY8AEgDczp:Reczp:Sep;6eglalp;MeaDczp:Sep;6egoaop;Mearczp:Reczp:Sep;6egrarp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jep;Mepxbbn0bbn0bbn0bbn0gDp;KepxFFbbFFbbFFbbFFbbgkp9oaqaop;MeaDp;Keczp:Rep9qgoaqalp;MeaDp;Keakp9oaqarp;MeaDp;Keczp:Rep9qgDpmwDKYqk8AExm35Ps8E8Fglp5eawclp:RegqpEi:T:j83ibavalp5baqpEd:T:j83ibabcwfaoaDpmbezHdiOAlvCXorQLgDp5eaqpEe:T:j83ibabaDp5baqpEb:T:j83ibabcafhbaeclfgeai6mbkkkuee97dnadcd4ae2c98GgeTmbcbhdinababpbbbgicwp:Recwp:Sep;6eaicep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbabczfhbadclfgdae6mbkkk:Sodw97euaec98Ghedndnadcl9hmbaeTmecbhdinabpxbbuJbbuJbbuJbbuJabpbbbgicKp:TeglaicYp:Tep9qgvcdp:Teavp9qgvclp:Teavp9qgop;6ep;Negvaicwp:RecKp:SegraipxFbbbFbbbFbbbFbbbgwp9ogDp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oavaDarp:Xeaiczp:RecKp:Segip:Uep;6ep;Meaqp;Keawp9op9qavaDaraip:Uep:Xep;6ep;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qavaoalcep:Rep9oalpxebbbebbbebbbebbbp9op9qp;6ep;Meaqp;KecKp:Rep9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgkpxbFu9hbFu9hbFu9hbFu9habpbbbglakpbbbgrpmlvorxmPsCXQL358E8Fgvczp:TegqavcHp:Tep9qgicdp:Teaip9qgiclp:Teaip9qgicwp:Teaip9qgop;6ep;NegialarpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbglp9ograDczp:Segwp:Ueavczp:Reczp:SegDp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gvp;Kealp9oaiarawaDp:Uep:Xep;6ep;Meavp;Keczp:Rep9qgwaiaoaqcep:Rep9oaqpxebbbebbbebbbebbbp9op9qp;6ep;Meavp;Keczp:ReaiaDarp:Uep;6ep;Meavp;Kealp9op9qgipmwDKYqk8AExm35Ps8E8FpkbbabawaipmbezHdiOAlvCXorQLpkbbabcafhbadclfgdae6mbkkk9teiucbcbydj:G:cjbgeabcifc98GfgbBdj:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkxebcj:Gdklz:zbb",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),n=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var s=WebAssembly.validate(t)?a(e):a(r),i,o=WebAssembly.instantiate(s,{}).then(function(g){i=g.instance,i.exports.__wasm_call_ctors()});function a(g){for(var x=new Uint8Array(g.length),T=0;T<g.length;++T){var _=g.charCodeAt(T);x[T]=_>96?_-97:_>64?_-39:_+4}for(var v=0,T=0;T<g.length;++T)x[v++]=x[T]<60?n[x[T]]:(x[T]-60)*64+x[++T];return x.buffer.slice(0,v)}function c(g,x,T,_,v,I,N){var q=g.exports.sbrk,re=_+3&-4,pe=q(re*v),Me=q(I.length),Re=new Uint8Array(g.exports.memory.buffer);Re.set(I,Me);var ce=x(pe,_,v,Me,I.length);if(ce==0&&N&&N(pe,re,v),T.set(Re.subarray(pe,pe+_*v)),q(pe-q(0)),ce!=0)throw new Error("Malformed buffer data: "+ce)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp",COLOR:"meshopt_decodeFilterColor"},f={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},l=[],d=0;function h(g){var x={object:new Worker(g),pending:0,requests:{}};return x.object.onmessage=function(T){var _=T.data;x.pending-=_.count,x.requests[_.id][_.action](_.value),delete x.requests[_.id]},x}function m(g){for(var x="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(s)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+w.name+";"+c.toString()+w.toString(),T=new Blob([x],{type:"text/javascript"}),_=URL.createObjectURL(T),v=l.length;v<g;++v)l[v]=h(_);for(var v=g;v<l.length;++v)l[v].object.postMessage({});l.length=g,URL.revokeObjectURL(_)}function b(g,x,T,_,v){for(var I=l[0],N=1;N<l.length;++N)l[N].pending<I.pending&&(I=l[N]);return new Promise(function(q,re){var pe=new Uint8Array(T),Me=++d;I.pending+=g,I.requests[Me]={resolve:q,reject:re},I.object.postMessage({id:Me,count:g,size:x,source:pe,mode:_,filter:v},[pe.buffer])})}function w(g){var x=g.data;self.ready.then(function(T){if(!x.id)return self.close();try{var _=new Uint8Array(x.count*x.size);c(T,T.exports[x.mode],_,x.count,x.size,x.source,T.exports[x.filter]),self.postMessage({id:x.id,count:x.count,action:"resolve",value:_},[_.buffer])}catch(v){self.postMessage({id:x.id,count:x.count,action:"reject",value:v})}})}return{ready:o,supported:!0,useWorkers:function(g){m(g)},decodeVertexBuffer:function(g,x,T,_,v){c(i,i.exports.meshopt_decodeVertexBuffer,g,x,T,_,i.exports[u[v]])},decodeIndexBuffer:function(g,x,T,_){c(i,i.exports.meshopt_decodeIndexBuffer,g,x,T,_)},decodeIndexSequence:function(g,x,T,_){c(i,i.exports.meshopt_decodeIndexSequence,g,x,T,_)},decodeGltfBuffer:function(g,x,T,_,v,I){c(i,i.exports[f[v]],g,x,T,_,i.exports[u[I]])},decodeGltfBufferAsync:function(g,x,T,_,v){return l.length>0?b(g,x,T,f[_],u[v]):o.then(function(){var I=new Uint8Array(g*x);return c(i,i.exports[f[_]],I,g,x,T,i.exports[u[v]]),I})}}})()});function TI(){return Promise.resolve().then(()=>(xI(),wI))}var _I=p(()=>{"use strict"});async function tN(){return sd||(sd=TI().then(async({MeshoptDecoder:r})=>(await r.ready,r),r=>{throw sd=void 0,new Error("Failed to load the packaged meshopt decoder.",{cause:r})})),sd}function rN(r){return typeof r=="string"?r:["NONE","OCTAHEDRAL","QUATERNION","EXPONENTIAL","COLOR"][r]}async function AI(r,e,t,n,s,i="NONE"){(await tN()).decodeGltfBuffer(r,e,t,n,s,rN(i))}var sd,vI=p(()=>{"use strict";_I()});async function id(r,e,t){if(!e.gltf?.decompressMeshes&&e.gltf?.decompressBufferViewIndices===void 0||!e.gltf?.loadBuffers)return;nN(r.json);let n=new se(r),s=e.gltf.decompressBufferViewIndices,i=s?new Set(typeof s=="function"?s(r.json):s):void 0,o=Array.from(n.bufferViews),a=o.map((c,u)=>i?.has(u)===!1?Promise.resolve():sN(n,c,t));if(await Promise.all(a),i){for(let c of i){let u=o[c];u&&n.removeExtension(u,t)}return}for(let c of o)n.removeExtension(c,t);for(let c of n.buffers)n.removeExtension(c,t);n.removeExtension(t)}function nN(r){let e=r.bufferViews||[];for(let n=0;n<e.length;n++){let s=e[n].extensions;if(s?.KHR_meshopt_compression&&s.EXT_meshopt_compression)throw new Error(`glTF bufferView ${n} cannot use both KHR_meshopt_compression and EXT_meshopt_compression.`)}let t=r.buffers||[];for(let n=0;n<t.length;n++){let s=t[n].extensions;if(s?.KHR_meshopt_compression&&s.EXT_meshopt_compression)throw new Error(`glTF buffer ${n} cannot use both KHR_meshopt_compression and EXT_meshopt_compression.`)}}async function sN(r,e,t){let n=r.getExtension(e,t);if(!n)return;let{byteOffset:s=0,byteLength:i,byteStride:o,count:a,mode:c,filter:u="NONE",buffer:f}=n,l=r.gltf.buffers[f],d=r.gltf.buffers[e.buffer],h=new Uint8Array(l.arrayBuffer,l.byteOffset+s,i),m=new Uint8Array(d.arrayBuffer,d.byteOffset+(e.byteOffset||0),e.byteLength);await AI(m,a,o,h,c,u)}var Fg=p(()=>{"use strict";Ke();vI()});var Og={};J(Og,{decode:()=>iN,name:()=>II});async function iN(r,e){await id(r,e,II)}var II,SI=p(()=>{"use strict";Fg();II="EXT_meshopt_compression"});var Mg={};J(Mg,{decode:()=>oN,name:()=>EI});async function oN(r,e){await id(r,e,EI)}var EI,LI=p(()=>{"use strict";Fg();EI="KHR_meshopt_compression"});var Rg={};J(Rg,{name:()=>aN,preprocess:()=>cN});function cN(r,e){let t=new se(r);if(t.hasExtension(ao)){if(!Cb("image/webp")){if(t.isExtensionRequired(ao))throw new Error(`gltf: Required extension ${ao} not supported by browser`);return}for(let n of t.textures){let s=t.getExtension(n,ao);s&&(n.source=s.source),t.removeExtension(n,ao)}t.removeExtension(ao)}}var ao,aN,BI=p(()=>{"use strict";jn();Ke();ao="EXT_texture_webp",aN=ao});var Dg={};J(Dg,{name:()=>uN,preprocess:()=>fN});async function fN(r,e){let t=new se(r);if(!t.hasExtension(co))return;if(!(await kb()).has("image/avif")){if(t.isExtensionRequired(co))throw new Error(`gltf: Required extension ${co} not supported by browser`);return}for(let s of t.textures){let i=t.getExtension(s,co);i&&(s.source=i.source),t.removeExtension(s,co)}t.removeExtension(co)}var co,uN,FI=p(()=>{"use strict";jn();Ke();co="EXT_texture_avif",uN=co});var Ng={};J(Ng,{decode:()=>dN,getDDSLoader:()=>Zc,name:()=>uo,preprocess:()=>lN});function Zc(r){return r?.loaders?.find(e=>e.extensions?.includes("dds")||e.mimeTypes?.includes("image/vnd-ms.dds"))}function lN(r,e,t){let n=new se(r);if(n.hasExtension(uo)){if(!Zc(t)){if(n.isExtensionRequired(uo))throw new Error("gltf: Required extension MSFT_texture_dds needs a DDS parser");return}for(let s of n.textures){let i=n.getExtension(s,uo);i&&(s.source=i.source)}}}async function dN(r,e,t){if(!Zc(t)||e.gltf?.loadImages===!1)return;let n=new se(r);if(n.hasExtension(uo)){for(let s of n.textures)n.removeExtension(s,uo);n.removeExtension(uo)}}var uo,kg=p(()=>{"use strict";Ke();uo="MSFT_texture_dds"});var Cg={};J(Cg,{name:()=>hN,preprocess:()=>pN});function pN(r,e){let t=new se(r);for(let n of t.textures){let s=t.getExtension(n,od);s&&(n.source=s.source,t.removeExtension(n,od))}t.removeExtension(od)}var od,hN,OI=p(()=>{"use strict";Ke();od="KHR_texture_basisu",hN=od});var eu,Ug=p(()=>{"use strict";eu="5.0.0-beta.4"});var tu,Vg=p(()=>{"use strict";tu={name:"Draco",id:"draco",module:"scene",encoding:"binary",format:"draco",extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"]}});var MI,RI=p(()=>{"use strict";MI={backend:typeof WebAssembly=="object"?"wasm":"javascript",extraAttributes:{},attributeNameEntry:void 0,shape:"arrow-table",decoderProfile:"full"}});async function fo(r,e=null,t={},n=null,s=null){if(qe&&t.useLocalLibraries&&!t.CDN&&n&&t.modules?.[n]===void 0){let i=Ki?"./libs":`modules/${e}/dist/libs`;t={...t,modules:{[n]:`${i}/${n}`,...s?{[s]:`${i}/${s}`}:{},...t.modules}}}return await ta(r,e,t,n,s)}var DI=p(()=>{"use strict";qs()});var mN,bN,ru,NI,_e,lo,kI=p(()=>{"use strict";mN="1.5.7",bN="8786740086a9f4d83f44aa83badfbea4dce7a1b5",ru=`https://www.gstatic.com/draco/versioned/decoders/${mN}`,NI=`https://cdn.jsdelivr.net/gh/google/draco@${bN}/javascript`,_e={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",GLTF_DECODER:"draco_wasm_wrapper_gltf.js",GLTF_DECODER_WASM:"draco_decoder_gltf.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js",ENCODER_WASM:"draco_encoder.wasm"},lo={[_e.DECODER]:`${ru}/${_e.DECODER}`,[_e.DECODER_WASM]:`${ru}/${_e.DECODER_WASM}`,[_e.GLTF_DECODER]:`${ru}/${_e.GLTF_DECODER}`,[_e.GLTF_DECODER_WASM]:`${ru}/${_e.GLTF_DECODER_WASM}`,[_e.FALLBACK_DECODER]:`${ru}/${_e.FALLBACK_DECODER}`,[_e.ENCODER]:`${NI}/${_e.ENCODER}`,[_e.ENCODER_WASM]:`${NI}/${_e.ENCODER_WASM}`}});async function ad(r={},e,t="full"){let n=$I(r);return n?await Gg(n):await gN(r,e==="js"?"javascript":e,t)}async function gN(r={},e,t="full"){let n=qI(`${e}:${t}`,r),s=CI.get(n);return s||(s=yN(r,e,t),CI.set(n,s)),await s}async function Gg(r){let e=TN(r),t=VI.get(e);return t||(t=qi(()=>e.createDecoderModule({}),n=>({draco:n})),VI.set(e,t)),await t}async function zg(r={}){let e=$I(r);if(e){let s=_N(e),i=PI.get(s);return i||(i=qi(()=>s.createEncoderModule({}),o=>({draco:o})),PI.set(s,i)),await i}let t=qI("encoder",r),n=UI.get(t);return n||(n=xN(r),UI.set(t,n)),await n}async function yN(r,e,t){try{return await GI(r,e,t)}catch(n){if(e==="javascript")throw n;try{return await GI(r,"javascript","full")}catch(s){throw new AggregateError([n,s],"Draco decoder could not load either the WebAssembly or JavaScript backend")}}}async function GI(r,e,t){let n=jI.then(()=>wN(r,e,t));return jI=n.then(()=>{},()=>{}),await n}async function wN(r,e,t){if(e==="javascript"){let o;try{o=await fo(lo[_e.FALLBACK_DECODER],"scene",r,_e.FALLBACK_DECODER,"draco_decoder.mjs")}catch(c){if(qe||r.useLocalLibraries)throw c;o=await fo(lo[_e.FALLBACK_DECODER],"scene",{...r,useLocalLibraries:!0},_e.FALLBACK_DECODER,"draco_decoder.mjs")}let a=jg(o,"DracoDecoderModule")||globalThis.DracoDecoderModule;return await Pg(a)}let n,s;try{[n,s]=await zI(r,t)}catch(o){if(qe||r.useLocalLibraries)throw o;[n,s]=await zI({...r,useLocalLibraries:!0},t)}let i=jg(n,"DracoDecoderModule")||globalThis.DracoDecoderModule;return await Pg(i,s)}async function zI(r,e){let t=e==="gltf"?_e.GLTF_DECODER:_e.DECODER,n=e==="gltf"?_e.GLTF_DECODER_WASM:_e.DECODER_WASM;return await Promise.all([fo(lo[t],"scene",r,t,e==="gltf"?"draco_wasm_wrapper_gltf.mjs":"draco_wasm_wrapper.mjs"),fo(lo[n],"scene",r,n)])}async function xN(r){let e,t;try{[e,t]=await WI(r)}catch(s){if(qe||r.useLocalLibraries)throw s;[e,t]=await WI({...r,useLocalLibraries:!0})}let n=jg(e,"DracoEncoderModule")||globalThis.DracoEncoderModule;return await Pg(n,t)}async function WI(r){return await Promise.all([fo(lo[_e.ENCODER],"scene",r,_e.ENCODER,"draco_encoder.mjs"),fo(lo[_e.ENCODER_WASM],"scene",r,_e.ENCODER_WASM)])}function Pg(r,e){if(typeof r!="function")throw new Error("Draco module initializer could not be loaded");return qi(t=>r({...e?{wasmBinary:e}:{},onModuleLoaded:t}),t=>({draco:t}))}function jg(r,e){if(typeof r=="function")return r;if(r&&typeof r=="object"){let t=r,n=t[e]||t.default;return typeof n=="function"?n:void 0}}function $I(r){let e=r.modules?.draco3d;if(e){if(typeof e!="object"&&typeof e!="function")throw new Error("Invalid draco3d module");return e}}function TN(r){let e=r;if(typeof e?.createDecoderModule!="function")throw new Error("Invalid draco3d decoder module");return e}function _N(r){let e=r;if(typeof e?.createEncoderModule!="function")throw new Error("Invalid draco3d encoder module");return e}function qI(r,e){let t=Object.entries(e.modules||{}).filter(([n])=>n!=="draco3d").map(([n,s])=>`${n}:${String(s)}`).sort().join("|");return[r,e.useLocalLibraries?"local":"remote",e.CDN||"",t].join("|")}var CI,UI,VI,PI,jI,nu=p(()=>{"use strict";ke();DI();kI();CI=new Map,UI=new Map,VI=new WeakMap,PI=new WeakMap;jI=Promise.resolve()});function XI(r,e,t){let n=HI(e.metadata),s=[],i=AN(e.attributes);for(let o in r){let a=r[o],c=KI(o,a,i[o]);s.push(c)}if(t){let o=KI("indices",t);s.push(o)}return{fields:s,metadata:n}}function AN(r){let e={};for(let t in r){let n=r[t];e[n.name||"undefined"]=n}return e}function KI(r,e,t){let n={...Bl(e),...t?HI(t.metadata):{}};return gb(r,e,n)}function HI(r){Object.entries(r);let e={};for(let t in r)e[`${t}.string`]=JSON.stringify(r[t]);return e}var JI=p(()=>{"use strict";Vn()});function EN(r,e){switch(e){case Float32Array:return r.DT_FLOAT32;case Int8Array:return r.DT_INT8;case Int16Array:return r.DT_INT16;case Int32Array:return r.DT_INT32;case Uint8Array:return r.DT_UINT8;case Uint16Array:return r.DT_UINT16;case Uint32Array:return r.DT_UINT32;default:return r.DT_INVALID}}function LN(r){let e=r.size(),t=new Int32Array(e);for(let n=0;n<e;n++)t[n]=r.GetValue(n);return t}function BN(r){let e=r.size(),t=new Uint32Array(e);for(let n=0;n<e;n++)t[n]=r.GetValue(n);return t}function FN(r,e){if(!Object.prototype.hasOwnProperty.call(e,r))return r;let t=/^(.*)_([0-9]+)$/.exec(r),n=t?t[1]:r,s=t?BigInt(t[2])+1n:1n;for(;Object.prototype.hasOwnProperty.call(e,`${n}_${s}`);)s++;return`${n}_${s}`}function ON(r){if(r.quantization_transform){let{quantization_bits:e,min_values:t,range:n}=r.quantization_transform;if(e!==void 0&&t&&n!==void 0)return{type:"quantization",bits:e,origin:Array.from(t),range:n}}if(r.octahedron_transform?.quantization_bits!==void 0)return{type:"octahedron",bits:r.octahedron_transform.quantization_bits}}function MN(r){if(r.includeAttributes&&r.excludeAttributes)throw new Error("DracoLoader: includeAttributes and excludeAttributes cannot be combined")}function RN(r,e){for(let t of r.includeAttributes||r.excludeAttributes||[])if(!e.includes(t))throw new Error(`DracoLoader: selected attribute "${t}" does not exist`)}function DN(r){let e=un(r);if(!e)throw new Error("Decoded mesh is missing positions");let t=r.POSITION;if(t?.transform?.type!=="quantization")return e;let{bits:n,origin:s,range:i}=t.transform,o=i/(2**n-1);return e.map(a=>a.map((c,u)=>s[u]+c*o))}var YI,vN,IN,SN,su,QI=p(()=>{"use strict";Vn();JI();YI={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},vN={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},IN=2,SN=4,su=class{draco;decoder;metadataQuerier;constructor(e){this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,t={}){MN(t);let n=ArrayBuffer.isView(e)?new Int8Array(e.buffer,e.byteOffset,e.byteLength):new Int8Array(e);this._disableAttributeTransforms(t);let s=this.decoder.GetEncodedGeometryType(n),i=s===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud,o=null;try{switch(s){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeArrayToMesh(n,n.byteLength,i);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeArrayToPointCloud(n,n.byteLength,i);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!i.ptr){let d=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(d)}let a=this._getDracoLoaderData(i,s,t),c=this._getMeshData(i,a,t),u=DN(c.attributes),f=XI(c.attributes,a,c.indices);return{loader:"draco",loaderData:a,header:{vertexCount:i.num_points(),boundingBox:u},...c,schema:f}}finally{o&&this.draco.destroy(o),i&&this.draco.destroy(i)}}_getDracoLoaderData(e,t,n){let s=this._getTopLevelMetadata(e),i=this._getDracoAttributes(e,n);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:s,attributes:i}}_getDracoAttributes(e,t){let n={};for(let s=0;s<e.num_attributes();s++){let i=this.decoder.GetAttribute(e,s),o=this._getAttributeMetadata(e,s);n[i.unique_id()]={unique_id:i.unique_id(),attribute_type:i.attribute_type(),data_type:i.data_type(),num_components:i.num_components(),byte_offset:i.byte_offset(),byte_stride:i.byte_stride(),normalized:i.normalized(),attribute_index:s,metadata:o};let a=this._getQuantizationTransform(i,t);a&&(n[i.unique_id()].quantization_transform=a);let c=this._getOctahedronTransform(i,t);c&&(n[i.unique_id()].octahedron_transform=c)}return n}_getMeshData(e,t,n){let s=this._getMeshAttributes(t,e,n);if(!s.POSITION)throw new Error("DRACO: No position attribute found.");return e instanceof this.draco.Mesh?n.topology==="triangle-strip"?{topology:"triangle-strip",mode:5,attributes:s,indices:{value:this._getTriangleStripIndices(e),size:1}}:{topology:"triangle-list",mode:4,attributes:s,indices:{value:this._getTriangleListIndices(e),size:1}}:{topology:"point-list",mode:0,attributes:s}}_getMeshAttributes(e,t,n){let s={},i={},a=Object.values(e.attributes).sort((c,u)=>c.attribute_index-u.attribute_index).map(c=>{let u=this._deduceAttributeName(c,n),f=FN(u,i);return i[f]=!0,c.name=f,{attributeName:f,loaderAttribute:c}});RN(n,Object.keys(i));for(let{attributeName:c,loaderAttribute:u}of a){if(!this._shouldExtractAttribute(c,u,n))continue;let f=this._getAttributeValues(t,u);if(f){let{value:l,size:d}=f;s[c]={value:l,size:d,byteOffset:u.byte_offset,byteStride:u.byte_stride,normalized:u.normalized,transform:ON(u)}}}return s}_shouldExtractAttribute(e,t,n){if(t.attribute_type===this.draco.POSITION){if(n.excludeAttributes?.includes(e))throw new Error(`DracoLoader: position attribute "${e}" cannot be excluded`);return!0}return n.includeAttributes&&!n.includeAttributes.includes(e)?!1:!n.excludeAttributes?.includes(e)}_getTriangleListIndices(e){let n=e.num_faces()*3,s=e.num_points()<=65536,i=n*(s?IN:SN),o=this.draco._malloc(i);try{if(s){if(!this.decoder.GetTrianglesUInt16Array(e,i,o))throw new Error("DRACO: Failed to decode triangle indices.");return new Uint16Array(this.draco.HEAPU8.buffer,o,n).slice()}if(!this.decoder.GetTrianglesUInt32Array(e,i,o))throw new Error("DRACO: Failed to decode triangle indices.");return new Uint32Array(this.draco.HEAPU8.buffer,o,n).slice()}finally{this.draco._free(o)}}_getTriangleStripIndices(e){let t=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,t),BN(t)}finally{this.draco.destroy(t)}}_getAttributeValues(e,t){let n=vN[t.data_type];if(!n)return console.warn(`DRACO: Unsupported attribute type ${t.data_type}`),null;let s=t.num_components,o=e.num_points()*s,a=o*n.BYTES_PER_ELEMENT,c=EN(this.draco,n),u,f=this.draco._malloc(a);try{let l=this.decoder.GetAttribute(e,t.attribute_index);if(!this.decoder.GetAttributeDataArrayForAllPoints(e,l,c,a,f))throw new Error(`DRACO: Failed to decode attribute ${t.unique_id}.`);u=new n(this.draco.HEAPU8.buffer,f,o).slice()}finally{this.draco._free(f)}return{value:u,size:s}}_deduceAttributeName(e,t){let n=e.unique_id;for(let[o,a]of Object.entries(t.extraAttributes||{}))if(a===n)return o;let s=t.attributeNameEntry||"name";if(e.metadata[s]){let o=e.metadata[s].string;return o==="COLOR"?"COLOR_0":o==="TEX_COORD"?"TEXCOORD_0":o}let i=e.attribute_type;for(let o in YI)if(this.draco[o]===i)return YI[o];return`CUSTOM_ATTRIBUTE_${n}`}_getTopLevelMetadata(e){let t=this.decoder.GetMetadata(e);return this._getDracoMetadata(t)}_getAttributeMetadata(e,t){let n=this.decoder.GetAttributeMetadata(e,t);return this._getDracoMetadata(n)}_getDracoMetadata(e){if(!e||!e.ptr)return{};let t={},n=this.metadataQuerier.NumEntries(e);for(let s=0;s<n;s++){let i=this.metadataQuerier.GetEntryName(e,s);t[i]=this._getDracoMetadataField(e,i)}return t}_getDracoMetadataField(e,t){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,t,n);let s=LN(n);return{int:this.metadataQuerier.GetIntEntry(e,t),string:this.metadataQuerier.GetStringEntry(e,t),double:this.metadataQuerier.GetDoubleEntry(e,t),intArray:s}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(e){let{quantizedAttributes:t=[],octahedronAttributes:n=[]}=e,s=[...t,...n];for(let i of s)this.decoder.SkipAttributeTransform(this.draco[i])}_getQuantizationTransform(e,t){let{quantizedAttributes:n=[]}=t,s=e.attribute_type();if(n.map(o=>this.draco[o]).includes(s)){let o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits(),range:o.range(),min_values:Float32Array.from({length:e.num_components()},(a,c)=>o.min_value(c))}}finally{this.draco.destroy(o)}}return null}_getOctahedronTransform(e,t){let{octahedronAttributes:n=[]}=t,s=e.attribute_type();if(n.map(o=>this.draco[o]).includes(s)){let o=new this.draco.AttributeOctahedronTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}}});async function ga(r,e,t,n){let s=n?.reportProgress||e?.onProgress;s?.({phase:"decode",completed:0,total:1,unit:"tasks"});let{draco:i}=await t();(e?.signal||n?.signal)?.throwIfAborted();let o=new su(i);try{let a=o.parseSync(r,e?.draco);return s?.({phase:"decode",completed:1,total:1,unit:"tasks"}),e?.draco?.shape==="arrow-table"?Js(a,"arrow-table"):a}finally{o.destroy()}}var cd=p(()=>{"use strict";Vn();QI()});var dZ,NN,kN,ZI=p(()=>{"use strict";qs();nu();cd();iu();({preload:dZ,...NN}=Wn),kN={...NN,parse:async(r,e,t)=>await ga(r,e,async()=>await ad(cn(e),"wasm",e?.draco?.decoderProfile),t)}});var Wg={};J(Wg,{DracoWASMLoaderWithParser:()=>kN});var $g=p(()=>{"use strict";ZI()});var wZ,CN,UN,eS=p(()=>{"use strict";qs();nu();cd();iu();({preload:wZ,...CN}=Wn),UN={...CN,parse:async(r,e,t)=>await ga(r,e,async()=>await ad(cn(e),"js"),t)}});var qg={};J(qg,{DracoJavaScriptLoaderWithParser:()=>UN});var Kg=p(()=>{"use strict";eS()});function jN(r){let e=r?.modules?.draco3d;if(!e)throw new Error('DracoLoader: backend "draco3d" requires options.modules.draco3d');return e}var IZ,VN,PN,tS=p(()=>{"use strict";nu();cd();iu();({preload:IZ,...VN}=Wn),PN={...VN,parse:async(r,e,t)=>await ga(r,e,async()=>await Gg(jN(e)),t)}});var Xg={};J(Xg,{Draco3DLoaderWithParser:()=>PN});var Hg=p(()=>{"use strict";tS()});async function GN(r,e){let t=e;switch(zN(t)){case"wasm":{let{DracoWASMLoaderWithParser:n}=await Promise.resolve().then(()=>($g(),Wg));return n}case"javascript":{let{DracoJavaScriptLoaderWithParser:n}=await Promise.resolve().then(()=>(Kg(),qg));return n}case"draco3d":{let{Draco3DLoaderWithParser:n}=await Promise.resolve().then(()=>(Hg(),Xg));return n}default:throw new Error(`DracoLoader: unsupported backend "${t?.draco?.backend}"`)}}function zN(r){return r?.draco?.backend?r.draco.backend==="js"?"javascript":r.draco.backend:Wn.options.draco.backend}var Wn,iu=p(()=>{"use strict";Jo();Ug();Vg();RI();Wn={dataType:null,batchType:null,...tu,version:eu,worker:!0,workerSourceNode:"draco/workers/draco-worker-node.ts",serializeWorkerResult:el,deserializeWorkerResult:tl,options:{draco:MI},preload:GN}});var rS=p(()=>{"use strict";iu()});function nS(r){let e={};for(let t in r){let n=r[t];if(t!=="indices"){let s=Jg(n);e[t]=s}}return e}function Jg(r){let{buffer:e,size:t,count:n}=WN(r);return{value:e,size:t,byteOffset:0,count:n,type:la(t),componentType:zn(e)}}function WN(r){let e=r,t=1,n=0;return r&&r.value&&(e=r.value,t=r.size||1),e&&(ArrayBuffer.isView(e)||(e=$N(e,Float32Array)),n=e.length/t),{buffer:e,size:t,count:n}}function $N(r,e,t=!1){return r?Array.isArray(r)?new e(r):t&&!(r instanceof e)?new e(r):r:null}var sS=p(()=>{"use strict";Qs()});var Yg={};J(Yg,{decode:()=>XN,name:()=>qN,preprocess:()=>KN});function KN(r,e,t){let n=new se(r);for(let s of n.meshes)for(let i of n.getReferences(s).primitives)n.getExtension(i,ya)}async function XN(r,e,t){if(!e?.gltf?.decompressMeshes)return;let n=new se(r),s=[];for(let i of n.meshes)for(let o of n.getReferences(i).primitives)n.getExtension(o,ya)&&s.push(HN(n,o,e,t));await Promise.all(s),n.removeExtension(ya)}async function HN(r,e,t,n){let s=r.getExtension(e,ya);if(!s)return;let i=fr(r.data,r.gltf.buffers,s.bufferView),o=Ji(i.buffer,i.byteOffset,i.byteLength),a={...t,draco:{...t.draco,shape:"mesh",topology:"triangle-list",decoderProfile:t.draco?.decoderProfile||"gltf",extraAttributes:s.attributes}};delete a["3d-tiles"];let c=await Ws(o,Wn,a,n),u=nS(c.attributes);for(let f of Object.keys(s.attributes))if(!Object.hasOwn(u,f))throw new Error(`glTF: Draco decompression did not produce attribute ${f}`);for(let[f,l]of Object.entries(u))if(f in e.attributes){let d=e.attributes[f],h=r.data.accessors?.[d];h?.normalized!==void 0&&(l.normalized=h.normalized),h?.min&&h?.max&&(l.min=h.min,l.max=h.max)}e.attributes={...e.attributes,...u},c.indices&&(e.indices=Jg(c.indices),e.mode=4),r.removeExtension(e,ya),JN(e)}function JN(r){if(!r.attributes||Object.keys(r.attributes).length===0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}var ya,qN,iS=p(()=>{"use strict";ke();rS();Ke();sS();ro();ya="KHR_draco_mesh_compression",qN=ya});var Zg={};J(Zg,{decode:()=>ek,name:()=>YN});async function ek(r,e){let t=new se(r);if(!t.hasExtension(wa)||!e.gltf?.loadBuffers)return;let s=r.json.materials||[];for(let i=0;i<s.length;i++)tk(i,r,t);s.some(i=>Qg(i).length>0)||t.removeExtension(wa)}function tk(r,e,t){let n=e.json.materials?.[r],s=Qg(n),i=new Map,o=nk(e);for(let a of s){let c=a.extensions?.[wa];if(c){let u=c.texCoord??a.texCoord??0,f=sk(u,c),l=i.get(f);if(!l){if(l={sourceTexCoord:u,texCoord:o,matrix:ck(c)},!ik(e,r,l))continue;o++,i.set(f,l)}a.texCoord=l.texCoord,rk(t,a,wa),a.extensions&&Object.keys(a.extensions).length===0&&delete a.extensions}}}function rk(r,e,t){e.extensions?.[t]!==void 0&&(r.recordRemovedExtension(t),delete e.extensions[t])}function Qg(r){if(!r||typeof r!="object")return[];let e=r,t=[],n=e.extensions;Number.isFinite(e.index)&&n?.[wa]&&t.push(e);for(let[s,i]of Object.entries(e))s!=="extras"&&t.push(...Qg(i));return t}function nk(r){let e=-1;for(let t of r.json.meshes||[])for(let n of t.primitives)for(let s of Object.keys(n.attributes)){let i=/^TEXCOORD_(\d+)$/.exec(s);i&&(e=Math.max(e,Number(i[1])))}return e+1}function sk(r,e){let{offset:t=[0,0],rotation:n=0,scale:s=[1,1]}=e;return JSON.stringify([r,t,n,s])}function ik(r,e,t){let n=[],s=r.json.meshes||[];for(let i of s)for(let o of i.primitives){let a=o.material;Number.isFinite(a)&&e===a&&n.push(o)}if(n.length===0||n.some(i=>!ok(r,i,t.sourceTexCoord)))return!1;for(let i of n)ak(r,i,t);return!0}function ok(r,e,t){let n=e.attributes[`TEXCOORD_${t}`],s=n;if(ArrayBuffer.isView(s?.value))return!0;if(!Number.isFinite(n))return!1;let i=r.json.accessors?.[n];if(!i||i.bufferView===void 0||i.sparse)return!1;let o=r.json.bufferViews?.[i.bufferView];return!!(o&&r.buffers[o.buffer])}function ak(r,e,t){let{sourceTexCoord:n,texCoord:s,matrix:i}=t,o=e.attributes[`TEXCOORD_${n}`],a=o;if(ArrayBuffer.isView(a?.value)){let c=new Float32Array(a.count*2);for(let u=0;u<a.count;u++)oS(a.value.subarray(u*2,u*2+2),a,i,c,u*2);aS(s,a,e,r,c);return}if(Number.isFinite(o)){let c=r.json.accessors?.[o];if(c&&c.bufferView!==void 0){let u=r.json.bufferViews?.[c.bufferView];if(u){let{arrayBuffer:f,byteOffset:l}=r.buffers[u.buffer],d=(l||0)+(c.byteOffset||0)+(u.byteOffset||0),{ArrayType:h,length:m}=Xc(c,u),b=Kc[c.componentType],w=Kl[c.type],g=u.byteStride||b*w,x=new Float32Array(m);for(let T=0;T<c.count;T++){let _=new h(f,d+T*g,2);oS(_,c,i,x,T*w)}aS(s,c,e,r,x)}}}}function oS(r,e,t,n,s){let i=e.componentType===5120||e.componentType===5122,o=2**(Kc[e.componentType]*8-(i?1:0))-1;ud.set(e.normalized?Math.max(r[0]/o,-1):r[0],e.normalized?Math.max(r[1]/o,-1):r[1],1),ud.transformByMatrix3(t),n.set([ud[0],ud[1]],s)}function aS(r,e,t,n,s){n.buffers.push({arrayBuffer:Qi(s.buffer),byteOffset:0,byteLength:s.buffer.byteLength}),n.json.bufferViews=n.json.bufferViews||[];let i=n.json.bufferViews;i.push({buffer:n.buffers.length-1,byteLength:s.buffer.byteLength,byteOffset:0});let o=n.json.accessors;o&&(o.push({bufferView:i?.length-1,byteOffset:0,componentType:5126,count:e.count,type:"VEC2"}),t.attributes[`TEXCOORD_${r}`]=o.length-1)}function ck(r){let{offset:e=[0,0],rotation:t=0,scale:n=[1,1]}=r,s=new Un().set(1,0,0,0,1,0,e[0],e[1],1),i=QN.set(Math.cos(t),Math.sin(t),0,-Math.sin(t),Math.cos(t),0,0,0,1),o=ZN.set(n[0],0,0,0,n[1],0,0,0,1);return s.multiplyRight(i).multiplyRight(o)}var wa,YN,ud,QN,ZN,cS=p(()=>{"use strict";Sl();Qs();Kb();Ke();ke();wa="KHR_texture_transform",YN=wa,ud=new Cc,QN=new Un,ZN=new Un});var ey={};J(ey,{decode:()=>fk,encode:()=>lk,name:()=>uk});async function fk(r){let e=new se(r),t=e.getExtension(ho);t&&(e.data.lights=t.lights,e.removeExtension(ho));for(let n of e.nodes){let s=e.getExtension(n,ho);s&&(n.light=s.light),e.removeExtension(n,ho)}}async function lk(r){let e=new ln(r),{json:t}=e;if(t.lights){let n=e.addExtension(ho);X(!n.lights),n.lights=t.lights,delete t.lights}if(e.json.lights){for(let n of e.json.lights){let s=n.node;e.addObjectExtension(s,ho,n)}delete e.json.lights}}var ho,uk,uS=p(()=>{"use strict";to();Ke();Hc();ho="KHR_lights_punctual",uk=ho});var ty={};J(ty,{decode:()=>hk,encode:()=>pk,name:()=>dk});async function hk(r){let e=new se(r);for(let t of e.materials)e.getExtension(t,xa)&&(t.unlit=!0),e.removeExtension(t,xa);e.removeExtension(xa)}function pk(r){let e=new ln(r);for(let t of r.json.materials||[]){let n=t;n.unlit&&(delete n.unlit,e.addObjectExtension(t,xa,{}),e.registerRequiredExtension(xa))}for(let t of["extensionsUsed","extensionsRequired"])r.json[t]?.length===0&&delete r.json[t]}var xa,dk,fS=p(()=>{"use strict";Ke();Hc();xa="KHR_materials_unlit",dk=xa});var ry={};J(ry,{decode:()=>bk,encode:()=>gk,name:()=>mk});async function bk(r){let e=new se(r),t=e.getExtension(ou);if(t){let n=yk(t,e);for(let s of e.materials){let i=e.getExtension(s,ou);i&&(s.technique=Object.assign({},i,n[i.technique]),s.technique.values=wk(s.technique,e)),e.removeExtension(s,ou)}e.removeExtension(ou)}}async function gk(r,e){}function yk(r,e){let{programs:t=[],shaders:n=[],techniques:s=[]}=r,i=new TextDecoder;return n.forEach(o=>{if(Number.isFinite(o.bufferView))o.code=i.decode(fr(e.data,e.gltf.buffers,o.bufferView));else throw new Error("KHR_techniques_webgl: no shader code")}),t.forEach(o=>{o.fragmentShader=n[o.fragmentShader],o.vertexShader=n[o.vertexShader]}),s.forEach(o=>{o.program=t[o.program]}),s}function wk(r,e){let t=Object.assign({},r.values);return Object.keys(r.uniforms||{}).forEach(n=>{r.uniforms[n].value&&!(n in t)&&(t[n]=r.uniforms[n].value)}),Object.keys(t).forEach(n=>{typeof t[n]=="object"&&t[n].index!==void 0&&(t[n].texture=e.resolveTexture(t[n].index,`technique.values.${n}.index`))}),t}var ou,mk,lS=p(()=>{"use strict";Ke();ro();ou="KHR_techniques_webgl",mk=ou});var ny={};J(ny,{decode:()=>Tk,name:()=>xk});async function Tk(r,e){let t=new se(r);_k(t,e)}function _k(r,e){if(!e.gltf?.loadBuffers)return;let t=r.getExtension(dS);t&&(e.gltf?.loadImages&&Ak(r,t),vk(r,t))}function Ak(r,e){let t=e.schema;if(!t)return;let n=t.classes,{featureTextures:s}=e;if(n&&s)for(let i in n){let o=n[i],a=Sk(s,i);a&&Lk(r,a,o)}}function vk(r,e){let t=e.schema;if(!t)return;let n=t.classes,s=e.featureTables;if(n&&s)for(let i in n){let o=Ik(s,i);o&&Ek(r,t,o)}}function Ik(r,e){for(let t in r){let n=r[t];if(n.class===e)return n}return null}function Sk(r,e){for(let t in r){let n=r[t];if(n.class===e)return n}return null}function Ek(r,e,t){if(!t.class)return;let n=e.classes?.[t.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${t.class}`);let s=t.count;for(let i in n.properties){let o=n.properties[i],a=t.properties?.[i];if(a){let c=Bk(r,e,o,s,a);a.data=c}}}function Lk(r,e,t){let n=e.class;for(let s in t.properties){let i=e?.properties?.[s];if(i){let o=Dk(r,i,n);i.data=o}}}function Bk(r,e,t,n,s){let i=[],o=s.bufferView,a=r.getTypedArrayForBufferView(o),c=Fk(r,t,s,n),u=Ok(r,t,s,n,c);return t.type==="STRING"||t.componentType==="STRING"?i=Ql(n,a,c,u,t.type==="ARRAY"?t.componentCount:void 0):Mk(t)&&(i=Rk(t,n,a,c)),i}function Fk(r,e,t,n){return e.type==="ARRAY"&&typeof e.componentCount>"u"&&typeof t.arrayOffsetBufferView<"u"?da(r,t.arrayOffsetBufferView,t.offsetType||"UINT32",n):null}function Ok(r,e,t,n,s){if(typeof t.stringOffsetBufferView<"u"){let i=s?Number(s[n]):n*(e.type==="ARRAY"&&e.componentCount||1);return da(r,t.stringOffsetBufferView,t.offsetType||"UINT32",i)}return null}function Mk(r){let e=["UINT8","INT16","UINT16","INT32","UINT32","INT64","UINT64","FLOAT32","FLOAT64"];return e.includes(r.type)||typeof r.componentType<"u"&&e.includes(r.componentType)}function Rk(r,e,t,n){let s=r.type==="ARRAY",i=r.componentCount,o="SCALAR",a=r.componentType||r.type,c=Jc(o,a),u=t.byteLength/c,f=ha(t,o,a,u);return s?n?Yc(f,e,n):i?Qc(f,e,i):[]:f}function Dk(r,e,t){let n=r.data;if(!n.meshes)return[];let s=[];for(let i of n.meshes)for(let o of i.primitives)Nk(r,t,e,s,o);return s}function Nk(r,e,t,n,s){let i={channels:t.channels,...t.texture},o=pa(r,i,s);o&&Yl(r,e,o,n,s)}var dS,xk,hS=p(()=>{"use strict";Ke();Zl();dS="EXT_feature_metadata",xk=dS});async function mS(r,e={},t){let n=pS.filter(s=>gS(s.name,e));for(let s of n)await s.preprocess?.(r,e,t)}async function bS(r,e={},t){let n=pS.filter(s=>gS(s.name,e));for(let s of n)await s.decode?.(r,e,t)}function gS(r,e){let t=e?.gltf?.excludeExtensions||{};return Array.isArray(t)?!t.includes(r):!(r in t&&!t[r])}var pS,yS=p(()=>{"use strict";nI();uI();fI();dI();hI();mI();gI();yI();SI();LI();BI();FI();kg();OI();iS();cS();Sg();uS();fS();lS();hS();pS=[Jb,Mg,Og,Yg,xg,bg,_g,vg,Ig,Eg,Lg,Bg,Rg,Dg,Ng,Cg,ey,ty,ry,Zg,ny]});function wS(r){let e=new se(r);for(let t of e.images){let n=e.getExtension(t,sy);n&&(t.bufferView=n.bufferView,t.mimeType=n.mimeType,delete t.uri),e.removeExtension(t,sy)}for(let t of e.data.buffers||[])t.id==="binary_glTF"&&delete t.uri;e.removeExtension(sy)}var sy,xS=p(()=>{"use strict";Ke();sy="KHR_binary_glTF"});function _S(r,e){let t=r.accessors||[],n=r.bufferViews||[],s=Ck(r),i=new Map;for(let[o,a]of t.entries()){let c=a.bufferView;if(c===void 0&&!a.byteStride){delete a.byteStride;continue}let u=n[c],f=s.get(o)||"unused",l=Uk(a),d=a.byteStride===0?l:a.byteStride??l,h=a.byteOffset??0,m=u?.byteOffset??0,b=typeof a.componentType=="number"&&Object.hasOwn(fd,a.componentType)?fd[a.componentType]:0,w=f==="vertex",g=w?d>=l&&d>=4&&d<=252&&d%4===0&&h%4===0&&(m+h)%4===0:d===l;if(!u||!l||f==="mixed"||!Number.isInteger(d)||!g||w&&d>u.byteLength||!Number.isInteger(a.count)||a.count<1||!Number.isInteger(h)||h<0||!Number.isInteger(m)||m<0||h%b!==0||(m+h)%b!==0||a.type.startsWith("MAT")&&(m+h)%4!==0||!Number.isInteger(u.byteLength)||h+(a.count-1)*d+l>u.byteLength){e(o);continue}let x=`${c}:${f}:${w?d:0}`,T=i.get(x);if(T===void 0){let _={...u};delete _.id,delete _.byteStride,delete _.target,w?(_.byteStride=d,_.target=34962):f==="indices"&&(_.target=34963),T=n.length,n.push(_),i.set(x,T)}a.bufferView=T,delete a.byteStride}}function Ck(r){let e=new Map,t=(n,s)=>{if(n===void 0)return;let i=e.get(n);e.set(n,i&&i!==s?"mixed":s)};for(let n of r.meshes||[])for(let s of n.primitives){for(let i of Object.values(s.attributes))t(i,"vertex");t(s.indices,"indices")}for(let n of r.animations||[])for(let s of n.samplers)t(s.input,"animation"),t(s.output,"animation");for(let n of r.skins||[])t(n.inverseBindMatrices,"inverseBind");return e}function Uk(r){let e=typeof r.componentType=="number"&&Object.hasOwn(fd,r.componentType)?fd[r.componentType]:0,t=Object.hasOwn(TS,r.type)?TS[r.type]:0;if(!e||!t)return 0;let n=r.type==="MAT2"?2:r.type==="MAT3"?3:4;return r.type.startsWith("MAT")&&n*e%4!==0?0:(e||0)*t}var fd,TS,AS=p(()=>{"use strict";fd={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},TS={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16}});function vS(r,e,t){let n=r.nodes||[],s=r.skins||[],i=s.length,o=!1;for(let a=0;a<i;a++){let c=s[a],u=c.jointNames;if(!Array.isArray(u)||u.length===0||u.some(m=>typeof m!="string"||!m)||new Set(u).size!==u.length){t(`skin ${a} has invalid joint names`),o=!0;continue}let f=n.flatMap((m,b)=>m.skin===a?[b]:[]),l=(f.length?f:[void 0]).map(m=>Vk(n,u,m,e,b=>t(`skin ${a} ${b}`))),d=l.some(m=>!m);o||=d;let h=new Map;for(let m of l){if(!m)continue;let b=`${m.skeletonIndex}:${m.jointIndices.join(",")}`,w=h.get(b);if(w===void 0){let g={...c,joints:m.jointIndices,skeleton:m.skeletonIndex};delete g.jointNames,c.bindShapeMatrix!==void 0&&Gk(c.bindShapeMatrix)&&delete g.bindShapeMatrix,!d&&h.size===0?(w=a,s[a]=g):(delete g.id,w=s.length,s.push(g)),h.set(b,w)}m.nodeIndex!==void 0&&(n[m.nodeIndex].skin=w,delete n[m.nodeIndex].skeletons)}}if(!o)for(let a of n)delete a.jointName}function Vk(r,e,t,n,s){let i=t===void 0?void 0:r[t].skeletons;if(i!==void 0&&(!Array.isArray(i)||i.some(l=>typeof l!="string"||!l)||new Set(i).size!==i.length))return s("has invalid skeleton roots"),null;let o=(i||[]).map(n),a=o.length?Pk(r,o):r.map((l,d)=>d);if(!a)return s("has invalid or overlapping skeleton subtrees"),null;let c=[],u=new Map;for(let l of a){let d=r[l].jointName;if(d===void 0)continue;let h=u.get(d)||[];h.push(l),u.set(d,h)}for(let l of e){let d=u.get(l)||[];if(d.length!==1)return s(`cannot uniquely resolve joint ${l}`),null;c.push(d[0])}let f=jk(r,[...c,...o]);return f===void 0?(s("joints have no unambiguous common hierarchy root"),null):{nodeIndex:t,jointIndices:c,skeletonIndex:o.length===1?o[0]:f}}function Pk(r,e){let t=new Set,n=[...e];for(;n.length;){let s=n.pop();if(!Number.isSafeInteger(s)||!r[s]||t.has(s))return null;t.add(s),n.push(...r[s].children||[])}return Array.from(t)}function jk(r,e){let t=new Map;for(let[i,o]of r.entries())for(let a of o.children||[]){if(!Number.isSafeInteger(a)||!r[a]||t.has(a))return;t.set(a,i)}let n=e.map(i=>{let o=[],a=new Set,c=i;for(;c!==void 0;){if(a.has(c))return[];a.add(c),o.push(c),c=t.get(c)}return o}),s=n.map(i=>new Set(i));return n[0].find(i=>s.every(o=>o.has(i)))}function Gk(r){return Array.isArray(r)&&r.length===16&&Array.from(r).every((e,t)=>e===(t%5===0?1:0))}var IS=p(()=>{"use strict"});function ld(r,e){if(!e.length)return;let t=new Map;for(let n of e){let s=t.get(n.bufferIndex)||[];s.push(n),t.set(n.bufferIndex,s)}r.buffers=[...r.buffers],r.json.bufferViews||=[];for(let[n,s]of t){let i=r.json.buffers[n],o=r.buffers[n],a=Te(i.byteLength,4),c=a+s.reduce((l,d)=>l+Te(d.bytes.byteLength,4),0),u=new ArrayBuffer(c),f=new Uint8Array(u);f.set(new Uint8Array(o.arrayBuffer,o.byteOffset,i.byteLength));for(let l of s){f.set(new Uint8Array(l.bytes),a);let d=r.json.bufferViews.length;r.json.bufferViews.push({buffer:n,byteOffset:a,byteLength:l.bytes.byteLength,...l.byteStride===void 0?{}:{byteStride:l.byteStride},...l.target===void 0?{}:{target:l.target}}),l.apply(d),a+=Te(l.bytes.byteLength,4)}i.byteLength=c,i.uri!==void 0&&(i.uri=`data:application/octet-stream;base64,${Vm(u)}`),r.buffers[n]={arrayBuffer:u,byteOffset:0,byteLength:c}}}var iy=p(()=>{"use strict";ke()});function SS(r,e){let t=new Map;for(let[n,s]of(r.json.skins||[]).entries()){if(s.bindShapeMatrix===void 0)continue;let i=s.bindShapeMatrix;if(!ES(i)){e(`skin ${n} non-identity bindShapeMatrix requires a finite affine matrix`);continue}let o=`${s.inverseBindMatrices}:${i.join(",")}`,a=t.get(o);if(a){if((s.joints||s.jointNames||[]).length>a.count){e(`skin ${n} non-identity bindShapeMatrix has too few inverse-bind matrices`);continue}a.skins.push(s);continue}let c=zk(r,s,i);if(typeof c=="string"){e(`skin ${n} non-identity bindShapeMatrix ${c}`);continue}t.set(o,c)}ld(r,Array.from(t.values(),n=>({bufferIndex:n.bufferIndex,bytes:n.matrixBytes,apply:s=>{r.json.accessors||=[];let i=r.json.accessors.length;r.json.accessors.push({bufferView:s,byteOffset:0,componentType:5126,count:n.count,type:"MAT4"});for(let o of n.skins)o.inverseBindMatrices=i,delete o.bindShapeMatrix}})))}function zk(r,e,t){let n=r.json.accessors?.[e.inverseBindMatrices],s=(e.joints||e.jointNames||[]).length;if(!n||n.componentType!==5126||n.type!=="MAT4"||n.normalized||n.sparse||n.extensions||Object.hasOwn(n,"byteStride")||!Number.isSafeInteger(n.count)||n.count<1)return"requires packed FLOAT MAT4 inverse-bind matrices";if(n.count<s)return"has too few inverse-bind matrices";let i=r.json.bufferViews?.[n.bufferView],o=i?.buffer,a=r.json.buffers?.[o],c=r.buffers[o];if(!i||o===void 0||!a||!c)return"requires a loaded inverse-bind buffer";if(i.extensions)return"does not support inverse-bind buffer-view extensions";let u=i.byteOffset??0,f=n.byteOffset??0,l=n.count*64;if(!(c.arrayBuffer instanceof ArrayBuffer)||!Number.isSafeInteger(a.byteLength)||a.byteLength<1||!Number.isSafeInteger(c.byteOffset)||c.byteOffset<0||!Number.isSafeInteger(c.byteLength)||c.byteLength<a.byteLength||c.byteOffset+c.byteLength>c.arrayBuffer.byteLength||!Number.isSafeInteger(u)||u<0||u%4!==0||!Number.isSafeInteger(i.byteLength)||i.byteLength<1||i.byteStride!==void 0||u+i.byteLength>a.byteLength||!Number.isSafeInteger(f)||f<0||f%4!==0||f+l>i.byteLength)return"has an invalid inverse-bind buffer layout";let d=new DataView(c.arrayBuffer),h=c.byteOffset+u+f,m=new ArrayBuffer(l),b=new DataView(m);for(let w=0;w<n.count;w++){let g=Array.from({length:16},(x,T)=>d.getFloat32(h+w*64+T*4,!0));if(!ES(g))return"requires finite affine inverse-bind matrices";for(let x=0;x<4;x++)for(let T=0;T<4;T++){let _=0;for(let v=0;v<4;v++)_+=g[v*4+T]*t[x*4+v];if(!Number.isFinite(Math.fround(_)))return"produces non-finite FLOAT matrix values";b.setFloat32(w*64+(x*4+T)*4,_,!0)}}return{bufferIndex:o,count:n.count,matrixBytes:m,skins:[e]}}function ES(r){if(!Array.isArray(r)||r.length!==16)return!1;for(let e=0;e<16;e++)if(!Number.isFinite(r[e]))return!1;return r[3]===0&&r[7]===0&&r[11]===0&&r[15]===1}var LS=p(()=>{"use strict";iy()});function FS(r){let e=r.accessors||[],t=new Map,n=new Map,s=ay(r),i=(o,a)=>{if(!Number.isSafeInteger(o)||o<0||!Object.hasOwn(e,o))return o;let c=e[o];if(!c)return o;let u=t.get(o)||new Map,f=`${a.usage}:${a.mode}:${["unit","signed","direction"].includes(a.mode)?a.semantic?.split("_")[0]:""}:${a.hasOpaqueConsumer?"opaque":""}`,l=u.get(f);return l===void 0&&(l=u.size?e.length:o,u.size&&e.push({...c}),u.set(f,l),n.set(l,a),t.set(o,u)),l};for(let o of r.meshes||[])for(let a of o.primitives){for(let[c,u]of Object.entries(a.attributes)){let f=e[u],l=["NORMAL","TANGENT"].includes(c)&&f&&[5120,5121,5122,5123].includes(f.componentType)?"direction":/^JOINTS_\d+$/.test(c)?"joints":/^(COLOR|WEIGHTS|TEXCOORD)_\d+$/.test(c)&&f&&[5120,5122].includes(f.componentType)?"signed":/^(COLOR|WEIGHTS|TEXCOORD)_\d+$/.test(c)&&f&&[5121,5123].includes(f.componentType)&&!f.normalized?"unit":/^WEIGHTS_\d+$/.test(c)?"weights":"copy";a.attributes[c]=i(u,{usage:"vertex",mode:l,semantic:c,...["signed","direction"].includes(l)?{hasOpaqueConsumer:s}:{}})}a.indices!==void 0&&(a.indices=i(a.indices,{usage:"indices",mode:"copy",hasOpaqueConsumer:a.extensions!==void 0}))}for(let o of r.animations||[])for(let a of o.samplers)a.input=i(a.input,{usage:"animation",mode:"copy"}),a.output=i(a.output,{usage:"animation",mode:"copy"});for(let o of r.skins||[])o.inverseBindMatrices!==void 0&&(o.inverseBindMatrices=i(o.inverseBindMatrices,{usage:"inverseBind",mode:"copy"}));for(let o=0;o<e.length;o++)n.has(o)||n.set(o,{usage:"unused",mode:"copy"});return n}function OS(r,e,t,n,s){let i=[],o=[];for(let[a,c]of e){let u=r.json.accessors[a],f=c.mode==="joints"||c.mode==="weights"||c.semantic?.startsWith("WEIGHTS_"),l=!!(f&&["SCALAR","VEC2","VEC3"].includes(u.type)),d=c.mode==="weights"&&(u.type!=="VEC4"||![5121,5123,5126].includes(u.componentType)||u.componentType===5126&&u.normalized),h=c.mode==="signed",m=c.mode==="direction",b=h||m,w=c.mode==="joints"&&(![5121,5123].includes(u.componentType)||u.normalized||u.type!=="VEC4");if(!t.has(a)&&!w&&!d&&!b&&!l&&c.usage!=="indices"&&c.mode!=="unit")continue;let g=au(r,a);if(typeof g=="string"){n(`accessor ${a} layout requires binary repacking: ${g}`);continue}if(f&&!["SCALAR","VEC2","VEC3","VEC4"].includes(u.type)){n(`accessor ${a} skin influences require scalar/vector data`);continue}if(c.mode==="weights"&&(![5121,5123,5126].includes(u.componentType)||u.componentType===5126&&u.normalized||u.componentType!==5126&&!u.normalized)){n(`accessor ${a} weights require FLOAT or normalized unsigned data`);continue}let x=u.componentType,T=u.normalized;if(b){if(c.hasOpaqueConsumer){n(`accessor ${a} integer conversion cannot interpret opaque extension consumers`);continue}if(!(m?[c.semantic==="NORMAL"?"VEC3":"VEC4"]:c.semantic?.startsWith("COLOR_")?["VEC3","VEC4"]:c.semantic?.startsWith("WEIGHTS_")?["SCALAR","VEC2","VEC3","VEC4"]:["VEC2"]).includes(u.type)||T!==void 0&&typeof T!="boolean"){n(`accessor ${a} integer ${c.semantic} has incompatible shape or normalization`);continue}let ie=!0;for(let we=0;we<u.count;we++)if(m){let Bt=Math.hypot(Math.fround(Ta(g,we,0)),Math.fround(Ta(g,we,1)),Math.fround(Ta(g,we,2)));(Math.abs(Bt-1)>1e-5||c.semantic==="TANGENT"&&![-1,1].includes(Ta(g,we,3)))&&(ie=!1)}else if(!c.semantic?.startsWith("TEXCOORD_"))for(let Bt=0;Bt<g.rows;Bt++){let dr=Ta(g,we,Bt);(dr<0||dr>1)&&(ie=!1)}if(!ie){n(m?`accessor ${a} integer ${c.semantic} requires unit directions and tangent handedness of +/-1; values are not repaired`:`accessor ${a} signed ${c.semantic} values must remain in [0, 1]`);continue}x=5126,T=!1}if(c.usage==="indices"){if(u.type!=="SCALAR"||![5121,5123,5125].includes(x)||T){n(`index accessor ${a} requires unnormalized unsigned SCALAR data`);continue}let ce=0;for(let we=0;we<u.count;we++)ce=Math.max(ce,Wt(g,we,0));if(ce===(x===5121?255:x===5123?65535:4294967295)){if(c.hasOpaqueConsumer){n(`index accessor ${a} cannot widen opaque primitive extension semantics`);continue}if(x===5125){n(`index accessor ${a} contains the unrepresentable uint32 restart value`);continue}x=x===5121?5123:5125}if(!t.has(a)&&x===u.componentType)continue}if(w||c.mode==="unit"){if(w&&u.normalized){n(`accessor ${a} joint indices require unnormalized scalar/vector data`);continue}if(c.mode==="unit"&&!(c.semantic?.startsWith("COLOR_")?["VEC3","VEC4"]:c.semantic?.startsWith("WEIGHTS_")?["SCALAR","VEC2","VEC3","VEC4"]:["VEC2"]).includes(u.type)){n(`accessor ${a} integer ${c.semantic} has an incompatible shape`);continue}let ce=0,ie=!0;for(let we=0;we<u.count;we++)for(let Bt=0;Bt<g.rows*g.columns;Bt++){let dr=Wt(g,we,Bt);(!Number.isInteger(dr)||dr<0||w&&dr>65535)&&(ie=!1),ce=Math.max(ce,dr)}if(!ie){n(`accessor ${a} joint indices require finite integers in [0, 65535]`);continue}if(w)x=ce<=255?5121:5123,T=!1;else if(ce<=1)x=5126,T=!1;else if(n(`accessor ${a} ambiguous integer attribute normalization; best effort assumes normalized unsigned values`),T=!0,!t.has(a)&&!l){o.push(()=>{u.normalized=!0});continue}}let _=l?4:g.rows,v=oy[x],I=g.columns>1?Te(g.rows*v,4):_*v,N=I*g.columns,q=c.usage==="vertex"?Te(N,4):N,re=new ArrayBuffer(u.count*q),pe=new Uint8Array(re),Me=new Uint8Array(g.data.buffer),Re=new DataView(re);for(let ce=0;ce<u.count;ce++)for(let ie=0;ie<g.columns;ie++)if(x===u.componentType){let we=g.byteOffset+ce*g.byteStride+ie*g.rows*g.componentSize;pe.set(Me.subarray(we,we+g.rows*g.componentSize),ce*q+ie*I)}else for(let we=0;we<g.rows;we++){let Bt=(b?Ta:Wt)(g,ce,ie*g.rows+we),dr=ce*q+ie*I+we*v;x===5126?Re.setFloat32(dr,Bt,!0):x===5121?Re.setUint8(dr,Bt):x===5125?Re.setUint32(dr,Bt,!0):Re.setUint16(dr,Bt,!0)}i.push({bufferIndex:g.bufferIndex,bytes:re,...c.usage==="vertex"?{byteStride:q,target:34962}:c.usage==="indices"?{target:34963}:{},apply:ce=>{b&&s(`Converted ${h?"signed":"integer"} ${c.semantic} accessor ${a} to FLOAT, preserving ${g.accessor.normalized?"explicitly normalized":"literal"} values.`),c.usage==="indices"&&x!==u.componentType&&s(`Widened index accessor ${a} to preserve a glTF 1 index reserved by glTF 2.`),u.bufferView=ce,u.byteOffset=0,delete u.byteStride,(x!==u.componentType||l)&&(delete u.min,delete u.max),u.componentType=x,l&&(u.type="VEC4"),T?u.normalized=!0:delete u.normalized}})}ld(r,i);for(let a of o)a()}function Ta(r,e,t){let n=Wt(r,e,t);if(r.accessor.normalized!==!0)return n;let s=Wk[r.accessor.componentType];return Math.max(n/s,-1)}function ay(r){let e=[r],t=new Set;for(;e.length;){let n=e.pop();if(!(!n||typeof n!="object"||t.has(n))){t.add(n);for(let[s,i]of Object.entries(n))if(s!=="extras"){if(s==="extensions"&&i&&typeof i=="object"&&Object.keys(i).some(o=>!["KHR_materials_unlit","KHR_materials_common"].includes(o)))return!0;e.push(i)}}}return!1}function au(r,e){let t=r.json.accessors?.[e];if(!t||!Number.isSafeInteger(e)||e<0)return"invalid accessor reference";let n=typeof t.componentType=="number"&&Object.hasOwn(oy,t.componentType)?oy[t.componentType]:void 0,s=typeof t.type=="string"&&Object.hasOwn(BS,t.type)?BS[t.type]:void 0;if(!n||!s||!Number.isSafeInteger(t.count)||t.count<1)return"invalid component type, shape, or count";let[i,o]=s,a=r.json.bufferViews?.[t.bufferView],c=r.json.buffers?.[a?.buffer],u=r.buffers[a?.buffer];if(!a||!c||!u)return"requires a loaded accessor buffer";if(t.sparse||t.extensions||a.extensions)return"sparse or extension-bearing data is unsupported";let f=i*o*n,l=t.byteStride??a.byteStride??f,d=l===0?f:l,h=t.byteOffset??0,m=a.byteOffset??0;return!(u.arrayBuffer instanceof ArrayBuffer)||!Number.isSafeInteger(d)||d<f||t.byteStride!==void 0&&t.byteStride>255||!Number.isSafeInteger(h)||h<0||!Number.isSafeInteger(m)||m<0||!Number.isSafeInteger(a.byteLength)||a.byteLength<1||!Number.isSafeInteger(c.byteLength)||c.byteLength<1||m+a.byteLength>c.byteLength||h+(t.count-1)*d+f>a.byteLength||!Number.isSafeInteger(u.byteOffset)||u.byteOffset<0||!Number.isSafeInteger(u.byteLength)||u.byteLength<c.byteLength||u.byteOffset+u.byteLength>u.arrayBuffer.byteLength?"invalid source buffer span or stride":{accessor:t,bufferIndex:a.buffer,componentSize:n,rows:i,columns:o,byteStride:d,data:new DataView(u.arrayBuffer),byteOffset:u.byteOffset+m+h}}function Wt(r,e,t){let n=r.byteOffset+e*r.byteStride+t*r.componentSize;switch(r.accessor.componentType){case 5120:return r.data.getInt8(n);case 5121:return r.data.getUint8(n);case 5122:return r.data.getInt16(n,!0);case 5123:return r.data.getUint16(n,!0);case 5125:return r.data.getUint32(n,!0);default:return r.data.getFloat32(n,!0)}}var oy,Wk,BS,cu=p(()=>{"use strict";ke();iy();oy={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Wk={5120:127,5121:255,5122:32767,5123:65535},BS={SCALAR:[1,1],VEC2:[2,1],VEC3:[3,1],VEC4:[4,1],MAT2:[2,2],MAT3:[3,3],MAT4:[4,4]}});function RS(r,e){let t=r.asset;t.premultipliedAlpha&&e("asset premultipliedAlpha rendering"),MS(t,["profile","premultipliedAlpha"]);for(let[n,s]of(r.textures||[]).entries()){let i=s;for(let[o,a]of Object.entries({format:6408,internalFormat:6408,target:3553,type:5121}))i[o]!==void 0&&i[o]!==a&&e(`texture ${n} non-default ${o} rendering`);MS(i,["format","internalFormat","target","type"])}}function MS(r,e){let t={};for(let a of e)Object.hasOwn(r,a)&&(t[a]=r[a],delete r[a]);if(!Object.keys(t).length)return;let n=cy(r.extras)?r.extras:r.extras===void 0?{}:{originalExtras:r.extras},s=cy(n.gltf1)?n.gltf1:n.gltf1===void 0?{}:{originalExtras:n.gltf1},i=cy(s.legacyFields)?s.legacyFields:s.legacyFields===void 0?{}:{originalExtras:s.legacyFields},o=Object.keys(t).some(a=>Object.hasOwn(i,a));r.extras={...n,gltf1:{...s,legacyFields:{...i,...t,...o?{originalExtras:i}:{}}}}}function cy(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}function uy(r){let e=/^(JOINTS?|WEIGHTS?|TEXCOORD|COLOR)(?:_(\d+))?$/.exec(r);if(e){let t=e[1].startsWith("JOINT")?"JOINTS":e[1].startsWith("WEIGHT")?"WEIGHTS":e[1],n=Number(e[2]||0);if(!Number.isSafeInteger(n)||n>999999999)throw new Error(`glTF v1: invalid attribute set index ${r}`);return`${t}_${n}`}return["POSITION","NORMAL","TANGENT"].includes(r)||r.startsWith("_")||r.includes(":")?r:`_${r}`}var DS=p(()=>{"use strict"});function NS(r,e,t){for(let[s,i]of(r.animations||[]).entries()){let l=function(d,h,m){try{let b=typeof d=="string"?e(d,h):d,w=h==="accessor"?r.accessors:r.nodes;if(typeof b=="number"&&Number.isSafeInteger(b)&&b>=0&&w?.[b])return b}catch{}return t(`animation ${s} ${m} unresolved ${h} reference`),d};var n=l;let o=i,a=o.parameters||{},c=new Map,u=i.samplers,f=Array.isArray(u)?u.map((d,h)=>[String(h),d]):Object.entries(u||{});i.samplers=f.map(([d,h],m)=>{c.set(d,m);for(let b of["input","output"]){let w=h[b],g=Object.hasOwn(a,w)?a[w]:w;h[b]=l(g,"accessor",`sampler ${d} ${b}`)}return h.interpolation??="LINEAR",h}),delete o.parameters;for(let[d,h]of(i.channels||[]).entries()){if(typeof h.sampler=="string"){let b=c.get(h.sampler);b===void 0?t(`animation ${s} channel ${d} unresolved sampler ${h.sampler}`):h.sampler=b}let m=h.target;m?.id!==void 0?(m.node=l(m.id,"node",`channel ${d} target`),delete m.id):typeof m?.node=="string"&&(m.node=l(m.node,"node",`channel ${d} target`))}}}var kS=p(()=>{"use strict"});function CS(r,e,t){let n=r.nodes||[],s=new Map;for(let[a,c]of n.entries())for(let u of c.children||[])s.set(u,s.has(u)?null:a);let i=[];for(let[a,c]of(r.scenes||[]).entries()){let u=o(c.nodes||[]);if(!u){e(`scene ${a} invalid node hierarchy`);continue}for(let f of Array.from(u)){let l=r.skins?.[n[f].skin];if(!Array.isArray(l?.joints)||!l.joints.length||l.skeleton===void 0||u.has(l.skeleton)&&l.joints.every(b=>u.has(b)))continue;let d=l.skeleton,h=new Set;for(;!h.has(d)&&typeof s.get(d)=="number";)h.add(d),d=s.get(d);let m=o([d]);if(h.has(d)||s.get(d)===null||!m||!l.joints.every(b=>m.has(b))||Array.from(m).some(b=>u.has(b)||n[b].mesh!==void 0||n[b].camera!==void 0||n[b].extensions!==void 0)){e(`scene ${a} skin ${n[f].skin} cannot safely attach detached skeleton`);continue}for(let b of m)u.add(b);i.push(()=>{c.nodes||=[],c.nodes.push(d),t(`Attached detached skeleton root ${d} to scene ${a}.`)})}}for(let a of i)a();function o(a){let c=new Set,u=[...a];for(;u.length;){let f=u.pop();if(!Number.isSafeInteger(f)||!n[f]||c.has(f)||s.get(f)===null)return null;c.add(f),u.push(...n[f].children||[])}return c}}var US=p(()=>{"use strict"});function VS(r,e){for(let[t,n]of(r.cameras||[]).entries()){let s=n.perspective,i=n.orthographic;(n.type==="perspective"?s&&uu(s.yfov)&&uu(s.znear)&&(s.aspectRatio===void 0||uu(s.aspectRatio))&&(s.zfar===void 0||uu(s.zfar)&&s.zfar>s.znear):n.type==="orthographic"&&i&&Number.isFinite(i.xmag)&&i.xmag!==0&&Number.isFinite(i.ymag)&&i.ymag!==0&&Number.isFinite(i.znear)&&i.znear>=0&&uu(i.zfar)&&i.zfar>i.znear)||e(`camera ${t} invalid projection parameters`)}}function uu(r){return Number.isFinite(r)&&r>0}var PS=p(()=>{"use strict"});function jS(r,e,t){let n=new Map,s=new Set;for(let[i,o]of(r.json.meshes||[]).entries())for(let[a,c]of o.primitives.entries()){let u=`mesh ${i} primitive ${a}`;for(let b of["TEXCOORD","COLOR","JOINTS","WEIGHTS"])Object.keys(c.attributes).filter(g=>g.startsWith(`${b}_`)).map(g=>Number(g.slice(b.length+1))).sort((g,x)=>g-x).some((g,x)=>g!==x)&&t(`${u} ${b} sets must be contiguous starting at zero`);for(let[b,w]of Object.entries(c.attributes)){let g=b.split("_")[0];if(!["NORMAL","TANGENT","COLOR","TEXCOORD","JOINTS","WEIGHTS"].includes(g))continue;let x=`${g}:${w}`;if(s.has(x))continue;s.add(x);let T=e(w,`${b} accessor ${w}`);T&&$k(T,g,`${b} accessor ${w}`,t)}let f=Object.values(c.attributes).map(b=>(Number.isSafeInteger(b)?r.json.accessors?.[b]:void 0)?.count);if(!f.length||f.some(b=>!Number.isSafeInteger(b)||b<1)){t(`${u} requires valid vertex attribute accessors`);continue}f.some(b=>b!==f[0])&&t(`${u} vertex attribute counts do not match`);let l=c.indices===void 0?f[0]:r.json.accessors?.[c.indices]?.count,d=c.mode===void 0?4:c.mode;if(!Number.isInteger(d)||d<0||d>6?t(`${u} requires a primitive mode in [0, 6]`):(!c.extensions||!Object.keys(c.extensions).length)&&(!Number.isSafeInteger(l)||l<1||d===1&&l%2!==0||[2,3].includes(d)&&l<2||d===4&&l%3!==0||[5,6].includes(d)&&l<3)&&t(`${u} draw count ${l} is incompatible with primitive mode ${d}`),c.indices===void 0)continue;let h=e(c.indices,`${u} indices`);if(!h)continue;if(h.accessor.type!=="SCALAR"||![5121,5123,5125].includes(h.accessor.componentType)||h.accessor.normalized){t(`${u} indices require unnormalized unsigned SCALAR data`);continue}let m=n.get(c.indices);if(m===void 0){m=0;for(let b=0;b<h.accessor.count;b++)m=Math.max(m,Wt(h,b,0));n.set(c.indices,m)}f.some(b=>m>=b)&&t(`${u} index ${m} is outside its vertex attribute counts`)}}function $k(r,e,t,n){let s=r.accessor,i=s.componentType===5126&&!s.normalized,o=[5121,5123].includes(s.componentType)&&s.normalized===!0,a=s.normalized===void 0||typeof s.normalized=="boolean",c=e==="NORMAL"?s.type==="VEC3"&&i:e==="TANGENT"?s.type==="VEC4"&&i:e==="JOINTS"?s.type==="VEC4"&&[5121,5123].includes(s.componentType)&&!s.normalized:e==="COLOR"?["VEC3","VEC4"].includes(s.type)&&(i||o):s.type===(e==="TEXCOORD"?"VEC2":"VEC4")&&(i||o);if(!a||!c){n(`${t} has incompatible core attribute shape, component type, or normalization`);return}for(let u=0;u<s.count;u++){let f=Array.from({length:r.rows},(l,d)=>Wt(r,u,d));if(f.some(l=>!Number.isFinite(l))||["NORMAL","TANGENT"].includes(e)&&Math.abs(Math.hypot(...f.slice(0,3))-1)>1e-5||e==="TANGENT"&&f[3]!==1&&f[3]!==-1||["COLOR","WEIGHTS"].includes(e)&&i&&f.some(l=>l<0||l>1)){n(`${t} requires finite core values, unit directions, tangent handedness \xB11, and colors/weights in [0, 1]`);return}}}var GS=p(()=>{"use strict";cu()});function zS(r,e,t){let n=new Map,s=new Set,i=[],o=(l,d)=>{let h=n.get(l);return h===void 0&&(h=au(r,l),n.set(l,h)),typeof h=="string"?(s.has(l)||(s.add(l),e(`${d}: ${h}`)),null):h},a=new Set;for(let l of r.json.meshes||[])for(let d of l.primitives)d.attributes.POSITION!==void 0&&a.add(d.attributes.POSITION);for(let l of a){let d=o(l,`POSITION accessor ${l}`);if(d){if(!dd(d,"VEC3")){e(`POSITION accessor ${l} requires unnormalized FLOAT VEC3 data`);continue}u(d,l)}}f(),c(),qk(r,o,e),jS(r,o,e);for(let l of i)l();function c(){for(let[l,d]of(r.json.skins||[]).entries()){if(d.inverseBindMatrices===void 0)continue;let h=`skin ${l} inverse-bind matrices`,m=o(d.inverseBindMatrices,h);if(m){if(!dd(m,"MAT4")||m.accessor.count<(d.joints?.length||0)){e(`${h} require FLOAT MAT4 data with at least one matrix per joint`);continue}for(let b=0;b<m.accessor.count;b++){let w=Array.from({length:16},(g,x)=>Wt(m,b,x));if(w.some(g=>!Number.isFinite(g))||w[3]!==0||w[7]!==0||w[11]!==0||w[15]!==1){e(`${h} require finite affine matrices`);break}}}}}function u(l,d){let h=new Array(l.rows).fill(1/0),m=new Array(l.rows).fill(-1/0);for(let b=0;b<l.accessor.count;b++)for(let w=0;w<l.rows;w++){let g=Wt(l,b,w);if(!Number.isFinite(g))return e(`accessor ${d} non-finite values cannot supply required bounds`),!1;h[w]=Math.min(h[w],g),m[w]=Math.max(m[w],g)}return(JSON.stringify(l.accessor.min)!==JSON.stringify(h)||JSON.stringify(l.accessor.max)!==JSON.stringify(m))&&i.push(()=>{l.accessor.min=h,l.accessor.max=m,t(`Calculated required bounds for accessor ${d}.`)}),!0}function f(){let l=new Set,d=new Set;for(let[h,m]of(r.json.animations||[]).entries()){let b=new Set;(!m.samplers.length||!m.channels?.length)&&e(`animation ${h} requires samplers and channels`);for(let[w,g]of m.samplers.entries()){let x=`animation ${h} sampler ${w}`;if(["LINEAR","STEP"].includes(g.interpolation??"LINEAR")||e(`${x} unsupported interpolation ${g.interpolation}`),!l.has(g.input)){l.add(g.input);let T=o(g.input,`${x} input`);if(T)if(!dd(T,"SCALAR"))e(`${x} time input requires unnormalized FLOAT SCALAR data`);else{let _=-1/0,v=!0;for(let I=0;I<T.accessor.count;I++){let N=Wt(T,I,0);(!Number.isFinite(N)||N<0||N<=_)&&(v=!1),_=N}v?u(T,g.input):e(`${x} times must be finite, nonnegative, and strictly increasing`)}}}for(let[w,g]of(m.channels||[]).entries()){let x=`animation ${h} channel ${w}`,T=Number.isSafeInteger(g.sampler)?m.samplers[g.sampler]:void 0,_=g.target,v=Number.isSafeInteger(_?.node)?r.json.nodes?.[_.node]:void 0;if(!T||!v||!["translation","rotation","scale"].includes(_?.path)){e(`${x} invalid sampler, node, or TRS target`);continue}v.matrix!==void 0&&e(`${x} matrix node requires TRS decomposition`);let I=`${_.node}:${_.path}`;if(b.has(I)&&e(`${x} duplicate node/path target`),b.add(I),!["LINEAR","STEP"].includes(T.interpolation??"LINEAR"))continue;let N=r.json.accessors?.[T.input],q=o(T.output,`${x} output`);if(!q)continue;if(!dd(q,_.path==="rotation"?"VEC4":"VEC3")||q.accessor.count!==N?.count){e(`${x} output shape, type, or count does not match its target and keys`);continue}let re=`${T.output}:${_.path}`;if(!d.has(re)){d.add(re);for(let pe=0;pe<q.accessor.count;pe++){let Me=Array.from({length:q.rows},(Re,ce)=>Wt(q,pe,ce));if(Me.some(Re=>!Number.isFinite(Re))||_.path==="rotation"&&Math.abs(Math.hypot(...Me)-1)>1e-5){e(`${x} output requires finite values and unit rotation quaternions`);break}}}}}}}function dd(r,e){return r.accessor.componentType===5126&&!r.accessor.normalized&&r.accessor.type===e}function qk(r,e,t){let n=new Set;for(let s of r.json.nodes||[]){let i=r.json.skins?.[s.skin],o=r.json.meshes?.[s.mesh];if(!Array.isArray(i?.joints)||!i.joints.length||!o)continue;let a=`${s.mesh}:${s.skin}`;if(!n.has(a)){n.add(a);for(let[c,u]of o.primitives.entries()){let f=`mesh ${s.mesh} primitive ${c} skin ${s.skin}`,l=Object.keys(u.attributes).filter(b=>/^JOINTS_\d+$/.test(b)).map(b=>Number(b.slice(7))).sort((b,w)=>b-w),d=Object.keys(u.attributes).filter(b=>/^WEIGHTS_\d+$/.test(b)).map(b=>Number(b.slice(8))).sort((b,w)=>b-w);if(!l.length&&!d.length){t(`${f} requires JOINTS_0 and WEIGHTS_0 skin influences`);continue}if(JSON.stringify(l)!==JSON.stringify(d)||l.some((b,w)=>b!==w)){t(`${f} requires matching contiguous joint/weight sets starting at zero`);continue}let h=r.json.accessors?.[u.attributes.POSITION]?.count,m=l.map(b=>({joints:e(u.attributes[`JOINTS_${b}`],`${f} joint set ${b}`),weights:e(u.attributes[`WEIGHTS_${b}`],`${f} weight set ${b}`)}));if(!m.some(({joints:b,weights:w})=>!b||!w)){if(m.some(({joints:b,weights:w})=>b.accessor.type!=="VEC4"||w.accessor.type!=="VEC4"||![5121,5123].includes(b.accessor.componentType)||b.accessor.normalized||!(w.accessor.componentType===5126&&!w.accessor.normalized||[5121,5123].includes(w.accessor.componentType)&&w.accessor.normalized)||b.accessor.count!==w.accessor.count||h!==void 0&&b.accessor.count!==h||b.accessor.count!==m[0].joints.accessor.count)){t(`${f} incompatible influence accessor types or vertex counts`);continue}for(let b=0;b<m[0].joints.accessor.count;b++){let w=0,g=0,x=!0,T=new Set;for(let{joints:_,weights:v}of m){let I=v.accessor.normalized?v.accessor.componentType===5121?255:65535:1;for(let N=0;N<4;N++){let q=Wt(_,b,N),re=Wt(v,b,N)/I;(q>=i.joints.length||!Number.isFinite(re)||re<0||re>1)&&(x=!1),re>0&&(T.has(q)&&(x=!1),T.add(q),g++),w+=re}}if(!x||Math.abs(w-1)>2e-7*Math.max(g,1)){t(`${f} invalid palette index, repeated weighted joint, or weights not summing to one at vertex ${b}`);break}}}}}}}var WS=p(()=>{"use strict";cu();GS()});function $S(r,e,t,n){let s=new Map,i=new Map,o=new Map;for(let[c,u]of(r.json.buffers||[]).entries()){let f=`buffer ${c}`,l=r.buffers[c],d=!!(l&&l.arrayBuffer instanceof ArrayBuffer&&Number.isSafeInteger(l.byteOffset)&&l.byteOffset>=0&&Number.isSafeInteger(l.byteLength)&&l.byteLength>=0&&Number.isSafeInteger(l.byteOffset+l.byteLength)&&l.byteOffset+l.byteLength<=l.arrayBuffer.byteLength);l&&!d&&t(`${f} invalid borrowed payload span`);let h=u.byteLength;if(h===void 0&&e.has(c)&&!u.extensions&&d&&l.byteLength>0&&(h=l.byteLength,i.set(c,h)),!Number.isSafeInteger(h)||h<1){t(`${f} requires a positive byteLength; missing lengths require unambiguous loaded URI data`);continue}s.set(c,h),d&&l.byteLength<h&&t(`${f} declared byteLength exceeds its loaded payload`)}let a=ay(r.json);for(let[c,u]of(r.json.bufferViews||[]).entries()){let f=u.byteOffset===void 0?0:u.byteOffset,l=s.get(u.buffer),d=u.byteLength===void 0&&!a&&l!==void 0?Kk(r,c,s):u.byteLength;u.byteLength===void 0&&d!==void 0&&o.set(c,d),(!Number.isSafeInteger(u.buffer)||u.buffer<0||l===void 0||!Number.isSafeInteger(f)||f<0||!Number.isSafeInteger(d)||(d??0)<1||!Number.isSafeInteger(f+(d??0))||f+(d??0)>l)&&t(`bufferView ${c} requires a valid buffer reference and contained positive byte span`)}for(let[c,u]of o)r.json.bufferViews[c].byteLength=u,n(`Inferred bufferView ${c} byteLength from its dense accessor spans.`);for(let[c,u]of i)r.json.buffers[c].byteLength=u,n(`Inferred buffer ${c} byteLength from its loaded URI payload.`)}function Kk(r,e,t){let n=r.json.bufferViews[e];if(n.byteOffset!==void 0&&(!Number.isSafeInteger(n.byteOffset)||n.byteOffset<0)||n.byteStride!==void 0&&(!Number.isSafeInteger(n.byteStride)||n.byteStride<0)||r.json.images?.some(a=>a.bufferView===e)||r.json.accessors?.some(a=>!!a.sparse))return;let s=t.get(n.buffer)-(n.byteOffset??0),i={...r,json:{...r.json,buffers:r.json.buffers.map((a,c)=>({...a,byteLength:t.get(c)})),bufferViews:r.json.bufferViews.map((a,c)=>c===e?{...a,byteLength:s}:a)}},o=0;for(let[a,c]of(r.json.accessors||[]).entries()){if(c.bufferView!==e)continue;let u=c;for(let d of[u.byteOffset,u.byteStride])if(d!==void 0&&(!Number.isSafeInteger(d)||d<0))return;let f=au(i,a);if(typeof f=="string")return;let l=(c.byteOffset??0)+(c.count-1)*f.byteStride+f.rows*f.columns*f.componentSize;o=Math.max(o,l)}return o>0?o:void 0}var qS=p(()=>{"use strict";cu()});function KS(r,e,t){let n=new Map;for(let i of r.animations||[])for(let o of i.channels||[]){let a=o.target?.node;if(!Number.isSafeInteger(a))continue;let c=n.get(a)||new Set;c.add(o.target.path),n.set(a,c)}let s=[];for(let[i,o]of n){let a=r.nodes?.[i];if(a?.matrix===void 0)continue;let c=`animated matrix node ${i}`;if(o.size!==1||!o.has("translation")){e(`${c} rotation or scale animation requires an unambiguous TRS basis`);continue}if(a.translation!==void 0||a.rotation!==void 0||a.scale!==void 0||a.extensions!==void 0){e(`${c} has conflicting TRS fields or opaque extensions`);continue}let u=Xk(a.matrix);if(!u){e(`${c} requires a finite affine, nonsingular matrix without shear`);continue}s.push(()=>{Object.assign(a,u),delete a.matrix,t(`Decomposed translation-only animated matrix node ${i}, preserving its linear transform.`)})}for(let i of s)i()}function Xk(r){if(!Array.isArray(r)||r.length!==16||Array.from(r).some(a=>!Number.isFinite(a))||r[3]!==0||r[7]!==0||r[11]!==0||r[15]!==1)return null;let e=[0,1,2].map(a=>Math.hypot(...r.slice(a*4,a*4+3)));if(e.some(a=>!Number.isFinite(a)||a===0))return null;let t=e.map((a,c)=>r.slice(c*4,c*4+3).map(u=>u/a));for(let a=0;a<3;a++)for(let c=a+1;c<3;c++)if(Math.abs(t[a].reduce((u,f,l)=>u+f*t[c][l],0))>1e-6)return null;let n=t[0][0]*(t[1][1]*t[2][2]-t[1][2]*t[2][1])-t[1][0]*(t[0][1]*t[2][2]-t[0][2]*t[2][1])+t[2][0]*(t[0][1]*t[1][2]-t[0][2]*t[1][1]);if(Math.abs(Math.abs(n)-1)>1e-6)return null;n<0&&(e[0]=-e[0],t[0]=t[0].map(a=>-a));let s=Array.from(new Uc().fromMatrix3(t.flat()).normalize()),i=r.slice(12,15),o=new Xs().translate(i).multiplyRight(new Xs().fromQuaternion(s)).scale(e);return Array.from(o).some((a,c)=>!Number.isFinite(a)||Math.abs(a-r[c])>1e-6*Math.max(1,Math.abs(r[c])))?null:{translation:i,rotation:s,scale:e}}var XS=p(()=>{"use strict";Sl()});function QS(r,e,t){let n=new Set,s=r.extensionsRequired?.includes(Pr)||!1;for(let[o,a]of(r.materials||[]).entries()){let c=a,u=a.extensions?.[Pr];if(u===void 0){Hk(c,r,e,t);continue}tE(c,u);let f=`material ${o}`;if(!lr(u)||typeof u.technique!="string"||!["CONSTANT","LAMBERT","PHONG","BLINN"].includes(u.technique)){e(`${f} unknown ${Pr} technique`);continue}if(u.values!==void 0&&!lr(u.values)){e(`${f} common material values must be an object`);continue}let l=u.values||{},d=Object.keys(u).filter(I=>!["technique","values","doubleSided","transparent","jointCount"].includes(I)),h=Object.keys(l).filter(I=>!["ambient","diffuse","emission","specular","shininess","transparency","doubleSided","transparent"].includes(I));(d.length||h.length)&&e(`${f} unrecognized common material fields ${[...d,...h].join(", ")}`),u.jointCount!==void 0&&(!Number.isSafeInteger(u.jointCount)||Number(u.jointCount)<0)&&e(`${f} invalid common material jointCount`);let m=HS(l.emission,r,`${f} emission`,e),b=u.technique==="CONSTANT",w=b?m:HS(l.diffuse,r,`${f} diffuse`,e),g=l.transparency===void 0?1:l.transparency,x=typeof g=="number"&&Number.isFinite(g)&&g>=0&&g<=1;x||e(`${f} common material transparency must be in [0, 1]`);let T=JS(u,l,"transparent",f,e),_=JS(u,l,"doubleSided",f,e);l.ambient!==void 0&&!YS(l.ambient)&&e(`${f} ambient lighting`),["PHONG","BLINN"].includes(String(u.technique))&&(l.specular!==void 0&&!YS(l.specular)&&e(`${f} specular/shininess lighting`),l.shininess!==void 0&&(typeof l.shininess!="number"||!Number.isFinite(l.shininess)||l.shininess<0)&&e(`${f} invalid common material shininess`)),a.pbrMetallicRoughness||={};let v=a.pbrMetallicRoughness;if(v.metallicFactor??=0,v.roughnessFactor??=1,w){let I=[...w.factor];I[3]*=x?g:1,v.baseColorFactor??=I,w.texture&&(v.baseColorTexture??=w.texture)}a.doubleSided??=_,a.alphaMode??=T?"BLEND":"OPAQUE",b?(a.extensions[fy]??={},Jk(r,fy,s),t(`Converted ${f} CONSTANT emission to an unlit material.`)):(m&&(a.emissiveFactor??=m.factor.slice(0,3),m.texture&&(a.emissiveTexture??=m.texture)),t(`Approximated ${f} ${String(u.technique)} lighting with rough non-metallic PBR factors.`)),typeof c.technique=="string"?n.add(c.technique):c.technique!==void 0&&e(`${f} invalid fallback technique ID`),delete c.technique,delete c.values,delete a.extensions[Pr],Object.keys(a.extensions).length||delete a.extensions}let i=rE(r);return(r.extensions?.[Pr]!==void 0||(r.nodes||[]).some(o=>o.extensions?.[Pr]!==void 0))&&e(`${Pr} lights or scene payloads`),i.has(Pr)||(r.extensionsUsed=r.extensionsUsed?.filter(o=>o!==Pr),r.extensionsRequired=r.extensionsRequired?.filter(o=>o!==Pr)),n}function ZS(r,e){if(!e.size||[...rE(r)].some(c=>![Pr,fy].includes(c))||(r.materials||[]).some(c=>c.technique!==void 0||c.values!==void 0))return!1;let t=r;if(["techniques","programs","shaders"].some(c=>t[c]!==void 0&&!lr(t[c])))return!1;let n=lr(t.techniques)?t.techniques:{},s=lr(t.programs)?t.programs:{},i=lr(t.shaders)?t.shaders:{},o=new Set,a=new Set;if(Object.keys(n).some(c=>!e.has(c)))return!1;for(let c of Object.values(n))lr(c)&&typeof c.program=="string"&&o.add(c.program);if(Object.keys(s).some(c=>!o.has(c)))return!1;for(let c of Object.values(s))if(lr(c))for(let u of["vertexShader","fragmentShader"])typeof c[u]=="string"&&a.add(c[u]);return Object.keys(i).every(c=>a.has(c))}function Hk(r,e,t,n){tE(r);let s=lr(r.values)?r.values:{},i=s.tex||s.texture2d_0||s.diffuseTex||s.diffuse,o=eE(e,i),a=ly(s.diffuse)?s.diffuse:void 0;if(o!==-1||a){let c=a?[...a]:[1,1,1,1],u=s.transparency;typeof u=="number"&&u>=0&&u<=1&&(c[3]*=u),r.pbrMetallicRoughness||={},r.pbrMetallicRoughness.metallicFactor??=0,r.pbrMetallicRoughness.roughnessFactor??=1,r.pbrMetallicRoughness.baseColorFactor??=c,o!==-1&&(r.pbrMetallicRoughness.baseColorTexture??={index:o}),r.pbrMetallicRoughness.baseColorFactor[3]<1&&(r.alphaMode||="BLEND"),n("Approximated glTF v1 diffuse material values with PBR material factors.")}(r.technique||r.values)&&t(`material technique ${r.technique||"<unnamed>"}`)}function HS(r,e,t,n){if(r===void 0)return{factor:[0,0,0,1]};if(ly(r))return{factor:[...r]};let s=eE(e,r);return s!==-1?{factor:[1,1,1,1],texture:{index:s}}:(n(`${t} requires an RGBA factor in [0, 1] or a resolved texture ID`),null)}function eE(r,e){return typeof e!="string"?-1:(r.textures||[]).findIndex(t=>t.id===e)}function JS(r,e,t,n,s){r[t]!==void 0&&e[t]!==void 0&&r[t]!==e[t]&&s(`${n} conflicting common material ${t}`);let i=e[t]!==void 0?e[t]:r[t]!==void 0?r[t]:!1;return typeof i=="boolean"?i:(s(`${n} common material ${t} must be boolean`),!1)}function tE(r,e){let t=lr(r.extras)?r.extras:r.extras===void 0?{}:{originalExtras:r.extras},n=lr(t.gltf1)?t.gltf1:t.gltf1===void 0?{}:{originalExtras:t.gltf1},s={technique:r.technique,values:r.values,...e===void 0?{}:{commonMaterial:e}},i=Object.keys(s).some(o=>Object.hasOwn(n,o));r.extras={...t,gltf1:{...n,...s,...i?{originalExtras:n}:{}}}}function Jk(r,e,t){r.extensionsUsed=[...new Set([...r.extensionsUsed||[],e])],t&&(r.extensionsRequired=[...new Set([...r.extensionsRequired||[],e])])}function rE(r){let e=new Set,t=[r],n=new Set;for(;t.length;){let s=t.pop();if(!(!s||typeof s!="object"||n.has(s))){if(n.add(s),lr(s)&&lr(s.extensions))for(let i of Object.keys(s.extensions))e.add(i);for(let[i,o]of Object.entries(s))i!=="extras"&&t.push(o)}}return e}function ly(r){return Array.isArray(r)&&r.length===4&&r.every(e=>typeof e=="number"&&Number.isFinite(e)&&e>=0&&e<=1)}function YS(r){return ly(r)&&r.slice(0,3).every(e=>e===0)}function lr(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}var Pr,fy,nE=p(()=>{"use strict";Pr="KHR_materials_common",fy="KHR_materials_unlit"});function sE(r,e={}){let t=new hy;return t.normalize(r,e,!0),()=>t.finishNormalization(r)}var dy,Yk,hy,iE=p(()=>{"use strict";xS();AS();IS();LS();cu();DS();kS();US();PS();WS();qS();XS();nE();dy={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",cameras:"camera",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},Yk={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",camera:"cameras",inverseBindMatrices:"accessors",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},hy=class r{idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}};json;report={converted:!1,mutated:!1,unsupported:[],warnings:[]};strict=!1;log;finished=!1;pendingAccessors=new Set;accessorConversions=new Map;uriBufferIndices=new Set;normalize(e,t={},n=!1){if(t.mutate===!1){let o={...e,json:JSON.parse(JSON.stringify(e.json))},a=new r().normalize(o,{...t,mutate:!0});return a.mutated=!1,a}this.strict=t.normalize==="strict",this.log=t.log,this.json=e.json;let s=e.json;switch(s.asset&&s.asset.version){case"2.0":case"2.1":return this.report;case void 0:case"1.0":break;default:return this._warning(`Unknown glTF version ${s.asset.version}`),this.report}if(!t.normalize)throw new Error("glTF v1 is not supported.");this.report.converted=!0,this.report.mutated=!0,this.log?.log(1,"glTF: Converting glTF v1 to glTF v2 using experimental normalization.")(),this._addAsset(s),this._orderBinaryBufferPayloads(e),this._convertTopLevelObjectsToArrays(s),wS(e),this._convertObjectIdsToArrayIndices(s),this._updateObjects(s);for(let[o,a]of(s.buffers||[]).entries())typeof a.uri=="string"&&this.uriBufferIndices.add(o);let i=QS(s,o=>this._unsupported(o),o=>this._warning(o));return NS(s,(o,a)=>this._convertIdToIndex(o,a),o=>this._unsupported(o)),VS(s,o=>this._unsupported(o)),KS(s,o=>this._unsupported(o),o=>this._warning(o)),RS(s,o=>this._unsupported(o)),this.accessorConversions=FS(s),_S(s,o=>this.pendingAccessors.add(o)),vS(s,o=>this._convertIdToIndex(o,"node"),o=>this._unsupported(o)),this._updateNodes(s),CS(s,o=>this._unsupported(o),o=>this._warning(o)),this._preserveLegacyResources(s,i),this._removeEmptyCollections(s),n?this.report:this.finishNormalization(e)}finishNormalization(e){return this.report.converted&&!this.finished&&($S(e,this.uriBufferIndices,t=>this._unsupported(t),t=>this._warning(t)),OS(e,this.accessorConversions,this.pendingAccessors,t=>this._unsupported(t),t=>this._warning(t)),SS(e,t=>this._unsupported(t)),zS(e,t=>this._unsupported(t),t=>this._warning(t)),this._finishReport(),this.log?.log(1,`glTF: Completed glTF v1 normalization (${this.report.unsupported.length} unsupported features).`)(),this.finished=!0),this.report}_unsupported(e){if(this.report.unsupported.push(e),this.log?.warn(`glTF v1 normalization does not support ${e}`)(),this.strict)throw new Error(`glTF v1 normalization does not support ${e}`)}_warning(e){this.report.warnings.push(e),this.log?.warn(`glTF: ${e}`)()}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_orderBinaryBufferPayloads(e){let t=this.json.buffers;if(!t||Array.isArray(t)||!t.binary_glTF)return;let s=Object.keys(t).indexOf("binary_glTF");s>0&&e.buffers?.length&&(e.buffers=[e.buffers[s],...e.buffers.filter((i,o)=>o!==s)])}_convertTopLevelObjectsToArrays(e){for(let t in dy)this._convertTopLevelObjectToArray(e,t)}_convertTopLevelObjectToArray(e,t){let n=e[t];if(!n||Array.isArray(n))return;e[t]=[];let s=Object.keys(n),i=t==="buffers"&&s.includes("binary_glTF")?["binary_glTF",...s.filter(o=>o!=="binary_glTF")]:s;for(let o of i){let a=n[o];a.id=a.id||o;let c=e[t].length;e[t].push(a),this.idToIndexMap[t][o]=c}}_convertObjectIdsToArrayIndices(e){for(let t in dy)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(let t of e.textures)this._convertTextureIds(t);for(let t of e.meshes)this._convertMeshIds(t);for(let t of e.nodes)this._convertNodeIds(t);for(let t of e.scenes)this._convertSceneIds(t)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(let t of e.primitives){let{attributes:n,indices:s,material:i}=t,o=new Map;for(let a in n){let c=uy(a),u=o.get(c);if(u!==void 0&&n[u]!==n[a])throw new Error(`glTF v1: conflicting attribute aliases ${u} and ${a}`);o.set(c,a)}t.attributes=Object.fromEntries(Object.entries(n).map(([a,c])=>[uy(a),this._convertIdToIndex(c,"accessor")])),s&&(t.indices=this._convertIdToIndex(s,"accessor")),i&&(t.material=this._convertIdToIndex(i,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map(t=>this._convertIdToIndex(t,"node"))),e.meshes&&(e.meshes=e.meshes.map(t=>this._convertIdToIndex(t,"mesh")))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map(t=>this._convertIdToIndex(t,"node")))}_convertIdsToIndices(e,t){e[t]||(e[t]=[]);for(let n of e[t])for(let s in n){let i=n[s],o=this._convertIdToIndex(i,s);n[s]=o}}_convertIdToIndex(e,t){let n=Yk[t];if(n in this.idToIndexMap){let s=this.idToIndexMap[n][e];if(!Number.isFinite(s))throw new Error(`gltf v1: failed to resolve ${t} with id ${e}`);return s}return e}_updateObjects(e){for(let t of this.json.buffers)delete t.type}_updateNodes(e){let t=e.nodes||[];for(let n=0;n<t.length;n++){let s=t[n];if(!Array.isArray(s.meshes))continue;let i=s.meshes;delete s.meshes,s.mesh=i.shift();for(let o of i){let a={...s,mesh:o,children:void 0};delete a.id,delete a.matrix,delete a.translation,delete a.rotation,delete a.scale,t.push(a),s.children||=[],s.children.push(t.length-1)}}}_preserveLegacyResources(e,t){let n=ZS(e,t),s={};for(let i of["techniques","programs","shaders"])e[i]&&(s[i]=e[i],delete e[i],n||this._unsupported(`legacy ${i}`));Object.keys(s).length&&(e.extras={...e.extras,gltf1Resources:s},n&&this._warning("Preserved shader resources overridden by converted common materials."))}_removeEmptyCollections(e){for(let t of e.nodes||[])Array.isArray(t.children)&&t.children.length===0&&delete t.children;for(let t of e.scenes||[])Array.isArray(t.nodes)&&t.nodes.length===0&&delete t.nodes;for(let t of[...Object.keys(dy),"extensionsUsed","extensionsRequired"])Array.isArray(e[t])&&e[t].length===0&&delete e[t]}_finishReport(){this.report.unsupported.length&&this.report.warnings.push(`Converted glTF v1 with unsupported features: ${this.report.unsupported.join(", ")}`)}}});function Qk(r,e){let t=r.basis;return{...r,core:{...r.core,mimeType:e},basis:{...t,format:t?.format||"auto"}}}async function oE(r,e,t=0,n,s){return await aE(r,e,t,n,s)}async function aE(r,e,t,n,s,i){Zk(r,e,t,n);let o=sE(r,{normalize:n?.gltf?.normalize,log:n?.core?.log});return await mS(r,n,s),n?.gltf?.loadBuffers&&r.json.buffers&&await cC(r,n,s,n.gltf.loadBufferIndices),o(),n?.gltf?.loadFiles&&r.json.files&&await aC(r,n,s),n?.gltf?.loadExternalAssets&&r.json.externalAssets&&await tC(r,n,s,i),n?.gltf?.loadImages&&await uC(r,n,s),await bS(r,n,s),r}function Zk(r,e,t,n){if(n.core?.baseUrl&&(r.baseUri=n.core?.baseUrl),e instanceof ArrayBuffer&&!Yv(e,t,n.glb)&&(e=new TextDecoder().decode(e)),typeof e=="string")r.json=Nm(e);else if(e instanceof ArrayBuffer){let f={};t=$l(f,e,t,n.glb),X(f.type==="glTF",`Invalid GLB magic string ${f.type}`),r._glb=f,r.json=f.json}else e&&typeof e=="object"?r.json=e:X(!1,"GLTF: must be ArrayBuffer, string, or parsed JSON object");let s=r.json.buffers||[],i=Array.isArray(s)?s:[],o=Array.isArray(s)?[]:Object.keys(s);if(r.buffers=new Array(Array.isArray(s)?s.length:o.length).fill(null),r._glb){let{binChunks:f}=r._glb;for(let w=0;w<i.length;w++){let g=i[w];if(g.chunk===void 0)continue;X(r._glb.version===3,"glTF buffer.chunk requires a GLB v3 container."),X(g.uri===void 0,`glTF buffer ${w} cannot define both uri and chunk.`);let x=f.find(T=>T.chunkIndex===g.chunk);X(x,`glTF buffer ${w} references missing GLB BIN chunk ${g.chunk}.`),X(g.byteLength<=x.byteLength,`glTF buffer ${w} is larger than GLB BIN chunk ${g.chunk}.`),r.buffers[w]={arrayBuffer:x.arrayBuffer,byteOffset:x.byteOffset,byteLength:g.byteLength}}let l=i.map((w,g)=>w.uri===void 0?g:-1).filter(w=>w!==-1),d=f.find(w=>w.chunkIndex===1),h=r._glb.version<3||r._glb.jsonChunkIndex===0&&i[0]?.chunk===void 0&&l.length===1&&l[0]===0&&!!d,m=r._glb.version<3?f[0]:d,b=r._glb.version===1&&!Array.isArray(s)?o.indexOf("binary_glTF"):0;if(h&&m&&b>=0&&(r.buffers[b]={arrayBuffer:m.arrayBuffer,byteOffset:m.byteOffset,byteLength:m.byteLength}),r._glb.version===3)for(let w of l)X(r.buffers[w],`glTF buffer ${w} without a uri must define a valid GLB v3 chunk.`)}if(!r._glb){let f=i.findIndex(l=>l.chunk!==void 0);X(f===-1,`glTF buffer ${f} uses chunk outside a GLB.`)}let a=r.json.images||[];r.images=new Array(a.length).fill({});let c=r.json.files||[];r.files=new Array(c.length).fill(null);let u=r.json.externalAssets||[];r.externalAssets=new Array(u.length).fill(null)}async function tC(r,e,t,n){let s=r.json.externalAssets||[],i=new Set;for(let a of r.json.nodes||[])a.externalAsset!==void 0&&(X(a.externalAsset>=0&&a.externalAsset<s.length,`glTF node references missing external asset ${a.externalAsset}.`),i.add(a.externalAsset));let o=n||nC(t.url?new Set([ql(t.url)]):new Set);for(let a of i)await rC(r,a,e,t,o)}async function rC(r,e,t,n,s){let i=r.json.externalAssets?.[e];if(!i)throw new Error(`Missing glTF external asset ${e}.`);X(Number.isInteger(i.file)&&i.file>=0&&i.file<(r.json.files?.length||0),`glTF external asset ${e} references missing file ${i.file}.`);let o=await Hl(r,i.file,t,n),a=o.url;X(!a||!s.ancestors.has(a),`glTF external asset cycle detected at ${a}.`);let c=a?s.cache.get(a):void 0;if(!c){let u=sC(r,o,t,n,s),f={...s,ancestors:new Set(s.ancestors)};a&&f.ancestors.add(a);let l=Ji(o.arrayBuffer,o.byteOffset,o.byteLength);c=aE({},l,0,t,u,f),a&&s.cache.set(a,c)}r.externalAssets=r.externalAssets||[],r.externalAssets[e]=await c}function nC(r){return{cache:new Map,ancestors:r,packageIds:{next:0}}}function sC(r,e,t,n,s){if(e.url&&!e.url.startsWith("data:"))return{...n,url:e.url,filename:oC(e.url),baseUrl:iC(e.url)};let i=`${eC}${s.packageIds.next++}`,o=`${i}/`;return{...n,url:e.name,filename:e.name,baseUrl:i,fetch:async(a,c)=>{let u=a;if(u.startsWith("data:"))return await n.fetch(a,c);let f=u.startsWith(o)?u.slice(o.length):u,l=Hb(r,f);X(l>=0,`glTF package does not contain file ${f}.`);let d=await Hl(r,l,t,n),h=Ji(d.arrayBuffer,d.byteOffset,d.byteLength);return new Response(h,{headers:{"content-type":d.mimeType}})}}}function iC(r){let e=r.lastIndexOf("/");return e>=0?r.slice(0,e):""}function oC(r){let e=r.lastIndexOf("/");return e>=0?r.slice(e+1):r}async function aC(r,e,t){let n=r.json.files||[];await Promise.all(n.map((s,i)=>Hl(r,i,e,t)))}async function cC(r,e,t,n){let s=r.json.buffers||[],i=n?new Set(typeof n=="function"?n(r.json):n):void 0;for(let o=0;o<s.length;++o){if(i&&!i.has(o))continue;let a=s[o];if(a.uri){let{fetch:c}=t;X(c);let u=Gn(a.uri,e,t),l=await(await t?.fetch?.(u))?.arrayBuffer?.();r.buffers[o]={arrayBuffer:l,byteOffset:0,byteLength:l.byteLength},delete a.uri}else r.buffers[o]===null&&(r.buffers[o]={arrayBuffer:new ArrayBuffer(a.byteLength),byteOffset:0,byteLength:a.byteLength})}}async function uC(r,e,t){let n=fC(r),s=r.json.images||[],i=[];for(let o of n)i.push(lC(r,s[o],o,e,t));return await Promise.all(i)}function fC(r){let e=new Set;r.json.asset.thumbnail!==void 0&&e.add(r.json.asset.thumbnail);let t=r.json.textures||[];for(let n of t)n.source!==void 0&&e.add(n.source);return Array.from(e).sort()}async function lC(r,e,t,n,s){let i;if(e.uri&&!e.hasOwnProperty("bufferView")){let f=Gn(e.uri,n,s),{fetch:l}=s;i=await(await l(f)).arrayBuffer(),e.bufferView={data:i}}if(Number.isFinite(e.bufferView)){let f=fr(r.json,r.buffers,e.bufferView);i=Ji(f.buffer,f.byteOffset,f.byteLength)}X(i,"glTF image has no data");let o=Qk(n,e.mimeType),a=Zc(s);if(!!(a&&!n.gltf?.excludeExtensions?.includes("MSFT_texture_dds")&&r.json.textures?.some(f=>f.source===t&&f.extensions?.MSFT_texture_dds?.source===t))){let f=await Ws(i,a,n,s);X(f.length>0,"MSFT_texture_dds parser returned no texture levels"),r.images=r.images||[],r.images[t]={compressed:!0,mipmaps:!0,width:f[0].width,height:f[0].height,data:f};return}let u=await Ws(i,[Wc,eo],o,s);u&&u[0]&&(u={compressed:!0,mipmaps:!1,width:u[0].width,height:u[0].height,data:u[0]}),r.images=r.images||[],r.images[t]=u}var eC,cE=p(()=>{"use strict";ke();jn();jn();to();qb();qc();rI();ro();yS();kg();iE();eC="gltf-package://"});async function uE(r,e={},t){let n={...py.options,...e};n.gltf={...py.options.gltf,...n.gltf};let s=e?.glb?.byteOffset||0;return await oE({},r,s,n,t)}var ete,dC,py,fE=p(()=>{"use strict";cE();dE();({preload:ete,...dC}=lE),py={...dC,parse:uE}});var my={};J(my,{GLTFLoaderWithParser:()=>py,parse:()=>uE});var by=p(()=>{"use strict";fE()});async function hC(){let{GLTFLoaderWithParser:r}=await Promise.resolve().then(()=>(by(),my));return r}var lE,dE=p(()=>{"use strict";Bb();Fb();lE={dataType:null,batchType:null,...J1,version:Nl,preload:hC,options:{gltf:{normalize:!0,loadBuffers:!0,loadFiles:!1,loadExternalAssets:!1,loadImages:!0,loadAudio:!0,decompressMeshes:!0}}}});async function bC(r,e){return hE(r,e)}function hE(r,e){let t={};return $l(t,r,e?.glb?.byteOffset||0,e?.glb),t}var cte,pC,mC,pE=p(()=>{"use strict";qb();bE();({preload:cte,...pC}=mE),mC={...pC,parse:bC,parseSync:hE}});var gy={};J(gy,{GLBLoaderWithParser:()=>mC});var yy=p(()=>{"use strict";pE()});async function gC(){let{GLBLoaderWithParser:r}=await Promise.resolve().then(()=>(yy(),gy));return r}var mE,bE=p(()=>{"use strict";Bb();Fb();mE={dataType:null,batchType:null,...Y1,version:Nl,preload:gC,options:{glb:{strict:!1}}}});function yC(r){return typeof r=="string"?r.charAt(0).toLowerCase()+r.slice(1):r}function hd(r){if(Array.isArray(r))return r.map(e=>hd(e));if(r&&typeof r=="object"){let e={};for(let[t,n]of Object.entries(r))Object.defineProperty(e,yC(t),{value:hd(n),enumerable:!0,configurable:!0,writable:!0});return e}return r}var gE=p(()=>{"use strict"});var yE,wC,xC,TC,fu,wy,_C,AC,lu,xy,_a,wE=p(()=>{"use strict";yE={ontext:()=>{},onprocessinginstruction:()=>{},onsgmldeclaration:()=>{},ondoctype:()=>{},oncomment:()=>{},onopentagstart:()=>{},onattribute:()=>{},onopentag:()=>{},onclosetag:()=>{},onopencdata:()=>{},oncdata:()=>{},onclosecdata:()=>{},onerror:()=>{},onend:()=>{},onready:()=>{},onscript:()=>{},onopennamespace:()=>{},onclosenamespace:()=>{}},wC={...yE,strict:!1,MAX_BUFFER_LENGTH:64*1024,lowercase:!1,lowercasetags:!1,noscript:!1,strictEntities:!1,preserveCase:!1,caseInsensitiveTags:!1,processEntities:!0,xmlns:void 0,position:void 0,trim:void 0,normalize:void 0},xC=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],TC=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"],fu=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,wy=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,_C=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,AC=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,lu={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830};Object.keys(lu).forEach(r=>{let e=lu[r];lu[r]=typeof e=="number"?String.fromCharCode(e):e});xy=class r{EVENTS=xC;ENTITIES={...lu};XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"};S=0;opt;trackPosition=!1;column=0;line=0;c="";error;q="";bufferCheckPosition;closed=!1;tags=[];looseCase="";closedRoot=!1;sawRoot=!1;strict=!1;tag;strictEntities;state;noscript=!1;attribList=[];ns;position=0;STATE={BEGIN:this.S++,BEGIN_WHITESPACE:this.S++,TEXT:this.S++,TEXT_ENTITY:this.S++,OPEN_WAKA:this.S++,SGML_DECL:this.S++,SGML_DECL_QUOTED:this.S++,DOCTYPE:this.S++,DOCTYPE_QUOTED:this.S++,DOCTYPE_DTD:this.S++,DOCTYPE_DTD_QUOTED:this.S++,COMMENT_STARTING:this.S++,COMMENT:this.S++,COMMENT_ENDING:this.S++,COMMENT_ENDED:this.S++,CDATA:this.S++,CDATA_ENDING:this.S++,CDATA_ENDING_2:this.S++,PROC_INST:this.S++,PROC_INST_BODY:this.S++,PROC_INST_ENDING:this.S++,OPEN_TAG:this.S++,OPEN_TAG_SLASH:this.S++,ATTRIB:this.S++,ATTRIB_NAME:this.S++,ATTRIB_NAME_SAW_WHITE:this.S++,ATTRIB_VALUE:this.S++,ATTRIB_VALUE_QUOTED:this.S++,ATTRIB_VALUE_CLOSED:this.S++,ATTRIB_VALUE_UNQUOTED:this.S++,ATTRIB_VALUE_ENTITY_Q:this.S++,ATTRIB_VALUE_ENTITY_U:this.S++,CLOSE_TAG:this.S++,CLOSE_TAG_SAW_WHITE:this.S++,SCRIPT:this.S++,SCRIPT_ENDING:this.S++};BUFFERS=TC;CDATA="[CDATA[";DOCTYPE="DOCTYPE";XML_NAMESPACE="http://www.w3.org/XML/1998/namespace";XMLNS_NAMESPACE="http://www.w3.org/2000/xmlns/";rootNS={xml:this.XML_NAMESPACE,xmlns:this.XMLNS_NAMESPACE};comment;sgmlDecl;textNode="";tagName;doctype;procInstName;procInstBody;entity="";attribName;attribValue;cdata="";script="";startTagPosition=0;constructor(){this.S=0;for(let e in this.STATE)this.STATE.hasOwnProperty(e)&&(this.STATE[this.STATE[e]]=e);this.S=this.STATE}static charAt(e,t){let n="";return t<e.length&&(n=e.charAt(t)),n}static isWhitespace(e){return e===" "||e===`
|
|
42
|
+
`),n="",s="",i=0,o=[],a=typeof"".trimLeft=="function";for(let l=0,f=t.length;l<f;l++)if(n=t[l],n=a?n.trimLeft():n.trim(),i=n.length,i!==0&&(s=n.charAt(0),s!=="#"))if(s==="v"){let d=n.split(/\s+/);switch(d[0]){case"v":e.vertices.push(parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3])),d.length>=7&&e.colors.push(parseFloat(d[4]),parseFloat(d[5]),parseFloat(d[6]));break;case"vn":e.normals.push(parseFloat(d[1]),parseFloat(d[2]),parseFloat(d[3]));break;case"vt":e.uvs.push(parseFloat(d[1]),parseFloat(d[2]));break;default:}}else if(s==="f"){let h=n.substr(1).trim().split(/\s+/),m=[];for(let g=0,y=h.length;g<y;g++){let x=h[g];if(x.length>0){let T=x.split("/");m.push(T)}}let b=m[0];for(let g=1,y=m.length-1;g<y;g++){let x=m[g],T=m[g+1];e.addFace(b[0],x[0],T[0],b[1],x[1],T[1],b[2],x[2],T[2])}}else if(s==="l"){let d=n.substring(1).trim().split(" "),h,m=[];if(n.indexOf("/")===-1)h=d;else{h=[];for(let b=0,g=d.length;b<g;b++){let y=d[b].split("/");y[0]!==""&&h.push(y[0]),y[1]!==""&&m.push(y[1])}}e.addLineGeometry(h,m)}else if(s==="p"){let h=n.substr(1).trim().split(" ");e.addPointGeometry(h)}else if(Sv.test(n)){o=Sv.exec(n)||[];let d=(" "+o[0].substr(1).trim()).substr(1);e.startObject(d)}else if(iD.test(n))e.object.startMaterial(n.substring(7).trim(),e.materialLibraries);else if(sD.test(n))e.materialLibraries.push(n.substring(7).trim());else if(s==="s"){if(o=n.split(" "),o.length>1){let h=o[1].trim().toLowerCase();e.object.smooth=h!=="0"&&h!=="off"}else e.object.smooth=!0;let d=e.object.currentMaterial();d&&(d.smooth=e.object.smooth)}else{if(n==="\0")continue;throw new Error(`Unexpected line: "${n}"`)}e.finalize();let c=[],u=[];for(let l of e.objects){let{geometry:f}=l;if(f.vertices.length===0)continue;let d={header:{vertexCount:f.vertices.length/3},attributes:{}};switch(f.type){case"Points":d.mode=0;break;case"Line":d.mode=1;break;default:d.mode=4;break}d.attributes.POSITION={value:new Float32Array(f.vertices),size:3},f.normals.length>0&&(d.attributes.NORMAL={value:new Float32Array(f.normals),size:3}),f.colors.length>0&&(d.attributes.COLOR_0={value:new Float32Array(f.colors),size:3}),f.uvs.length>0&&(d.attributes.TEXCOORD_0={value:new Float32Array(f.uvs),size:2}),d.materials=[];for(let h of l.materials){let m={name:h.name,flatShading:!h.smooth};d.materials.push(m),u.push(m)}d.name=l.name,c.push(d)}return{meshes:c,materials:u}}var Sv,sD,iD,zb,Wb,$b,Lv=p(()=>{"use strict";Sv=/^[og]\s*(.+)?/,sD=/^mtllib /,iD=/^usemtl /,zb=class r{constructor({index:e,name:t="",mtllib:n,smooth:s,groupStart:i}){this.index=e,this.name=t,this.mtllib=n,this.smooth=s,this.groupStart=i,this.groupEnd=-1,this.groupCount=-1,this.inherited=!1}clone(e=this.index){return new r({index:e,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0})}},Wb=class{constructor(e=""){this.name=e,this.geometry={vertices:[],normals:[],colors:[],uvs:[]},this.materials=[],this.smooth=!0,this.fromDeclaration=null}startMaterial(e,t){let n=this._finalize(!1);n&&(n.inherited||n.groupCount<=0)&&this.materials.splice(n.index,1);let s=new zb({index:this.materials.length,name:e,mtllib:Array.isArray(t)&&t.length>0?t[t.length-1]:"",smooth:n!==void 0?n.smooth:this.smooth,groupStart:n!==void 0?n.groupEnd:0});return this.materials.push(s),s}currentMaterial(){if(this.materials.length>0)return this.materials[this.materials.length-1]}_finalize(e){let t=this.currentMaterial();if(t&&t.groupEnd===-1&&(t.groupEnd=this.geometry.vertices.length/3,t.groupCount=t.groupEnd-t.groupStart,t.inherited=!1),e&&this.materials.length>1)for(let n=this.materials.length-1;n>=0;n--)this.materials[n].groupCount<=0&&this.materials.splice(n,1);return e&&this.materials.length===0&&this.materials.push({name:"",smooth:this.smooth}),t}},$b=class{constructor(){this.objects=[],this.object=null,this.vertices=[],this.normals=[],this.colors=[],this.uvs=[],this.materialLibraries=[],this.startObject("",!1)}startObject(e,t=!0){if(this.object&&!this.object.fromDeclaration){this.object.name=e,this.object.fromDeclaration=t;return}let n=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object=new Wb(e),this.object.fromDeclaration=t,n&&n.name&&typeof n.clone=="function"){let s=n.clone(0);s.inherited=!0,this.object.materials.push(s)}this.objects.push(this.object)}finalize(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)}parseVertexIndex(e,t){let n=parseInt(e);return(n>=0?n-1:n+t/3)*3}parseNormalIndex(e,t){let n=parseInt(e);return(n>=0?n-1:n+t/3)*3}parseUVIndex(e,t){let n=parseInt(e);return(n>=0?n-1:n+t/2)*2}addVertex(e,t,n){let s=this.vertices,i=this.object.geometry.vertices;i.push(s[e+0],s[e+1],s[e+2]),i.push(s[t+0],s[t+1],s[t+2]),i.push(s[n+0],s[n+1],s[n+2])}addVertexPoint(e){let t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])}addVertexLine(e){let t=this.vertices;this.object.geometry.vertices.push(t[e+0],t[e+1],t[e+2])}addNormal(e,t,n){let s=this.normals,i=this.object.geometry.normals;i.push(s[e+0],s[e+1],s[e+2]),i.push(s[t+0],s[t+1],s[t+2]),i.push(s[n+0],s[n+1],s[n+2])}addColor(e,t,n){let s=this.colors,i=this.object.geometry.colors;i.push(s[e+0],s[e+1],s[e+2]),i.push(s[t+0],s[t+1],s[t+2]),i.push(s[n+0],s[n+1],s[n+2])}addUV(e,t,n){let s=this.uvs,i=this.object.geometry.uvs;i.push(s[e+0],s[e+1]),i.push(s[t+0],s[t+1]),i.push(s[n+0],s[n+1])}addUVLine(e){let t=this.uvs;this.object.geometry.uvs.push(t[e+0],t[e+1])}addFace(e,t,n,s,i,o,a,c,u){let l=this.vertices.length,f=this.parseVertexIndex(e,l),d=this.parseVertexIndex(t,l),h=this.parseVertexIndex(n,l);if(this.addVertex(f,d,h),s!==void 0&&s!==""){let m=this.uvs.length;f=this.parseUVIndex(s,m),d=this.parseUVIndex(i,m),h=this.parseUVIndex(o,m),this.addUV(f,d,h)}if(a!==void 0&&a!==""){let m=this.normals.length;f=this.parseNormalIndex(a,m),d=a===c?f:this.parseNormalIndex(c,m),h=a===u?f:this.parseNormalIndex(u,m),this.addNormal(f,d,h)}this.colors.length>0&&this.addColor(f,d,h)}addPointGeometry(e){this.object.geometry.type="Points";let t=this.vertices.length;for(let n of e)this.addVertexPoint(this.parseVertexIndex(n,t))}addLineGeometry(e,t){this.object.geometry.type="Line";let n=this.vertices.length,s=this.uvs.length;for(let i of e)this.addVertexLine(this.parseVertexIndex(i,n));for(let i of t)this.addUVLine(this.parseUVIndex(i,s))}}});function Kf(r,e){let{meshes:t}=Ev(r),n=t.reduce((a,c)=>a+c.header.vertexCount,0),s=oD(t,n),i={vertexCount:n,boundingBox:Er(s)??void 0},o=qf(s,{mode:4,boundingBox:i.boundingBox});return{loaderData:{header:{}},schema:o,header:i,mode:4,topology:"point-list",attributes:s}}function oD(r,e){let t=new Float32Array(e*3),n,s,i,o=0;for(let c of r){let{POSITION:u,NORMAL:l,COLOR_0:f,TEXCOORD_0:d}=c.attributes;t.set(u.value,o*3),l&&(n=n||new Float32Array(e*3),n.set(l.value,o*3)),f&&(s=s||new Float32Array(e*3),s.set(f.value,o*3)),d&&(i=i||new Float32Array(e*2),i.set(d.value,o*2)),o+=u.value.length/3}let a={};return a.POSITION={value:t,size:3},n&&(a.NORMAL={value:n,size:3}),s&&(a.COLOR_0={value:s,size:3}),i&&(a.TEXCOORD_0={value:i,size:2}),a}var Bv=p(()=>{"use strict";mn();Lv();Gb()});function Fv(r,e){let t=ei(r,"arrow-table");return e?.obj?.shape==="mesh"?pn(t):t}function uD(r){let e=r?.batchSize??r?.core?.batchSize;return typeof e=="number"?e:void 0}function lD(r){return r.split(/\r?\n/).some(e=>{let t=e.trimStart();return t.startsWith("f ")||t.startsWith("l ")})}function*fD(r,e,t){let n=r.split(/\r?\n/).filter(s=>s.trimStart().startsWith("v "));yield*hD(n,e,t)}async function*dD(r,e,t){let n=t||1e3,s=[];for await(let i of r)i.trimStart().startsWith("v ")&&(s.push(i),s.length>=n&&(yield Xf(qb(s),e),s=[]));s.length>0&&(yield Xf(qb(s),e))}function*hD(r,e,t){let n=t||r.length||1;for(let s=0;s<r.length;s+=n){let i=qb(r.slice(s,s+n));yield Xf(i,e)}}function qb(r){let e=new Float32Array(r.length*3);for(let s=0;s<r.length;s++){let i=r[s].trim().split(/\s+/);e[s*3+0]=Number(i[1]),e[s*3+1]=Number(i[2]),e[s*3+2]=Number(i[3])}let t={POSITION:{value:e,size:3}},n=Er(t);return{loaderData:{header:{}},schema:qf(t,{mode:0,boundingBox:n??void 0}),header:{vertexCount:r.length,boundingBox:n??void 0},mode:0,topology:"point-list",attributes:t}}function Xf(r,e){let t=ei(r,"arrow-table");if(e?.obj?.shape==="mesh"){let n=pn(t);return{shape:"mesh",batchType:"data",data:n,length:n.header?.vertexCount||0}}return hb(t)}function pD(r,e){let t=gm(r);return e?.obj?.shape==="mesh"?pn(t):t}function mD(r,e){let t=gm(r);return e?.obj?.shape!=="mesh"?t:{shape:"mesh",batchType:"data",data:pn(t),length:t.length}}var eY,aD,cD,Ov=p(()=>{"use strict";Ue();ea();mn();Gb();Bv();Dv();({preload:eY,...aD}=Mv);cD={...aD,parse:async(r,e)=>Fv(Kf(new TextDecoder().decode(r),e),e),parseTextSync:(r,e)=>Fv(Kf(r,e),e),parseInBatches:async function*(r,e){let t=uD(e);if(e?.obj?.pointCloud){let i=ub(r),o=lb(i);yield*dD(o,e,t);return}let n=await fb(r),s=new TextDecoder().decode(n);if(lD(s)){yield Xf(Kf(s,e),e);return}yield*fD(s,e,t)},serializeWorkerResult:Hi,deserializeWorkerResult:pD,serializeWorkerBatch:Hi,deserializeWorkerBatch:mD}});var Kb={};J(Kb,{OBJLoaderWithParser:()=>cD});var Xb=p(()=>{"use strict";Ov()});async function gD(){let{OBJLoaderWithParser:r}=await Promise.resolve().then(()=>(Xb(),Kb));return r}function yD(r){return r[0]==="v"}var bD,Mv,Dv=p(()=>{"use strict";lx();ea();bD="5.0.0-beta.6";Mv={...ux,dataType:null,batchType:null,version:bD,worker:!0,workerInBatches:!0,serializeWorkerResult:Hi,text:!0,testText:yD,options:{obj:{shape:"arrow-table"}},preload:gD}});var Rv,kv=p(()=>{"use strict";Rv={name:"MTL",id:"mtl",module:"mtl",encoding:"text",format:"mtl",extensions:["mtl"],mimeTypes:["text/plain"]}});function Hb(r,e){let t=[],n={name:"placeholder"},s=r.split(`
|
|
43
|
+
`);for(let i of s){if(i=i.trim(),i.length===0||i.charAt(0)==="#")continue;let o=i.indexOf(" "),a=o>=0?i.substring(0,o):i;a=a.toLowerCase();let c=o>=0?i.substring(o+1):"";switch(c=c.trim(),a){case"newmtl":n={name:c},t.push(n);break;case"ka":n.ambientColor=Hf(c);break;case"kd":n.diffuseColor=Hf(c);break;case"map_kd":n.diffuseTextureUrl=c;break;case"ks":n.specularColor=Hf(c);break;case"map_ks":n.specularTextureUrl=c;break;case"ke":n.emissiveColor=Hf(c);break;case"map_ke":n.emissiveTextureUrl=c;break;case"ns":n.shininess=parseFloat(c);break;case"map_ns":break;case"ni":n.refraction=parseFloat(c);break;case"illum":n.illumination=parseFloat(c);break;default:break}}return t}function Hf(r,e){let t=r.split(wD,3);return[parseFloat(t[0]),parseFloat(t[1]),parseFloat(t[2])]}var wD,Nv=p(()=>{"use strict";wD=/\s+/});var fY,xD,dY,TD,_D,AD,Cv=p(()=>{"use strict";Nv();Jb();Jb();({preload:fY,...xD}=Jf),{preload:dY,...TD}=Jf,_D={...xD},AD={...TD,parse:async(r,e)=>Hb(new TextDecoder().decode(r),e?.mtl),parseTextSync:(r,e)=>Hb(r,e?.mtl)}});var Yb={};J(Yb,{MTLLoaderWithParser:()=>AD,MTLWorkerLoaderWithParser:()=>_D});var Qb=p(()=>{"use strict";Cv()});async function ID(){let{MTLLoaderWithParser:r}=await Promise.resolve().then(()=>(Qb(),Yb));return r}var vD,Jf,Jb=p(()=>{"use strict";kv();vD="5.0.0-beta.6";Jf={...Rv,dataType:null,batchType:null,version:vD,worker:!0,text:!0,testText:r=>r.includes("newmtl"),options:{mtl:{}},preload:ID}});var Yf,Zb=p(()=>{"use strict";Yf="5.0.0-beta.6"});var Uv,Pv,eg=p(()=>{"use strict";Uv={name:"glTF",id:"gltf",module:"scene",encoding:"binary",format:"gltf",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"]},Pv={name:"GLB",id:"glb",module:"scene",encoding:"binary",format:"glb",extensions:["glb"],mimeTypes:["model/gltf-binary"],binary:!0,tests:["glTF"]}});function Vv(r){return!BD(r,"ftyp",4)||(r[8]&96)===0?null:SD(r)}function SD(r){switch(ED(r,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function ED(r,e,t){return String.fromCharCode(...r.slice(e,t))}function LD(r){return[...r].map(e=>e.charCodeAt(0))}function BD(r,e,t=0){let n=LD(e);for(let s=0;s<n.length;++s)if(n[s]!==r[s+t])return!1;return!0}var jv=p(()=>{"use strict"});function $n(r){let e=Xc(r);return OD(e)||RD(e)||MD(e)||DD(e)||FD(e)}function FD(r){let e=new Uint8Array(r instanceof DataView?r.buffer:r),t=Vv(e);return t?{mimeType:t.mimeType,width:0,height:0}:null}function OD(r){let e=Xc(r);return e.byteLength>=33&&e.getUint32(0,dr)===2303741511&&e.getUint32(4,dr)===218765834&&e.getUint32(8,dr)===13&&e.getUint32(12,dr)===1229472850?{mimeType:"image/png",width:e.getUint32(16,dr),height:e.getUint32(20,dr)}:null}function MD(r){let e=Xc(r);return e.byteLength>=10&&e.getUint32(0,dr)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,Kc),height:e.getUint16(8,Kc)}:null}function DD(r){let e=Xc(r);return e.byteLength>=14&&e.getUint16(0,dr)===16973&&e.getUint32(2,Kc)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,Kc),height:e.getUint32(22,Kc)}:null}function RD(r){let e=Xc(r);if(!(e.byteLength>=3&&e.getUint16(0,dr)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:s}=kD(),i=2;for(;i+9<e.byteLength;){let o=e.getUint16(i,dr);if(s.has(o))return{mimeType:"image/jpeg",height:e.getUint16(i+5,dr),width:e.getUint16(i+7,dr)};if(!n.has(o))return null;i+=2,i+=e.getUint16(i,dr)}return null}function kD(){let r=new Set([65499,65476,65484,65501,65534]);for(let t=65504;t<65520;++t)r.add(t);return{tableMarkers:r,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function Xc(r){if(r instanceof DataView)return r;if(ArrayBuffer.isView(r))return new DataView(r.buffer);if(r instanceof ArrayBuffer)return new DataView(r);throw new Error("toDataView")}var dr,Kc,Qf=p(()=>{"use strict";jv();dr=!1,Kc=!0});var ND,CD,UD,Gv,zv=p(()=>{"use strict";Qf();ND=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],CD=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],UD={id:"image",module:"images",name:"Images",encoding:"image",format:"image",mimeTypes:CD,extensions:ND,tests:[r=>!!$n(new DataView(r))]},Gv={...UD,id:"imagebitmap",name:"ImageBitmap",format:"image-bitmap"}});var Zf,tg=p(()=>{"use strict";Zf="5.0.0-beta.6"});function da(r){if(!r)return!1;if(PD.test(r))return!0;for(let e=r.indexOf(".svg");e>=0;e=r.indexOf(".svg",e+4)){let t=r[e+4];if(t===void 0||t==="?"||t==="#")return!0}return!1}function Wv(r,e){if(da(e)){let n=new TextDecoder().decode(r);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(i){throw new Error(i.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return rg(r,e)}function rg(r,e){if(da(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(r)])}var PD,ed=p(()=>{"use strict";PD=/^data:image\/svg\+xml/});async function $v(r,e,t){let n=Wv(r,t),s=self.URL||self.webkitURL,i=typeof n!="string"&&s.createObjectURL(n);try{return await VD(i||n,e)}finally{i&&s.revokeObjectURL(i)}}async function VD(r,e){let t=new Image;return t.src=r,e?.image?.decode&&t.decode?(await t.decode(),t):await new Promise((n,s)=>{try{t.onload=()=>n(t),t.onerror=i=>{let o=i instanceof Error?i.message:"error";s(new Error(o))}}catch(i){s(i)}})}var qv=p(()=>{"use strict";ed()});async function Xv(r,e,t){let n;da(t)?n=await $v(r,e,t):n=rg(r,t);let s=e&&e.imagebitmap;return await Jv(n,s)}async function Hv(r,e){let t=e&&e.imagebitmap;return await Jv(r,t)}async function Jv(r,e=null){if((jD(e)||!Kv)&&(e=null),e)try{return await createImageBitmap(r,e)}catch(t){console.warn(t),Kv=!1}return await createImageBitmap(r)}function jD(r){if(!r)return!0;for(let e in r)if(Object.prototype.hasOwnProperty.call(r,e))return!1;return!0}var Kv,Yv=p(()=>{"use strict";ed();qv();Kv=!0});async function Qv(r,e){let{mimeType:t}=$n(r)||{},n=globalThis.loaders?.parseImageNode;fr(n);let s=globalThis.loaders?.createImageBitmapNode;if(!s)throw new Error("Install '@loaders.gl/core/polyfills' to parse images under Node.js");let i=await n(r,t);return s(i)}var Zv=p(()=>{"use strict";Ue();Qf()});async function ng(r,e,t){e=e||{},rI(e);let n=!!globalThis.loaders?.parseImageNode;if(!Gn||n)return await Qv(r,e);if(typeof ImageBitmap>"u"||typeof createImageBitmap!="function")throw new Error(eI);return await Xv(r,e,t?.url)}async function tI(r,e,t){e=e||{},rI(e);let n=!!globalThis.loaders?.parseImageNode;if(!Gn||n||da(t?.url)||r.type.startsWith("image/svg+xml"))return await ng(await r.arrayBuffer(),e,t);if(typeof ImageBitmap>"u"||typeof createImageBitmap!="function")throw new Error(eI);return await Hv(r,e)}function rI(r){let e=r.image?.type;if(e&&e!=="imagebitmap")throw new Error(GD)}var GD,eI,nI=p(()=>{"use strict";Ue();Yv();ed();Zv();GD="@loaders.gl/images: ImageLoader only accepts options.image.type='imagebitmap'. Remove legacy image/data/auto values and call getImageData(image) if you need raw pixels.",eI="@loaders.gl/images: ImageLoader requires browser ImageBitmap support. Use a browser with createImageBitmap support or load images under Node.js with @loaders.gl/core/polyfills."});var sI={};J(sI,{ImageLoaderWithParser:()=>WD});var jY,zD,WD,iI=p(()=>{"use strict";nI();sg();({preload:jY,...zD}=Hc),WD={...zD,parse:ng,parseBlob:tI}});async function qD(){let{ImageLoaderWithParser:r}=await Promise.resolve().then(()=>(iI(),sI));return r}var $D,Hc,sg=p(()=>{"use strict";tg();zv();$D={image:{}};Hc={dataType:null,batchType:null,...Gv,version:Zf,options:$D,preload:qD}});function aI(r){let e=JD(r);if(!e)throw new Error("Not an image");return e}function Jc(r){switch(aI(r)){case"data":return r;case"imagebitmap":return KD(r)?XD(r):oI(r);case"image":return oI(r);default:throw new Error("getImageData")}}function KD(r){let e=globalThis.loaders?.isImageBitmapNode;return!!e?.(r)}function XD(r){let e=globalThis.loaders?.getImageBitmapDataNode;if(!e)throw new Error("getImageData");return e(r)}function oI(r){let e=HD(r.width,r.height),t=e.getContext("2d");if(!t)throw new Error("getImageData");return e.width=r.width,e.height=r.height,t.drawImage(r,0,0),t.getImageData(0,0,r.width,r.height)}function HD(r,e){if(typeof OffscreenCanvas<"u")return new OffscreenCanvas(r,e);if(typeof document<"u"){let t=document.createElement("canvas");return t.width=r,t.height=e,t}throw new Error("getImageData")}function JD(r){return typeof ImageBitmap<"u"&&r instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&r instanceof Image?"image":r&&typeof r=="object"&&r.data&&r.width&&r.height?"data":null}var cI=p(()=>{"use strict"});async function og(){return td?await td:(td=QD(),await td)}async function QD(){let r=new Set;for(let e of YD)(Gn?await tR(e):uI(e))&&r.add(e);return r}function ag(r){if(ig[r]===void 0){let e=Gn?ZD(r):uI(r);ig[r]=e}return ig[r]}function uI(r){let e=["image/png","image/jpeg","image/gif"],t=globalThis.loaders?.imageFormatsNode||e;return!!globalThis.loaders?.parseImageNode&&t.includes(r)}function ZD(r){switch(r){case"image/avif":case"image/webp":return rR(r);default:return!0}}async function tR(r){let e=eR[r];return e?await nR(e):!0}function rR(r){try{return document.createElement("canvas").toDataURL(r).indexOf(`data:${r}`)===0}catch{return!1}}async function nR(r){return new Promise(e=>{let t=new Image;t.src=r,t.onload=()=>e(t.height>0),t.onerror=()=>e(!1)})}var YD,td,ig,eR,cg=p(()=>{"use strict";Ue();YD=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/tiff","image/svg","image/svg+xml","image/bmp","image/vnd.microsoft.icon"],td=null;ig={};eR={"image/avif":"data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAAB0AAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQ0MAAAAABNjb2xybmNseAACAAIAAYAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAACVtZGF0EgAKCBgANogQEAwgMg8f8D///8WfhwB8+ErK42A=","image/webp":"data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"}});var lI,fI=p(()=>{"use strict";lI={name:"Basis",id:"basis",module:"images",encoding:"image",format:"basis",extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],binary:!0,tests:["sB"]}});function hI(r){if(!rd){r=r||iR()||void 0,rd=new Set;for(let e of sR)for(let t in dI)if(r&&r.getExtension(`${e}${t}`))for(let n of dI[t])rd.add(n)}return rd}function iR(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var sR,dI,rd,pI=p(()=>{"use strict";sR=["","WEBKIT_","MOZ_"],dI={WEBGL_compressed_texture_s3tc:["bc1-rgb-unorm-webgl","bc1-rgba-unorm","bc2-rgba-unorm","bc3-rgba-unorm"],WEBGL_compressed_texture_s3tc_srgb:["bc1-rgb-unorm-srgb-webgl","bc1-rgba-unorm-srgb","bc2-rgba-unorm-srgb","bc3-rgba-unorm-srgb"],EXT_texture_compression_rgtc:["bc4-r-unorm","bc4-r-snorm","bc5-rg-unorm","bc5-rg-snorm"],EXT_texture_compression_bptc:["bc6h-rgb-ufloat","bc6h-rgb-float","bc7-rgba-unorm","bc7-rgba-unorm-srgb"],WEBGL_compressed_texture_etc1:["etc1-rgb-unorm-webgl"],WEBGL_compressed_texture_etc:["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgb8a1unorm","etc2-rgb8a1unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb","eac-r11unorm","eac-r11snorm","eac-rg11unorm","eac-rg11snorm"],WEBGL_compressed_texture_pvrtc:["pvrtc-rgb4unorm-webgl","pvrtc-rgba4unorm-webgl","pvrtc-rgb2unorm-webgl","pvrtc-rgba2unorm-webgl"],WEBGL_compressed_texture_atc:["atc-rgb-unorm-webgl","atc-rgba-unorm-webgl","atc-rgbai-unorm-webgl"],WEBGL_compressed_texture_astc:["astc-4x4-unorm","astc-4x4-unorm-srgb","astc-5x4-unorm","astc-5x4-unorm-srgb","astc-5x5-unorm","astc-5x5-unorm-srgb","astc-6x5-unorm","astc-6x5-unorm-srgb","astc-6x6-unorm","astc-6x6-unorm-srgb","astc-8x5-unorm","astc-8x5-unorm-srgb","astc-8x6-unorm","astc-8x6-unorm-srgb","astc-8x8-unorm","astc-8x8-unorm-srgb","astc-10x5-unorm","astc-10x5-unorm-srgb","astc-10x6-unorm","astc-10x6-unorm-srgb","astc-10x8-unorm","astc-10x8-unorm-srgb","astc-10x10-unorm","astc-10x10-unorm-srgb","astc-12x10-unorm","astc-12x10-unorm-srgb","astc-12x12-unorm","astc-12x12-unorm-srgb"]},rd=null});function bI(r=hI(),e,t={}){let n=new Set(r);if(!e)return aR(n);if(e.isHDR){let s=mI(e);return t.astcHDR&&(s==="astc-4x4"||s==="astc-6x6")&&nd(n,s.slice(5))?s==="astc-4x4"?"astc-hdr-4x4":"astc-hdr-6x6":n.has("bc6h-rgb-ufloat")?"bc6h":"rgba16f"}if(e.codec==="xubc7")return lg(n)?"bc7":"rgba32";if(e.codec.startsWith("xuastc-ldr-")||e.codec.startsWith("astc-ldr-")){let s=mI(e);return s&&nd(n,s.slice(5))?s:ug(n,e,["bc7","bc","etc2","atc"])}return e.codec==="uastc-ldr-4x4"?nd(n,"4x4")?"astc-4x4":ug(n,e,["bc7","bc","etc2","etc1","pvrtc","atc"]):ug(n,e,["etc2","etc1","bc7","bc","pvrtc","atc"])}function aR(r){return nd(r,"4x4")?"astc-4x4":lg(r)?"bc7":gI(r)?{alpha:"bc3",noAlpha:"bc1"}:yI(r)?"etc2":r.has("etc1-rgb-unorm-webgl")?{alpha:"rgba32",noAlpha:"etc1"}:wI(r)?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:xI(r)?{alpha:"atc-rgba-interpolated-alpha",noAlpha:"atc-rgb"}:{alpha:"rgba32",noAlpha:"rgb565"}}function ug(r,e,t){for(let n of t)switch(n){case"bc7":if(lg(r))return"bc7";break;case"bc":if(gI(r))return e.hasAlpha?"bc3":"bc1";break;case"etc2":if(yI(r))return"etc2";break;case"etc1":if(!e.hasAlpha&&r.has("etc1-rgb-unorm-webgl"))return"etc1";break;case"pvrtc":if(wI(r))return e.hasAlpha?"pvrtc1-4-rgba":"pvrtc1-4-rgb";break;case"atc":if(xI(r))return e.hasAlpha?"atc-rgba-interpolated-alpha":"atc-rgb";break;default:break}return e.hasAlpha?"rgba32":"rgb565"}function mI(r){let e=`${r.blockWidth}x${r.blockHeight}`;return oR.includes(e)?`astc-${e}`:null}function nd(r,e){return ha(r,[`astc-${e}-unorm`,`astc-${e}-unorm-srgb`])}function lg(r){return ha(r,["bc7-rgba-unorm","bc7-rgba-unorm-srgb"])}function gI(r){return ha(r,["bc1-rgb-unorm-webgl","bc1-rgb-unorm-srgb-webgl","bc1-rgba-unorm","bc1-rgba-unorm-srgb","bc3-rgba-unorm","bc3-rgba-unorm-srgb"])}function yI(r){return ha(r,["etc2-rgb8unorm","etc2-rgb8unorm-srgb","etc2-rgba8unorm","etc2-rgba8unorm-srgb"])}function wI(r){return ha(r,["pvrtc-rgb4unorm-webgl","pvrtc-rgba4unorm-webgl","pvrtc-rgb2unorm-webgl","pvrtc-rgba2unorm-webgl"])}function xI(r){return ha(r,["atc-rgb-unorm-webgl","atc-rgba-unorm-webgl","atc-rgbai-unorm-webgl"])}function ha(r,e){return e.some(t=>r.has(t))}var oR,TI=p(()=>{"use strict";pI();oR=["4x4","5x4","5x5","6x5","6x6","8x5","8x6","8x8","10x5","10x6","10x8","10x10","12x10","12x12"]});async function vI(r){xm(r.modules);let e=Tm("basis");return e||(AI||=cR(r),await AI)}async function cR(r){let e=null,t=null;return[e,t]=await Promise.all([await ia(_I.TRANSCODER,"images",r,null,"basis_transcoder.mjs"),await ia(_I.TRANSCODER_WASM,"images",r)]),e=e||globalThis.BASIS,await uR(e,t)}function uR(r,e){let t={};return e&&(t.wasmBinary=e),Ji(()=>r(t),n=>{let{BasisFile:s,KTX2File:i,getBasisTexFormatBlockHeight:o,getBasisTexFormatBlockWidth:a,initializeBasis:c,isFormatSupported:u}=n;return c(),{BasisFile:s,KTX2File:i,getBasisTexFormatBlockHeight:o,getBasisTexFormatBlockWidth:a,isFormatSupported:u}})}var _I,AI,II=p(()=>{"use strict";Ue();Js();_I={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"}});function SI(r){if(r.byteLength<fg.byteLength)return!1;let e=new Uint8Array(r,0,fg.byteLength);return fg.every((t,n)=>e[n]===t)}var fg,EI=p(()=>{"use strict";fg=new Uint8Array([171,75,84,88,32,50,48,187,13,10,26,10])});async function hR(r){let e=LI,t;LI=new Promise(n=>{t=n}),await e;try{return await r()}finally{t()}}async function FI(r,e={}){return await hR(async()=>{let t=await vI(hn(e)),n=e.basis?.containerFormat||"auto";if(n==="ktx2"||n==="auto"&&SI(r)){if(!t.KTX2File)throw new Error("The injected Basis transcoder module does not provide KTX2File");return mR(t,r,e)}return pR(t,r,e)})}function pR(r,e,t){let n=new r.BasisFile(new Uint8Array(e));try{let s=MI(n,!1);if(!n.startTranscoding())throw new Error("Failed to start Basis transcoding");let i=[];for(let o=0;o<n.getNumImages();o++){let a=[];for(let c=0;c<n.getNumLevels(o);c++){let u=n.getImageWidth(o,c),l=n.getImageHeight(o,c);a.push(OI(n,s,u,l,t,f=>n.getImageTranscodedSizeInBytes(o,c,f),(f,d)=>n.transcodeImage(f,o,c,d,0,0)))}i.push(a)}return i}finally{n.close(),n.delete()}}function mR(r,e,t){let n=new r.KTX2File(new Uint8Array(e));try{if(!n.isValid())throw new Error("Invalid KTX2 texture");if(n.getHeader().pixelDepth>0)throw new Error("BasisLoader does not support 3D KTX2 textures");let i=MI(n,!0);if(!n.startTranscoding())throw new Error("Failed to start KTX2 transcoding");let o=Math.max(1,n.getLayers()),a=Math.max(1,n.getFaces()),c=[];for(let u=0;u<o;u++)for(let l=0;l<a;l++){let f=[];for(let d=0;d<n.getLevels();d++){let h=n.getImageLevelInfo(d,u,l);f.push(OI(n,{...i,hasAlpha:!!h.alphaFlag},h.width,h.height,t,m=>n.getImageTranscodedSizeInBytes(d,u,l,m),(m,b)=>n.transcodeImage(m,d,u,l,b,0,-1,-1)))}c.push(f)}return c}finally{n.close(),n.delete()}}function OI(r,e,t,n,s,i,o){let a=gR(s,e);bR(e,dg(s,e));let c=i(a.basisFormat),u=wR(c,a.dataType);if(!o(u,a.basisFormat))throw new Error(`Failed to transcode Basis texture to ${dg(s,e)}`);let l=e.isSRGB&&a.srgbTextureFormat;return{shape:"texture-level",width:t,height:n,data:u,compressed:a.compressed,format:l&&a.srgbFormat||a.format,textureFormat:l?a.srgbTextureFormat:a.textureFormat,levelSize:c,hasAlpha:e.hasAlpha}}function bR(r,e){let t=e==="bc6h"||e==="rgba16f"||e==="rgb9e5"||e.startsWith("astc-hdr-");if(r.isHDR!==t)throw new Error(`Basis source codec ${r.codec} cannot be transcoded to ${e}`);if(r.codec==="xubc7"&&e!=="bc7"&&e!=="rgba32")throw new Error(`Basis source codec ${r.codec} cannot be transcoded to ${e}`)}function gR(r,e){let t=dg(r,e),n=BI[t];if(!n)throw new Error(`Unknown Basis format ${t}`);return n}function dg(r,e){let t=r.basis?.format||"auto";return t==="auto"&&(t=bI(r.basis?.supportedTextureFormats,e,r.basis?.supportedTextureFeatures)),typeof t=="object"&&(t=e.hasAlpha?t.alpha:t.noAlpha),t.toLowerCase()}function MI(r,e){let t=r.getBasisTexFormat(),n=yR[t];if(!n)throw new Error(`Unsupported Basis source texture format ${t}`);return{codec:n,isHDR:!!r.isHDR(),isSRGB:e?!!r.isSRGB():!1,hasAlpha:!!r.getHasAlpha(),blockWidth:r.getBlockWidth(),blockHeight:r.getBlockHeight()}}function wR(r,e){return e==="uint16"?new Uint16Array(r/Uint16Array.BYTES_PER_ELEMENT):e==="uint32"?new Uint32Array(r/Uint32Array.BYTES_PER_ELEMENT):new Uint8Array(r)}function it(r,e,t){return{basisFormat:r,compressed:!0,format:e,textureFormat:t}}function pa(r,e,t,n,s){return{basisFormat:r,compressed:!1,format:e,textureFormat:t,srgbFormat:n,srgbTextureFormat:s}}function $t(r,e,t,n){return{...it(r,e,`astc-${n}-unorm`),srgbFormat:t,srgbTextureFormat:`astc-${n}-unorm-srgb`}}var Wt,BI,tZ,LI,yR,DI=p(()=>{"use strict";Js();TI();II();EI();Wt={"4x4":$t(10,37808,37840,"4x4"),"5x4":$t(28,37809,37841,"5x4"),"5x5":$t(29,37810,37842,"5x5"),"6x5":$t(30,37811,37843,"6x5"),"6x6":$t(31,37812,37844,"6x6"),"8x5":$t(32,37813,37845,"8x5"),"8x6":$t(33,37814,37846,"8x6"),"8x8":$t(36,37815,37847,"8x8"),"10x5":$t(34,37816,37848,"10x5"),"10x6":$t(35,37817,37849,"10x6"),"10x8":$t(37,37818,37850,"10x8"),"10x10":$t(38,37819,37851,"10x10"),"12x10":$t(39,37820,37852,"12x10"),"12x12":$t(40,37821,37853,"12x12")},BI={etc1:it(0,36196,"etc1-rgb-unorm-webgl"),etc2:{...it(1,37493,"etc2-rgba8unorm"),srgbFormat:37495,srgbTextureFormat:"etc2-rgba8unorm-srgb"},bc1:{...it(2,33776,"bc1-rgb-unorm-webgl"),srgbFormat:35916,srgbTextureFormat:"bc1-rgb-unorm-srgb-webgl"},bc3:{...it(3,33779,"bc3-rgba-unorm"),srgbFormat:35919,srgbTextureFormat:"bc3-rgba-unorm-srgb"},bc4:it(4,36283,"bc4-r-unorm"),bc5:it(5,36285,"bc5-rg-unorm"),bc7:{...it(6,36492,"bc7-rgba-unorm"),srgbFormat:36493,srgbTextureFormat:"bc7-rgba-unorm-srgb"},"pvrtc1-4-rgb":it(8,35840,"pvrtc-rgb4unorm-webgl"),"pvrtc1-4-rgba":it(9,35842,"pvrtc-rgba4unorm-webgl"),"astc-4x4":Wt["4x4"],"astc-5x4":Wt["5x4"],"astc-5x5":Wt["5x5"],"astc-6x5":Wt["6x5"],"astc-6x6":Wt["6x6"],"astc-8x5":Wt["8x5"],"astc-8x6":Wt["8x6"],"astc-8x8":Wt["8x8"],"astc-10x5":Wt["10x5"],"astc-10x6":Wt["10x6"],"astc-10x8":Wt["10x8"],"astc-10x10":Wt["10x10"],"astc-12x10":Wt["12x10"],"astc-12x12":Wt["12x12"],"atc-rgb":it(11,35986,"atc-rgb-unorm-webgl"),"atc-rgba-interpolated-alpha":it(12,34798,"atc-rgbai-unorm-webgl"),rgba32:pa(13,32856,"rgba8unorm",35907,"rgba8unorm-srgb"),rgb565:pa(14,36194,"rgb565unorm-webgl"),bgr565:pa(15,36194,"rgb565unorm-webgl"),rgba4444:pa(16,32854,"rgba4unorm-webgl"),"eac-r11":it(20,37488,"eac-r11unorm"),"eac-rg11":it(21,37490,"eac-rg11unorm"),bc6h:it(22,36495,"bc6h-rgb-ufloat"),"astc-hdr-4x4":it(23,37808,"astc-4x4-unorm"),rgba16f:{...pa(25,34842,"rgba16float"),dataType:"uint16"},rgb9e5:{...pa(26,35901,"rgb9e5ufloat"),dataType:"uint32"},"astc-hdr-6x6":it(27,37812,"astc-6x6-unorm")},tZ=Object.freeze(Object.keys(BI)),LI=Promise.resolve();yR={0:"etc1s",1:"uastc-ldr-4x4",2:"uastc-hdr-4x4",3:"astc-hdr-6x6",4:"uastc-hdr-6x6",5:"xuastc-ldr-4x4",6:"xuastc-ldr-5x4",7:"xuastc-ldr-5x5",8:"xuastc-ldr-6x5",9:"xuastc-ldr-6x6",10:"xuastc-ldr-8x5",11:"xuastc-ldr-8x6",12:"xuastc-ldr-10x5",13:"xuastc-ldr-10x6",14:"xuastc-ldr-8x8",15:"xuastc-ldr-10x8",16:"xuastc-ldr-10x10",17:"xuastc-ldr-12x10",18:"xuastc-ldr-12x12",19:"astc-ldr-4x4",20:"astc-ldr-5x4",21:"astc-ldr-5x5",22:"astc-ldr-6x5",23:"astc-ldr-6x6",24:"astc-ldr-8x5",25:"astc-ldr-8x6",26:"astc-ldr-10x5",27:"astc-ldr-10x6",28:"astc-ldr-8x8",29:"astc-ldr-10x8",30:"astc-ldr-10x10",31:"astc-ldr-12x10",32:"astc-ldr-12x12",33:"xubc7"}});var RI={};J(RI,{BasisLoaderWithParser:()=>AR,BasisWorkerLoaderWithParser:()=>_R});var oZ,xR,aZ,TR,_R,AR,kI=p(()=>{"use strict";DI();sd();sd();({preload:oZ,...xR}=io),{preload:aZ,...TR}=io,_R={...xR},AR={...TR,parse:FI}});async function vR(){let{BasisLoaderWithParser:r}=await Promise.resolve().then(()=>(kI(),RI));return r}var io,sd=p(()=>{"use strict";fI();tg();io={...lI,dataType:null,batchType:null,name:"Basis",id:"basis",module:"images",version:Zf,worker:!0,workerNode:"basis-worker-node.cjs",extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",containerFormat:"auto"}},preload:vR}});var qn=p(()=>{"use strict";sg();Qf();cI();cg();cg();sd()});function H(r,e){if(!r)throw new Error(e||"assert failed: gltf")}var oo=p(()=>{"use strict"});function FR(r,e=0){return`${String.fromCharCode(r.getUint8(e+0))}${String.fromCharCode(r.getUint8(e+1))}${String.fromCharCode(r.getUint8(e+2))}${String.fromCharCode(r.getUint8(e+3))}`}function PI(r,e=0,t={}){let n=new DataView(r),{magic:s=NI}=t,i=n.getUint32(e,!1);return i===s||i===NI}function ad(r,e,t=0,n={}){let s=new DataView(e),i=FR(s,t+0),o=s.getUint32(t+4,ti),a=o===3?jI(s,t+8,"GLB byte length"):s.getUint32(t+8,ti);switch(Object.assign(r,{header:{byteOffset:t,byteLength:a,hasBinChunk:!1},type:i,version:o,json:{},jsonChunkIndex:-1,binChunks:[]}),r.version){case 1:return OR(r,s,t+id);case 2:return MR(r,s,t+id,n);case 3:return DR(r,s,t+UI,n);default:throw new Error(`Invalid GLB version ${r.version}. Only supports versions 1, 2 and 3.`)}}function OR(r,e,t){fr(r.header.byteLength>id+od);let n=r.header.byteOffset+r.header.byteLength;fr(n<=e.byteLength);let s=e.getUint32(t+0,ti),i=e.getUint32(t+4,ti);if(t+=od,fr(i===ER),t+s>n)throw new Error("GLB JSON content extends beyond the declared file length.");hg(r,e,t,s,0),t+=s;let o=n-t;return o>0&&pg(r,e,t,o,1),n}function MR(r,e,t,n){return fr(r.header.byteLength>id+od),VI(r,e,t,od,n),r.header.byteOffset+r.header.byteLength}function DR(r,e,t,n){return fr(r.header.byteLength>=UI+CI),VI(r,e,t,CI,n),r.header.byteOffset+r.header.byteLength}function VI(r,e,t,n,s){let i=r.header.byteOffset+r.header.byteLength;fr(i<=e.byteLength);let o=0;for(;t+n<=i;){let a=r.version===3,c=e.getUint32(t+(a?0:4),ti),u=a?e.getUint32(t+4,ti):0,l=a?jI(e,t+8,"GLB chunk length"):e.getUint32(t+0,ti);if(t+=n,u!==0)throw new Error(`Unsupported GLB chunk encoding ${u}.`);if(t+l>i)throw new Error("GLB chunk extends beyond the declared file length.");switch(c){case IR:(r.version!==3||r.jsonChunkIndex===-1)&&hg(r,e,t,l,o);break;case SR:pg(r,e,t,l,o);break;case LR:s.strict||hg(r,e,t,l,o);break;case BR:s.strict||pg(r,e,t,l,o);break;default:break}t+=mg(l),o++}return t}function hg(r,e,t,n,s){let i=new Uint8Array(e.buffer,t,n),a=new TextDecoder("utf8").decode(i);return r.json=JSON.parse(a),r.jsonChunkIndex=s,mg(n)}function pg(r,e,t,n,s){return r.header.hasBinChunk=!0,r.binChunks.push({chunkIndex:s,byteOffset:t,byteLength:n,arrayBuffer:e.buffer}),mg(n)}function jI(r,e,t){let n=r.getBigUint64(e,ti);if(n>BigInt(Number.MAX_SAFE_INTEGER))throw new Error(`${t} exceeds JavaScript's safe integer range.`);return Number(n)}function mg(r){return Math.ceil(r/4)*4}var ti,NI,id,UI,od,CI,IR,SR,ER,LR,BR,bg=p(()=>{"use strict";Ue();ti=!0,NI=1735152710,id=12,UI=16,od=8,CI=16,IR=1313821514,SR=5130562,ER=0,LR=0,BR=1});function Kn(r,e,t){if(r.startsWith("data:")||r.startsWith("http:")||r.startsWith("https:"))return cd(r);let s=t?.baseUrl||RR(e?.core?.baseUrl);if(!s)throw new Error(`'baseUrl' must be provided to resolve relative url ${r}`);let i=s.endsWith("/")?`${s}${r}`:`${s}/${r}`;return cd(i)}function cd(r){try{return new URL(r).href}catch{return r}}function RR(r){if(!r)return;if(r.endsWith("/"))return r;let e=r.lastIndexOf("/");return e>=0?r.slice(0,e+1):""}var Yc=p(()=>{"use strict"});var ud,Qc,gg=p(()=>{"use strict";ud={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Qc={5120:1,5121:1,5122:2,5123:2,5124:4,5125:4,5126:4,5130:8,5131:2,5134:8,5135:8}});function ma(r){return GI[r-1]||GI[0]}function Xn(r){let e=NR.get(r.constructor);if(!e)throw new Error("Illegal typed array");return e}function Zc(r,e){let t=PR[r.componentType],n=CR[r.type],s=UR[r.componentType],i=r.count*n,o=r.count*n*s;H(o>=0&&o<=e.byteLength);let a=Qc[r.componentType],c=ud[r.type];return{ArrayType:t,length:i,byteLength:o,componentByteSize:a,numberOfComponentsInElement:c}}var GI,kR,NR,CR,UR,PR,ri=p(()=>{"use strict";oo();gg();GI=["SCALAR","VEC2","VEC3","VEC4"],kR=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Int32Array,5124],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130],[BigInt64Array,5134],[BigUint64Array,5135]],NR=new Map(kR),CR={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},UR={5120:1,5121:1,5122:2,5123:2,5124:4,5125:4,5126:4,5130:8,5131:2,5134:8,5135:8},PR={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5124:Int32Array,5125:Uint32Array,5126:Float32Array,5130:Float64Array,5131:Uint16Array,5134:BigInt64Array,5135:BigUint64Array}});function hr(r,e,t){let n=typeof t=="number"?r.bufferViews[t]:t;H(n);let s=n.buffer,i=e[s];H(i),H((n.byteOffset||0)>=0&&n.byteLength>=0),H((n.byteOffset||0)+n.byteLength<=i.byteLength),H(i.byteOffset>=0&&i.byteOffset+i.byteLength<=i.arrayBuffer.byteLength);let o=(n.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,o,n.byteLength)}function zI(r,e,t){let n=r.images[t];return hr(r,e,n.bufferView)}function ld(r,e,t){let n=typeof t=="number"?r.accessors?.[t]:t;if(!n)throw new Error(`No gltf accessor ${JSON.stringify(t)}`);H(Number.isSafeInteger(n.count)&&n.count>=0);let{ArrayType:s,length:i,numberOfComponentsInElement:o}=Zc(n,{byteLength:1/0}),a=n.value,c;ArrayBuffer.isView(a)?(H(a.length===i),c=a):n.bufferView===void 0?c=new s(i):c=yg(r,e,n);let u=n.sparse;if(!u)return c;let l=new s(i);new Uint8Array(l.buffer).set(new Uint8Array(c.buffer,c.byteOffset,c.byteLength)),H(u.count>=0&&u.count<=n.count),H([5121,5123,5125].includes(u.indices.componentType));let f=yg(r,e,{bufferView:u.indices.bufferView,byteOffset:u.indices.byteOffset,componentType:u.indices.componentType,count:u.count,type:"SCALAR"}),d=yg(r,e,{bufferView:u.values.bufferView,byteOffset:u.values.byteOffset,componentType:n.componentType,count:u.count,type:n.type}),h=-1,m=new Uint8Array(l.buffer),b=o*s.BYTES_PER_ELEMENT,g=new Uint8Array(d.buffer,d.byteOffset,d.byteLength);for(let y=0;y<u.count;y++){let x=Number(f[y]);H(x>h&&x<n.count),m.set(g.subarray(y*b,(y+1)*b),x*b),h=x}return l}function yg(r,e,t){let n=r.bufferViews?.[t.bufferView];if(!n)throw new Error(`No gltf buffer view for accessor ${n}`);let s=e[n.buffer];H(s);let{arrayBuffer:i,byteOffset:o}=s;H((n.byteOffset||0)>=0&&n.byteLength>=0),H((n.byteOffset||0)+n.byteLength<=s.byteLength),H(o>=0&&o+s.byteLength<=i.byteLength),H((t.byteOffset||0)>=0);let a=(o||0)+(t.byteOffset||0)+(n.byteOffset||0),{ArrayType:c,length:u,componentByteSize:l,numberOfComponentsInElement:f}=Zc(t,n),d=l*f,h=t.type.startsWith("MAT")?Number(t.type.slice(3)):1,m=_e(h*l,4),b=h>1?h*m:d,g=n.byteStride??b,y=h>1?(h-1)*m+h*l:d;if(H(g>=b),H((t.byteOffset||0)+(t.count===0?0:(t.count-1)*g+y)<=n.byteLength),t.count===0)return new c(0);if(h>1&&m!==h*l){let _=n.byteStride??h*m,v=(h-1)*m+h*l;H((t.byteOffset||0)+(t.count-1)*_+v<=n.byteLength);let I=new c(u),N=new Uint8Array(I.buffer,I.byteOffset,I.byteLength);for(let K=0;K<t.count;K++)for(let ne=0;ne<h;ne++){let be=new Uint8Array(i,a+K*_+ne*m,h*l);N.set(be,K*d+ne*h*l)}return I}let x=n.byteStride||d;if(typeof n.byteStride>"u"||n.byteStride===d){if(a%l!==0){let v=new Uint8Array(i,a,u*l),I=new Uint8Array(v.byteLength);return I.set(v),new c(I.buffer,0,u)}return new c(i,a,u)}let T=new c(u);for(let _=0;_<t.count;_++){let v=a+_*x,I;if(v%l!==0){let N=new Uint8Array(i,v,d),K=new Uint8Array(d);K.set(N),I=new c(K.buffer,0,f)}else I=new c(i,v,f);T.set(I,_*f)}return T}var ao=p(()=>{"use strict";oo();Ue();ri()});function wg(r,e){let t=r.json.files||[],n=[];for(let s=0;s<t.length;s++){let i=t[s];(i.name===e||i.uri===e)&&n.push(s)}return H(n.length<=1,`glTF package file reference ${e} is ambiguous.`),n[0]??-1}async function fd(r,e,t,n){let s=r.json.files||[],i=typeof e=="number"?e:wg(r,e);H(Number.isInteger(i)&&i>=0&&i<s.length),r.files=r.files||new Array(s.length).fill(null);let o=r.files[i];if(o)return o;let a=s[i];H(a.mimeType,`glTF file ${i} must define mimeType.`);let c=a.uri!==void 0,u=a.bufferView!==void 0;H(c!==u,`glTF file ${i} must define exactly one of uri or bufferView.`);let l;if(a.uri!==void 0){let f=Kn(a.uri,t,n),d=await n.fetch(f);H(d?.ok,`Failed to fetch glTF file ${a.uri}: HTTP ${d?.status}.`);let h=await d.arrayBuffer();l={arrayBuffer:h,byteOffset:0,byteLength:h.byteLength,mimeType:a.mimeType,name:a.name,url:f}}else{let f=hr(r.json,r.buffers,a.bufferView);l={arrayBuffer:f.buffer,byteOffset:f.byteOffset,byteLength:f.byteLength,mimeType:a.mimeType,name:a.name}}return r.files[i]=l,l}var WI=p(()=>{"use strict";ao();Yc();oo()});var xg={};J(xg,{name:()=>co,preprocess:()=>VR});function VR(r){let{json:e}=r;if(!(!e.extensionsUsed?.includes(co)&&!e.extensionsRequired?.includes(co))){if(!e.extensionsUsed?.includes(co)||!e.extensionsRequired?.includes(co))throw new Error(`${co}: must be declared in extensionsUsed and extensionsRequired.`);for(let[t,n]of(e.accessors||[]).entries())if(n.componentType===5130&&n.normalized)throw new Error(`${co}: accessor ${t} must not be normalized.`)}}var co,$I=p(()=>{"use strict";co="KHR_accessor_float64"});function jR(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}var bn,eu=p(()=>{"use strict";qn();Ue();oo();ri();ao();bn=class{gltf;sourceBuffers;byteLength;constructor(e){this.gltf={json:e?.json||jR(),buffers:e?.buffers||[],images:e?.images||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=_e(this.gltf.buffers[0].byteLength,4),this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}hasExtension(e){let t=this.getUsedExtensions().find(s=>s===e),n=this.getRequiredExtensions().find(s=>s===e);return typeof t=="string"||typeof n=="string"}getExtension(e){let t=this.getUsedExtensions().find(s=>s===e),n=this.json.extensions||{};return t?n[e]:null}getRequiredExtension(e){return this.getRequiredExtensions().find(n=>n===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(e,t){return(e.extensions||{})[t]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,t){if(typeof t=="object")return t;let n=this.json[e]&&this.json[e][t];if(!n)throw new Error(`glTF file error: Could not find ${e}[${t}]`);return n}getTypedArrayForBufferView(e){return hr(this.gltf.json,this.gltf.buffers,e)}getTypedArrayForAccessor(e){return ld(this.gltf.json,this.gltf.buffers,e)}getTypedArrayForImageData(e){e=this.getAccessor(e);let t=this.getBufferView(e.bufferView),s=this.getBuffer(t.buffer).data,i=t.byteOffset||0;return new Uint8Array(s,i,t.byteLength)}addApplicationData(e,t){return this.json[e]=t,this}addExtraData(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}addObjectExtension(e,t,n){return e.extensions=e.extensions||{},e.extensions[t]=n,this.registerUsedExtension(t),this}setObjectExtension(e,t,n){let s=e.extensions||{};s[t]=n}removeObjectExtension(e,t){let n=e?.extensions||{};if(n[t]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let s=this.json.extensionsRemoved;s.includes(t)||s.push(t)}delete n[t]}addExtension(e,t={}){return H(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return H(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(t=>t===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(t=>t===e)||this.json.extensionsRequired.push(e)}removeExtension(e){if(this.json.extensions?.[e]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let t=this.json.extensionsRemoved;t.includes(e)||t.push(e)}this.json.extensions&&delete this.json.extensions[e],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e)}setDefaultScene(e){this.json.scene=e}addScene(e){let{nodeIndices:t}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(e){let{meshIndex:t,matrix:n}=e;this.json.nodes=this.json.nodes||[];let s={mesh:t};return n&&(s.matrix=n),this.json.nodes.push(s),this.json.nodes.length-1}addMesh(e){let{attributes:t,indices:n,material:s,mode:i=4}=e,a={primitives:[{attributes:this._addAttributes(t),mode:i}]};if(n){let c=this._addIndices(n);a.primitives[0].indices=c}return Number.isFinite(s)&&(a.primitives[0].material=s),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(e){let n={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(n),this.json.meshes.length-1}addImage(e,t){let n=$n(e),s=t||n?.mimeType,o={bufferView:this.addBufferView(e),mimeType:s};return this.json.images=this.json.images||[],this.json.images.push(o),this.json.images.length-1}addBufferView(e,t=0,n=this.byteLength){let s=e.byteLength;H(Number.isFinite(s)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);let i={buffer:t,byteOffset:n,byteLength:s};return this.byteLength+=_e(s,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}addAccessor(e,t){let n=t.normalized,s={bufferView:e,...n===void 0?{}:{normalized:n},type:ma(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(s),this.json.accessors.length-1}addBinaryBuffer(e,t={size:3}){let n=this.addBufferView(e),s={min:t.min,max:t.max};(!s.min||!s.max)&&(s=this._getAccessorMinMax(e,t.size));let i={size:t.size,componentType:Xn(e),count:Math.round(e.length/t.size),min:s.min,max:s.max};return this.addAccessor(n,Object.assign(i,t))}addTexture(e){let{imageIndex:t,samplerIndex:n}=e,s={source:t,...n===void 0?{}:{sampler:n}};return this.json.textures=this.json.textures||[],this.json.textures.push(s),this.json.textures.length-1}addSampler(e){return this.json.samplers=this.json.samplers||[],this.json.samplers.push({...e}),this.json.samplers.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){if(this.byteLength===0&&!this.json.buffers?.length){delete this.json.buffers,delete this.gltf.binary,this.sourceBuffers=[],this.gltf.buffers=[];return}let e=[0],t=this.byteLength;for(let o=1;o<this.gltf.buffers.length;o++){let a=this.gltf.buffers[o];a&&(e[o]=_e(t,8),t=e[o]+_e(a.byteLength,4))}let n=new ArrayBuffer(t),s=new Uint8Array(n),i=0;for(let o of this.sourceBuffers||[])i=to(o,s,i);for(let o=1;o<this.gltf.buffers.length;o++){let a=this.gltf.buffers[o];a&&to(a,s,e[o])}for(let o of this.json.bufferViews||[]){let a=e[o.buffer];H(a!==void 0),o.byteOffset=a+(o.byteOffset||0),o.buffer=0;for(let c of["EXT_meshopt_compression","KHR_meshopt_compression"]){let u=o.extensions?.[c];if(u){let l=e[u.buffer];H(l!==void 0),u.byteOffset=l+(u.byteOffset||0),u.buffer=0}}}this.byteLength=t,this.json.buffers=[{byteLength:t}],this.gltf.binary=n,this.sourceBuffers=[n],this.gltf.buffers=[{arrayBuffer:n,byteOffset:0,byteLength:n.byteLength}]}_removeStringFromArray(e,t){let n=!0;for(;n;){let s=e.indexOf(t);s>-1?e.splice(s,1):n=!1}}_addAttributes(e={}){let t={};for(let n in e){let s=e[n],i=this._getGltfAttributeName(n),o=s.value,a=o.BYTES_PER_ELEMENT*s.size,c=_e(a,4),u;if(c===a)u=this.addBinaryBuffer(o,s);else{let l=o.length/s.size,f=new Uint8Array(l*c),d=new Uint8Array(o.buffer,o.byteOffset,o.byteLength);for(let m=0;m<l;m++)f.set(d.subarray(m*a,(m+1)*a),m*c);let h=this.addBufferView(f);this.json.bufferViews[h].byteStride=c,u=this.addAccessor(h,{...this._getAccessorMinMax(o,s.size),...s,componentType:Xn(o),count:l})}t[i]=u}return t}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,t){let n={min:null,max:null};if(e.length<t)return n;n.min=[],n.max=[];let s=e.subarray(0,t);for(let i of s)n.min.push(i),n.max.push(i);for(let i=t;i<e.length;i+=t)for(let o=0;o<t;o++)n.min[0+o]=Math.min(n.min[0+o],e[i+o]),n.max[0+o]=Math.max(n.max[0+o],e[i+o]);return n}}});function GR(r){switch(r.type){case"accessor":return{get bufferView(){return r.bufferView?.data}};case"animation":return{get channels(){return uo(r.channels)},get samplers(){return uo(r.samplers)}};case"animationChannel":return{get sampler(){return r.sampler.data},get target(){return r.target.data}};case"animationChannelTarget":return{get node(){return r.node?.data}};case"animationSampler":return{get input(){return r.input.data},get output(){return r.output.data}};case"bufferView":return{get buffer(){return r.buffer.data}};case"externalAsset":return{get file(){return r.file.data}};case"file":case"image":return{get bufferView(){return r.bufferView?.data}};case"material":return{get baseColorTexture(){return r.baseColorTexture?.data},get metallicRoughnessTexture(){return r.metallicRoughnessTexture?.data},get normalTexture(){return r.normalTexture?.data},get occlusionTexture(){return r.occlusionTexture?.data},get emissiveTexture(){return r.emissiveTexture?.data},get textures(){return uo(r.textures)}};case"textureInfo":return{get texture(){return r.texture.data}};case"mesh":return{get primitives(){return uo(r.primitives)}};case"primitive":return{get attributes(){return qI(r.attributes)},get indices(){return r.indices?.data},get material(){return r.material?.data},get targets(){return r.targets.map(qI)}};case"node":return{get camera(){return r.camera?.data},get children(){return uo(r.children)},get skin(){return r.skin?.data},get mesh(){return r.mesh?.data},get externalAsset(){return r.externalAsset?.data}};case"scene":return{get nodes(){return uo(r.nodes)}};case"skin":return{get inverseBindMatrices(){return r.inverseBindMatrices?.data},get skeleton(){return r.skeleton?.data},get joints(){return uo(r.joints)}};case"texture":return{get sampler(){return r.sampler?.data},get source(){return r.source?.data}};default:return{}}}function lo(r,e){return(function*(){for(let n=0;n<r.length;n++)yield e(r[n],n)})()}function uo(r){return(function*(){for(let t of r)yield t.data})()}function qI(r){return new Map(Array.from(r,([e,t])=>[e,t.data]))}function zR(r){switch(r){case"bufferView":return"bufferViews";case"externalAsset":return"externalAssets";case"mesh":return"meshes";default:return`${r}s`}}function KI(r,e){if(r)for(let t=r.length-1;t>=0;t--)r[t]===e&&r.splice(t,1)}var Je,ni,Tg,_g,Ag,vg,dd,Ig,Sg,Eg,Lg,Bg,Fg,Og,Mg,Dg,Rg,kg,Ng,Cg,Ug,Pg,ie,He=p(()=>{"use strict";ao();ri();Je=class{gltf;type;index;data;path;iterator;constructor(e,t,n,s,i){this.iterator=e,this.gltf=e.gltf,this.type=t,this.index=n,this.data=s,this.path=i}},ni=class extends Je{parent;constructor(e,t,n,s,i,o){super(e,t,n,s,i),this.parent=o}},Tg=class extends Je{get bufferView(){return this.data.bufferView===void 0?void 0:this.iterator.resolveBufferView(this.data.bufferView,`${this.path}.bufferView`)}},_g=class extends Je{get channels(){return lo(this.data.channels,(e,t)=>this.iterator.getOrCreateNested(e,()=>new Ag(this.iterator,"animationChannel",t,e,`${this.path}.channels[${t}]`,this)))}get samplers(){return lo(this.data.samplers,(e,t)=>this.iterator.getOrCreateNested(e,()=>new dd(this.iterator,"animationSampler",t,e,`${this.path}.samplers[${t}]`,this)))}},Ag=class extends ni{get sampler(){let t=this.parent.data.samplers[this.data.sampler];if(!t)throw new Error(`Invalid glTF reference at ${this.path}.sampler: animation sampler index ${this.data.sampler} is out of range`);return this.iterator.getOrCreateNested(t,()=>new dd(this.iterator,"animationSampler",this.data.sampler,t,`${this.parent.path}.samplers[${this.data.sampler}]`,this.parent))}get target(){return this.iterator.getOrCreateNested(this.data.target,()=>new vg(this.iterator,"animationChannelTarget",0,this.data.target,`${this.path}.target`,this))}},vg=class extends ni{get node(){return this.data.node===void 0?void 0:this.iterator.resolveNode(this.data.node,`${this.path}.node`)}},dd=class extends ni{get input(){return this.iterator.resolveAccessor(this.data.input,`${this.path}.input`)}get output(){return this.iterator.resolveAccessor(this.data.output,`${this.path}.output`)}},Ig=class extends Je{get loadedBuffer(){return this.gltf.buffers[this.index]}},Sg=class extends Je{get buffer(){return this.iterator.resolveBuffer(this.data.buffer,`${this.path}.buffer`)}get loadedBufferView(){let e=this.buffer.loadedBuffer;if(!e)return;let t=e.byteOffset+(this.data.byteOffset||0);return new Uint8Array(e.arrayBuffer,t,this.data.byteLength)}},Eg=class extends Je{},Lg=class extends Je{get file(){return this.iterator.resolveFile(this.data.file,`${this.path}.file`)}get loadedAsset(){return this.gltf.externalAssets?.[this.index]}},Bg=class extends Je{get bufferView(){return this.data.bufferView===void 0?void 0:this.iterator.resolveBufferView(this.data.bufferView,`${this.path}.bufferView`)}get loadedFile(){return this.gltf.files?.[this.index]}},Fg=class extends Je{get bufferView(){return this.data.bufferView===void 0?void 0:this.iterator.resolveBufferView(this.data.bufferView,`${this.path}.bufferView`)}get loadedImage(){return this.gltf.images?.[this.index]}},Og=class extends Je{get baseColorTexture(){return this.getTextureInfo(this.data.pbrMetallicRoughness?.baseColorTexture,0,"pbrMetallicRoughness.baseColorTexture")}get metallicRoughnessTexture(){return this.getTextureInfo(this.data.pbrMetallicRoughness?.metallicRoughnessTexture,1,"pbrMetallicRoughness.metallicRoughnessTexture")}get normalTexture(){return this.getTextureInfo(this.data.normalTexture,2,"normalTexture")}get occlusionTexture(){return this.getTextureInfo(this.data.occlusionTexture,3,"occlusionTexture")}get emissiveTexture(){return this.getTextureInfo(this.data.emissiveTexture,4,"emissiveTexture")}get textures(){return[this.baseColorTexture,this.metallicRoughnessTexture,this.normalTexture,this.occlusionTexture,this.emissiveTexture].filter(t=>!!t).values()}getTextureInfo(e,t,n){return e?this.iterator.getOrCreateNested(e,()=>new Mg(this.iterator,"textureInfo",t,e,`${this.path}.${n}`,this)):void 0}},Mg=class extends ni{get texture(){return this.iterator.resolveTexture(this.data.index,`${this.path}.index`)}},Dg=class extends Je{get primitives(){return lo(this.data.primitives,(e,t)=>this.iterator.getOrCreateNested(e,()=>new Rg(this.iterator,"primitive",t,e,`${this.path}.primitives[${t}]`,this)))}},Rg=class extends ni{get attributes(){return new Map(Object.entries(this.data.attributes).map(([e,t])=>[e,this.iterator.resolveAccessor(t,`${this.path}.attributes.${e}`)]))}get indices(){return this.data.indices===void 0?void 0:this.iterator.resolveAccessor(this.data.indices,`${this.path}.indices`)}get material(){return this.data.material===void 0?void 0:this.iterator.resolveMaterial(this.data.material,`${this.path}.material`)}get targets(){return(this.data.targets||[]).map((e,t)=>new Map(Object.entries(e).map(([n,s])=>[n,this.iterator.resolveAccessor(s,`${this.path}.targets[${t}].${n}`)])))}},kg=class extends Je{get camera(){return this.data.camera===void 0?void 0:this.iterator.resolveCamera(this.data.camera,`${this.path}.camera`)}get children(){return lo(this.data.children||[],(e,t)=>this.iterator.resolveNode(e,`${this.path}.children[${t}]`))}get skin(){return this.data.skin===void 0?void 0:this.iterator.resolveSkin(this.data.skin,`${this.path}.skin`)}get mesh(){return this.data.mesh===void 0?void 0:this.iterator.resolveMesh(this.data.mesh,`${this.path}.mesh`)}get externalAsset(){return this.data.externalAsset===void 0?void 0:this.iterator.resolveExternalAsset(this.data.externalAsset,`${this.path}.externalAsset`)}},Ng=class extends Je{},Cg=class extends Je{get nodes(){return lo(this.data.nodes||[],(e,t)=>this.iterator.resolveNode(e,`${this.path}.nodes[${t}]`))}},Ug=class extends Je{get inverseBindMatrices(){return this.data.inverseBindMatrices===void 0?void 0:this.iterator.resolveAccessor(this.data.inverseBindMatrices,`${this.path}.inverseBindMatrices`)}get skeleton(){return this.data.skeleton===void 0?void 0:this.iterator.resolveNode(this.data.skeleton,`${this.path}.skeleton`)}get joints(){return lo(this.data.joints,(e,t)=>this.iterator.resolveNode(e,`${this.path}.joints[${t}]`))}},Pg=class extends Je{get sampler(){return this.data.sampler===void 0?void 0:this.iterator.resolveSampler(this.data.sampler,`${this.path}.sampler`)}get source(){return this.data.source===void 0?void 0:this.iterator.resolveImage(this.data.source,`${this.path}.source`)}},ie=class{gltf;objectCache=new WeakMap;referencesCache=new WeakMap;constructor(e){this.gltf=e}get data(){return this.gltf.json}getTypedArrayForBufferView(e){return hr(this.data,this.gltf.buffers,e)}getTypedArrayForAccessor(e){return ld(this.data,this.gltf.buffers,e)}getTypedArrayForImageData(e){return zI(this.data,this.gltf.buffers,e)}getLoadedBuffer(e){let t=this.getMetadata(e);return this.gltf.buffers[t.index]}getLoadedBufferView(e){let t=this.getReferences(e).buffer,n=this.getLoadedBuffer(t);if(!n)return;let s=n.byteOffset+(e.byteOffset||0);return new Uint8Array(n.arrayBuffer,s,e.byteLength)}getLoadedImage(e){return this.gltf.images?.[this.getMetadata(e).index]}getLoadedFile(e){return this.gltf.files?.[this.getMetadata(e).index]}getLoadedExternalAsset(e){return this.gltf.externalAssets?.[this.getMetadata(e).index]}addBuffer(e){let t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return this.gltf.buffers.push({arrayBuffer:t,byteOffset:0,byteLength:e.byteLength}),this.data.buffers||=[],this.data.buffers.push({byteLength:e.byteLength}),this.data.buffers.length-1}addBufferView(e,t,n=0){return this.data.bufferViews||=[],this.data.bufferViews.push({buffer:e,byteOffset:n,byteLength:t}),this.data.bufferViews.length-1}addAccessor(e,t){return this.data.accessors||=[],this.data.accessors.push({bufferView:e,type:ma(t.size),componentType:t.componentType,count:t.count,min:t.min,max:t.max}),this.data.accessors.length-1}getReferences(e){let t=this.referencesCache.get(e);if(t)return t;let n=this.getObjectIterator(e),s=GR(n);return this.referencesCache.set(e,s),s}getMetadata(e){let t=this.getObjectIterator(e),n=t instanceof ni?t.parent.data:void 0;return{gltf:this.gltf,type:t.type,index:t.index,parent:n,path:t.path}}get scene(){return this.data.scene===void 0?void 0:this.resolveScene(this.data.scene,"scene").data}get thumbnail(){return this.data.asset.thumbnail===void 0?void 0:this.resolveImage(this.data.asset.thumbnail,"asset.thumbnail").data}get accessors(){return this.iterateCollectionData("accessor")}get animations(){return this.iterateCollectionData("animation")}get buffers(){return this.iterateCollectionData("buffer")}get bufferViews(){return this.iterateCollectionData("bufferView")}get cameras(){return this.iterateCollectionData("camera")}get externalAssets(){return this.iterateCollectionData("externalAsset")}get files(){return this.iterateCollectionData("file")}get images(){return this.iterateCollectionData("image")}get materials(){return this.iterateCollectionData("material")}get meshes(){return this.iterateCollectionData("mesh")}get nodes(){return this.iterateCollectionData("node")}get samplers(){return this.iterateCollectionData("sampler")}get scenes(){return this.iterateCollectionData("scene")}get skins(){return this.iterateCollectionData("skin")}get textures(){return this.iterateCollectionData("texture")}hasExtension(e){return!!this.data.extensionsUsed?.includes(e)||!!this.data.extensionsRequired?.includes(e)}isExtensionRequired(e){return!!this.data.extensionsRequired?.includes(e)}getExtension(e,t){let n=typeof e=="string"?this.data:e,s=typeof e=="string"?e:t;return n.extensions?.[s]}setExtension(e,t,n){let s=typeof e=="string",i=s?this.data:e,o=s?e:t,a=s?t:n,c=s?!!n:!1;i.extensions||={},i.extensions[o]=a,this.registerUsedExtension(o),c&&this.registerRequiredExtension(o)}registerUsedExtension(e){this.data.extensionsUsed||=[],this.data.extensionsUsed.includes(e)||this.data.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.data.extensionsRequired||=[],this.data.extensionsRequired.includes(e)||this.data.extensionsRequired.push(e)}removeExtension(e,t){let n=typeof e=="string",s=n?this.data:e,i=n?e:t;s.extensions?.[i]!==void 0&&(this.recordRemovedExtension(i),delete s.extensions[i]),n&&(KI(this.data.extensionsUsed,i),KI(this.data.extensionsRequired,i))}recordRemovedExtension(e){let t=this.data;t.extensionsRemoved||=[],t.extensionsRemoved.includes(e)||t.extensionsRemoved.push(e)}resolveAccessor(e,t){return this.resolveCollectionObject("accessor",e,t)}resolveBuffer(e,t){return this.resolveCollectionObject("buffer",e,t)}resolveBufferView(e,t){return this.resolveCollectionObject("bufferView",e,t)}resolveCamera(e,t){return this.resolveCollectionObject("camera",e,t)}resolveExternalAsset(e,t){return this.resolveCollectionObject("externalAsset",e,t)}resolveFile(e,t){return this.resolveCollectionObject("file",e,t)}resolveImage(e,t){return this.resolveCollectionObject("image",e,t)}resolveMaterial(e,t){return this.resolveCollectionObject("material",e,t)}resolveMesh(e,t){return this.resolveCollectionObject("mesh",e,t)}resolveNode(e,t){return this.resolveCollectionObject("node",e,t)}resolveSampler(e,t){return this.resolveCollectionObject("sampler",e,t)}resolveScene(e,t){return this.resolveCollectionObject("scene",e,t)}resolveSkin(e,t){return this.resolveCollectionObject("skin",e,t)}resolveTexture(e,t){return this.resolveCollectionObject("texture",e,t)}getOrCreateNested(e,t){return this.getOrCreate(e,t)}iterateCollection(e){let t=this.getCollection(e);return lo(t,(n,s)=>this.resolveCollectionObject(e,s,e))}iterateCollectionData(e){return(function*(n){for(let s of n.iterateCollection(e))yield s.data})(this)}getObjectIterator(e){let t=this.objectCache.get(e);if(!t)throw new Error("glTF object is not registered with this iterator");return t}resolveCollectionObject(e,t,n){let i=this.getCollection(e)[t];if(!i)throw new Error(`Invalid glTF reference at ${n}: ${e} index ${t} is out of range`);return this.getOrCreate(i,()=>this.createCollectionObject(e,t,i))}getCollection(e){switch(e){case"accessor":return this.data.accessors||[];case"animation":return this.data.animations||[];case"buffer":return this.data.buffers||[];case"bufferView":return this.data.bufferViews||[];case"camera":return this.data.cameras||[];case"externalAsset":return this.data.externalAssets||[];case"file":return this.data.files||[];case"image":return this.data.images||[];case"material":return this.data.materials||[];case"mesh":return this.data.meshes||[];case"node":return this.data.nodes||[];case"sampler":return this.data.samplers||[];case"scene":return this.data.scenes||[];case"skin":return this.data.skins||[];case"texture":return this.data.textures||[]}}createCollectionObject(e,t,n){let s=`${zR(e)}[${t}]`;switch(e){case"accessor":return new Tg(this,e,t,n,s);case"animation":return new _g(this,e,t,n,s);case"buffer":return new Ig(this,e,t,n,s);case"bufferView":return new Sg(this,e,t,n,s);case"camera":return new Eg(this,e,t,n,s);case"externalAsset":return new Lg(this,e,t,n,s);case"file":return new Bg(this,e,t,n,s);case"image":return new Fg(this,e,t,n,s);case"material":return new Og(this,e,t,n,s);case"mesh":return new Dg(this,e,t,n,s);case"node":return new kg(this,e,t,n,s);case"sampler":return new Ng(this,e,t,n,s);case"scene":return new Cg(this,e,t,n,s);case"skin":return new Ug(this,e,t,n,s);case"texture":return new Pg(this,e,t,n,s)}}getOrCreate(e,t){let n=this.objectCache.get(e);if(n)return n;let s=t();return this.objectCache.set(e,s),s}}});function XI(r){return(r%1+1)%1}function tu(r,e){return JI[e]*HI[r]}function ba(r,e,t,n){if(t!=="UINT8"&&t!=="UINT16"&&t!=="UINT32"&&t!=="UINT64")return null;let s=r.getTypedArrayForBufferView(e),i=ga(s,"SCALAR",t,n+1);if(i instanceof BigInt64Array||i instanceof BigUint64Array){let o=new Float64Array(i.length),a=BigInt(Number.MAX_SAFE_INTEGER);for(let c=0;c<i.length;c++){let u=i[c];if(u<0n||u>a)throw new Error("EXT_structural_metadata: UINT64 offset exceeds the safe integer range");o[c]=Number(u)}return o}return i}function ga(r,e,t,n=1){let s=HI[e],i=WR[t],o=JI[t],a=n*s,c=a*o,u=r.buffer,l=r.byteOffset;return l%o!==0&&(u=new Uint8Array(u).slice(l,l+c).buffer,l=0),new i(ro(u),l,a)}function ya(r,e,t){let n=`TEXCOORD_${e.texCoord||0}`,s=t.attributes[n],i=r.getTypedArrayForAccessor(s),o=r.gltf.json,a=e.index,c=o.textures?.[a]?.source;if(typeof c<"u"){let u=o.images?.[c]?.mimeType,l=r.gltf.images?.[c];if(l&&typeof l.width<"u"&&!("compressed"in l&&l.compressed)){let f=[];for(let d=0;d<i.length;d+=2){let h=$R(l,u,i,d,e.channels);f.push(h)}return f}}return[]}function hd(r,e,t,n,s){if(!t?.length)return;let i=[];for(let f of t){let d=n.findIndex(h=>h===f);d===-1&&(d=n.push(f)-1),i.push(d)}let o=new Uint32Array(i),a=r instanceof ie?r:new ie(r.gltf),c=a.addBuffer(o),u=a.addBufferView(c,o.byteLength),l=a.addAccessor(u,{size:1,componentType:Xn(o),count:o.length});s.attributes[e]=l}function $R(r,e,t,n,s=[0]){let i={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},o=t[n],a=t[n+1],c=1;e&&(e.indexOf("image/jpeg")!==-1||e.indexOf("image/png")!==-1)&&(c=4);let u=qR(o,a,r,c),l=0;for(let f of s){let d=typeof f=="number"?Object.values(i)[f]:i[f],h=u+d.offset,m=Jc(r);if(m.data.length<=h)throw new Error(`${m.data.length} <= ${h}`);let b=m.data[h];l|=b<<d.shift}return l}function qR(r,e,t,n=1){let s=t.width,i=XI(r)*(s-1),o=Math.round(i),a=t.height,c=XI(e)*(a-1),u=Math.round(c),l=t.components?t.components:n;return(u*s+o)*l}function ru(r,e,t,n=1){let s=[];for(let i=0;i<e;i++){let o=Number(t[i]),a=Number(t[i+1])-o;if(!Number.isInteger(o)||!Number.isInteger(a)||o<0||a<0||(o+a)*n>r.length)break;let c=o*n,u=a*n;s.push(r.slice(c,c+u))}return s}function nu(r,e,t,n=1){let s=[],i=t*n;for(let o=0;o<e;o++){let a=o*i;s.push(r.slice(a,a+i))}return s}function pd(r,e,t,n,s){let i=new TextDecoder("utf8");if(t){if(!n)throw new Error("stringOffsets is required for variable-length string arrays");let o=[];for(let a=0;a<r;a++){let c=t[a],u=t[a+1],l=[];for(let f=c;f<u;f++){let d=n[f],h=n[f+1],m=e.subarray(d,h);l.push(i.decode(m))}o.push(l)}return o}if(n){let o=[],a=r*(s||1);for(let c=0;c<a;c++){let u=Number(n[c]),l=Number(n[c+1]);u>=0&&l>=u&&l<=e.length&&o.push(i.decode(e.subarray(u,l)))}return s?Array.from({length:r},(c,u)=>o.slice(u*s,(u+1)*s)):o}return[]}var HI,WR,JI,md=p(()=>{"use strict";He();ri();qn();Ue();HI={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},WR={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},JI={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8}});var Vg={};J(Vg,{createExtMeshFeatures:()=>ZR,decode:()=>XR,encode:()=>HR,name:()=>KR});async function XR(r,e){let t=new ie(r);JR(t,e)}function HR(r,e){let t=new bn(r);return QR(t,e),t.createBinaryChunk(),t.gltf}function JR(r,e){for(let t of r.meshes)for(let n of r.getReferences(t).primitives)YR(r,n,e)}function YR(r,e,t){let s=r.getExtension(e,wa)?.featureIds||[];if(s)for(let i of s){let o;if(typeof i.attribute<"u"){if(!t?.gltf?.loadBuffers)continue;let a=`_FEATURE_ID_${i.attribute}`,c=e.attributes[a];o=r.getTypedArrayForAccessor(c)}else if(typeof i.texture<"u"){if(!t?.gltf?.loadImages)continue;o=ya(r,i.texture,e)}else{let a=e.attributes.POSITION,c=typeof a=="number"?r.data.accessors?.[a]?.count:a?.count;if(typeof c!="number"||!Number.isInteger(c)||c<0)throw new Error("EXT_mesh_features: implicit feature IDs require a POSITION accessor");if(i.featureCount!==c)throw new Error(`EXT_mesh_features: implicit featureCount ${i.featureCount} does not match vertex count ${c}`);delete i.data,Object.defineProperty(i,"implicit",{configurable:!0,enumerable:!1,writable:!0,value:{start:0,count:c}})}o&&(i.data=o,delete i.implicit)}}function QR(r,e){let t=r.gltf.json.meshes;if(t)for(let n of t)for(let s of n.primitives)ek(r,s)}function ZR(r,e,t,n){e.extensions||(e.extensions={});let s=e.extensions[wa];s||(s={featureIds:[]},e.extensions[wa]=s);let{featureIds:i}=s,o={featureCount:t.length,propertyTable:n,data:t};i.push(o),r.addObjectExtension(e,wa,s)}function ek(r,e){let t=e.extensions?.[wa];if(!t)return;let n=t.featureIds;n.forEach((s,i)=>{if(s.data){let{accessorKey:o,index:a}=tk(e.attributes),c=new Uint32Array(s.data);n[i]={featureCount:c.length,propertyTable:s.propertyTable,attribute:a};let u=r.addBufferView(c),l=r.addAccessor(u,{size:1,componentType:Xn(c),count:c.length});e.attributes[o]=l}})}function tk(r){let e="_FEATURE_ID_",t=Object.keys(r).filter(i=>i.indexOf(e)===0),n=-1;for(let i of t){let o=Number(i.substring(e.length));o>n&&(n=o)}return n++,{accessorKey:`${e}${n}`,index:n}}var wa,KR,YI=p(()=>{"use strict";eu();He();md();ri();wa="EXT_mesh_features",KR=wa});var Wg={};J(Wg,{createExtStructuralMetadata:()=>Sk,decode:()=>nk,encode:()=>sk,name:()=>rk});async function nk(r,e,t){let n=new ie(r),s=n.getExtension(fo);if(e.gltf?.loadBuffers&&s?.schemaUri&&!s.schema){if(!t?.fetch)throw new Error("EXT_structural_metadata: a loader context is required to load schemaUri");let i=Kn(s.schemaUri,e,t),o=await t.fetch(i);if(!o.ok)throw new Error(`EXT_structural_metadata: failed to load schemaUri ${i} (${o.status})`);s.schema=await o.json()}ik(n,e)}function sk(r,e){let t=new bn(r);return vk(t,e),t.createBinaryChunk(),t.gltf}function ik(r,e){if(!e.gltf?.loadBuffers)return;let t=r.getExtension(fo);t&&(e.gltf?.loadImages&&ok(r,t),ak(r,t))}function ok(r,e){let t=e.propertyTextures,n=r.data;if(t&&n.meshes)for(let s of n.meshes)for(let i of s.primitives)ck(r,t,i,e)}function ak(r,e){let t=e.schema;if(!t)return;let n=t.classes,s=e.propertyTables;if(n&&s)for(let i of s)i.class&&n[i.class]&&lk(r,t,i)}function ck(r,e,t,n){if(!e)return;let i=t.extensions?.[fo]?.propertyTextures;if(i)for(let o of i){let a=e[o];uk(r,a,t,n)}}function uk(r,e,t,n){if(!e.properties)return;n.dataAttributeNames||(n.dataAttributeNames=[]);let s=e.class;for(let i in e.properties){let o=`${s}_${i}`,a=e.properties?.[i];if(!a)continue;a.data||(a.data=[]);let c=a.data,u=ya(r,a,t);u!==null&&(hd(r,o,u,c,t),a.data=c,n.dataAttributeNames.push(o))}}function lk(r,e,t){let n=e.classes?.[t.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${t.class}`);let s=t.count;for(let i in n.properties){let o=n.properties[i],a=t.properties?.[i];if(a){let c={},u=fk(r,e,o,s,a,c);a.data=u,c.value!==void 0&&Object.defineProperty(a,"rawData",{value:c.value,configurable:!0,enumerable:!1,writable:!0})}}}function fk(r,e,t,n,s,i){let o=[],a=s.values,c=r.getTypedArrayForBufferView(a),u=hk(r,t,s,n),l=pk(r,t,s,n,u);switch(t.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{let f=mk(t,s,n,c,u);o=f.data,i&&(i.value=f.rawData);break}case"BOOLEAN":{o=dk(t,n,c,u);break}case"STRING":{o=pd(n,c,u,l,t.array?t.count:void 0);break}case"ENUM":{o=wk(e,t,n,c,u);break}default:throw new Error(`Unknown classProperty type ${t.type}`)}return o}function dk(r,e,t,n){return r.array?n?Array.from({length:e},(s,i)=>{let o=Number(n[i]),a=Number(n[i+1]);if(!Number.isInteger(o)||!Number.isInteger(a)||o<0||a<o)throw new Error("EXT_structural_metadata: invalid BOOLEAN array offsets");return jg(t,o,a-o)}):r.count===void 0?[]:Array.from({length:e},(s,i)=>jg(t,i*r.count,r.count)):jg(t,0,e)}function jg(r,e,t){if(e+t>r.byteLength*8)throw new Error("EXT_structural_metadata: BOOLEAN values exceed their buffer view");return Array.from({length:t},(n,s)=>{let i=e+s;return!!(r[Math.floor(i/8)]&1<<i%8)})}function hk(r,e,t,n){return e.array&&typeof e.count>"u"&&typeof t.arrayOffsets<"u"?ba(r,t.arrayOffsets,t.arrayOffsetType||"UINT32",n):null}function pk(r,e,t,n,s){if(typeof t.stringOffsets<"u"){let i=s?Number(s[n]):n*(e.array&&e.count||1);return ba(r,t.stringOffsets,t.stringOffsetType||"UINT32",i)}return null}function mk(r,e,t,n,s){let i=r.array,o=r.count,a={VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16}[r.type]||1,c=tu(r.type,r.componentType),u=n.byteLength/c,l;r.componentType?l=ga(n,r.type,r.componentType,u):l=n;let f=l,d=e.offset??r.offset,h=e.scale??r.scale,m=r.normalized||d!==void 0||h!==void 0?bk(f,r.componentType,r.type,r.normalized,d,h):f;return i?s?{data:ru(m,t,s,a),rawData:ru(f,t,s,a)}:o?{data:nu(m,t,o,a),rawData:nu(f,t,o,a)}:{data:[],rawData:[]}:{data:m,rawData:f}}function bk(r,e,t,n,s,i){let o=yk(e),a=!!(n&&o!==void 0);if(!a&&s===void 0&&i===void 0)return r;let c=gk(t),u=new Float64Array(r.length);for(let l=0;l<r.length;l++){let f=Number(r[l]);a&&(f=e?.startsWith("INT")?Math.max(f/o,-1):f/o);let d=l%c,h=Array.isArray(s)?s[d]??0:s??0,m=Array.isArray(i)?i[d]??1:i??1;u[l]=f*m+h}return u}function gk(r){switch(r){case"VEC2":return 2;case"VEC3":return 3;case"VEC4":return 4;case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16;default:return 1}}function yk(r){switch(r){case"INT8":return 127;case"UINT8":return 255;case"INT16":return 32767;case"UINT16":return 65535;case"INT32":return 2147483647;case"UINT32":return 4294967295;case"INT64":return 2**63-1;case"UINT64":return 2**64-1;default:return}}function wk(r,e,t,n,s){let i=e.enumType;if(!i)throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");let o=r.enums?.[i];if(!o)throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${i}`);let a=o.valueType||"UINT16",c=tu(e.type,a),u=n.byteLength/c,l=ga(n,e.type,a,u);if(l||(l=n),e.array){if(s)return xk({valuesData:l,numberOfElements:t,arrayOffsets:s,enumEntry:o});let f=e.count;return f?Tk(l,t,f,o):[]}return zg(l,0,t,o)}function xk(r){let{valuesData:e,numberOfElements:t,arrayOffsets:n,enumEntry:s}=r,i=[];for(let o=0;o<t;o++){let a=Number(n[o]),c=Number(n[o+1])-a;if(!Number.isInteger(a)||!Number.isInteger(c)||a<0||c<0||a+c>e.length)break;let u=zg(e,a,c,s);i.push(u)}return i}function Tk(r,e,t,n){let s=[];for(let i=0;i<e;i++){let o=t*i,a=zg(r,o,t,n);s.push(a)}return s}function zg(r,e,t,n){let s=[];for(let i=0;i<t;i++){let o=r[e+i],a=_k(n,o);a?s.push(a.name):s.push("")}return s}function _k(r,e){for(let t of r.values)if(typeof e=="bigint"?Number.isSafeInteger(t.value)&&BigInt(t.value)===e:t.value===e)return t;return null}function vk(r,e){let t=r.getExtension(fo);if(t&&t.propertyTables)for(let n of t.propertyTables){let s=n.class,i=t.schema?.classes?.[s];n.properties&&i&&Ik(n,i,r)}}function Ik(r,e,t){for(let n in r.properties){let s=r.properties[n].data;if(s){let i=e.properties[n];if(i){let o=Bk(s,i,t);r.properties[n]=o}}}}function Sk(r,e,t=Ak){let n=r.getExtension(fo);n||(n=r.addExtension(fo)),n.schema=Ek(e,t,n.schema);let s=Lk(e,t,n.schema);return n.propertyTables||(n.propertyTables=[]),n.propertyTables.push(s)-1}function Ek(r,e,t){let n=t??{id:"schema_id"},s={properties:{}};for(let i of r){let o={type:i.elementType,componentType:i.componentType};s.properties[i.name]=o}return n.classes={},n.classes[e]=s,n}function Lk(r,e,t){let n={class:e,count:0},s=0,i=t.classes?.[e];for(let o of r){if(s===0&&(s=o.values.length),s!==o.values.length&&o.values.length)throw new Error("Illegal values in attributes");i?.properties[o.name]&&(n.properties||(n.properties={}),n.properties[o.name]={values:0,data:o.values})}return n.count=s,n}function Bk(r,e,t){let n={values:0};if(e.type==="STRING"){let{stringData:s,stringOffsets:i}=Mk(r);n.stringOffsets=Gg(i,t),n.values=Gg(s,t)}else if(e.type==="SCALAR"&&e.componentType){let s=Ok(r,e.componentType);n.values=Gg(s,t)}return n}function Ok(r,e){let t=[];for(let s of r)t.push(Number(s));let n=Fk[e];if(!n)throw new Error("Illegal component type");return new n(t)}function Mk(r){let e=new TextEncoder,t=[],n=0;for(let c of r){let u=e.encode(c);n+=u.length,t.push(u)}let s=new Uint8Array(n),i=[],o=0;for(let c of t)s.set(c,o),i.push(o),o+=c.length;i.push(o);let a=new Uint32Array(i);return{stringData:s,stringOffsets:a}}function Gg(r,e){return e.addBufferView(r)}var fo,rk,Ak,Fk,QI=p(()=>{"use strict";eu();He();md();Yc();fo="EXT_structural_metadata",rk=fo;Ak="schemaClassId";Fk={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:Int32Array,UINT64:Uint32Array,FLOAT32:Float32Array,FLOAT64:Float64Array}});var qg={};J(qg,{SPZ_COMPRESSION_EXTENSION_NAME:()=>su,decode:()=>Rk,getGaussianSplatPrimitives:()=>ZI,name:()=>$g});async function Rk(r,e,t){let n=t?.loaders?.find(o=>o.extensions?.includes("spz")),s=ZI(r),i=new ie(r);for(let[o,a]of(r.json.meshes||[]).entries())for(let[c,u]of a.primitives.entries()){let l=u.extensions?.[$g];if(!l)continue;let f=s.find(b=>b.meshIndex===o&&b.primitiveIndex===c),d=e?.gltf?.legacyGaussianSplatColorSpace,h=d&&l.extensions?.[su]?{...l,kernel:l.kernel??"ellipse",colorSpace:l.colorSpace??d}:l;f&&(f.extension=h),Nk(r.json,u,h,o,c,i);let m=l.extensions?.[su];if(m&&f){let b=e?.gltf?.splatDecoder,g=r.json.bufferViews?.[m.bufferView];if(g&&r.buffers[g.buffer])f.compressedBytes=kk(r,m.bufferView);else if(b||n)throw new Error(`KHR_gaussian_splatting: bufferView ${m.bufferView} is not loaded for SPZ2 decoding.`);n&&t&&f.compressedBytes?f.decoded=await Xs(f.compressedBytes.buffer,n,{...e,splats:{...e.splats,sourceCoordinateSystem:"LUF"}},t):b&&f.compressedBytes&&(f.decoded=await b(f.compressedBytes.buffer,{sourceCoordinateSystem:"LUF"}))}}s.length&&(r.gaussianSplatPrimitives=s)}function kk(r,e){let t=r.json.bufferViews?.[e];if(!t)throw new Error(`KHR_gaussian_splatting: bufferView ${e} is not defined.`);let n=r.buffers[t.buffer];if(!n)throw new Error(`KHR_gaussian_splatting: buffer ${t.buffer} is not loaded for SPZ2 payload.`);let s=n.byteOffset+(t.byteOffset||0);return new Uint8Array(n.arrayBuffer,s,t.byteLength).slice()}function ZI(r){let e="json"in r?r.json:r,t=[];for(let[n,s]of(e.meshes||[]).entries())for(let[i,o]of s.primitives.entries()){let a=o.extensions?.[$g];if(!a)continue;let c=a.extensions?.[su]?.bufferView;t.push({meshIndex:n,primitiveIndex:i,attributes:{...o.attributes},extension:a,compressedBufferView:c})}return t}function Nk(r,e,t,n,s,i){if((e.mode??4)!==0)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} must use POINTS mode.`);if(typeof t.kernel!="string"||t.kernel.length===0)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} is missing kernel.`);if(typeof t.colorSpace!="string"||t.colorSpace.length===0)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} is missing colorSpace.`);let o=t.extensions?.[su]?.bufferView;if(o!==void 0){if(!Number.isInteger(o)||o<0||o>=(r.bufferViews||[]).length)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} has an invalid SPZ bufferView.`)}else for(let a of Dk)if(e.attributes[a]===void 0)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} is missing ${a}.`);for(let[a,c]of Object.entries(e.attributes))if(!Number.isInteger(c)||c<0||c>=(r.accessors||[]).length)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} has invalid accessor ${a}.`);Ck(r,e,i,n,s);for(let a=1;a<=3;a++){let c=a*2+1,u=Array.from({length:c},(l,f)=>e.attributes[`KHR_gaussian_splatting:SH_DEGREE_${a}_COEF_${f}`]!==void 0);if(u.some(Boolean)&&!u.every(Boolean))throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} has incomplete SH degree ${a}.`);if(u.some(Boolean)&&a>1){let l=a-1,f=l*2+1;for(let d=0;d<f;d++)if(e.attributes[`KHR_gaussian_splatting:SH_DEGREE_${l}_COEF_${d}`]===void 0)throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} skips SH degree ${l}.`)}}}function Ck(r,e,t,n,s){let i=e.attributes["KHR_gaussian_splatting:SCALE"],o=e.attributes["KHR_gaussian_splatting:OPACITY"];for(let[a,c,u]of[["KHR_gaussian_splatting:SCALE",i,l=>l>=0],["KHR_gaussian_splatting:OPACITY",o,l=>l>=0&&l<=1]]){if(c===void 0||!Uk(r,t,c))continue;let l=t.getTypedArrayForAccessor(c);for(let f=0;f<l.length;f++)if(!u(Number(l[f])))throw new Error(`KHR_gaussian_splatting: mesh ${n} primitive ${s} has an invalid ${a} value.`)}}function Uk(r,e,t){let n=r.accessors?.[t],s=n?.bufferView===void 0?void 0:r.bufferViews?.[n.bufferView];return!!(s&&e.gltf.buffers[s.buffer])}var $g,su,Dk,eS=p(()=>{"use strict";Ue();He();$g="KHR_gaussian_splatting",su="KHR_gaussian_splatting_compression_spz_2",Dk=["POSITION","KHR_gaussian_splatting:ROTATION","KHR_gaussian_splatting:SCALE","KHR_gaussian_splatting:OPACITY","KHR_gaussian_splatting:SH_DEGREE_0_COEF_0"]});var Xg={};J(Xg,{decode:()=>Pk,getVoxelPrimitives:()=>Vk,name:()=>Kg});async function Pk(r){for(let[e,t]of(r.json.meshes||[]).entries())for(let[n,s]of t.primitives.entries()){let i=s.extensions?.[Kg];i&&jk(r.json,s,i,e,n)}}function Vk(r){let e="json"in r?r.json:r,t=[];for(let[n,s]of(e.meshes||[]).entries())for(let[i,o]of s.primitives.entries()){let a=o.extensions?.[Kg];a&&t.push({meshIndex:n,primitiveIndex:i,attributes:{...o.attributes},extension:a})}return t}function jk(r,e,t,n,s){if(!Number.isInteger(t.shape)||t.shape<0)throw new Error(`EXT_primitive_voxels: mesh ${n} primitive ${s} has invalid shape.`);if(!Array.isArray(t.dimensions)||t.dimensions.length!==3||t.dimensions.some(i=>!Number.isInteger(i)||i<=0))throw new Error(`EXT_primitive_voxels: mesh ${n} primitive ${s} must provide three positive dimensions.`);if(e.mode!==void 0&&e.mode!==2147483647)throw new Error(`EXT_primitive_voxels: mesh ${n} primitive ${s} must use voxel mode.`);for(let i of Object.keys(e.attributes)){let o=e.attributes[i];if(!Number.isInteger(o)||o<0||o>=(r.accessors||[]).length)throw new Error(`EXT_primitive_voxels: mesh ${n} primitive ${s} has invalid accessor ${i}.`)}}var Kg,tS=p(()=>{"use strict";Kg="EXT_primitive_voxels"});var Hg={};J(Hg,{decode:()=>zk,getPrimitiveRestartRanges:()=>bd,name:()=>si});async function zk(r,e){if(!r.json.extensionsUsed?.includes(si))return;if(!r.json.extensionsRequired?.includes(si))throw new Error(`${si} must be declared in extensionsRequired`);if(!e.gltf?.loadBuffers)return;let t=new ie(r);for(let n of t.meshes)for(let s of t.getReferences(n).primitives)Wk(t,s)}function Wk(r,e){if(e.indices===void 0)return;let t=e.indices,n=typeof t=="number"?r.data.accessors?.[t]:t;if(!n)throw new Error(`${si}: primitive references missing indices accessor ${e.indices}`);let s=$k(n),i=r.getTypedArrayForAccessor(e.indices),o=Array.prototype.includes.call(i,s);if(!Gk.has(e.mode??4)){if(o)throw new Error(`${si}: primitive restart is not valid for mode ${e.mode??4}`);return}Object.defineProperty(e,"primitiveRestart",{configurable:!0,enumerable:!1,writable:!0,value:{restartIndex:s,ranges:bd(i,s)}})}function $k(r){if(r.type!=="SCALAR")throw new Error(`${si}: indices accessor must have SCALAR type`);switch(r.componentType){case 5121:return 255;case 5123:return 65535;case 5125:return 4294967295;default:throw new Error(`${si}: indices accessor must use an unsigned integer component type`)}}function bd(r,e){let t=[],n=0;for(let s=0;s<=r.length;s++)(s===r.length||r[s]===e)&&(s>n&&t.push({offset:n,count:s-n}),n=s+1);return t}var si,Gk,Jg=p(()=>{"use strict";He();si="KHR_mesh_primitive_restart",Gk=new Set([2,3,5,6])});var Yg={};J(Yg,{decode:()=>qk,name:()=>qt});async function qk(r,e){if(!e.gltf?.loadBuffers)return;let t=new ie(r);for(let n of t.meshes)for(let s of t.getReferences(n).primitives){let i=t.getExtension(s,qt);i&&Object.defineProperty(i,"data",{configurable:!0,enumerable:!1,writable:!0,value:Kk(t,s,i)})}}function Kk(r,e,t){if(!Number.isInteger(t.count)||t.count<1)throw new Error(`${qt}: count must be a positive integer`);if((e.mode??4)!==4||e.indices===void 0)throw new Error(`${qt}: primitive must use TRIANGLES mode with indices`);let n=gd(r,e.indices,"indices"),s=gd(r,t.indicesOffsets,"indicesOffsets",t.count),i=gd(r,t.loopIndices,"loopIndices"),o=gd(r,t.loopIndicesOffsets,"loopIndicesOffsets",t.count),a=r.data.accessors?.[t.loopIndices],c=Xk(a.componentType);rS(s,n.length,"indicesOffsets"),rS(o,i.length,"loopIndicesOffsets");let u=[];for(let l=0;l<t.count;l++){let f=Number(s[l]),d=l+1<t.count?Number(s[l+1]):n.length,h=Number(o[l]),m=l+1<t.count?Number(o[l+1]):i.length,b=Array.from(i).slice(h,m),g=bd(b,c).map(y=>({offset:y.offset+h,count:y.count}));if((d-f)%3!==0)throw new Error(`${qt}: polygon ${l} triangle range must contain complete triangles`);if(g.length===0)throw new Error(`${qt}: polygon ${l} must contain at least one loop`);if(g.some(y=>y.count<3))throw new Error(`${qt}: polygon ${l} loops must contain at least three indices`);u.push({triangleRange:{offset:f,count:d-f},loopRanges:g})}return{indicesOffsets:s,loopIndices:i,loopIndicesOffsets:o,polygons:u}}function gd(r,e,t,n){if(typeof e=="number"&&(!Number.isInteger(e)||e<0))throw new Error(`${qt}: ${t} must reference an accessor`);let s=typeof e=="number"?r.data.accessors?.[e]:e;if(!s)throw new Error(`${qt}: ${t} references missing accessor ${e}`);if(s.type!=="SCALAR"||![5121,5123,5125].includes(s.componentType))throw new Error(`${qt}: ${t} must be an unsigned integer SCALAR accessor`);if(n!==void 0&&s.count!==n)throw new Error(`${qt}: ${t} count must equal polygon count ${n}`);return r.getTypedArrayForAccessor(e)}function rS(r,e,t){if(Number(r[0])!==0)throw new Error(`${qt}: ${t} must begin at zero`);let n=-1;for(let s=0;s<r.length;s++){let i=Number(r[s]);if(!Number.isInteger(i)||i<0||i>=e||i<=n)throw new Error(`${qt}: ${t} must contain increasing in-bounds offsets`);n=i}}function Xk(r){switch(r){case 5121:return 255;case 5123:return 65535;case 5125:return 4294967295;default:throw new Error(`${qt}: unsupported loop index component type ${r}`)}}var qt,nS=p(()=>{"use strict";He();Jg();qt="EXT_mesh_polygon"});var Qg={};J(Qg,{decode:()=>Hk,getSpatialAudio:()=>sS,name:()=>xa});function sS(r){let e="asset"in r?r:r.json,t=[],n=e.extensions?.[xa];n&&t.push({nodeIndex:null,extension:n});for(let[s,i]of(e.nodes||[]).entries()){let o=i.extensions?.[xa];o&&t.push({nodeIndex:s,extension:o})}return t}async function Hk(r){let e=sS(r);for(let{extension:t,nodeIndex:n}of e){let s=n===null?"root":`node ${n}`;for(let i of t.sources||[]){if(!Array.isArray(i.accessors)||i.accessors.length===0)throw new Error(`${xa}: ${s} source ${i.id} requires audio accessors.`);for(let o of i.accessors)if(!Number.isInteger(o)||o<0||!r.json.accessors?.[o])throw new Error(`${xa}: ${s} source ${i.id} has invalid accessor ${o}.`);if(i.reverbFeedGain&&i.reverbFeedGain.length!==(i.reverbFeed?.length||0))throw new Error(`${xa}: ${s} source ${i.id} has mismatched reverb feed gains.`)}}e.length&&(r.spatialAudio=e)}var xa,iS=p(()=>{"use strict";xa="MPEG_audio_spatial"});var Zg={};J(Zg,{decode:()=>Jk,name:()=>Kt});async function Jk(r,e,t){let n=r.json.extensions?.[Kt],s=(n?.audio||[]).map(c=>({audio:c})),i=n?.sources||[],o=n?.emitters||[];for(let c of i)c.audio!==void 0&&yd(s,c.audio,"audio");for(let c of o){if(c.type!=="global"&&c.type!=="positional")throw new Error(`${Kt}: invalid emitter type ${c.type}.`);if(c.type==="global"&&c.positional!==void 0)throw new Error(`${Kt}: global emitters cannot have positional settings.`);for(let u of c.sources||[])yd(i,u,"source")}let a=[];for(let c of["nodes","scenes"])for(let[u,l]of(r.json[c]||[]).entries()){let f=l.extensions?.[Kt];if(f){if(!Array.isArray(f.emitters)||!f.emitters.length)throw new Error(`${Kt}: ${c} ${u} requires emitters.`);for(let d of f.emitters){let h=yd(o,d,"emitter");if(c==="scenes"&&h.type!=="global")throw new Error(`${Kt}: scenes may only reference global emitters.`);a.push({emitterIndex:d,nodeIndex:c==="nodes"?u:null,sceneIndex:c==="scenes"?u:null,emitter:h,sources:(h.sources||[]).map(m=>{let b=i[m];return{sourceIndex:m,source:b,clip:b.audio===void 0?void 0:s[b.audio]}})})}}}if(n){for(let c of s)Yk(r,c);e.gltf?.loadAudio!==!1&&await Promise.all(s.map(c=>Qk(r,c,e,t))),r.audioClips=s,r.audioEmitters=a}}function yd(r,e,t){if(!Number.isInteger(e)||e<0||!r[e])throw new Error(`${Kt}: invalid ${t} index ${e}.`);return r[e]}function Yk(r,e){let{audio:t}=e;if(t.bufferView!==void 0){if(yd(r.json.bufferViews||[],t.bufferView,"bufferView"),!t.mimeType)throw new Error(`${Kt}: buffer-view audio requires mimeType.`)}else if(!t.uri)throw new Error(`${Kt}: audio requires a uri or bufferView.`)}async function Qk(r,e,t,n){let{audio:s}=e;if(s.bufferView!==void 0){let a=r.json.bufferViews[s.bufferView],c=r.buffers[a.buffer];if(!c){if(t.gltf?.loadBuffers===!1)return;throw new Error(`${Kt}: audio buffer ${a.buffer} is not loaded.`)}let u=a.byteOffset??0,l=a.byteLength;if(!Number.isSafeInteger(u)||u<0||!Number.isSafeInteger(l)||l<0||u+l>c.byteLength||c.byteOffset+u+l>c.arrayBuffer.byteLength)throw new Error(`${Kt}: audio bufferView exceeds its buffer.`);e.data=new Uint8Array(c.arrayBuffer,c.byteOffset+u,l);return}if(!n?.fetch)throw new Error(`${Kt}: a loader context is required to load audio.`);let i=Kn(s.uri,t,n),o=await n.fetch(i);if(!o.ok)throw new Error(`${Kt}: failed to load audio ${i} (${o.status}).`);e.url=i,e.data=new Uint8Array(await o.arrayBuffer())}var Kt,oS=p(()=>{"use strict";Yc();Kt="KHR_audio_emitter"});var aS={};J(aS,{MeshoptDecoder:()=>Zk});var Zk,cS=p(()=>{"use strict";Zk=(function(){var r="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuixkbeeeddddillviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WboY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbrl79IV9Rbwq;X8:kdbk:kYi5ud9:du8Jjjjjbcjq9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaicefhxcj;abad9Uc;WFbGcjdadca0EhmaialfgPar9Rgoadfhsavaoadz:jjjjbgzceVhHcbhOdndninaeaO9nmeaPax9RaD6mdamaeaO9RaOamfgoae6EgAcsfglc9WGhCaAcethXaxaDfhiaOaeaoaeao6E9RhQalcl4cifcd4hLazcjdfaAfhKcbhYabaOad2fg8AhEaHh3incbh5dnawTmbaxaYcd4fRbbh5kcbh8Eazcjdfhqinaih8Fdndndndna5a8Ecet4ciGgoc9:fPdebdkaPa8F9RaA6mrazcjdfa8EaA2fa8FaAz:jjjjb8Aa8FaAfhixdkazcjdfa8EaA2fcbaAz:kjjjb8Aa8FhixekaPa8F9RaL6mva8FaLfhidnaCTmbaPai9RcK6mbaocdtc:q:G:cjbfcj:G:cjbawEhaczhrcbhlinargoc9Wfghaqfhrdndndndndndnaaa8Fahco4fRbbalcoG4ciGcdtfydbPDbedvivvvlvkar9cb83bwar9cb83bbxlkarcbaiRbdai8Xbb9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbaqaofgrcGfcbaicdfa8J9c8N1:NfghRbbag9cjjjjjw:dg8J9qE86bbarcVfcbaha8J9c8M1:NfghRbbag9cjjjjjl:dg8J9qE86bbarc7fcbaha8J9c8L1:NfghRbbag9cjjjjjd:dg8J9qE86bbarctfcbaha8J9c8K1:NfghRbbag9cjjjjje:dg8J9qE86bbarc91fcbaha8J9c8J1:NfghRbbag9cjjjj;ab:dg8J9qE86bbarc4fcbaha8J9cg1:NfghRbbag9cjjjja:dg8J9qE86bbarc93fcbaha8J9ch1:NfghRbbag9cjjjjz:dgg9qE86bbarc94fcbahag9ca1:NfghRbbai8Xbe9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbarc95fcbaha8J9c8N1:NfgiRbbag9cjjjjjw:dg8J9qE86bbarc96fcbaia8J9c8M1:NfgiRbbag9cjjjjjl:dg8J9qE86bbarc97fcbaia8J9c8L1:NfgiRbbag9cjjjjjd:dg8J9qE86bbarc98fcbaia8J9c8K1:NfgiRbbag9cjjjjje:dg8J9qE86bbarc99fcbaia8J9c8J1:NfgiRbbag9cjjjj;ab:dg8J9qE86bbarc9:fcbaia8J9cg1:NfgiRbbag9cjjjja:dg8J9qE86bbarcufcbaia8J9ch1:NfgiRbbag9cjjjjz:dgg9qE86bbaiag9ca1:NfhixikaraiRblaiRbbghco4g8Ka8KciSg8KE86bbaqaofgrcGfaiclfa8Kfg8KRbbahcl4ciGg8La8LciSg8LE86bbarcVfa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc7fa8Ka8Lfg8KRbbahciGghahciSghE86bbarctfa8Kahfg8KRbbaiRbeghco4g8La8LciSg8LE86bbarc91fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc4fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc93fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc94fa8Kahfg8KRbbaiRbdghco4g8La8LciSg8LE86bbarc95fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc96fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc97fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc98fa8KahfghRbbaiRbigico4g8Ka8KciSg8KE86bbarc99faha8KfghRbbaicl4ciGg8Ka8KciSg8KE86bbarc9:faha8KfghRbbaicd4ciGg8Ka8KciSg8KE86bbarcufaha8KfgrRbbaiciGgiaiciSgiE86bbaraifhixdkaraiRbwaiRbbghcl4g8Ka8KcsSg8KE86bbaqaofgrcGfaicwfa8Kfg8KRbbahcsGghahcsSghE86bbarcVfa8KahfghRbbaiRbeg8Kcl4g8La8LcsSg8LE86bbarc7faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarctfaha8KfghRbbaiRbdg8Kcl4g8La8LcsSg8LE86bbarc91faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc4faha8KfghRbbaiRbig8Kcl4g8La8LcsSg8LE86bbarc93faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc94faha8KfghRbbaiRblg8Kcl4g8La8LcsSg8LE86bbarc95faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc96faha8KfghRbbaiRbvg8Kcl4g8La8LcsSg8LE86bbarc97faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc98faha8KfghRbbaiRbog8Kcl4g8La8LcsSg8LE86bbarc99faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc9:faha8KfghRbbaiRbrgicl4g8Ka8KcsSg8KE86bbarcufaha8KfgrRbbaicsGgiaicsSgiE86bbaraifhixekarai8Pbw83bwarai8Pbb83bbaiczfhikdnaoaC9pmbalcdfhlaoczfhraPai9RcL0mekkaoaC6moaimexokaCmva8FTmvkaqaAfhqa8Ecefg8Ecl9hmbkdndndndnawTmbasaYcd4fRbbgociGPlbedrbkaATmdazaYfh8Fazcjdfhhcbh8EaEhaina8FRbbhraahocbhlinaoahalfRbbgqce4cbaqceG9R7arfgr86bbaoadfhoaAalcefgl9hmbkaacefhaa8Fcefh8FahaAfhha8Ecefg8Ecl9hmbxikkaATmeazaYfhaazcjdfhhcbhoceh8EaKh8FinaEaofhlaa8Vbbhrcbhoinala8FaofRbbcwtahaofRbbgqVc;:FiGce4cbaqceG9R7arfgr87bbaladfhlaQaocefgofmbka8FaXfh8FcdhoaacdfhaahaXfhha8EceGhlcbh8EalmbxdkkaATmbaocl4h8EazaYfRbbhqcwhoa3hlinalRbbaotaqVhqalcefhlaocwfgoca9hmbkcbhhaEh8FaKhainazcjdfahfRbbhrcwhoaahlinalRbbaotarVhralaAfhlaocwfgoca9hmbkara8E94aq7hqcbhoa8Fhlinalaqao486bbalcefhlaocwfgoca9hmbka8Fadfh8FaacefhaahcefghaA9hmbkkaEclfhEa3clfh3aYclfgYad6mbkaza8AaAcufad2fadz:jjjjb8AaAaOfhOaihxaimbkc9:hoxdkcbc99aPax9RakSEhoxekc9:hokavcjqf8Kjjjjbaok:bsesu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecjez:kjjjb8Aav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhDaicefgiarfhqdndnaeci9pmbaqhexekcmcsawceSEhkcbhxcbhmaqhecbhlcbhoindndnaiRbbgrc;Ve0mbavc;abfaoarcu7gPcl4fcsGcitfgwydlhsawydbhzdndnarcsGgwak9pmbavalaPfcsGcdtfydbaxawEhraxawTgHfhxxekdnaeaD9nmbc9:hoxokdndnawcsSmbcehHamawcetfcWfhrxekaecefhrae8SbbgwcFeGhPdndnawcu9mmbarhexekaecvfheaPcFbGhPcrhwdninar8SbbgHcFbGawtaPVhPaHcu9kmearcefhrawcrfgwc8J9hmbxdkkarcefhekcehHaPce4cbaPceG9R7amfhrkarhmkavc;abfaocitfgwarBdbawasBdlavalcdtfarBdbavc;abfaocefcsGcitfgwazBdbawarBdlaocdfhoaHalfhldnadcd9hmbabar87elabas87edabaz87ebabcofhbxdkabarBdwabasBdlabazBdbabcxfhbxekdnarcpe0mbavalaDarcsGfRbbgwcl4gP9RcsGcdtfydbaxcefgsaPEhravalaw9RcsGcdtfydbasaPTgzfgsawcsGgPEhwaPThPdndnadcd9hmbabaw87elabar87edabax87ebcohHxekabawBdwabarBdlabaxBdbcxhHkavalcdtfaxBdbavc;abfaocitfgOarBdbaOaxBdlavalcefglcsGcdtfarBdbavc;abfaocefcsGcitfgOawBdbaOarBdlavalazfglcsGcdtfawBdbavc;abfaocdfcsGcitfgraxBdbarawBdlaocifhoabaHfhbalaPfhlasaPfhxxekdnaeaD9nmbc9:hoxlkaxcbaeRbbgwEgHarc;:eSgrfhsawcsGhOdndnawcl4gAmbascefhzxekashzavalaA9RcsGcdtfydbhskdndnaOmbazcefhxxekazhxavalaw9RcsGcdtfydbhzkdndnarTmbaecefhrxekaecdfhrae8SbegPcFeGhwdnaPcu9kmbaecofhHawcFbGhwcrhedninar8SbbgPcFbGaetawVhwaPcu9kmearcefhraecrfgec8J9hmbkaHhrxekarcefhrkawce4cbawceG9R7amfgmhHkdndnaAcsSmbarhwxekarcefhwar8SbbgecFeGhPdnaecu9kmbarcvfhsaPcFbGhPcrhedninaw8SbbgrcFbGaetaPVhParcu9kmeawcefhwaecrfgec8J9hmbkashwxekawcefhwkaPce4cbaPceG9R7amfgmhskdndnaOcsSmbawhexekawcefheaw8SbbgrcFeGhPdnarcu9kmbawcvfhzaPcFbGhPcrhrdninae8SbbgwcFbGartaPVhPawcu9kmeaecefhearcrfgrc8J9hmbkazhexekaecefhekaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabaz87elabas87edabaH87ebcohrxekabazBdwabasBdlabaHBdbcxhrkavc;abfaocitfgwasBdbawaHBdlavalcdtfaHBdbavc;abfaocefcsGcitfgwazBdbawasBdlavalcefglcsGcdtfasBdbavc;abfaocdfcsGcitfgwaHBdbawazBdlavalaATaAcsSVfglcsGcdtfazBdbalaOTaOcsSVfhlaocifhoabarfhbkaocsGhoalcsGhlaicefgiaq6mbkkcbc99aeaDSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk:4ioiue99dud99dud99dnaeTmbcbhiabhlindndnal8Uebgv:YgoJ:ji:1Salcof8UebgrciVgw:Y:vgDNJbbbZJbbb:;avcu9kEMgq:lJbbb9p9DTmbaq:Ohkxekcjjjj94hkkalclf8Uebhvalcdf8UebhxalarcefciGcetfak87ebdndnax:YgqaDNJbbbZJbbb:;axcu9kEMgm:lJbbb9p9DTmbam:Ohxxekcjjjj94hxkabaiarciGgkfcd7cetfax87ebdndnav:YgmaDNJbbbZJbbb:;avcu9kEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkalarcufciGcetfav87ebdndnawaw2:ZgPaPMaoaoN:taqaqN:tamamN:tgoJbbbbaoJbbbb9GE:raDNJbbbZMgD:lJbbb9p9DTmbaD:Ohrxekcjjjj94hrkalakcetfar87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk:Tvirud99eudndnadcl9hmbaeTmeindndnabRbbgiabcefgl8Sbbgvabcdfgo8Sbbgrf9R:YJbbuJabcifgwRbbgdce4adVgDcd4aDVgDcl4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax86bbdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao86bbdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai86bbdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad86bbabclfhbaecufgembxdkkaeTmbindndnab8Vebgiabcdfgl8Uebgvabclfgo8Uebgrf9R:YJbFu9habcofgw8Vebgdce4adVgDcd4aDVgDcl4aDVgDcw4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax87ebdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao87ebdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai87ebdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad87ebabcwfhbaecufgembkkk9teiucbcbyd:K:G:cjbgeabcifc98GfgbBd:K:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkk83dbcj:Gdk8Kbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbc:K:Gdkl8W:qbb",e="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuixkbbebeeddddilve9Weeeviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WbwY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbDl79IV9Rbqq:I9Dklbzik94evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaeai86b:q:W:cjbaecitab8Piw83i:q:G:cjbaecefgecjd9hmbkk:SBlEud97dur978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaialfgxar9RhodnadTgmmbavaoad;8qbbkaicefhPcj;abad9Uc;WFbGcjdadca0EhsdndndnadTmbaoadfhzcbhHinaeaH9nmdaxaP9RaD6miabaHad2fgOavcjdfasaeaH9RaHasfae6EgAaAcsfgoc9WGgCSEhXaPaDfhQaocl4cifcd4hLavcj;cbfaCcetfhKavcj;cbfaCci2fhYavcj;cbfaCfh8AcbhEaoc;ab6h3incbh5dnawTmbaPaEcd4fRbbh5kcbh8Eavcj;cbfh8Findndndndna5a8Ecet4ciGgoc9:fPdebdkaxaQ9RaC6mwdnaCTmbavcj;cbfa8EaC2faQaC;8qbbkaQaAfhQxdkaCTmeavcj;cbfa8EaC2fcbaC;8kbxekaxaQ9RaL6moaoclVcbawEhraQaLfhocbhidna3mbaxao9Rc;Gb6mbcbhlina8FalfhidndndndndndnaQalco4fRbbgqciGarfPDbedibledibkaipxbbbbbbbbbbbbbbbbpklbxlkaiaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiaopbbbpklbaoczfhoxekaiaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcd4ciGarfPDbedibledibkaiczfpxbbbbbbbbbbbbbbbbpklbxlkaiczfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiczfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiczfaopbbbpklbaoczfhoxekaiczfaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcl4ciGarfPDbedibledibkaicafpxbbbbbbbbbbbbbbbbpklbxlkaicafaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaicafaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaicafaopbbbpklbaoczfhoxekaicafaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqco4arfPDbedibledibkaic8Wfpxbbbbbbbbbbbbbbbbpklbxlkaic8Wfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaoclffaqRb:q:W:cjbfhoxikaic8Wfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaocwffaqRb:q:W:cjbfhoxdkaic8Wfaopbbbpklbaoczfhoxekaic8WfaopbbdaoRbbgicitpbi:q:G:cjbaiRb:q:W:cjbgipsaoRbegqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbaiaocdffaqRb:q:W:cjbfhokalc;abfhialcjefaC0meaihlaxao9Rc;Fb0mbkkdnaiaC9pmbaici4hlinaxao9RcK6mwa8FaifhqdndndndndndnaQaico4fRbbalcoG4ciGarfPDbedibledibkaqpxbbbbbbbbbbbbbbbbpkbbxlkaqaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spkbbagaoclffa8JRb:q:W:cjbfhoxikaqaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spkbbagaocwffa8JRb:q:W:cjbfhoxdkaqaopbbbpkbbaoczfhoxekaqaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpkbbagaocdffa8JRb:q:W:cjbfhokalcdfhlaiczfgiaC6mbkkaohQaoTmoka8FaCfh8Fa8Ecefg8Ecl9hmbkdndndndnawTmbazaEcd4fRbbglciGPlbedwbkaCTmdaXaEfhlavaEfpbdbh8Kcbhoinalavcj;cbfaofpblbg8La8Aaofpblbg8MpmbzeHdOiAlCvXoQrLg8NaKaofpblbgyaYaofpblbg8PpmbzeHdOiAlCvXoQrLgIpmbezHdiOAlvCXorQLgacep9Taapxeeeeeeeeeeeeeeeeghp9op9Hp9rgaa8Kp9Ug8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp9Ug8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp9Ug8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9Abbbaladfgla8Ka8NaIpmwDKYqk8AExm35Ps8E8Fgacep9Taaahp9op9Hp9rgap9Ug8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp9Ug8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp9Ug8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9Abbbaladfgla8Ka8La8MpmwKDYq8AkEx3m5P8Es8Fg8Laya8PpmwKDYq8AkEx3m5P8Es8Fg8MpmbezHdiOAlvCXorQLgacep9Taaahp9op9Hp9rgap9Ug8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp9Ug8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp9Ug8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9Abbbaladfgla8Ka8La8MpmwDKYqk8AExm35Ps8E8Fgacep9Taaahp9op9Hp9rgap9Ughp9Abbbaladfglahaaaapmlvorlvorlvorlvorp9Ughp9AbbbaladfglahaaaapmwDqkwDqkwDqkwDqkp9Ughp9AbbbaladfglahaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9AbbbaladfhlaoczfgoaC6mbxikkaCTmeaXaEfhlavaEfpbdbh8Kcbhoinalavcj;cbfaofpblbg8La8Aaofpblbg8MpmbzeHdOiAlCvXoQrLg8NaKaofpblbgyaYaofpblbg8PpmbzeHdOiAlCvXoQrLgIpmbezHdiOAlvCXorQLgacep:neaapxebebebebebebebebghp9op:bep9rgaa8Kp:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8NaIpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwKDYq8AkEx3m5P8Es8Fg8Laya8PpmwKDYq8AkEx3m5P8Es8Fg8MpmbezHdiOAlvCXorQLgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeghp9Abbbaladfglahaaaapmlvorlvorlvorlvorp:oeghp9AbbbaladfglahaaaapmwDqkwDqkwDqkwDqkp:oeghp9AbbbaladfglahaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9AbbbaladfhlaoczfgoaC6mbxdkkaCTmbaXaEfhrcbhocbalcl4gl9Rc8FGhiavaEfpbdbhhinaravcj;cbfaofpblbg8Ka8Aaofpblbg8LpmbzeHdOiAlCvXoQrLg8MaKaofpblbg8NaYaofpblbgypmbzeHdOiAlCvXoQrLg8PpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgaahp9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ma8PpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwKDYq8AkEx3m5P8Es8Fg8Ka8NaypmwKDYq8AkEx3m5P8Es8Fg8LpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9AbbbaradfhraoczfgoaC6mbkkaEclfgEad6mbkdnaXavcjdf9hmbaAad2goTmbaOavcjdfao;8qbbkdnammbavaXaAcufad2fad;8qbbkaAaHfhHc9:hoaQhPaQmbxlkkaeTmbaDalfhrcbhocuhlinaralaD9RglfaD6mdasaeao9Raoasfae6Eaofgoae6mbkaial9RhPkcbc99axaP9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaokwbz:bjjjbkpPesu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecje;8kbav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhDaicefgiarfhqdndnaeci9pmbaqhexekcmcsawceSEhkcbhxcbhmaqhecbhlcbhoindndnaiRbbgrc;Ve0mbavc;abfaoarcu7gPcl4fcsGcitfgwydlhsawydbhzdndnarcsGgwak9pmbavalaPfcsGcdtfydbaxawEhraxawTgHfhxxekdnaeaD9nmbc9:hoxokdndnawcsSmbcehHamawcetfcWfhrxekaecefhrae8SbbgwcFeGhPdndnawcu9mmbarhexekaecvfheaPcFbGhPcrhwdninar8SbbgHcFbGawtaPVhPaHcu9kmearcefhrawcrfgwc8J9hmbxdkkarcefhekcehHaPce4cbaPceG9R7amfhrkarhmkavc;abfaocitfgwarBdbawasBdlavalcdtfarBdbavc;abfaocefcsGcitfgwazBdbawarBdlaocdfhoaHalfhldnadcd9hmbabar87elabas87edabaz87ebabcofhbxdkabarBdwabasBdlabazBdbabcxfhbxekdnarcpe0mbavalaDarcsGfRbbgwcl4gP9RcsGcdtfydbaxcefgsaPEhravalaw9RcsGcdtfydbasaPTgzfgsawcsGgPEhwaPThPdndnadcd9hmbabaw87elabar87edabax87ebcohHxekabawBdwabarBdlabaxBdbcxhHkavalcdtfaxBdbavc;abfaocitfgOarBdbaOaxBdlavalcefglcsGcdtfarBdbavc;abfaocefcsGcitfgOawBdbaOarBdlavalazfglcsGcdtfawBdbavc;abfaocdfcsGcitfgraxBdbarawBdlaocifhoabaHfhbalaPfhlasaPfhxxekdnaeaD9nmbc9:hoxlkaxcbaeRbbgwEgHarc;:eSgrfhsawcsGhOdndnawcl4gAmbascefhzxekashzavalaA9RcsGcdtfydbhskdndnaOmbazcefhxxekazhxavalaw9RcsGcdtfydbhzkdndnarTmbaecefhrxekaecdfhrae8SbegPcFeGhwdnaPcu9kmbaecofhHawcFbGhwcrhedninar8SbbgPcFbGaetawVhwaPcu9kmearcefhraecrfgec8J9hmbkaHhrxekarcefhrkawce4cbawceG9R7amfgmhHkdndnaAcsSmbarhwxekarcefhwar8SbbgecFeGhPdnaecu9kmbarcvfhsaPcFbGhPcrhedninaw8SbbgrcFbGaetaPVhParcu9kmeawcefhwaecrfgec8J9hmbkashwxekawcefhwkaPce4cbaPceG9R7amfgmhskdndnaOcsSmbawhexekawcefheaw8SbbgrcFeGhPdnarcu9kmbawcvfhzaPcFbGhPcrhrdninae8SbbgwcFbGartaPVhPawcu9kmeaecefhearcrfgrc8J9hmbkazhexekaecefhekaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabaz87elabas87edabaH87ebcohrxekabazBdwabasBdlabaHBdbcxhrkavc;abfaocitfgwasBdbawaHBdlavalcdtfaHBdbavc;abfaocefcsGcitfgwazBdbawasBdlavalcefglcsGcdtfasBdbavc;abfaocdfcsGcitfgwaHBdbawazBdlavalaATaAcsSVfglcsGcdtfazBdbalaOTaOcsSVfhlaocifhoabarfhbkaocsGhoalcsGhlaicefgiaq6mbkkcbc99aeaDSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk;Toio97eue97aec98Ghedndnadcl9hmbaeTmecbhdinababpbbbgicKp:RecKp:Sep;6eglaicwp:RecKp:Sep;6ealp;Geaiczp:RecKp:Sep;6egvp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgwp9op9rp;Keglpxbb;:9cbb;:9cbb;:9cbb;:9calalp;Meaoaop;Meavaravawp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFbbbFbbbFbbbFbbbp9oaipxbbbFbbbFbbbFbbbFp9op9qalavp;Mearp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaoavp;Mearp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgDaDpbbbgipxbbbbbbFFbbbbbbFFgwp9oabpbbbgoaipmbediwDqkzHOAKY8AEgvczp:Reczp:Sep;6eglaoaipmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eavczp:Sep;6egvp;Gealp;Gep;Kep;Legipxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgqp9op9rp;Keglpxb;:FSb;:FSb;:FSb;:FSalalp;Meaiaip;Meavaravaqp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbp9oaiavp;Mearp;Keczp:Rep9qgialavp;Mearp;KepxFFbbFFbbFFbbFFbbp9oglpmwDKYqk8AExm35Ps8E8Fp9qpkbbabaoawp9oaialpmbezHdiOAlvCXorQLp9qpkbbabcafhbadclfgdae6mbkkk;2ileue97euo97dnaec98GgiTmbcbheinabcKfpx:ji:1S:ji:1S:ji:1S:ji:1SabpbbbglabczfgvpbbbgopmlvorxmPsCXQL358E8Fgrczp:Segwpxibbbibbbibbbibbbp9qp;6egDp;NegqaDaDp;MegDaDp;KealaopmbediwDqkzHOAKY8AEgDczp:Reczp:Sep;6eglalp;MeaDczp:Sep;6egoaop;Mearczp:Reczp:Sep;6egrarp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jep;Mepxbbn0bbn0bbn0bbn0gDp;KepxFFbbFFbbFFbbFFbbgkp9oaqaop;MeaDp;Keczp:Rep9qgoaqalp;MeaDp;Keakp9oaqarp;MeaDp;Keczp:Rep9qgDpmwDKYqk8AExm35Ps8E8Fglp5eawclp:RegqpEi:T:j83ibavalp5baqpEd:T:j83ibabcwfaoaDpmbezHdiOAlvCXorQLgDp5eaqpEe:T:j83ibabaDp5baqpEb:T:j83ibabcafhbaeclfgeai6mbkkkuee97dnadcd4ae2c98GgeTmbcbhdinababpbbbgicwp:Recwp:Sep;6eaicep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbabczfhbadclfgdae6mbkkk:Sodw97euaec98Ghedndnadcl9hmbaeTmecbhdinabpxbbuJbbuJbbuJbbuJabpbbbgicKp:TeglaicYp:Tep9qgvcdp:Teavp9qgvclp:Teavp9qgop;6ep;Negvaicwp:RecKp:SegraipxFbbbFbbbFbbbFbbbgwp9ogDp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oavaDarp:Xeaiczp:RecKp:Segip:Uep;6ep;Meaqp;Keawp9op9qavaDaraip:Uep:Xep;6ep;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qavaoalcep:Rep9oalpxebbbebbbebbbebbbp9op9qp;6ep;Meaqp;KecKp:Rep9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgkpxbFu9hbFu9hbFu9hbFu9habpbbbglakpbbbgrpmlvorxmPsCXQL358E8Fgvczp:TegqavcHp:Tep9qgicdp:Teaip9qgiclp:Teaip9qgicwp:Teaip9qgop;6ep;NegialarpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbglp9ograDczp:Segwp:Ueavczp:Reczp:SegDp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gvp;Kealp9oaiarawaDp:Uep:Xep;6ep;Meavp;Keczp:Rep9qgwaiaoaqcep:Rep9oaqpxebbbebbbebbbebbbp9op9qp;6ep;Meavp;Keczp:ReaiaDarp:Uep;6ep;Meavp;Kealp9op9qgipmwDKYqk8AExm35Ps8E8FpkbbabawaipmbezHdiOAlvCXorQLpkbbabcafhbadclfgdae6mbkkk9teiucbcbydj:G:cjbgeabcifc98GfgbBdj:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkxebcj:Gdklz:zbb",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),n=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var s=WebAssembly.validate(t)?a(e):a(r),i,o=WebAssembly.instantiate(s,{}).then(function(y){i=y.instance,i.exports.__wasm_call_ctors()});function a(y){for(var x=new Uint8Array(y.length),T=0;T<y.length;++T){var _=y.charCodeAt(T);x[T]=_>96?_-97:_>64?_-39:_+4}for(var v=0,T=0;T<y.length;++T)x[v++]=x[T]<60?n[x[T]]:(x[T]-60)*64+x[++T];return x.buffer.slice(0,v)}function c(y,x,T,_,v,I,N){var K=y.exports.sbrk,ne=_+3&-4,be=K(ne*v),Re=K(I.length),ke=new Uint8Array(y.exports.memory.buffer);ke.set(I,Re);var ue=x(be,_,v,Re,I.length);if(ue==0&&N&&N(be,ne,v),T.set(ke.subarray(be,be+_*v)),K(be-K(0)),ue!=0)throw new Error("Malformed buffer data: "+ue)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp",COLOR:"meshopt_decodeFilterColor"},l={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},f=[],d=0;function h(y){var x={object:new Worker(y),pending:0,requests:{}};return x.object.onmessage=function(T){var _=T.data;x.pending-=_.count,x.requests[_.id][_.action](_.value),delete x.requests[_.id]},x}function m(y){for(var x="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(s)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+g.name+";"+c.toString()+g.toString(),T=new Blob([x],{type:"text/javascript"}),_=URL.createObjectURL(T),v=f.length;v<y;++v)f[v]=h(_);for(var v=y;v<f.length;++v)f[v].object.postMessage({});f.length=y,URL.revokeObjectURL(_)}function b(y,x,T,_,v){for(var I=f[0],N=1;N<f.length;++N)f[N].pending<I.pending&&(I=f[N]);return new Promise(function(K,ne){var be=new Uint8Array(T),Re=++d;I.pending+=y,I.requests[Re]={resolve:K,reject:ne},I.object.postMessage({id:Re,count:y,size:x,source:be,mode:_,filter:v},[be.buffer])})}function g(y){var x=y.data;self.ready.then(function(T){if(!x.id)return self.close();try{var _=new Uint8Array(x.count*x.size);c(T,T.exports[x.mode],_,x.count,x.size,x.source,T.exports[x.filter]),self.postMessage({id:x.id,count:x.count,action:"resolve",value:_},[_.buffer])}catch(v){self.postMessage({id:x.id,count:x.count,action:"reject",value:v})}})}return{ready:o,supported:!0,useWorkers:function(y){m(y)},decodeVertexBuffer:function(y,x,T,_,v){c(i,i.exports.meshopt_decodeVertexBuffer,y,x,T,_,i.exports[u[v]])},decodeIndexBuffer:function(y,x,T,_){c(i,i.exports.meshopt_decodeIndexBuffer,y,x,T,_)},decodeIndexSequence:function(y,x,T,_){c(i,i.exports.meshopt_decodeIndexSequence,y,x,T,_)},decodeGltfBuffer:function(y,x,T,_,v,I){c(i,i.exports[l[v]],y,x,T,_,i.exports[u[I]])},decodeGltfBufferAsync:function(y,x,T,_,v){return f.length>0?b(y,x,T,l[_],u[v]):o.then(function(){var I=new Uint8Array(y*x);return c(i,i.exports[l[_]],I,y,x,T,i.exports[u[v]]),I})}}})()});function uS(){return Promise.resolve().then(()=>(cS(),aS))}var lS=p(()=>{"use strict"});async function eN(){return wd||(wd=uS().then(async({MeshoptDecoder:r})=>(await r.ready,r),r=>{throw wd=void 0,new Error("Failed to load the packaged meshopt decoder.",{cause:r})})),wd}function tN(r){return typeof r=="string"?r:["NONE","OCTAHEDRAL","QUATERNION","EXPONENTIAL","COLOR"][r]}async function fS(r,e,t,n,s,i="NONE"){(await eN()).decodeGltfBuffer(r,e,t,n,s,tN(i))}var wd,dS=p(()=>{"use strict";lS()});async function xd(r,e,t){if(!e.gltf?.decompressMeshes&&e.gltf?.decompressBufferViewIndices===void 0||!e.gltf?.loadBuffers)return;rN(r.json);let n=new ie(r),s=e.gltf.decompressBufferViewIndices,i=s?new Set(typeof s=="function"?s(r.json):s):void 0,o=Array.from(n.bufferViews),a=o.map((c,u)=>i?.has(u)===!1?Promise.resolve():nN(n,c,t));if(await Promise.all(a),i){for(let c of i){let u=o[c];u&&n.removeExtension(u,t)}return}for(let c of o)n.removeExtension(c,t);for(let c of n.buffers)n.removeExtension(c,t);n.removeExtension(t)}function rN(r){let e=r.bufferViews||[];for(let n=0;n<e.length;n++){let s=e[n].extensions;if(s?.KHR_meshopt_compression&&s.EXT_meshopt_compression)throw new Error(`glTF bufferView ${n} cannot use both KHR_meshopt_compression and EXT_meshopt_compression.`)}let t=r.buffers||[];for(let n=0;n<t.length;n++){let s=t[n].extensions;if(s?.KHR_meshopt_compression&&s.EXT_meshopt_compression)throw new Error(`glTF buffer ${n} cannot use both KHR_meshopt_compression and EXT_meshopt_compression.`)}}async function nN(r,e,t){let n=r.getExtension(e,t);if(!n)return;let{byteOffset:s=0,byteLength:i,byteStride:o,count:a,mode:c,filter:u="NONE",buffer:l}=n,f=r.gltf.buffers[l],d=r.gltf.buffers[e.buffer],h=new Uint8Array(f.arrayBuffer,f.byteOffset+s,i),m=new Uint8Array(d.arrayBuffer,d.byteOffset+(e.byteOffset||0),e.byteLength);await fS(m,a,o,h,c,u)}var ey=p(()=>{"use strict";He();dS()});var ty={};J(ty,{decode:()=>sN,name:()=>hS});async function sN(r,e){await xd(r,e,hS)}var hS,pS=p(()=>{"use strict";ey();hS="EXT_meshopt_compression"});var ry={};J(ry,{decode:()=>iN,name:()=>mS});async function iN(r,e){await xd(r,e,mS)}var mS,bS=p(()=>{"use strict";ey();mS="KHR_meshopt_compression"});var ny={};J(ny,{name:()=>oN,preprocess:()=>aN});function aN(r,e){let t=new ie(r);if(t.hasExtension(ho)){if(!ag("image/webp")){if(t.isExtensionRequired(ho))throw new Error(`gltf: Required extension ${ho} not supported by browser`);return}for(let n of t.textures){let s=t.getExtension(n,ho);s&&(n.source=s.source),t.removeExtension(n,ho)}t.removeExtension(ho)}}var ho,oN,gS=p(()=>{"use strict";qn();He();ho="EXT_texture_webp",oN=ho});var sy={};J(sy,{name:()=>cN,preprocess:()=>uN});async function uN(r,e){let t=new ie(r);if(!t.hasExtension(po))return;if(!(await og()).has("image/avif")){if(t.isExtensionRequired(po))throw new Error(`gltf: Required extension ${po} not supported by browser`);return}for(let s of t.textures){let i=t.getExtension(s,po);i&&(s.source=i.source),t.removeExtension(s,po)}t.removeExtension(po)}var po,cN,yS=p(()=>{"use strict";qn();He();po="EXT_texture_avif",cN=po});var iy={};J(iy,{decode:()=>fN,getDDSLoader:()=>iu,name:()=>mo,preprocess:()=>lN});function iu(r){return r?.loaders?.find(e=>e.extensions?.includes("dds")||e.mimeTypes?.includes("image/vnd-ms.dds"))}function lN(r,e,t){let n=new ie(r);if(n.hasExtension(mo)){if(!iu(t)){if(n.isExtensionRequired(mo))throw new Error("gltf: Required extension MSFT_texture_dds needs a DDS parser");return}for(let s of n.textures){let i=n.getExtension(s,mo);i&&(s.source=i.source)}}}async function fN(r,e,t){if(!iu(t)||e.gltf?.loadImages===!1)return;let n=new ie(r);if(n.hasExtension(mo)){for(let s of n.textures)n.removeExtension(s,mo);n.removeExtension(mo)}}var mo,oy=p(()=>{"use strict";He();mo="MSFT_texture_dds"});var ay={};J(ay,{name:()=>dN,preprocess:()=>hN});function hN(r,e){let t=new ie(r);for(let n of t.textures){let s=t.getExtension(n,Td);s&&(n.source=s.source,t.removeExtension(n,Td))}t.removeExtension(Td)}var Td,dN,wS=p(()=>{"use strict";He();Td="KHR_texture_basisu",dN=Td});var ou,cy=p(()=>{"use strict";ou="5.0.0-beta.6"});var au,uy=p(()=>{"use strict";au={name:"Draco",id:"draco",module:"scene",encoding:"binary",format:"draco",extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"]}});var xS,TS=p(()=>{"use strict";xS={backend:typeof WebAssembly=="object"?"wasm":"javascript",extraAttributes:{},attributeNameEntry:void 0,shape:"arrow-table",decoderProfile:"full"}});async function bo(r,e=null,t={},n=null,s=null){if(Xe&&t.useLocalLibraries&&!t.CDN&&n&&t.modules?.[n]===void 0){let i=Yi?"./libs":`modules/${e}/dist/libs`;t={...t,modules:{[n]:`${i}/${n}`,...s?{[s]:`${i}/${s}`}:{},...t.modules}}}return await ia(r,e,t,n,s)}var _S=p(()=>{"use strict";Js()});var pN,mN,cu,AS,Ae,go,vS=p(()=>{"use strict";pN="1.5.7",mN="8786740086a9f4d83f44aa83badfbea4dce7a1b5",cu=`https://www.gstatic.com/draco/versioned/decoders/${pN}`,AS=`https://cdn.jsdelivr.net/gh/google/draco@${mN}/javascript`,Ae={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",GLTF_DECODER:"draco_wasm_wrapper_gltf.js",GLTF_DECODER_WASM:"draco_decoder_gltf.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js",ENCODER_WASM:"draco_encoder.wasm"},go={[Ae.DECODER]:`${cu}/${Ae.DECODER}`,[Ae.DECODER_WASM]:`${cu}/${Ae.DECODER_WASM}`,[Ae.GLTF_DECODER]:`${cu}/${Ae.GLTF_DECODER}`,[Ae.GLTF_DECODER_WASM]:`${cu}/${Ae.GLTF_DECODER_WASM}`,[Ae.FALLBACK_DECODER]:`${cu}/${Ae.FALLBACK_DECODER}`,[Ae.ENCODER]:`${AS}/${Ae.ENCODER}`,[Ae.ENCODER_WASM]:`${AS}/${Ae.ENCODER_WASM}`}});async function _d(r={},e,t="full"){let n=DS(r);return n?await dy(n):await bN(r,e==="js"?"javascript":e,t)}async function bN(r={},e,t="full"){let n=RS(`${e}:${t}`,r),s=IS.get(n);return s||(s=gN(r,e,t),IS.set(n,s)),await s}async function dy(r){let e=xN(r),t=ES.get(e);return t||(t=Ji(()=>e.createDecoderModule({}),n=>({draco:n})),ES.set(e,t)),await t}async function hy(r={}){let e=DS(r);if(e){let s=TN(e),i=LS.get(s);return i||(i=Ji(()=>s.createEncoderModule({}),o=>({draco:o})),LS.set(s,i)),await i}let t=RS("encoder",r),n=SS.get(t);return n||(n=wN(r),SS.set(t,n)),await n}async function gN(r,e,t){try{return await FS(r,e,t)}catch(n){if(e==="javascript")throw n;try{return await FS(r,"javascript","full")}catch(s){throw new AggregateError([n,s],"Draco decoder could not load either the WebAssembly or JavaScript backend")}}}async function FS(r,e,t){let n=BS.then(()=>yN(r,e,t));return BS=n.then(()=>{},()=>{}),await n}async function yN(r,e,t){if(e==="javascript"){let o;try{o=await bo(go[Ae.FALLBACK_DECODER],"scene",r,Ae.FALLBACK_DECODER,"draco_decoder.mjs")}catch(c){if(Xe||r.useLocalLibraries)throw c;o=await bo(go[Ae.FALLBACK_DECODER],"scene",{...r,useLocalLibraries:!0},Ae.FALLBACK_DECODER,"draco_decoder.mjs")}let a=fy(o,"DracoDecoderModule")||globalThis.DracoDecoderModule;return await ly(a)}let n,s;try{[n,s]=await OS(r,t)}catch(o){if(Xe||r.useLocalLibraries)throw o;[n,s]=await OS({...r,useLocalLibraries:!0},t)}let i=fy(n,"DracoDecoderModule")||globalThis.DracoDecoderModule;return await ly(i,s)}async function OS(r,e){let t=e==="gltf"?Ae.GLTF_DECODER:Ae.DECODER,n=e==="gltf"?Ae.GLTF_DECODER_WASM:Ae.DECODER_WASM;return await Promise.all([bo(go[t],"scene",r,t,e==="gltf"?"draco_wasm_wrapper_gltf.mjs":"draco_wasm_wrapper.mjs"),bo(go[n],"scene",r,n)])}async function wN(r){let e,t;try{[e,t]=await MS(r)}catch(s){if(Xe||r.useLocalLibraries)throw s;[e,t]=await MS({...r,useLocalLibraries:!0})}let n=fy(e,"DracoEncoderModule")||globalThis.DracoEncoderModule;return await ly(n,t)}async function MS(r){return await Promise.all([bo(go[Ae.ENCODER],"scene",r,Ae.ENCODER,"draco_encoder.mjs"),bo(go[Ae.ENCODER_WASM],"scene",r,Ae.ENCODER_WASM)])}function ly(r,e){if(typeof r!="function")throw new Error("Draco module initializer could not be loaded");return Ji(t=>r({...e?{wasmBinary:e}:{},onModuleLoaded:t}),t=>({draco:t}))}function fy(r,e){if(typeof r=="function")return r;if(r&&typeof r=="object"){let t=r,n=t[e]||t.default;return typeof n=="function"?n:void 0}}function DS(r){let e=r.modules?.draco3d;if(e){if(typeof e!="object"&&typeof e!="function")throw new Error("Invalid draco3d module");return e}}function xN(r){let e=r;if(typeof e?.createDecoderModule!="function")throw new Error("Invalid draco3d decoder module");return e}function TN(r){let e=r;if(typeof e?.createEncoderModule!="function")throw new Error("Invalid draco3d encoder module");return e}function RS(r,e){let t=Object.entries(e.modules||{}).filter(([n])=>n!=="draco3d").map(([n,s])=>`${n}:${String(s)}`).sort().join("|");return[r,e.useLocalLibraries?"local":"remote",e.CDN||"",t].join("|")}var IS,SS,ES,LS,BS,uu=p(()=>{"use strict";Ue();_S();vS();IS=new Map,SS=new Map,ES=new WeakMap,LS=new WeakMap;BS=Promise.resolve()});function NS(r,e,t){let n=CS(e.metadata),s=[],i=_N(e.attributes);for(let o in r){let a=r[o],c=kS(o,a,i[o]);s.push(c)}if(t){let o=kS("indices",t);s.push(o)}return{fields:s,metadata:n}}function _N(r){let e={};for(let t in r){let n=r[t];e[n.name||"undefined"]=n}return e}function kS(r,e,t){let n={...$f(e),...t?CS(t.metadata):{}};return Wf(r,e,n)}function CS(r){Object.entries(r);let e={};for(let t in r)e[`${t}.string`]=JSON.stringify(r[t]);return e}var US=p(()=>{"use strict";mn()});function SN(r,e){switch(e){case Float32Array:return r.DT_FLOAT32;case Int8Array:return r.DT_INT8;case Int16Array:return r.DT_INT16;case Int32Array:return r.DT_INT32;case Uint8Array:return r.DT_UINT8;case Uint16Array:return r.DT_UINT16;case Uint32Array:return r.DT_UINT32;default:return r.DT_INVALID}}function EN(r){let e=r.size(),t=new Int32Array(e);for(let n=0;n<e;n++)t[n]=r.GetValue(n);return t}function LN(r){let e=r.size(),t=new Uint32Array(e);for(let n=0;n<e;n++)t[n]=r.GetValue(n);return t}function BN(r,e){if(!Object.prototype.hasOwnProperty.call(e,r))return r;let t=/^(.*)_([0-9]+)$/.exec(r),n=t?t[1]:r,s=t?BigInt(t[2])+1n:1n;for(;Object.prototype.hasOwnProperty.call(e,`${n}_${s}`);)s++;return`${n}_${s}`}function FN(r){if(r.quantization_transform){let{quantization_bits:e,min_values:t,range:n}=r.quantization_transform;if(e!==void 0&&t&&n!==void 0)return{type:"quantization",bits:e,origin:Array.from(t),range:n}}if(r.octahedron_transform?.quantization_bits!==void 0)return{type:"octahedron",bits:r.octahedron_transform.quantization_bits}}function ON(r){if(r.includeAttributes&&r.excludeAttributes)throw new Error("DracoLoader: includeAttributes and excludeAttributes cannot be combined")}function MN(r,e){for(let t of r.includeAttributes||r.excludeAttributes||[])if(!e.includes(t))throw new Error(`DracoLoader: selected attribute "${t}" does not exist`)}function DN(r){let e=Er(r);if(!e)throw new Error("Decoded mesh is missing positions");let t=r.POSITION;if(t?.transform?.type!=="quantization")return e;let{bits:n,origin:s,range:i}=t.transform,o=i/(2**n-1);return e.map(a=>a.map((c,u)=>s[u]+c*o))}var PS,AN,vN,IN,lu,VS=p(()=>{"use strict";mn();US();PS={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},AN={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},vN=2,IN=4,lu=class{draco;decoder;metadataQuerier;constructor(e){this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,t={}){ON(t);let n=ArrayBuffer.isView(e)?new Int8Array(e.buffer,e.byteOffset,e.byteLength):new Int8Array(e);this._disableAttributeTransforms(t);let s=this.decoder.GetEncodedGeometryType(n),i=s===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud,o=null;try{switch(s){case this.draco.TRIANGULAR_MESH:o=this.decoder.DecodeArrayToMesh(n,n.byteLength,i);break;case this.draco.POINT_CLOUD:o=this.decoder.DecodeArrayToPointCloud(n,n.byteLength,i);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!o.ok()||!i.ptr){let d=`DRACO decompression failed: ${o.error_msg()}`;throw new Error(d)}let a=this._getDracoLoaderData(i,s,t),c=this._getMeshData(i,a,t),u=DN(c.attributes),l=NS(c.attributes,a,c.indices);return{loader:"draco",loaderData:a,header:{vertexCount:i.num_points(),boundingBox:u},...c,schema:l}}finally{o&&this.draco.destroy(o),i&&this.draco.destroy(i)}}_getDracoLoaderData(e,t,n){let s=this._getTopLevelMetadata(e),i=this._getDracoAttributes(e,n);return{geometry_type:t,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:s,attributes:i}}_getDracoAttributes(e,t){let n={};for(let s=0;s<e.num_attributes();s++){let i=this.decoder.GetAttribute(e,s),o=this._getAttributeMetadata(e,s);n[i.unique_id()]={unique_id:i.unique_id(),attribute_type:i.attribute_type(),data_type:i.data_type(),num_components:i.num_components(),byte_offset:i.byte_offset(),byte_stride:i.byte_stride(),normalized:i.normalized(),attribute_index:s,metadata:o};let a=this._getQuantizationTransform(i,t);a&&(n[i.unique_id()].quantization_transform=a);let c=this._getOctahedronTransform(i,t);c&&(n[i.unique_id()].octahedron_transform=c)}return n}_getMeshData(e,t,n){let s=this._getMeshAttributes(t,e,n);if(!s.POSITION)throw new Error("DRACO: No position attribute found.");return e instanceof this.draco.Mesh?n.topology==="triangle-strip"?{topology:"triangle-strip",mode:5,attributes:s,indices:{value:this._getTriangleStripIndices(e),size:1}}:{topology:"triangle-list",mode:4,attributes:s,indices:{value:this._getTriangleListIndices(e),size:1}}:{topology:"point-list",mode:0,attributes:s}}_getMeshAttributes(e,t,n){let s={},i={},a=Object.values(e.attributes).sort((c,u)=>c.attribute_index-u.attribute_index).map(c=>{let u=this._deduceAttributeName(c,n),l=BN(u,i);return i[l]=!0,c.name=l,{attributeName:l,loaderAttribute:c}});MN(n,Object.keys(i));for(let{attributeName:c,loaderAttribute:u}of a){if(!this._shouldExtractAttribute(c,u,n))continue;let l=this._getAttributeValues(t,u);if(l){let{value:f,size:d}=l;s[c]={value:f,size:d,byteOffset:u.byte_offset,byteStride:u.byte_stride,normalized:u.normalized,transform:FN(u)}}}return s}_shouldExtractAttribute(e,t,n){if(t.attribute_type===this.draco.POSITION){if(n.excludeAttributes?.includes(e))throw new Error(`DracoLoader: position attribute "${e}" cannot be excluded`);return!0}return n.includeAttributes&&!n.includeAttributes.includes(e)?!1:!n.excludeAttributes?.includes(e)}_getTriangleListIndices(e){let n=e.num_faces()*3,s=e.num_points()<=65536,i=n*(s?vN:IN),o=this.draco._malloc(i);try{if(s){if(!this.decoder.GetTrianglesUInt16Array(e,i,o))throw new Error("DRACO: Failed to decode triangle indices.");return new Uint16Array(this.draco.HEAPU8.buffer,o,n).slice()}if(!this.decoder.GetTrianglesUInt32Array(e,i,o))throw new Error("DRACO: Failed to decode triangle indices.");return new Uint32Array(this.draco.HEAPU8.buffer,o,n).slice()}finally{this.draco._free(o)}}_getTriangleStripIndices(e){let t=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,t),LN(t)}finally{this.draco.destroy(t)}}_getAttributeValues(e,t){let n=AN[t.data_type];if(!n)return console.warn(`DRACO: Unsupported attribute type ${t.data_type}`),null;let s=t.num_components,o=e.num_points()*s,a=o*n.BYTES_PER_ELEMENT,c=SN(this.draco,n),u,l=this.draco._malloc(a);try{let f=this.decoder.GetAttribute(e,t.attribute_index);if(!this.decoder.GetAttributeDataArrayForAllPoints(e,f,c,a,l))throw new Error(`DRACO: Failed to decode attribute ${t.unique_id}.`);u=new n(this.draco.HEAPU8.buffer,l,o).slice()}finally{this.draco._free(l)}return{value:u,size:s}}_deduceAttributeName(e,t){let n=e.unique_id;for(let[o,a]of Object.entries(t.extraAttributes||{}))if(a===n)return o;let s=t.attributeNameEntry||"name";if(e.metadata[s]){let o=e.metadata[s].string;return o==="COLOR"?"COLOR_0":o==="TEX_COORD"?"TEXCOORD_0":o}let i=e.attribute_type;for(let o in PS)if(this.draco[o]===i)return PS[o];return`CUSTOM_ATTRIBUTE_${n}`}_getTopLevelMetadata(e){let t=this.decoder.GetMetadata(e);return this._getDracoMetadata(t)}_getAttributeMetadata(e,t){let n=this.decoder.GetAttributeMetadata(e,t);return this._getDracoMetadata(n)}_getDracoMetadata(e){if(!e||!e.ptr)return{};let t={},n=this.metadataQuerier.NumEntries(e);for(let s=0;s<n;s++){let i=this.metadataQuerier.GetEntryName(e,s);t[i]=this._getDracoMetadataField(e,i)}return t}_getDracoMetadataField(e,t){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,t,n);let s=EN(n);return{int:this.metadataQuerier.GetIntEntry(e,t),string:this.metadataQuerier.GetStringEntry(e,t),double:this.metadataQuerier.GetDoubleEntry(e,t),intArray:s}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(e){let{quantizedAttributes:t=[],octahedronAttributes:n=[]}=e,s=[...t,...n];for(let i of s)this.decoder.SkipAttributeTransform(this.draco[i])}_getQuantizationTransform(e,t){let{quantizedAttributes:n=[]}=t,s=e.attribute_type();if(n.map(o=>this.draco[o]).includes(s)){let o=new this.draco.AttributeQuantizationTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits(),range:o.range(),min_values:Float32Array.from({length:e.num_components()},(a,c)=>o.min_value(c))}}finally{this.draco.destroy(o)}}return null}_getOctahedronTransform(e,t){let{octahedronAttributes:n=[]}=t,s=e.attribute_type();if(n.map(o=>this.draco[o]).includes(s)){let o=new this.draco.AttributeOctahedronTransform;try{if(o.InitFromAttribute(e))return{quantization_bits:o.quantization_bits()}}finally{this.draco.destroy(o)}}return null}}});async function Ta(r,e,t,n){let s=n?.reportProgress||e?.onProgress;s?.({phase:"decode",completed:0,total:1,unit:"tasks"});let{draco:i}=await t();(e?.signal||n?.signal)?.throwIfAborted();let o=new lu(i);try{let a=o.parseSync(r,e?.draco);return s?.({phase:"decode",completed:1,total:1,unit:"tasks"}),e?.draco?.shape==="arrow-table"?ei(a,"arrow-table"):a}finally{o.destroy()}}var Ad=p(()=>{"use strict";mn();VS()});var qee,RN,kN,jS=p(()=>{"use strict";Js();uu();Ad();fu();({preload:qee,...RN}=Hn),kN={...RN,parse:async(r,e,t)=>await Ta(r,e,async()=>await _d(hn(e),"wasm",e?.draco?.decoderProfile),t)}});var py={};J(py,{DracoWASMLoaderWithParser:()=>kN});var my=p(()=>{"use strict";jS()});var Zee,NN,CN,GS=p(()=>{"use strict";Js();uu();Ad();fu();({preload:Zee,...NN}=Hn),CN={...NN,parse:async(r,e,t)=>await Ta(r,e,async()=>await _d(hn(e),"js"),t)}});var by={};J(by,{DracoJavaScriptLoaderWithParser:()=>CN});var gy=p(()=>{"use strict";GS()});function VN(r){let e=r?.modules?.draco3d;if(!e)throw new Error('DracoLoader: backend "draco3d" requires options.modules.draco3d');return e}var ite,UN,PN,zS=p(()=>{"use strict";uu();Ad();fu();({preload:ite,...UN}=Hn),PN={...UN,parse:async(r,e,t)=>await Ta(r,e,async()=>await dy(VN(e)),t)}});var yy={};J(yy,{Draco3DLoaderWithParser:()=>PN});var wy=p(()=>{"use strict";zS()});async function jN(r,e){let t=e;switch(GN(t)){case"wasm":{let{DracoWASMLoaderWithParser:n}=await Promise.resolve().then(()=>(my(),py));return n}case"javascript":{let{DracoJavaScriptLoaderWithParser:n}=await Promise.resolve().then(()=>(gy(),by));return n}case"draco3d":{let{Draco3DLoaderWithParser:n}=await Promise.resolve().then(()=>(wy(),yy));return n}default:throw new Error(`DracoLoader: unsupported backend "${t?.draco?.backend}"`)}}function GN(r){return r?.draco?.backend?r.draco.backend==="js"?"javascript":r.draco.backend:Hn.options.draco.backend}var Hn,fu=p(()=>{"use strict";ea();cy();uy();TS();Hn={dataType:null,batchType:null,...au,version:ou,worker:!0,workerSourceNode:"draco/workers/draco-worker-node.ts",serializeWorkerResult:af,deserializeWorkerResult:cf,options:{draco:xS},preload:jN}});var WS=p(()=>{"use strict";fu()});function $S(r){let e={};for(let t in r){let n=r[t];if(t!=="indices"){let s=xy(n);e[t]=s}}return e}function xy(r){let{buffer:e,size:t,count:n}=zN(r);return{value:e,size:t,byteOffset:0,count:n,type:ma(t),componentType:Xn(e)}}function zN(r){let e=r,t=1,n=0;return r&&r.value&&(e=r.value,t=r.size||1),e&&(ArrayBuffer.isView(e)||(e=WN(e,Float32Array)),n=e.length/t),{buffer:e,size:t,count:n}}function WN(r,e,t=!1){return r?Array.isArray(r)?new e(r):t&&!(r instanceof e)?new e(r):r:null}var qS=p(()=>{"use strict";ri()});var Ty={};J(Ty,{decode:()=>KN,name:()=>$N,preprocess:()=>qN});function qN(r,e,t){let n=new ie(r);for(let s of n.meshes)for(let i of n.getReferences(s).primitives)n.getExtension(i,_a)}async function KN(r,e,t){if(!e?.gltf?.decompressMeshes)return;let n=new ie(r),s=[];for(let i of n.meshes)for(let o of n.getReferences(i).primitives)n.getExtension(o,_a)&&s.push(XN(n,o,e,t));await Promise.all(s),n.removeExtension(_a)}async function XN(r,e,t,n){let s=r.getExtension(e,_a);if(!s)return;let i=hr(r.data,r.gltf.buffers,s.bufferView),o=eo(i.buffer,i.byteOffset,i.byteLength),a={...t,draco:{...t.draco,shape:"mesh",topology:"triangle-list",decoderProfile:t.draco?.decoderProfile||"gltf",extraAttributes:s.attributes}};delete a["3d-tiles"];let c=await Xs(o,Hn,a,n),u=$S(c.attributes);for(let l of Object.keys(s.attributes))if(!Object.hasOwn(u,l))throw new Error(`glTF: Draco decompression did not produce attribute ${l}`);for(let[l,f]of Object.entries(u))if(l in e.attributes){let d=e.attributes[l],h=r.data.accessors?.[d];h?.normalized!==void 0&&(f.normalized=h.normalized),h?.min&&h?.max&&(f.min=h.min,f.max=h.max)}e.attributes={...e.attributes,...u},c.indices&&(e.indices=xy(c.indices),e.mode=4),r.removeExtension(e,_a),HN(e)}function HN(r){if(!r.attributes||Object.keys(r.attributes).length===0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}var _a,$N,KS=p(()=>{"use strict";Ue();WS();He();qS();ao();_a="KHR_draco_mesh_compression",$N=_a});var Ay={};J(Ay,{decode:()=>ZN,name:()=>JN});async function ZN(r,e){let t=new ie(r);if(!t.hasExtension(Aa)||!e.gltf?.loadBuffers)return;let s=r.json.materials||[];for(let i=0;i<s.length;i++)eC(i,r,t);s.some(i=>_y(i).length>0)||t.removeExtension(Aa)}function eC(r,e,t){let n=e.json.materials?.[r],s=_y(n),i=new Map,o=rC(e);for(let a of s){let c=a.extensions?.[Aa];if(c){let u=c.texCoord??a.texCoord??0,l=nC(u,c),f=i.get(l);if(!f){if(f={sourceTexCoord:u,texCoord:o,matrix:aC(c)},!sC(e,r,f))continue;o++,i.set(l,f)}a.texCoord=f.texCoord,tC(t,a,Aa),a.extensions&&Object.keys(a.extensions).length===0&&delete a.extensions}}}function tC(r,e,t){e.extensions?.[t]!==void 0&&(r.recordRemovedExtension(t),delete e.extensions[t])}function _y(r){if(!r||typeof r!="object")return[];let e=r,t=[],n=e.extensions;Number.isFinite(e.index)&&n?.[Aa]&&t.push(e);for(let[s,i]of Object.entries(e))s!=="extras"&&t.push(..._y(i));return t}function rC(r){let e=-1;for(let t of r.json.meshes||[])for(let n of t.primitives)for(let s of Object.keys(n.attributes)){let i=/^TEXCOORD_(\d+)$/.exec(s);i&&(e=Math.max(e,Number(i[1])))}return e+1}function nC(r,e){let{offset:t=[0,0],rotation:n=0,scale:s=[1,1]}=e;return JSON.stringify([r,t,n,s])}function sC(r,e,t){let n=[],s=r.json.meshes||[];for(let i of s)for(let o of i.primitives){let a=o.material;Number.isFinite(a)&&e===a&&n.push(o)}if(n.length===0||n.some(i=>!iC(r,i,t.sourceTexCoord)))return!1;for(let i of n)oC(r,i,t);return!0}function iC(r,e,t){let n=e.attributes[`TEXCOORD_${t}`],s=n;if(ArrayBuffer.isView(s?.value))return!0;if(!Number.isFinite(n))return!1;let i=r.json.accessors?.[n];if(!i||i.bufferView===void 0||i.sparse)return!1;let o=r.json.bufferViews?.[i.bufferView];return!!(o&&r.buffers[o.buffer])}function oC(r,e,t){let{sourceTexCoord:n,texCoord:s,matrix:i}=t,o=e.attributes[`TEXCOORD_${n}`],a=o;if(ArrayBuffer.isView(a?.value)){let c=new Float32Array(a.count*2);for(let u=0;u<a.count;u++)XS(a.value.subarray(u*2,u*2+2),a,i,c,u*2);HS(s,a,e,r,c);return}if(Number.isFinite(o)){let c=r.json.accessors?.[o];if(c&&c.bufferView!==void 0){let u=r.json.bufferViews?.[c.bufferView];if(u){let{arrayBuffer:l,byteOffset:f}=r.buffers[u.buffer],d=(f||0)+(c.byteOffset||0)+(u.byteOffset||0),{ArrayType:h,length:m}=Zc(c,u),b=Qc[c.componentType],g=ud[c.type],y=u.byteStride||b*g,x=new Float32Array(m);for(let T=0;T<c.count;T++){let _=new h(l,d+T*y,2);XS(_,c,i,x,T*g)}HS(s,c,e,r,x)}}}}function XS(r,e,t,n,s){let i=e.componentType===5120||e.componentType===5122,o=2**(Qc[e.componentType]*8-(i?1:0))-1;vd.set(e.normalized?Math.max(r[0]/o,-1):r[0],e.normalized?Math.max(r[1]/o,-1):r[1],1),vd.transformByMatrix3(t),n.set([vd[0],vd[1]],s)}function HS(r,e,t,n,s){n.buffers.push({arrayBuffer:ro(s.buffer),byteOffset:0,byteLength:s.buffer.byteLength}),n.json.bufferViews=n.json.bufferViews||[];let i=n.json.bufferViews;i.push({buffer:n.buffers.length-1,byteLength:s.buffer.byteLength,byteOffset:0});let o=n.json.accessors;o&&(o.push({bufferView:i?.length-1,byteOffset:0,componentType:5126,count:e.count,type:"VEC2"}),t.attributes[`TEXCOORD_${r}`]=o.length-1)}function aC(r){let{offset:e=[0,0],rotation:t=0,scale:n=[1,1]}=r,s=new zn().set(1,0,0,0,1,0,e[0],e[1],1),i=YN.set(Math.cos(t),Math.sin(t),0,-Math.sin(t),Math.cos(t),0,0,0,1),o=QN.set(n[0],0,0,0,n[1],0,0,0,1);return s.multiplyRight(i).multiplyRight(o)}var Aa,JN,vd,YN,QN,JS=p(()=>{"use strict";Uf();ri();gg();He();Ue();Aa="KHR_texture_transform",JN=Aa,vd=new jc,YN=new zn,QN=new zn});var vy={};J(vy,{decode:()=>uC,encode:()=>lC,name:()=>cC});async function uC(r){let e=new ie(r),t=e.getExtension(yo);t&&(e.data.lights=t.lights,e.removeExtension(yo));for(let n of e.nodes){let s=e.getExtension(n,yo);s&&(n.light=s.light),e.removeExtension(n,yo)}}async function lC(r){let e=new bn(r),{json:t}=e;if(t.lights){let n=e.addExtension(yo);H(!n.lights),n.lights=t.lights,delete t.lights}if(e.json.lights){for(let n of e.json.lights){let s=n.node;e.addObjectExtension(s,yo,n)}delete e.json.lights}}var yo,cC,YS=p(()=>{"use strict";oo();He();eu();yo="KHR_lights_punctual",cC=yo});var Iy={};J(Iy,{decode:()=>dC,encode:()=>hC,name:()=>fC});async function dC(r){let e=new ie(r);for(let t of e.materials)e.getExtension(t,va)&&(t.unlit=!0),e.removeExtension(t,va);e.removeExtension(va)}function hC(r){let e=new bn(r);for(let t of r.json.materials||[]){let n=t;n.unlit&&(delete n.unlit,e.addObjectExtension(t,va,{}),e.registerRequiredExtension(va))}for(let t of["extensionsUsed","extensionsRequired"])r.json[t]?.length===0&&delete r.json[t]}var va,fC,QS=p(()=>{"use strict";He();eu();va="KHR_materials_unlit",fC=va});var Sy={};J(Sy,{decode:()=>mC,encode:()=>bC,name:()=>pC});async function mC(r){let e=new ie(r),t=e.getExtension(du);if(t){let n=gC(t,e);for(let s of e.materials){let i=e.getExtension(s,du);i&&(s.technique=Object.assign({},i,n[i.technique]),s.technique.values=yC(s.technique,e)),e.removeExtension(s,du)}e.removeExtension(du)}}async function bC(r,e){}function gC(r,e){let{programs:t=[],shaders:n=[],techniques:s=[]}=r,i=new TextDecoder;return n.forEach(o=>{if(Number.isFinite(o.bufferView))o.code=i.decode(hr(e.data,e.gltf.buffers,o.bufferView));else throw new Error("KHR_techniques_webgl: no shader code")}),t.forEach(o=>{o.fragmentShader=n[o.fragmentShader],o.vertexShader=n[o.vertexShader]}),s.forEach(o=>{o.program=t[o.program]}),s}function yC(r,e){let t=Object.assign({},r.values);return Object.keys(r.uniforms||{}).forEach(n=>{r.uniforms[n].value&&!(n in t)&&(t[n]=r.uniforms[n].value)}),Object.keys(t).forEach(n=>{typeof t[n]=="object"&&t[n].index!==void 0&&(t[n].texture=e.resolveTexture(t[n].index,`technique.values.${n}.index`))}),t}var du,pC,ZS=p(()=>{"use strict";He();ao();du="KHR_techniques_webgl",pC=du});var Ey={};J(Ey,{decode:()=>xC,name:()=>wC});async function xC(r,e){let t=new ie(r);TC(t,e)}function TC(r,e){if(!e.gltf?.loadBuffers)return;let t=r.getExtension(eE);t&&(e.gltf?.loadImages&&_C(r,t),AC(r,t))}function _C(r,e){let t=e.schema;if(!t)return;let n=t.classes,{featureTextures:s}=e;if(n&&s)for(let i in n){let o=n[i],a=IC(s,i);a&&EC(r,a,o)}}function AC(r,e){let t=e.schema;if(!t)return;let n=t.classes,s=e.featureTables;if(n&&s)for(let i in n){let o=vC(s,i);o&&SC(r,t,o)}}function vC(r,e){for(let t in r){let n=r[t];if(n.class===e)return n}return null}function IC(r,e){for(let t in r){let n=r[t];if(n.class===e)return n}return null}function SC(r,e,t){if(!t.class)return;let n=e.classes?.[t.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${t.class}`);let s=t.count;for(let i in n.properties){let o=n.properties[i],a=t.properties?.[i];if(a){let c=LC(r,e,o,s,a);a.data=c}}}function EC(r,e,t){let n=e.class;for(let s in t.properties){let i=e?.properties?.[s];if(i){let o=DC(r,i,n);i.data=o}}}function LC(r,e,t,n,s){let i=[],o=s.bufferView,a=r.getTypedArrayForBufferView(o),c=BC(r,t,s,n),u=FC(r,t,s,n,c);return t.type==="STRING"||t.componentType==="STRING"?i=pd(n,a,c,u,t.type==="ARRAY"?t.componentCount:void 0):OC(t)&&(i=MC(t,n,a,c)),i}function BC(r,e,t,n){return e.type==="ARRAY"&&typeof e.componentCount>"u"&&typeof t.arrayOffsetBufferView<"u"?ba(r,t.arrayOffsetBufferView,t.offsetType||"UINT32",n):null}function FC(r,e,t,n,s){if(typeof t.stringOffsetBufferView<"u"){let i=s?Number(s[n]):n*(e.type==="ARRAY"&&e.componentCount||1);return ba(r,t.stringOffsetBufferView,t.offsetType||"UINT32",i)}return null}function OC(r){let e=["UINT8","INT16","UINT16","INT32","UINT32","INT64","UINT64","FLOAT32","FLOAT64"];return e.includes(r.type)||typeof r.componentType<"u"&&e.includes(r.componentType)}function MC(r,e,t,n){let s=r.type==="ARRAY",i=r.componentCount,o="SCALAR",a=r.componentType||r.type,c=tu(o,a),u=t.byteLength/c,l=ga(t,o,a,u);return s?n?ru(l,e,n):i?nu(l,e,i):[]:l}function DC(r,e,t){let n=r.data;if(!n.meshes)return[];let s=[];for(let i of n.meshes)for(let o of i.primitives)RC(r,t,e,s,o);return s}function RC(r,e,t,n,s){let i={channels:t.channels,...t.texture},o=ya(r,i,s);o&&hd(r,e,o,n,s)}var eE,wC,tE=p(()=>{"use strict";He();md();eE="EXT_feature_metadata",wC=eE});async function nE(r,e={},t){let n=rE.filter(s=>iE(s.name,e));for(let s of n)await s.preprocess?.(r,e,t)}async function sE(r,e={},t){let n=rE.filter(s=>iE(s.name,e));for(let s of n)await s.decode?.(r,e,t)}function iE(r,e){let t=e?.gltf?.excludeExtensions||{};return Array.isArray(t)?!t.includes(r):!(r in t&&!t[r])}var rE,oE=p(()=>{"use strict";$I();YI();QI();eS();tS();nS();iS();oS();pS();bS();gS();yS();oy();wS();KS();JS();Jg();YS();QS();ZS();tE();rE=[xg,ry,ty,Ty,Wg,Vg,qg,Xg,Hg,Yg,Qg,Zg,ny,sy,iy,ay,vy,Iy,Sy,Ay,Ey]});function aE(r){let e=new ie(r);for(let t of e.images){let n=e.getExtension(t,Ly);n&&(t.bufferView=n.bufferView,t.mimeType=n.mimeType,delete t.uri),e.removeExtension(t,Ly)}for(let t of e.data.buffers||[])t.id==="binary_glTF"&&delete t.uri;e.removeExtension(Ly)}var Ly,cE=p(()=>{"use strict";He();Ly="KHR_binary_glTF"});function lE(r,e){let t=r.accessors||[],n=r.bufferViews||[],s=NC(r),i=new Map;for(let[o,a]of t.entries()){let c=a.bufferView;if(c===void 0&&!a.byteStride){delete a.byteStride;continue}let u=n[c],l=s.get(o)||"unused",f=CC(a),d=a.byteStride===0?f:a.byteStride??f,h=a.byteOffset??0,m=u?.byteOffset??0,b=typeof a.componentType=="number"&&Object.hasOwn(Id,a.componentType)?Id[a.componentType]:0,g=l==="vertex",y=g?d>=f&&d>=4&&d<=252&&d%4===0&&h%4===0&&(m+h)%4===0:d===f;if(!u||!f||l==="mixed"||!Number.isInteger(d)||!y||g&&d>u.byteLength||!Number.isInteger(a.count)||a.count<1||!Number.isInteger(h)||h<0||!Number.isInteger(m)||m<0||h%b!==0||(m+h)%b!==0||a.type.startsWith("MAT")&&(m+h)%4!==0||!Number.isInteger(u.byteLength)||h+(a.count-1)*d+f>u.byteLength){e(o);continue}let x=`${c}:${l}:${g?d:0}`,T=i.get(x);if(T===void 0){let _={...u};delete _.id,delete _.byteStride,delete _.target,g?(_.byteStride=d,_.target=34962):l==="indices"&&(_.target=34963),T=n.length,n.push(_),i.set(x,T)}a.bufferView=T,delete a.byteStride}}function NC(r){let e=new Map,t=(n,s)=>{if(n===void 0)return;let i=e.get(n);e.set(n,i&&i!==s?"mixed":s)};for(let n of r.meshes||[])for(let s of n.primitives){for(let i of Object.values(s.attributes))t(i,"vertex");t(s.indices,"indices")}for(let n of r.animations||[])for(let s of n.samplers)t(s.input,"animation"),t(s.output,"animation");for(let n of r.skins||[])t(n.inverseBindMatrices,"inverseBind");return e}function CC(r){let e=typeof r.componentType=="number"&&Object.hasOwn(Id,r.componentType)?Id[r.componentType]:0,t=Object.hasOwn(uE,r.type)?uE[r.type]:0;if(!e||!t)return 0;let n=r.type==="MAT2"?2:r.type==="MAT3"?3:4;return r.type.startsWith("MAT")&&n*e%4!==0?0:(e||0)*t}var Id,uE,fE=p(()=>{"use strict";Id={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},uE={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16}});function dE(r,e,t){let n=r.nodes||[],s=r.skins||[],i=s.length,o=!1;for(let a=0;a<i;a++){let c=s[a],u=c.jointNames;if(!Array.isArray(u)||u.length===0||u.some(m=>typeof m!="string"||!m)||new Set(u).size!==u.length){t(`skin ${a} has invalid joint names`),o=!0;continue}let l=n.flatMap((m,b)=>m.skin===a?[b]:[]),f=(l.length?l:[void 0]).map(m=>UC(n,u,m,e,b=>t(`skin ${a} ${b}`))),d=f.some(m=>!m);o||=d;let h=new Map;for(let m of f){if(!m)continue;let b=`${m.skeletonIndex}:${m.jointIndices.join(",")}`,g=h.get(b);if(g===void 0){let y={...c,joints:m.jointIndices,skeleton:m.skeletonIndex};delete y.jointNames,c.bindShapeMatrix!==void 0&&jC(c.bindShapeMatrix)&&delete y.bindShapeMatrix,!d&&h.size===0?(g=a,s[a]=y):(delete y.id,g=s.length,s.push(y)),h.set(b,g)}m.nodeIndex!==void 0&&(n[m.nodeIndex].skin=g,delete n[m.nodeIndex].skeletons)}}if(!o)for(let a of n)delete a.jointName}function UC(r,e,t,n,s){let i=t===void 0?void 0:r[t].skeletons;if(i!==void 0&&(!Array.isArray(i)||i.some(f=>typeof f!="string"||!f)||new Set(i).size!==i.length))return s("has invalid skeleton roots"),null;let o=(i||[]).map(n),a=o.length?PC(r,o):r.map((f,d)=>d);if(!a)return s("has invalid or overlapping skeleton subtrees"),null;let c=[],u=new Map;for(let f of a){let d=r[f].jointName;if(d===void 0)continue;let h=u.get(d)||[];h.push(f),u.set(d,h)}for(let f of e){let d=u.get(f)||[];if(d.length!==1)return s(`cannot uniquely resolve joint ${f}`),null;c.push(d[0])}let l=VC(r,[...c,...o]);return l===void 0?(s("joints have no unambiguous common hierarchy root"),null):{nodeIndex:t,jointIndices:c,skeletonIndex:o.length===1?o[0]:l}}function PC(r,e){let t=new Set,n=[...e];for(;n.length;){let s=n.pop();if(!Number.isSafeInteger(s)||!r[s]||t.has(s))return null;t.add(s),n.push(...r[s].children||[])}return Array.from(t)}function VC(r,e){let t=new Map;for(let[i,o]of r.entries())for(let a of o.children||[]){if(!Number.isSafeInteger(a)||!r[a]||t.has(a))return;t.set(a,i)}let n=e.map(i=>{let o=[],a=new Set,c=i;for(;c!==void 0;){if(a.has(c))return[];a.add(c),o.push(c),c=t.get(c)}return o}),s=n.map(i=>new Set(i));return n[0].find(i=>s.every(o=>o.has(i)))}function jC(r){return Array.isArray(r)&&r.length===16&&Array.from(r).every((e,t)=>e===(t%5===0?1:0))}var hE=p(()=>{"use strict"});function Sd(r,e){if(!e.length)return;let t=new Map;for(let n of e){let s=t.get(n.bufferIndex)||[];s.push(n),t.set(n.bufferIndex,s)}r.buffers=[...r.buffers],r.json.bufferViews||=[];for(let[n,s]of t){let i=r.json.buffers[n],o=r.buffers[n],a=_e(i.byteLength,4),c=a+s.reduce((f,d)=>f+_e(d.bytes.byteLength,4),0),u=new ArrayBuffer(c),l=new Uint8Array(u);l.set(new Uint8Array(o.arrayBuffer,o.byteOffset,i.byteLength));for(let f of s){l.set(new Uint8Array(f.bytes),a);let d=r.json.bufferViews.length;r.json.bufferViews.push({buffer:n,byteOffset:a,byteLength:f.bytes.byteLength,...f.byteStride===void 0?{}:{byteStride:f.byteStride},...f.target===void 0?{}:{target:f.target}}),f.apply(d),a+=_e(f.bytes.byteLength,4)}i.byteLength=c,i.uri!==void 0&&(i.uri=`data:application/octet-stream;base64,${cb(u)}`),r.buffers[n]={arrayBuffer:u,byteOffset:0,byteLength:c}}}var By=p(()=>{"use strict";Ue()});function pE(r,e){let t=new Map;for(let[n,s]of(r.json.skins||[]).entries()){if(s.bindShapeMatrix===void 0)continue;let i=s.bindShapeMatrix;if(!mE(i)){e(`skin ${n} non-identity bindShapeMatrix requires a finite affine matrix`);continue}let o=`${s.inverseBindMatrices}:${i.join(",")}`,a=t.get(o);if(a){if((s.joints||s.jointNames||[]).length>a.count){e(`skin ${n} non-identity bindShapeMatrix has too few inverse-bind matrices`);continue}a.skins.push(s);continue}let c=GC(r,s,i);if(typeof c=="string"){e(`skin ${n} non-identity bindShapeMatrix ${c}`);continue}t.set(o,c)}Sd(r,Array.from(t.values(),n=>({bufferIndex:n.bufferIndex,bytes:n.matrixBytes,apply:s=>{r.json.accessors||=[];let i=r.json.accessors.length;r.json.accessors.push({bufferView:s,byteOffset:0,componentType:5126,count:n.count,type:"MAT4"});for(let o of n.skins)o.inverseBindMatrices=i,delete o.bindShapeMatrix}})))}function GC(r,e,t){let n=r.json.accessors?.[e.inverseBindMatrices],s=(e.joints||e.jointNames||[]).length;if(!n||n.componentType!==5126||n.type!=="MAT4"||n.normalized||n.sparse||n.extensions||Object.hasOwn(n,"byteStride")||!Number.isSafeInteger(n.count)||n.count<1)return"requires packed FLOAT MAT4 inverse-bind matrices";if(n.count<s)return"has too few inverse-bind matrices";let i=r.json.bufferViews?.[n.bufferView],o=i?.buffer,a=r.json.buffers?.[o],c=r.buffers[o];if(!i||o===void 0||!a||!c)return"requires a loaded inverse-bind buffer";if(i.extensions)return"does not support inverse-bind buffer-view extensions";let u=i.byteOffset??0,l=n.byteOffset??0,f=n.count*64;if(!(c.arrayBuffer instanceof ArrayBuffer)||!Number.isSafeInteger(a.byteLength)||a.byteLength<1||!Number.isSafeInteger(c.byteOffset)||c.byteOffset<0||!Number.isSafeInteger(c.byteLength)||c.byteLength<a.byteLength||c.byteOffset+c.byteLength>c.arrayBuffer.byteLength||!Number.isSafeInteger(u)||u<0||u%4!==0||!Number.isSafeInteger(i.byteLength)||i.byteLength<1||i.byteStride!==void 0||u+i.byteLength>a.byteLength||!Number.isSafeInteger(l)||l<0||l%4!==0||l+f>i.byteLength)return"has an invalid inverse-bind buffer layout";let d=new DataView(c.arrayBuffer),h=c.byteOffset+u+l,m=new ArrayBuffer(f),b=new DataView(m);for(let g=0;g<n.count;g++){let y=Array.from({length:16},(x,T)=>d.getFloat32(h+g*64+T*4,!0));if(!mE(y))return"requires finite affine inverse-bind matrices";for(let x=0;x<4;x++)for(let T=0;T<4;T++){let _=0;for(let v=0;v<4;v++)_+=y[v*4+T]*t[x*4+v];if(!Number.isFinite(Math.fround(_)))return"produces non-finite FLOAT matrix values";b.setFloat32(g*64+(x*4+T)*4,_,!0)}}return{bufferIndex:o,count:n.count,matrixBytes:m,skins:[e]}}function mE(r){if(!Array.isArray(r)||r.length!==16)return!1;for(let e=0;e<16;e++)if(!Number.isFinite(r[e]))return!1;return r[3]===0&&r[7]===0&&r[11]===0&&r[15]===1}var bE=p(()=>{"use strict";By()});function yE(r){let e=r.accessors||[],t=new Map,n=new Map,s=Oy(r),i=(o,a)=>{if(!Number.isSafeInteger(o)||o<0||!Object.hasOwn(e,o))return o;let c=e[o];if(!c)return o;let u=t.get(o)||new Map,l=`${a.usage}:${a.mode}:${["unit","signed","direction"].includes(a.mode)?a.semantic?.split("_")[0]:""}:${a.hasOpaqueConsumer?"opaque":""}`,f=u.get(l);return f===void 0&&(f=u.size?e.length:o,u.size&&e.push({...c}),u.set(l,f),n.set(f,a),t.set(o,u)),f};for(let o of r.meshes||[])for(let a of o.primitives){for(let[c,u]of Object.entries(a.attributes)){let l=e[u],f=["NORMAL","TANGENT"].includes(c)&&l&&[5120,5121,5122,5123].includes(l.componentType)?"direction":/^JOINTS_\d+$/.test(c)?"joints":/^(COLOR|WEIGHTS|TEXCOORD)_\d+$/.test(c)&&l&&[5120,5122].includes(l.componentType)?"signed":/^(COLOR|WEIGHTS|TEXCOORD)_\d+$/.test(c)&&l&&[5121,5123].includes(l.componentType)&&!l.normalized?"unit":/^WEIGHTS_\d+$/.test(c)?"weights":"copy";a.attributes[c]=i(u,{usage:"vertex",mode:f,semantic:c,...["signed","direction"].includes(f)?{hasOpaqueConsumer:s}:{}})}a.indices!==void 0&&(a.indices=i(a.indices,{usage:"indices",mode:"copy",hasOpaqueConsumer:a.extensions!==void 0}))}for(let o of r.animations||[])for(let a of o.samplers)a.input=i(a.input,{usage:"animation",mode:"copy"}),a.output=i(a.output,{usage:"animation",mode:"copy"});for(let o of r.skins||[])o.inverseBindMatrices!==void 0&&(o.inverseBindMatrices=i(o.inverseBindMatrices,{usage:"inverseBind",mode:"copy"}));for(let o=0;o<e.length;o++)n.has(o)||n.set(o,{usage:"unused",mode:"copy"});return n}function wE(r,e,t,n,s){let i=[],o=[];for(let[a,c]of e){let u=r.json.accessors[a],l=c.mode==="joints"||c.mode==="weights"||c.semantic?.startsWith("WEIGHTS_"),f=!!(l&&["SCALAR","VEC2","VEC3"].includes(u.type)),d=c.mode==="weights"&&(u.type!=="VEC4"||![5121,5123,5126].includes(u.componentType)||u.componentType===5126&&u.normalized),h=c.mode==="signed",m=c.mode==="direction",b=h||m,g=c.mode==="joints"&&(![5121,5123].includes(u.componentType)||u.normalized||u.type!=="VEC4");if(!t.has(a)&&!g&&!d&&!b&&!f&&c.usage!=="indices"&&c.mode!=="unit")continue;let y=hu(r,a);if(typeof y=="string"){n(`accessor ${a} layout requires binary repacking: ${y}`);continue}if(l&&!["SCALAR","VEC2","VEC3","VEC4"].includes(u.type)){n(`accessor ${a} skin influences require scalar/vector data`);continue}if(c.mode==="weights"&&(![5121,5123,5126].includes(u.componentType)||u.componentType===5126&&u.normalized||u.componentType!==5126&&!u.normalized)){n(`accessor ${a} weights require FLOAT or normalized unsigned data`);continue}let x=u.componentType,T=u.normalized;if(b){if(c.hasOpaqueConsumer){n(`accessor ${a} integer conversion cannot interpret opaque extension consumers`);continue}if(!(m?[c.semantic==="NORMAL"?"VEC3":"VEC4"]:c.semantic?.startsWith("COLOR_")?["VEC3","VEC4"]:c.semantic?.startsWith("WEIGHTS_")?["SCALAR","VEC2","VEC3","VEC4"]:["VEC2"]).includes(u.type)||T!==void 0&&typeof T!="boolean"){n(`accessor ${a} integer ${c.semantic} has incompatible shape or normalization`);continue}let oe=!0;for(let xe=0;xe<u.count;xe++)if(m){let Rt=Math.hypot(Math.fround(Ia(y,xe,0)),Math.fround(Ia(y,xe,1)),Math.fround(Ia(y,xe,2)));(Math.abs(Rt-1)>1e-5||c.semantic==="TANGENT"&&![-1,1].includes(Ia(y,xe,3)))&&(oe=!1)}else if(!c.semantic?.startsWith("TEXCOORD_"))for(let Rt=0;Rt<y.rows;Rt++){let mr=Ia(y,xe,Rt);(mr<0||mr>1)&&(oe=!1)}if(!oe){n(m?`accessor ${a} integer ${c.semantic} requires unit directions and tangent handedness of +/-1; values are not repaired`:`accessor ${a} signed ${c.semantic} values must remain in [0, 1]`);continue}x=5126,T=!1}if(c.usage==="indices"){if(u.type!=="SCALAR"||![5121,5123,5125].includes(x)||T){n(`index accessor ${a} requires unnormalized unsigned SCALAR data`);continue}let ue=0;for(let xe=0;xe<u.count;xe++)ue=Math.max(ue,Xt(y,xe,0));if(ue===(x===5121?255:x===5123?65535:4294967295)){if(c.hasOpaqueConsumer){n(`index accessor ${a} cannot widen opaque primitive extension semantics`);continue}if(x===5125){n(`index accessor ${a} contains the unrepresentable uint32 restart value`);continue}x=x===5121?5123:5125}if(!t.has(a)&&x===u.componentType)continue}if(g||c.mode==="unit"){if(g&&u.normalized){n(`accessor ${a} joint indices require unnormalized scalar/vector data`);continue}if(c.mode==="unit"&&!(c.semantic?.startsWith("COLOR_")?["VEC3","VEC4"]:c.semantic?.startsWith("WEIGHTS_")?["SCALAR","VEC2","VEC3","VEC4"]:["VEC2"]).includes(u.type)){n(`accessor ${a} integer ${c.semantic} has an incompatible shape`);continue}let ue=0,oe=!0;for(let xe=0;xe<u.count;xe++)for(let Rt=0;Rt<y.rows*y.columns;Rt++){let mr=Xt(y,xe,Rt);(!Number.isInteger(mr)||mr<0||g&&mr>65535)&&(oe=!1),ue=Math.max(ue,mr)}if(!oe){n(`accessor ${a} joint indices require finite integers in [0, 65535]`);continue}if(g)x=ue<=255?5121:5123,T=!1;else if(ue<=1)x=5126,T=!1;else if(n(`accessor ${a} ambiguous integer attribute normalization; best effort assumes normalized unsigned values`),T=!0,!t.has(a)&&!f){o.push(()=>{u.normalized=!0});continue}}let _=f?4:y.rows,v=Fy[x],I=y.columns>1?_e(y.rows*v,4):_*v,N=I*y.columns,K=c.usage==="vertex"?_e(N,4):N,ne=new ArrayBuffer(u.count*K),be=new Uint8Array(ne),Re=new Uint8Array(y.data.buffer),ke=new DataView(ne);for(let ue=0;ue<u.count;ue++)for(let oe=0;oe<y.columns;oe++)if(x===u.componentType){let xe=y.byteOffset+ue*y.byteStride+oe*y.rows*y.componentSize;be.set(Re.subarray(xe,xe+y.rows*y.componentSize),ue*K+oe*I)}else for(let xe=0;xe<y.rows;xe++){let Rt=(b?Ia:Xt)(y,ue,oe*y.rows+xe),mr=ue*K+oe*I+xe*v;x===5126?ke.setFloat32(mr,Rt,!0):x===5121?ke.setUint8(mr,Rt):x===5125?ke.setUint32(mr,Rt,!0):ke.setUint16(mr,Rt,!0)}i.push({bufferIndex:y.bufferIndex,bytes:ne,...c.usage==="vertex"?{byteStride:K,target:34962}:c.usage==="indices"?{target:34963}:{},apply:ue=>{b&&s(`Converted ${h?"signed":"integer"} ${c.semantic} accessor ${a} to FLOAT, preserving ${y.accessor.normalized?"explicitly normalized":"literal"} values.`),c.usage==="indices"&&x!==u.componentType&&s(`Widened index accessor ${a} to preserve a glTF 1 index reserved by glTF 2.`),u.bufferView=ue,u.byteOffset=0,delete u.byteStride,(x!==u.componentType||f)&&(delete u.min,delete u.max),u.componentType=x,f&&(u.type="VEC4"),T?u.normalized=!0:delete u.normalized}})}Sd(r,i);for(let a of o)a()}function Ia(r,e,t){let n=Xt(r,e,t);if(r.accessor.normalized!==!0)return n;let s=zC[r.accessor.componentType];return Math.max(n/s,-1)}function Oy(r){let e=[r],t=new Set;for(;e.length;){let n=e.pop();if(!(!n||typeof n!="object"||t.has(n))){t.add(n);for(let[s,i]of Object.entries(n))if(s!=="extras"){if(s==="extensions"&&i&&typeof i=="object"&&Object.keys(i).some(o=>!["KHR_materials_unlit","KHR_materials_common"].includes(o)))return!0;e.push(i)}}}return!1}function hu(r,e){let t=r.json.accessors?.[e];if(!t||!Number.isSafeInteger(e)||e<0)return"invalid accessor reference";let n=typeof t.componentType=="number"&&Object.hasOwn(Fy,t.componentType)?Fy[t.componentType]:void 0,s=typeof t.type=="string"&&Object.hasOwn(gE,t.type)?gE[t.type]:void 0;if(!n||!s||!Number.isSafeInteger(t.count)||t.count<1)return"invalid component type, shape, or count";let[i,o]=s,a=r.json.bufferViews?.[t.bufferView],c=r.json.buffers?.[a?.buffer],u=r.buffers[a?.buffer];if(!a||!c||!u)return"requires a loaded accessor buffer";if(t.sparse||t.extensions||a.extensions)return"sparse or extension-bearing data is unsupported";let l=i*o*n,f=t.byteStride??a.byteStride??l,d=f===0?l:f,h=t.byteOffset??0,m=a.byteOffset??0;return!(u.arrayBuffer instanceof ArrayBuffer)||!Number.isSafeInteger(d)||d<l||t.byteStride!==void 0&&t.byteStride>255||!Number.isSafeInteger(h)||h<0||!Number.isSafeInteger(m)||m<0||!Number.isSafeInteger(a.byteLength)||a.byteLength<1||!Number.isSafeInteger(c.byteLength)||c.byteLength<1||m+a.byteLength>c.byteLength||h+(t.count-1)*d+l>a.byteLength||!Number.isSafeInteger(u.byteOffset)||u.byteOffset<0||!Number.isSafeInteger(u.byteLength)||u.byteLength<c.byteLength||u.byteOffset+u.byteLength>u.arrayBuffer.byteLength?"invalid source buffer span or stride":{accessor:t,bufferIndex:a.buffer,componentSize:n,rows:i,columns:o,byteStride:d,data:new DataView(u.arrayBuffer),byteOffset:u.byteOffset+m+h}}function Xt(r,e,t){let n=r.byteOffset+e*r.byteStride+t*r.componentSize;switch(r.accessor.componentType){case 5120:return r.data.getInt8(n);case 5121:return r.data.getUint8(n);case 5122:return r.data.getInt16(n,!0);case 5123:return r.data.getUint16(n,!0);case 5125:return r.data.getUint32(n,!0);default:return r.data.getFloat32(n,!0)}}var Fy,zC,gE,pu=p(()=>{"use strict";Ue();By();Fy={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},zC={5120:127,5121:255,5122:32767,5123:65535},gE={SCALAR:[1,1],VEC2:[2,1],VEC3:[3,1],VEC4:[4,1],MAT2:[2,2],MAT3:[3,3],MAT4:[4,4]}});function TE(r,e){let t=r.asset;t.premultipliedAlpha&&e("asset premultipliedAlpha rendering"),xE(t,["profile","premultipliedAlpha"]);for(let[n,s]of(r.textures||[]).entries()){let i=s;for(let[o,a]of Object.entries({format:6408,internalFormat:6408,target:3553,type:5121}))i[o]!==void 0&&i[o]!==a&&e(`texture ${n} non-default ${o} rendering`);xE(i,["format","internalFormat","target","type"])}}function xE(r,e){let t={};for(let a of e)Object.hasOwn(r,a)&&(t[a]=r[a],delete r[a]);if(!Object.keys(t).length)return;let n=My(r.extras)?r.extras:r.extras===void 0?{}:{originalExtras:r.extras},s=My(n.gltf1)?n.gltf1:n.gltf1===void 0?{}:{originalExtras:n.gltf1},i=My(s.legacyFields)?s.legacyFields:s.legacyFields===void 0?{}:{originalExtras:s.legacyFields},o=Object.keys(t).some(a=>Object.hasOwn(i,a));r.extras={...n,gltf1:{...s,legacyFields:{...i,...t,...o?{originalExtras:i}:{}}}}}function My(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}function Dy(r){let e=/^(JOINTS?|WEIGHTS?|TEXCOORD|COLOR)(?:_(\d+))?$/.exec(r);if(e){let t=e[1].startsWith("JOINT")?"JOINTS":e[1].startsWith("WEIGHT")?"WEIGHTS":e[1],n=Number(e[2]||0);if(!Number.isSafeInteger(n)||n>999999999)throw new Error(`glTF v1: invalid attribute set index ${r}`);return`${t}_${n}`}return["POSITION","NORMAL","TANGENT"].includes(r)||r.startsWith("_")||r.includes(":")?r:`_${r}`}var _E=p(()=>{"use strict"});function AE(r,e,t){for(let[s,i]of(r.animations||[]).entries()){let f=function(d,h,m){try{let b=typeof d=="string"?e(d,h):d,g=h==="accessor"?r.accessors:r.nodes;if(typeof b=="number"&&Number.isSafeInteger(b)&&b>=0&&g?.[b])return b}catch{}return t(`animation ${s} ${m} unresolved ${h} reference`),d};var n=f;let o=i,a=o.parameters||{},c=new Map,u=i.samplers,l=Array.isArray(u)?u.map((d,h)=>[String(h),d]):Object.entries(u||{});i.samplers=l.map(([d,h],m)=>{c.set(d,m);for(let b of["input","output"]){let g=h[b],y=Object.hasOwn(a,g)?a[g]:g;h[b]=f(y,"accessor",`sampler ${d} ${b}`)}return h.interpolation??="LINEAR",h}),delete o.parameters;for(let[d,h]of(i.channels||[]).entries()){if(typeof h.sampler=="string"){let b=c.get(h.sampler);b===void 0?t(`animation ${s} channel ${d} unresolved sampler ${h.sampler}`):h.sampler=b}let m=h.target;m?.id!==void 0?(m.node=f(m.id,"node",`channel ${d} target`),delete m.id):typeof m?.node=="string"&&(m.node=f(m.node,"node",`channel ${d} target`))}}}var vE=p(()=>{"use strict"});function IE(r,e,t){let n=r.nodes||[],s=new Map;for(let[a,c]of n.entries())for(let u of c.children||[])s.set(u,s.has(u)?null:a);let i=[];for(let[a,c]of(r.scenes||[]).entries()){let u=o(c.nodes||[]);if(!u){e(`scene ${a} invalid node hierarchy`);continue}for(let l of Array.from(u)){let f=r.skins?.[n[l].skin];if(!Array.isArray(f?.joints)||!f.joints.length||f.skeleton===void 0||u.has(f.skeleton)&&f.joints.every(b=>u.has(b)))continue;let d=f.skeleton,h=new Set;for(;!h.has(d)&&typeof s.get(d)=="number";)h.add(d),d=s.get(d);let m=o([d]);if(h.has(d)||s.get(d)===null||!m||!f.joints.every(b=>m.has(b))||Array.from(m).some(b=>u.has(b)||n[b].mesh!==void 0||n[b].camera!==void 0||n[b].extensions!==void 0)){e(`scene ${a} skin ${n[l].skin} cannot safely attach detached skeleton`);continue}for(let b of m)u.add(b);i.push(()=>{c.nodes||=[],c.nodes.push(d),t(`Attached detached skeleton root ${d} to scene ${a}.`)})}}for(let a of i)a();function o(a){let c=new Set,u=[...a];for(;u.length;){let l=u.pop();if(!Number.isSafeInteger(l)||!n[l]||c.has(l)||s.get(l)===null)return null;c.add(l),u.push(...n[l].children||[])}return c}}var SE=p(()=>{"use strict"});function EE(r,e){for(let[t,n]of(r.cameras||[]).entries()){let s=n.perspective,i=n.orthographic;(n.type==="perspective"?s&&mu(s.yfov)&&mu(s.znear)&&(s.aspectRatio===void 0||mu(s.aspectRatio))&&(s.zfar===void 0||mu(s.zfar)&&s.zfar>s.znear):n.type==="orthographic"&&i&&Number.isFinite(i.xmag)&&i.xmag!==0&&Number.isFinite(i.ymag)&&i.ymag!==0&&Number.isFinite(i.znear)&&i.znear>=0&&mu(i.zfar)&&i.zfar>i.znear)||e(`camera ${t} invalid projection parameters`)}}function mu(r){return Number.isFinite(r)&&r>0}var LE=p(()=>{"use strict"});function BE(r,e,t){let n=new Map,s=new Set;for(let[i,o]of(r.json.meshes||[]).entries())for(let[a,c]of o.primitives.entries()){let u=`mesh ${i} primitive ${a}`;for(let b of["TEXCOORD","COLOR","JOINTS","WEIGHTS"])Object.keys(c.attributes).filter(y=>y.startsWith(`${b}_`)).map(y=>Number(y.slice(b.length+1))).sort((y,x)=>y-x).some((y,x)=>y!==x)&&t(`${u} ${b} sets must be contiguous starting at zero`);for(let[b,g]of Object.entries(c.attributes)){let y=b.split("_")[0];if(!["NORMAL","TANGENT","COLOR","TEXCOORD","JOINTS","WEIGHTS"].includes(y))continue;let x=`${y}:${g}`;if(s.has(x))continue;s.add(x);let T=e(g,`${b} accessor ${g}`);T&&WC(T,y,`${b} accessor ${g}`,t)}let l=Object.values(c.attributes).map(b=>(Number.isSafeInteger(b)?r.json.accessors?.[b]:void 0)?.count);if(!l.length||l.some(b=>!Number.isSafeInteger(b)||b<1)){t(`${u} requires valid vertex attribute accessors`);continue}l.some(b=>b!==l[0])&&t(`${u} vertex attribute counts do not match`);let f=c.indices===void 0?l[0]:r.json.accessors?.[c.indices]?.count,d=c.mode===void 0?4:c.mode;if(!Number.isInteger(d)||d<0||d>6?t(`${u} requires a primitive mode in [0, 6]`):(!c.extensions||!Object.keys(c.extensions).length)&&(!Number.isSafeInteger(f)||f<1||d===1&&f%2!==0||[2,3].includes(d)&&f<2||d===4&&f%3!==0||[5,6].includes(d)&&f<3)&&t(`${u} draw count ${f} is incompatible with primitive mode ${d}`),c.indices===void 0)continue;let h=e(c.indices,`${u} indices`);if(!h)continue;if(h.accessor.type!=="SCALAR"||![5121,5123,5125].includes(h.accessor.componentType)||h.accessor.normalized){t(`${u} indices require unnormalized unsigned SCALAR data`);continue}let m=n.get(c.indices);if(m===void 0){m=0;for(let b=0;b<h.accessor.count;b++)m=Math.max(m,Xt(h,b,0));n.set(c.indices,m)}l.some(b=>m>=b)&&t(`${u} index ${m} is outside its vertex attribute counts`)}}function WC(r,e,t,n){let s=r.accessor,i=s.componentType===5126&&!s.normalized,o=[5121,5123].includes(s.componentType)&&s.normalized===!0,a=s.normalized===void 0||typeof s.normalized=="boolean",c=e==="NORMAL"?s.type==="VEC3"&&i:e==="TANGENT"?s.type==="VEC4"&&i:e==="JOINTS"?s.type==="VEC4"&&[5121,5123].includes(s.componentType)&&!s.normalized:e==="COLOR"?["VEC3","VEC4"].includes(s.type)&&(i||o):s.type===(e==="TEXCOORD"?"VEC2":"VEC4")&&(i||o);if(!a||!c){n(`${t} has incompatible core attribute shape, component type, or normalization`);return}for(let u=0;u<s.count;u++){let l=Array.from({length:r.rows},(f,d)=>Xt(r,u,d));if(l.some(f=>!Number.isFinite(f))||["NORMAL","TANGENT"].includes(e)&&Math.abs(Math.hypot(...l.slice(0,3))-1)>1e-5||e==="TANGENT"&&l[3]!==1&&l[3]!==-1||["COLOR","WEIGHTS"].includes(e)&&i&&l.some(f=>f<0||f>1)){n(`${t} requires finite core values, unit directions, tangent handedness \xB11, and colors/weights in [0, 1]`);return}}}var FE=p(()=>{"use strict";pu()});function OE(r,e,t){let n=new Map,s=new Set,i=[],o=(f,d)=>{let h=n.get(f);return h===void 0&&(h=hu(r,f),n.set(f,h)),typeof h=="string"?(s.has(f)||(s.add(f),e(`${d}: ${h}`)),null):h},a=new Set;for(let f of r.json.meshes||[])for(let d of f.primitives)d.attributes.POSITION!==void 0&&a.add(d.attributes.POSITION);for(let f of a){let d=o(f,`POSITION accessor ${f}`);if(d){if(!Ed(d,"VEC3")){e(`POSITION accessor ${f} requires unnormalized FLOAT VEC3 data`);continue}u(d,f)}}l(),c(),$C(r,o,e),BE(r,o,e);for(let f of i)f();function c(){for(let[f,d]of(r.json.skins||[]).entries()){if(d.inverseBindMatrices===void 0)continue;let h=`skin ${f} inverse-bind matrices`,m=o(d.inverseBindMatrices,h);if(m){if(!Ed(m,"MAT4")||m.accessor.count<(d.joints?.length||0)){e(`${h} require FLOAT MAT4 data with at least one matrix per joint`);continue}for(let b=0;b<m.accessor.count;b++){let g=Array.from({length:16},(y,x)=>Xt(m,b,x));if(g.some(y=>!Number.isFinite(y))||g[3]!==0||g[7]!==0||g[11]!==0||g[15]!==1){e(`${h} require finite affine matrices`);break}}}}}function u(f,d){let h=new Array(f.rows).fill(1/0),m=new Array(f.rows).fill(-1/0);for(let b=0;b<f.accessor.count;b++)for(let g=0;g<f.rows;g++){let y=Xt(f,b,g);if(!Number.isFinite(y))return e(`accessor ${d} non-finite values cannot supply required bounds`),!1;h[g]=Math.min(h[g],y),m[g]=Math.max(m[g],y)}return(JSON.stringify(f.accessor.min)!==JSON.stringify(h)||JSON.stringify(f.accessor.max)!==JSON.stringify(m))&&i.push(()=>{f.accessor.min=h,f.accessor.max=m,t(`Calculated required bounds for accessor ${d}.`)}),!0}function l(){let f=new Set,d=new Set;for(let[h,m]of(r.json.animations||[]).entries()){let b=new Set;(!m.samplers.length||!m.channels?.length)&&e(`animation ${h} requires samplers and channels`);for(let[g,y]of m.samplers.entries()){let x=`animation ${h} sampler ${g}`;if(["LINEAR","STEP"].includes(y.interpolation??"LINEAR")||e(`${x} unsupported interpolation ${y.interpolation}`),!f.has(y.input)){f.add(y.input);let T=o(y.input,`${x} input`);if(T)if(!Ed(T,"SCALAR"))e(`${x} time input requires unnormalized FLOAT SCALAR data`);else{let _=-1/0,v=!0;for(let I=0;I<T.accessor.count;I++){let N=Xt(T,I,0);(!Number.isFinite(N)||N<0||N<=_)&&(v=!1),_=N}v?u(T,y.input):e(`${x} times must be finite, nonnegative, and strictly increasing`)}}}for(let[g,y]of(m.channels||[]).entries()){let x=`animation ${h} channel ${g}`,T=Number.isSafeInteger(y.sampler)?m.samplers[y.sampler]:void 0,_=y.target,v=Number.isSafeInteger(_?.node)?r.json.nodes?.[_.node]:void 0;if(!T||!v||!["translation","rotation","scale"].includes(_?.path)){e(`${x} invalid sampler, node, or TRS target`);continue}v.matrix!==void 0&&e(`${x} matrix node requires TRS decomposition`);let I=`${_.node}:${_.path}`;if(b.has(I)&&e(`${x} duplicate node/path target`),b.add(I),!["LINEAR","STEP"].includes(T.interpolation??"LINEAR"))continue;let N=r.json.accessors?.[T.input],K=o(T.output,`${x} output`);if(!K)continue;if(!Ed(K,_.path==="rotation"?"VEC4":"VEC3")||K.accessor.count!==N?.count){e(`${x} output shape, type, or count does not match its target and keys`);continue}let ne=`${T.output}:${_.path}`;if(!d.has(ne)){d.add(ne);for(let be=0;be<K.accessor.count;be++){let Re=Array.from({length:K.rows},(ke,ue)=>Xt(K,be,ue));if(Re.some(ke=>!Number.isFinite(ke))||_.path==="rotation"&&Math.abs(Math.hypot(...Re)-1)>1e-5){e(`${x} output requires finite values and unit rotation quaternions`);break}}}}}}}function Ed(r,e){return r.accessor.componentType===5126&&!r.accessor.normalized&&r.accessor.type===e}function $C(r,e,t){let n=new Set;for(let s of r.json.nodes||[]){let i=r.json.skins?.[s.skin],o=r.json.meshes?.[s.mesh];if(!Array.isArray(i?.joints)||!i.joints.length||!o)continue;let a=`${s.mesh}:${s.skin}`;if(!n.has(a)){n.add(a);for(let[c,u]of o.primitives.entries()){let l=`mesh ${s.mesh} primitive ${c} skin ${s.skin}`,f=Object.keys(u.attributes).filter(b=>/^JOINTS_\d+$/.test(b)).map(b=>Number(b.slice(7))).sort((b,g)=>b-g),d=Object.keys(u.attributes).filter(b=>/^WEIGHTS_\d+$/.test(b)).map(b=>Number(b.slice(8))).sort((b,g)=>b-g);if(!f.length&&!d.length){t(`${l} requires JOINTS_0 and WEIGHTS_0 skin influences`);continue}if(JSON.stringify(f)!==JSON.stringify(d)||f.some((b,g)=>b!==g)){t(`${l} requires matching contiguous joint/weight sets starting at zero`);continue}let h=r.json.accessors?.[u.attributes.POSITION]?.count,m=f.map(b=>({joints:e(u.attributes[`JOINTS_${b}`],`${l} joint set ${b}`),weights:e(u.attributes[`WEIGHTS_${b}`],`${l} weight set ${b}`)}));if(!m.some(({joints:b,weights:g})=>!b||!g)){if(m.some(({joints:b,weights:g})=>b.accessor.type!=="VEC4"||g.accessor.type!=="VEC4"||![5121,5123].includes(b.accessor.componentType)||b.accessor.normalized||!(g.accessor.componentType===5126&&!g.accessor.normalized||[5121,5123].includes(g.accessor.componentType)&&g.accessor.normalized)||b.accessor.count!==g.accessor.count||h!==void 0&&b.accessor.count!==h||b.accessor.count!==m[0].joints.accessor.count)){t(`${l} incompatible influence accessor types or vertex counts`);continue}for(let b=0;b<m[0].joints.accessor.count;b++){let g=0,y=0,x=!0,T=new Set;for(let{joints:_,weights:v}of m){let I=v.accessor.normalized?v.accessor.componentType===5121?255:65535:1;for(let N=0;N<4;N++){let K=Xt(_,b,N),ne=Xt(v,b,N)/I;(K>=i.joints.length||!Number.isFinite(ne)||ne<0||ne>1)&&(x=!1),ne>0&&(T.has(K)&&(x=!1),T.add(K),y++),g+=ne}}if(!x||Math.abs(g-1)>2e-7*Math.max(y,1)){t(`${l} invalid palette index, repeated weighted joint, or weights not summing to one at vertex ${b}`);break}}}}}}}var ME=p(()=>{"use strict";pu();FE()});function DE(r,e,t,n){let s=new Map,i=new Map,o=new Map;for(let[c,u]of(r.json.buffers||[]).entries()){let l=`buffer ${c}`,f=r.buffers[c],d=!!(f&&f.arrayBuffer instanceof ArrayBuffer&&Number.isSafeInteger(f.byteOffset)&&f.byteOffset>=0&&Number.isSafeInteger(f.byteLength)&&f.byteLength>=0&&Number.isSafeInteger(f.byteOffset+f.byteLength)&&f.byteOffset+f.byteLength<=f.arrayBuffer.byteLength);f&&!d&&t(`${l} invalid borrowed payload span`);let h=u.byteLength;if(h===void 0&&e.has(c)&&!u.extensions&&d&&f.byteLength>0&&(h=f.byteLength,i.set(c,h)),!Number.isSafeInteger(h)||h<1){t(`${l} requires a positive byteLength; missing lengths require unambiguous loaded URI data`);continue}s.set(c,h),d&&f.byteLength<h&&t(`${l} declared byteLength exceeds its loaded payload`)}let a=Oy(r.json);for(let[c,u]of(r.json.bufferViews||[]).entries()){let l=u.byteOffset===void 0?0:u.byteOffset,f=s.get(u.buffer),d=u.byteLength===void 0&&!a&&f!==void 0?qC(r,c,s):u.byteLength;u.byteLength===void 0&&d!==void 0&&o.set(c,d),(!Number.isSafeInteger(u.buffer)||u.buffer<0||f===void 0||!Number.isSafeInteger(l)||l<0||!Number.isSafeInteger(d)||(d??0)<1||!Number.isSafeInteger(l+(d??0))||l+(d??0)>f)&&t(`bufferView ${c} requires a valid buffer reference and contained positive byte span`)}for(let[c,u]of o)r.json.bufferViews[c].byteLength=u,n(`Inferred bufferView ${c} byteLength from its dense accessor spans.`);for(let[c,u]of i)r.json.buffers[c].byteLength=u,n(`Inferred buffer ${c} byteLength from its loaded URI payload.`)}function qC(r,e,t){let n=r.json.bufferViews[e];if(n.byteOffset!==void 0&&(!Number.isSafeInteger(n.byteOffset)||n.byteOffset<0)||n.byteStride!==void 0&&(!Number.isSafeInteger(n.byteStride)||n.byteStride<0)||r.json.images?.some(a=>a.bufferView===e)||r.json.accessors?.some(a=>!!a.sparse))return;let s=t.get(n.buffer)-(n.byteOffset??0),i={...r,json:{...r.json,buffers:r.json.buffers.map((a,c)=>({...a,byteLength:t.get(c)})),bufferViews:r.json.bufferViews.map((a,c)=>c===e?{...a,byteLength:s}:a)}},o=0;for(let[a,c]of(r.json.accessors||[]).entries()){if(c.bufferView!==e)continue;let u=c;for(let d of[u.byteOffset,u.byteStride])if(d!==void 0&&(!Number.isSafeInteger(d)||d<0))return;let l=hu(i,a);if(typeof l=="string")return;let f=(c.byteOffset??0)+(c.count-1)*l.byteStride+l.rows*l.columns*l.componentSize;o=Math.max(o,f)}return o>0?o:void 0}var RE=p(()=>{"use strict";pu()});function kE(r,e,t){let n=new Map;for(let i of r.animations||[])for(let o of i.channels||[]){let a=o.target?.node;if(!Number.isSafeInteger(a))continue;let c=n.get(a)||new Set;c.add(o.target.path),n.set(a,c)}let s=[];for(let[i,o]of n){let a=r.nodes?.[i];if(a?.matrix===void 0)continue;let c=`animated matrix node ${i}`;if(o.size!==1||!o.has("translation")){e(`${c} rotation or scale animation requires an unambiguous TRS basis`);continue}if(a.translation!==void 0||a.rotation!==void 0||a.scale!==void 0||a.extensions!==void 0){e(`${c} has conflicting TRS fields or opaque extensions`);continue}let u=KC(a.matrix);if(!u){e(`${c} requires a finite affine, nonsingular matrix without shear`);continue}s.push(()=>{Object.assign(a,u),delete a.matrix,t(`Decomposed translation-only animated matrix node ${i}, preserving its linear transform.`)})}for(let i of s)i()}function KC(r){if(!Array.isArray(r)||r.length!==16||Array.from(r).some(a=>!Number.isFinite(a))||r[3]!==0||r[7]!==0||r[11]!==0||r[15]!==1)return null;let e=[0,1,2].map(a=>Math.hypot(...r.slice(a*4,a*4+3)));if(e.some(a=>!Number.isFinite(a)||a===0))return null;let t=e.map((a,c)=>r.slice(c*4,c*4+3).map(u=>u/a));for(let a=0;a<3;a++)for(let c=a+1;c<3;c++)if(Math.abs(t[a].reduce((u,l,f)=>u+l*t[c][f],0))>1e-6)return null;let n=t[0][0]*(t[1][1]*t[2][2]-t[1][2]*t[2][1])-t[1][0]*(t[0][1]*t[2][2]-t[0][2]*t[2][1])+t[2][0]*(t[0][1]*t[1][2]-t[0][2]*t[1][1]);if(Math.abs(Math.abs(n)-1)>1e-6)return null;n<0&&(e[0]=-e[0],t[0]=t[0].map(a=>-a));let s=Array.from(new Gc().fromMatrix3(t.flat()).normalize()),i=r.slice(12,15),o=new Qs().translate(i).multiplyRight(new Qs().fromQuaternion(s)).scale(e);return Array.from(o).some((a,c)=>!Number.isFinite(a)||Math.abs(a-r[c])>1e-6*Math.max(1,Math.abs(r[c])))?null:{translation:i,rotation:s,scale:e}}var NE=p(()=>{"use strict";Uf()});function VE(r,e,t){let n=new Set,s=r.extensionsRequired?.includes(qr)||!1;for(let[o,a]of(r.materials||[]).entries()){let c=a,u=a.extensions?.[qr];if(u===void 0){XC(c,r,e,t);continue}zE(c,u);let l=`material ${o}`;if(!pr(u)||typeof u.technique!="string"||!["CONSTANT","LAMBERT","PHONG","BLINN"].includes(u.technique)){e(`${l} unknown ${qr} technique`);continue}if(u.values!==void 0&&!pr(u.values)){e(`${l} common material values must be an object`);continue}let f=u.values||{},d=Object.keys(u).filter(I=>!["technique","values","doubleSided","transparent","jointCount"].includes(I)),h=Object.keys(f).filter(I=>!["ambient","diffuse","emission","specular","shininess","transparency","doubleSided","transparent"].includes(I));(d.length||h.length)&&e(`${l} unrecognized common material fields ${[...d,...h].join(", ")}`),u.jointCount!==void 0&&(!Number.isSafeInteger(u.jointCount)||Number(u.jointCount)<0)&&e(`${l} invalid common material jointCount`);let m=CE(f.emission,r,`${l} emission`,e),b=u.technique==="CONSTANT",g=b?m:CE(f.diffuse,r,`${l} diffuse`,e),y=f.transparency===void 0?1:f.transparency,x=typeof y=="number"&&Number.isFinite(y)&&y>=0&&y<=1;x||e(`${l} common material transparency must be in [0, 1]`);let T=UE(u,f,"transparent",l,e),_=UE(u,f,"doubleSided",l,e);f.ambient!==void 0&&!PE(f.ambient)&&e(`${l} ambient lighting`),["PHONG","BLINN"].includes(String(u.technique))&&(f.specular!==void 0&&!PE(f.specular)&&e(`${l} specular/shininess lighting`),f.shininess!==void 0&&(typeof f.shininess!="number"||!Number.isFinite(f.shininess)||f.shininess<0)&&e(`${l} invalid common material shininess`)),a.pbrMetallicRoughness||={};let v=a.pbrMetallicRoughness;if(v.metallicFactor??=0,v.roughnessFactor??=1,g){let I=[...g.factor];I[3]*=x?y:1,v.baseColorFactor??=I,g.texture&&(v.baseColorTexture??=g.texture)}a.doubleSided??=_,a.alphaMode??=T?"BLEND":"OPAQUE",b?(a.extensions[Ry]??={},HC(r,Ry,s),t(`Converted ${l} CONSTANT emission to an unlit material.`)):(m&&(a.emissiveFactor??=m.factor.slice(0,3),m.texture&&(a.emissiveTexture??=m.texture)),t(`Approximated ${l} ${String(u.technique)} lighting with rough non-metallic PBR factors.`)),typeof c.technique=="string"?n.add(c.technique):c.technique!==void 0&&e(`${l} invalid fallback technique ID`),delete c.technique,delete c.values,delete a.extensions[qr],Object.keys(a.extensions).length||delete a.extensions}let i=WE(r);return(r.extensions?.[qr]!==void 0||(r.nodes||[]).some(o=>o.extensions?.[qr]!==void 0))&&e(`${qr} lights or scene payloads`),i.has(qr)||(r.extensionsUsed=r.extensionsUsed?.filter(o=>o!==qr),r.extensionsRequired=r.extensionsRequired?.filter(o=>o!==qr)),n}function jE(r,e){if(!e.size||[...WE(r)].some(c=>![qr,Ry].includes(c))||(r.materials||[]).some(c=>c.technique!==void 0||c.values!==void 0))return!1;let t=r;if(["techniques","programs","shaders"].some(c=>t[c]!==void 0&&!pr(t[c])))return!1;let n=pr(t.techniques)?t.techniques:{},s=pr(t.programs)?t.programs:{},i=pr(t.shaders)?t.shaders:{},o=new Set,a=new Set;if(Object.keys(n).some(c=>!e.has(c)))return!1;for(let c of Object.values(n))pr(c)&&typeof c.program=="string"&&o.add(c.program);if(Object.keys(s).some(c=>!o.has(c)))return!1;for(let c of Object.values(s))if(pr(c))for(let u of["vertexShader","fragmentShader"])typeof c[u]=="string"&&a.add(c[u]);return Object.keys(i).every(c=>a.has(c))}function XC(r,e,t,n){zE(r);let s=pr(r.values)?r.values:{},i=s.tex||s.texture2d_0||s.diffuseTex||s.diffuse,o=GE(e,i),a=ky(s.diffuse)?s.diffuse:void 0;if(o!==-1||a){let c=a?[...a]:[1,1,1,1],u=s.transparency;typeof u=="number"&&u>=0&&u<=1&&(c[3]*=u),r.pbrMetallicRoughness||={},r.pbrMetallicRoughness.metallicFactor??=0,r.pbrMetallicRoughness.roughnessFactor??=1,r.pbrMetallicRoughness.baseColorFactor??=c,o!==-1&&(r.pbrMetallicRoughness.baseColorTexture??={index:o}),r.pbrMetallicRoughness.baseColorFactor[3]<1&&(r.alphaMode||="BLEND"),n("Approximated glTF v1 diffuse material values with PBR material factors.")}(r.technique||r.values)&&t(`material technique ${r.technique||"<unnamed>"}`)}function CE(r,e,t,n){if(r===void 0)return{factor:[0,0,0,1]};if(ky(r))return{factor:[...r]};let s=GE(e,r);return s!==-1?{factor:[1,1,1,1],texture:{index:s}}:(n(`${t} requires an RGBA factor in [0, 1] or a resolved texture ID`),null)}function GE(r,e){return typeof e!="string"?-1:(r.textures||[]).findIndex(t=>t.id===e)}function UE(r,e,t,n,s){r[t]!==void 0&&e[t]!==void 0&&r[t]!==e[t]&&s(`${n} conflicting common material ${t}`);let i=e[t]!==void 0?e[t]:r[t]!==void 0?r[t]:!1;return typeof i=="boolean"?i:(s(`${n} common material ${t} must be boolean`),!1)}function zE(r,e){let t=pr(r.extras)?r.extras:r.extras===void 0?{}:{originalExtras:r.extras},n=pr(t.gltf1)?t.gltf1:t.gltf1===void 0?{}:{originalExtras:t.gltf1},s={technique:r.technique,values:r.values,...e===void 0?{}:{commonMaterial:e}},i=Object.keys(s).some(o=>Object.hasOwn(n,o));r.extras={...t,gltf1:{...n,...s,...i?{originalExtras:n}:{}}}}function HC(r,e,t){r.extensionsUsed=[...new Set([...r.extensionsUsed||[],e])],t&&(r.extensionsRequired=[...new Set([...r.extensionsRequired||[],e])])}function WE(r){let e=new Set,t=[r],n=new Set;for(;t.length;){let s=t.pop();if(!(!s||typeof s!="object"||n.has(s))){if(n.add(s),pr(s)&&pr(s.extensions))for(let i of Object.keys(s.extensions))e.add(i);for(let[i,o]of Object.entries(s))i!=="extras"&&t.push(o)}}return e}function ky(r){return Array.isArray(r)&&r.length===4&&r.every(e=>typeof e=="number"&&Number.isFinite(e)&&e>=0&&e<=1)}function PE(r){return ky(r)&&r.slice(0,3).every(e=>e===0)}function pr(r){return r!==null&&typeof r=="object"&&!Array.isArray(r)}var qr,Ry,$E=p(()=>{"use strict";qr="KHR_materials_common",Ry="KHR_materials_unlit"});function qE(r,e={}){let t=new Cy;return t.normalize(r,e,!0),()=>t.finishNormalization(r)}var Ny,JC,Cy,KE=p(()=>{"use strict";cE();fE();hE();bE();pu();_E();vE();SE();LE();ME();RE();NE();$E();Ny={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",cameras:"camera",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},JC={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",camera:"cameras",inverseBindMatrices:"accessors",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},Cy=class r{idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}};json;report={converted:!1,mutated:!1,unsupported:[],warnings:[]};strict=!1;log;finished=!1;pendingAccessors=new Set;accessorConversions=new Map;uriBufferIndices=new Set;normalize(e,t={},n=!1){if(t.mutate===!1){let o={...e,json:JSON.parse(JSON.stringify(e.json))},a=new r().normalize(o,{...t,mutate:!0});return a.mutated=!1,a}this.strict=t.normalize==="strict",this.log=t.log,this.json=e.json;let s=e.json;switch(s.asset&&s.asset.version){case"2.0":case"2.1":return this.report;case void 0:case"1.0":break;default:return this._warning(`Unknown glTF version ${s.asset.version}`),this.report}if(!t.normalize)throw new Error("glTF v1 is not supported.");this.report.converted=!0,this.report.mutated=!0,this.log?.log(1,"glTF: Converting glTF v1 to glTF v2 using experimental normalization.")(),this._addAsset(s),this._orderBinaryBufferPayloads(e),this._convertTopLevelObjectsToArrays(s),aE(e),this._convertObjectIdsToArrayIndices(s),this._updateObjects(s);for(let[o,a]of(s.buffers||[]).entries())typeof a.uri=="string"&&this.uriBufferIndices.add(o);let i=VE(s,o=>this._unsupported(o),o=>this._warning(o));return AE(s,(o,a)=>this._convertIdToIndex(o,a),o=>this._unsupported(o)),EE(s,o=>this._unsupported(o)),kE(s,o=>this._unsupported(o),o=>this._warning(o)),TE(s,o=>this._unsupported(o)),this.accessorConversions=yE(s),lE(s,o=>this.pendingAccessors.add(o)),dE(s,o=>this._convertIdToIndex(o,"node"),o=>this._unsupported(o)),this._updateNodes(s),IE(s,o=>this._unsupported(o),o=>this._warning(o)),this._preserveLegacyResources(s,i),this._removeEmptyCollections(s),n?this.report:this.finishNormalization(e)}finishNormalization(e){return this.report.converted&&!this.finished&&(DE(e,this.uriBufferIndices,t=>this._unsupported(t),t=>this._warning(t)),wE(e,this.accessorConversions,this.pendingAccessors,t=>this._unsupported(t),t=>this._warning(t)),pE(e,t=>this._unsupported(t)),OE(e,t=>this._unsupported(t),t=>this._warning(t)),this._finishReport(),this.log?.log(1,`glTF: Completed glTF v1 normalization (${this.report.unsupported.length} unsupported features).`)(),this.finished=!0),this.report}_unsupported(e){if(this.report.unsupported.push(e),this.log?.warn(`glTF v1 normalization does not support ${e}`)(),this.strict)throw new Error(`glTF v1 normalization does not support ${e}`)}_warning(e){this.report.warnings.push(e),this.log?.warn(`glTF: ${e}`)()}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_orderBinaryBufferPayloads(e){let t=this.json.buffers;if(!t||Array.isArray(t)||!t.binary_glTF)return;let s=Object.keys(t).indexOf("binary_glTF");s>0&&e.buffers?.length&&(e.buffers=[e.buffers[s],...e.buffers.filter((i,o)=>o!==s)])}_convertTopLevelObjectsToArrays(e){for(let t in Ny)this._convertTopLevelObjectToArray(e,t)}_convertTopLevelObjectToArray(e,t){let n=e[t];if(!n||Array.isArray(n))return;e[t]=[];let s=Object.keys(n),i=t==="buffers"&&s.includes("binary_glTF")?["binary_glTF",...s.filter(o=>o!=="binary_glTF")]:s;for(let o of i){let a=n[o];a.id=a.id||o;let c=e[t].length;e[t].push(a),this.idToIndexMap[t][o]=c}}_convertObjectIdsToArrayIndices(e){for(let t in Ny)this._convertIdsToIndices(e,t);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(let t of e.textures)this._convertTextureIds(t);for(let t of e.meshes)this._convertMeshIds(t);for(let t of e.nodes)this._convertNodeIds(t);for(let t of e.scenes)this._convertSceneIds(t)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(let t of e.primitives){let{attributes:n,indices:s,material:i}=t,o=new Map;for(let a in n){let c=Dy(a),u=o.get(c);if(u!==void 0&&n[u]!==n[a])throw new Error(`glTF v1: conflicting attribute aliases ${u} and ${a}`);o.set(c,a)}t.attributes=Object.fromEntries(Object.entries(n).map(([a,c])=>[Dy(a),this._convertIdToIndex(c,"accessor")])),s&&(t.indices=this._convertIdToIndex(s,"accessor")),i&&(t.material=this._convertIdToIndex(i,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map(t=>this._convertIdToIndex(t,"node"))),e.meshes&&(e.meshes=e.meshes.map(t=>this._convertIdToIndex(t,"mesh")))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map(t=>this._convertIdToIndex(t,"node")))}_convertIdsToIndices(e,t){e[t]||(e[t]=[]);for(let n of e[t])for(let s in n){let i=n[s],o=this._convertIdToIndex(i,s);n[s]=o}}_convertIdToIndex(e,t){let n=JC[t];if(n in this.idToIndexMap){let s=this.idToIndexMap[n][e];if(!Number.isFinite(s))throw new Error(`gltf v1: failed to resolve ${t} with id ${e}`);return s}return e}_updateObjects(e){for(let t of this.json.buffers)delete t.type}_updateNodes(e){let t=e.nodes||[];for(let n=0;n<t.length;n++){let s=t[n];if(!Array.isArray(s.meshes))continue;let i=s.meshes;delete s.meshes,s.mesh=i.shift();for(let o of i){let a={...s,mesh:o,children:void 0};delete a.id,delete a.matrix,delete a.translation,delete a.rotation,delete a.scale,t.push(a),s.children||=[],s.children.push(t.length-1)}}}_preserveLegacyResources(e,t){let n=jE(e,t),s={};for(let i of["techniques","programs","shaders"])e[i]&&(s[i]=e[i],delete e[i],n||this._unsupported(`legacy ${i}`));Object.keys(s).length&&(e.extras={...e.extras,gltf1Resources:s},n&&this._warning("Preserved shader resources overridden by converted common materials."))}_removeEmptyCollections(e){for(let t of e.nodes||[])Array.isArray(t.children)&&t.children.length===0&&delete t.children;for(let t of e.scenes||[])Array.isArray(t.nodes)&&t.nodes.length===0&&delete t.nodes;for(let t of[...Object.keys(Ny),"extensionsUsed","extensionsRequired"])Array.isArray(e[t])&&e[t].length===0&&delete e[t]}_finishReport(){this.report.unsupported.length&&this.report.warnings.push(`Converted glTF v1 with unsupported features: ${this.report.unsupported.join(", ")}`)}}});function YC(r,e){let t=r.basis;return{...r,core:{...r.core,mimeType:e},basis:{...t,format:t?.format||"auto"}}}async function XE(r,e,t=0,n,s){return await HE(r,e,t,n,s)}async function HE(r,e,t,n,s,i){QC(r,e,t,n);let o=qE(r,{normalize:n?.gltf?.normalize,log:n?.core?.log});return await nE(r,n,s),n?.gltf?.loadBuffers&&r.json.buffers&&await a3(r,n,s,n.gltf.loadBufferIndices),o(),n?.gltf?.loadFiles&&r.json.files&&await o3(r,n,s),n?.gltf?.loadExternalAssets&&r.json.externalAssets&&await e3(r,n,s,i),n?.gltf?.loadImages&&await c3(r,n,s),await sE(r,n,s),r}function QC(r,e,t,n){if(n.core?.baseUrl&&(r.baseUri=n.core?.baseUrl),e instanceof ArrayBuffer&&!PI(e,t,n.glb)&&(e=new TextDecoder().decode(e)),typeof e=="string")r.json=sb(e);else if(e instanceof ArrayBuffer){let l={};t=ad(l,e,t,n.glb),H(l.type==="glTF",`Invalid GLB magic string ${l.type}`),r._glb=l,r.json=l.json}else e&&typeof e=="object"?r.json=e:H(!1,"GLTF: must be ArrayBuffer, string, or parsed JSON object");let s=r.json.buffers||[],i=Array.isArray(s)?s:[],o=Array.isArray(s)?[]:Object.keys(s);if(r.buffers=new Array(Array.isArray(s)?s.length:o.length).fill(null),r._glb){let{binChunks:l}=r._glb;for(let g=0;g<i.length;g++){let y=i[g];if(y.chunk===void 0)continue;H(r._glb.version===3,"glTF buffer.chunk requires a GLB v3 container."),H(y.uri===void 0,`glTF buffer ${g} cannot define both uri and chunk.`);let x=l.find(T=>T.chunkIndex===y.chunk);H(x,`glTF buffer ${g} references missing GLB BIN chunk ${y.chunk}.`),H(y.byteLength<=x.byteLength,`glTF buffer ${g} is larger than GLB BIN chunk ${y.chunk}.`),r.buffers[g]={arrayBuffer:x.arrayBuffer,byteOffset:x.byteOffset,byteLength:y.byteLength}}let f=i.map((g,y)=>g.uri===void 0?y:-1).filter(g=>g!==-1),d=l.find(g=>g.chunkIndex===1),h=r._glb.version<3||r._glb.jsonChunkIndex===0&&i[0]?.chunk===void 0&&f.length===1&&f[0]===0&&!!d,m=r._glb.version<3?l[0]:d,b=r._glb.version===1&&!Array.isArray(s)?o.indexOf("binary_glTF"):0;if(h&&m&&b>=0&&(r.buffers[b]={arrayBuffer:m.arrayBuffer,byteOffset:m.byteOffset,byteLength:m.byteLength}),r._glb.version===3)for(let g of f)H(r.buffers[g],`glTF buffer ${g} without a uri must define a valid GLB v3 chunk.`)}if(!r._glb){let l=i.findIndex(f=>f.chunk!==void 0);H(l===-1,`glTF buffer ${l} uses chunk outside a GLB.`)}let a=r.json.images||[];r.images=new Array(a.length).fill({});let c=r.json.files||[];r.files=new Array(c.length).fill(null);let u=r.json.externalAssets||[];r.externalAssets=new Array(u.length).fill(null)}async function e3(r,e,t,n){let s=r.json.externalAssets||[],i=new Set;for(let a of r.json.nodes||[])a.externalAsset!==void 0&&(H(a.externalAsset>=0&&a.externalAsset<s.length,`glTF node references missing external asset ${a.externalAsset}.`),i.add(a.externalAsset));let o=n||r3(t.url?new Set([cd(t.url)]):new Set);for(let a of i)await t3(r,a,e,t,o)}async function t3(r,e,t,n,s){let i=r.json.externalAssets?.[e];if(!i)throw new Error(`Missing glTF external asset ${e}.`);H(Number.isInteger(i.file)&&i.file>=0&&i.file<(r.json.files?.length||0),`glTF external asset ${e} references missing file ${i.file}.`);let o=await fd(r,i.file,t,n),a=o.url;H(!a||!s.ancestors.has(a),`glTF external asset cycle detected at ${a}.`);let c=a?s.cache.get(a):void 0;if(!c){let u=n3(r,o,t,n,s),l={...s,ancestors:new Set(s.ancestors)};a&&l.ancestors.add(a);let f=eo(o.arrayBuffer,o.byteOffset,o.byteLength);c=HE({},f,0,t,u,l),a&&s.cache.set(a,c)}r.externalAssets=r.externalAssets||[],r.externalAssets[e]=await c}function r3(r){return{cache:new Map,ancestors:r,packageIds:{next:0}}}function n3(r,e,t,n,s){if(e.url&&!e.url.startsWith("data:"))return{...n,url:e.url,filename:i3(e.url),baseUrl:s3(e.url)};let i=`${ZC}${s.packageIds.next++}`,o=`${i}/`;return{...n,url:e.name,filename:e.name,baseUrl:i,fetch:async(a,c)=>{let u=a;if(u.startsWith("data:"))return await n.fetch(a,c);let l=u.startsWith(o)?u.slice(o.length):u,f=wg(r,l);H(f>=0,`glTF package does not contain file ${l}.`);let d=await fd(r,f,t,n),h=eo(d.arrayBuffer,d.byteOffset,d.byteLength);return new Response(h,{headers:{"content-type":d.mimeType}})}}}function s3(r){let e=r.lastIndexOf("/");return e>=0?r.slice(0,e):""}function i3(r){let e=r.lastIndexOf("/");return e>=0?r.slice(e+1):r}async function o3(r,e,t){let n=r.json.files||[];await Promise.all(n.map((s,i)=>fd(r,i,e,t)))}async function a3(r,e,t,n){let s=r.json.buffers||[],i=n?new Set(typeof n=="function"?n(r.json):n):void 0;for(let o=0;o<s.length;++o){if(i&&!i.has(o))continue;let a=s[o];if(a.uri){let{fetch:c}=t;H(c);let u=Kn(a.uri,e,t),f=await(await t?.fetch?.(u))?.arrayBuffer?.();r.buffers[o]={arrayBuffer:f,byteOffset:0,byteLength:f.byteLength},delete a.uri}else r.buffers[o]===null&&(r.buffers[o]={arrayBuffer:new ArrayBuffer(a.byteLength),byteOffset:0,byteLength:a.byteLength})}}async function c3(r,e,t){let n=u3(r),s=r.json.images||[],i=[];for(let o of n)i.push(l3(r,s[o],o,e,t));return await Promise.all(i)}function u3(r){let e=new Set;r.json.asset.thumbnail!==void 0&&e.add(r.json.asset.thumbnail);let t=r.json.textures||[];for(let n of t)n.source!==void 0&&e.add(n.source);return Array.from(e).sort()}async function l3(r,e,t,n,s){let i;if(e.uri&&!e.hasOwnProperty("bufferView")){let l=Kn(e.uri,n,s),{fetch:f}=s;i=await(await f(l)).arrayBuffer(),e.bufferView={data:i}}if(Number.isFinite(e.bufferView)){let l=hr(r.json,r.buffers,e.bufferView);i=eo(l.buffer,l.byteOffset,l.byteLength)}H(i,"glTF image has no data");let o=YC(n,e.mimeType),a=iu(s);if(!!(a&&!n.gltf?.excludeExtensions?.includes("MSFT_texture_dds")&&r.json.textures?.some(l=>l.source===t&&l.extensions?.MSFT_texture_dds?.source===t))){let l=await Xs(i,a,n,s);H(l.length>0,"MSFT_texture_dds parser returned no texture levels"),r.images=r.images||[],r.images[t]={compressed:!0,mipmaps:!0,width:l[0].width,height:l[0].height,data:l};return}let u=await Xs(i,[Hc,io],o,s);u&&u[0]&&(u={compressed:!0,mipmaps:!1,width:u[0].width,height:u[0].height,data:u[0]}),r.images=r.images||[],r.images[t]=u}var ZC,JE=p(()=>{"use strict";Ue();qn();qn();oo();bg();Yc();WI();ao();oE();oy();KE();ZC="gltf-package://"});async function YE(r,e={},t){let n={...Uy.options,...e};n.gltf={...Uy.options.gltf,...n.gltf};let s=e?.glb?.byteOffset||0;return await XE({},r,s,n,t)}var Rre,f3,Uy,QE=p(()=>{"use strict";JE();eL();({preload:Rre,...f3}=ZE),Uy={...f3,parse:YE}});var Py={};J(Py,{GLTFLoaderWithParser:()=>Uy,parse:()=>YE});var Vy=p(()=>{"use strict";QE()});async function d3(){let{GLTFLoaderWithParser:r}=await Promise.resolve().then(()=>(Vy(),Py));return r}var ZE,eL=p(()=>{"use strict";Zb();eg();ZE={dataType:null,batchType:null,...Uv,version:Yf,preload:d3,options:{gltf:{normalize:!0,loadBuffers:!0,loadFiles:!1,loadExternalAssets:!1,loadImages:!0,loadAudio:!0,decompressMeshes:!0}}}});async function m3(r,e){return tL(r,e)}function tL(r,e){let t={};return ad(t,r,e?.glb?.byteOffset||0,e?.glb),t}var Gre,h3,p3,rL=p(()=>{"use strict";bg();sL();({preload:Gre,...h3}=nL),p3={...h3,parse:m3,parseSync:tL}});var jy={};J(jy,{GLBLoaderWithParser:()=>p3});var Gy=p(()=>{"use strict";rL()});async function b3(){let{GLBLoaderWithParser:r}=await Promise.resolve().then(()=>(Gy(),jy));return r}var nL,sL=p(()=>{"use strict";Zb();eg();nL={dataType:null,batchType:null,...Pv,version:Yf,preload:b3,options:{glb:{strict:!1}}}});function g3(r){return typeof r=="string"?r.charAt(0).toLowerCase()+r.slice(1):r}function Ld(r){if(Array.isArray(r))return r.map(e=>Ld(e));if(r&&typeof r=="object"){let e={};for(let[t,n]of Object.entries(r))Object.defineProperty(e,g3(t),{value:Ld(n),enumerable:!0,configurable:!0,writable:!0});return e}return r}var iL=p(()=>{"use strict"});var oL,y3,w3,x3,bu,zy,T3,_3,gu,Wy,Sa,aL=p(()=>{"use strict";oL={ontext:()=>{},onprocessinginstruction:()=>{},onsgmldeclaration:()=>{},ondoctype:()=>{},oncomment:()=>{},onopentagstart:()=>{},onattribute:()=>{},onopentag:()=>{},onclosetag:()=>{},onopencdata:()=>{},oncdata:()=>{},onclosecdata:()=>{},onerror:()=>{},onend:()=>{},onready:()=>{},onscript:()=>{},onopennamespace:()=>{},onclosenamespace:()=>{}},y3={...oL,strict:!1,MAX_BUFFER_LENGTH:64*1024,lowercase:!1,lowercasetags:!1,noscript:!1,strictEntities:!1,preserveCase:!1,caseInsensitiveTags:!1,processEntities:!0,xmlns:void 0,position:void 0,trim:void 0,normalize:void 0},w3=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"],x3=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"],bu=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,zy=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,T3=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,_3=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,gu={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830};Object.keys(gu).forEach(r=>{let e=gu[r];gu[r]=typeof e=="number"?String.fromCharCode(e):e});Wy=class r{EVENTS=w3;ENTITIES={...gu};XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"};S=0;opt;trackPosition=!1;column=0;line=0;c="";error;q="";bufferCheckPosition;closed=!1;tags=[];looseCase="";closedRoot=!1;sawRoot=!1;strict=!1;tag;strictEntities;state;noscript=!1;attribList=[];ns;position=0;STATE={BEGIN:this.S++,BEGIN_WHITESPACE:this.S++,TEXT:this.S++,TEXT_ENTITY:this.S++,OPEN_WAKA:this.S++,SGML_DECL:this.S++,SGML_DECL_QUOTED:this.S++,DOCTYPE:this.S++,DOCTYPE_QUOTED:this.S++,DOCTYPE_DTD:this.S++,DOCTYPE_DTD_QUOTED:this.S++,COMMENT_STARTING:this.S++,COMMENT:this.S++,COMMENT_ENDING:this.S++,COMMENT_ENDED:this.S++,CDATA:this.S++,CDATA_ENDING:this.S++,CDATA_ENDING_2:this.S++,PROC_INST:this.S++,PROC_INST_BODY:this.S++,PROC_INST_ENDING:this.S++,OPEN_TAG:this.S++,OPEN_TAG_SLASH:this.S++,ATTRIB:this.S++,ATTRIB_NAME:this.S++,ATTRIB_NAME_SAW_WHITE:this.S++,ATTRIB_VALUE:this.S++,ATTRIB_VALUE_QUOTED:this.S++,ATTRIB_VALUE_CLOSED:this.S++,ATTRIB_VALUE_UNQUOTED:this.S++,ATTRIB_VALUE_ENTITY_Q:this.S++,ATTRIB_VALUE_ENTITY_U:this.S++,CLOSE_TAG:this.S++,CLOSE_TAG_SAW_WHITE:this.S++,SCRIPT:this.S++,SCRIPT_ENDING:this.S++};BUFFERS=x3;CDATA="[CDATA[";DOCTYPE="DOCTYPE";XML_NAMESPACE="http://www.w3.org/XML/1998/namespace";XMLNS_NAMESPACE="http://www.w3.org/2000/xmlns/";rootNS={xml:this.XML_NAMESPACE,xmlns:this.XMLNS_NAMESPACE};comment;sgmlDecl;textNode="";tagName;doctype;procInstName;procInstBody;entity="";attribName;attribValue;cdata="";script="";startTagPosition=0;constructor(){this.S=0;for(let e in this.STATE)this.STATE.hasOwnProperty(e)&&(this.STATE[this.STATE[e]]=e);this.S=this.STATE}static charAt(e,t){let n="";return t<e.length&&(n=e.charAt(t)),n}static isWhitespace(e){return e===" "||e===`
|
|
44
44
|
`||e==="\r"||e===" "}static isQuote(e){return e==='"'||e==="'"}static isAttribEnd(e){return e===">"||r.isWhitespace(e)}static isMatch(e,t){return e.test(t)}static notMatch(e,t){return!r.isMatch(e,t)}static qname(e,t){let s=e.indexOf(":")<0?["",e]:e.split(":"),i=s[0],o=s[1];return t&&e==="xmlns"&&(i="xmlns",o=""),{prefix:i,local:o}}write(e){if(this.error)throw this.error;if(this.closed)return this.errorFunction("Cannot write after close. Assign an onready handler.");if(e===null)return this.end();typeof e=="object"&&(e=e.toString());let t=0,n;for(;n=r.charAt(e,t++),this.c=n,!!n;)switch(this.trackPosition&&(this.position++,n===`
|
|
45
45
|
`?(this.line++,this.column=0):this.column++),this.state){case this.S.BEGIN:if(this.state=this.S.BEGIN_WHITESPACE,n==="\uFEFF")continue;this.beginWhiteSpace(n);continue;case this.S.BEGIN_WHITESPACE:this.beginWhiteSpace(n);continue;case this.S.TEXT:if(this.sawRoot&&!this.closedRoot){let o=t-1;for(;n&&n!=="<"&&n!=="&";)n=r.charAt(e,t++),n&&this.trackPosition&&(this.position++,n===`
|
|
46
|
-
`?(this.line++,this.column=0):this.column++);this.textNode+=e.substring(o,t-1)}n==="<"&&!(this.sawRoot&&this.closedRoot&&!this.strict)?(this.state=this.S.OPEN_WAKA,this.startTagPosition=this.position):(!r.isWhitespace(n)&&(!this.sawRoot||this.closedRoot)&&this.strictFail("Text data outside of root node."),n==="&"?this.state=this.S.TEXT_ENTITY:this.textNode+=n);continue;case this.S.SCRIPT:n==="<"?this.state=this.S.SCRIPT_ENDING:this.script+=n;continue;case this.S.SCRIPT_ENDING:n==="/"?this.state=this.S.CLOSE_TAG:(this.script+=`<${n}`,this.state=this.S.SCRIPT);continue;case this.S.OPEN_WAKA:if(n==="!")this.state=this.S.SGML_DECL,this.sgmlDecl="";else if(!r.isWhitespace(n))if(r.isMatch(
|
|
46
|
+
`?(this.line++,this.column=0):this.column++);this.textNode+=e.substring(o,t-1)}n==="<"&&!(this.sawRoot&&this.closedRoot&&!this.strict)?(this.state=this.S.OPEN_WAKA,this.startTagPosition=this.position):(!r.isWhitespace(n)&&(!this.sawRoot||this.closedRoot)&&this.strictFail("Text data outside of root node."),n==="&"?this.state=this.S.TEXT_ENTITY:this.textNode+=n);continue;case this.S.SCRIPT:n==="<"?this.state=this.S.SCRIPT_ENDING:this.script+=n;continue;case this.S.SCRIPT_ENDING:n==="/"?this.state=this.S.CLOSE_TAG:(this.script+=`<${n}`,this.state=this.S.SCRIPT);continue;case this.S.OPEN_WAKA:if(n==="!")this.state=this.S.SGML_DECL,this.sgmlDecl="";else if(!r.isWhitespace(n))if(r.isMatch(bu,n))this.state=this.S.OPEN_TAG,this.tagName=n;else if(n==="/")this.state=this.S.CLOSE_TAG,this.tagName="";else if(n==="?")this.state=this.S.PROC_INST,this.procInstName=this.procInstBody="";else{if(this.strictFail("Unencoded <"),this.startTagPosition+1<this.position){let o=this.position-this.startTagPosition;n=new Array(o).join(" ")+n}this.textNode+=`<${n}`,this.state=this.S.TEXT}continue;case this.S.SGML_DECL:(this.sgmlDecl+n).toUpperCase()===this.CDATA?(this.emitNode("onopencdata"),this.state=this.S.CDATA,this.sgmlDecl="",this.cdata=""):this.sgmlDecl+n==="--"?(this.state=this.S.COMMENT,this.comment="",this.sgmlDecl=""):(this.sgmlDecl+n).toUpperCase()===this.DOCTYPE?(this.state=this.S.DOCTYPE,(this.doctype||this.sawRoot)&&this.strictFail("Inappropriately located doctype declaration"),this.doctype="",this.sgmlDecl=""):n===">"?(this.emitNode("onsgmldeclaration",this.sgmlDecl),this.sgmlDecl="",this.state=this.S.TEXT):r.isQuote(n)?(this.state=this.S.SGML_DECL_QUOTED,this.sgmlDecl+=n):this.sgmlDecl+=n;continue;case this.S.SGML_DECL_QUOTED:n===this.q&&(this.state=this.S.SGML_DECL,this.q=""),this.sgmlDecl+=n;continue;case this.S.DOCTYPE:n===">"?(this.state=this.S.TEXT,this.emitNode("ondoctype",this.doctype),this.doctype=!0):(this.doctype+=n,n==="["?this.state=this.S.DOCTYPE_DTD:r.isQuote(n)&&(this.state=this.S.DOCTYPE_QUOTED,this.q=n));continue;case this.S.DOCTYPE_QUOTED:this.doctype+=n,n===this.q&&(this.q="",this.state=this.S.DOCTYPE);continue;case this.S.DOCTYPE_DTD:this.doctype+=n,n==="]"?this.state=this.S.DOCTYPE:r.isQuote(n)&&(this.state=this.S.DOCTYPE_DTD_QUOTED,this.q=n);continue;case this.S.DOCTYPE_DTD_QUOTED:this.doctype+=n,n===this.q&&(this.state=this.S.DOCTYPE_DTD,this.q="");continue;case this.S.COMMENT:n==="-"?this.state=this.S.COMMENT_ENDING:this.comment+=n;continue;case this.S.COMMENT_ENDING:n==="-"?(this.state=this.S.COMMENT_ENDED,this.comment=this.textApplyOptions(this.comment),this.comment&&this.emitNode("oncomment",this.comment),this.comment=""):(this.comment+=`-${n}`,this.state=this.S.COMMENT);continue;case this.S.COMMENT_ENDED:n!==">"?(this.strictFail("Malformed comment"),this.comment+=`--${n}`,this.state=this.S.COMMENT):this.state=this.S.TEXT;continue;case this.S.CDATA:n==="]"?this.state=this.S.CDATA_ENDING:this.cdata+=n;continue;case this.S.CDATA_ENDING:n==="]"?this.state=this.S.CDATA_ENDING_2:(this.cdata+=`]${n}`,this.state=this.S.CDATA);continue;case this.S.CDATA_ENDING_2:n===">"?(this.cdata&&this.emitNode("oncdata",this.cdata),this.emitNode("onclosecdata"),this.cdata="",this.state=this.S.TEXT):n==="]"?this.cdata+="]":(this.cdata+=`]]${n}`,this.state=this.S.CDATA);continue;case this.S.PROC_INST:n==="?"?this.state=this.S.PROC_INST_ENDING:r.isWhitespace(n)?this.state=this.S.PROC_INST_BODY:this.procInstName+=n;continue;case this.S.PROC_INST_BODY:if(!this.procInstBody&&r.isWhitespace(n))continue;n==="?"?this.state=this.S.PROC_INST_ENDING:this.procInstBody+=n;continue;case this.S.PROC_INST_ENDING:n===">"?(this.emitNode("onprocessinginstruction",{name:this.procInstName,body:this.procInstBody}),this.procInstName=this.procInstBody="",this.state=this.S.TEXT):(this.procInstBody+=`?${n}`,this.state=this.S.PROC_INST_BODY);continue;case this.S.OPEN_TAG:r.isMatch(zy,n)?this.tagName+=n:(this.newTag(),n===">"?this.openTag():n==="/"?this.state=this.S.OPEN_TAG_SLASH:(r.isWhitespace(n)||this.strictFail("Invalid character in tag name"),this.state=this.S.ATTRIB));continue;case this.S.OPEN_TAG_SLASH:n===">"?(this.openTag(!0),this.closeTag()):(this.strictFail("Forward-slash in opening tag not followed by >"),this.state=this.S.ATTRIB);continue;case this.S.ATTRIB:if(r.isWhitespace(n))continue;n===">"?this.openTag():n==="/"?this.state=this.S.OPEN_TAG_SLASH:r.isMatch(bu,n)?(this.attribName=n,this.attribValue="",this.state=this.S.ATTRIB_NAME):this.strictFail("Invalid attribute name");continue;case this.S.ATTRIB_NAME:n==="="?this.state=this.S.ATTRIB_VALUE:n===">"?(this.strictFail("Attribute without value"),this.attribValue=this.attribName,this.attrib(),this.openTag()):r.isWhitespace(n)?this.state=this.S.ATTRIB_NAME_SAW_WHITE:r.isMatch(zy,n)?this.attribName+=n:this.strictFail("Invalid attribute name");continue;case this.S.ATTRIB_NAME_SAW_WHITE:if(n==="=")this.state=this.S.ATTRIB_VALUE;else{if(r.isWhitespace(n))continue;this.strictFail("Attribute without value"),Object.defineProperty(this.tag.attributes,this.attribName,{value:"",enumerable:!0,configurable:!0,writable:!0}),this.attribValue="",this.emitNode("onattribute",{name:this.attribName,value:""}),this.attribName="",n===">"?this.openTag():r.isMatch(bu,n)?(this.attribName=n,this.state=this.S.ATTRIB_NAME):(this.strictFail("Invalid attribute name"),this.state=this.S.ATTRIB)}continue;case this.S.ATTRIB_VALUE:if(r.isWhitespace(n))continue;r.isQuote(n)?(this.q=n,this.state=this.S.ATTRIB_VALUE_QUOTED):(this.strictFail("Unquoted attribute value"),this.state=this.S.ATTRIB_VALUE_UNQUOTED,this.attribValue=n);continue;case this.S.ATTRIB_VALUE_QUOTED:if(n!==this.q){n==="&"?this.state=this.S.ATTRIB_VALUE_ENTITY_Q:this.attribValue+=n;continue}this.attrib(),this.q="",this.state=this.S.ATTRIB_VALUE_CLOSED;continue;case this.S.ATTRIB_VALUE_CLOSED:r.isWhitespace(n)?this.state=this.S.ATTRIB:n===">"?this.openTag():n==="/"?this.state=this.S.OPEN_TAG_SLASH:r.isMatch(bu,n)?(this.strictFail("No whitespace between attributes"),this.attribName=n,this.attribValue="",this.state=this.S.ATTRIB_NAME):this.strictFail("Invalid attribute name");continue;case this.S.ATTRIB_VALUE_UNQUOTED:if(!r.isAttribEnd(n)){n==="&"?this.state=this.S.ATTRIB_VALUE_ENTITY_U:this.attribValue+=n;continue}this.attrib(),n===">"?this.openTag():this.state=this.S.ATTRIB;continue;case this.S.CLOSE_TAG:if(this.tagName)n===">"?this.closeTag():r.isMatch(zy,n)?this.tagName+=n:this.script?(this.script+=`</${this.tagName}`,this.tagName="",this.state=this.S.SCRIPT):(r.isWhitespace(n)||this.strictFail("Invalid tagname in closing tag"),this.state=this.S.CLOSE_TAG_SAW_WHITE);else{if(r.isWhitespace(n))continue;r.notMatch(bu,n)?this.script?(this.script+=`</${n}`,this.state=this.S.SCRIPT):this.strictFail("Invalid tagname in closing tag."):this.tagName=n}continue;case this.S.CLOSE_TAG_SAW_WHITE:if(r.isWhitespace(n))continue;n===">"?this.closeTag():this.strictFail("Invalid characters in closing tag");continue;case this.S.TEXT_ENTITY:case this.S.ATTRIB_VALUE_ENTITY_Q:case this.S.ATTRIB_VALUE_ENTITY_U:let s,i;switch(this.state){case this.S.TEXT_ENTITY:s=this.S.TEXT,i="textNode";break;case this.S.ATTRIB_VALUE_ENTITY_Q:s=this.S.ATTRIB_VALUE_QUOTED,i="attribValue";break;case this.S.ATTRIB_VALUE_ENTITY_U:s=this.S.ATTRIB_VALUE_UNQUOTED,i="attribValue";break;default:throw new Error(`Unknown state: ${this.state}`)}n===";"?(this[i]+=this.parseEntity(),this.entity="",this.state=s):r.isMatch(this.entity.length?_3:T3,n)?this.entity+=n:(this.strictFail("Invalid character in entity name"),this[i]+=`&${this.entity}${n}`,this.entity="",this.state=s);continue;default:throw new Error(`Unknown state: ${this.state}`)}return this.position>=this.bufferCheckPosition&&this.checkBufferLength(),this}emit(e,t){if(this.events.hasOwnProperty(e)){let n=e.replace(/^on/,"");this.events[e](t,n,this)}}clearBuffers(){for(let e=0,t=this.BUFFERS.length;e<t;e++)this[this[e]]=""}flushBuffers(){this.closeText(),this.cdata!==""&&(this.emitNode("oncdata",this.cdata),this.cdata=""),this.script!==""&&(this.emitNode("onscript",this.script),this.script="")}end(){return this.sawRoot&&!this.closedRoot&&this.strictFail("Unclosed root tag"),this.strict&&this.state!==this.S.BEGIN&&this.state!==this.S.BEGIN_WHITESPACE&&this.state!==this.S.TEXT&&this.errorFunction("Unexpected end"),this.closeText(),this.c="",this.closed=!0,this.emit("onend"),new Sa(this.opt)}errorFunction(e){this.closeText(),this.trackPosition&&(e+=`
|
|
47
47
|
Line: ${this.line}
|
|
48
48
|
Column: ${this.column}
|
|
49
49
|
Char: ${this.c}`);let t=new Error(e);return this.error=t,this.emit("onerror",t),this}attrib(){if(!this.strict&&!this.opt.preserveCase&&(this.attribName=this.attribName[this.looseCase]()),this.attribList.indexOf(this.attribName)!==-1||Object.hasOwn(this.tag.attributes,this.attribName)){this.strictFail("Duplicate attribute"),this.attribName=this.attribValue="";return}if(this.opt.xmlns){let e=r.qname(this.attribName,!0),t=e.prefix,n=e.local;if(t==="xmlns")if(n==="xml"&&this.attribValue!==this.XML_NAMESPACE)this.strictFail(`xml: prefix must be bound to ${this.XML_NAMESPACE}
|
|
50
50
|
Actual: ${this.attribValue}`);else if(n==="xmlns"&&this.attribValue!==this.XMLNS_NAMESPACE)this.strictFail(`xmlns: prefix must be bound to ${this.XMLNS_NAMESPACE}
|
|
51
|
-
Actual: ${this.attribValue}`);else{let s=this.tag,i=this.tags[this.tags.length-1]||this;s.ns===i.ns&&(s.ns=Object.create(i.ns)),s.ns[n]=this.attribValue}this.attribList.push([this.attribName,this.attribValue])}else Object.defineProperty(this.tag.attributes,this.attribName,{value:this.attribValue,enumerable:!0,configurable:!0,writable:!0}),this.emitNode("onattribute",{name:this.attribName,value:this.attribValue});this.attribName=this.attribValue=""}newTag(){!this.strict&&!this.opt.preserveCase&&(this.tagName=this.tagName[this.looseCase]());let e=this.tags[this.tags.length-1]||this,t={name:this.tagName,attributes:{}};this.tag=t,this.opt.xmlns&&(t.ns=e.ns),this.attribList.length=0,this.emitNode("onopentagstart",t)}parseEntity(){let e=this.decodeEntity();return this.opt.processEntities===!1?`&${this.entity};`:e}decodeEntity(){let e=this.entity,t=e.toLowerCase(),n=NaN,s="";return typeof this.ENTITIES[e]=="string"||typeof this.ENTITIES[e]=="number"?this.ENTITIES[e]:typeof this.ENTITIES[t]=="string"||typeof this.ENTITIES[t]=="number"?this.ENTITIES[t]:(e=t,e.charAt(0)==="#"&&(e.charAt(1)==="x"?(e=e.slice(2),n=parseInt(e,16),s=n.toString(16)):(e=e.slice(1),n=parseInt(e,10),s=n.toString(10))),e=e.replace(/^0+/,""),Number.isNaN(n)||s.toLowerCase()!==e?(this.strictFail("Invalid character entity"),`&${this.entity};`):n<0||n>1114111||n>=55296&&n<=57343||n<32&&![9,10,13].includes(n)||n===65534||n===65535?(this.strictFail("Invalid character entity"),`&${this.entity};`):String.fromCodePoint(n))}beginWhiteSpace(e){e==="<"?(this.state=this.S.OPEN_WAKA,this.startTagPosition=this.position):r.isWhitespace(e)||(this.strictFail("Non-whitespace before first tag."),this.textNode=e,this.state=this.S.TEXT)}strictFail(e){if(typeof this!="object"||!(this instanceof _a))throw new Error("bad call to strictFail");this.strict&&this.errorFunction(e)}textApplyOptions(e){return this.opt.trim&&(e=e.trim()),this.opt.normalize&&(e=e.replace(/\s+/g," ")),e}emitNode(e,t){this.textNode&&this.closeText(),this.emit(e,t)}closeText(){this.textNode=this.textApplyOptions(this.textNode),this.textNode!==void 0&&this.textNode!==""&&this.textNode!=="undefined"&&this.emit("ontext",this.textNode),this.textNode=""}checkBufferLength(){let e=Math.max(this.opt.MAX_BUFFER_LENGTH,10),t=0;for(let s=0,i=this.BUFFERS.length;s<i;s++){let o=this[this.BUFFERS[s]]?.length||0;if(o>e)switch(this.BUFFERS[s]){case"textNode":this.closeText();break;case"cdata":this.emitNode("oncdata",this.cdata),this.cdata="";break;case"script":this.emitNode("onscript",this.script),this.script="";break;default:this.errorFunction(`Max buffer length exceeded: ${this.BUFFERS[s]}`)}t=Math.max(t,o)}let n=this.opt.MAX_BUFFER_LENGTH-t;this.bufferCheckPosition=n+this.position}openTag(e){if(this.opt.xmlns){let t=this.tag,n=r.qname(this.tagName);t.prefix=n.prefix,t.local=n.local,t.uri=t.ns[n.prefix]||"",t.prefix&&!t.uri&&(this.strictFail(`Unbound namespace prefix: ${JSON.stringify(this.tagName)}`),t.uri=n.prefix);let s=this.tags[this.tags.length-1]||this;if(t.ns&&s.ns!==t.ns){let i=this;Object.keys(t.ns).forEach(o=>{i.emitNode("onopennamespace",{prefix:o,uri:t.ns[o]})})}for(let i=0,o=this.attribList.length;i<o;i++){let a=this.attribList[i],c=a[0],u=a[1],f=r.qname(c,!0),l=f.prefix,d=f.local,h=l===""?"":t.ns[l]||"",m={name:c,value:u,prefix:l,local:d,uri:h};l&&l!=="xmlns"&&!h&&(this.strictFail(`Unbound namespace prefix: ${JSON.stringify(l)}`),m.uri=l),Object.defineProperty(this.tag.attributes,c,{value:m,enumerable:!0,configurable:!0,writable:!0}),this.emitNode("onattribute",m)}this.attribList.length=0}this.tag.isSelfClosing=!!e,this.sawRoot=!0,this.tags.push(this.tag),this.emitNode("onopentag",this.tag),e||(!this.noscript&&this.tagName.toLowerCase()==="script"?this.state=this.S.SCRIPT:this.state=this.S.TEXT,this.tag=null,this.tagName=""),this.attribName=this.attribValue="",this.attribList.length=0}closeTag(){if(!this.tagName){this.strictFail("Weird empty close tag."),this.textNode+="</>",this.state=this.S.TEXT;return}let e=!this.strict&&(this.opt.caseInsensitiveTags||!this.opt.preserveCase);if(this.script){if((e?this.tagName.toLowerCase():this.tagName)!=="script"){this.script+=`</${this.tagName}>`,this.tagName="",this.state=this.S.SCRIPT;return}this.emitNode("onscript",this.script),this.script=""}let t=this.tags.length,n=this.tagName,s=e?n.toLowerCase():n;for(;t--;){let o=this.tags[t];if((e?o.name.toLowerCase():o.name)!==s)this.strictFail("Unexpected close tag");else break}if(t<0){this.strictFail(`Unmatched closing tag: ${this.tagName}`),this.textNode+=`</${this.tagName}>`,this.state=this.S.TEXT;return}this.tagName=n;let i=this.tags.length;for(;i-- >t;){let o=this.tags.pop();this.tag=o,this.tagName=this.tag.name,this.emitNode("onclosetag",this.tagName);let a={};for(let u in o.ns)o.ns.hasOwnProperty(u)&&(a[u]=o.ns[u]);let c=this.tags[this.tags.length-1]||this;if(this.opt.xmlns&&o.ns!==c.ns){let u=this;Object.keys(o.ns).forEach(f=>{let l=o.ns[f];u.emitNode("onclosenamespace",{prefix:f,uri:l})})}}t===0&&(this.closedRoot=!0),this.tagName=this.attribValue=this.attribName="",this.attribList.length=0,this.state=this.S.TEXT}},_a=class extends xy{static ENTITIES=lu;opt=wC;events=yE;constructor(e){super(),this.clearBuffers(),this.opt=e={...this.opt,...e},this.events={...this.events,...e},this.q=this.c="",this.opt.lowercase=this.opt.lowercase||this.opt.lowercasetags,this.bufferCheckPosition=this.opt.MAX_BUFFER_LENGTH,this.looseCase=this.opt.lowercase?"toLowerCase":"toUpperCase",this.tags=[],this.closed=this.closedRoot=this.sawRoot=!1,this.tag=this.error=null,this.strict=!!this.opt.strict,this.noscript=!!(this.opt.strict||this.opt.noscript),this.state=this.S.BEGIN,this.strictEntities=this.opt.strictEntities,this.ENTITIES=this.strictEntities?Object.create(this.XML_ENTITIES):Object.create(this.ENTITIES),this.attribList=[],this.opt.xmlns&&(this.ns=Object.create(this.rootNS)),this.trackPosition=this.opt.position!==!1,this.trackPosition&&(this.position=this.line=this.column=0),this.emit("onready")}resume(){return this.error=null,this}close(){return this.write(null)}flush(){this.flushBuffers()}}});function Aa(r,e,t){Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0})}function xE(r,e={}){if(e.strict!==!1&&/[^\u0009\u000a\u000d\u0020-\ud7ff\ue000-\ufffd\u{10000}-\u{10ffff}]/u.test(r))throw new Error("XML: invalid XML character");let t=e.maxDepth??256;if(!Number.isSafeInteger(t)||t<1||t>4096)throw new Error("XML: maxDepth must be an integer between 1 and 4096");let n=new Ty(e,t);if(new _a({strict:e.strict!==!1,strictEntities:!e.htmlEntities,preserveCase:!0,caseInsensitiveTags:e.strict===!1,processEntities:e.processEntities!==!1,onopentag:i=>n.openElement(i.name,i.attributes||{}),ontext:i=>n.addText(i),oncdata:i=>n.addText(i),onscript:i=>n.addText(i),onclosetag:()=>n.closeElement(),onerror:i=>{throw i}}).write(r).close(),e.strict===!1)for(;n.stack.length;)n.closeElement();if(n.result===void 0)throw new Error("XML: document requires a root element");return n.result}var Ty,TE=p(()=>{"use strict";wE();Ty=class{options;maximumDepth;stack=[];result;constructor(e,t){this.options=e,this.maximumDepth=t}openElement(e,t){if(this.stack.length>=this.maximumDepth)throw new Error("XML: maximum nesting depth exceeded");if(!this.stack.length&&this.result!==void 0&&this.options.strict!==!1)throw new Error("XML: document requires a single root element");let n=this.normalizeName(e),s=this.stack[this.stack.length-1];this.stack.push({name:n,path:s?`${s.path}.${n}`:n,attributes:this.normalizeAttributes(t),children:{},orderedChildren:[],text:""})}addText(e){let t=this.stack[this.stack.length-1];t&&(t.text+=e)}closeElement(){let e=this.stack.pop();if(!e)return;let t=this.finalizeElement(e),n=this.stack[this.stack.length-1];if(this.options.preserveOrder){n?n.orderedChildren.push(t):this.result=t;return}n?this.addChild(n.children,e.name,e.path,t):(this.result===void 0&&(this.result={}),this.addChild(this.result,e.name,e.path,t))}finalizeElement(e){let t=this.options.trimValues===!1?e.text:e.text.trim();if(this.options.preserveOrder)return{name:e.name,attributes:e.attributes,children:e.orderedChildren,text:t};let n=Object.keys(e.attributes).length>0;if(!n&&!Object.keys(e.children).length)return this.parseValue(t,this.options.parseTagValue!==!1);let s=e.children;if(t&&Aa(s,this.options.textNodeName??"value",this.parseValue(t,this.options.parseTagValue!==!1)),n&&this.options.attributesGroupName)Aa(s,this.options.attributesGroupName,e.attributes);else for(let[i,o]of Object.entries(e.attributes))Aa(s,i,o);return s}addChild(e,t,n,s){if(!Object.hasOwn(e,t))Aa(e,t,this.options.arrayPaths?.includes(n)?[s]:s);else{let i=e[t];Array.isArray(i)?i.push(s):Aa(e,t,[i,s])}}normalizeAttributes(e){let t={};if(this.options.ignoreAttributes)return t;for(let[n,s]of Object.entries(e)){if(this.options.removeNSPrefix&&(n==="xmlns"||n.startsWith("xmlns:")))continue;let i=this.options.trimValues===!1?s:s.trim();Aa(t,(this.options.attributeNamePrefix??"")+this.normalizeName(n),this.parseValue(i,this.options.parseAttributeValue===!0))}return t}normalizeName(e){return this.options.removeNSPrefix?e.slice(e.indexOf(":")+1):e}parseValue(e,t){return t?e==="true"||e==="false"?e==="true":e!==""&&e.trim()!==""&&Number.isFinite(Number(e))?Number(e):e:e}}});function _y(r,e={}){if(Object.hasOwn(e,"_fastXML")||Object.hasOwn(e,"_sax"))throw new Error("XML: backend-specific options were removed; use native XML options");if(e._parser&&!["internal","sax"].includes(e._parser))throw new Error("XML: unsupported parser backend; use the native documents parser");let t=xE(r,e);return e.uncapitalizeKeys?hd(t):t}var _E=p(()=>{"use strict";gE();TE()});var AE=p(()=>{"use strict";_E()});function du(r){if(/<!DOCTYPE|<!ENTITY/i.test(r))throw new Error("MaterialX: document types and entity declarations are unsupported.");let e;try{e=_y(r,{preserveOrder:!0,parseAttributeValue:!1,trimValues:!1})}catch(n){throw new Error("MaterialX: malformed XML.",{cause:n})}if(e.name!=="materialx")throw new Error("MaterialX: expected a materialx root element.");let t=e.attributes.version;if(!t||!/^1\.\d+$/.test(t))throw new Error("MaterialX: expected a MaterialX 1.x version.");return{version:t,root:vE(e,0)}}function vE(r,e){return{category:r.name,attributes:r.attributes,children:r.children.map(t=>vE(t,e+1))}}var IE=p(()=>{"use strict";AE()});var Ay={};J(Ay,{MaterialXLoaderWithParser:()=>IC});var Lte,vC,IC,vy=p(()=>{"use strict";EE();IE();({preload:Lte,...vC}=SE),IC={...vC,parse:async r=>du(new TextDecoder().decode(r)),parseSync:r=>du(new TextDecoder().decode(r)),parseText:async r=>du(r),parseTextSync:du}});async function SC(){let{MaterialXLoaderWithParser:r}=await Promise.resolve().then(()=>(vy(),Ay));return r}var SE,EE=p(()=>{"use strict";SE={name:"MaterialX",id:"materialx",module:"scene",version:"latest",extensions:["mtlx"],mimeTypes:["application/xml"],text:!0,dataType:null,batchType:null,options:{},preload:SC}});function PE(r){let e=r.size(),t=new ArrayBuffer(e),n=new Int8Array(t);for(let s=0;s<e;++s)n[s]=r.GetValue(s);return t}function KC(r){return r instanceof Map?r.entries():Object.entries(r)}function mu(r){return ArrayBuffer.isView(r)?r:r&&typeof r=="object"&&"value"in r&&ArrayBuffer.isView(r.value)?r.value:null}function yd(r,e){return ArrayBuffer.isView(r)?e:r.size}function XC(r,e){for(let t of r)if(!Number.isInteger(t)||t<0||t>=e)throw new Error(`DracoWriter: triangle index ${t} is outside vertex range 0-${e-1}`)}function jE(r){return!!(r.attributeQuantization&&Object.keys(r.attributeQuantization).length)}function wd(r,e,t){if(!Number.isInteger(e)||e<1||e>30)throw new Error(`DracoWriter: quantization bits for "${r}" must be an integer from 1 to 30`);if(t==="NORMAL"&&(e<2||e>29))throw new Error(`DracoWriter: quantization bits for NORMAL attribute "${r}" must be an integer from 2 to 29`)}function HC(r,e,t){if(wd(r,t.bits),!Array.isArray(t.origin)||t.origin.length!==e)throw new Error(`DracoWriter: quantization origin for "${r}" must contain ${e} values`);if(!t.origin.every(Number.isFinite))throw new Error(`DracoWriter: quantization origin for "${r}" must be finite`);if(!Number.isFinite(t.range)||t.range<=0)throw new Error(`DracoWriter: quantization range for "${r}" must be positive`)}function GE(r,e){for(let t of["POSITION","NORMAL","COLOR","TEX_COORD","GENERIC"])if(r[t]===e)return t;return"GENERIC"}function JC(r){let e={gltf:{method:"MESH_EDGEBREAKER_ENCODING",speed:[5,5],quantization:{POSITION:14,NORMAL:10,TEX_COORD:12}},webgpu:{method:"MESH_SEQUENTIAL_ENCODING",speed:[5,5],quantization:{POSITION:14,NORMAL:10,TEX_COORD:12}},balanced:{method:"MESH_EDGEBREAKER_ENCODING",speed:[5,5],quantization:{POSITION:12,NORMAL:10,TEX_COORD:10}}},t=r.preset?e[r.preset]:{};return{...t,...r,quantization:{...t.quantization,...r.quantization}}}var qC,VE,La,zE=p(()=>{"use strict";qC={POSITION:"POSITION",NORMAL:"NORMAL",COLOR_0:"COLOR",TEXCOORD_0:"TEX_COORD"},VE=()=>{},La=class{draco;dracoEncoder;dracoMeshBuilder;dracoMetadataBuilder;log=VE;constructor(e){this.draco=e,this.dracoEncoder=new this.draco.Encoder,this.dracoMeshBuilder=new this.draco.MeshBuilder,this.dracoMetadataBuilder=new this.draco.MetadataBuilder}destroy(){this.destroyEncodedObject(this.dracoMeshBuilder),this.destroyEncodedObject(this.dracoEncoder),this.destroyEncodedObject(this.dracoMetadataBuilder)}destroyEncodedObject(e){e&&this.draco.destroy(e)}encodeSync(e,t={}){return this._encodeSync(e,t,!1).data}encodeSyncWithReport(e,t={}){return this._encodeSync(e,t,!0)}_encodeSync(e,t,n){return t=JC(t),this.log=t.log||VE,t.pointcloud?this._encodePointCloud(e,t,n):this._encodeMesh(e,t,n)}_getAttributesFromMesh(e){return{...e.indices?{indices:e.indices}:{},...e.attributes}}_encodePointCloud(e,t,n){let s=new this.draco.PointCloud,i=new this.draco.DracoInt8Array,o=null;try{t.metadata&&this._addGeometryMetadata(s,t.metadata);let a=this._getAttributesFromMesh(e),c=this._createDracoPointCloud(s,a,t),u=jE(t),f,l;if(u?(o=new this.draco.ExpertEncoder(s),this._setExpertOptions(o,c,t),l=o,n&&l.SetTrackEncodedProperties(!0),f=o.EncodeToDracoBuffer(t.deduplicateValues??!1,i)):(this._setOptions(t),l=this.dracoEncoder,n&&l.SetTrackEncodedProperties(!0),f=this.dracoEncoder.EncodePointCloudToDracoBuffer(s,t.deduplicateValues??!1,i)),!(f>0))throw new Error("Draco encoding failed.");this.log(`DRACO encoded ${s.num_points()} points
|
|
52
|
-
with ${s.num_attributes()} attributes into ${
|
|
53
|
-
with ${s.num_attributes()} attributes into ${f} bytes`);let d=PE(i);return{data:d,report:this._getEncodingReport("mesh",d.byteLength,s,l,c,t,n)}}finally{this.destroyEncodedObject(o),this.destroyEncodedObject(i),this.destroyEncodedObject(s)}}_setOptions(e){if(e.speed&&this.dracoEncoder.SetSpeedOptions(...e.speed),e.method){let t=this.draco[e.method];this.dracoEncoder.SetEncodingMethod(t)}if(e.quantization)for(let t in e.quantization){let n=t,s=e.quantization[n];s!==void 0&&(wd(n,s,n),this.dracoEncoder.SetAttributeQuantization(this.draco[n],s))}}_setExpertOptions(e,t,n){n.speed&&e.SetSpeedOptions(...n.speed),n.method&&e.SetEncodingMethod(this.draco[n.method]);let s=this._getAttributeQuantization(t,n);for(let[i,o]of s){let a=t[i];typeof o=="number"?e.SetAttributeQuantization(a.attributeId,o):e.SetAttributeExplicitQuantization(a.attributeId,o.bits,a.componentCount,o.origin,o.range)}}_getAttributeQuantization(e,t){let n=new Map;for(let i of Object.keys(t.quantization||{})){let o=t.quantization?.[i];o!==void 0&&(wd(i,o,i),n.set(this.draco[i],o))}let s=new Map;for(let[i,o]of Object.entries(e)){let a=n.get(o.attributeType);a!==void 0&&s.set(i,a)}for(let[i,o]of Object.entries(t.attributeQuantization||{})){let a=e[i];if(!a)throw new Error(`DracoWriter: quantized attribute "${i}" does not exist`);if(typeof o=="number")wd(i,o,a.attributeTypeName);else{if(a.attributeTypeName==="NORMAL")throw new Error(`DracoWriter: explicit quantization transforms are not supported for NORMAL attribute "${i}"`);HC(i,e[i].componentCount,o)}s.set(i,o)}for(let i of s.keys())if(!e[i].supportsQuantization)throw new Error(`DracoWriter: quantization for "${i}" requires floating-point attribute data`);return s}_getEncodingReport(e,t,n,s,i,o,a){let c=this._getAttributeQuantization(i,o),u={};for(let[f,l]of Object.entries(i))u[f]={id:l.attributeId,type:l.attributeTypeName,componentCount:l.componentCount,...c.has(f)?{quantization:c.get(f)}:{}};return{geometryType:e,byteLength:t,pointCount:a?s.GetNumberOfEncodedPoints():n.num_points(),faceCount:a?s.GetNumberOfEncodedFaces():e==="mesh"&&typeof n.num_faces=="function"?n.num_faces():0,attributeCount:n.num_attributes(),...o.method?{method:o.method}:{},...o.speed?{speed:o.speed}:{},attributes:u}}_createDracoMesh(e,t,n){let s=n.attributesMetadata||{},i={},o=this._getVertexCount(t,n);for(let[a,c]of Object.entries(t)){let u=this._addAttributeToMesh(e,a,c,o,n);if(u!==-1){let f=mu(c),l=this._getDracoAttributeType(a,n.attributeTypes);i[a]={attributeId:u,attributeType:l,attributeTypeName:GE(this.draco,l),componentCount:yd(c,f.length/o),supportsQuantization:f instanceof Float32Array},this._addAttributeMetadata(e,u,{[n.attributeNameEntry||"name"]:a,...s[a]||{}})}}return i}_createDracoPointCloud(e,t,n){let s=n.attributesMetadata||{},i={},o=this._getVertexCount(t,n);for(let[a,c]of Object.entries(t)){let u=this._addAttributeToMesh(e,a,c,o,n);if(u!==-1){let f=mu(c),l=this._getDracoAttributeType(a,n.attributeTypes);i[a]={attributeId:u,attributeType:l,attributeTypeName:GE(this.draco,l),componentCount:yd(c,f.length/o),supportsQuantization:f instanceof Float32Array},this._addAttributeMetadata(e,u,{[n.attributeNameEntry||"name"]:a,...s[a]||{}})}}return i}_addAttributeToMesh(e,t,n,s,i={}){let o=mu(n);if(!o)throw new Error(`DracoWriter: attribute "${t}" must contain a typed array`);let a=this._getDracoAttributeType(t,i.attributeTypes),c=yd(n,o.length/s);if(a==="indices"){if(o.length%3!==0)throw new Error("DracoWriter: triangle indices length must be divisible by 3");XC(o,s);let l=o.length/3;this.log(`Adding attribute ${t}, size ${l}`);let d=o instanceof Uint16Array||o instanceof Uint32Array?o:Uint32Array.from(o);return this.dracoMeshBuilder.AddFacesToMesh(e,l,d),-1}if(!Number.isInteger(c)||c<=0||o.length!==s*c)throw new Error(`DracoWriter: attribute "${t}" has ${o.length} values, expected ${s*c}`);this.log(`Adding attribute ${t}, size ${c}`);let u=this.dracoMeshBuilder,f=-1;if(o instanceof Int8Array)f=u.AddInt8Attribute(e,a,s,c,o);else if(o instanceof Int16Array)f=u.AddInt16Attribute(e,a,s,c,o);else if(o instanceof Int32Array)f=u.AddInt32Attribute(e,a,s,c,o);else if(o instanceof Uint8Array)f=u.AddUInt8Attribute(e,a,s,c,o);else if(o instanceof Uint8ClampedArray){let l=new Uint8Array(o.buffer,o.byteOffset,o.byteLength);f=u.AddUInt8Attribute(e,a,s,c,l)}else if(o instanceof Uint16Array)f=u.AddUInt16Attribute(e,a,s,c,o);else if(o instanceof Uint32Array)f=u.AddUInt32Attribute(e,a,s,c,o);else if(o instanceof Float32Array)f=u.AddFloatAttribute(e,a,s,c,o);else throw new Error(`DracoWriter: attribute "${t}" uses unsupported ${o.constructor.name}`);return!ArrayBuffer.isView(n)&&n.normalized!==void 0&&u.SetNormalizedFlagForAttribute(e,f,n.normalized),f}_getDracoAttributeType(e,t={}){if(e.toLowerCase()==="indices")return"indices";let n=t[e];if(n)return this.draco[n];let s=qC[e];if(s)return this.draco[s];switch(e.toLowerCase()){case"position":case"positions":case"vertices":return this.draco.POSITION;case"normal":case"normals":return this.draco.NORMAL;case"color":case"colors":return this.draco.COLOR;case"texcoord":case"texcoords":return this.draco.TEX_COORD;default:return/^color_\d+$/i.test(e)?this.draco.COLOR:/^texcoord_\d+$/i.test(e)?this.draco.TEX_COORD:this.draco.GENERIC}}_getVertexCount(e,t){let n=this._getPositionAttribute(e,t.attributeTypes),s=n&&mu(n);if(!n||!s)throw new Error("DracoWriter: POSITION attribute is required");let i=yd(n,3);if(!Number.isInteger(i)||i<=0||s.length%i!==0)throw new Error("DracoWriter: POSITION attribute has an invalid size or value count");return s.length/i}_getPositionAttribute(e,t={}){for(let n in e){let s=e[n];if(this._getDracoAttributeType(n,t)===this.draco.POSITION&&mu(s))return s}return null}_addGeometryMetadata(e,t){let n=new this.draco.Metadata;this._populateDracoMetadata(n,t),this.dracoMeshBuilder.AddMetadata(e,n)}_addAttributeMetadata(e,t,n){let s=new this.draco.Metadata;this._populateDracoMetadata(s,n),this.dracoMeshBuilder.SetMetadataForAttribute(e,t,s)}_populateDracoMetadata(e,t){for(let[n,s]of KC(t))switch(typeof s){case"number":Math.trunc(s)===s?this.dracoMetadataBuilder.AddIntEntry(e,n,s):this.dracoMetadataBuilder.AddDoubleEntry(e,n,s);break;case"object":s instanceof Int32Array&&this.dracoMetadataBuilder.AddIntEntryArray(e,n,s,s.length);break;default:this.dracoMetadataBuilder.AddStringEntry(e,n,s)}}}});async function ZC(r,e={}){return(await WE(r,e)).data}async function WE(r,e={}){let{draco:t}=await zg(cn(e)),n=new La(t);try{return n.encodeSyncWithReport(KE(r),e.draco)}finally{n.destroy()}}async function e8(r,e={}){qE(e.signal);let t=[],n=0;for await(let s of Dy([r],e))t.push(s),n++,e.onProgress?.({completed:n,total:r.length});return t}function Dy(r,e={}){let t=r8(r);if(Dm(Ry,e)){let{onProgress:n,...s}=e;return Om(Ry,t,s)}return $E(t,e)}async function*t8(r,e={}){let t=(async function*(){for await(let n of r)yield[n]})();for await(let n of Dy(t,e))yield n.data}async function*$E(r,e={}){let{draco:t}=await zg(cn(e)),n=new La(t);try{for await(let s of r)for(let i of s)qE(e.signal),yield n.encodeSyncWithReport(i,e.draco)}finally{n.destroy()}}async function*r8(r){for await(let e of r)yield e.map(KE)}function qE(r){if(!r?.aborted)return;if(r.reason!==void 0)throw r.reason;let e=new Error("Draco batch encoding aborted");throw e.name="AbortError",e}function KE(r){if(n8(r))return fn(r);if(s8(r))return r;let{indices:e,...t}=r;return{attributes:t,...e?{indices:e}:{}}}function n8(r){return typeof r=="object"&&r!==null&&"shape"in r&&r.shape==="arrow-table"}function s8(r){return typeof r=="object"&&r!==null&&"attributes"in r&&typeof r.attributes=="object"&&r.attributes!==null&&!ArrayBuffer.isView(r.attributes)}var YC,Ry,QC,XE=p(()=>{"use strict";ke();Vn();qs();zE();nu();Ug();Vg();YC={pointcloud:!1,attributeNameEntry:"name"},Ry={...tu,id:"draco-writer",name:"Draco compressed geometry writer",module:"scene",version:eu,worker:!0,workerNode:"draco-writer-worker-node.cjs",workerSourceNode:"draco/workers/draco-writer-worker-node.ts",options:{draco:{}}},QC={...tu,name:"DRACO",version:eu,options:{draco:YC},encode:ZC,encodeInBatches:t8}});var HE={};J(HE,{DracoWriter:()=>QC,DracoWriterWorker:()=>Ry,encodeDraco:()=>WE,encodeDracoBatch:()=>e8,encodeDracoInBatches:()=>Dy,encodeDracoInBatchesLocally:()=>$E});var JE=p(()=>{"use strict";XE()});var p3={};J(p3,{DRACO_EXTERNAL_LIBRARIES:()=>bt,DRACO_EXTERNAL_LIBRARY_URLS:()=>yL,DracoFormat:()=>Ad,DracoLoader:()=>vd,DracoWorkerLoader:()=>bL,FetchError:()=>A.FetchError,GLBFormat:()=>Sa,GLBLoader:()=>lL,GLBWriter:()=>hL,GLTFFormat:()=>Ia,GLTFLoader:()=>RE,GLTFWriter:()=>fL,JSONLoader:()=>A.JSONLoader,MTLFormat:()=>pd,MTLLoader:()=>Sy,MTLWorkerLoader:()=>BE,MaterialXLoader:()=>wL,NullLoader:()=>A.NullLoader,NullWorkerLoader:()=>A.NullWorkerLoader,OBJFormat:()=>va,OBJLoader:()=>Iy,OBJWorkerLoader:()=>LE,OBJWriter:()=>OE,RequestScheduler:()=>A.RequestScheduler,USDLoader:()=>Ma,_BrowserFileSystem:()=>A._BrowserFileSystem,_fetchProgress:()=>A._fetchProgress,_selectSource:()=>A._selectSource,_unregisterLoaders:()=>A._unregisterLoaders,assert:()=>A.assert,concatenateArrayBuffersAsync:()=>A.concatenateArrayBuffersAsync,coreApi:()=>A.coreApi,createDataSource:()=>A.createDataSource,document:()=>A.document,encode:()=>A.encode,encodeInBatches:()=>A.encodeInBatches,encodeSync:()=>A.encodeSync,encodeTable:()=>A.encodeTable,encodeTableAsText:()=>A.encodeTableAsText,encodeTableInBatches:()=>A.encodeTableInBatches,encodeText:()=>A.encodeText,encodeTextSync:()=>A.encodeTextSync,encodeURLtoURL:()=>A.encodeURLtoURL,fetchFile:()=>A.fetchFile,forEach:()=>A.forEach,getLoaderOptions:()=>A.getLoaderOptions,getPathPrefix:()=>A.getPathPrefix,global:()=>A.global,isAsyncIterable:()=>A.isAsyncIterable,isBrowser:()=>A.isBrowser,isIterable:()=>A.isIterable,isIterator:()=>A.isIterator,isPromise:()=>A.isPromise,isPureObject:()=>A.isPureObject,isReadableStream:()=>A.isReadableStream,isResponse:()=>A.isResponse,isWorker:()=>A.isWorker,isWritableStream:()=>A.isWritableStream,load:()=>A.load,loadInBatches:()=>A.loadInBatches,makeIterator:()=>A.makeIterator,makeLineIterator:()=>A.makeLineIterator,makeNumberedLineIterator:()=>A.makeNumberedLineIterator,makeStream:()=>A.makeStream,makeTextDecoderIterator:()=>A.makeTextDecoderIterator,makeTextEncoderIterator:()=>A.makeTextEncoderIterator,parse:()=>A.parse,parseFile:()=>A.parseFile,parseInBatches:()=>A.parseInBatches,parseSync:()=>A.parseSync,preload:()=>A.preload,preloadSync:()=>A.preloadSync,readArrayBuffer:()=>A.readArrayBuffer,registerLoaders:()=>A.registerLoaders,resolvePath:()=>A.resolvePath,selectLoader:()=>A.selectLoader,selectLoaderSync:()=>A.selectLoaderSync,self:()=>A.self,setLoaderOptions:()=>A.setLoaderOptions,setPathPrefix:()=>A.setPathPrefix,window:()=>A.window});var A=SL(pw(),1);Md();var va={name:"OBJ",id:"obj",module:"scene",encoding:"text",format:"obj",extensions:["obj"],mimeTypes:["text/plain"]};Jo();var EC=typeof __VERSION__<"u"?__VERSION__:"latest";async function LC(){let{OBJLoaderWithParser:r}=await Promise.resolve().then(()=>(vb(),Ab));return r}var Iy={...va,dataType:null,batchType:null,version:EC,worker:!0,workerInBatches:!0,serializeWorkerResult:$i,text:!0,testText:BC,options:{obj:{shape:"arrow-table"}},preload:LC};function BC(r){return r[0]==="v"}var LE=Iy;var pd={name:"MTL",id:"mtl",module:"mtl",encoding:"text",format:"mtl",extensions:["mtl"],mimeTypes:["text/plain"]};var FC=typeof __VERSION__<"u"?__VERSION__:"latest";async function OC(){let{MTLLoaderWithParser:r}=await Promise.resolve().then(()=>(Lb(),Eb));return r}var Sy={...pd,dataType:null,batchType:null,version:FC,worker:!0,text:!0,testText:r=>r.includes("newmtl"),options:{mtl:{}},preload:OC},BE=Sy;Vn();var MC=typeof __VERSION__<"u"?__VERSION__:"latest",OE={...va,dataType:null,batchType:null,version:MC,options:{obj:{}},text:!0,encode:async(r,e)=>FE(r,e),encodeSync:FE,encodeTextSync:ME};function FE(r,e){let t=ME(r,e);return new TextEncoder().encode(t).buffer}function ME(r,e){let t=fn(RC(r)),n=DC(t,"POSITION"),s=t.attributes.NORMAL,i=t.attributes.TEXCOORD_0,o=t.attributes.COLOR_0,a=n.value.length/n.size,c=["# loaders.gl OBJ"];for(let f=0;f<a;f++){let l=[$n(n,f,0),$n(n,f,1),$n(n,f,2)];o&&l.push(Ey(o,f,0),Ey(o,f,1),Ey(o,f,2)),c.push(`v ${l.join(" ")}`)}if(i)for(let f=0;f<a;f++)c.push(`vt ${$n(i,f,0)} ${$n(i,f,1)}`);if(s)for(let f=0;f<a;f++)c.push(`vn ${$n(s,f,0)} ${$n(s,f,1)} ${$n(s,f,2)}`);let u=NC(t,a);for(let f=0;f<u.length;f+=3){let l=[Ly(u[f],!!i,!!s),Ly(u[f+1],!!i,!!s),Ly(u[f+2],!!i,!!s)];c.push(`f ${l.join(" ")}`)}return`${c.join(`
|
|
51
|
+
Actual: ${this.attribValue}`);else{let s=this.tag,i=this.tags[this.tags.length-1]||this;s.ns===i.ns&&(s.ns=Object.create(i.ns)),s.ns[n]=this.attribValue}this.attribList.push([this.attribName,this.attribValue])}else Object.defineProperty(this.tag.attributes,this.attribName,{value:this.attribValue,enumerable:!0,configurable:!0,writable:!0}),this.emitNode("onattribute",{name:this.attribName,value:this.attribValue});this.attribName=this.attribValue=""}newTag(){!this.strict&&!this.opt.preserveCase&&(this.tagName=this.tagName[this.looseCase]());let e=this.tags[this.tags.length-1]||this,t={name:this.tagName,attributes:{}};this.tag=t,this.opt.xmlns&&(t.ns=e.ns),this.attribList.length=0,this.emitNode("onopentagstart",t)}parseEntity(){let e=this.decodeEntity();return this.opt.processEntities===!1?`&${this.entity};`:e}decodeEntity(){let e=this.entity,t=e.toLowerCase(),n=NaN,s="";return typeof this.ENTITIES[e]=="string"||typeof this.ENTITIES[e]=="number"?this.ENTITIES[e]:typeof this.ENTITIES[t]=="string"||typeof this.ENTITIES[t]=="number"?this.ENTITIES[t]:(e=t,e.charAt(0)==="#"&&(e.charAt(1)==="x"?(e=e.slice(2),n=parseInt(e,16),s=n.toString(16)):(e=e.slice(1),n=parseInt(e,10),s=n.toString(10))),e=e.replace(/^0+/,""),Number.isNaN(n)||s.toLowerCase()!==e?(this.strictFail("Invalid character entity"),`&${this.entity};`):n<0||n>1114111||n>=55296&&n<=57343||n<32&&![9,10,13].includes(n)||n===65534||n===65535?(this.strictFail("Invalid character entity"),`&${this.entity};`):String.fromCodePoint(n))}beginWhiteSpace(e){e==="<"?(this.state=this.S.OPEN_WAKA,this.startTagPosition=this.position):r.isWhitespace(e)||(this.strictFail("Non-whitespace before first tag."),this.textNode=e,this.state=this.S.TEXT)}strictFail(e){if(typeof this!="object"||!(this instanceof Sa))throw new Error("bad call to strictFail");this.strict&&this.errorFunction(e)}textApplyOptions(e){return this.opt.trim&&(e=e.trim()),this.opt.normalize&&(e=e.replace(/\s+/g," ")),e}emitNode(e,t){this.textNode&&this.closeText(),this.emit(e,t)}closeText(){this.textNode=this.textApplyOptions(this.textNode),this.textNode!==void 0&&this.textNode!==""&&this.textNode!=="undefined"&&this.emit("ontext",this.textNode),this.textNode=""}checkBufferLength(){let e=Math.max(this.opt.MAX_BUFFER_LENGTH,10),t=0;for(let s=0,i=this.BUFFERS.length;s<i;s++){let o=this[this.BUFFERS[s]]?.length||0;if(o>e)switch(this.BUFFERS[s]){case"textNode":this.closeText();break;case"cdata":this.emitNode("oncdata",this.cdata),this.cdata="";break;case"script":this.emitNode("onscript",this.script),this.script="";break;default:this.errorFunction(`Max buffer length exceeded: ${this.BUFFERS[s]}`)}t=Math.max(t,o)}let n=this.opt.MAX_BUFFER_LENGTH-t;this.bufferCheckPosition=n+this.position}openTag(e){if(this.opt.xmlns){let t=this.tag,n=r.qname(this.tagName);t.prefix=n.prefix,t.local=n.local,t.uri=t.ns[n.prefix]||"",t.prefix&&!t.uri&&(this.strictFail(`Unbound namespace prefix: ${JSON.stringify(this.tagName)}`),t.uri=n.prefix);let s=this.tags[this.tags.length-1]||this;if(t.ns&&s.ns!==t.ns){let i=this;Object.keys(t.ns).forEach(o=>{i.emitNode("onopennamespace",{prefix:o,uri:t.ns[o]})})}for(let i=0,o=this.attribList.length;i<o;i++){let a=this.attribList[i],c=a[0],u=a[1],l=r.qname(c,!0),f=l.prefix,d=l.local,h=f===""?"":t.ns[f]||"",m={name:c,value:u,prefix:f,local:d,uri:h};f&&f!=="xmlns"&&!h&&(this.strictFail(`Unbound namespace prefix: ${JSON.stringify(f)}`),m.uri=f),Object.defineProperty(this.tag.attributes,c,{value:m,enumerable:!0,configurable:!0,writable:!0}),this.emitNode("onattribute",m)}this.attribList.length=0}this.tag.isSelfClosing=!!e,this.sawRoot=!0,this.tags.push(this.tag),this.emitNode("onopentag",this.tag),e||(!this.noscript&&this.tagName.toLowerCase()==="script"?this.state=this.S.SCRIPT:this.state=this.S.TEXT,this.tag=null,this.tagName=""),this.attribName=this.attribValue="",this.attribList.length=0}closeTag(){if(!this.tagName){this.strictFail("Weird empty close tag."),this.textNode+="</>",this.state=this.S.TEXT;return}let e=!this.strict&&(this.opt.caseInsensitiveTags||!this.opt.preserveCase);if(this.script){if((e?this.tagName.toLowerCase():this.tagName)!=="script"){this.script+=`</${this.tagName}>`,this.tagName="",this.state=this.S.SCRIPT;return}this.emitNode("onscript",this.script),this.script=""}let t=this.tags.length,n=this.tagName,s=e?n.toLowerCase():n;for(;t--;){let o=this.tags[t];if((e?o.name.toLowerCase():o.name)!==s)this.strictFail("Unexpected close tag");else break}if(t<0){this.strictFail(`Unmatched closing tag: ${this.tagName}`),this.textNode+=`</${this.tagName}>`,this.state=this.S.TEXT;return}this.tagName=n;let i=this.tags.length;for(;i-- >t;){let o=this.tags.pop();this.tag=o,this.tagName=this.tag.name,this.emitNode("onclosetag",this.tagName);let a={};for(let u in o.ns)o.ns.hasOwnProperty(u)&&(a[u]=o.ns[u]);let c=this.tags[this.tags.length-1]||this;if(this.opt.xmlns&&o.ns!==c.ns){let u=this;Object.keys(o.ns).forEach(l=>{let f=o.ns[l];u.emitNode("onclosenamespace",{prefix:l,uri:f})})}}t===0&&(this.closedRoot=!0),this.tagName=this.attribValue=this.attribName="",this.attribList.length=0,this.state=this.S.TEXT}},Sa=class extends Wy{static ENTITIES=gu;opt=y3;events=oL;constructor(e){super(),this.clearBuffers(),this.opt=e={...this.opt,...e},this.events={...this.events,...e},this.q=this.c="",this.opt.lowercase=this.opt.lowercase||this.opt.lowercasetags,this.bufferCheckPosition=this.opt.MAX_BUFFER_LENGTH,this.looseCase=this.opt.lowercase?"toLowerCase":"toUpperCase",this.tags=[],this.closed=this.closedRoot=this.sawRoot=!1,this.tag=this.error=null,this.strict=!!this.opt.strict,this.noscript=!!(this.opt.strict||this.opt.noscript),this.state=this.S.BEGIN,this.strictEntities=this.opt.strictEntities,this.ENTITIES=this.strictEntities?Object.create(this.XML_ENTITIES):Object.create(this.ENTITIES),this.attribList=[],this.opt.xmlns&&(this.ns=Object.create(this.rootNS)),this.trackPosition=this.opt.position!==!1,this.trackPosition&&(this.position=this.line=this.column=0),this.emit("onready")}resume(){return this.error=null,this}close(){return this.write(null)}flush(){this.flushBuffers()}}});function Ea(r,e,t){Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0})}function cL(r,e={}){if(e.strict!==!1&&/[^\u0009\u000a\u000d\u0020-\ud7ff\ue000-\ufffd\u{10000}-\u{10ffff}]/u.test(r))throw new Error("XML: invalid XML character");let t=e.maxDepth??256;if(!Number.isSafeInteger(t)||t<1||t>4096)throw new Error("XML: maxDepth must be an integer between 1 and 4096");let n=new $y(e,t);if(new Sa({strict:e.strict!==!1,strictEntities:!e.htmlEntities,preserveCase:!0,caseInsensitiveTags:e.strict===!1,processEntities:e.processEntities!==!1,onopentag:i=>n.openElement(i.name,i.attributes||{}),ontext:i=>n.addText(i),oncdata:i=>n.addText(i),onscript:i=>n.addText(i),onclosetag:()=>n.closeElement(),onerror:i=>{throw i}}).write(r).close(),e.strict===!1)for(;n.stack.length;)n.closeElement();if(n.result===void 0)throw new Error("XML: document requires a root element");return n.result}var $y,uL=p(()=>{"use strict";aL();$y=class{options;maximumDepth;stack=[];result;constructor(e,t){this.options=e,this.maximumDepth=t}openElement(e,t){if(this.stack.length>=this.maximumDepth)throw new Error("XML: maximum nesting depth exceeded");if(!this.stack.length&&this.result!==void 0&&this.options.strict!==!1)throw new Error("XML: document requires a single root element");let n=this.normalizeName(e),s=this.stack[this.stack.length-1];this.stack.push({name:n,path:s?`${s.path}.${n}`:n,attributes:this.normalizeAttributes(t),children:{},orderedChildren:[],text:""})}addText(e){let t=this.stack[this.stack.length-1];t&&(t.text+=e)}closeElement(){let e=this.stack.pop();if(!e)return;let t=this.finalizeElement(e),n=this.stack[this.stack.length-1];if(this.options.preserveOrder){n?n.orderedChildren.push(t):this.result=t;return}n?this.addChild(n.children,e.name,e.path,t):(this.result===void 0&&(this.result={}),this.addChild(this.result,e.name,e.path,t))}finalizeElement(e){let t=this.options.trimValues===!1?e.text:e.text.trim();if(this.options.preserveOrder)return{name:e.name,attributes:e.attributes,children:e.orderedChildren,text:t};let n=Object.keys(e.attributes).length>0;if(!n&&!Object.keys(e.children).length)return this.parseValue(t,this.options.parseTagValue!==!1);let s=e.children;if(t&&Ea(s,this.options.textNodeName??"value",this.parseValue(t,this.options.parseTagValue!==!1)),n&&this.options.attributesGroupName)Ea(s,this.options.attributesGroupName,e.attributes);else for(let[i,o]of Object.entries(e.attributes))Ea(s,i,o);return s}addChild(e,t,n,s){if(!Object.hasOwn(e,t))Ea(e,t,this.options.arrayPaths?.includes(n)?[s]:s);else{let i=e[t];Array.isArray(i)?i.push(s):Ea(e,t,[i,s])}}normalizeAttributes(e){let t={};if(this.options.ignoreAttributes)return t;for(let[n,s]of Object.entries(e)){if(this.options.removeNSPrefix&&(n==="xmlns"||n.startsWith("xmlns:")))continue;let i=this.options.trimValues===!1?s:s.trim();Ea(t,(this.options.attributeNamePrefix??"")+this.normalizeName(n),this.parseValue(i,this.options.parseAttributeValue===!0))}return t}normalizeName(e){return this.options.removeNSPrefix?e.slice(e.indexOf(":")+1):e}parseValue(e,t){return t?e==="true"||e==="false"?e==="true":e!==""&&e.trim()!==""&&Number.isFinite(Number(e))?Number(e):e:e}}});function qy(r,e={}){if(Object.hasOwn(e,"_fastXML")||Object.hasOwn(e,"_sax"))throw new Error("XML: backend-specific options were removed; use native XML options");if(e._parser&&!["internal","sax"].includes(e._parser))throw new Error("XML: unsupported parser backend; use the native documents parser");let t=cL(r,e);return e.uncapitalizeKeys?Ld(t):t}var lL=p(()=>{"use strict";iL();uL()});var fL=p(()=>{"use strict";lL()});function yu(r){if(/<!DOCTYPE|<!ENTITY/i.test(r))throw new Error("MaterialX: document types and entity declarations are unsupported.");let e;try{e=qy(r,{preserveOrder:!0,parseAttributeValue:!1,trimValues:!1})}catch(n){throw new Error("MaterialX: malformed XML.",{cause:n})}if(e.name!=="materialx")throw new Error("MaterialX: expected a materialx root element.");let t=e.attributes.version;if(!t||!/^1\.\d+$/.test(t))throw new Error("MaterialX: expected a MaterialX 1.x version.");return{version:t,root:dL(e,0)}}function dL(r,e){return{category:r.name,attributes:r.attributes,children:r.children.map(t=>dL(t,e+1))}}var hL=p(()=>{"use strict";fL()});var Ky={};J(Ky,{MaterialXLoaderWithParser:()=>v3});var cne,A3,v3,Xy=p(()=>{"use strict";mL();hL();({preload:cne,...A3}=pL),v3={...A3,parse:async r=>yu(new TextDecoder().decode(r)),parseSync:r=>yu(new TextDecoder().decode(r)),parseText:async r=>yu(r),parseTextSync:yu}});async function I3(){let{MaterialXLoaderWithParser:r}=await Promise.resolve().then(()=>(Xy(),Ky));return r}var pL,mL=p(()=>{"use strict";pL={name:"MaterialX",id:"materialx",module:"scene",version:"latest",extensions:["mtlx"],mimeTypes:["application/xml"],text:!0,dataType:null,batchType:null,options:{},preload:I3}});function Hy(r){let e=new DataView(r),t=r.byteLength>=84&&84+e.getUint32(80,!0)*50===r.byteLength,n,s,i;if(t){let a=e.getUint32(80,!0);n=new Float32Array(a*9),s=new Float32Array(a*9),i=new TextDecoder().decode(r.slice(0,80));for(let c=0;c<a;c++){let u=84+c*50;for(let l=0;l<9;l++)n[c*9+l]=e.getFloat32(u+12+l*4,!0),s[c*9+l]=e.getFloat32(u+l%3*4,!0)}}else{let a=new TextDecoder().decode(r).trim().split(/\r?\n/).map(f=>f.trim()).filter(Boolean),c=[],u=[];i=a[0]||"";let l=0;for(;l<a.length;){if(!/^solid(?:\s|$)/i.test(a[l++]))throw new Error("STL: expected solid header or exact binary length");for(;l<a.length&&!/^endsolid(?:\s|$)/i.test(a[l]);){let f=bL(a[l++],"facet normal");if(!/^outer\s+loop$/i.test(a[l++]||""))throw new Error("STL: expected outer loop");for(let d=0;d<3;d++)c.push(...bL(a[l++],"vertex")),u.push(...f);if(!/^endloop$/i.test(a[l++]||"")||!/^endfacet$/i.test(a[l++]||""))throw new Error("STL: incomplete facet")}if(l>=a.length)throw new Error("STL: missing endsolid");l++}if(!a.length)throw new Error("STL: empty input");n=new Float32Array(c),s=new Float32Array(u)}if(!n.every(Number.isFinite)||!s.every(Number.isFinite))throw new Error("STL: non-finite coordinates");let o={POSITION:{value:n,size:3},NORMAL:{value:s,size:3}};return{topology:"triangle-list",mode:4,attributes:o,schema:jb(o),header:{vertexCount:n.length/3,boundingBox:Er(o)??void 0},loaderData:{header:i,format:t?"binary":"ascii"}}}function bL(r,e){let t=r?.split(/\s+/)||[],n=e.split(" "),s=t.slice(n.length);if(n.some((i,o)=>t[o]?.toLowerCase()!==i)||s.length!==3||s.some(i=>!/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i.test(i)))throw new Error(`STL: invalid ${e} record`);return s.map(Number)}var gL=p(()=>{"use strict";mn()});var Jy={};J(Jy,{STLLoaderWithParser:()=>E3});var pne,S3,E3,Yy=p(()=>{"use strict";wL();gL();({preload:pne,...S3}=yL),E3={...S3,parse:async r=>Hy(r),parseSync:Hy}});async function B3(){let{STLLoaderWithParser:r}=await Promise.resolve().then(()=>(Yy(),Jy));return r}var L3,yL,wL=p(()=>{"use strict";L3="5.0.0-beta.6";yL={name:"STL",id:"stl",module:"scene",version:L3,extensions:["stl"],mimeTypes:["model/stl"],binary:!0,dataType:null,batchType:null,options:{},preload:B3}});function ML(r){let e=r.size(),t=new ArrayBuffer(e),n=new Int8Array(t);for(let s=0;s<e;++s)n[s]=r.GetValue(s);return t}function J3(r){return r instanceof Map?r.entries():Object.entries(r)}function Tu(r){return ArrayBuffer.isView(r)?r:r&&typeof r=="object"&&"value"in r&&ArrayBuffer.isView(r.value)?r.value:null}function Dd(r,e){return ArrayBuffer.isView(r)?e:r.size}function Y3(r,e){for(let t of r)if(!Number.isInteger(t)||t<0||t>=e)throw new Error(`DracoWriter: triangle index ${t} is outside vertex range 0-${e-1}`)}function DL(r){return!!(r.attributeQuantization&&Object.keys(r.attributeQuantization).length)}function Rd(r,e,t){if(!Number.isInteger(e)||e<1||e>30)throw new Error(`DracoWriter: quantization bits for "${r}" must be an integer from 1 to 30`);if(t==="NORMAL"&&(e<2||e>29))throw new Error(`DracoWriter: quantization bits for NORMAL attribute "${r}" must be an integer from 2 to 29`)}function Q3(r,e,t){if(Rd(r,t.bits),!Array.isArray(t.origin)||t.origin.length!==e)throw new Error(`DracoWriter: quantization origin for "${r}" must contain ${e} values`);if(!t.origin.every(Number.isFinite))throw new Error(`DracoWriter: quantization origin for "${r}" must be finite`);if(!Number.isFinite(t.range)||t.range<=0)throw new Error(`DracoWriter: quantization range for "${r}" must be positive`)}function RL(r,e){for(let t of["POSITION","NORMAL","COLOR","TEX_COORD","GENERIC"])if(r[t]===e)return t;return"GENERIC"}function Z3(r){let e={gltf:{method:"MESH_EDGEBREAKER_ENCODING",speed:[5,5],quantization:{POSITION:14,NORMAL:10,TEX_COORD:12}},webgpu:{method:"MESH_SEQUENTIAL_ENCODING",speed:[5,5],quantization:{POSITION:14,NORMAL:10,TEX_COORD:12}},balanced:{method:"MESH_EDGEBREAKER_ENCODING",speed:[5,5],quantization:{POSITION:12,NORMAL:10,TEX_COORD:10}}},t=r.preset?e[r.preset]:{};return{...t,...r,quantization:{...t.quantization,...r.quantization}}}var H3,OL,Ma,kL=p(()=>{"use strict";H3={POSITION:"POSITION",NORMAL:"NORMAL",COLOR_0:"COLOR",TEXCOORD_0:"TEX_COORD"},OL=()=>{},Ma=class{draco;dracoEncoder;dracoMeshBuilder;dracoMetadataBuilder;log=OL;constructor(e){this.draco=e,this.dracoEncoder=new this.draco.Encoder,this.dracoMeshBuilder=new this.draco.MeshBuilder,this.dracoMetadataBuilder=new this.draco.MetadataBuilder}destroy(){this.destroyEncodedObject(this.dracoMeshBuilder),this.destroyEncodedObject(this.dracoEncoder),this.destroyEncodedObject(this.dracoMetadataBuilder)}destroyEncodedObject(e){e&&this.draco.destroy(e)}encodeSync(e,t={}){return this._encodeSync(e,t,!1).data}encodeSyncWithReport(e,t={}){return this._encodeSync(e,t,!0)}_encodeSync(e,t,n){return t=Z3(t),this.log=t.log||OL,t.pointcloud?this._encodePointCloud(e,t,n):this._encodeMesh(e,t,n)}_getAttributesFromMesh(e){return{...e.indices?{indices:e.indices}:{},...e.attributes}}_encodePointCloud(e,t,n){let s=new this.draco.PointCloud,i=new this.draco.DracoInt8Array,o=null;try{t.metadata&&this._addGeometryMetadata(s,t.metadata);let a=this._getAttributesFromMesh(e),c=this._createDracoPointCloud(s,a,t),u=DL(t),l,f;if(u?(o=new this.draco.ExpertEncoder(s),this._setExpertOptions(o,c,t),f=o,n&&f.SetTrackEncodedProperties(!0),l=o.EncodeToDracoBuffer(t.deduplicateValues??!1,i)):(this._setOptions(t),f=this.dracoEncoder,n&&f.SetTrackEncodedProperties(!0),l=this.dracoEncoder.EncodePointCloudToDracoBuffer(s,t.deduplicateValues??!1,i)),!(l>0))throw new Error("Draco encoding failed.");this.log(`DRACO encoded ${s.num_points()} points
|
|
52
|
+
with ${s.num_attributes()} attributes into ${l} bytes`);let d=ML(i);return{data:d,report:this._getEncodingReport("point-cloud",d.byteLength,s,f,c,t,n)}}finally{this.destroyEncodedObject(o),this.destroyEncodedObject(i),this.destroyEncodedObject(s)}}_encodeMesh(e,t,n){let s=new this.draco.Mesh,i=new this.draco.DracoInt8Array,o=null;try{t.metadata&&this._addGeometryMetadata(s,t.metadata);let a=this._getAttributesFromMesh(e),c=this._createDracoMesh(s,a,t),u=DL(t),l,f;if(u?(o=new this.draco.ExpertEncoder(s),this._setExpertOptions(o,c,t),f=o,n&&f.SetTrackEncodedProperties(!0),l=o.EncodeToDracoBuffer(!1,i)):(this._setOptions(t),f=this.dracoEncoder,n&&f.SetTrackEncodedProperties(!0),l=this.dracoEncoder.EncodeMeshToDracoBuffer(s,i)),l<=0)throw new Error("Draco encoding failed.");this.log(`DRACO encoded ${s.num_points()} points
|
|
53
|
+
with ${s.num_attributes()} attributes into ${l} bytes`);let d=ML(i);return{data:d,report:this._getEncodingReport("mesh",d.byteLength,s,f,c,t,n)}}finally{this.destroyEncodedObject(o),this.destroyEncodedObject(i),this.destroyEncodedObject(s)}}_setOptions(e){if(e.speed&&this.dracoEncoder.SetSpeedOptions(...e.speed),e.method){let t=this.draco[e.method];this.dracoEncoder.SetEncodingMethod(t)}if(e.quantization)for(let t in e.quantization){let n=t,s=e.quantization[n];s!==void 0&&(Rd(n,s,n),this.dracoEncoder.SetAttributeQuantization(this.draco[n],s))}}_setExpertOptions(e,t,n){n.speed&&e.SetSpeedOptions(...n.speed),n.method&&e.SetEncodingMethod(this.draco[n.method]);let s=this._getAttributeQuantization(t,n);for(let[i,o]of s){let a=t[i];typeof o=="number"?e.SetAttributeQuantization(a.attributeId,o):e.SetAttributeExplicitQuantization(a.attributeId,o.bits,a.componentCount,o.origin,o.range)}}_getAttributeQuantization(e,t){let n=new Map;for(let i of Object.keys(t.quantization||{})){let o=t.quantization?.[i];o!==void 0&&(Rd(i,o,i),n.set(this.draco[i],o))}let s=new Map;for(let[i,o]of Object.entries(e)){let a=n.get(o.attributeType);a!==void 0&&s.set(i,a)}for(let[i,o]of Object.entries(t.attributeQuantization||{})){let a=e[i];if(!a)throw new Error(`DracoWriter: quantized attribute "${i}" does not exist`);if(typeof o=="number")Rd(i,o,a.attributeTypeName);else{if(a.attributeTypeName==="NORMAL")throw new Error(`DracoWriter: explicit quantization transforms are not supported for NORMAL attribute "${i}"`);Q3(i,e[i].componentCount,o)}s.set(i,o)}for(let i of s.keys())if(!e[i].supportsQuantization)throw new Error(`DracoWriter: quantization for "${i}" requires floating-point attribute data`);return s}_getEncodingReport(e,t,n,s,i,o,a){let c=this._getAttributeQuantization(i,o),u={};for(let[l,f]of Object.entries(i))u[l]={id:f.attributeId,type:f.attributeTypeName,componentCount:f.componentCount,...c.has(l)?{quantization:c.get(l)}:{}};return{geometryType:e,byteLength:t,pointCount:a?s.GetNumberOfEncodedPoints():n.num_points(),faceCount:a?s.GetNumberOfEncodedFaces():e==="mesh"&&typeof n.num_faces=="function"?n.num_faces():0,attributeCount:n.num_attributes(),...o.method?{method:o.method}:{},...o.speed?{speed:o.speed}:{},attributes:u}}_createDracoMesh(e,t,n){let s=n.attributesMetadata||{},i={},o=this._getVertexCount(t,n);for(let[a,c]of Object.entries(t)){let u=this._addAttributeToMesh(e,a,c,o,n);if(u!==-1){let l=Tu(c),f=this._getDracoAttributeType(a,n.attributeTypes);i[a]={attributeId:u,attributeType:f,attributeTypeName:RL(this.draco,f),componentCount:Dd(c,l.length/o),supportsQuantization:l instanceof Float32Array},this._addAttributeMetadata(e,u,{[n.attributeNameEntry||"name"]:a,...s[a]||{}})}}return i}_createDracoPointCloud(e,t,n){let s=n.attributesMetadata||{},i={},o=this._getVertexCount(t,n);for(let[a,c]of Object.entries(t)){let u=this._addAttributeToMesh(e,a,c,o,n);if(u!==-1){let l=Tu(c),f=this._getDracoAttributeType(a,n.attributeTypes);i[a]={attributeId:u,attributeType:f,attributeTypeName:RL(this.draco,f),componentCount:Dd(c,l.length/o),supportsQuantization:l instanceof Float32Array},this._addAttributeMetadata(e,u,{[n.attributeNameEntry||"name"]:a,...s[a]||{}})}}return i}_addAttributeToMesh(e,t,n,s,i={}){let o=Tu(n);if(!o)throw new Error(`DracoWriter: attribute "${t}" must contain a typed array`);let a=this._getDracoAttributeType(t,i.attributeTypes),c=Dd(n,o.length/s);if(a==="indices"){if(o.length%3!==0)throw new Error("DracoWriter: triangle indices length must be divisible by 3");Y3(o,s);let f=o.length/3;this.log(`Adding attribute ${t}, size ${f}`);let d=o instanceof Uint16Array||o instanceof Uint32Array?o:Uint32Array.from(o);return this.dracoMeshBuilder.AddFacesToMesh(e,f,d),-1}if(!Number.isInteger(c)||c<=0||o.length!==s*c)throw new Error(`DracoWriter: attribute "${t}" has ${o.length} values, expected ${s*c}`);this.log(`Adding attribute ${t}, size ${c}`);let u=this.dracoMeshBuilder,l=-1;if(o instanceof Int8Array)l=u.AddInt8Attribute(e,a,s,c,o);else if(o instanceof Int16Array)l=u.AddInt16Attribute(e,a,s,c,o);else if(o instanceof Int32Array)l=u.AddInt32Attribute(e,a,s,c,o);else if(o instanceof Uint8Array)l=u.AddUInt8Attribute(e,a,s,c,o);else if(o instanceof Uint8ClampedArray){let f=new Uint8Array(o.buffer,o.byteOffset,o.byteLength);l=u.AddUInt8Attribute(e,a,s,c,f)}else if(o instanceof Uint16Array)l=u.AddUInt16Attribute(e,a,s,c,o);else if(o instanceof Uint32Array)l=u.AddUInt32Attribute(e,a,s,c,o);else if(o instanceof Float32Array)l=u.AddFloatAttribute(e,a,s,c,o);else throw new Error(`DracoWriter: attribute "${t}" uses unsupported ${o.constructor.name}`);return!ArrayBuffer.isView(n)&&n.normalized!==void 0&&u.SetNormalizedFlagForAttribute(e,l,n.normalized),l}_getDracoAttributeType(e,t={}){if(e.toLowerCase()==="indices")return"indices";let n=t[e];if(n)return this.draco[n];let s=H3[e];if(s)return this.draco[s];switch(e.toLowerCase()){case"position":case"positions":case"vertices":return this.draco.POSITION;case"normal":case"normals":return this.draco.NORMAL;case"color":case"colors":return this.draco.COLOR;case"texcoord":case"texcoords":return this.draco.TEX_COORD;default:return/^color_\d+$/i.test(e)?this.draco.COLOR:/^texcoord_\d+$/i.test(e)?this.draco.TEX_COORD:this.draco.GENERIC}}_getVertexCount(e,t){let n=this._getPositionAttribute(e,t.attributeTypes),s=n&&Tu(n);if(!n||!s)throw new Error("DracoWriter: POSITION attribute is required");let i=Dd(n,3);if(!Number.isInteger(i)||i<=0||s.length%i!==0)throw new Error("DracoWriter: POSITION attribute has an invalid size or value count");return s.length/i}_getPositionAttribute(e,t={}){for(let n in e){let s=e[n];if(this._getDracoAttributeType(n,t)===this.draco.POSITION&&Tu(s))return s}return null}_addGeometryMetadata(e,t){let n=new this.draco.Metadata;this._populateDracoMetadata(n,t),this.dracoMeshBuilder.AddMetadata(e,n)}_addAttributeMetadata(e,t,n){let s=new this.draco.Metadata;this._populateDracoMetadata(s,n),this.dracoMeshBuilder.SetMetadataForAttribute(e,t,s)}_populateDracoMetadata(e,t){for(let[n,s]of J3(t))switch(typeof s){case"number":Math.trunc(s)===s?this.dracoMetadataBuilder.AddIntEntry(e,n,s):this.dracoMetadataBuilder.AddDoubleEntry(e,n,s);break;case"object":s instanceof Int32Array&&this.dracoMetadataBuilder.AddIntEntryArray(e,n,s,s.length);break;default:this.dracoMetadataBuilder.AddStringEntry(e,n,s)}}}});async function r8(r,e={}){return(await NL(r,e)).data}async function NL(r,e={}){let{draco:t}=await hy(hn(e)),n=new Ma(t);try{return n.encodeSyncWithReport(PL(r),e.draco)}finally{n.destroy()}}async function n8(r,e={}){UL(e.signal);let t=[],n=0;for await(let s of aw([r],e))t.push(s),n++,e.onProgress?.({completed:n,total:r.length});return t}function aw(r,e={}){let t=i8(r);if(nb(ow,e)){let{onProgress:n,...s}=e;return eb(ow,t,s)}return CL(t,e)}async function*s8(r,e={}){let t=(async function*(){for await(let n of r)yield[n]})();for await(let n of aw(t,e))yield n.data}async function*CL(r,e={}){let{draco:t}=await hy(hn(e)),n=new Ma(t);try{for await(let s of r)for(let i of s)UL(e.signal),yield n.encodeSyncWithReport(i,e.draco)}finally{n.destroy()}}async function*i8(r){for await(let e of r)yield e.map(PL)}function UL(r){if(!r?.aborted)return;if(r.reason!==void 0)throw r.reason;let e=new Error("Draco batch encoding aborted");throw e.name="AbortError",e}function PL(r){if(o8(r))return pn(r);if(a8(r))return r;let{indices:e,...t}=r;return{attributes:t,...e?{indices:e}:{}}}function o8(r){return typeof r=="object"&&r!==null&&"shape"in r&&r.shape==="arrow-table"}function a8(r){return typeof r=="object"&&r!==null&&"attributes"in r&&typeof r.attributes=="object"&&r.attributes!==null&&!ArrayBuffer.isView(r.attributes)}var e8,ow,t8,VL=p(()=>{"use strict";Ue();mn();Js();kL();uu();cy();uy();e8={pointcloud:!1,attributeNameEntry:"name"},ow={...au,id:"draco-writer",name:"Draco compressed geometry writer",module:"scene",version:ou,worker:!0,workerNode:"draco-writer-worker-node.cjs",workerSourceNode:"draco/workers/draco-writer-worker-node.ts",options:{draco:{}}},t8={...au,name:"DRACO",version:ou,options:{draco:e8},encode:r8,encodeInBatches:s8}});var jL={};J(jL,{DracoWriter:()=>t8,DracoWriterWorker:()=>ow,encodeDraco:()=>NL,encodeDracoBatch:()=>n8,encodeDracoInBatches:()=>aw,encodeDracoInBatchesLocally:()=>CL});var GL=p(()=>{"use strict";VL()});var wU={};J(wU,{DRACO_EXTERNAL_LIBRARIES:()=>xt,DRACO_EXTERNAL_LIBRARY_URLS:()=>lB,DracoFormat:()=>Ud,DracoLoader:()=>Pd,DracoWorkerLoader:()=>cB,FetchError:()=>A.FetchError,GLBFormat:()=>Fa,GLBLoader:()=>nB,GLBWriter:()=>iB,GLTFFormat:()=>Ba,GLTFLoader:()=>IL,GLTFWriter:()=>rB,JSONLoader:()=>A.JSONLoader,MTLFormat:()=>Bd,MTLLoader:()=>Zy,MTLWorkerLoader:()=>TL,MaterialXLoader:()=>fB,NullLoader:()=>A.NullLoader,NullWorkerLoader:()=>A.NullWorkerLoader,OBJFormat:()=>La,OBJLoader:()=>Qy,OBJWorkerLoader:()=>xL,OBJWriter:()=>AL,RequestScheduler:()=>A.RequestScheduler,STLLoader:()=>dB,USDLoader:()=>Na,_BrowserFileSystem:()=>A._BrowserFileSystem,_fetchProgress:()=>A._fetchProgress,_selectSource:()=>A._selectSource,_unregisterLoaders:()=>A._unregisterLoaders,assert:()=>A.assert,concatenateArrayBuffersAsync:()=>A.concatenateArrayBuffersAsync,coreApi:()=>A.coreApi,createDataSource:()=>A.createDataSource,document:()=>A.document,encode:()=>A.encode,encodeInBatches:()=>A.encodeInBatches,encodeSync:()=>A.encodeSync,encodeTable:()=>A.encodeTable,encodeTableAsText:()=>A.encodeTableAsText,encodeTableInBatches:()=>A.encodeTableInBatches,encodeText:()=>A.encodeText,encodeTextSync:()=>A.encodeTextSync,encodeURLtoURL:()=>A.encodeURLtoURL,fetchFile:()=>A.fetchFile,forEach:()=>A.forEach,getLoaderOptions:()=>A.getLoaderOptions,getPathPrefix:()=>A.getPathPrefix,global:()=>A.global,isAsyncIterable:()=>A.isAsyncIterable,isBrowser:()=>A.isBrowser,isIterable:()=>A.isIterable,isIterator:()=>A.isIterator,isPromise:()=>A.isPromise,isPureObject:()=>A.isPureObject,isReadableStream:()=>A.isReadableStream,isResponse:()=>A.isResponse,isWorker:()=>A.isWorker,isWritableStream:()=>A.isWritableStream,load:()=>A.load,loadInBatches:()=>A.loadInBatches,makeIterator:()=>A.makeIterator,makeLineIterator:()=>A.makeLineIterator,makeNumberedLineIterator:()=>A.makeNumberedLineIterator,makeStream:()=>A.makeStream,makeTextDecoderIterator:()=>A.makeTextDecoderIterator,makeTextEncoderIterator:()=>A.makeTextEncoderIterator,parse:()=>A.parse,parseFile:()=>A.parseFile,parseInBatches:()=>A.parseInBatches,parseSync:()=>A.parseSync,preload:()=>A.preload,preloadSync:()=>A.preloadSync,readArrayBuffer:()=>A.readArrayBuffer,registerLoaders:()=>A.registerLoaders,resolvePath:()=>A.resolvePath,selectLoader:()=>A.selectLoader,selectLoaderSync:()=>A.selectLoaderSync,self:()=>A.self,setLoaderOptions:()=>A.setLoaderOptions,setPathPrefix:()=>A.setPathPrefix,window:()=>A.window});var A=wB(jw(),1);Yd();var La={name:"OBJ",id:"obj",module:"scene",encoding:"text",format:"obj",extensions:["obj"],mimeTypes:["text/plain"]};ea();var F3=typeof __VERSION__<"u"?__VERSION__:"latest";async function O3(){let{OBJLoaderWithParser:r}=await Promise.resolve().then(()=>(Xb(),Kb));return r}var Qy={...La,dataType:null,batchType:null,version:F3,worker:!0,workerInBatches:!0,serializeWorkerResult:Hi,text:!0,testText:M3,options:{obj:{shape:"arrow-table"}},preload:O3};function M3(r){return r[0]==="v"}var xL=Qy;var Bd={name:"MTL",id:"mtl",module:"mtl",encoding:"text",format:"mtl",extensions:["mtl"],mimeTypes:["text/plain"]};var D3=typeof __VERSION__<"u"?__VERSION__:"latest";async function R3(){let{MTLLoaderWithParser:r}=await Promise.resolve().then(()=>(Qb(),Yb));return r}var Zy={...Bd,dataType:null,batchType:null,version:D3,worker:!0,text:!0,testText:r=>r.includes("newmtl"),options:{mtl:{}},preload:R3},TL=Zy;mn();var k3=typeof __VERSION__<"u"?__VERSION__:"latest",AL={...La,dataType:null,batchType:null,version:k3,options:{obj:{}},text:!0,encode:async(r,e)=>_L(r,e),encodeSync:_L,encodeTextSync:vL};function _L(r,e){let t=vL(r,e);return new TextEncoder().encode(t).buffer}function vL(r,e){let t=pn(N3(r)),n=C3(t,"POSITION"),s=t.attributes.NORMAL,i=t.attributes.TEXCOORD_0,o=t.attributes.COLOR_0,a=n.value.length/n.size,c=["# loaders.gl OBJ"];for(let l=0;l<a;l++){let f=[Jn(n,l,0),Jn(n,l,1),Jn(n,l,2)];o&&f.push(ew(o,l,0),ew(o,l,1),ew(o,l,2)),c.push(`v ${f.join(" ")}`)}if(i)for(let l=0;l<a;l++)c.push(`vt ${Jn(i,l,0)} ${Jn(i,l,1)}`);if(s)for(let l=0;l<a;l++)c.push(`vn ${Jn(s,l,0)} ${Jn(s,l,1)} ${Jn(s,l,2)}`);let u=U3(t,a);for(let l=0;l<u.length;l+=3){let f=[tw(u[l],!!i,!!s),tw(u[l+1],!!i,!!s),tw(u[l+2],!!i,!!s)];c.push(`f ${f.join(" ")}`)}return`${c.join(`
|
|
54
54
|
`)}
|
|
55
|
-
`}function RC(r){return"shape"in r&&r.shape==="arrow-table"?r:Js(r,"arrow-table")}function DC(r,e){let t=r.attributes[e];if(!t)throw new Error(`OBJWriter: ${e} attribute is required`);return t}function $n(r,e,t){return r.value[e*r.size+t]||0}function Ey(r,e,t){let n=$n(r,e,t);return r.normalized||n>1?n/255:n}function NC(r,e){if(r.indices?.value?.length)return Array.from(r.indices.value);if(r.mode!==4&&r.topology!=="triangle-list")return[];let t=[];for(let n=0;n+2<e;n+=3)t.push(n,n+1,n+2);return t}function Ly(r,e,t){let n=r+1;return e&&t?`${n}/${n}/${n}`:e?`${n}/${n}`:t?`${n}//${n}`:String(n)}var ti=typeof __VERSION__<"u"?__VERSION__:"latest";var Ia={name:"glTF",id:"gltf",module:"scene",encoding:"binary",format:"gltf",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"]},Sa={name:"GLB",id:"glb",module:"scene",encoding:"binary",format:"glb",extensions:["glb"],mimeTypes:["model/gltf-binary"],binary:!0,tests:["glTF"]};async function kC(){let{GLTFLoaderWithParser:r}=await Promise.resolve().then(()=>(by(),my));return r}var RE={dataType:null,batchType:null,...Ia,version:ti,preload:kC,options:{gltf:{normalize:!0,loadBuffers:!0,loadFiles:!1,loadExternalAssets:!1,loadImages:!0,loadAudio:!0,decompressMeshes:!0}}};ke();var CC=1179937895,DE=1313821514,By=5130562,Lt=!0;function hu(r,e,t=0,n={}){let s=CC,i=n.version??("version"in r?r.version:2),o=r.json??{};if(i===3)return UC(r,e,t,s,o);if(i!==2)throw new Error(`Unsupported GLB writer version ${i}.`);let a="binChunks"in r?r.binary?new Uint8Array(r.binary):r.binChunks?.[0]&&bd(r.binChunks[0]):r.buffers?.[0]&&bd(r.buffers[0]),c=t;e&&(e.setUint32(t+0,s,Lt),e.setUint32(t+4,i,Lt),e.setUint32(t+8,0,Lt));let u=t+8;t+=12;let f=t;e&&(e.setUint32(t+0,0,Lt),e.setUint32(t+4,DE,Lt)),t+=8;let l=JSON.stringify(o);if(t=fl(e,t,l,4),e){let d=t-f-8;e.setUint32(f+0,d,Lt)}if(a){let d=t;if(e&&(e.setUint32(t+0,0,Lt),e.setUint32(t+4,By,Lt)),t+=8,t=Dc(e,t,a,4),e){let h=t-d-8;e.setUint32(d+0,h,Lt)}}if(e){let d=t-c;e.setUint32(u,d,Lt)}return t}function UC(r,e,t,n,s){let i=t,o=[{type:DE,arrayBuffer:VC(s)},...("chunks"in r?r.chunks:[])??[],..."binChunks"in r?(r.binChunks??[]).map(a=>({type:By,arrayBuffer:bd(a).slice().buffer})):(r.buffers??[]).map(a=>({type:By,arrayBuffer:bd(a).slice().buffer}))];e&&(e.setUint32(t,n,Lt),e.setUint32(t+4,3,Lt),md(e,t+8,0,"GLB file length")),t+=16;for(let a of o){let c=a.encoding??0;if(c!==0)throw new Error(`Unsupported GLB chunk encoding ${c}.`);let u=t;e&&(e.setUint32(t,a.type,Lt),e.setUint32(t+4,c,Lt),md(e,t+8,0,"GLB chunk length")),t+=16,t=Dc(e,t,new Uint8Array(a.arrayBuffer),4),e&&md(e,u+8,t-u-16,"GLB chunk length")}return e&&md(e,i+8,t-i,"GLB file length"),t}function bd(r){return new Uint8Array(r.arrayBuffer,r.byteOffset,r.byteLength)}function VC(r){let e=JSON.stringify(r),t=new TextEncoder().encode(e).byteLength,n=Math.ceil(t/4)*4,s=new ArrayBuffer(n),i=new DataView(s);return fl(i,0,e,4),s}function md(r,e,t,n){if(!Number.isSafeInteger(t)||t<0)throw new Error(`${n} is outside the safe integer range.`);r.setBigUint64(e,BigInt(t),Lt)}function Fy(r,e,t,n){return PC(r),hu(r,e,t,n)}function PC(r){if(r.buffers&&r.buffers.length>1)throw new Error("encodeGLTF: multiple buffers not yet implemented")}function Ae(r,e){if(!r)throw new Error(e||"assert failed: gltf")}ke();var NE={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},kE={5120:1,5121:1,5122:2,5123:2,5124:4,5125:4,5126:4,5130:8,5131:2,5134:8,5135:8};var CE=["SCALAR","VEC2","VEC3","VEC4"],jC=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Int32Array,5124],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130],[BigInt64Array,5134],[BigUint64Array,5135]],GC=new Map(jC),zC={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},WC={5120:1,5121:1,5122:2,5123:2,5124:4,5125:4,5126:4,5130:8,5131:2,5134:8,5135:8},$C={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5124:Int32Array,5125:Uint32Array,5126:Float32Array,5130:Float64Array,5131:Uint16Array,5134:BigInt64Array,5135:BigUint64Array};function gd(r){return CE[r-1]||CE[0]}function po(r){let e=GC.get(r.constructor);if(!e)throw new Error("Illegal typed array");return e}function Oy(r,e){let t=$C[r.componentType],n=zC[r.type],s=WC[r.componentType],i=r.count*n,o=r.count*n*s;Ae(o>=0&&o<=e.byteLength);let a=kE[r.componentType],c=NE[r.type];return{ArrayType:t,length:i,byteLength:o,componentByteSize:a,numberOfComponentsInElement:c}}function pu(r,e,t){let n=typeof t=="number"?r.bufferViews[t]:t;Ae(n);let s=n.buffer,i=e[s];Ae(i),Ae((n.byteOffset||0)>=0&&n.byteLength>=0),Ae((n.byteOffset||0)+n.byteLength<=i.byteLength),Ae(i.byteOffset>=0&&i.byteOffset+i.byteLength<=i.arrayBuffer.byteLength);let o=(n.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,o,n.byteLength)}function UE(r,e,t){let n=r.images[t];return pu(r,e,n.bufferView)}function Ea(r,e,t){let n=typeof t=="number"?r.accessors?.[t]:t;if(!n)throw new Error(`No gltf accessor ${JSON.stringify(t)}`);Ae(Number.isSafeInteger(n.count)&&n.count>=0);let{ArrayType:s,length:i,numberOfComponentsInElement:o}=Oy(n,{byteLength:1/0}),a=n.value,c;ArrayBuffer.isView(a)?(Ae(a.length===i),c=a):n.bufferView===void 0?c=new s(i):c=My(r,e,n);let u=n.sparse;if(!u)return c;let f=new s(i);new Uint8Array(f.buffer).set(new Uint8Array(c.buffer,c.byteOffset,c.byteLength)),Ae(u.count>=0&&u.count<=n.count),Ae([5121,5123,5125].includes(u.indices.componentType));let l=My(r,e,{bufferView:u.indices.bufferView,byteOffset:u.indices.byteOffset,componentType:u.indices.componentType,count:u.count,type:"SCALAR"}),d=My(r,e,{bufferView:u.values.bufferView,byteOffset:u.values.byteOffset,componentType:n.componentType,count:u.count,type:n.type}),h=-1,m=new Uint8Array(f.buffer),b=o*s.BYTES_PER_ELEMENT,w=new Uint8Array(d.buffer,d.byteOffset,d.byteLength);for(let g=0;g<u.count;g++){let x=Number(l[g]);Ae(x>h&&x<n.count),m.set(w.subarray(g*b,(g+1)*b),x*b),h=x}return f}function My(r,e,t){let n=r.bufferViews?.[t.bufferView];if(!n)throw new Error(`No gltf buffer view for accessor ${n}`);let s=e[n.buffer];Ae(s);let{arrayBuffer:i,byteOffset:o}=s;Ae((n.byteOffset||0)>=0&&n.byteLength>=0),Ae((n.byteOffset||0)+n.byteLength<=s.byteLength),Ae(o>=0&&o+s.byteLength<=i.byteLength),Ae((t.byteOffset||0)>=0);let a=(o||0)+(t.byteOffset||0)+(n.byteOffset||0),{ArrayType:c,length:u,componentByteSize:f,numberOfComponentsInElement:l}=Oy(t,n),d=f*l,h=t.type.startsWith("MAT")?Number(t.type.slice(3)):1,m=Te(h*f,4),b=h>1?h*m:d,w=n.byteStride??b,g=h>1?(h-1)*m+h*f:d;if(Ae(w>=b),Ae((t.byteOffset||0)+(t.count===0?0:(t.count-1)*w+g)<=n.byteLength),t.count===0)return new c(0);if(h>1&&m!==h*f){let _=n.byteStride??h*m,v=(h-1)*m+h*f;Ae((t.byteOffset||0)+(t.count-1)*_+v<=n.byteLength);let I=new c(u),N=new Uint8Array(I.buffer,I.byteOffset,I.byteLength);for(let q=0;q<t.count;q++)for(let re=0;re<h;re++){let pe=new Uint8Array(i,a+q*_+re*m,h*f);N.set(pe,q*d+re*h*f)}return I}let x=n.byteStride||d;if(typeof n.byteStride>"u"||n.byteStride===d){if(a%f!==0){let v=new Uint8Array(i,a,u*f),I=new Uint8Array(v.byteLength);return I.set(v),new c(I.buffer,0,u)}return new c(i,a,u)}let T=new c(u);for(let _=0;_<t.count;_++){let v=a+_*x,I;if(v%f!==0){let N=new Uint8Array(i,v,d),q=new Uint8Array(d);q.set(N),I=new c(q.buffer,0,l)}else I=new c(i,v,l);T.set(I,_*l)}return T}var Ny="KHR_draco_mesh_compression";async function QE(r,e={}){let t=e.gltf?.draco;if(!t?.enabled)return r;if((r.buffers?.length||0)>1)throw new Error("GLTF Draco writer requires a single buffer");let n=o8(r.json),s=a8(r.buffers||[]),i={...r,json:n,buffers:s},o=[];for(let d of n.meshes||[])for(let h of d.primitives||[]){let m=h.mode??4;if(m!==4){if(t.skipUnsupportedPrimitives??!0)continue;throw new Error(`GLTF Draco writer cannot compress primitive mode ${m}; only TRIANGLES (4) is supported`)}if(h.extensions?.[Ny])throw new Error("GLTF Draco writer refuses to replace an existing Draco extension");let b=i8(r,h),{encodeDraco:w}=await Promise.resolve().then(()=>(JE(),HE)),g=await w(b,{core:e.core,modules:e.modules,draco:t});o.push({primitive:h,result:g})}if(o.length===0)return i;let a=c8(s),c=a.byteLength;for(let{result:d}of o)c=ky(c)+d.data.byteLength;let u=new Uint8Array(c);u.set(a),n.bufferViews=n.bufferViews||[],n.buffers=n.buffers||[{byteLength:0}];let f=ky(a.byteLength);for(let{primitive:d,result:h}of o){new Uint8Array(u.buffer,f,h.data.byteLength).set(new Uint8Array(h.data));let m=n.bufferViews.length;n.bufferViews.push({buffer:0,byteOffset:f,byteLength:h.data.byteLength}),d.extensions={...d.extensions||{},[Ny]:{bufferView:m,attributes:Object.fromEntries(Object.entries(h.report.attributes).map(([b,w])=>[b,w.id]))}},f=ky(f+h.data.byteLength)}let l=u;return i.buffers[0]={...i.buffers[0]||{byteOffset:0},arrayBuffer:l.buffer,byteOffset:0,byteLength:l.byteLength},n.buffers[0]={...n.buffers[0]||{},byteLength:l.byteLength},n.extensionsUsed=u8(n.extensionsUsed,Ny),i}function i8(r,e){if(!e.attributes||e.attributes.POSITION===void 0)throw new Error("GLTF Draco writer requires a POSITION attribute");let t={};for(let[s,i]of Object.entries(e.attributes)){let o=r.json.accessors?.[i];if(!o)throw new Error(`GLTF Draco writer could not resolve accessor ${i}`);if(o.sparse)throw new Error(`GLTF Draco writer does not support sparse accessor ${i}`);let a=YE(r,i,o.componentType);t[s]={value:a,size:f8(o.type),...o.normalized===void 0?{}:{normalized:o.normalized}}}let n;if(e.indices!==void 0){let s=r.json.accessors?.[e.indices];if(!s)throw new Error(`GLTF Draco writer could not resolve index accessor ${e.indices}`);if(s.sparse)throw new Error(`GLTF Draco writer does not support sparse accessor ${e.indices}`);n=YE(r,e.indices,s.componentType)}else{let s=r.json.accessors?.[e.attributes.POSITION];if(!s||s.count%3!==0)throw new Error("GLTF Draco writer requires triangle-aligned POSITION data without indices");n=new Uint32Array(s.count);for(let i=0;i<n.length;i++)n[i]=i}return{attributes:t,indices:n}}function YE(r,e,t){let n=Ea(r.json,r.buffers,e);if(n instanceof BigInt64Array||n instanceof BigUint64Array||n instanceof Float64Array)throw new Error(`GLTF Draco writer does not support 64-bit accessor ${e} (componentType ${t}); the official 1.5.7 encoder binding has no 64-bit attribute API`);return n}function o8(r){return JSON.parse(JSON.stringify(r))}function a8(r){return r.map(e=>({...e,arrayBuffer:e.arrayBuffer.slice(0)}))}function c8(r){let e=r[0]||{arrayBuffer:new ArrayBuffer(0),byteOffset:0,byteLength:0};return new Uint8Array(e.arrayBuffer,e.byteOffset||0,e.byteLength)}function ky(r){return Math.ceil(r/4)*4}function u8(r,e){return r?.includes(e)?r:[...r||[],e]}function f8(r){switch(r){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":return 4;case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16;default:throw new Error(`GLTF Draco writer does not recognize accessor type ${r}`)}}var ow={};J(ow,{createExtMeshFeatures:()=>A8,decode:()=>y8,encode:()=>w8,name:()=>g8});jn();ke();function l8(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}var ri=class{gltf;sourceBuffers;byteLength;constructor(e){this.gltf={json:e?.json||l8(),buffers:e?.buffers||[],images:e?.images||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=Te(this.gltf.buffers[0].byteLength,4),this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}hasExtension(e){let t=this.getUsedExtensions().find(s=>s===e),n=this.getRequiredExtensions().find(s=>s===e);return typeof t=="string"||typeof n=="string"}getExtension(e){let t=this.getUsedExtensions().find(s=>s===e),n=this.json.extensions||{};return t?n[e]:null}getRequiredExtension(e){return this.getRequiredExtensions().find(n=>n===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(e,t){return(e.extensions||{})[t]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,t){if(typeof t=="object")return t;let n=this.json[e]&&this.json[e][t];if(!n)throw new Error(`glTF file error: Could not find ${e}[${t}]`);return n}getTypedArrayForBufferView(e){return pu(this.gltf.json,this.gltf.buffers,e)}getTypedArrayForAccessor(e){return Ea(this.gltf.json,this.gltf.buffers,e)}getTypedArrayForImageData(e){e=this.getAccessor(e);let t=this.getBufferView(e.bufferView),s=this.getBuffer(t.buffer).data,i=t.byteOffset||0;return new Uint8Array(s,i,t.byteLength)}addApplicationData(e,t){return this.json[e]=t,this}addExtraData(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}addObjectExtension(e,t,n){return e.extensions=e.extensions||{},e.extensions[t]=n,this.registerUsedExtension(t),this}setObjectExtension(e,t,n){let s=e.extensions||{};s[t]=n}removeObjectExtension(e,t){let n=e?.extensions||{};if(n[t]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let s=this.json.extensionsRemoved;s.includes(t)||s.push(t)}delete n[t]}addExtension(e,t={}){return Ae(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return Ae(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(t=>t===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(t=>t===e)||this.json.extensionsRequired.push(e)}removeExtension(e){if(this.json.extensions?.[e]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let t=this.json.extensionsRemoved;t.includes(e)||t.push(e)}this.json.extensions&&delete this.json.extensions[e],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e)}setDefaultScene(e){this.json.scene=e}addScene(e){let{nodeIndices:t}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(e){let{meshIndex:t,matrix:n}=e;this.json.nodes=this.json.nodes||[];let s={mesh:t};return n&&(s.matrix=n),this.json.nodes.push(s),this.json.nodes.length-1}addMesh(e){let{attributes:t,indices:n,material:s,mode:i=4}=e,a={primitives:[{attributes:this._addAttributes(t),mode:i}]};if(n){let c=this._addIndices(n);a.primitives[0].indices=c}return Number.isFinite(s)&&(a.primitives[0].material=s),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(e){let n={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(n),this.json.meshes.length-1}addImage(e,t){let n=Pn(e),s=t||n?.mimeType,o={bufferView:this.addBufferView(e),mimeType:s};return this.json.images=this.json.images||[],this.json.images.push(o),this.json.images.length-1}addBufferView(e,t=0,n=this.byteLength){let s=e.byteLength;Ae(Number.isFinite(s)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);let i={buffer:t,byteOffset:n,byteLength:s};return this.byteLength+=Te(s,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}addAccessor(e,t){let n=t.normalized,s={bufferView:e,...n===void 0?{}:{normalized:n},type:gd(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(s),this.json.accessors.length-1}addBinaryBuffer(e,t={size:3}){let n=this.addBufferView(e),s={min:t.min,max:t.max};(!s.min||!s.max)&&(s=this._getAccessorMinMax(e,t.size));let i={size:t.size,componentType:po(e),count:Math.round(e.length/t.size),min:s.min,max:s.max};return this.addAccessor(n,Object.assign(i,t))}addTexture(e){let{imageIndex:t,samplerIndex:n}=e,s={source:t,...n===void 0?{}:{sampler:n}};return this.json.textures=this.json.textures||[],this.json.textures.push(s),this.json.textures.length-1}addSampler(e){return this.json.samplers=this.json.samplers||[],this.json.samplers.push({...e}),this.json.samplers.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){if(this.byteLength===0&&!this.json.buffers?.length){delete this.json.buffers,delete this.gltf.binary,this.sourceBuffers=[],this.gltf.buffers=[];return}let e=[0],t=this.byteLength;for(let o=1;o<this.gltf.buffers.length;o++){let a=this.gltf.buffers[o];a&&(e[o]=Te(t,8),t=e[o]+Te(a.byteLength,4))}let n=new ArrayBuffer(t),s=new Uint8Array(n),i=0;for(let o of this.sourceBuffers||[])i=Yi(o,s,i);for(let o=1;o<this.gltf.buffers.length;o++){let a=this.gltf.buffers[o];a&&Yi(a,s,e[o])}for(let o of this.json.bufferViews||[]){let a=e[o.buffer];Ae(a!==void 0),o.byteOffset=a+(o.byteOffset||0),o.buffer=0;for(let c of["EXT_meshopt_compression","KHR_meshopt_compression"]){let u=o.extensions?.[c];if(u){let f=e[u.buffer];Ae(f!==void 0),u.byteOffset=f+(u.byteOffset||0),u.buffer=0}}}this.byteLength=t,this.json.buffers=[{byteLength:t}],this.gltf.binary=n,this.sourceBuffers=[n],this.gltf.buffers=[{arrayBuffer:n,byteOffset:0,byteLength:n.byteLength}]}_removeStringFromArray(e,t){let n=!0;for(;n;){let s=e.indexOf(t);s>-1?e.splice(s,1):n=!1}}_addAttributes(e={}){let t={};for(let n in e){let s=e[n],i=this._getGltfAttributeName(n),o=s.value,a=o.BYTES_PER_ELEMENT*s.size,c=Te(a,4),u;if(c===a)u=this.addBinaryBuffer(o,s);else{let f=o.length/s.size,l=new Uint8Array(f*c),d=new Uint8Array(o.buffer,o.byteOffset,o.byteLength);for(let m=0;m<f;m++)l.set(d.subarray(m*a,(m+1)*a),m*c);let h=this.addBufferView(l);this.json.bufferViews[h].byteStride=c,u=this.addAccessor(h,{...this._getAccessorMinMax(o,s.size),...s,componentType:po(o),count:f})}t[i]=u}return t}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,t){let n={min:null,max:null};if(e.length<t)return n;n.min=[],n.max=[];let s=e.subarray(0,t);for(let i of s)n.min.push(i),n.max.push(i);for(let i=t;i<e.length;i+=t)for(let o=0;o<t;o++)n.min[0+o]=Math.min(n.min[0+o],e[i+o]),n.max[0+o]=Math.max(n.max[0+o],e[i+o]);return n}};var He=class{gltf;type;index;data;path;iterator;constructor(e,t,n,s,i){this.iterator=e,this.gltf=e.gltf,this.type=t,this.index=n,this.data=s,this.path=i}},ni=class extends He{parent;constructor(e,t,n,s,i,o){super(e,t,n,s,i),this.parent=o}},Cy=class extends He{get bufferView(){return this.data.bufferView===void 0?void 0:this.iterator.resolveBufferView(this.data.bufferView,`${this.path}.bufferView`)}},Uy=class extends He{get channels(){return bo(this.data.channels,(e,t)=>this.iterator.getOrCreateNested(e,()=>new Vy(this.iterator,"animationChannel",t,e,`${this.path}.channels[${t}]`,this)))}get samplers(){return bo(this.data.samplers,(e,t)=>this.iterator.getOrCreateNested(e,()=>new xd(this.iterator,"animationSampler",t,e,`${this.path}.samplers[${t}]`,this)))}},Vy=class extends ni{get sampler(){let t=this.parent.data.samplers[this.data.sampler];if(!t)throw new Error(`Invalid glTF reference at ${this.path}.sampler: animation sampler index ${this.data.sampler} is out of range`);return this.iterator.getOrCreateNested(t,()=>new xd(this.iterator,"animationSampler",this.data.sampler,t,`${this.parent.path}.samplers[${this.data.sampler}]`,this.parent))}get target(){return this.iterator.getOrCreateNested(this.data.target,()=>new Py(this.iterator,"animationChannelTarget",0,this.data.target,`${this.path}.target`,this))}},Py=class extends ni{get node(){return this.data.node===void 0?void 0:this.iterator.resolveNode(this.data.node,`${this.path}.node`)}},xd=class extends ni{get input(){return this.iterator.resolveAccessor(this.data.input,`${this.path}.input`)}get output(){return this.iterator.resolveAccessor(this.data.output,`${this.path}.output`)}},jy=class extends He{get loadedBuffer(){return this.gltf.buffers[this.index]}},Gy=class extends He{get buffer(){return this.iterator.resolveBuffer(this.data.buffer,`${this.path}.buffer`)}get loadedBufferView(){let e=this.buffer.loadedBuffer;if(!e)return;let t=e.byteOffset+(this.data.byteOffset||0);return new Uint8Array(e.arrayBuffer,t,this.data.byteLength)}},zy=class extends He{},Wy=class extends He{get file(){return this.iterator.resolveFile(this.data.file,`${this.path}.file`)}get loadedAsset(){return this.gltf.externalAssets?.[this.index]}},$y=class extends He{get bufferView(){return this.data.bufferView===void 0?void 0:this.iterator.resolveBufferView(this.data.bufferView,`${this.path}.bufferView`)}get loadedFile(){return this.gltf.files?.[this.index]}},qy=class extends He{get bufferView(){return this.data.bufferView===void 0?void 0:this.iterator.resolveBufferView(this.data.bufferView,`${this.path}.bufferView`)}get loadedImage(){return this.gltf.images?.[this.index]}},Ky=class extends He{get baseColorTexture(){return this.getTextureInfo(this.data.pbrMetallicRoughness?.baseColorTexture,0,"pbrMetallicRoughness.baseColorTexture")}get metallicRoughnessTexture(){return this.getTextureInfo(this.data.pbrMetallicRoughness?.metallicRoughnessTexture,1,"pbrMetallicRoughness.metallicRoughnessTexture")}get normalTexture(){return this.getTextureInfo(this.data.normalTexture,2,"normalTexture")}get occlusionTexture(){return this.getTextureInfo(this.data.occlusionTexture,3,"occlusionTexture")}get emissiveTexture(){return this.getTextureInfo(this.data.emissiveTexture,4,"emissiveTexture")}get textures(){return[this.baseColorTexture,this.metallicRoughnessTexture,this.normalTexture,this.occlusionTexture,this.emissiveTexture].filter(t=>!!t).values()}getTextureInfo(e,t,n){return e?this.iterator.getOrCreateNested(e,()=>new Xy(this.iterator,"textureInfo",t,e,`${this.path}.${n}`,this)):void 0}},Xy=class extends ni{get texture(){return this.iterator.resolveTexture(this.data.index,`${this.path}.index`)}},Hy=class extends He{get primitives(){return bo(this.data.primitives,(e,t)=>this.iterator.getOrCreateNested(e,()=>new Jy(this.iterator,"primitive",t,e,`${this.path}.primitives[${t}]`,this)))}},Jy=class extends ni{get attributes(){return new Map(Object.entries(this.data.attributes).map(([e,t])=>[e,this.iterator.resolveAccessor(t,`${this.path}.attributes.${e}`)]))}get indices(){return this.data.indices===void 0?void 0:this.iterator.resolveAccessor(this.data.indices,`${this.path}.indices`)}get material(){return this.data.material===void 0?void 0:this.iterator.resolveMaterial(this.data.material,`${this.path}.material`)}get targets(){return(this.data.targets||[]).map((e,t)=>new Map(Object.entries(e).map(([n,s])=>[n,this.iterator.resolveAccessor(s,`${this.path}.targets[${t}].${n}`)])))}},Yy=class extends He{get camera(){return this.data.camera===void 0?void 0:this.iterator.resolveCamera(this.data.camera,`${this.path}.camera`)}get children(){return bo(this.data.children||[],(e,t)=>this.iterator.resolveNode(e,`${this.path}.children[${t}]`))}get skin(){return this.data.skin===void 0?void 0:this.iterator.resolveSkin(this.data.skin,`${this.path}.skin`)}get mesh(){return this.data.mesh===void 0?void 0:this.iterator.resolveMesh(this.data.mesh,`${this.path}.mesh`)}get externalAsset(){return this.data.externalAsset===void 0?void 0:this.iterator.resolveExternalAsset(this.data.externalAsset,`${this.path}.externalAsset`)}},Qy=class extends He{},Zy=class extends He{get nodes(){return bo(this.data.nodes||[],(e,t)=>this.iterator.resolveNode(e,`${this.path}.nodes[${t}]`))}},ew=class extends He{get inverseBindMatrices(){return this.data.inverseBindMatrices===void 0?void 0:this.iterator.resolveAccessor(this.data.inverseBindMatrices,`${this.path}.inverseBindMatrices`)}get skeleton(){return this.data.skeleton===void 0?void 0:this.iterator.resolveNode(this.data.skeleton,`${this.path}.skeleton`)}get joints(){return bo(this.data.joints,(e,t)=>this.iterator.resolveNode(e,`${this.path}.joints[${t}]`))}},tw=class extends He{get sampler(){return this.data.sampler===void 0?void 0:this.iterator.resolveSampler(this.data.sampler,`${this.path}.sampler`)}get source(){return this.data.source===void 0?void 0:this.iterator.resolveImage(this.data.source,`${this.path}.source`)}},jr=class{gltf;objectCache=new WeakMap;referencesCache=new WeakMap;constructor(e){this.gltf=e}get data(){return this.gltf.json}getTypedArrayForBufferView(e){return pu(this.data,this.gltf.buffers,e)}getTypedArrayForAccessor(e){return Ea(this.data,this.gltf.buffers,e)}getTypedArrayForImageData(e){return UE(this.data,this.gltf.buffers,e)}getLoadedBuffer(e){let t=this.getMetadata(e);return this.gltf.buffers[t.index]}getLoadedBufferView(e){let t=this.getReferences(e).buffer,n=this.getLoadedBuffer(t);if(!n)return;let s=n.byteOffset+(e.byteOffset||0);return new Uint8Array(n.arrayBuffer,s,e.byteLength)}getLoadedImage(e){return this.gltf.images?.[this.getMetadata(e).index]}getLoadedFile(e){return this.gltf.files?.[this.getMetadata(e).index]}getLoadedExternalAsset(e){return this.gltf.externalAssets?.[this.getMetadata(e).index]}addBuffer(e){let t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return this.gltf.buffers.push({arrayBuffer:t,byteOffset:0,byteLength:e.byteLength}),this.data.buffers||=[],this.data.buffers.push({byteLength:e.byteLength}),this.data.buffers.length-1}addBufferView(e,t,n=0){return this.data.bufferViews||=[],this.data.bufferViews.push({buffer:e,byteOffset:n,byteLength:t}),this.data.bufferViews.length-1}addAccessor(e,t){return this.data.accessors||=[],this.data.accessors.push({bufferView:e,type:gd(t.size),componentType:t.componentType,count:t.count,min:t.min,max:t.max}),this.data.accessors.length-1}getReferences(e){let t=this.referencesCache.get(e);if(t)return t;let n=this.getObjectIterator(e),s=d8(n);return this.referencesCache.set(e,s),s}getMetadata(e){let t=this.getObjectIterator(e),n=t instanceof ni?t.parent.data:void 0;return{gltf:this.gltf,type:t.type,index:t.index,parent:n,path:t.path}}get scene(){return this.data.scene===void 0?void 0:this.resolveScene(this.data.scene,"scene").data}get thumbnail(){return this.data.asset.thumbnail===void 0?void 0:this.resolveImage(this.data.asset.thumbnail,"asset.thumbnail").data}get accessors(){return this.iterateCollectionData("accessor")}get animations(){return this.iterateCollectionData("animation")}get buffers(){return this.iterateCollectionData("buffer")}get bufferViews(){return this.iterateCollectionData("bufferView")}get cameras(){return this.iterateCollectionData("camera")}get externalAssets(){return this.iterateCollectionData("externalAsset")}get files(){return this.iterateCollectionData("file")}get images(){return this.iterateCollectionData("image")}get materials(){return this.iterateCollectionData("material")}get meshes(){return this.iterateCollectionData("mesh")}get nodes(){return this.iterateCollectionData("node")}get samplers(){return this.iterateCollectionData("sampler")}get scenes(){return this.iterateCollectionData("scene")}get skins(){return this.iterateCollectionData("skin")}get textures(){return this.iterateCollectionData("texture")}hasExtension(e){return!!this.data.extensionsUsed?.includes(e)||!!this.data.extensionsRequired?.includes(e)}isExtensionRequired(e){return!!this.data.extensionsRequired?.includes(e)}getExtension(e,t){let n=typeof e=="string"?this.data:e,s=typeof e=="string"?e:t;return n.extensions?.[s]}setExtension(e,t,n){let s=typeof e=="string",i=s?this.data:e,o=s?e:t,a=s?t:n,c=s?!!n:!1;i.extensions||={},i.extensions[o]=a,this.registerUsedExtension(o),c&&this.registerRequiredExtension(o)}registerUsedExtension(e){this.data.extensionsUsed||=[],this.data.extensionsUsed.includes(e)||this.data.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.data.extensionsRequired||=[],this.data.extensionsRequired.includes(e)||this.data.extensionsRequired.push(e)}removeExtension(e,t){let n=typeof e=="string",s=n?this.data:e,i=n?e:t;s.extensions?.[i]!==void 0&&(this.recordRemovedExtension(i),delete s.extensions[i]),n&&(eL(this.data.extensionsUsed,i),eL(this.data.extensionsRequired,i))}recordRemovedExtension(e){let t=this.data;t.extensionsRemoved||=[],t.extensionsRemoved.includes(e)||t.extensionsRemoved.push(e)}resolveAccessor(e,t){return this.resolveCollectionObject("accessor",e,t)}resolveBuffer(e,t){return this.resolveCollectionObject("buffer",e,t)}resolveBufferView(e,t){return this.resolveCollectionObject("bufferView",e,t)}resolveCamera(e,t){return this.resolveCollectionObject("camera",e,t)}resolveExternalAsset(e,t){return this.resolveCollectionObject("externalAsset",e,t)}resolveFile(e,t){return this.resolveCollectionObject("file",e,t)}resolveImage(e,t){return this.resolveCollectionObject("image",e,t)}resolveMaterial(e,t){return this.resolveCollectionObject("material",e,t)}resolveMesh(e,t){return this.resolveCollectionObject("mesh",e,t)}resolveNode(e,t){return this.resolveCollectionObject("node",e,t)}resolveSampler(e,t){return this.resolveCollectionObject("sampler",e,t)}resolveScene(e,t){return this.resolveCollectionObject("scene",e,t)}resolveSkin(e,t){return this.resolveCollectionObject("skin",e,t)}resolveTexture(e,t){return this.resolveCollectionObject("texture",e,t)}getOrCreateNested(e,t){return this.getOrCreate(e,t)}iterateCollection(e){let t=this.getCollection(e);return bo(t,(n,s)=>this.resolveCollectionObject(e,s,e))}iterateCollectionData(e){return(function*(n){for(let s of n.iterateCollection(e))yield s.data})(this)}getObjectIterator(e){let t=this.objectCache.get(e);if(!t)throw new Error("glTF object is not registered with this iterator");return t}resolveCollectionObject(e,t,n){let i=this.getCollection(e)[t];if(!i)throw new Error(`Invalid glTF reference at ${n}: ${e} index ${t} is out of range`);return this.getOrCreate(i,()=>this.createCollectionObject(e,t,i))}getCollection(e){switch(e){case"accessor":return this.data.accessors||[];case"animation":return this.data.animations||[];case"buffer":return this.data.buffers||[];case"bufferView":return this.data.bufferViews||[];case"camera":return this.data.cameras||[];case"externalAsset":return this.data.externalAssets||[];case"file":return this.data.files||[];case"image":return this.data.images||[];case"material":return this.data.materials||[];case"mesh":return this.data.meshes||[];case"node":return this.data.nodes||[];case"sampler":return this.data.samplers||[];case"scene":return this.data.scenes||[];case"skin":return this.data.skins||[];case"texture":return this.data.textures||[]}}createCollectionObject(e,t,n){let s=`${h8(e)}[${t}]`;switch(e){case"accessor":return new Cy(this,e,t,n,s);case"animation":return new Uy(this,e,t,n,s);case"buffer":return new jy(this,e,t,n,s);case"bufferView":return new Gy(this,e,t,n,s);case"camera":return new zy(this,e,t,n,s);case"externalAsset":return new Wy(this,e,t,n,s);case"file":return new $y(this,e,t,n,s);case"image":return new qy(this,e,t,n,s);case"material":return new Ky(this,e,t,n,s);case"mesh":return new Hy(this,e,t,n,s);case"node":return new Yy(this,e,t,n,s);case"sampler":return new Qy(this,e,t,n,s);case"scene":return new Zy(this,e,t,n,s);case"skin":return new ew(this,e,t,n,s);case"texture":return new tw(this,e,t,n,s)}}getOrCreate(e,t){let n=this.objectCache.get(e);if(n)return n;let s=t();return this.objectCache.set(e,s),s}};function d8(r){switch(r.type){case"accessor":return{get bufferView(){return r.bufferView?.data}};case"animation":return{get channels(){return mo(r.channels)},get samplers(){return mo(r.samplers)}};case"animationChannel":return{get sampler(){return r.sampler.data},get target(){return r.target.data}};case"animationChannelTarget":return{get node(){return r.node?.data}};case"animationSampler":return{get input(){return r.input.data},get output(){return r.output.data}};case"bufferView":return{get buffer(){return r.buffer.data}};case"externalAsset":return{get file(){return r.file.data}};case"file":case"image":return{get bufferView(){return r.bufferView?.data}};case"material":return{get baseColorTexture(){return r.baseColorTexture?.data},get metallicRoughnessTexture(){return r.metallicRoughnessTexture?.data},get normalTexture(){return r.normalTexture?.data},get occlusionTexture(){return r.occlusionTexture?.data},get emissiveTexture(){return r.emissiveTexture?.data},get textures(){return mo(r.textures)}};case"textureInfo":return{get texture(){return r.texture.data}};case"mesh":return{get primitives(){return mo(r.primitives)}};case"primitive":return{get attributes(){return ZE(r.attributes)},get indices(){return r.indices?.data},get material(){return r.material?.data},get targets(){return r.targets.map(ZE)}};case"node":return{get camera(){return r.camera?.data},get children(){return mo(r.children)},get skin(){return r.skin?.data},get mesh(){return r.mesh?.data},get externalAsset(){return r.externalAsset?.data}};case"scene":return{get nodes(){return mo(r.nodes)}};case"skin":return{get inverseBindMatrices(){return r.inverseBindMatrices?.data},get skeleton(){return r.skeleton?.data},get joints(){return mo(r.joints)}};case"texture":return{get sampler(){return r.sampler?.data},get source(){return r.source?.data}};default:return{}}}function bo(r,e){return(function*(){for(let n=0;n<r.length;n++)yield e(r[n],n)})()}function mo(r){return(function*(){for(let t of r)yield t.data})()}function ZE(r){return new Map(Array.from(r,([e,t])=>[e,t.data]))}function h8(r){switch(r){case"bufferView":return"bufferViews";case"externalAsset":return"externalAssets";case"mesh":return"meshes";default:return`${r}s`}}function eL(r,e){if(r)for(let t=r.length-1;t>=0;t--)r[t]===e&&r.splice(t,1)}jn();ke();function tL(r){return(r%1+1)%1}var rL={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},p8={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},nL={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8};function rw(r,e){return nL[e]*rL[r]}function nw(r,e,t,n){if(t!=="UINT8"&&t!=="UINT16"&&t!=="UINT32"&&t!=="UINT64")return null;let s=r.getTypedArrayForBufferView(e),i=Td(s,"SCALAR",t,n+1);if(i instanceof BigInt64Array||i instanceof BigUint64Array){let o=new Float64Array(i.length),a=BigInt(Number.MAX_SAFE_INTEGER);for(let c=0;c<i.length;c++){let u=i[c];if(u<0n||u>a)throw new Error("EXT_structural_metadata: UINT64 offset exceeds the safe integer range");o[c]=Number(u)}return o}return i}function Td(r,e,t,n=1){let s=rL[e],i=p8[t],o=nL[t],a=n*s,c=a*o,u=r.buffer,f=r.byteOffset;return f%o!==0&&(u=new Uint8Array(u).slice(f,f+c).buffer,f=0),new i(Qi(u),f,a)}function _d(r,e,t){let n=`TEXCOORD_${e.texCoord||0}`,s=t.attributes[n],i=r.getTypedArrayForAccessor(s),o=r.gltf.json,a=e.index,c=o.textures?.[a]?.source;if(typeof c<"u"){let u=o.images?.[c]?.mimeType,f=r.gltf.images?.[c];if(f&&typeof f.width<"u"&&!("compressed"in f&&f.compressed)){let l=[];for(let d=0;d<i.length;d+=2){let h=m8(f,u,i,d,e.channels);l.push(h)}return l}}return[]}function sL(r,e,t,n,s){if(!t?.length)return;let i=[];for(let l of t){let d=n.findIndex(h=>h===l);d===-1&&(d=n.push(l)-1),i.push(d)}let o=new Uint32Array(i),a=r instanceof jr?r:new jr(r.gltf),c=a.addBuffer(o),u=a.addBufferView(c,o.byteLength),f=a.addAccessor(u,{size:1,componentType:po(o),count:o.length});s.attributes[e]=f}function m8(r,e,t,n,s=[0]){let i={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},o=t[n],a=t[n+1],c=1;e&&(e.indexOf("image/jpeg")!==-1||e.indexOf("image/png")!==-1)&&(c=4);let u=b8(o,a,r,c),f=0;for(let l of s){let d=typeof l=="number"?Object.values(i)[l]:i[l],h=u+d.offset,m=$c(r);if(m.data.length<=h)throw new Error(`${m.data.length} <= ${h}`);let b=m.data[h];f|=b<<d.shift}return f}function b8(r,e,t,n=1){let s=t.width,i=tL(r)*(s-1),o=Math.round(i),a=t.height,c=tL(e)*(a-1),u=Math.round(c),f=t.components?t.components:n;return(u*s+o)*f}function sw(r,e,t,n=1){let s=[];for(let i=0;i<e;i++){let o=Number(t[i]),a=Number(t[i+1])-o;if(!Number.isInteger(o)||!Number.isInteger(a)||o<0||a<0||(o+a)*n>r.length)break;let c=o*n,u=a*n;s.push(r.slice(c,c+u))}return s}function iw(r,e,t,n=1){let s=[],i=t*n;for(let o=0;o<e;o++){let a=o*i;s.push(r.slice(a,a+i))}return s}function iL(r,e,t,n,s){let i=new TextDecoder("utf8");if(t){if(!n)throw new Error("stringOffsets is required for variable-length string arrays");let o=[];for(let a=0;a<r;a++){let c=t[a],u=t[a+1],f=[];for(let l=c;l<u;l++){let d=n[l],h=n[l+1],m=e.subarray(d,h);f.push(i.decode(m))}o.push(f)}return o}if(n){let o=[],a=r*(s||1);for(let c=0;c<a;c++){let u=Number(n[c]),f=Number(n[c+1]);u>=0&&f>=u&&f<=e.length&&o.push(i.decode(e.subarray(u,f)))}return s?Array.from({length:r},(c,u)=>o.slice(u*s,(u+1)*s)):o}return[]}var Ba="EXT_mesh_features",g8=Ba;async function y8(r,e){let t=new jr(r);x8(t,e)}function w8(r,e){let t=new ri(r);return _8(t,e),t.createBinaryChunk(),t.gltf}function x8(r,e){for(let t of r.meshes)for(let n of r.getReferences(t).primitives)T8(r,n,e)}function T8(r,e,t){let s=r.getExtension(e,Ba)?.featureIds||[];if(s)for(let i of s){let o;if(typeof i.attribute<"u"){if(!t?.gltf?.loadBuffers)continue;let a=`_FEATURE_ID_${i.attribute}`,c=e.attributes[a];o=r.getTypedArrayForAccessor(c)}else if(typeof i.texture<"u"){if(!t?.gltf?.loadImages)continue;o=_d(r,i.texture,e)}else{let a=e.attributes.POSITION,c=typeof a=="number"?r.data.accessors?.[a]?.count:a?.count;if(typeof c!="number"||!Number.isInteger(c)||c<0)throw new Error("EXT_mesh_features: implicit feature IDs require a POSITION accessor");if(i.featureCount!==c)throw new Error(`EXT_mesh_features: implicit featureCount ${i.featureCount} does not match vertex count ${c}`);delete i.data,Object.defineProperty(i,"implicit",{configurable:!0,enumerable:!1,writable:!0,value:{start:0,count:c}})}o&&(i.data=o,delete i.implicit)}}function _8(r,e){let t=r.gltf.json.meshes;if(t)for(let n of t)for(let s of n.primitives)v8(r,s)}function A8(r,e,t,n){e.extensions||(e.extensions={});let s=e.extensions[Ba];s||(s={featureIds:[]},e.extensions[Ba]=s);let{featureIds:i}=s,o={featureCount:t.length,propertyTable:n,data:t};i.push(o),r.addObjectExtension(e,Ba,s)}function v8(r,e){let t=e.extensions?.[Ba];if(!t)return;let n=t.featureIds;n.forEach((s,i)=>{if(s.data){let{accessorKey:o,index:a}=I8(e.attributes),c=new Uint32Array(s.data);n[i]={featureCount:c.length,propertyTable:s.propertyTable,attribute:a};let u=r.addBufferView(c),f=r.addAccessor(u,{size:1,componentType:po(c),count:c.length});e.attributes[o]=f}})}function I8(r){let e="_FEATURE_ID_",t=Object.keys(r).filter(i=>i.indexOf(e)===0),n=-1;for(let i of t){let o=Number(i.substring(e.length));o>n&&(n=o)}return n++,{accessorKey:`${e}${n}`,index:n}}var fw={};J(fw,{createExtStructuralMetadata:()=>Y8,decode:()=>L8,encode:()=>B8,name:()=>E8});function aL(r,e,t){if(r.startsWith("data:")||r.startsWith("http:")||r.startsWith("https:"))return oL(r);let s=t?.baseUrl||S8(e?.core?.baseUrl);if(!s)throw new Error(`'baseUrl' must be provided to resolve relative url ${r}`);let i=s.endsWith("/")?`${s}${r}`:`${s}/${r}`;return oL(i)}function oL(r){try{return new URL(r).href}catch{return r}}function S8(r){if(!r)return;if(r.endsWith("/"))return r;let e=r.lastIndexOf("/");return e>=0?r.slice(0,e+1):""}var go="EXT_structural_metadata",E8=go;async function L8(r,e,t){let n=new jr(r),s=n.getExtension(go);if(e.gltf?.loadBuffers&&s?.schemaUri&&!s.schema){if(!t?.fetch)throw new Error("EXT_structural_metadata: a loader context is required to load schemaUri");let i=aL(s.schemaUri,e,t),o=await t.fetch(i);if(!o.ok)throw new Error(`EXT_structural_metadata: failed to load schemaUri ${i} (${o.status})`);s.schema=await o.json()}F8(n,e)}function B8(r,e){let t=new ri(r);return H8(t,e),t.createBinaryChunk(),t.gltf}function F8(r,e){if(!e.gltf?.loadBuffers)return;let t=r.getExtension(go);t&&(e.gltf?.loadImages&&O8(r,t),M8(r,t))}function O8(r,e){let t=e.propertyTextures,n=r.data;if(t&&n.meshes)for(let s of n.meshes)for(let i of s.primitives)R8(r,t,i,e)}function M8(r,e){let t=e.schema;if(!t)return;let n=t.classes,s=e.propertyTables;if(n&&s)for(let i of s)i.class&&n[i.class]&&N8(r,t,i)}function R8(r,e,t,n){if(!e)return;let i=t.extensions?.[go]?.propertyTextures;if(i)for(let o of i){let a=e[o];D8(r,a,t,n)}}function D8(r,e,t,n){if(!e.properties)return;n.dataAttributeNames||(n.dataAttributeNames=[]);let s=e.class;for(let i in e.properties){let o=`${s}_${i}`,a=e.properties?.[i];if(!a)continue;a.data||(a.data=[]);let c=a.data,u=_d(r,a,t);u!==null&&(sL(r,o,u,c,t),a.data=c,n.dataAttributeNames.push(o))}}function N8(r,e,t){let n=e.classes?.[t.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${t.class}`);let s=t.count;for(let i in n.properties){let o=n.properties[i],a=t.properties?.[i];if(a){let c={},u=k8(r,e,o,s,a,c);a.data=u,c.value!==void 0&&Object.defineProperty(a,"rawData",{value:c.value,configurable:!0,enumerable:!1,writable:!0})}}}function k8(r,e,t,n,s,i){let o=[],a=s.values,c=r.getTypedArrayForBufferView(a),u=U8(r,t,s,n),f=V8(r,t,s,n,u);switch(t.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{let l=P8(t,s,n,c,u);o=l.data,i&&(i.value=l.rawData);break}case"BOOLEAN":{o=C8(t,n,c,u);break}case"STRING":{o=iL(n,c,u,f,t.array?t.count:void 0);break}case"ENUM":{o=W8(e,t,n,c,u);break}default:throw new Error(`Unknown classProperty type ${t.type}`)}return o}function C8(r,e,t,n){return r.array?n?Array.from({length:e},(s,i)=>{let o=Number(n[i]),a=Number(n[i+1]);if(!Number.isInteger(o)||!Number.isInteger(a)||o<0||a<o)throw new Error("EXT_structural_metadata: invalid BOOLEAN array offsets");return aw(t,o,a-o)}):r.count===void 0?[]:Array.from({length:e},(s,i)=>aw(t,i*r.count,r.count)):aw(t,0,e)}function aw(r,e,t){if(e+t>r.byteLength*8)throw new Error("EXT_structural_metadata: BOOLEAN values exceed their buffer view");return Array.from({length:t},(n,s)=>{let i=e+s;return!!(r[Math.floor(i/8)]&1<<i%8)})}function U8(r,e,t,n){return e.array&&typeof e.count>"u"&&typeof t.arrayOffsets<"u"?nw(r,t.arrayOffsets,t.arrayOffsetType||"UINT32",n):null}function V8(r,e,t,n,s){if(typeof t.stringOffsets<"u"){let i=s?Number(s[n]):n*(e.array&&e.count||1);return nw(r,t.stringOffsets,t.stringOffsetType||"UINT32",i)}return null}function P8(r,e,t,n,s){let i=r.array,o=r.count,a={VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16}[r.type]||1,c=rw(r.type,r.componentType),u=n.byteLength/c,f;r.componentType?f=Td(n,r.type,r.componentType,u):f=n;let l=f,d=e.offset??r.offset,h=e.scale??r.scale,m=r.normalized||d!==void 0||h!==void 0?j8(l,r.componentType,r.type,r.normalized,d,h):l;return i?s?{data:sw(m,t,s,a),rawData:sw(l,t,s,a)}:o?{data:iw(m,t,o,a),rawData:iw(l,t,o,a)}:{data:[],rawData:[]}:{data:m,rawData:l}}function j8(r,e,t,n,s,i){let o=z8(e),a=!!(n&&o!==void 0);if(!a&&s===void 0&&i===void 0)return r;let c=G8(t),u=new Float64Array(r.length);for(let f=0;f<r.length;f++){let l=Number(r[f]);a&&(l=e?.startsWith("INT")?Math.max(l/o,-1):l/o);let d=f%c,h=Array.isArray(s)?s[d]??0:s??0,m=Array.isArray(i)?i[d]??1:i??1;u[f]=l*m+h}return u}function G8(r){switch(r){case"VEC2":return 2;case"VEC3":return 3;case"VEC4":return 4;case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16;default:return 1}}function z8(r){switch(r){case"INT8":return 127;case"UINT8":return 255;case"INT16":return 32767;case"UINT16":return 65535;case"INT32":return 2147483647;case"UINT32":return 4294967295;case"INT64":return 2**63-1;case"UINT64":return 2**64-1;default:return}}function W8(r,e,t,n,s){let i=e.enumType;if(!i)throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");let o=r.enums?.[i];if(!o)throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${i}`);let a=o.valueType||"UINT16",c=rw(e.type,a),u=n.byteLength/c,f=Td(n,e.type,a,u);if(f||(f=n),e.array){if(s)return $8({valuesData:f,numberOfElements:t,arrayOffsets:s,enumEntry:o});let l=e.count;return l?q8(f,t,l,o):[]}return uw(f,0,t,o)}function $8(r){let{valuesData:e,numberOfElements:t,arrayOffsets:n,enumEntry:s}=r,i=[];for(let o=0;o<t;o++){let a=Number(n[o]),c=Number(n[o+1])-a;if(!Number.isInteger(a)||!Number.isInteger(c)||a<0||c<0||a+c>e.length)break;let u=uw(e,a,c,s);i.push(u)}return i}function q8(r,e,t,n){let s=[];for(let i=0;i<e;i++){let o=t*i,a=uw(r,o,t,n);s.push(a)}return s}function uw(r,e,t,n){let s=[];for(let i=0;i<t;i++){let o=r[e+i],a=K8(n,o);a?s.push(a.name):s.push("")}return s}function K8(r,e){for(let t of r.values)if(typeof e=="bigint"?Number.isSafeInteger(t.value)&&BigInt(t.value)===e:t.value===e)return t;return null}var X8="schemaClassId";function H8(r,e){let t=r.getExtension(go);if(t&&t.propertyTables)for(let n of t.propertyTables){let s=n.class,i=t.schema?.classes?.[s];n.properties&&i&&J8(n,i,r)}}function J8(r,e,t){for(let n in r.properties){let s=r.properties[n].data;if(s){let i=e.properties[n];if(i){let o=e3(s,i,t);r.properties[n]=o}}}}function Y8(r,e,t=X8){let n=r.getExtension(go);n||(n=r.addExtension(go)),n.schema=Q8(e,t,n.schema);let s=Z8(e,t,n.schema);return n.propertyTables||(n.propertyTables=[]),n.propertyTables.push(s)-1}function Q8(r,e,t){let n=t??{id:"schema_id"},s={properties:{}};for(let i of r){let o={type:i.elementType,componentType:i.componentType};s.properties[i.name]=o}return n.classes={},n.classes[e]=s,n}function Z8(r,e,t){let n={class:e,count:0},s=0,i=t.classes?.[e];for(let o of r){if(s===0&&(s=o.values.length),s!==o.values.length&&o.values.length)throw new Error("Illegal values in attributes");i?.properties[o.name]&&(n.properties||(n.properties={}),n.properties[o.name]={values:0,data:o.values})}return n.count=s,n}function e3(r,e,t){let n={values:0};if(e.type==="STRING"){let{stringData:s,stringOffsets:i}=n3(r);n.stringOffsets=cw(i,t),n.values=cw(s,t)}else if(e.type==="SCALAR"&&e.componentType){let s=r3(r,e.componentType);n.values=cw(s,t)}return n}var t3={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:Int32Array,UINT64:Uint32Array,FLOAT32:Float32Array,FLOAT64:Float64Array};function r3(r,e){let t=[];for(let s of r)t.push(Number(s));let n=t3[e];if(!n)throw new Error("Illegal component type");return new n(t)}function n3(r){let e=new TextEncoder,t=[],n=0;for(let c of r){let u=e.encode(c);n+=u.length,t.push(u)}let s=new Uint8Array(n),i=[],o=0;for(let c of t)s.set(c,o),i.push(o),o+=c.length;i.push(o);let a=new Uint32Array(i);return{stringData:s,stringOffsets:a}}function cw(r,e){return e.addBufferView(r)}var lw={};J(lw,{decode:()=>i3,encode:()=>o3,name:()=>s3});var Fa="KHR_materials_unlit",s3=Fa;async function i3(r){let e=new jr(r);for(let t of e.materials)e.getExtension(t,Fa)&&(t.unlit=!0),e.removeExtension(t,Fa);e.removeExtension(Fa)}function o3(r){let e=new ri(r);for(let t of r.json.materials||[]){let n=t;n.unlit&&(delete n.unlit,e.addObjectExtension(t,Fa,{}),e.registerRequiredExtension(Fa))}for(let t of["extensionsUsed","extensionsRequired"])r.json[t]?.length===0&&delete r.json[t]}var a3=[lw,fw,ow];function cL(r,e={}){for(let t of a3)r=t.encode?.(r,e)??r;return r}var fL={dataType:null,batchType:null,...Ia,version:ti,options:{gltf:{}},encode:async(r,e={})=>{let t=await QE(r,e),n={...e};return n.gltf=e.gltf?{...e.gltf,draco:void 0}:void 0,uL(t,n)},encodeSync:uL};function uL(r,e={}){if(e.gltf?.draco?.enabled)throw new Error("GLTFWriter Draco compression is asynchronous; use encode() instead of encodeSync()");let{byteOffset:t=0}=e,n=cL(r);r.buffers=n.buffers,r.binary=n.binary;let s=Fy(n,null,t,e),i=new ArrayBuffer(s),o=new DataView(i);return Fy(n,o,t,e),i}async function c3(){let{GLBLoaderWithParser:r}=await Promise.resolve().then(()=>(yy(),gy));return r}var lL={dataType:null,batchType:null,...Sa,version:ti,preload:c3,options:{glb:{strict:!1}}};var hL={...Sa,version:ti,options:{glb:{}},encode:async(r,e={})=>dL(r,e),encodeSync:dL};function dL(r,e){let{byteOffset:t=0}=e??{},n=e?.glb??{},s=hu(r,null,t,n),i=new ArrayBuffer(s),o=new DataView(i);return hu(r,o,t,n),i}Jo();var pL=typeof __VERSION__<"u"?__VERSION__:"latest";var Ad={name:"Draco",id:"draco",module:"scene",encoding:"binary",format:"draco",extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"]};var mL={backend:typeof WebAssembly=="object"?"wasm":"javascript",extraAttributes:{},attributeNameEntry:void 0,shape:"arrow-table",decoderProfile:"full"};async function u3(r,e){let t=e;switch(f3(t)){case"wasm":{let{DracoWASMLoaderWithParser:n}=await Promise.resolve().then(()=>($g(),Wg));return n}case"javascript":{let{DracoJavaScriptLoaderWithParser:n}=await Promise.resolve().then(()=>(Kg(),qg));return n}case"draco3d":{let{Draco3DLoaderWithParser:n}=await Promise.resolve().then(()=>(Hg(),Xg));return n}default:throw new Error(`DracoLoader: unsupported backend "${t?.draco?.backend}"`)}}var vd={dataType:null,batchType:null,...Ad,version:pL,worker:!0,workerSourceNode:"draco/workers/draco-worker-node.ts",serializeWorkerResult:el,deserializeWorkerResult:tl,options:{draco:mL},preload:u3},bL=vd;function f3(r){return r?.draco?.backend?r.draco.backend==="js"?"javascript":r.draco.backend:vd.options.draco.backend}var l3="1.5.7",d3="8786740086a9f4d83f44aa83badfbea4dce7a1b5",bu=`https://www.gstatic.com/draco/versioned/decoders/${l3}`,gL=`https://cdn.jsdelivr.net/gh/google/draco@${d3}/javascript`,bt={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",GLTF_DECODER:"draco_wasm_wrapper_gltf.js",GLTF_DECODER_WASM:"draco_decoder_gltf.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js",ENCODER_WASM:"draco_encoder.wasm"},yL={[bt.DECODER]:`${bu}/${bt.DECODER}`,[bt.DECODER_WASM]:`${bu}/${bt.DECODER_WASM}`,[bt.GLTF_DECODER]:`${bu}/${bt.GLTF_DECODER}`,[bt.GLTF_DECODER_WASM]:`${bu}/${bt.GLTF_DECODER_WASM}`,[bt.FALLBACK_DECODER]:`${bu}/${bt.FALLBACK_DECODER}`,[bt.ENCODER]:`${gL}/${bt.ENCODER}`,[bt.ENCODER_WASM]:`${gL}/${bt.ENCODER_WASM}`};async function h3(){let{MaterialXLoaderWithParser:r}=await Promise.resolve().then(()=>(vy(),Ay));return r}var wL={name:"MaterialX",id:"materialx",module:"scene",version:"latest",extensions:["mtlx"],mimeTypes:["application/xml"],text:!0,dataType:null,batchType:null,options:{},preload:h3};return EL(p3);})();
|
|
55
|
+
`}function N3(r){return"shape"in r&&r.shape==="arrow-table"?r:ei(r,"arrow-table")}function C3(r,e){let t=r.attributes[e];if(!t)throw new Error(`OBJWriter: ${e} attribute is required`);return t}function Jn(r,e,t){return r.value[e*r.size+t]||0}function ew(r,e,t){let n=Jn(r,e,t);return r.normalized||n>1?n/255:n}function U3(r,e){if(r.indices?.value?.length)return Array.from(r.indices.value);if(r.mode!==4&&r.topology!=="triangle-list")return[];let t=[];for(let n=0;n+2<e;n+=3)t.push(n,n+1,n+2);return t}function tw(r,e,t){let n=r+1;return e&&t?`${n}/${n}/${n}`:e?`${n}/${n}`:t?`${n}//${n}`:String(n)}var ii=typeof __VERSION__<"u"?__VERSION__:"latest";var Ba={name:"glTF",id:"gltf",module:"scene",encoding:"binary",format:"gltf",extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"]},Fa={name:"GLB",id:"glb",module:"scene",encoding:"binary",format:"glb",extensions:["glb"],mimeTypes:["model/gltf-binary"],binary:!0,tests:["glTF"]};async function P3(){let{GLTFLoaderWithParser:r}=await Promise.resolve().then(()=>(Vy(),Py));return r}var IL={dataType:null,batchType:null,...Ba,version:ii,preload:P3,options:{gltf:{normalize:!0,loadBuffers:!0,loadFiles:!1,loadExternalAssets:!1,loadImages:!0,loadAudio:!0,decompressMeshes:!0}}};Ue();var V3=1179937895,SL=1313821514,rw=5130562,Dt=!0;function wu(r,e,t=0,n={}){let s=V3,i=n.version??("version"in r?r.version:2),o=r.json??{};if(i===3)return j3(r,e,t,s,o);if(i!==2)throw new Error(`Unsupported GLB writer version ${i}.`);let a="binChunks"in r?r.binary?new Uint8Array(r.binary):r.binChunks?.[0]&&Od(r.binChunks[0]):r.buffers?.[0]&&Od(r.buffers[0]),c=t;e&&(e.setUint32(t+0,s,Dt),e.setUint32(t+4,i,Dt),e.setUint32(t+8,0,Dt));let u=t+8;t+=12;let l=t;e&&(e.setUint32(t+0,0,Dt),e.setUint32(t+4,SL,Dt)),t+=8;let f=JSON.stringify(o);if(t=xf(e,t,f,4),e){let d=t-l-8;e.setUint32(l+0,d,Dt)}if(a){let d=t;if(e&&(e.setUint32(t+0,0,Dt),e.setUint32(t+4,rw,Dt)),t+=8,t=Uc(e,t,a,4),e){let h=t-d-8;e.setUint32(d+0,h,Dt)}}if(e){let d=t-c;e.setUint32(u,d,Dt)}return t}function j3(r,e,t,n,s){let i=t,o=[{type:SL,arrayBuffer:G3(s)},...("chunks"in r?r.chunks:[])??[],..."binChunks"in r?(r.binChunks??[]).map(a=>({type:rw,arrayBuffer:Od(a).slice().buffer})):(r.buffers??[]).map(a=>({type:rw,arrayBuffer:Od(a).slice().buffer}))];e&&(e.setUint32(t,n,Dt),e.setUint32(t+4,3,Dt),Fd(e,t+8,0,"GLB file length")),t+=16;for(let a of o){let c=a.encoding??0;if(c!==0)throw new Error(`Unsupported GLB chunk encoding ${c}.`);let u=t;e&&(e.setUint32(t,a.type,Dt),e.setUint32(t+4,c,Dt),Fd(e,t+8,0,"GLB chunk length")),t+=16,t=Uc(e,t,new Uint8Array(a.arrayBuffer),4),e&&Fd(e,u+8,t-u-16,"GLB chunk length")}return e&&Fd(e,i+8,t-i,"GLB file length"),t}function Od(r){return new Uint8Array(r.arrayBuffer,r.byteOffset,r.byteLength)}function G3(r){let e=JSON.stringify(r),t=new TextEncoder().encode(e).byteLength,n=Math.ceil(t/4)*4,s=new ArrayBuffer(n),i=new DataView(s);return xf(i,0,e,4),s}function Fd(r,e,t,n){if(!Number.isSafeInteger(t)||t<0)throw new Error(`${n} is outside the safe integer range.`);r.setBigUint64(e,BigInt(t),Dt)}function nw(r,e,t,n){return z3(r),wu(r,e,t,n)}function z3(r){if(r.buffers&&r.buffers.length>1)throw new Error("encodeGLTF: multiple buffers not yet implemented")}function ve(r,e){if(!r)throw new Error(e||"assert failed: gltf")}Ue();var EL={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},LL={5120:1,5121:1,5122:2,5123:2,5124:4,5125:4,5126:4,5130:8,5131:2,5134:8,5135:8};var BL=["SCALAR","VEC2","VEC3","VEC4"],W3=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Int32Array,5124],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130],[BigInt64Array,5134],[BigUint64Array,5135]],$3=new Map(W3),q3={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},K3={5120:1,5121:1,5122:2,5123:2,5124:4,5125:4,5126:4,5130:8,5131:2,5134:8,5135:8},X3={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5124:Int32Array,5125:Uint32Array,5126:Float32Array,5130:Float64Array,5131:Uint16Array,5134:BigInt64Array,5135:BigUint64Array};function Md(r){return BL[r-1]||BL[0]}function wo(r){let e=$3.get(r.constructor);if(!e)throw new Error("Illegal typed array");return e}function sw(r,e){let t=X3[r.componentType],n=q3[r.type],s=K3[r.componentType],i=r.count*n,o=r.count*n*s;ve(o>=0&&o<=e.byteLength);let a=LL[r.componentType],c=EL[r.type];return{ArrayType:t,length:i,byteLength:o,componentByteSize:a,numberOfComponentsInElement:c}}function xu(r,e,t){let n=typeof t=="number"?r.bufferViews[t]:t;ve(n);let s=n.buffer,i=e[s];ve(i),ve((n.byteOffset||0)>=0&&n.byteLength>=0),ve((n.byteOffset||0)+n.byteLength<=i.byteLength),ve(i.byteOffset>=0&&i.byteOffset+i.byteLength<=i.arrayBuffer.byteLength);let o=(n.byteOffset||0)+i.byteOffset;return new Uint8Array(i.arrayBuffer,o,n.byteLength)}function FL(r,e,t){let n=r.images[t];return xu(r,e,n.bufferView)}function Oa(r,e,t){let n=typeof t=="number"?r.accessors?.[t]:t;if(!n)throw new Error(`No gltf accessor ${JSON.stringify(t)}`);ve(Number.isSafeInteger(n.count)&&n.count>=0);let{ArrayType:s,length:i,numberOfComponentsInElement:o}=sw(n,{byteLength:1/0}),a=n.value,c;ArrayBuffer.isView(a)?(ve(a.length===i),c=a):n.bufferView===void 0?c=new s(i):c=iw(r,e,n);let u=n.sparse;if(!u)return c;let l=new s(i);new Uint8Array(l.buffer).set(new Uint8Array(c.buffer,c.byteOffset,c.byteLength)),ve(u.count>=0&&u.count<=n.count),ve([5121,5123,5125].includes(u.indices.componentType));let f=iw(r,e,{bufferView:u.indices.bufferView,byteOffset:u.indices.byteOffset,componentType:u.indices.componentType,count:u.count,type:"SCALAR"}),d=iw(r,e,{bufferView:u.values.bufferView,byteOffset:u.values.byteOffset,componentType:n.componentType,count:u.count,type:n.type}),h=-1,m=new Uint8Array(l.buffer),b=o*s.BYTES_PER_ELEMENT,g=new Uint8Array(d.buffer,d.byteOffset,d.byteLength);for(let y=0;y<u.count;y++){let x=Number(f[y]);ve(x>h&&x<n.count),m.set(g.subarray(y*b,(y+1)*b),x*b),h=x}return l}function iw(r,e,t){let n=r.bufferViews?.[t.bufferView];if(!n)throw new Error(`No gltf buffer view for accessor ${n}`);let s=e[n.buffer];ve(s);let{arrayBuffer:i,byteOffset:o}=s;ve((n.byteOffset||0)>=0&&n.byteLength>=0),ve((n.byteOffset||0)+n.byteLength<=s.byteLength),ve(o>=0&&o+s.byteLength<=i.byteLength),ve((t.byteOffset||0)>=0);let a=(o||0)+(t.byteOffset||0)+(n.byteOffset||0),{ArrayType:c,length:u,componentByteSize:l,numberOfComponentsInElement:f}=sw(t,n),d=l*f,h=t.type.startsWith("MAT")?Number(t.type.slice(3)):1,m=_e(h*l,4),b=h>1?h*m:d,g=n.byteStride??b,y=h>1?(h-1)*m+h*l:d;if(ve(g>=b),ve((t.byteOffset||0)+(t.count===0?0:(t.count-1)*g+y)<=n.byteLength),t.count===0)return new c(0);if(h>1&&m!==h*l){let _=n.byteStride??h*m,v=(h-1)*m+h*l;ve((t.byteOffset||0)+(t.count-1)*_+v<=n.byteLength);let I=new c(u),N=new Uint8Array(I.buffer,I.byteOffset,I.byteLength);for(let K=0;K<t.count;K++)for(let ne=0;ne<h;ne++){let be=new Uint8Array(i,a+K*_+ne*m,h*l);N.set(be,K*d+ne*h*l)}return I}let x=n.byteStride||d;if(typeof n.byteStride>"u"||n.byteStride===d){if(a%l!==0){let v=new Uint8Array(i,a,u*l),I=new Uint8Array(v.byteLength);return I.set(v),new c(I.buffer,0,u)}return new c(i,a,u)}let T=new c(u);for(let _=0;_<t.count;_++){let v=a+_*x,I;if(v%l!==0){let N=new Uint8Array(i,v,d),K=new Uint8Array(d);K.set(N),I=new c(K.buffer,0,f)}else I=new c(i,v,f);T.set(I,_*f)}return T}var cw="KHR_draco_mesh_compression";async function WL(r,e={}){let t=e.gltf?.draco;if(!t?.enabled)return r;if((r.buffers?.length||0)>1)throw new Error("GLTF Draco writer requires a single buffer");let n=u8(r.json),s=l8(r.buffers||[]),i={...r,json:n,buffers:s},o=[];for(let d of n.meshes||[])for(let h of d.primitives||[]){let m=h.mode??4;if(m!==4){if(t.skipUnsupportedPrimitives??!0)continue;throw new Error(`GLTF Draco writer cannot compress primitive mode ${m}; only TRIANGLES (4) is supported`)}if(h.extensions?.[cw])throw new Error("GLTF Draco writer refuses to replace an existing Draco extension");let b=c8(r,h),{encodeDraco:g}=await Promise.resolve().then(()=>(GL(),jL)),y=await g(b,{core:e.core,modules:e.modules,draco:t});o.push({primitive:h,result:y})}if(o.length===0)return i;let a=f8(s),c=a.byteLength;for(let{result:d}of o)c=uw(c)+d.data.byteLength;let u=new Uint8Array(c);u.set(a),n.bufferViews=n.bufferViews||[],n.buffers=n.buffers||[{byteLength:0}];let l=uw(a.byteLength);for(let{primitive:d,result:h}of o){new Uint8Array(u.buffer,l,h.data.byteLength).set(new Uint8Array(h.data));let m=n.bufferViews.length;n.bufferViews.push({buffer:0,byteOffset:l,byteLength:h.data.byteLength}),d.extensions={...d.extensions||{},[cw]:{bufferView:m,attributes:Object.fromEntries(Object.entries(h.report.attributes).map(([b,g])=>[b,g.id]))}},l=uw(l+h.data.byteLength)}let f=u;return i.buffers[0]={...i.buffers[0]||{byteOffset:0},arrayBuffer:f.buffer,byteOffset:0,byteLength:f.byteLength},n.buffers[0]={...n.buffers[0]||{},byteLength:f.byteLength},n.extensionsUsed=d8(n.extensionsUsed,cw),i}function c8(r,e){if(!e.attributes||e.attributes.POSITION===void 0)throw new Error("GLTF Draco writer requires a POSITION attribute");let t={};for(let[s,i]of Object.entries(e.attributes)){let o=r.json.accessors?.[i];if(!o)throw new Error(`GLTF Draco writer could not resolve accessor ${i}`);if(o.sparse)throw new Error(`GLTF Draco writer does not support sparse accessor ${i}`);let a=zL(r,i,o.componentType);t[s]={value:a,size:h8(o.type),...o.normalized===void 0?{}:{normalized:o.normalized}}}let n;if(e.indices!==void 0){let s=r.json.accessors?.[e.indices];if(!s)throw new Error(`GLTF Draco writer could not resolve index accessor ${e.indices}`);if(s.sparse)throw new Error(`GLTF Draco writer does not support sparse accessor ${e.indices}`);n=zL(r,e.indices,s.componentType)}else{let s=r.json.accessors?.[e.attributes.POSITION];if(!s||s.count%3!==0)throw new Error("GLTF Draco writer requires triangle-aligned POSITION data without indices");n=new Uint32Array(s.count);for(let i=0;i<n.length;i++)n[i]=i}return{attributes:t,indices:n}}function zL(r,e,t){let n=Oa(r.json,r.buffers,e);if(n instanceof BigInt64Array||n instanceof BigUint64Array||n instanceof Float64Array)throw new Error(`GLTF Draco writer does not support 64-bit accessor ${e} (componentType ${t}); the official 1.5.7 encoder binding has no 64-bit attribute API`);return n}function u8(r){return JSON.parse(JSON.stringify(r))}function l8(r){return r.map(e=>({...e,arrayBuffer:e.arrayBuffer.slice(0)}))}function f8(r){let e=r[0]||{arrayBuffer:new ArrayBuffer(0),byteOffset:0,byteLength:0};return new Uint8Array(e.arrayBuffer,e.byteOffset||0,e.byteLength)}function uw(r){return Math.ceil(r/4)*4}function d8(r,e){return r?.includes(e)?r:[...r||[],e]}function h8(r){switch(r){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":return 4;case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16;default:throw new Error(`GLTF Draco writer does not recognize accessor type ${r}`)}}var Dw={};J(Dw,{createExtMeshFeatures:()=>S8,decode:()=>T8,encode:()=>_8,name:()=>x8});qn();Ue();function p8(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}var oi=class{gltf;sourceBuffers;byteLength;constructor(e){this.gltf={json:e?.json||p8(),buffers:e?.buffers||[],images:e?.images||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=_e(this.gltf.buffers[0].byteLength,4),this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}hasExtension(e){let t=this.getUsedExtensions().find(s=>s===e),n=this.getRequiredExtensions().find(s=>s===e);return typeof t=="string"||typeof n=="string"}getExtension(e){let t=this.getUsedExtensions().find(s=>s===e),n=this.json.extensions||{};return t?n[e]:null}getRequiredExtension(e){return this.getRequiredExtensions().find(n=>n===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(e,t){return(e.extensions||{})[t]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,t){if(typeof t=="object")return t;let n=this.json[e]&&this.json[e][t];if(!n)throw new Error(`glTF file error: Could not find ${e}[${t}]`);return n}getTypedArrayForBufferView(e){return xu(this.gltf.json,this.gltf.buffers,e)}getTypedArrayForAccessor(e){return Oa(this.gltf.json,this.gltf.buffers,e)}getTypedArrayForImageData(e){e=this.getAccessor(e);let t=this.getBufferView(e.bufferView),s=this.getBuffer(t.buffer).data,i=t.byteOffset||0;return new Uint8Array(s,i,t.byteLength)}addApplicationData(e,t){return this.json[e]=t,this}addExtraData(e,t){return this.json.extras=this.json.extras||{},this.json.extras[e]=t,this}addObjectExtension(e,t,n){return e.extensions=e.extensions||{},e.extensions[t]=n,this.registerUsedExtension(t),this}setObjectExtension(e,t,n){let s=e.extensions||{};s[t]=n}removeObjectExtension(e,t){let n=e?.extensions||{};if(n[t]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let s=this.json.extensionsRemoved;s.includes(t)||s.push(t)}delete n[t]}addExtension(e,t={}){return ve(t),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=t,this.registerUsedExtension(e),t}addRequiredExtension(e,t={}){return ve(t),this.addExtension(e,t),this.registerRequiredExtension(e),t}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(t=>t===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(t=>t===e)||this.json.extensionsRequired.push(e)}removeExtension(e){if(this.json.extensions?.[e]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let t=this.json.extensionsRemoved;t.includes(e)||t.push(e)}this.json.extensions&&delete this.json.extensions[e],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e)}setDefaultScene(e){this.json.scene=e}addScene(e){let{nodeIndices:t}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:t}),this.json.scenes.length-1}addNode(e){let{meshIndex:t,matrix:n}=e;this.json.nodes=this.json.nodes||[];let s={mesh:t};return n&&(s.matrix=n),this.json.nodes.push(s),this.json.nodes.length-1}addMesh(e){let{attributes:t,indices:n,material:s,mode:i=4}=e,a={primitives:[{attributes:this._addAttributes(t),mode:i}]};if(n){let c=this._addIndices(n);a.primitives[0].indices=c}return Number.isFinite(s)&&(a.primitives[0].material=s),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(e){let n={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(n),this.json.meshes.length-1}addImage(e,t){let n=$n(e),s=t||n?.mimeType,o={bufferView:this.addBufferView(e),mimeType:s};return this.json.images=this.json.images||[],this.json.images.push(o),this.json.images.length-1}addBufferView(e,t=0,n=this.byteLength){let s=e.byteLength;ve(Number.isFinite(s)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);let i={buffer:t,byteOffset:n,byteLength:s};return this.byteLength+=_e(s,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(i),this.json.bufferViews.length-1}addAccessor(e,t){let n=t.normalized,s={bufferView:e,...n===void 0?{}:{normalized:n},type:Md(t.size),componentType:t.componentType,count:t.count,max:t.max,min:t.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(s),this.json.accessors.length-1}addBinaryBuffer(e,t={size:3}){let n=this.addBufferView(e),s={min:t.min,max:t.max};(!s.min||!s.max)&&(s=this._getAccessorMinMax(e,t.size));let i={size:t.size,componentType:wo(e),count:Math.round(e.length/t.size),min:s.min,max:s.max};return this.addAccessor(n,Object.assign(i,t))}addTexture(e){let{imageIndex:t,samplerIndex:n}=e,s={source:t,...n===void 0?{}:{sampler:n}};return this.json.textures=this.json.textures||[],this.json.textures.push(s),this.json.textures.length-1}addSampler(e){return this.json.samplers=this.json.samplers||[],this.json.samplers.push({...e}),this.json.samplers.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){if(this.byteLength===0&&!this.json.buffers?.length){delete this.json.buffers,delete this.gltf.binary,this.sourceBuffers=[],this.gltf.buffers=[];return}let e=[0],t=this.byteLength;for(let o=1;o<this.gltf.buffers.length;o++){let a=this.gltf.buffers[o];a&&(e[o]=_e(t,8),t=e[o]+_e(a.byteLength,4))}let n=new ArrayBuffer(t),s=new Uint8Array(n),i=0;for(let o of this.sourceBuffers||[])i=to(o,s,i);for(let o=1;o<this.gltf.buffers.length;o++){let a=this.gltf.buffers[o];a&&to(a,s,e[o])}for(let o of this.json.bufferViews||[]){let a=e[o.buffer];ve(a!==void 0),o.byteOffset=a+(o.byteOffset||0),o.buffer=0;for(let c of["EXT_meshopt_compression","KHR_meshopt_compression"]){let u=o.extensions?.[c];if(u){let l=e[u.buffer];ve(l!==void 0),u.byteOffset=l+(u.byteOffset||0),u.buffer=0}}}this.byteLength=t,this.json.buffers=[{byteLength:t}],this.gltf.binary=n,this.sourceBuffers=[n],this.gltf.buffers=[{arrayBuffer:n,byteOffset:0,byteLength:n.byteLength}]}_removeStringFromArray(e,t){let n=!0;for(;n;){let s=e.indexOf(t);s>-1?e.splice(s,1):n=!1}}_addAttributes(e={}){let t={};for(let n in e){let s=e[n],i=this._getGltfAttributeName(n),o=s.value,a=o.BYTES_PER_ELEMENT*s.size,c=_e(a,4),u;if(c===a)u=this.addBinaryBuffer(o,s);else{let l=o.length/s.size,f=new Uint8Array(l*c),d=new Uint8Array(o.buffer,o.byteOffset,o.byteLength);for(let m=0;m<l;m++)f.set(d.subarray(m*a,(m+1)*a),m*c);let h=this.addBufferView(f);this.json.bufferViews[h].byteStride=c,u=this.addAccessor(h,{...this._getAccessorMinMax(o,s.size),...s,componentType:wo(o),count:l})}t[i]=u}return t}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,t){let n={min:null,max:null};if(e.length<t)return n;n.min=[],n.max=[];let s=e.subarray(0,t);for(let i of s)n.min.push(i),n.max.push(i);for(let i=t;i<e.length;i+=t)for(let o=0;o<t;o++)n.min[0+o]=Math.min(n.min[0+o],e[i+o]),n.max[0+o]=Math.max(n.max[0+o],e[i+o]);return n}};var Ye=class{gltf;type;index;data;path;iterator;constructor(e,t,n,s,i){this.iterator=e,this.gltf=e.gltf,this.type=t,this.index=n,this.data=s,this.path=i}},ai=class extends Ye{parent;constructor(e,t,n,s,i,o){super(e,t,n,s,i),this.parent=o}},lw=class extends Ye{get bufferView(){return this.data.bufferView===void 0?void 0:this.iterator.resolveBufferView(this.data.bufferView,`${this.path}.bufferView`)}},fw=class extends Ye{get channels(){return To(this.data.channels,(e,t)=>this.iterator.getOrCreateNested(e,()=>new dw(this.iterator,"animationChannel",t,e,`${this.path}.channels[${t}]`,this)))}get samplers(){return To(this.data.samplers,(e,t)=>this.iterator.getOrCreateNested(e,()=>new kd(this.iterator,"animationSampler",t,e,`${this.path}.samplers[${t}]`,this)))}},dw=class extends ai{get sampler(){let t=this.parent.data.samplers[this.data.sampler];if(!t)throw new Error(`Invalid glTF reference at ${this.path}.sampler: animation sampler index ${this.data.sampler} is out of range`);return this.iterator.getOrCreateNested(t,()=>new kd(this.iterator,"animationSampler",this.data.sampler,t,`${this.parent.path}.samplers[${this.data.sampler}]`,this.parent))}get target(){return this.iterator.getOrCreateNested(this.data.target,()=>new hw(this.iterator,"animationChannelTarget",0,this.data.target,`${this.path}.target`,this))}},hw=class extends ai{get node(){return this.data.node===void 0?void 0:this.iterator.resolveNode(this.data.node,`${this.path}.node`)}},kd=class extends ai{get input(){return this.iterator.resolveAccessor(this.data.input,`${this.path}.input`)}get output(){return this.iterator.resolveAccessor(this.data.output,`${this.path}.output`)}},pw=class extends Ye{get loadedBuffer(){return this.gltf.buffers[this.index]}},mw=class extends Ye{get buffer(){return this.iterator.resolveBuffer(this.data.buffer,`${this.path}.buffer`)}get loadedBufferView(){let e=this.buffer.loadedBuffer;if(!e)return;let t=e.byteOffset+(this.data.byteOffset||0);return new Uint8Array(e.arrayBuffer,t,this.data.byteLength)}},bw=class extends Ye{},gw=class extends Ye{get file(){return this.iterator.resolveFile(this.data.file,`${this.path}.file`)}get loadedAsset(){return this.gltf.externalAssets?.[this.index]}},yw=class extends Ye{get bufferView(){return this.data.bufferView===void 0?void 0:this.iterator.resolveBufferView(this.data.bufferView,`${this.path}.bufferView`)}get loadedFile(){return this.gltf.files?.[this.index]}},ww=class extends Ye{get bufferView(){return this.data.bufferView===void 0?void 0:this.iterator.resolveBufferView(this.data.bufferView,`${this.path}.bufferView`)}get loadedImage(){return this.gltf.images?.[this.index]}},xw=class extends Ye{get baseColorTexture(){return this.getTextureInfo(this.data.pbrMetallicRoughness?.baseColorTexture,0,"pbrMetallicRoughness.baseColorTexture")}get metallicRoughnessTexture(){return this.getTextureInfo(this.data.pbrMetallicRoughness?.metallicRoughnessTexture,1,"pbrMetallicRoughness.metallicRoughnessTexture")}get normalTexture(){return this.getTextureInfo(this.data.normalTexture,2,"normalTexture")}get occlusionTexture(){return this.getTextureInfo(this.data.occlusionTexture,3,"occlusionTexture")}get emissiveTexture(){return this.getTextureInfo(this.data.emissiveTexture,4,"emissiveTexture")}get textures(){return[this.baseColorTexture,this.metallicRoughnessTexture,this.normalTexture,this.occlusionTexture,this.emissiveTexture].filter(t=>!!t).values()}getTextureInfo(e,t,n){return e?this.iterator.getOrCreateNested(e,()=>new Tw(this.iterator,"textureInfo",t,e,`${this.path}.${n}`,this)):void 0}},Tw=class extends ai{get texture(){return this.iterator.resolveTexture(this.data.index,`${this.path}.index`)}},_w=class extends Ye{get primitives(){return To(this.data.primitives,(e,t)=>this.iterator.getOrCreateNested(e,()=>new Aw(this.iterator,"primitive",t,e,`${this.path}.primitives[${t}]`,this)))}},Aw=class extends ai{get attributes(){return new Map(Object.entries(this.data.attributes).map(([e,t])=>[e,this.iterator.resolveAccessor(t,`${this.path}.attributes.${e}`)]))}get indices(){return this.data.indices===void 0?void 0:this.iterator.resolveAccessor(this.data.indices,`${this.path}.indices`)}get material(){return this.data.material===void 0?void 0:this.iterator.resolveMaterial(this.data.material,`${this.path}.material`)}get targets(){return(this.data.targets||[]).map((e,t)=>new Map(Object.entries(e).map(([n,s])=>[n,this.iterator.resolveAccessor(s,`${this.path}.targets[${t}].${n}`)])))}},vw=class extends Ye{get camera(){return this.data.camera===void 0?void 0:this.iterator.resolveCamera(this.data.camera,`${this.path}.camera`)}get children(){return To(this.data.children||[],(e,t)=>this.iterator.resolveNode(e,`${this.path}.children[${t}]`))}get skin(){return this.data.skin===void 0?void 0:this.iterator.resolveSkin(this.data.skin,`${this.path}.skin`)}get mesh(){return this.data.mesh===void 0?void 0:this.iterator.resolveMesh(this.data.mesh,`${this.path}.mesh`)}get externalAsset(){return this.data.externalAsset===void 0?void 0:this.iterator.resolveExternalAsset(this.data.externalAsset,`${this.path}.externalAsset`)}},Iw=class extends Ye{},Sw=class extends Ye{get nodes(){return To(this.data.nodes||[],(e,t)=>this.iterator.resolveNode(e,`${this.path}.nodes[${t}]`))}},Ew=class extends Ye{get inverseBindMatrices(){return this.data.inverseBindMatrices===void 0?void 0:this.iterator.resolveAccessor(this.data.inverseBindMatrices,`${this.path}.inverseBindMatrices`)}get skeleton(){return this.data.skeleton===void 0?void 0:this.iterator.resolveNode(this.data.skeleton,`${this.path}.skeleton`)}get joints(){return To(this.data.joints,(e,t)=>this.iterator.resolveNode(e,`${this.path}.joints[${t}]`))}},Lw=class extends Ye{get sampler(){return this.data.sampler===void 0?void 0:this.iterator.resolveSampler(this.data.sampler,`${this.path}.sampler`)}get source(){return this.data.source===void 0?void 0:this.iterator.resolveImage(this.data.source,`${this.path}.source`)}},Kr=class{gltf;objectCache=new WeakMap;referencesCache=new WeakMap;constructor(e){this.gltf=e}get data(){return this.gltf.json}getTypedArrayForBufferView(e){return xu(this.data,this.gltf.buffers,e)}getTypedArrayForAccessor(e){return Oa(this.data,this.gltf.buffers,e)}getTypedArrayForImageData(e){return FL(this.data,this.gltf.buffers,e)}getLoadedBuffer(e){let t=this.getMetadata(e);return this.gltf.buffers[t.index]}getLoadedBufferView(e){let t=this.getReferences(e).buffer,n=this.getLoadedBuffer(t);if(!n)return;let s=n.byteOffset+(e.byteOffset||0);return new Uint8Array(n.arrayBuffer,s,e.byteLength)}getLoadedImage(e){return this.gltf.images?.[this.getMetadata(e).index]}getLoadedFile(e){return this.gltf.files?.[this.getMetadata(e).index]}getLoadedExternalAsset(e){return this.gltf.externalAssets?.[this.getMetadata(e).index]}addBuffer(e){let t=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);return this.gltf.buffers.push({arrayBuffer:t,byteOffset:0,byteLength:e.byteLength}),this.data.buffers||=[],this.data.buffers.push({byteLength:e.byteLength}),this.data.buffers.length-1}addBufferView(e,t,n=0){return this.data.bufferViews||=[],this.data.bufferViews.push({buffer:e,byteOffset:n,byteLength:t}),this.data.bufferViews.length-1}addAccessor(e,t){return this.data.accessors||=[],this.data.accessors.push({bufferView:e,type:Md(t.size),componentType:t.componentType,count:t.count,min:t.min,max:t.max}),this.data.accessors.length-1}getReferences(e){let t=this.referencesCache.get(e);if(t)return t;let n=this.getObjectIterator(e),s=m8(n);return this.referencesCache.set(e,s),s}getMetadata(e){let t=this.getObjectIterator(e),n=t instanceof ai?t.parent.data:void 0;return{gltf:this.gltf,type:t.type,index:t.index,parent:n,path:t.path}}get scene(){return this.data.scene===void 0?void 0:this.resolveScene(this.data.scene,"scene").data}get thumbnail(){return this.data.asset.thumbnail===void 0?void 0:this.resolveImage(this.data.asset.thumbnail,"asset.thumbnail").data}get accessors(){return this.iterateCollectionData("accessor")}get animations(){return this.iterateCollectionData("animation")}get buffers(){return this.iterateCollectionData("buffer")}get bufferViews(){return this.iterateCollectionData("bufferView")}get cameras(){return this.iterateCollectionData("camera")}get externalAssets(){return this.iterateCollectionData("externalAsset")}get files(){return this.iterateCollectionData("file")}get images(){return this.iterateCollectionData("image")}get materials(){return this.iterateCollectionData("material")}get meshes(){return this.iterateCollectionData("mesh")}get nodes(){return this.iterateCollectionData("node")}get samplers(){return this.iterateCollectionData("sampler")}get scenes(){return this.iterateCollectionData("scene")}get skins(){return this.iterateCollectionData("skin")}get textures(){return this.iterateCollectionData("texture")}hasExtension(e){return!!this.data.extensionsUsed?.includes(e)||!!this.data.extensionsRequired?.includes(e)}isExtensionRequired(e){return!!this.data.extensionsRequired?.includes(e)}getExtension(e,t){let n=typeof e=="string"?this.data:e,s=typeof e=="string"?e:t;return n.extensions?.[s]}setExtension(e,t,n){let s=typeof e=="string",i=s?this.data:e,o=s?e:t,a=s?t:n,c=s?!!n:!1;i.extensions||={},i.extensions[o]=a,this.registerUsedExtension(o),c&&this.registerRequiredExtension(o)}registerUsedExtension(e){this.data.extensionsUsed||=[],this.data.extensionsUsed.includes(e)||this.data.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.data.extensionsRequired||=[],this.data.extensionsRequired.includes(e)||this.data.extensionsRequired.push(e)}removeExtension(e,t){let n=typeof e=="string",s=n?this.data:e,i=n?e:t;s.extensions?.[i]!==void 0&&(this.recordRemovedExtension(i),delete s.extensions[i]),n&&(qL(this.data.extensionsUsed,i),qL(this.data.extensionsRequired,i))}recordRemovedExtension(e){let t=this.data;t.extensionsRemoved||=[],t.extensionsRemoved.includes(e)||t.extensionsRemoved.push(e)}resolveAccessor(e,t){return this.resolveCollectionObject("accessor",e,t)}resolveBuffer(e,t){return this.resolveCollectionObject("buffer",e,t)}resolveBufferView(e,t){return this.resolveCollectionObject("bufferView",e,t)}resolveCamera(e,t){return this.resolveCollectionObject("camera",e,t)}resolveExternalAsset(e,t){return this.resolveCollectionObject("externalAsset",e,t)}resolveFile(e,t){return this.resolveCollectionObject("file",e,t)}resolveImage(e,t){return this.resolveCollectionObject("image",e,t)}resolveMaterial(e,t){return this.resolveCollectionObject("material",e,t)}resolveMesh(e,t){return this.resolveCollectionObject("mesh",e,t)}resolveNode(e,t){return this.resolveCollectionObject("node",e,t)}resolveSampler(e,t){return this.resolveCollectionObject("sampler",e,t)}resolveScene(e,t){return this.resolveCollectionObject("scene",e,t)}resolveSkin(e,t){return this.resolveCollectionObject("skin",e,t)}resolveTexture(e,t){return this.resolveCollectionObject("texture",e,t)}getOrCreateNested(e,t){return this.getOrCreate(e,t)}iterateCollection(e){let t=this.getCollection(e);return To(t,(n,s)=>this.resolveCollectionObject(e,s,e))}iterateCollectionData(e){return(function*(n){for(let s of n.iterateCollection(e))yield s.data})(this)}getObjectIterator(e){let t=this.objectCache.get(e);if(!t)throw new Error("glTF object is not registered with this iterator");return t}resolveCollectionObject(e,t,n){let i=this.getCollection(e)[t];if(!i)throw new Error(`Invalid glTF reference at ${n}: ${e} index ${t} is out of range`);return this.getOrCreate(i,()=>this.createCollectionObject(e,t,i))}getCollection(e){switch(e){case"accessor":return this.data.accessors||[];case"animation":return this.data.animations||[];case"buffer":return this.data.buffers||[];case"bufferView":return this.data.bufferViews||[];case"camera":return this.data.cameras||[];case"externalAsset":return this.data.externalAssets||[];case"file":return this.data.files||[];case"image":return this.data.images||[];case"material":return this.data.materials||[];case"mesh":return this.data.meshes||[];case"node":return this.data.nodes||[];case"sampler":return this.data.samplers||[];case"scene":return this.data.scenes||[];case"skin":return this.data.skins||[];case"texture":return this.data.textures||[]}}createCollectionObject(e,t,n){let s=`${b8(e)}[${t}]`;switch(e){case"accessor":return new lw(this,e,t,n,s);case"animation":return new fw(this,e,t,n,s);case"buffer":return new pw(this,e,t,n,s);case"bufferView":return new mw(this,e,t,n,s);case"camera":return new bw(this,e,t,n,s);case"externalAsset":return new gw(this,e,t,n,s);case"file":return new yw(this,e,t,n,s);case"image":return new ww(this,e,t,n,s);case"material":return new xw(this,e,t,n,s);case"mesh":return new _w(this,e,t,n,s);case"node":return new vw(this,e,t,n,s);case"sampler":return new Iw(this,e,t,n,s);case"scene":return new Sw(this,e,t,n,s);case"skin":return new Ew(this,e,t,n,s);case"texture":return new Lw(this,e,t,n,s)}}getOrCreate(e,t){let n=this.objectCache.get(e);if(n)return n;let s=t();return this.objectCache.set(e,s),s}};function m8(r){switch(r.type){case"accessor":return{get bufferView(){return r.bufferView?.data}};case"animation":return{get channels(){return xo(r.channels)},get samplers(){return xo(r.samplers)}};case"animationChannel":return{get sampler(){return r.sampler.data},get target(){return r.target.data}};case"animationChannelTarget":return{get node(){return r.node?.data}};case"animationSampler":return{get input(){return r.input.data},get output(){return r.output.data}};case"bufferView":return{get buffer(){return r.buffer.data}};case"externalAsset":return{get file(){return r.file.data}};case"file":case"image":return{get bufferView(){return r.bufferView?.data}};case"material":return{get baseColorTexture(){return r.baseColorTexture?.data},get metallicRoughnessTexture(){return r.metallicRoughnessTexture?.data},get normalTexture(){return r.normalTexture?.data},get occlusionTexture(){return r.occlusionTexture?.data},get emissiveTexture(){return r.emissiveTexture?.data},get textures(){return xo(r.textures)}};case"textureInfo":return{get texture(){return r.texture.data}};case"mesh":return{get primitives(){return xo(r.primitives)}};case"primitive":return{get attributes(){return $L(r.attributes)},get indices(){return r.indices?.data},get material(){return r.material?.data},get targets(){return r.targets.map($L)}};case"node":return{get camera(){return r.camera?.data},get children(){return xo(r.children)},get skin(){return r.skin?.data},get mesh(){return r.mesh?.data},get externalAsset(){return r.externalAsset?.data}};case"scene":return{get nodes(){return xo(r.nodes)}};case"skin":return{get inverseBindMatrices(){return r.inverseBindMatrices?.data},get skeleton(){return r.skeleton?.data},get joints(){return xo(r.joints)}};case"texture":return{get sampler(){return r.sampler?.data},get source(){return r.source?.data}};default:return{}}}function To(r,e){return(function*(){for(let n=0;n<r.length;n++)yield e(r[n],n)})()}function xo(r){return(function*(){for(let t of r)yield t.data})()}function $L(r){return new Map(Array.from(r,([e,t])=>[e,t.data]))}function b8(r){switch(r){case"bufferView":return"bufferViews";case"externalAsset":return"externalAssets";case"mesh":return"meshes";default:return`${r}s`}}function qL(r,e){if(r)for(let t=r.length-1;t>=0;t--)r[t]===e&&r.splice(t,1)}qn();Ue();function KL(r){return(r%1+1)%1}var XL={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},g8={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},HL={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8};function Bw(r,e){return HL[e]*XL[r]}function Fw(r,e,t,n){if(t!=="UINT8"&&t!=="UINT16"&&t!=="UINT32"&&t!=="UINT64")return null;let s=r.getTypedArrayForBufferView(e),i=Nd(s,"SCALAR",t,n+1);if(i instanceof BigInt64Array||i instanceof BigUint64Array){let o=new Float64Array(i.length),a=BigInt(Number.MAX_SAFE_INTEGER);for(let c=0;c<i.length;c++){let u=i[c];if(u<0n||u>a)throw new Error("EXT_structural_metadata: UINT64 offset exceeds the safe integer range");o[c]=Number(u)}return o}return i}function Nd(r,e,t,n=1){let s=XL[e],i=g8[t],o=HL[t],a=n*s,c=a*o,u=r.buffer,l=r.byteOffset;return l%o!==0&&(u=new Uint8Array(u).slice(l,l+c).buffer,l=0),new i(ro(u),l,a)}function Cd(r,e,t){let n=`TEXCOORD_${e.texCoord||0}`,s=t.attributes[n],i=r.getTypedArrayForAccessor(s),o=r.gltf.json,a=e.index,c=o.textures?.[a]?.source;if(typeof c<"u"){let u=o.images?.[c]?.mimeType,l=r.gltf.images?.[c];if(l&&typeof l.width<"u"&&!("compressed"in l&&l.compressed)){let f=[];for(let d=0;d<i.length;d+=2){let h=y8(l,u,i,d,e.channels);f.push(h)}return f}}return[]}function JL(r,e,t,n,s){if(!t?.length)return;let i=[];for(let f of t){let d=n.findIndex(h=>h===f);d===-1&&(d=n.push(f)-1),i.push(d)}let o=new Uint32Array(i),a=r instanceof Kr?r:new Kr(r.gltf),c=a.addBuffer(o),u=a.addBufferView(c,o.byteLength),l=a.addAccessor(u,{size:1,componentType:wo(o),count:o.length});s.attributes[e]=l}function y8(r,e,t,n,s=[0]){let i={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},o=t[n],a=t[n+1],c=1;e&&(e.indexOf("image/jpeg")!==-1||e.indexOf("image/png")!==-1)&&(c=4);let u=w8(o,a,r,c),l=0;for(let f of s){let d=typeof f=="number"?Object.values(i)[f]:i[f],h=u+d.offset,m=Jc(r);if(m.data.length<=h)throw new Error(`${m.data.length} <= ${h}`);let b=m.data[h];l|=b<<d.shift}return l}function w8(r,e,t,n=1){let s=t.width,i=KL(r)*(s-1),o=Math.round(i),a=t.height,c=KL(e)*(a-1),u=Math.round(c),l=t.components?t.components:n;return(u*s+o)*l}function Ow(r,e,t,n=1){let s=[];for(let i=0;i<e;i++){let o=Number(t[i]),a=Number(t[i+1])-o;if(!Number.isInteger(o)||!Number.isInteger(a)||o<0||a<0||(o+a)*n>r.length)break;let c=o*n,u=a*n;s.push(r.slice(c,c+u))}return s}function Mw(r,e,t,n=1){let s=[],i=t*n;for(let o=0;o<e;o++){let a=o*i;s.push(r.slice(a,a+i))}return s}function YL(r,e,t,n,s){let i=new TextDecoder("utf8");if(t){if(!n)throw new Error("stringOffsets is required for variable-length string arrays");let o=[];for(let a=0;a<r;a++){let c=t[a],u=t[a+1],l=[];for(let f=c;f<u;f++){let d=n[f],h=n[f+1],m=e.subarray(d,h);l.push(i.decode(m))}o.push(l)}return o}if(n){let o=[],a=r*(s||1);for(let c=0;c<a;c++){let u=Number(n[c]),l=Number(n[c+1]);u>=0&&l>=u&&l<=e.length&&o.push(i.decode(e.subarray(u,l)))}return s?Array.from({length:r},(c,u)=>o.slice(u*s,(u+1)*s)):o}return[]}var Da="EXT_mesh_features",x8=Da;async function T8(r,e){let t=new Kr(r);A8(t,e)}function _8(r,e){let t=new oi(r);return I8(t,e),t.createBinaryChunk(),t.gltf}function A8(r,e){for(let t of r.meshes)for(let n of r.getReferences(t).primitives)v8(r,n,e)}function v8(r,e,t){let s=r.getExtension(e,Da)?.featureIds||[];if(s)for(let i of s){let o;if(typeof i.attribute<"u"){if(!t?.gltf?.loadBuffers)continue;let a=`_FEATURE_ID_${i.attribute}`,c=e.attributes[a];o=r.getTypedArrayForAccessor(c)}else if(typeof i.texture<"u"){if(!t?.gltf?.loadImages)continue;o=Cd(r,i.texture,e)}else{let a=e.attributes.POSITION,c=typeof a=="number"?r.data.accessors?.[a]?.count:a?.count;if(typeof c!="number"||!Number.isInteger(c)||c<0)throw new Error("EXT_mesh_features: implicit feature IDs require a POSITION accessor");if(i.featureCount!==c)throw new Error(`EXT_mesh_features: implicit featureCount ${i.featureCount} does not match vertex count ${c}`);delete i.data,Object.defineProperty(i,"implicit",{configurable:!0,enumerable:!1,writable:!0,value:{start:0,count:c}})}o&&(i.data=o,delete i.implicit)}}function I8(r,e){let t=r.gltf.json.meshes;if(t)for(let n of t)for(let s of n.primitives)E8(r,s)}function S8(r,e,t,n){e.extensions||(e.extensions={});let s=e.extensions[Da];s||(s={featureIds:[]},e.extensions[Da]=s);let{featureIds:i}=s,o={featureCount:t.length,propertyTable:n,data:t};i.push(o),r.addObjectExtension(e,Da,s)}function E8(r,e){let t=e.extensions?.[Da];if(!t)return;let n=t.featureIds;n.forEach((s,i)=>{if(s.data){let{accessorKey:o,index:a}=L8(e.attributes),c=new Uint32Array(s.data);n[i]={featureCount:c.length,propertyTable:s.propertyTable,attribute:a};let u=r.addBufferView(c),l=r.addAccessor(u,{size:1,componentType:wo(c),count:c.length});e.attributes[o]=l}})}function L8(r){let e="_FEATURE_ID_",t=Object.keys(r).filter(i=>i.indexOf(e)===0),n=-1;for(let i of t){let o=Number(i.substring(e.length));o>n&&(n=o)}return n++,{accessorKey:`${e}${n}`,index:n}}var Cw={};J(Cw,{createExtStructuralMetadata:()=>eU,decode:()=>O8,encode:()=>M8,name:()=>F8});function ZL(r,e,t){if(r.startsWith("data:")||r.startsWith("http:")||r.startsWith("https:"))return QL(r);let s=t?.baseUrl||B8(e?.core?.baseUrl);if(!s)throw new Error(`'baseUrl' must be provided to resolve relative url ${r}`);let i=s.endsWith("/")?`${s}${r}`:`${s}/${r}`;return QL(i)}function QL(r){try{return new URL(r).href}catch{return r}}function B8(r){if(!r)return;if(r.endsWith("/"))return r;let e=r.lastIndexOf("/");return e>=0?r.slice(0,e+1):""}var _o="EXT_structural_metadata",F8=_o;async function O8(r,e,t){let n=new Kr(r),s=n.getExtension(_o);if(e.gltf?.loadBuffers&&s?.schemaUri&&!s.schema){if(!t?.fetch)throw new Error("EXT_structural_metadata: a loader context is required to load schemaUri");let i=ZL(s.schemaUri,e,t),o=await t.fetch(i);if(!o.ok)throw new Error(`EXT_structural_metadata: failed to load schemaUri ${i} (${o.status})`);s.schema=await o.json()}D8(n,e)}function M8(r,e){let t=new oi(r);return Q8(t,e),t.createBinaryChunk(),t.gltf}function D8(r,e){if(!e.gltf?.loadBuffers)return;let t=r.getExtension(_o);t&&(e.gltf?.loadImages&&R8(r,t),k8(r,t))}function R8(r,e){let t=e.propertyTextures,n=r.data;if(t&&n.meshes)for(let s of n.meshes)for(let i of s.primitives)N8(r,t,i,e)}function k8(r,e){let t=e.schema;if(!t)return;let n=t.classes,s=e.propertyTables;if(n&&s)for(let i of s)i.class&&n[i.class]&&U8(r,t,i)}function N8(r,e,t,n){if(!e)return;let i=t.extensions?.[_o]?.propertyTextures;if(i)for(let o of i){let a=e[o];C8(r,a,t,n)}}function C8(r,e,t,n){if(!e.properties)return;n.dataAttributeNames||(n.dataAttributeNames=[]);let s=e.class;for(let i in e.properties){let o=`${s}_${i}`,a=e.properties?.[i];if(!a)continue;a.data||(a.data=[]);let c=a.data,u=Cd(r,a,t);u!==null&&(JL(r,o,u,c,t),a.data=c,n.dataAttributeNames.push(o))}}function U8(r,e,t){let n=e.classes?.[t.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${t.class}`);let s=t.count;for(let i in n.properties){let o=n.properties[i],a=t.properties?.[i];if(a){let c={},u=P8(r,e,o,s,a,c);a.data=u,c.value!==void 0&&Object.defineProperty(a,"rawData",{value:c.value,configurable:!0,enumerable:!1,writable:!0})}}}function P8(r,e,t,n,s,i){let o=[],a=s.values,c=r.getTypedArrayForBufferView(a),u=j8(r,t,s,n),l=G8(r,t,s,n,u);switch(t.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{let f=z8(t,s,n,c,u);o=f.data,i&&(i.value=f.rawData);break}case"BOOLEAN":{o=V8(t,n,c,u);break}case"STRING":{o=YL(n,c,u,l,t.array?t.count:void 0);break}case"ENUM":{o=K8(e,t,n,c,u);break}default:throw new Error(`Unknown classProperty type ${t.type}`)}return o}function V8(r,e,t,n){return r.array?n?Array.from({length:e},(s,i)=>{let o=Number(n[i]),a=Number(n[i+1]);if(!Number.isInteger(o)||!Number.isInteger(a)||o<0||a<o)throw new Error("EXT_structural_metadata: invalid BOOLEAN array offsets");return Rw(t,o,a-o)}):r.count===void 0?[]:Array.from({length:e},(s,i)=>Rw(t,i*r.count,r.count)):Rw(t,0,e)}function Rw(r,e,t){if(e+t>r.byteLength*8)throw new Error("EXT_structural_metadata: BOOLEAN values exceed their buffer view");return Array.from({length:t},(n,s)=>{let i=e+s;return!!(r[Math.floor(i/8)]&1<<i%8)})}function j8(r,e,t,n){return e.array&&typeof e.count>"u"&&typeof t.arrayOffsets<"u"?Fw(r,t.arrayOffsets,t.arrayOffsetType||"UINT32",n):null}function G8(r,e,t,n,s){if(typeof t.stringOffsets<"u"){let i=s?Number(s[n]):n*(e.array&&e.count||1);return Fw(r,t.stringOffsets,t.stringOffsetType||"UINT32",i)}return null}function z8(r,e,t,n,s){let i=r.array,o=r.count,a={VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16}[r.type]||1,c=Bw(r.type,r.componentType),u=n.byteLength/c,l;r.componentType?l=Nd(n,r.type,r.componentType,u):l=n;let f=l,d=e.offset??r.offset,h=e.scale??r.scale,m=r.normalized||d!==void 0||h!==void 0?W8(f,r.componentType,r.type,r.normalized,d,h):f;return i?s?{data:Ow(m,t,s,a),rawData:Ow(f,t,s,a)}:o?{data:Mw(m,t,o,a),rawData:Mw(f,t,o,a)}:{data:[],rawData:[]}:{data:m,rawData:f}}function W8(r,e,t,n,s,i){let o=q8(e),a=!!(n&&o!==void 0);if(!a&&s===void 0&&i===void 0)return r;let c=$8(t),u=new Float64Array(r.length);for(let l=0;l<r.length;l++){let f=Number(r[l]);a&&(f=e?.startsWith("INT")?Math.max(f/o,-1):f/o);let d=l%c,h=Array.isArray(s)?s[d]??0:s??0,m=Array.isArray(i)?i[d]??1:i??1;u[l]=f*m+h}return u}function $8(r){switch(r){case"VEC2":return 2;case"VEC3":return 3;case"VEC4":return 4;case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16;default:return 1}}function q8(r){switch(r){case"INT8":return 127;case"UINT8":return 255;case"INT16":return 32767;case"UINT16":return 65535;case"INT32":return 2147483647;case"UINT32":return 4294967295;case"INT64":return 2**63-1;case"UINT64":return 2**64-1;default:return}}function K8(r,e,t,n,s){let i=e.enumType;if(!i)throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");let o=r.enums?.[i];if(!o)throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${i}`);let a=o.valueType||"UINT16",c=Bw(e.type,a),u=n.byteLength/c,l=Nd(n,e.type,a,u);if(l||(l=n),e.array){if(s)return X8({valuesData:l,numberOfElements:t,arrayOffsets:s,enumEntry:o});let f=e.count;return f?H8(l,t,f,o):[]}return Nw(l,0,t,o)}function X8(r){let{valuesData:e,numberOfElements:t,arrayOffsets:n,enumEntry:s}=r,i=[];for(let o=0;o<t;o++){let a=Number(n[o]),c=Number(n[o+1])-a;if(!Number.isInteger(a)||!Number.isInteger(c)||a<0||c<0||a+c>e.length)break;let u=Nw(e,a,c,s);i.push(u)}return i}function H8(r,e,t,n){let s=[];for(let i=0;i<e;i++){let o=t*i,a=Nw(r,o,t,n);s.push(a)}return s}function Nw(r,e,t,n){let s=[];for(let i=0;i<t;i++){let o=r[e+i],a=J8(n,o);a?s.push(a.name):s.push("")}return s}function J8(r,e){for(let t of r.values)if(typeof e=="bigint"?Number.isSafeInteger(t.value)&&BigInt(t.value)===e:t.value===e)return t;return null}var Y8="schemaClassId";function Q8(r,e){let t=r.getExtension(_o);if(t&&t.propertyTables)for(let n of t.propertyTables){let s=n.class,i=t.schema?.classes?.[s];n.properties&&i&&Z8(n,i,r)}}function Z8(r,e,t){for(let n in r.properties){let s=r.properties[n].data;if(s){let i=e.properties[n];if(i){let o=nU(s,i,t);r.properties[n]=o}}}}function eU(r,e,t=Y8){let n=r.getExtension(_o);n||(n=r.addExtension(_o)),n.schema=tU(e,t,n.schema);let s=rU(e,t,n.schema);return n.propertyTables||(n.propertyTables=[]),n.propertyTables.push(s)-1}function tU(r,e,t){let n=t??{id:"schema_id"},s={properties:{}};for(let i of r){let o={type:i.elementType,componentType:i.componentType};s.properties[i.name]=o}return n.classes={},n.classes[e]=s,n}function rU(r,e,t){let n={class:e,count:0},s=0,i=t.classes?.[e];for(let o of r){if(s===0&&(s=o.values.length),s!==o.values.length&&o.values.length)throw new Error("Illegal values in attributes");i?.properties[o.name]&&(n.properties||(n.properties={}),n.properties[o.name]={values:0,data:o.values})}return n.count=s,n}function nU(r,e,t){let n={values:0};if(e.type==="STRING"){let{stringData:s,stringOffsets:i}=oU(r);n.stringOffsets=kw(i,t),n.values=kw(s,t)}else if(e.type==="SCALAR"&&e.componentType){let s=iU(r,e.componentType);n.values=kw(s,t)}return n}var sU={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:Int32Array,UINT64:Uint32Array,FLOAT32:Float32Array,FLOAT64:Float64Array};function iU(r,e){let t=[];for(let s of r)t.push(Number(s));let n=sU[e];if(!n)throw new Error("Illegal component type");return new n(t)}function oU(r){let e=new TextEncoder,t=[],n=0;for(let c of r){let u=e.encode(c);n+=u.length,t.push(u)}let s=new Uint8Array(n),i=[],o=0;for(let c of t)s.set(c,o),i.push(o),o+=c.length;i.push(o);let a=new Uint32Array(i);return{stringData:s,stringOffsets:a}}function kw(r,e){return e.addBufferView(r)}var Uw={};J(Uw,{decode:()=>cU,encode:()=>uU,name:()=>aU});var Ra="KHR_materials_unlit",aU=Ra;async function cU(r){let e=new Kr(r);for(let t of e.materials)e.getExtension(t,Ra)&&(t.unlit=!0),e.removeExtension(t,Ra);e.removeExtension(Ra)}function uU(r){let e=new oi(r);for(let t of r.json.materials||[]){let n=t;n.unlit&&(delete n.unlit,e.addObjectExtension(t,Ra,{}),e.registerRequiredExtension(Ra))}for(let t of["extensionsUsed","extensionsRequired"])r.json[t]?.length===0&&delete r.json[t]}var lU=[Uw,Cw,Dw];function eB(r,e={}){for(let t of lU)r=t.encode?.(r,e)??r;return r}var rB={dataType:null,batchType:null,...Ba,version:ii,options:{gltf:{}},encode:async(r,e={})=>{let t=await WL(r,e),n={...e};return n.gltf=e.gltf?{...e.gltf,draco:void 0}:void 0,tB(t,n)},encodeSync:tB};function tB(r,e={}){if(e.gltf?.draco?.enabled)throw new Error("GLTFWriter Draco compression is asynchronous; use encode() instead of encodeSync()");let{byteOffset:t=0}=e,n=eB(r);r.buffers=n.buffers,r.binary=n.binary;let s=nw(n,null,t,e),i=new ArrayBuffer(s),o=new DataView(i);return nw(n,o,t,e),i}async function fU(){let{GLBLoaderWithParser:r}=await Promise.resolve().then(()=>(Gy(),jy));return r}var nB={dataType:null,batchType:null,...Fa,version:ii,preload:fU,options:{glb:{strict:!1}}};var iB={...Fa,version:ii,options:{glb:{}},encode:async(r,e={})=>sB(r,e),encodeSync:sB};function sB(r,e){let{byteOffset:t=0}=e??{},n=e?.glb??{},s=wu(r,null,t,n),i=new ArrayBuffer(s),o=new DataView(i);return wu(r,o,t,n),i}ea();var oB=typeof __VERSION__<"u"?__VERSION__:"latest";var Ud={name:"Draco",id:"draco",module:"scene",encoding:"binary",format:"draco",extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"]};var aB={backend:typeof WebAssembly=="object"?"wasm":"javascript",extraAttributes:{},attributeNameEntry:void 0,shape:"arrow-table",decoderProfile:"full"};async function dU(r,e){let t=e;switch(hU(t)){case"wasm":{let{DracoWASMLoaderWithParser:n}=await Promise.resolve().then(()=>(my(),py));return n}case"javascript":{let{DracoJavaScriptLoaderWithParser:n}=await Promise.resolve().then(()=>(gy(),by));return n}case"draco3d":{let{Draco3DLoaderWithParser:n}=await Promise.resolve().then(()=>(wy(),yy));return n}default:throw new Error(`DracoLoader: unsupported backend "${t?.draco?.backend}"`)}}var Pd={dataType:null,batchType:null,...Ud,version:oB,worker:!0,workerSourceNode:"draco/workers/draco-worker-node.ts",serializeWorkerResult:af,deserializeWorkerResult:cf,options:{draco:aB},preload:dU},cB=Pd;function hU(r){return r?.draco?.backend?r.draco.backend==="js"?"javascript":r.draco.backend:Pd.options.draco.backend}var pU="1.5.7",mU="8786740086a9f4d83f44aa83badfbea4dce7a1b5",_u=`https://www.gstatic.com/draco/versioned/decoders/${pU}`,uB=`https://cdn.jsdelivr.net/gh/google/draco@${mU}/javascript`,xt={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",GLTF_DECODER:"draco_wasm_wrapper_gltf.js",GLTF_DECODER_WASM:"draco_decoder_gltf.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js",ENCODER_WASM:"draco_encoder.wasm"},lB={[xt.DECODER]:`${_u}/${xt.DECODER}`,[xt.DECODER_WASM]:`${_u}/${xt.DECODER_WASM}`,[xt.GLTF_DECODER]:`${_u}/${xt.GLTF_DECODER}`,[xt.GLTF_DECODER_WASM]:`${_u}/${xt.GLTF_DECODER_WASM}`,[xt.FALLBACK_DECODER]:`${_u}/${xt.FALLBACK_DECODER}`,[xt.ENCODER]:`${uB}/${xt.ENCODER}`,[xt.ENCODER_WASM]:`${uB}/${xt.ENCODER_WASM}`};async function bU(){let{MaterialXLoaderWithParser:r}=await Promise.resolve().then(()=>(Xy(),Ky));return r}var fB={name:"MaterialX",id:"materialx",module:"scene",version:"latest",extensions:["mtlx"],mimeTypes:["application/xml"],text:!0,dataType:null,batchType:null,options:{},preload:bU};var gU=typeof __VERSION__<"u"?__VERSION__:"latest";async function yU(){let{STLLoaderWithParser:r}=await Promise.resolve().then(()=>(Yy(),Jy));return r}var dB={name:"STL",id:"stl",module:"scene",version:gU,extensions:["stl"],mimeTypes:["model/stl"],binary:!0,dataType:null,batchType:null,options:{},preload:yU};return xB(wU);})();
|
|
56
56
|
return __exports__;
|
|
57
57
|
});
|