@miris-inc/core 0.0.8-3ee2ddb → 0.0.8-48a7adc
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/LICENSE +201 -0
- package/README.md +82 -0
- package/banner.svg +34 -0
- package/dist/AquaApi.js +15 -0
- package/dist/AquaApi.wasm +0 -0
- package/dist/aqua-parser.js +14 -0
- package/dist/aqua-parser.wasm +0 -0
- package/dist/core.d.ts +624 -0
- package/dist/core.js +2137 -0
- package/dist/core.prod.js +1 -0
- package/dist/core.standalone.js +5782 -0
- package/dist/core.standalone.prod.js +1 -0
- package/package.json +50 -7
- package/core.js +0 -6318
- package/icon-black.svg +0 -10
- package/icon-white.svg +0 -11
- package/social-card.png +0 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t,e,n,r=class{#t=/* @__PURE__ */new Map;#e=/* @__PURE__ */new Map;forKey(t){return this.#t.get(t)}forId(t){return this.#e.get(t)}setKey(t,e){this.#t.set(t,e)}setId(t,e){return this.#e.set(t,e)}delete(t){this.#t.delete(t.key),this.#e.delete(t.id)}deleteKey(t){this.#t.delete(t)}deleteId(t){this.#e.delete(t)}},i=class{#n;useExtSplats=!1;#r=null;splatsExtendedData=null;#i=null;#a=null;#s=null;#o=null;#c=0;sh1Data=null;sh1Max=1;sh2Data=null;sh2Max=1;sh3Data=null;sh3Max=1;sh3ExtendedData=null;get key(){return this.#n??null}set key(t){this.store.deleteKey(this.key),(t||0===t)&&this.store.setKey(t,this),this.#n=t}set splats(t){this.#r=t}get splats(){return this.#r}set bounds(t){this.#i=t}get bounds(){return console.warn("`bounds` is deprecated, use `localBounds` instead"),this.#i}set localBounds(t){this.#a=t}get localBounds(){return this.#a}set lodIndex(t){this.#o=t}get lodIndex(){return this.#o}set paddingCount(t){this.#c=t}get paddingCount(){return this.#c}set transform(t){this.#s=t}get transform(){return this.#s}setSh1(t,e){this.sh1Data=t,this.sh1Max=e}setSh2(t,e){this.sh2Data=t,this.sh2Max=e}setSh3(t,e){this.sh3Data=t,this.sh3Max=e}dispose(){const t=this.#n;t?.dispose?.(),this.store.delete(this),this.#n=null,t?.dispose?.(),this.#r=null,this.splatsExtendedData=null,this.#i=null,this.#s=null,this.sh1Data=null,this.sh2Data=null,this.sh3Data=null,this.sh3ExtendedData=null,this.modelRoot?.lods?.delete(this)}constructor({id:t,modelRoot:e,lodStore:n}){Object.defineProperties(this,{id:{value:t},modelRoot:{value:e},store:{value:n}}),n.setId(t,this),e.add(this)}},a=class{constructor({type:t,lod:e}){Object.defineProperties(this,{type:{value:t},lod:{value:e}})}},s=class t{static#t=/* @__PURE__ */new Map;static#e=/* @__PURE__ */new Map;static forKey(t){return this.#t.get(t)}static forId(t){return this.#e.get(t)}#n;get key(){return this.#n??null}set key(e){t.#t.delete(this.key),(e||0===e)&&t.#t.set(e,this),this.#n=e}#u=/* @__PURE__ */new Set;get lods(){return this.#u}#s;set transform(t){this.#s=t}get transform(){return this.#s}constructor({id:e,stream:n}){Object.defineProperties(this,{id:{value:e},stream:{value:n}}),t.#e.set(e,this),n.add(this)}add(t){this.#u.add(t)}dispose(){const e=[...this.#u];this.#u.clear();for(const t of e)t.dispose();t.#t.delete(this.key),t.#e.delete(this.id),this.#n=null}},o=class{static#l=/* @__PURE__ */new Map;static#d=1;static#h=0;static#p=2**32;static#m=0;static#f(t){this.#h=(this.#h+t)%this.#p}static#g(t){this.#h=(this.#h-t)%this.#p,this.#h<0&&(this.#h+=this.#p)}static getCheckSum(){return this.#h}static getConsecutiveIds(t){const e=this.#d;return this.#d+=t,e}static addWithId(t,e){this.#f(e),this.#l.set(e,t)}static add(t){const e=this.#d++;return this.addWithId(t,e),e}static get(t){const e=this.#l.get(t);if(void 0===e)throw new Error(`Attribute with id ${t} not found in cache`);return e}static remove(t){if(Array.isArray(t))for(const e of t)this.#l.delete(e),this.#g(e);else this.#l.delete(t),this.#g(t)}static validateCheckSum(t){if(t!=this.getCheckSum()){let e=t-this.getCheckSum();e<0&&(e+=this.#p),e!=this.#m&&(console.error(`ID checksum mismatch between WASM and TypeScript sides! ${t} ${this.getCheckSum()}`),this.#m=e)}}},c=class t extends EventTarget{static _idMap=/* @__PURE__ */new Map;static _keyMap=/* @__PURE__ */new Map;static forId(t){if(t)return this._idMap.get(t)}static forKey(t){return this._keyMap.get(t)}#n;#y=!1;#v={};_addVariantCollection(t){this.#v[t]||(this.#v[t]={id:t,children:[]})}_findAndAddToVariantSet(t,e){const n=r=>{if(!r)return!1;if(r.id===t)return r.children?r.children.push(e):"option"===e.type?(r.options||(r.options=[]),r.options.push(e)):(r.nestedSets||(r.nestedSets=[]),r.nestedSets.push(e)),!0;if(Array.isArray(r.children))for(const t of r.children)if(n(t))return!0;if(Array.isArray(r.nestedSets))for(const t of r.nestedSets)if(n(t))return!0;if(Array.isArray(r.options))for(const t of r.options)if(n(t))return!0;return!1};for(const r of Object.values(this.#v))if(n(r))return}_addVariant(t,e){this._findAndAddToVariantSet(t,e)}_exportVariantHierarchies(){return Object.entries(this.#v).map(([t,e])=>({hierarchyId:Number(t),hierarchy:e}))}_setVariantSelection(t){this.client.setVariantSelection(t)}get key(){return this.#n??null}set key(e){t._keyMap.delete(this.key),(e||0===e)&&t._keyMap.set(e,this),this.#n=e}#b=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];get matrix(){return this.#b}set matrix(t){this.#b=t;const{engine:e,client:n}=this,r=e.malloc(4*this.#b.length);e.heapF32.set(Float32Array.from(this.#b),r/4),n.setSceneObjectTransform(this.id,r),e.free(r)}get boundingBox(){const{engine:t,client:e}=this,n=t.malloc(24);e.getWorldBoundingBox(this.id,n);const[r,i,a,s,o,c]=Float32Array.from(t.heapF32.subarray(n/4,n/4+6));if(void 0===r||void 0===i||void 0===a||void 0===s||void 0===o||void 0===c)return;const u={min:{x:r-s/2,y:i-o/2,z:a-c/2},max:{x:r+s/2,y:i+o/2,z:a+c/2},size:{x:s,y:o,z:c},center:{x:r,y:i,z:a}};return Object.freeze(u),u}#S=/* @__PURE__ */new Set;get modelRoots(){return new Set(this.#S)}get chunks(){return this.modelRoots}constructor(e){super();const{scene:n,uuid:r}=e;Object.defineProperties(this,{uuid:{value:r,enumerable:!0},scene:{value:n,enumerable:!0},client:{value:n.client,enumerable:!0},miris:{value:n.miris,enumerable:!0},engine:{value:n.miris.engine,enumerable:!0}}),this._initStream(e),t._idMap.set(this.id,this),n.add(this)}_initStream({uuid:t}){const e=this.client.addStreamById(t,t,!1);Object.defineProperty(this,"id",{value:e})}async _onStreamLoaded(){this.#y||(this.dispatchEvent(new Event("streamloaded")),this.scene._onSceneLoaded(),this.#y=!0)}_onRootLoaded(){this.dispatchEvent(new Event("rootloaded"))}add(t){this.#S.add(t)}end(){console.log("ending the stream"),this.client.removeStream(this.id);for(const t of this.#S)t.dispose();this.#S.clear(),t._idMap.delete(this.id),t._keyMap.delete(this.key),this.scene.streams.has(this)&&this.scene.delete(this)}},u=(n=new URL("AquaApi.wasm",import.meta.url).href).includes("/.vite/")?n.replace(/\.vite\/[^?#]*/,()=>"node_modules/@miris-inc/core/dist/AquaApi.wasm"):n;function l(t){return t.default||t}var d=function(...n){var r;return t||(e=fetch(u).then(t=>!t.ok||(t.headers.get("content-type")||"").includes("text/html")?null:t.arrayBuffer()).catch(()=>null),t=(r=(t=>t.includes("/.vite/")?new URL("/node_modules/@miris-inc/core/dist/AquaApi.js",t).href:t)(new URL("./AquaApi.js",""+import.meta.url).href),import(/* webpackIgnore: true */ /* turbopackIgnore: true */ r).then(t=>{const e=l(t);if("function"==typeof e)return e;throw new Error("bad module")}).catch(()=>fetch(r).then(t=>{if(!t.ok)throw new Error(t.status+" "+r);return t.text()}).then(t=>{const e=URL.createObjectURL(new Blob([t],{type:"text/javascript"}));return import(/* webpackIgnore: true */ /* turbopackIgnore: true */ e).then(t=>(URL.revokeObjectURL(e),l(t)))}))).catch(n=>{throw t=e=void 0,n})),Promise.all([t,e]).then(([t,e])=>{if(e){const[r={},...i]=n;return t({...r,wasmBinary:e},...i)}return t(...n)})},h=class t{static name="thread";static get Worker(){throw new Error("Thread could not be initialized because no Worker was supplied. Do you forget to set `static Worker = Worker` on the child class?")}constructor({engine:e}){Object.defineProperty(this,"engine",{value:e,enumerable:!0}),Object.defineProperty(this,"ready",{enumerable:!0,value:new Promise(t=>{this.#w.set(0,async()=>{this.#_=!1,this.#w.delete(0),t(this)})})}),this.#k=new this.constructor.Worker({name:`decoder-${t.#C()}`}),this.#k.addEventListener("message",this.#T.bind(this))}static#A=0;static#C(){return this.#A+=1}#_=!0;get pending(){return this.#_}#k;#w=/* @__PURE__ */new Map;get pendingRequests(){return this.#w.size}get terminated(){return!this.#k}#$=0;#P(){return this.#$+=1}async _execute(t,...e){if(this.pending)throw new Error(`Unable to execute ${t} because decoder has not yet been initialized`);if(!this.#k)throw new Error(`Unable to execute ${t} because decoder has already been terminated`);return new Promise(n=>{if(!this.#k)throw new Error(`Unable to execute ${t} because decoder has already been terminated`);const r=this.#P();this.#w.set(r,async t=>{this.#w.delete(r),n(t)});const i=e.filter(t=>t instanceof ArrayBuffer);this.#k.postMessage({id:r,action:t,args:e},i)})}#T({data:t}){"ready"===t&&(t={id:0,result:void 0});const{id:e,result:n}=t;this.#w.get(e)?.(n)}_postToWorker(t,e){this.#k?.postMessage(t,e??[])}terminate(){this.#k&&(this.#k.terminate(),this.#k.removeEventListener("message",this.#T),this.#k=null)}},p='const e = {\n\tsparkPackedSplat: {\n\t\telementsPerSplat: 4,\n\t\tdiscard: !1\n\t},\n\textendedPackedSplatLow: {\n\t\telementsPerSplat: 4,\n\t\tdiscard: !1\n\t},\n\textendedPackedSplatHigh: {\n\t\telementsPerSplat: 4,\n\t\tdiscard: !1\n\t},\n\tpackedSh1: {\n\t\telementsPerSplat: 2,\n\t\tdiscard: !1\n\t},\n\tpackedSh2: {\n\t\telementsPerSplat: 4,\n\t\tdiscard: !1\n\t},\n\tpackedSh3: {\n\t\telementsPerSplat: 4,\n\t\tdiscard: !1\n\t},\n\tsh1Extended: {\n\t\telementsPerSplat: 4,\n\t\tdiscard: !1\n\t},\n\tsh2Extended: {\n\t\telementsPerSplat: 4,\n\t\tdiscard: !1\n\t},\n\tsh3Extended_0: {\n\t\telementsPerSplat: 4,\n\t\tdiscard: !1\n\t},\n\tsh3Extended_1: {\n\t\telementsPerSplat: 4,\n\t\tdiscard: !1\n\t},\n\tsplatterEllipsoids: {\n\t\telementsPerSplat: 12,\n\t\tdiscard: !1\n\t},\n\tsplatterSphericalHarmonics: {\n\t\telementsPerSplat: 16,\n\t\tdiscard: !1\n\t}\n};\nfunction t(t, r, n) {\n\tconst a = e[t];\n\tif (void 0 === a) throw new Error("attribute name" + t + " is unknown");\n\tconst i = n.length, o = (s = i, u = 2048 * a.elementsPerSplat, Math.ceil(s / u) * u);\n\tvar s, u;\n\tconst c = new Uint32Array(o);\n\treturn c.set(n), {\n\t\tpaddedData: c,\n\t\toriginalSize: i,\n\t\tid: r\n\t};\n}\nconst { wasmBinary: r } = await new Promise((e) => {\n\tself.addEventListener("message", function t(r) {\n\t\t"wasm-init" === r.data?.type && (self.removeEventListener("message", t), e(r.data));\n\t});\n});\nif (!r) throw new Error("Decoder worker did not receive WASM binary. The main thread failed to fetch aqua-parser.wasm.");\nconst n = await async function(e = {}) {\n\tvar t, r, n = e, a = "./this.program", i = (e, t) => {\n\t\tthrow t;\n\t}, o = import.meta.url, s = "";\n\ttry {\n\t\ts = new URL(".", o).href;\n\t} catch {}\n\tr = (e) => {\n\t\tvar t = new XMLHttpRequest();\n\t\treturn t.open("GET", e, !1), t.responseType = "arraybuffer", t.send(null), new Uint8Array(t.response);\n\t}, t = async (e) => {\n\t\tvar t = await fetch(e, { credentials: "same-origin" });\n\t\tif (t.ok) return t.arrayBuffer();\n\t\tthrow new Error(t.status + " : " + t.url);\n\t};\n\tvar u, c, l, p, d, f, h, v, m, y, g, _, w, $, b, T, P = console.log.bind(console), C = console.error.bind(console), k = !1, S = !1;\n\tfunction F() {\n\t\tvar e = d.buffer;\n\t\tn.HEAP8 = f = new Int8Array(e), v = new Int16Array(e), n.HEAPU8 = h = new Uint8Array(e), m = new Uint16Array(e), n.HEAP32 = y = new Int32Array(e), n.HEAPU32 = g = new Uint32Array(e), n.HEAPF32 = _ = new Float32Array(e), n.HEAPF64 = w = new Float64Array(e), $ = new BigInt64Array(e), b = new BigUint64Array(e);\n\t}\n\tfunction A(e) {\n\t\tn.onAbort?.(e), C(e = "Aborted(" + e + ")"), k = !0, e += ". Build with -sASSERTIONS for more info.";\n\t\tvar t = new WebAssembly.RuntimeError(e);\n\t\tthrow p?.(t), t;\n\t}\n\tfunction D() {\n\t\treturn n.locateFile ? (e = "aqua-parser.wasm", n.locateFile ? n.locateFile(e, s) : s + e) : "";\n\t\tvar e;\n\t}\n\tasync function W(e) {\n\t\tif (!u) try {\n\t\t\tvar n = await t(e);\n\t\t\treturn new Uint8Array(n);\n\t\t} catch {}\n\t\treturn function(e) {\n\t\t\tif (e == T && u) return new Uint8Array(u);\n\t\t\tif (r) return r(e);\n\t\t\tthrow "both async and sync fetching of the wasm failed";\n\t\t}(e);\n\t}\n\tasync function E(e, t, r) {\n\t\tif (!e) try {\n\t\t\tvar n = fetch(t, { credentials: "same-origin" });\n\t\t\treturn await WebAssembly.instantiateStreaming(n, r);\n\t\t} catch (a) {\n\t\t\tC(`wasm streaming compile failed: ${a}`), C("falling back to ArrayBuffer instantiation");\n\t\t}\n\t\treturn async function(e, t) {\n\t\t\ttry {\n\t\t\t\tvar r = await W(e);\n\t\t\t\treturn await WebAssembly.instantiate(r, t);\n\t\t\t} catch (n) {\n\t\t\t\tC(`failed to asynchronously prepare wasm: ${n}`), A(n);\n\t\t\t}\n\t\t}(t, r);\n\t}\n\tclass x {\n\t\tname = "ExitStatus";\n\t\tconstructor(e) {\n\t\t\tthis.message = `Program terminated with exit(${e})`, this.status = e;\n\t\t}\n\t}\n\tvar O = (e) => {\n\t\tfor (; e.length > 0;) e.shift()(n);\n\t}, R = [], j = (e) => R.push(e), U = [], H = (e) => U.push(e), I = !0, V = (e) => Je(e), B = () => Ge(), M = [], q = 0, L = 0;\n\tclass z {\n\t\tconstructor(e) {\n\t\t\tthis.excPtr = e, this.ptr = e - 24;\n\t\t}\n\t\tset_type(e) {\n\t\t\tg[this.ptr + 4 >> 2] = e;\n\t\t}\n\t\tget_type() {\n\t\t\treturn g[this.ptr + 4 >> 2];\n\t\t}\n\t\tset_destructor(e) {\n\t\t\tg[this.ptr + 8 >> 2] = e;\n\t\t}\n\t\tget_destructor() {\n\t\t\treturn g[this.ptr + 8 >> 2];\n\t\t}\n\t\tset_caught(e) {\n\t\t\te = e ? 1 : 0, f[this.ptr + 12] = e;\n\t\t}\n\t\tget_caught() {\n\t\t\treturn 0 != f[this.ptr + 12];\n\t\t}\n\t\tset_rethrown(e) {\n\t\t\te = e ? 1 : 0, f[this.ptr + 13] = e;\n\t\t}\n\t\tget_rethrown() {\n\t\t\treturn 0 != f[this.ptr + 13];\n\t\t}\n\t\tinit(e, t) {\n\t\t\tthis.set_adjusted_ptr(0), this.set_type(e), this.set_destructor(t);\n\t\t}\n\t\tset_adjusted_ptr(e) {\n\t\t\tg[this.ptr + 16 >> 2] = e;\n\t\t}\n\t\tget_adjusted_ptr() {\n\t\t\treturn g[this.ptr + 16 >> 2];\n\t\t}\n\t}\n\tvar N = (e) => Ne(e), J = (e) => {\n\t\tvar t = L;\n\t\tif (!t) return N(0), 0;\n\t\tvar r = new z(t);\n\t\tr.set_adjusted_ptr(t);\n\t\tvar n = r.get_type();\n\t\tif (!n) return N(0), t;\n\t\tfor (var a of e) {\n\t\t\tif (0 === a || a === n) break;\n\t\t\tvar i = r.ptr + 16;\n\t\t\tif (Ke(a, n, i)) return N(a), t;\n\t\t}\n\t\treturn N(n), t;\n\t}, Y = (e) => {\n\t\tfor (var t = "";;) {\n\t\t\tvar r = h[e++];\n\t\t\tif (!r) return t;\n\t\t\tt += String.fromCharCode(r);\n\t\t}\n\t}, G = {}, X = {}, Z = {}, K = class extends Error {\n\t\tconstructor(e) {\n\t\t\tsuper(e), this.name = "BindingError";\n\t\t}\n\t}, Q = (e) => {\n\t\tthrow new K(e);\n\t};\n\tfunction ee(e, t, r = {}) {\n\t\treturn function(e, t, r = {}) {\n\t\t\tvar n = t.name;\n\t\t\tif (e || Q(`type "${n}" must have a positive integer typeid pointer`), X.hasOwnProperty(e)) {\n\t\t\t\tif (r.ignoreDuplicateRegistrations) return;\n\t\t\t\tQ(`Cannot register type \'${n}\' twice`);\n\t\t\t}\n\t\t\tif (X[e] = t, delete Z[e], G.hasOwnProperty(e)) {\n\t\t\t\tvar a = G[e];\n\t\t\t\tdelete G[e], a.forEach((e) => e());\n\t\t\t}\n\t\t}(e, t, r);\n\t}\n\tvar te = (e, t, r) => {\n\t\tswitch (t) {\n\t\t\tcase 1: return r ? (e) => f[e] : (e) => h[e];\n\t\t\tcase 2: return r ? (e) => v[e >> 1] : (e) => m[e >> 1];\n\t\t\tcase 4: return r ? (e) => y[e >> 2] : (e) => g[e >> 2];\n\t\t\tcase 8: return r ? (e) => $[e >> 3] : (e) => b[e >> 3];\n\t\t\tdefault: throw new TypeError(`invalid integer width (${t}): ${e}`);\n\t\t}\n\t}, re = (e) => ({\n\t\tcount: e.count,\n\t\tdeleteScheduled: e.deleteScheduled,\n\t\tpreservePointerOnDelete: e.preservePointerOnDelete,\n\t\tptr: e.ptr,\n\t\tptrType: e.ptrType,\n\t\tsmartPtr: e.smartPtr,\n\t\tsmartPtrType: e.smartPtrType\n\t}), ne = (e) => {\n\t\tQ(e.$$.ptrType.registeredClass.name + " instance already deleted");\n\t}, ae = !1, ie = (e) => {}, oe = (e) => {\n\t\te.count.value -= 1, 0 === e.count.value && ((e) => {\n\t\t\te.smartPtr ? e.smartPtrType.rawDestructor(e.smartPtr) : e.ptrType.registeredClass.rawDestructor(e.ptr);\n\t\t})(e);\n\t}, se = (e) => typeof FinalizationRegistry > "u" ? (se = (e) => e, e) : (ae = new FinalizationRegistry((e) => {\n\t\toe(e.$$);\n\t}), ie = (e) => ae.unregister(e), (se = (e) => {\n\t\tvar t = e.$$;\n\t\tif (t.smartPtr) {\n\t\t\tvar r = { $$: t };\n\t\t\tae.register(e, r, e);\n\t\t}\n\t\treturn e;\n\t})(e)), ue = [];\n\tfunction ce() {}\n\tvar le = (e, t) => Object.defineProperty(t, "name", { value: e }), pe = {}, de = (e, t, r) => {\n\t\tif (void 0 === e[t].overloadTable) {\n\t\t\tvar n = e[t];\n\t\t\te[t] = function(...n) {\n\t\t\t\treturn e[t].overloadTable.hasOwnProperty(n.length) || Q(`Function \'${r}\' called with an invalid number of arguments (${n.length}) - expects one of (${e[t].overloadTable})!`), e[t].overloadTable[n.length].apply(this, n);\n\t\t\t}, e[t].overloadTable = [], e[t].overloadTable[n.argCount] = n;\n\t\t}\n\t}, fe = (e, t, r) => {\n\t\tn.hasOwnProperty(e) ? ((void 0 === r || void 0 !== n[e].overloadTable && void 0 !== n[e].overloadTable[r]) && Q(`Cannot register public name \'${e}\' twice`), de(n, e, e), n[e].overloadTable.hasOwnProperty(r) && Q(`Cannot register multiple overloads of a function with the same number of arguments (${r})!`), n[e].overloadTable[r] = t) : (n[e] = t, n[e].argCount = r);\n\t};\n\tfunction he(e, t, r, n, a, i, o, s) {\n\t\tthis.name = e, this.constructor = t, this.instancePrototype = r, this.rawDestructor = n, this.baseClass = a, this.getActualType = i, this.upcast = o, this.downcast = s, this.pureVirtualFunctions = [];\n\t}\n\tvar ve = (e, t, r) => {\n\t\tfor (; t !== r;) t.upcast || Q(`Expected null or instance of ${r.name}, got an instance of ${t.name}`), e = t.upcast(e), t = t.baseClass;\n\t\treturn e;\n\t}, me = (e) => {\n\t\tif (null === e) return "null";\n\t\tvar t = typeof e;\n\t\treturn "object" === t || "array" === t || "function" === t ? e.toString() : "" + e;\n\t};\n\tfunction ye(e, t) {\n\t\tif (null === t) return this.isReference && Q(`null is not a valid ${this.name}`), 0;\n\t\tt.$$ || Q(`Cannot pass "${me(t)}" as a ${this.name}`), t.$$.ptr || Q(`Cannot pass deleted object as a pointer of type ${this.name}`);\n\t\tvar r = t.$$.ptrType.registeredClass;\n\t\treturn ve(t.$$.ptr, r, this.registeredClass);\n\t}\n\tfunction ge(e, t) {\n\t\tvar r;\n\t\tif (null === t) return this.isReference && Q(`null is not a valid ${this.name}`), this.isSmartPointer ? (r = this.rawConstructor(), null !== e && e.push(this.rawDestructor, r), r) : 0;\n\t\t(!t || !t.$$) && Q(`Cannot pass "${me(t)}" as a ${this.name}`), t.$$.ptr || Q(`Cannot pass deleted object as a pointer of type ${this.name}`), !this.isConst && t.$$.ptrType.isConst && Q(`Cannot convert argument of type ${t.$$.smartPtrType ? t.$$.smartPtrType.name : t.$$.ptrType.name} to parameter type ${this.name}`);\n\t\tvar n = t.$$.ptrType.registeredClass;\n\t\tif (r = ve(t.$$.ptr, n, this.registeredClass), this.isSmartPointer) switch (void 0 === t.$$.smartPtr && Q("Passing raw pointer to smart pointer is illegal"), this.sharingPolicy) {\n\t\t\tcase 0:\n\t\t\t\tt.$$.smartPtrType === this ? r = t.$$.smartPtr : Q(`Cannot convert argument of type ${t.$$.smartPtrType ? t.$$.smartPtrType.name : t.$$.ptrType.name} to parameter type ${this.name}`);\n\t\t\t\tbreak;\n\t\t\tcase 1:\n\t\t\t\tr = t.$$.smartPtr;\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tif (t.$$.smartPtrType === this) r = t.$$.smartPtr;\n\t\t\t\telse {\n\t\t\t\t\tvar a = t.clone();\n\t\t\t\t\tr = this.rawShare(r, ot.toHandle(() => a.delete())), null !== e && e.push(this.rawDestructor, r);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault: Q("Unsupporting sharing policy");\n\t\t}\n\t\treturn r;\n\t}\n\tfunction _e(e, t) {\n\t\tif (null === t) return this.isReference && Q(`null is not a valid ${this.name}`), 0;\n\t\tt.$$ || Q(`Cannot pass "${me(t)}" as a ${this.name}`), t.$$.ptr || Q(`Cannot pass deleted object as a pointer of type ${this.name}`), t.$$.ptrType.isConst && Q(`Cannot convert argument of type ${t.$$.ptrType.name} to parameter type ${this.name}`);\n\t\tvar r = t.$$.ptrType.registeredClass;\n\t\treturn ve(t.$$.ptr, r, this.registeredClass);\n\t}\n\tfunction we(e) {\n\t\treturn this.fromWireType(g[e >> 2]);\n\t}\n\tvar $e = (e, t, r) => {\n\t\tif (t === r) return e;\n\t\tif (void 0 === r.baseClass) return null;\n\t\tvar n = $e(e, t, r.baseClass);\n\t\treturn null === n ? null : r.downcast(n);\n\t}, be = {}, Te = (e, t) => (t = ((e, t) => {\n\t\tfor (void 0 === t && Q("ptr should not be undefined"); e.baseClass;) t = e.upcast(t), e = e.baseClass;\n\t\treturn t;\n\t})(e, t), be[t]), Pe = class extends Error {\n\t\tconstructor(e) {\n\t\t\tsuper(e), this.name = "InternalError";\n\t\t}\n\t}, Ce = (e) => {\n\t\tthrow new Pe(e);\n\t}, ke = (e, t) => ((!t.ptrType || !t.ptr) && Ce("makeClassHandle requires ptr and ptrType"), !!t.smartPtrType != !!t.smartPtr && Ce("Both smartPtrType and smartPtr must be specified"), t.count = { value: 1 }, se(Object.create(e, { $$: {\n\t\tvalue: t,\n\t\twritable: !0\n\t} })));\n\tfunction Se(e) {\n\t\tvar t = this.getPointee(e);\n\t\tif (!t) return this.destructor(e), null;\n\t\tvar r = Te(this.registeredClass, t);\n\t\tif (void 0 !== r) {\n\t\t\tif (0 === r.$$.count.value) return r.$$.ptr = t, r.$$.smartPtr = e, r.clone();\n\t\t\tvar n = r.clone();\n\t\t\treturn this.destructor(e), n;\n\t\t}\n\t\tfunction a() {\n\t\t\treturn this.isSmartPointer ? ke(this.registeredClass.instancePrototype, {\n\t\t\t\tptrType: this.pointeeType,\n\t\t\t\tptr: t,\n\t\t\t\tsmartPtrType: this,\n\t\t\t\tsmartPtr: e\n\t\t\t}) : ke(this.registeredClass.instancePrototype, {\n\t\t\t\tptrType: this,\n\t\t\t\tptr: e\n\t\t\t});\n\t\t}\n\t\tvar i, o = pe[this.registeredClass.getActualType(t)];\n\t\tif (!o) return a.call(this);\n\t\ti = this.isConst ? o.constPointerType : o.pointerType;\n\t\tvar s = $e(t, this.registeredClass, i.registeredClass);\n\t\treturn null === s ? a.call(this) : this.isSmartPointer ? ke(i.registeredClass.instancePrototype, {\n\t\t\tptrType: i,\n\t\t\tptr: s,\n\t\t\tsmartPtrType: this,\n\t\t\tsmartPtr: e\n\t\t}) : ke(i.registeredClass.instancePrototype, {\n\t\t\tptrType: i,\n\t\t\tptr: s\n\t\t});\n\t}\n\tfunction Fe(e, t, r, n, a, i, o, s, u, c, l) {\n\t\tthis.name = e, this.registeredClass = t, this.isReference = r, this.isConst = n, this.isSmartPointer = a, this.pointeeType = i, this.sharingPolicy = o, this.rawGetPointee = s, this.rawConstructor = u, this.rawShare = c, this.rawDestructor = l, a || void 0 !== t.baseClass ? this.toWireType = ge : n ? (this.toWireType = ye, this.destructorFunction = null) : (this.toWireType = _e, this.destructorFunction = null);\n\t}\n\tvar Ae, De = (e, t, r) => {\n\t\tn.hasOwnProperty(e) || Ce("Replacing nonexistent public symbol"), void 0 !== n[e].overloadTable && void 0 !== r ? n[e].overloadTable[r] = t : (n[e] = t, n[e].argCount = r);\n\t}, We = [], Ee = (e) => {\n\t\tvar t = We[e];\n\t\treturn t || (We[e] = t = Ae.get(e)), t;\n\t}, xe = (e, t, r = !1) => {\n\t\te = Y(e);\n\t\tvar n = Ee(t);\n\t\treturn "function" != typeof n && Q(`unknown function pointer with signature ${e}: ${t}`), n;\n\t};\n\tclass Oe extends Error {}\n\tvar Re = (e) => {\n\t\tvar t = Be(e), r = Y(t);\n\t\treturn qe(t), r;\n\t}, je = (e, t) => {\n\t\tvar r = [], n = {};\n\t\tthrow t.forEach(function e(t) {\n\t\t\tif (!n[t] && !X[t]) {\n\t\t\t\tif (Z[t]) return void Z[t].forEach(e);\n\t\t\t\tr.push(t), n[t] = !0;\n\t\t\t}\n\t\t}), new Oe(`${e}: ` + r.map(Re).join([", "]));\n\t}, Ue = (e, t, r) => {\n\t\tfunction n(t) {\n\t\t\tvar n = r(t);\n\t\t\tn.length !== e.length && Ce("Mismatched type converter count");\n\t\t\tfor (var a = 0; a < e.length; ++a) ee(e[a], n[a]);\n\t\t}\n\t\te.forEach((e) => Z[e] = t);\n\t\tvar a = new Array(t.length), i = [], o = 0;\n\t\tt.forEach((e, t) => {\n\t\t\tX.hasOwnProperty(e) ? a[t] = X[e] : (i.push(e), G.hasOwnProperty(e) || (G[e] = []), G[e].push(() => {\n\t\t\t\ta[t] = X[e], ++o === i.length && n(a);\n\t\t\t}));\n\t\t}), 0 === i.length && n(a);\n\t}, He = (e) => {\n\t\tfor (; e.length;) {\n\t\t\tvar t = e.pop();\n\t\t\te.pop()(t);\n\t\t}\n\t};\n\tfunction Ie(e) {\n\t\tfor (var t = 1; t < e.length; ++t) if (null !== e[t] && void 0 === e[t].destructorFunction) return !0;\n\t\treturn !1;\n\t}\n\tfunction Ve(e, t, r, n, a, i) {\n\t\tvar o = t.length;\n\t\to < 2 && Q("argTypes array size mismatch! Must at least get return value and \'this\' types!");\n\t\tfor (var s = null !== t[1] && null !== r, u = Ie(t), c = !t[0].isVoid, l = t[0], p = t[1], d = [\n\t\t\te,\n\t\t\tQ,\n\t\t\tn,\n\t\t\ta,\n\t\t\tHe,\n\t\t\tl.fromWireType.bind(l),\n\t\t\tp?.toWireType.bind(p)\n\t\t], f = 2; f < o; ++f) {\n\t\t\tvar h = t[f];\n\t\t\td.push(h.toWireType.bind(h));\n\t\t}\n\t\tif (!u) for (f = s ? 1 : 2; f < t.length; ++f) null !== t[f].destructorFunction && d.push(t[f].destructorFunction);\n\t\treturn le(e, function(e, t, r, n) {\n\t\t\tvar a = Ie(e), i = e.length - 2, o = [], s = ["fn"];\n\t\t\tt && s.push("thisWired");\n\t\t\tfor (var u = 0; u < i; ++u) o.push(`arg${u}`), s.push(`arg${u}Wired`);\n\t\t\to = o.join(","), s = s.join(",");\n\t\t\tvar c = `return function (${o}) {\\n`;\n\t\t\ta && (c += "var destructors = [];\\n");\n\t\t\tvar l = a ? "destructors" : "null", p = [\n\t\t\t\t"humanName",\n\t\t\t\t"throwBindingError",\n\t\t\t\t"invoker",\n\t\t\t\t"fn",\n\t\t\t\t"runDestructors",\n\t\t\t\t"fromRetWire",\n\t\t\t\t"toClassParamWire"\n\t\t\t];\n\t\t\tfor (t && (c += `var thisWired = toClassParamWire(${l}, this);\\n`), u = 0; u < i; ++u) {\n\t\t\t\tvar d = `toArg${u}Wire`;\n\t\t\t\tc += `var arg${u}Wired = ${d}(${l}, arg${u});\\n`, p.push(d);\n\t\t\t}\n\t\t\tif (c += (r || n ? "var rv = " : "") + `invoker(${s});\\n`, a) c += "runDestructors(destructors);\\n";\n\t\t\telse for (u = t ? 1 : 2; u < e.length; ++u) {\n\t\t\t\tvar f = 1 === u ? "thisWired" : "arg" + (u - 2) + "Wired";\n\t\t\t\tnull !== e[u].destructorFunction && (c += `${f}_dtor(${f});\\n`, p.push(`${f}_dtor`));\n\t\t\t}\n\t\t\treturn r && (c += "var ret = fromRetWire(rv);\\nreturn ret;\\n"), c += "}\\n", new Function(p, c);\n\t\t}(t, s, c, i)(...d));\n\t}\n\tvar Be, Me, qe, Le, ze, Ne, Je, Ye, Ge, Xe, Ze, Ke, Qe, et = (e, t) => {\n\t\tfor (var r = [], n = 0; n < e; n++) r.push(g[t + 4 * n >> 2]);\n\t\treturn r;\n\t}, tt = (e) => {\n\t\tconst t = (e = e.trim()).indexOf("(");\n\t\treturn -1 === t ? e : e.slice(0, t);\n\t}, rt = (e, t, r) => (e instanceof Object || Q(`${r} with invalid "this": ${e}`), e instanceof t.registeredClass.constructor || Q(`${r} incompatible with "this" of type ${e.constructor.name}`), e.$$.ptr || Q(`cannot call emscripten binding method ${r} on deleted object`), ve(e.$$.ptr, e.$$.ptrType.registeredClass, t.registeredClass)), nt = [], at = [\n\t\t0,\n\t\t1,\n\t\t,\n\t\t1,\n\t\tnull,\n\t\t1,\n\t\t!0,\n\t\t1,\n\t\t!1,\n\t\t1\n\t], it = (e) => {\n\t\te > 9 && 0 === --at[e + 1] && (at[e] = void 0, nt.push(e));\n\t}, ot = {\n\t\ttoValue: (e) => (e || Q(`Cannot use deleted val. handle = ${e}`), at[e]),\n\t\ttoHandle: (e) => {\n\t\t\tswitch (e) {\n\t\t\t\tcase void 0: return 2;\n\t\t\t\tcase null: return 4;\n\t\t\t\tcase !0: return 6;\n\t\t\t\tcase !1: return 8;\n\t\t\t\tdefault: {\n\t\t\t\t\tconst t = nt.pop() || at.length;\n\t\t\t\t\treturn at[t] = e, at[t + 1] = 1, t;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}, st = {\n\t\tname: "emscripten::val",\n\t\tfromWireType: (e) => {\n\t\t\tvar t = ot.toValue(e);\n\t\t\treturn it(e), t;\n\t\t},\n\t\ttoWireType: (e, t) => ot.toHandle(t),\n\t\treadValueFromPointer: we,\n\t\tdestructorFunction: null\n\t}, ut = (e, t, r) => {\n\t\tswitch (t) {\n\t\t\tcase 1: return r ? function(e) {\n\t\t\t\treturn this.fromWireType(f[e]);\n\t\t\t} : function(e) {\n\t\t\t\treturn this.fromWireType(h[e]);\n\t\t\t};\n\t\t\tcase 2: return r ? function(e) {\n\t\t\t\treturn this.fromWireType(v[e >> 1]);\n\t\t\t} : function(e) {\n\t\t\t\treturn this.fromWireType(m[e >> 1]);\n\t\t\t};\n\t\t\tcase 4: return r ? function(e) {\n\t\t\t\treturn this.fromWireType(y[e >> 2]);\n\t\t\t} : function(e) {\n\t\t\t\treturn this.fromWireType(g[e >> 2]);\n\t\t\t};\n\t\t\tdefault: throw new TypeError(`invalid integer width (${t}): ${e}`);\n\t\t}\n\t}, ct = (e, t) => {\n\t\tvar r = X[e];\n\t\treturn void 0 === r && Q(`${t} has unknown type ${Re(e)}`), r;\n\t}, lt = (e, t) => {\n\t\tswitch (t) {\n\t\t\tcase 4: return function(e) {\n\t\t\t\treturn this.fromWireType(_[e >> 2]);\n\t\t\t};\n\t\t\tcase 8: return function(e) {\n\t\t\t\treturn this.fromWireType(w[e >> 3]);\n\t\t\t};\n\t\t\tdefault: throw new TypeError(`invalid float width (${t}): ${e}`);\n\t\t}\n\t}, pt = (e, t, r) => ((e, t, r, n) => {\n\t\tif (!(n > 0)) return 0;\n\t\tfor (var a = r, i = r + n - 1, o = 0; o < e.length; ++o) {\n\t\t\tvar s = e.codePointAt(o);\n\t\t\tif (s <= 127) {\n\t\t\t\tif (r >= i) break;\n\t\t\t\tt[r++] = s;\n\t\t\t} else if (s <= 2047) {\n\t\t\t\tif (r + 1 >= i) break;\n\t\t\t\tt[r++] = 192 | s >> 6, t[r++] = 128 | 63 & s;\n\t\t\t} else if (s <= 65535) {\n\t\t\t\tif (r + 2 >= i) break;\n\t\t\t\tt[r++] = 224 | s >> 12, t[r++] = 128 | s >> 6 & 63, t[r++] = 128 | 63 & s;\n\t\t\t} else {\n\t\t\t\tif (r + 3 >= i) break;\n\t\t\t\tt[r++] = 240 | s >> 18, t[r++] = 128 | s >> 12 & 63, t[r++] = 128 | s >> 6 & 63, t[r++] = 128 | 63 & s, o++;\n\t\t\t}\n\t\t}\n\t\treturn t[r] = 0, r - a;\n\t})(e, h, t, r), dt = (e) => {\n\t\tfor (var t = 0, r = 0; r < e.length; ++r) {\n\t\t\tvar n = e.charCodeAt(r);\n\t\t\tn <= 127 ? t++ : n <= 2047 ? t += 2 : n >= 55296 && n <= 57343 ? (t += 4, ++r) : t += 3;\n\t\t}\n\t\treturn t;\n\t}, ft = typeof TextDecoder < "u" ? new TextDecoder() : void 0, ht = (e, t, r, n) => {\n\t\tvar a = t + r;\n\t\tif (n) return a;\n\t\tfor (; e[t] && !(t >= a);) ++t;\n\t\treturn t;\n\t}, vt = (e, t = 0, r, n) => {\n\t\tvar a = ht(e, t, r, n);\n\t\tif (a - t > 16 && e.buffer && ft) return ft.decode(e.subarray(t, a));\n\t\tfor (var i = ""; t < a;) {\n\t\t\tvar o = e[t++];\n\t\t\tif (128 & o) {\n\t\t\t\tvar s = 63 & e[t++];\n\t\t\t\tif (192 != (224 & o)) {\n\t\t\t\t\tvar u = 63 & e[t++];\n\t\t\t\t\tif ((o = 224 == (240 & o) ? (15 & o) << 12 | s << 6 | u : (7 & o) << 18 | s << 12 | u << 6 | 63 & e[t++]) < 65536) i += String.fromCharCode(o);\n\t\t\t\t\telse {\n\t\t\t\t\t\tvar c = o - 65536;\n\t\t\t\t\t\ti += String.fromCharCode(55296 | c >> 10, 56320 | 1023 & c);\n\t\t\t\t\t}\n\t\t\t\t} else i += String.fromCharCode((31 & o) << 6 | s);\n\t\t\t} else i += String.fromCharCode(o);\n\t\t}\n\t\treturn i;\n\t}, mt = (e, t, r) => e ? vt(h, e, t, r) : "", yt = typeof TextDecoder < "u" ? new TextDecoder("utf-16le") : void 0, gt = (e, t, r) => {\n\t\tvar n = e >> 1, a = ht(m, n, t / 2, r);\n\t\tif (a - n > 16 && yt) return yt.decode(m.subarray(n, a));\n\t\tfor (var i = "", o = n; o < a; ++o) {\n\t\t\tvar s = m[o];\n\t\t\ti += String.fromCharCode(s);\n\t\t}\n\t\treturn i;\n\t}, _t = (e, t, r) => {\n\t\tif (r ??= 2147483647, r < 2) return 0;\n\t\tfor (var n = t, a = (r -= 2) < 2 * e.length ? r / 2 : e.length, i = 0; i < a; ++i) {\n\t\t\tvar o = e.charCodeAt(i);\n\t\t\tv[t >> 1] = o, t += 2;\n\t\t}\n\t\treturn v[t >> 1] = 0, t - n;\n\t}, wt = (e) => 2 * e.length, $t = (e, t, r) => {\n\t\tfor (var n = "", a = e >> 2, i = 0; !(i >= t / 4); i++) {\n\t\t\tvar o = g[a + i];\n\t\t\tif (!o && !r) break;\n\t\t\tn += String.fromCodePoint(o);\n\t\t}\n\t\treturn n;\n\t}, bt = (e, t, r) => {\n\t\tif (r ??= 2147483647, r < 4) return 0;\n\t\tfor (var n = t, a = n + r - 4, i = 0; i < e.length; ++i) {\n\t\t\tvar o = e.codePointAt(i);\n\t\t\tif (o > 65535 && i++, y[t >> 2] = o, (t += 4) + 4 > a) break;\n\t\t}\n\t\treturn y[t >> 2] = 0, t - n;\n\t}, Tt = (e) => {\n\t\tfor (var t = 0, r = 0; r < e.length; ++r) e.codePointAt(r) > 65535 && r++, t += 4;\n\t\treturn t;\n\t}, Pt = 0, Ct = [], kt = (e, t, r) => {\n\t\tvar n = [], a = e(n, r);\n\t\treturn n.length && (g[t >> 2] = ot.toHandle(n)), a;\n\t}, St = {}, Ft = (e) => {\n\t\tvar t = St[e];\n\t\treturn void 0 === t ? Y(e) : t;\n\t}, At = (e) => e < -9007199254740992 || e > 9007199254740992 ? NaN : Number(e), Dt = [\n\t\t0,\n\t\t31,\n\t\t60,\n\t\t91,\n\t\t121,\n\t\t152,\n\t\t182,\n\t\t213,\n\t\t244,\n\t\t274,\n\t\t305,\n\t\t335\n\t], Wt = [\n\t\t0,\n\t\t31,\n\t\t59,\n\t\t90,\n\t\t120,\n\t\t151,\n\t\t181,\n\t\t212,\n\t\t243,\n\t\t273,\n\t\t304,\n\t\t334\n\t], Et = {}, xt = (e) => {\n\t\tif (e instanceof x || "unwind" == e) return c;\n\t\ti(0, e);\n\t}, Ot = () => I || Pt > 0, Rt = (e) => {\n\t\tc = e, Ot() || (n.onExit?.(e), k = !0), i(0, new x(e));\n\t}, jt = (e, t) => {\n\t\tc = e, Rt(e);\n\t}, Ut = (e) => {\n\t\tif (!k) try {\n\t\t\te(), (() => {\n\t\t\t\tif (!Ot()) try {\n\t\t\t\t\tjt(c);\n\t\t\t\t} catch (e) {\n\t\t\t\t\txt(e);\n\t\t\t\t}\n\t\t\t})();\n\t\t} catch (t) {\n\t\t\txt(t);\n\t\t}\n\t}, Ht = () => performance.now(), It = (e, t) => Math.ceil(e / t) * t, Vt = (e) => {\n\t\tvar t = (e - d.buffer.byteLength + 65535) / 65536 | 0;\n\t\ttry {\n\t\t\treturn d.grow(t), F(), 1;\n\t\t} catch {}\n\t}, Bt = {}, Mt = () => {\n\t\tif (!Mt.strings) {\n\t\t\tvar e = {\n\t\t\t\tUSER: "web_user",\n\t\t\t\tLOGNAME: "web_user",\n\t\t\t\tPATH: "/",\n\t\t\t\tPWD: "/",\n\t\t\t\tHOME: "/home/web_user",\n\t\t\t\tLANG: ("object" == typeof navigator && navigator.language || "C").replace("-", "_") + ".UTF-8",\n\t\t\t\t_: a || "./this.program"\n\t\t\t};\n\t\t\tfor (var t in Bt) void 0 === Bt[t] ? delete e[t] : e[t] = Bt[t];\n\t\t\tvar r = [];\n\t\t\tfor (var t in e) r.push(`${t}=${e[t]}`);\n\t\t\tMt.strings = r;\n\t\t}\n\t\treturn Mt.strings;\n\t}, qt = [\n\t\tnull,\n\t\t[],\n\t\t[]\n\t], Lt = (e, t) => {\n\t\tvar r = qt[e];\n\t\t0 === t || 10 === t ? ((1 === e ? P : C)(vt(r)), r.length = 0) : r.push(t);\n\t}, zt = (e) => n["_" + e], Nt = (e) => Ye(e), Jt = (e, t, r, n, a) => {\n\t\tvar i = {\n\t\t\tstring: (e) => {\n\t\t\t\tvar t = 0;\n\t\t\t\treturn null != e && 0 !== e && (t = ((e) => {\n\t\t\t\t\tvar t = dt(e) + 1, r = Nt(t);\n\t\t\t\t\treturn pt(e, r, t), r;\n\t\t\t\t})(e)), t;\n\t\t\t},\n\t\t\tarray: (e) => {\n\t\t\t\tvar t = Nt(e.length);\n\t\t\t\treturn ((e, t) => {\n\t\t\t\t\tf.set(e, t);\n\t\t\t\t})(e, t), t;\n\t\t\t}\n\t\t};\n\t\tvar o = zt(e), s = [], u = 0;\n\t\tif (n) for (var c = 0; c < n.length; c++) {\n\t\t\tvar l = i[r[c]];\n\t\t\tl ? (0 === u && (u = B()), s[c] = l(n[c])) : s[c] = n[c];\n\t\t}\n\t\tvar p, d = o(...s);\n\t\treturn p = d, 0 !== u && V(u), d = function(e) {\n\t\t\treturn "string" === t ? mt(e) : "boolean" === t ? !!e : e;\n\t\t}(p), d;\n\t};\n\tif ((() => {\n\t\tlet e = ce.prototype;\n\t\tObject.assign(e, {\n\t\t\tisAliasOf(e) {\n\t\t\t\tif (!(this instanceof ce && e instanceof ce)) return !1;\n\t\t\t\tvar t = this.$$.ptrType.registeredClass, r = this.$$.ptr;\n\t\t\t\te.$$ = e.$$;\n\t\t\t\tfor (var n = e.$$.ptrType.registeredClass, a = e.$$.ptr; t.baseClass;) r = t.upcast(r), t = t.baseClass;\n\t\t\t\tfor (; n.baseClass;) a = n.upcast(a), n = n.baseClass;\n\t\t\t\treturn t === n && r === a;\n\t\t\t},\n\t\t\tclone() {\n\t\t\t\tif (this.$$.ptr || ne(this), this.$$.preservePointerOnDelete) return this.$$.count.value += 1, this;\n\t\t\t\tvar e = se(Object.create(Object.getPrototypeOf(this), { $$: { value: re(this.$$) } }));\n\t\t\t\treturn e.$$.count.value += 1, e.$$.deleteScheduled = !1, e;\n\t\t\t},\n\t\t\tdelete() {\n\t\t\t\tthis.$$.ptr || ne(this), this.$$.deleteScheduled && !this.$$.preservePointerOnDelete && Q("Object already scheduled for deletion"), ie(this), oe(this.$$), this.$$.preservePointerOnDelete || (this.$$.smartPtr = void 0, this.$$.ptr = void 0);\n\t\t\t},\n\t\t\tisDeleted() {\n\t\t\t\treturn !this.$$.ptr;\n\t\t\t},\n\t\t\tdeleteLater() {\n\t\t\t\treturn this.$$.ptr || ne(this), this.$$.deleteScheduled && !this.$$.preservePointerOnDelete && Q("Object already scheduled for deletion"), ue.push(this), ue.length, this.$$.deleteScheduled = !0, this;\n\t\t\t}\n\t\t});\n\t\tconst t = Symbol.dispose;\n\t\tt && (e[t] = e.delete);\n\t})(), Object.assign(Fe.prototype, {\n\t\tgetPointee(e) {\n\t\t\treturn this.rawGetPointee && (e = this.rawGetPointee(e)), e;\n\t\t},\n\t\tdestructor(e) {\n\t\t\tthis.rawDestructor?.(e);\n\t\t},\n\t\treadValueFromPointer: we,\n\t\tfromWireType: Se\n\t}), n.noExitRuntime && (I = n.noExitRuntime), n.print && (P = n.print), n.printErr && (C = n.printErr), n.wasmBinary && (u = n.wasmBinary), n.arguments && n.arguments, n.thisProgram && (a = n.thisProgram), n.preInit) for ("function" == typeof n.preInit && (n.preInit = [n.preInit]); n.preInit.length > 0;) n.preInit.shift()();\n\tn.ENV = Bt, n.ccall = Jt, n.cwrap = (e, t, r, n) => {\n\t\tvar a = !r || r.every((e) => "number" === e || "boolean" === e);\n\t\treturn "string" !== t && a && !n ? zt(e) : (...n) => Jt(e, t, r, n);\n\t};\n\tvar Yt, Gt = {\n\t\t__cxa_begin_catch: (e) => {\n\t\t\tvar t = new z(e);\n\t\t\treturn t.get_caught() || (t.set_caught(!0), q--), t.set_rethrown(!1), M.push(t), Ze(e), Qe(e);\n\t\t},\n\t\t__cxa_end_catch: () => {\n\t\t\tze(0, 0);\n\t\t\tvar e = M.pop();\n\t\t\tXe(e.excPtr), L = 0;\n\t\t},\n\t\t__cxa_find_matching_catch_2: () => J([]),\n\t\t__cxa_find_matching_catch_3: (e) => J([e]),\n\t\t__cxa_find_matching_catch_4: (e, t) => J([e, t]),\n\t\t__cxa_rethrow: () => {\n\t\t\tvar e = M.pop();\n\t\t\te || A("no exception to throw");\n\t\t\tvar t = e.excPtr;\n\t\t\tthrow e.get_rethrown() || (M.push(e), e.set_rethrown(!0), e.set_caught(!1), q++), L = t;\n\t\t},\n\t\t__cxa_throw: (e, t, r) => {\n\t\t\tthrow new z(e).init(t, r), q++, L = e;\n\t\t},\n\t\t__cxa_uncaught_exceptions: () => q,\n\t\t__resumeException: (e) => {\n\t\t\tthrow L || (L = e), L;\n\t\t},\n\t\t_abort_js: () => A(""),\n\t\t_embind_register_bigint: (e, t, r, n, a) => {\n\t\t\tt = Y(t);\n\t\t\tconst i = 0n === n;\n\t\t\tlet o = (e) => e;\n\t\t\tif (i) {\n\t\t\t\tconst e = 8 * r;\n\t\t\t\to = (t) => BigInt.asUintN(e, t), a = o(a);\n\t\t\t}\n\t\t\tee(e, {\n\t\t\t\tname: t,\n\t\t\t\tfromWireType: o,\n\t\t\t\ttoWireType: (e, t) => ("number" == typeof t && (t = BigInt(t)), t),\n\t\t\t\treadValueFromPointer: te(t, r, !i),\n\t\t\t\tdestructorFunction: null\n\t\t\t});\n\t\t},\n\t\t_embind_register_bool: (e, t, r, n) => {\n\t\t\tee(e, {\n\t\t\t\tname: t = Y(t),\n\t\t\t\tfromWireType: function(e) {\n\t\t\t\t\treturn !!e;\n\t\t\t\t},\n\t\t\t\ttoWireType: function(e, t) {\n\t\t\t\t\treturn t ? r : n;\n\t\t\t\t},\n\t\t\t\treadValueFromPointer: function(e) {\n\t\t\t\t\treturn this.fromWireType(h[e]);\n\t\t\t\t},\n\t\t\t\tdestructorFunction: null\n\t\t\t});\n\t\t},\n\t\t_embind_register_class: (e, t, r, n, a, i, o, s, u, c, l, p, d) => {\n\t\t\tl = Y(l), i = xe(a, i), s &&= xe(o, s), c &&= xe(u, c), d = xe(p, d);\n\t\t\tvar f = ((e) => {\n\t\t\t\tvar t = (e = e.replace(/[^a-zA-Z0-9_]/g, "$")).charCodeAt(0);\n\t\t\t\treturn t >= 48 && t <= 57 ? `_${e}` : e;\n\t\t\t})(l);\n\t\t\tfe(f, function() {\n\t\t\t\tje(`Cannot construct ${l} due to unbound types`, [n]);\n\t\t\t}), Ue([\n\t\t\t\te,\n\t\t\t\tt,\n\t\t\t\tr\n\t\t\t], n ? [n] : [], (t) => {\n\t\t\t\tvar r, a;\n\t\t\t\tt = t[0], n ? a = (r = t.registeredClass).instancePrototype : a = ce.prototype;\n\t\t\t\tvar o = le(l, function(...e) {\n\t\t\t\t\tif (Object.getPrototypeOf(this) !== u) throw new K(`Use \'new\' to construct ${l}`);\n\t\t\t\t\tif (void 0 === p.constructor_body) throw new K(`${l} has no accessible constructor`);\n\t\t\t\t\tvar t = p.constructor_body[e.length];\n\t\t\t\t\tif (void 0 === t) throw new K(`Tried to invoke ctor of ${l} with invalid number of parameters (${e.length}) - expected (${Object.keys(p.constructor_body).toString()}) parameters instead!`);\n\t\t\t\t\treturn t.apply(this, e);\n\t\t\t\t}), u = Object.create(a, { constructor: { value: o } });\n\t\t\t\to.prototype = u;\n\t\t\t\tvar p = new he(l, o, u, d, r, i, s, c);\n\t\t\t\tp.baseClass && (p.baseClass.__derivedClasses ??= [], p.baseClass.__derivedClasses.push(p));\n\t\t\t\tvar h = new Fe(l, p, !0, !1, !1), v = new Fe(l + "*", p, !1, !1, !1), m = new Fe(l + " const*", p, !1, !0, !1);\n\t\t\t\treturn pe[e] = {\n\t\t\t\t\tpointerType: v,\n\t\t\t\t\tconstPointerType: m\n\t\t\t\t}, De(f, o), [\n\t\t\t\t\th,\n\t\t\t\t\tv,\n\t\t\t\t\tm\n\t\t\t\t];\n\t\t\t});\n\t\t},\n\t\t_embind_register_class_class_function: (e, t, r, n, a, i, o, s, u) => {\n\t\t\tvar c = et(r, n);\n\t\t\tt = Y(t), t = tt(t), i = xe(a, i, s), Ue([], [e], (e) => {\n\t\t\t\tvar n = `${(e = e[0]).name}.${t}`;\n\t\t\t\tfunction a() {\n\t\t\t\t\tje(`Cannot call ${n} due to unbound types`, c);\n\t\t\t\t}\n\t\t\t\tt.startsWith("@@") && (t = Symbol[t.substring(2)]);\n\t\t\t\tvar u = e.registeredClass.constructor;\n\t\t\t\treturn void 0 === u[t] ? (a.argCount = r - 1, u[t] = a) : (de(u, t, n), u[t].overloadTable[r - 1] = a), Ue([], c, (a) => {\n\t\t\t\t\tvar c = Ve(n, [a[0], null].concat(a.slice(1)), null, i, o, s);\n\t\t\t\t\tif (void 0 === u[t].overloadTable ? (c.argCount = r - 1, u[t] = c) : u[t].overloadTable[r - 1] = c, e.registeredClass.__derivedClasses) for (const r of e.registeredClass.__derivedClasses) r.constructor.hasOwnProperty(t) || (r.constructor[t] = c);\n\t\t\t\t\treturn [];\n\t\t\t\t}), [];\n\t\t\t});\n\t\t},\n\t\t_embind_register_class_constructor: (e, t, r, n, a, i) => {\n\t\t\tvar o = et(t, r);\n\t\t\ta = xe(n, a), Ue([], [e], (e) => {\n\t\t\t\tvar r = `constructor ${(e = e[0]).name}`;\n\t\t\t\tif (void 0 === e.registeredClass.constructor_body && (e.registeredClass.constructor_body = []), void 0 !== e.registeredClass.constructor_body[t - 1]) throw new K(`Cannot register multiple constructors with identical number of parameters (${t - 1}) for class \'${e.name}\'! Overload resolution is currently only performed using the parameter count, not actual type info!`);\n\t\t\t\treturn e.registeredClass.constructor_body[t - 1] = () => {\n\t\t\t\t\tje(`Cannot construct ${e.name} due to unbound types`, o);\n\t\t\t\t}, Ue([], o, (n) => (n.splice(1, 0, null), e.registeredClass.constructor_body[t - 1] = Ve(r, n, null, a, i), [])), [];\n\t\t\t});\n\t\t},\n\t\t_embind_register_class_function: (e, t, r, n, a, i, o, s, u, c) => {\n\t\t\tvar l = et(r, n);\n\t\t\tt = Y(t), t = tt(t), i = xe(a, i, u), Ue([], [e], (e) => {\n\t\t\t\tvar n = `${(e = e[0]).name}.${t}`;\n\t\t\t\tfunction a() {\n\t\t\t\t\tje(`Cannot call ${n} due to unbound types`, l);\n\t\t\t\t}\n\t\t\t\tt.startsWith("@@") && (t = Symbol[t.substring(2)]), s && e.registeredClass.pureVirtualFunctions.push(t);\n\t\t\t\tvar c = e.registeredClass.instancePrototype, p = c[t];\n\t\t\t\treturn void 0 === p || void 0 === p.overloadTable && p.className !== e.name && p.argCount === r - 2 ? (a.argCount = r - 2, a.className = e.name, c[t] = a) : (de(c, t, n), c[t].overloadTable[r - 2] = a), Ue([], l, (a) => {\n\t\t\t\t\tvar s = Ve(n, a, e, i, o, u);\n\t\t\t\t\treturn void 0 === c[t].overloadTable ? (s.argCount = r - 2, c[t] = s) : c[t].overloadTable[r - 2] = s, [];\n\t\t\t\t}), [];\n\t\t\t});\n\t\t},\n\t\t_embind_register_class_property: (e, t, r, n, a, i, o, s, u, c) => {\n\t\t\tt = Y(t), a = xe(n, a), Ue([], [e], (e) => {\n\t\t\t\tvar n = `${(e = e[0]).name}.${t}`, l = {\n\t\t\t\t\tget() {\n\t\t\t\t\t\tje(`Cannot access ${n} due to unbound types`, [r, o]);\n\t\t\t\t\t},\n\t\t\t\t\tenumerable: !0,\n\t\t\t\t\tconfigurable: !0\n\t\t\t\t};\n\t\t\t\treturn l.set = u ? () => je(`Cannot access ${n} due to unbound types`, [r, o]) : (e) => Q(n + " is a read-only property"), Object.defineProperty(e.registeredClass.instancePrototype, t, l), Ue([], u ? [r, o] : [r], (r) => {\n\t\t\t\t\tvar o = r[0], l = {\n\t\t\t\t\t\tget() {\n\t\t\t\t\t\t\tvar t = rt(this, e, n + " getter");\n\t\t\t\t\t\t\treturn o.fromWireType(a(i, t));\n\t\t\t\t\t\t},\n\t\t\t\t\t\tenumerable: !0\n\t\t\t\t\t};\n\t\t\t\t\tif (u) {\n\t\t\t\t\t\tu = xe(s, u);\n\t\t\t\t\t\tvar p = r[1];\n\t\t\t\t\t\tl.set = function(t) {\n\t\t\t\t\t\t\tvar r = rt(this, e, n + " setter"), a = [];\n\t\t\t\t\t\t\tu(c, r, p.toWireType(a, t)), He(a);\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t\treturn Object.defineProperty(e.registeredClass.instancePrototype, t, l), [];\n\t\t\t\t}), [];\n\t\t\t});\n\t\t},\n\t\t_embind_register_emval: (e) => ee(e, st),\n\t\t_embind_register_enum: (e, t, r, n) => {\n\t\t\tfunction a() {}\n\t\t\tt = Y(t), a.values = {}, ee(e, {\n\t\t\t\tname: t,\n\t\t\t\tconstructor: a,\n\t\t\t\tfromWireType: function(e) {\n\t\t\t\t\treturn this.constructor.values[e];\n\t\t\t\t},\n\t\t\t\ttoWireType: (e, t) => t.value,\n\t\t\t\treadValueFromPointer: ut(t, r, n),\n\t\t\t\tdestructorFunction: null\n\t\t\t}), fe(t, a);\n\t\t},\n\t\t_embind_register_enum_value: (e, t, r) => {\n\t\t\tvar n = ct(e, "enum");\n\t\t\tt = Y(t);\n\t\t\tvar a = n.constructor, i = Object.create(n.constructor.prototype, {\n\t\t\t\tvalue: { value: r },\n\t\t\t\tconstructor: { value: le(`${n.name}_${t}`, function() {}) }\n\t\t\t});\n\t\t\ta.values[r] = i, a[t] = i;\n\t\t},\n\t\t_embind_register_float: (e, t, r) => {\n\t\t\tee(e, {\n\t\t\t\tname: t = Y(t),\n\t\t\t\tfromWireType: (e) => e,\n\t\t\t\ttoWireType: (e, t) => t,\n\t\t\t\treadValueFromPointer: lt(t, r),\n\t\t\t\tdestructorFunction: null\n\t\t\t});\n\t\t},\n\t\t_embind_register_function: (e, t, r, n, a, i, o, s) => {\n\t\t\tvar u = et(t, r);\n\t\t\te = Y(e), e = tt(e), a = xe(n, a, o), fe(e, function() {\n\t\t\t\tje(`Cannot call ${e} due to unbound types`, u);\n\t\t\t}, t - 1), Ue([], u, (r) => {\n\t\t\t\tvar n = [r[0], null].concat(r.slice(1));\n\t\t\t\treturn De(e, Ve(e, n, null, a, i, o), t - 1), [];\n\t\t\t});\n\t\t},\n\t\t_embind_register_integer: (e, t, r, n, a) => {\n\t\t\tt = Y(t);\n\t\t\tlet i = (e) => e;\n\t\t\tif (0 === n) {\n\t\t\t\tvar o = 32 - 8 * r;\n\t\t\t\ti = (e) => e << o >>> o, a = i(a);\n\t\t\t}\n\t\t\tee(e, {\n\t\t\t\tname: t,\n\t\t\t\tfromWireType: i,\n\t\t\t\ttoWireType: (e, t) => t,\n\t\t\t\treadValueFromPointer: te(t, r, 0 !== n),\n\t\t\t\tdestructorFunction: null\n\t\t\t});\n\t\t},\n\t\t_embind_register_memory_view: (e, t, r) => {\n\t\t\tvar n = [\n\t\t\t\tInt8Array,\n\t\t\t\tUint8Array,\n\t\t\t\tInt16Array,\n\t\t\t\tUint16Array,\n\t\t\t\tInt32Array,\n\t\t\t\tUint32Array,\n\t\t\t\tFloat32Array,\n\t\t\t\tFloat64Array,\n\t\t\t\tBigInt64Array,\n\t\t\t\tBigUint64Array\n\t\t\t][t];\n\t\t\tfunction a(e) {\n\t\t\t\tvar t = g[e >> 2], r = g[e + 4 >> 2];\n\t\t\t\treturn new n(f.buffer, r, t);\n\t\t\t}\n\t\t\tee(e, {\n\t\t\t\tname: r = Y(r),\n\t\t\t\tfromWireType: a,\n\t\t\t\treadValueFromPointer: a\n\t\t\t}, { ignoreDuplicateRegistrations: !0 });\n\t\t},\n\t\t_embind_register_std_string: (e, t) => {\n\t\t\tt = Y(t);\n\t\t\tee(e, {\n\t\t\t\tname: t,\n\t\t\t\tfromWireType(e) {\n\t\t\t\t\tvar t, r = g[e >> 2];\n\t\t\t\t\treturn t = mt(e + 4, r, !0), qe(e), t;\n\t\t\t\t},\n\t\t\t\ttoWireType(e, t) {\n\t\t\t\t\tt instanceof ArrayBuffer && (t = new Uint8Array(t));\n\t\t\t\t\tvar r, n = "string" == typeof t;\n\t\t\t\t\tn || ArrayBuffer.isView(t) && 1 == t.BYTES_PER_ELEMENT || Q("Cannot pass non-string to std::string"), r = n ? dt(t) : t.length;\n\t\t\t\t\tvar a = Me(4 + r + 1), i = a + 4;\n\t\t\t\t\t(g[a >> 2] = r, n) ? pt(t, i, r + 1) : h.set(t, i);\n\t\t\t\t\treturn null !== e && e.push(qe, a), a;\n\t\t\t\t},\n\t\t\t\treadValueFromPointer: we,\n\t\t\t\tdestructorFunction(e) {\n\t\t\t\t\tqe(e);\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\t_embind_register_std_wstring: (e, t, r) => {\n\t\t\tvar n, a, i;\n\t\t\tr = Y(r), 2 === t ? (n = gt, a = _t, i = wt) : (n = $t, a = bt, i = Tt), ee(e, {\n\t\t\t\tname: r,\n\t\t\t\tfromWireType: (e) => {\n\t\t\t\t\tvar r = g[e >> 2], a = n(e + 4, r * t, !0);\n\t\t\t\t\treturn qe(e), a;\n\t\t\t\t},\n\t\t\t\ttoWireType: (e, n) => {\n\t\t\t\t\t"string" != typeof n && Q(`Cannot pass non-string to C++ string type ${r}`);\n\t\t\t\t\tvar o = i(n), s = Me(4 + o + t);\n\t\t\t\t\treturn g[s >> 2] = o / t, a(n, s + 4, o + t), null !== e && e.push(qe, s), s;\n\t\t\t\t},\n\t\t\t\treadValueFromPointer: we,\n\t\t\t\tdestructorFunction(e) {\n\t\t\t\t\tqe(e);\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\t_embind_register_void: (e, t) => {\n\t\t\tee(e, {\n\t\t\t\tisVoid: !0,\n\t\t\t\tname: t = Y(t),\n\t\t\t\tfromWireType: () => {},\n\t\t\t\ttoWireType: (e, t) => {}\n\t\t\t});\n\t\t},\n\t\t_emscripten_runtime_keepalive_clear: () => {\n\t\t\tI = !1, Pt = 0;\n\t\t},\n\t\t_emval_create_invoker: (e, t, r) => {\n\t\t\tvar [n, ...a] = ((e, t) => {\n\t\t\t\tfor (var r = new Array(e), n = 0; n < e; ++n) r[n] = ct(g[t + 4 * n >> 2], `parameter ${n}`);\n\t\t\t\treturn r;\n\t\t\t})(e, t), i = n.toWireType.bind(n), o = a.map((e) => e.readValueFromPointer.bind(e));\n\t\t\te--;\n\t\t\tvar s, u = { toValue: ot.toValue }, c = o.map((e, t) => {\n\t\t\t\tvar r = `argFromPtr${t}`;\n\t\t\t\treturn u[r] = e, `${r}(args${t ? "+" + 8 * t : ""})`;\n\t\t\t});\n\t\t\tswitch (r) {\n\t\t\t\tcase 0:\n\t\t\t\t\ts = "toValue(handle)";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\ts = "new (toValue(handle))";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\ts = "";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1: u.getStringOrSymbol = Ft, s = "toValue(handle)[getStringOrSymbol(methodName)]";\n\t\t\t}\n\t\t\ts += `(${c})`, n.isVoid || (u.toReturnWire = i, u.emval_returnValue = kt, s = `return emval_returnValue(toReturnWire, destructorsRef, ${s})`), s = `return function (handle, methodName, destructorsRef, args) {\\n ${s}\\n }`;\n\t\t\tvar l = new Function(Object.keys(u), s)(...Object.values(u));\n\t\t\treturn ((e) => {\n\t\t\t\tvar t = Ct.length;\n\t\t\t\treturn Ct.push(e), t;\n\t\t\t})(le(`methodCaller<(${a.map((e) => e.name)}) => ${n.name}>`, l));\n\t\t},\n\t\t_emval_decref: it,\n\t\t_emval_invoke: (e, t, r, n, a) => Ct[e](t, r, n, a),\n\t\t_emval_new_object: () => ot.toHandle({}),\n\t\t_emval_run_destructors: (e) => {\n\t\t\tHe(ot.toValue(e)), it(e);\n\t\t},\n\t\t_emval_set_property: (e, t, r) => {\n\t\t\te = ot.toValue(e), t = ot.toValue(t), r = ot.toValue(r), e[t] = r;\n\t\t},\n\t\t_gmtime_js: function(e, t) {\n\t\t\te = At(e);\n\t\t\tvar r = /* @__PURE__ */ new Date(1e3 * e);\n\t\t\ty[t >> 2] = r.getUTCSeconds(), y[t + 4 >> 2] = r.getUTCMinutes(), y[t + 8 >> 2] = r.getUTCHours(), y[t + 12 >> 2] = r.getUTCDate(), y[t + 16 >> 2] = r.getUTCMonth(), y[t + 20 >> 2] = r.getUTCFullYear() - 1900, y[t + 24 >> 2] = r.getUTCDay();\n\t\t\tvar n = Date.UTC(r.getUTCFullYear(), 0, 1, 0, 0, 0, 0), a = (r.getTime() - n) / 864e5 | 0;\n\t\t\ty[t + 28 >> 2] = a;\n\t\t},\n\t\t_localtime_js: function(e, t) {\n\t\t\te = At(e);\n\t\t\tvar r = /* @__PURE__ */ new Date(1e3 * e);\n\t\t\ty[t >> 2] = r.getSeconds(), y[t + 4 >> 2] = r.getMinutes(), y[t + 8 >> 2] = r.getHours(), y[t + 12 >> 2] = r.getDate(), y[t + 16 >> 2] = r.getMonth(), y[t + 20 >> 2] = r.getFullYear() - 1900, y[t + 24 >> 2] = r.getDay();\n\t\t\tvar n = 0 | ((e) => (((e) => e % 4 == 0 && (e % 100 != 0 || e % 400 == 0))(e.getFullYear()) ? Dt : Wt)[e.getMonth()] + e.getDate() - 1)(r);\n\t\t\ty[t + 28 >> 2] = n, y[t + 36 >> 2] = -60 * r.getTimezoneOffset();\n\t\t\tvar a = new Date(r.getFullYear(), 0, 1), i = new Date(r.getFullYear(), 6, 1).getTimezoneOffset(), o = a.getTimezoneOffset(), s = 0 | (i != o && r.getTimezoneOffset() == Math.min(o, i));\n\t\t\ty[t + 32 >> 2] = s;\n\t\t},\n\t\t_setitimer_js: (e, t) => (Et[e] && (clearTimeout(Et[e].id), delete Et[e]), t ? (Et[e] = {\n\t\t\tid: setTimeout(() => {\n\t\t\t\tdelete Et[e], Ut(() => Le(e, Ht()));\n\t\t\t}, t),\n\t\t\ttimeout_ms: t\n\t\t}, 0) : 0),\n\t\t_tzset_js: (e, t, r, n) => {\n\t\t\tvar a = /* @__PURE__ */ (/* @__PURE__ */ new Date()).getFullYear(), i = new Date(a, 0, 1), o = new Date(a, 6, 1), s = i.getTimezoneOffset(), u = o.getTimezoneOffset(), c = Math.max(s, u);\n\t\t\tg[e >> 2] = 60 * c, y[t >> 2] = +(s != u);\n\t\t\tvar l = (e) => {\n\t\t\t\tvar t = e >= 0 ? "-" : "+", r = Math.abs(e);\n\t\t\t\treturn `UTC${t}${String(Math.floor(r / 60)).padStart(2, "0")}${String(r % 60).padStart(2, "0")}`;\n\t\t\t}, p = l(s), d = l(u);\n\t\t\tu < s ? (pt(p, r, 17), pt(d, n, 17)) : (pt(p, n, 17), pt(d, r, 17));\n\t\t},\n\t\tclock_time_get: function(e, t, r) {\n\t\t\tif (t = At(t), !((e) => e >= 0 && e <= 3)(e)) return 28;\n\t\t\tvar n = 0 === e ? Date.now() : Ht();\n\t\t\tvar a = Math.round(1e3 * n * 1e3);\n\t\t\treturn $[r >> 3] = BigInt(a), 0;\n\t\t},\n\t\temscripten_get_heap_max: () => 2147483648,\n\t\temscripten_resize_heap: (e) => {\n\t\t\tvar t = h.length, r = 2147483648;\n\t\t\tif ((e >>>= 0) > r) return !1;\n\t\t\tfor (var n = 1; n <= 4; n *= 2) {\n\t\t\t\tvar a = t * (1 + .2 / n);\n\t\t\t\tif (a = Math.min(a, e + 100663296), Vt(Math.min(r, It(Math.max(e, a), 65536)))) return !0;\n\t\t\t}\n\t\t\treturn !1;\n\t\t},\n\t\tenviron_get: (e, t) => {\n\t\t\tvar r = 0, n = 0;\n\t\t\tfor (var a of Mt()) {\n\t\t\t\tvar i = t + r;\n\t\t\t\tg[e + n >> 2] = i, r += pt(a, i, 1 / 0) + 1, n += 4;\n\t\t\t}\n\t\t\treturn 0;\n\t\t},\n\t\tenviron_sizes_get: (e, t) => {\n\t\t\tvar r = Mt();\n\t\t\tg[e >> 2] = r.length;\n\t\t\tvar n = 0;\n\t\t\tfor (var a of r) n += dt(a) + 1;\n\t\t\treturn g[t >> 2] = n, 0;\n\t\t},\n\t\tfd_close: (e) => 52,\n\t\tfd_fdstat_get: (e, t) => {\n\t\t\tvar r = 0;\n\t\t\treturn 0 == e ? r = 2 : (1 == e || 2 == e) && (r = 64), f[t] = 2, v[t + 2 >> 1] = 1, $[t + 8 >> 3] = BigInt(r), $[t + 16 >> 3] = BigInt(0), 0;\n\t\t},\n\t\tfd_seek: function(e, t, r, n) {\n\t\t\treturn t = At(t), 70;\n\t\t},\n\t\tfd_write: (e, t, r, n) => {\n\t\t\tfor (var a = 0, i = 0; i < r; i++) {\n\t\t\t\tvar o = g[t >> 2], s = g[t + 4 >> 2];\n\t\t\t\tt += 8;\n\t\t\t\tfor (var u = 0; u < s; u++) Lt(e, h[o + u]);\n\t\t\t\ta += s;\n\t\t\t}\n\t\t\treturn g[n >> 2] = a, 0;\n\t\t},\n\t\tinvoke_diii: function(e, t, r, n) {\n\t\t\tvar a = B();\n\t\t\ttry {\n\t\t\t\treturn Ee(e)(t, r, n);\n\t\t\t} catch (i) {\n\t\t\t\tif (V(a), i !== i + 0) throw i;\n\t\t\t\tze(1, 0);\n\t\t\t}\n\t\t},\n\t\tinvoke_fi: function(e, t) {\n\t\t\tvar r = B();\n\t\t\ttry {\n\t\t\t\treturn Ee(e)(t);\n\t\t\t} catch (n) {\n\t\t\t\tif (V(r), n !== n + 0) throw n;\n\t\t\t\tze(1, 0);\n\t\t\t}\n\t\t},\n\t\tinvoke_fiii: function(e, t, r, n) {\n\t\t\tvar a = B();\n\t\t\ttry {\n\t\t\t\treturn Ee(e)(t, r, n);\n\t\t\t} catch (i) {\n\t\t\t\tif (V(a), i !== i + 0) throw i;\n\t\t\t\tze(1, 0);\n\t\t\t}\n\t\t},\n\t\tinvoke_i: function(e) {\n\t\t\tvar t = B();\n\t\t\ttry {\n\t\t\t\treturn Ee(e)();\n\t\t\t} catch (r) {\n\t\t\t\tif (V(t), r !== r + 0) throw r;\n\t\t\t\tze(1, 0);\n\t\t\t}\n\t\t},\n\t\tinvoke_ii: function(e, t) {\n\t\t\tvar r = B();\n\t\t\ttry {\n\t\t\t\treturn Ee(e)(t);\n\t\t\t} catch (n) {\n\t\t\t\tif (V(r), n !== n + 0) throw n;\n\t\t\t\tze(1, 0);\n\t\t\t}\n\t\t},\n\t\tinvoke_iii: function(e, t, r) {\n\t\t\tvar n = B();\n\t\t\ttry {\n\t\t\t\treturn Ee(e)(t, r);\n\t\t\t} catch (a) {\n\t\t\t\tif (V(n), a !== a + 0) throw a;\n\t\t\t\tze(1, 0);\n\t\t\t}\n\t\t},\n\t\tinvoke_iiii: function(e, t, r, n) {\n\t\t\tvar a = B();\n\t\t\ttry {\n\t\t\t\treturn Ee(e)(t, r, n);\n\t\t\t} catch (i) {\n\t\t\t\tif (V(a), i !== i + 0) throw i;\n\t\t\t\tze(1, 0);\n\t\t\t}\n\t\t},\n\t\tinvoke_iiiid: function(e, t, r, n, a) {\n\t\t\tvar i = B();\n\t\t\ttry {\n\t\t\t\treturn Ee(e)(t, r, n, a);\n\t\t\t} catch (o) {\n\t\t\t\tif (V(i), o !== o + 0) throw o;\n\t\t\t\tze(1, 0);\n\t\t\t}\n\t\t},\n\t\tinvoke_iiiii: function(e, t, r, n, a) {\n\t\t\tvar i = B();\n\t\t\ttry {\n\t\t\t\treturn Ee(e)(t, r, n, a);\n\t\t\t} catch (o) {\n\t\t\t\tif (V(i), o !== o + 0) throw o;\n\t\t\t\tze(1, 0);\n\t\t\t}\n\t\t},\n\t\tinvoke_iiiiid: function(e, t, r, n, a, i) {\n\t\t\tvar o = B();\n\t\t\ttry {\n\t\t\t\treturn Ee(e)(t, r, n, a, i);\n\t\t\t} catch (s) {\n\t\t\t\tif (V(o), s !== s + 0) throw s;\n\t\t\t\tze(1, 0);\n\t\t\t}\n\t\t},\n\t\tinvoke_iiiiii: function(e, t, r, n, a, i) {\n\t\t\tvar o = B();\n\t\t\ttry {\n\t\t\t\treturn Ee(e)(t, r, n, a, i);\n\t\t\t} catch (s) {\n\t\t\t\tif (V(o), s !== s + 0) throw s;\n\t\t\t\tze(1, 0);\n\t\t\t}\n\t\t},\n\t\tinvoke_iiiiiii: function(e, t, r, n, a, i, o) {\n\t\t\tvar s = B();\n\t\t\ttry {\n\t\t\t\treturn Ee(e)(t, r, n, a, i, o);\n\t\t\t} catch (u) {\n\t\t\t\tif (V(s), u !== u + 0) throw u;\n\t\t\t\tze(1, 0);\n\t\t\t}\n\t\t},\n\t\tinvoke_iiiiiiii: function(e, t, r, n, a, i, o, s) {\n\t\t\tvar u = B();\n\t\t\ttry {\n\t\t\t\treturn Ee(e)(t, r, n, a, i, o, s);\n\t\t\t} catch (c) {\n\t\t\t\tif (V(u), c !== c + 0) throw c;\n\t\t\t\tze(1, 0);\n\t\t\t}\n\t\t},\n\t\tinvoke_iiiiiiiiii: function(e, t, r, n, a, i, o, s, u, c) {\n\t\t\tvar l = B();\n\t\t\ttry {\n\t\t\t\treturn Ee(e)(t, r, n, a, i, o, s, u, c);\n\t\t\t} catch (p) {\n\t\t\t\tif (V(l), p !== p + 0) throw p;\n\t\t\t\tze(1, 0);\n\t\t\t}\n\t\t},\n\t\tinvoke_iiiiiiiiiii: function(e, t, r, n, a, i, o, s, u, c, l) {\n\t\t\tvar p = B();\n\t\t\ttry {\n\t\t\t\treturn Ee(e)(t, r, n, a, i, o, s, u, c, l);\n\t\t\t} catch (d) {\n\t\t\t\tif (V(p), d !== d + 0) throw d;\n\t\t\t\tze(1, 0);\n\t\t\t}\n\t\t},\n\t\tinvoke_iiiiiiiiiiii: function(e, t, r, n, a, i, o, s, u, c, l, p) {\n\t\t\tvar d = B();\n\t\t\ttry {\n\t\t\t\treturn Ee(e)(t, r, n, a, i, o, s, u, c, l, p);\n\t\t\t} catch (f) {\n\t\t\t\tif (V(d), f !== f + 0) throw f;\n\t\t\t\tze(1, 0);\n\t\t\t}\n\t\t},\n\t\tinvoke_iiiiijj: function(e, t, r, n, a, i, o) {\n\t\t\tvar s = B();\n\t\t\ttry {\n\t\t\t\treturn Ee(e)(t, r, n, a, i, o);\n\t\t\t} catch (u) {\n\t\t\t\tif (V(s), u !== u + 0) throw u;\n\t\t\t\tze(1, 0);\n\t\t\t}\n\t\t},\n\t\tinvoke_iiiijj: function(e, t, r, n, a, i) {\n\t\t\tvar o = B();\n\t\t\ttry {\n\t\t\t\treturn Ee(e)(t, r, n, a, i);\n\t\t\t} catch (s) {\n\t\t\t\tif (V(o), s !== s + 0) throw s;\n\t\t\t\tze(1, 0);\n\t\t\t}\n\t\t},\n\t\tinvoke_iiij: function(e, t, r, n) {\n\t\t\tvar a = B();\n\t\t\ttry {\n\t\t\t\treturn Ee(e)(t, r, n);\n\t\t\t} catch (i) {\n\t\t\t\tif (V(a), i !== i + 0) throw i;\n\t\t\t\tze(1, 0);\n\t\t\t}\n\t\t},\n\t\tinvoke_j: function(e) {\n\t\t\tvar t = B();\n\t\t\ttry {\n\t\t\t\treturn Ee(e)();\n\t\t\t} catch (r) {\n\t\t\t\tif (V(t), r !== r + 0) throw r;\n\t\t\t\treturn ze(1, 0), 0n;\n\t\t\t}\n\t\t},\n\t\tinvoke_jiiii: function(e, t, r, n, a) {\n\t\t\tvar i = B();\n\t\t\ttry {\n\t\t\t\treturn Ee(e)(t, r, n, a);\n\t\t\t} catch (o) {\n\t\t\t\tif (V(i), o !== o + 0) throw o;\n\t\t\t\treturn ze(1, 0), 0n;\n\t\t\t}\n\t\t},\n\t\tinvoke_v: function(e) {\n\t\t\tvar t = B();\n\t\t\ttry {\n\t\t\t\tEe(e)();\n\t\t\t} catch (r) {\n\t\t\t\tif (V(t), r !== r + 0) throw r;\n\t\t\t\tze(1, 0);\n\t\t\t}\n\t\t},\n\t\tinvoke_vi: function(e, t) {\n\t\t\tvar r = B();\n\t\t\ttry {\n\t\t\t\tEe(e)(t);\n\t\t\t} catch (n) {\n\t\t\t\tif (V(r), n !== n + 0) throw n;\n\t\t\t\tze(1, 0);\n\t\t\t}\n\t\t},\n\t\tinvoke_vii: function(e, t, r) {\n\t\t\tvar n = B();\n\t\t\ttry {\n\t\t\t\tEe(e)(t, r);\n\t\t\t} catch (a) {\n\t\t\t\tif (V(n), a !== a + 0) throw a;\n\t\t\t\tze(1, 0);\n\t\t\t}\n\t\t},\n\t\tinvoke_viii: function(e, t, r, n) {\n\t\t\tvar a = B();\n\t\t\ttry {\n\t\t\t\tEe(e)(t, r, n);\n\t\t\t} catch (i) {\n\t\t\t\tif (V(a), i !== i + 0) throw i;\n\t\t\t\tze(1, 0);\n\t\t\t}\n\t\t},\n\t\tinvoke_viiii: function(e, t, r, n, a) {\n\t\t\tvar i = B();\n\t\t\ttry {\n\t\t\t\tEe(e)(t, r, n, a);\n\t\t\t} catch (o) {\n\t\t\t\tif (V(i), o !== o + 0) throw o;\n\t\t\t\tze(1, 0);\n\t\t\t}\n\t\t},\n\t\tinvoke_viiiii: function(e, t, r, n, a, i) {\n\t\t\tvar o = B();\n\t\t\ttry {\n\t\t\t\tEe(e)(t, r, n, a, i);\n\t\t\t} catch (s) {\n\t\t\t\tif (V(o), s !== s + 0) throw s;\n\t\t\t\tze(1, 0);\n\t\t\t}\n\t\t},\n\t\tinvoke_viiiiii: function(e, t, r, n, a, i, o) {\n\t\t\tvar s = B();\n\t\t\ttry {\n\t\t\t\tEe(e)(t, r, n, a, i, o);\n\t\t\t} catch (u) {\n\t\t\t\tif (V(s), u !== u + 0) throw u;\n\t\t\t\tze(1, 0);\n\t\t\t}\n\t\t},\n\t\tinvoke_viiiiiii: function(e, t, r, n, a, i, o, s) {\n\t\t\tvar u = B();\n\t\t\ttry {\n\t\t\t\tEe(e)(t, r, n, a, i, o, s);\n\t\t\t} catch (c) {\n\t\t\t\tif (V(u), c !== c + 0) throw c;\n\t\t\t\tze(1, 0);\n\t\t\t}\n\t\t},\n\t\tinvoke_viiiiiiii: function(e, t, r, n, a, i, o, s, u) {\n\t\t\tvar c = B();\n\t\t\ttry {\n\t\t\t\tEe(e)(t, r, n, a, i, o, s, u);\n\t\t\t} catch (l) {\n\t\t\t\tif (V(c), l !== l + 0) throw l;\n\t\t\t\tze(1, 0);\n\t\t\t}\n\t\t},\n\t\tinvoke_viiiiiiiiii: function(e, t, r, n, a, i, o, s, u, c, l) {\n\t\t\tvar p = B();\n\t\t\ttry {\n\t\t\t\tEe(e)(t, r, n, a, i, o, s, u, c, l);\n\t\t\t} catch (d) {\n\t\t\t\tif (V(p), d !== d + 0) throw d;\n\t\t\t\tze(1, 0);\n\t\t\t}\n\t\t},\n\t\tinvoke_viiiiiiiiiiiiiii: function(e, t, r, n, a, i, o, s, u, c, l, p, d, f, h, v) {\n\t\t\tvar m = B();\n\t\t\ttry {\n\t\t\t\tEe(e)(t, r, n, a, i, o, s, u, c, l, p, d, f, h, v);\n\t\t\t} catch (y) {\n\t\t\t\tif (V(m), y !== y + 0) throw y;\n\t\t\t\tze(1, 0);\n\t\t\t}\n\t\t},\n\t\tinvoke_viiji: function(e, t, r, n, a) {\n\t\t\tvar i = B();\n\t\t\ttry {\n\t\t\t\tEe(e)(t, r, n, a);\n\t\t\t} catch (o) {\n\t\t\t\tif (V(i), o !== o + 0) throw o;\n\t\t\t\tze(1, 0);\n\t\t\t}\n\t\t},\n\t\tinvoke_viijii: function(e, t, r, n, a, i) {\n\t\t\tvar o = B();\n\t\t\ttry {\n\t\t\t\tEe(e)(t, r, n, a, i);\n\t\t\t} catch (s) {\n\t\t\t\tif (V(o), s !== s + 0) throw s;\n\t\t\t\tze(1, 0);\n\t\t\t}\n\t\t},\n\t\tllvm_eh_typeid_for: (e) => e,\n\t\tproc_exit: Rt\n\t};\n\treturn Yt = await async function() {\n\t\tfunction e(e, t) {\n\t\t\treturn Yt = e.exports, d = Yt.memory, F(), Ae = Yt.__indirect_function_table, function(e) {\n\t\t\t\tBe = e.__getTypeName, n._malloc = Me = e.malloc, n._parseDropFile = e.parseDropFile, n._getAttributeFromDropFile = e.getAttributeFromDropFile, n._takeAttributeFromDropFile = e.takeAttributeFromDropFile, n._flattenDropFile = e.flattenDropFile, n._destroyDropFileHandle = e.destroyDropFileHandle, e.__cxa_free_exception, n._free = qe = e.free, Le = e._emscripten_timeout, ze = e.setThrew, Ne = e._emscripten_tempret_set, Je = e._emscripten_stack_restore, Ye = e._emscripten_stack_alloc, Ge = e.emscripten_stack_get_current, Xe = e.__cxa_decrement_exception_refcount, Ze = e.__cxa_increment_exception_refcount, Ke = e.__cxa_can_catch, Qe = e.__cxa_get_exception_ptr;\n\t\t\t}(Yt), Yt;\n\t\t}\n\t\tvar t = {\n\t\t\tenv: Gt,\n\t\t\twasi_snapshot_preview1: Gt\n\t\t};\n\t\treturn n.instantiateWasm ? new Promise((r, a) => {\n\t\t\tn.instantiateWasm(t, (t, n) => {\n\t\t\t\tr(e(t));\n\t\t\t});\n\t\t}) : (T ??= D(), e((await E(u, T, t)).instance));\n\t}(), function() {\n\t\tfunction e() {\n\t\t\tn.calledRun = !0, !k && (S = !0, Yt.__wasm_call_ctors(), l?.(n), n.onRuntimeInitialized?.(), function() {\n\t\t\t\tif (n.postRun) for ("function" == typeof n.postRun && (n.postRun = [n.postRun]); n.postRun.length;) j(n.postRun.shift());\n\t\t\t\tO(R);\n\t\t\t}());\n\t\t}\n\t\t(function() {\n\t\t\tif (n.preRun) for ("function" == typeof n.preRun && (n.preRun = [n.preRun]); n.preRun.length;) H(n.preRun.shift());\n\t\t\tO(U);\n\t\t})(), n.setStatus ? (n.setStatus("Running..."), setTimeout(() => {\n\t\t\tsetTimeout(() => n.setStatus(""), 1), e();\n\t\t}, 1)) : e();\n\t}(), S ? n : new Promise((e, t) => {\n\t\tl = e, p = t;\n\t});\n}({ wasmBinary: r }), a = /* @__PURE__ */ new Map(), i = {\n\tget AttributeInfo() {\n\t\treturn n.AttributeInfo;\n\t},\n\tget AquaStatus() {\n\t\treturn n.AquaStatus;\n\t},\n\tget heapU8() {\n\t\treturn n.HEAPU8;\n\t},\n\tget heapU32() {\n\t\treturn n.HEAPU32;\n\t},\n\tget SceneRequestDescriptor() {\n\t\treturn n.SceneRequestDescriptor;\n\t},\n\tget WorkerDataType() {\n\t\treturn n.WorkerDataType;\n\t},\n\tdataPtrView: (e) => n.dataPtrView(e),\n\tfree: (...e) => n.ccall("free", "number", ["number"], e),\n\tmalloc: (...e) => n.ccall("malloc", "number", ["number"], e),\n\tparseDropFile: (e, t) => n.parseDropFile(e, t),\n\tgetAttributeFromDropFile: (e, t, r) => n.getAttributeFromDropFile(e, t, r),\n\ttakeAttributeFromDropFile: (e, t, r) => n.takeAttributeFromDropFile(e, t, r),\n\tflattenDropFile: (e, t, r) => n.flattenDropFile(e, t, r),\n\tdestroyDropFileHandle: (e) => n.destroyDropFileHandle(e)\n};\nvar o = {\n\tasync cancel(e, t) {\n\t\tconst r = `${t}-${e}`, n = a.get(r);\n\t\treturn n && (n.abort(), a.delete(r)), [{ cancelled: !!n }];\n\t},\n\theapSnapshot: async (e) => "function" != typeof n.TakeHeapSnapshot ? [{ snapshotJson: null }] : [{ snapshotJson: n.TakeHeapSnapshot(e) }],\n\theapTrackingControl: async (e) => "function" != typeof n.SetHeapTrackingEnabled ? [{ success: !1 }] : (n.SetHeapTrackingEnabled(e), [{ success: !0 }]),\n\theapTrackingReset: async () => "function" != typeof n.ResetHeapTracking ? [{ success: !1 }] : (n.ResetHeapTracking(), [{ success: !0 }]),\n\tasync decode(r, o, s, u, c, l) {\n\t\tconst p = `${o}-${r}`, d = new AbortController();\n\t\ta.set(p, d);\n\t\ttry {\n\t\t\tconst { free: a, malloc: p, parseDropFile: h, getAttributeFromDropFile: v, takeAttributeFromDropFile: m, flattenDropFile: y, destroyDropFileHandle: g } = i, _ = s.byteLength, w = p(_);\n\t\t\ti.heapU8.set(new Uint8Array(s), w);\n\t\t\tconst $ = n.SceneRequestDescriptor.deserializeFromBinary(w, _);\n\t\t\ta(w);\n\t\t\tlet b = $.getUrl();\n\t\t\tif (l) {\n\t\t\t\tconst e = new URL(b);\n\t\t\t\te.searchParams.delete("jwt"), b = e.toString();\n\t\t\t}\n\t\t\tconst T = $.getBody() || null, P = T ? "POST" : "GET", C = $.getHeaders();\n\t\t\t$.delete();\n\t\t\tconst k = performance.now(), S = await fetch(b, {\n\t\t\t\tmethod: P,\n\t\t\t\theaders: C,\n\t\t\t\tbody: T,\n\t\t\t\tsignal: d.signal\n\t\t\t}), F = JSON.stringify({ "x-cache": S.headers.get("x-cache") ?? "" });\n\t\t\tif (!S.ok) {\n\t\t\t\tconst e = performance.now() - k;\n\t\t\t\treturn [{\n\t\t\t\t\trequestIdLow: r,\n\t\t\t\t\trequestIdHigh: o,\n\t\t\t\t\tresultBuffer: /* @__PURE__ */ new ArrayBuffer(0),\n\t\t\t\t\tsuccess: !1,\n\t\t\t\t\tparsed: !1,\n\t\t\t\t\terror: `HTTP error! status: ${S.status}`,\n\t\t\t\t\tdataType: n.WorkerDataType.Raw.value,\n\t\t\t\t\tcontextPtr: u,\n\t\t\t\t\tattributes: [],\n\t\t\t\t\tduration: e,\n\t\t\t\t\tttfb: e,\n\t\t\t\t\thttpStatus: S.status,\n\t\t\t\t\tresponseHeadersJson: F\n\t\t\t\t}, { transfer: [] }];\n\t\t\t}\n\t\t\tconst A = performance.now() - k, D = await S.arrayBuffer(), W = performance.now() - k, E = [];\n\t\t\tif (!b.split(/[?#]/, 1)[0].endsWith(".drop")) return [{\n\t\t\t\trequestIdLow: r,\n\t\t\t\trequestIdHigh: o,\n\t\t\t\tresultBuffer: D,\n\t\t\t\tsuccess: !0,\n\t\t\t\tparsed: !1,\n\t\t\t\terror: void 0,\n\t\t\t\tdataType: n.WorkerDataType.Raw.value,\n\t\t\t\tcontextPtr: u,\n\t\t\t\tattributes: E,\n\t\t\t\tduration: W,\n\t\t\t\tttfb: A,\n\t\t\t\thttpStatus: S.status,\n\t\t\t\tresponseHeadersJson: F\n\t\t\t}, { transfer: [D] }];\n\t\t\tconst x = D.byteLength, O = p(x);\n\t\t\ti.heapU8.set(new Uint8Array(D), O);\n\t\t\tconst R = p(4), j = p(4);\n\t\t\ti.heapU32[R / 4] = 0, i.heapU32[j / 4] = 0;\n\t\t\tlet U = 0, H = 0;\n\t\t\tconst I = new i.AttributeInfo();\n\t\t\ttry {\n\t\t\t\tif (U = h(O, x), 0 === U) throw new Error("parseDropFile failed");\n\t\t\t\tlet a = c;\n\t\t\t\tfor (const [r, n] of Object.entries(e)) {\n\t\t\t\t\tif (n.discard) m(U, r, a);\n\t\t\t\t\telse if (v(U, r, I) === i.AquaStatus.Success) {\n\t\t\t\t\t\tconst e = t(r, a, i.dataPtrView(I));\n\t\t\t\t\t\tm(U, r, a) === i.AquaStatus.Success && E.push(e);\n\t\t\t\t\t}\n\t\t\t\t\ta++;\n\t\t\t\t}\n\t\t\t\tif (y(U, R, j) !== i.AquaStatus.Success) throw new Error("flattenDropFile failed");\n\t\t\t\tH = i.heapU32[R / 4];\n\t\t\t\tconst s = i.heapU32[j / 4];\n\t\t\t\tif (0 === H) throw new Error("flattenDropFile gave nullptr");\n\t\t\t\tconst l = i.heapU8.buffer.slice(H, H + s), p = E.map((e) => e.paddedData.buffer);\n\t\t\t\treturn [{\n\t\t\t\t\trequestIdLow: r,\n\t\t\t\t\trequestIdHigh: o,\n\t\t\t\t\tresultBuffer: l,\n\t\t\t\t\tsuccess: !0,\n\t\t\t\t\tparsed: !0,\n\t\t\t\t\terror: void 0,\n\t\t\t\t\tdataType: n.WorkerDataType.Drop.value,\n\t\t\t\t\tcontextPtr: u,\n\t\t\t\t\tattributes: E,\n\t\t\t\t\tduration: W,\n\t\t\t\t\tttfb: A,\n\t\t\t\t\thttpStatus: S.status,\n\t\t\t\t\tresponseHeadersJson: F\n\t\t\t\t}, { transfer: [l, ...p] }];\n\t\t\t} catch (f) {\n\t\t\t\tconsole.error("Exception when parsing dropfile", f);\n\t\t\t\tconst e = f instanceof Error ? f.stack ?? f.message : String(f), t = (/* @__PURE__ */ new Uint8Array()).buffer;\n\t\t\t\treturn [{\n\t\t\t\t\trequestIdLow: r,\n\t\t\t\t\trequestIdHigh: o,\n\t\t\t\t\tresultBuffer: t,\n\t\t\t\t\tsuccess: !1,\n\t\t\t\t\tparsed: !1,\n\t\t\t\t\terror: e,\n\t\t\t\t\tdataType: n.WorkerDataType.Drop.value,\n\t\t\t\t\tcontextPtr: u,\n\t\t\t\t\tattributes: void 0,\n\t\t\t\t\tduration: W,\n\t\t\t\t\tttfb: A,\n\t\t\t\t\thttpStatus: S.status,\n\t\t\t\t\tresponseHeadersJson: F\n\t\t\t\t}, { transfer: [t] }];\n\t\t\t} finally {\n\t\t\t\tg(U), a(O), a(R), a(j), 0 !== H && a(H), I.delete();\n\t\t\t}\n\t\t} catch (f) {\n\t\t\tconst e = f instanceof Error ? f.message : String(f), t = f instanceof Error && "AbortError" === f.name;\n\t\t\treturn [{\n\t\t\t\trequestIdLow: r,\n\t\t\t\trequestIdHigh: o,\n\t\t\t\tresultBuffer: /* @__PURE__ */ new ArrayBuffer(0),\n\t\t\t\tsuccess: !1,\n\t\t\t\tparsed: !1,\n\t\t\t\terror: t ? "Cancelled" : e,\n\t\t\t\tdataType: n.WorkerDataType.Raw.value,\n\t\t\t\tcontextPtr: u,\n\t\t\t\tattributes: [],\n\t\t\t\tduration: 0,\n\t\t\t\tttfb: 0,\n\t\t\t\thttpStatus: 0,\n\t\t\t\tresponseHeadersJson: "{}"\n\t\t\t}, { transfer: [] }];\n\t\t} finally {\n\t\t\ta.delete(p);\n\t\t}\n\t}\n};\nself.postMessage("ready"), self.addEventListener("message", async ({ data: e }) => {\n\tif ("ready" === e) return;\n\tconst { id: t, action: r, args: n } = e, [a, ...i] = await Reflect.apply(o[r], void 0, [...n, t]);\n\tself.postMessage({\n\t\tid: t,\n\t\tresult: a\n\t}, ...i);\n});\n',m="undefined"!=typeof self&&self.Blob&&new Blob(["URL.revokeObjectURL(import.meta.url);",p],{type:"text/javascript;charset=utf-8"});function f(t){let e;try{if(e=m&&(self.URL||self.webkitURL).createObjectURL(m),!e)throw"";const n=new Worker(e,{type:"module",name:t?.name});return n.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(e)}),n}catch(n){return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(p),{type:"module",name:t?.name})}}var g=(t=>t.includes("/.vite/")?t.replace(/\.vite\/[^?#]*/,()=>"@miris-inc/core/dist/aqua-parser.wasm"):t)(new URL("aqua-parser.wasm",import.meta.url).href),y=(t=>{let e;return async()=>{e??=fetch(t).then(e=>{if(!e.ok)throw new Error(`HTTP ${e.status} fetching ${t}`);return e.arrayBuffer()});try{return(await e).slice(0)}catch(n){throw e=void 0,n}}})(g),v=class extends h{static name="decoder";static Worker=f;constructor(t){super(t),this.#E()}async#E(){try{const t=await y();this._postToWorker({type:"wasm-init",wasmBinary:t},[t])}catch(t){console.error("Failed to load aqua-parser.wasm for decoder worker",t),this._postToWorker({type:"wasm-init"})}}get AttributeInfo(){return this.module.AttributeInfo}async heapSnapshot(t){return this._execute("heapSnapshot",t)}async heapTrackingControl(t){return this._execute("heapTrackingControl",t)}async heapTrackingReset(){return this._execute("heapTrackingReset")}async cancel(t,e){await this.ready,this._execute("cancel",t,e).catch(()=>{})}async decode(...t){const{requestIdLow:e,requestIdHigh:n,resultBuffer:r,success:i,dataType:a,contextPtr:s,attributes:c,duration:u,ttfb:l,httpStatus:d,responseHeadersJson:h}=await this._execute("decode",...t);if(void 0!==c)for(const{paddedData:g,originalSize:y,id:v}of c)o.addWithId({paddedData:g,originalSize:y},v);const{engine:p}=this,m=r.byteLength,f=p.malloc(m);p.heapU8.set(new Uint8Array(r),f),p.onWorkerResult(e,n,f,m,d,u,l,i,a,"",h,s)}},b={sparkPackedSplat:{elementsPerSplat:4,discard:!1},extendedPackedSplatLow:{elementsPerSplat:4,discard:!1},extendedPackedSplatHigh:{elementsPerSplat:4,discard:!1},packedSh1:{elementsPerSplat:2,discard:!1},packedSh2:{elementsPerSplat:4,discard:!1},packedSh3:{elementsPerSplat:4,discard:!1},sh1Extended:{elementsPerSplat:4,discard:!1},sh2Extended:{elementsPerSplat:4,discard:!1},sh3Extended_0:{elementsPerSplat:4,discard:!1},sh3Extended_1:{elementsPerSplat:4,discard:!1},splatterEllipsoids:{elementsPerSplat:12,discard:!1},splatterSphericalHarmonics:{elementsPerSplat:16,discard:!1}};function S(t,e,n){const r=b[t];if(void 0===r)throw new Error("attribute name"+t+" is unknown");const i=n.length,a=(s=i,o=2048*r.elementsPerSplat,Math.ceil(s/o)*o);var s,o;const c=new Uint32Array(a);return c.set(n),{paddedData:c,originalSize:i,id:e}}var w=class{static SPARK_PACKED_SPLAT="sparkPackedSplat";static SPARK_EXTENDED_SPLAT_LOW="extendedPackedSplatLow";static SPARK_EXTENDED_SPLAT_HIGH="extendedPackedSplatHigh";static SPARK_PACKED_SH1="packedSh1";static SPARK_PACKED_SH2="packedSh2";static SPARK_PACKED_SH3="packedSh3";static SPARK_EXTENDED_SH1="sh1Extended";static SPARK_EXTENDED_SH2="sh2Extended";static SPARK_EXTENDED_SH3_A="sh3Extended_0";static SPARK_EXTENDED_SH3_B="sh3Extended_1";static UNUSED="unused";static SPLATTER_ELLIPSOIDS="splatterEllipsoids";static SPLATTER_SPHERICAL_HARMONICS="splatterSphericalHarmonics"},_=class t{static AquaStatus={Success:0,Failure:1};static SceneObjectType={ModelRoot:0,SceneObject:1,StreamObject:2,GaussianSplats:3,PointsObject:4,Camera:5,LodOctree:6,VariantSetCollection:7,VariantSet:8,VariantSetOption:9};static Feature={DrMap:0,ReflMesh:1,GlassMesh:2};static FeatureState={NotLoaded:0,Pending:1,Loaded:2,Failed:3};#x;get module(){if(!this.#x)throw new Error("Engine has not yet been initialized. Did you forget to `await engine.ready()?`");return this.#x}#D=/* @__PURE__ */new Set;#F=/* @__PURE__ */new Map;#I=new URL(location.href).searchParams.has("nojwt");constructor(t={}){Object.defineProperty(this,"pending",{value:!0,configurable:!0,enumerable:!0}),Object.defineProperty(this,"ready",{enumerable:!0,value:this.#R(t)})}async#R(e){return this.#x=await d({createDeserializeWorker:this.createDeserializeWorker.bind(this),submitToWorker:this.submitToWorker.bind(this),cancelRequest:this.cancelRequest.bind(this),terminateWorker:this.terminateWorker.bind(this),workerUrl:"aqua-parser",...e,preRun:[e=>Object.assign(e.ENV,t.#O())]}),Object.defineProperty(this,"pending",{value:!1,configurable:!1}),this}get AttributeInfo(){return this.module.AttributeInfo}get Handedness(){return this.module.Handedness}get heapF32(){return this.module.HEAPF32}get heapU8(){return this.module.HEAPU8}get MatrixOrder(){return this.module.MatrixOrder}get SceneChangeIds(){return this.module.SceneChangeIds}get SceneMetadata(){return this.module.SceneMetadata}get RuntimeSettings(){return this.module.RuntimeSettings}get SpatialFormat(){return this.module.SpatialFormat}get StringVector(){return this.module.StringVector}get UpAxis(){return this.module.UpAxis}activatedObjectIdsView(...t){return this.module.activatedObjectIdsView(...t)}addStreamById(...t){return this.module.ccall("AddStreamById","number",["number","string","string","number"],t)}allocateSceneChangesArrays(...t){return this.module.AllocateSceneChangesArrays(...t)}createContext(...t){return this.module.ccall("CreateAquaContext","number",[],t)}destroyContext(...t){return this.module.ccall("DestroyAquaContext","number",["number"],t)}createClient(t,...e){return t?this.module.ccall("CreateClientForContext","number",["number"],[t,...e]):this.module.ccall("CreateClient","number",[],e)}createdObjectIdsView(...t){return this.module.createdObjectIdsView(...t)}deletedObjectIdsView(...t){return this.module.deletedObjectIdsView(...t)}dataPtrView(...t){return this.module.dataPtrView(...t)}deactivatedObjectIdsView(...t){return this.module.deactivatedObjectIdsView(...t)}destroyClient(...t){return this.module.ccall("DestroyClient","number",["number"],t)}free(...t){return this.module.ccall("free","number",["number"],t)}getAssetsAsync(...t){return this.module.GetAssetsAsync(...t)}getAttribute(...t){return this.module.ccall("GetAttribute","number",["number","number","string","number"],t)}getDefaultCameraId(...t){return this.module.ccall("GetDefaultCameraId","number",["number"],t)}getViewingVolumeId(...t){return this.module.ccall("GetViewingVolumeId","number",["number"],t)}getLocalBoundingBox(...t){return this.module.ccall("GetLocalBoundingBox","number",["number","number","number"],t)}getWorldBoundingBox(...t){return this.module.ccall("GetWorldBoundingBox","number",["number","number","number"],t)}getLodIndex(...t){return this.module.ccall("GetLodIndex","number",["number","number"],t)}getSceneChanges(...t){return this.module.GetSceneChanges(...t)}getSceneChangesCounts(...t){return this.module.GetSceneChangesCounts(...t)}getSceneMetadata(...t){return this.module.GetSceneMetadata(...t).value}getSceneObjectParent(...t){return this.module.ccall("GetSceneObjectParent","number",["number","number"],t)}getSceneObjectType(...t){return this.module.ccall("GetSceneObjectType","number",["number","number"],t)}getLocalTransform(...t){return this.module.ccall("MirisGetLocalTransform","number",["number","number","number"],t)}getWorldTransform(...t){return this.module.ccall("MirisGetWorldTransform","number",["number","number","number"],t)}hasAttribute(...t){return this.module.ccall("HasAttribute","boolean",["number","number","string"],t)}isSceneObjectAncestorOf(...t){return this.module.ccall("IsSceneObjectAncestorOf","boolean",["number","number","number"],t)}lockScene(...t){return this.module.ccall("LockScene","number",["number"],t)}malloc(...t){return this.module.ccall("malloc","number",["number"],t)}modifiedObjectIdsView(...t){return this.module.modifiedObjectIdsView(...t)}onWorkerResult(...t){const e=`${t[1]}-${t[0]}`;return this.#F.delete(e),this.module.ccall("onWorkerResult",null,["number","number","number","number","number","number","number","number","number","string","string","number"],t)}removeStream(...t){return this.module.ccall("RemoveStream","boolean",["pointer","number"],t)}setAssetViewerKey(...t){return this.module.ccall("SetAssetViewerKey","number",["number","string"],t)}setClientSpatialFormat(...t){return this.module.SetClientSpatialFormat(...t).value}setRuntimeSettings(...t){return this.module.SetRuntimeSettings(...t).value}setMainCameraTransform(...t){return this.module.ccall("SetMainCameraTransform","number",["number","number"],t)}setMainCameraViewFrustum(...t){return this.module.ccall("SetMainCameraViewFrustum","number",["number","number","number","number","number"],t)}setMaxCacheSize(...t){return this.module.setMaxCacheSize(...t)}setSceneObjectTransform(...t){return this.module.ccall("SetSceneObjectTransform","number",["number","number","number"],t)}hasFeature(...t){return this.module.HasFeature(...t)}getFeatureVersion(...t){return this.module.GetFeatureVersion(...t)}getFeatureState(...t){return this.module.GetFeatureState(...t)}getName(...t){return this.module.GetName(...t)}setVariantSelection(...t){return this.module.ccall("SetVariantSelection","number",["number","number"],t)}takeAttribute(...t){return this.module.ccall("TakeAttribute","number",["number","number","string","bigint"],t)}takeEvictedClientSideAttributeIds(...t){return this.module.TakeEvictedClientSideAttributeIds(...t)}getActiveClientSideIdsCheckSum(){return this.module.GetActiveClientSideIdsCheckSum()}unlockScene(...t){return this.module.ccall("UnlockScene","number",["number"],t)}updateSceneExecution(...t){return this.module.ccall("UpdateSceneExecution","number",["number"],t)}recordFrameTime(...t){return this.module.ccall("RecordFrameTime","number",["number","number"],t)}takeRenderRequired(...t){return this.module.TakeRenderRequired(...t)}createDeserializeWorker(t,e,n){for(let r=1;r<n;r+=1)this.#D.add(new v({engine:this}));return!0}cancelRequest(t,e){const n=`${e}-${t}`,r=this.#F.get(n);return r&&(r.cancel(t,e),this.#F.delete(n)),!0}submitToWorker(t,e,n,r){const i=[...this.#D.values()].reduce((t,e)=>t?e.pendingRequests<t.pendingRequests?e:t:e),a=`${e}-${t}`;this.#F.set(a,i);const s=o.getConsecutiveIds(Object.keys(b).length);return i.ready.then(()=>i.decode(t,e,n,r,s,this.#I)),!0}terminateWorker(){for(const t of this.#D)t.terminate();this.#D.clear()}async requestWorkerHeapSnapshots(t){const e=[...this.#D];return(await Promise.allSettled(e.map(e=>e.ready.then(()=>{let n;const r=new Promise(t=>{n=setTimeout(()=>t(null),5e3)});return Promise.race([e.heapSnapshot(t).then(t=>t.snapshotJson),r]).finally(()=>clearTimeout(n))})))).map(t=>"fulfilled"===t.status?t.value:null)}async setWorkerHeapTrackingEnabled(t){await Promise.allSettled([...this.#D].map(e=>e.ready.then(()=>e.heapTrackingControl(t))))}async resetWorkerHeapTracking(){await Promise.allSettled([...this.#D].map(t=>t.ready.then(()=>t.heapTrackingReset())))}static#O(){return{AQUA_USE_SINGLETON_NETWORK_TRANSPORT:"true",AQUA_SERVER_BASE_URL:"https://app.miris.com/viewer/v1"}}},k=[30,60,72,90,120,144,165,240];var C=class{static _instance;static async instance(){const t=this._instance??=new this;return await t.ready,t}#M;get sharedContext(){return this.#M}#j;get viewerKey(){return this.#j}set viewerKey(t){this.#j=t}#V=/* @__PURE__ */new Set;get scenes(){return new Set(this.#V)}#B=[];#W=null;#U=/* @__PURE__ */new Set;#H=/* @__PURE__ */new Map;#L=!0;get useSphericalHarmonics(){return this.#L}set useSphericalHarmonics(t){this.#L=t}constructor(){this.constructor.prototype._instance||(this.constructor.prototype._instance=this),Object.defineProperties(this,{pending:{value:!0,configurable:!0,enumerable:!0},engine:{value:new _,enumerable:!0}}),Object.defineProperty(this,"ready",{enumerable:!0,value:this.#z()}),console.assert?.(!1===this._xrModeActive),this.#q()}async#z(){const{engine:t}=this;await t.ready,this.#M=this.engine.createContext();const e=1048576,n=new URLSearchParams(window.location.search).get("aquaMaxCacheSize");let r=0;if(n){const t=parseInt(n,10);!isNaN(t)&&t>0&&(r=t)}return r>0?this.engine.setMaxCacheSize(r*e):navigator.userAgent.includes("iPhone")?this.engine.setMaxCacheSize(128*e):navigator.userAgent.includes("Android")&&this.engine.setMaxCacheSize(256*e),this.#K(),Object.defineProperty(this,"pending",{value:!1,configurable:!1}),this}dispose(){this.#M&&(this.engine.destroyContext(this.#M)!==_.AquaStatus.Success&&console.error(`Failed to destroy aqua context with handle '${this.#M}'`),this.#M=0)}updateParentedTransform(t,e){}#N=function(){let t=[],e=null,n=0;return screen.addEventListener?.("change",()=>{t=[],n=0,e=null}),{update(r){if(!n){if(null!==e&&(t.push(r-e),t.length>60&&t.shift(),!n&&60===t.length)){const e=1e3/(t.reduce((t,e)=>t+e,0)/t.length);n=k.reduce((t,n)=>Math.abs(n-e)<Math.abs(t-e)?n:t)}e=r}},get nativeHz(){return n}}}();#G=this.#K.bind(this);#Q=!1;#Y=null;#X=-1;#J=72;#Z=null;_xrModeActive=!1;_xrSession=null;_requestAnimationFrame=null;signalResumeFromIdle(){}#tt(){const t=new this.engine.RuntimeSettings;t.targetFramesPerSecond=this.#J,t.xrModeActive=this._xrModeActive,null!==this.#Z?t.splatCountBudget=this.#Z:this._xrModeActive&&(t.splatCountBudget=2e5);for(const e of this.#V)e.client.setRuntimeSettings(t);t.delete()}static _XR_TARGET_FRAME_RATE=43;#q(){this._requestAnimationFrame=this._xrModeActive?this._xrSession.requestAnimationFrame.bind(this._xrSession):window.requestAnimationFrame.bind(window)}_setTargetFrameRate(t){this.#J=t,this.#N=null,this.#tt()}_setXRModeActive(t,e,n){this._xrModeActive=t,this._xrSession=n??null,void 0!==e&&(this.#J=e),this.#tt(),this.#q()}_setSplatCountBudgetOverride(t){this.#Z=t,this.#tt()}#K(t=0){this.#Q||(this._update(t),this._xrModeActive||requestAnimationFrame(this.#G))}_update(t=0){if(0!==t&&t===this.#X)return;if(this.#X=t,this.#N&&(this.#N.update(performance.now()),this.#N.nativeHz>0)){const t=this.#N.nativeHz;this.#J=t<=40?t:40,this.#tt(),this.#N=null}const e=performance.now(),n=null===this.#Y?null:e-this.#Y;this.#Y=e;const r=null!==n&&n<=1e3?n:null;for(const i of this.#V){const{client:t}=i;null!==r&&t.recordFrameTime(r),t.updateSceneExecution();const e=t.takeEvictedClientSideAttributeIds();try{const t=e.size();if(t>0){const n=[];for(let r=0;r<t;r++)n.push(Number(e.get(r)));o.remove(n)}}finally{e.delete()}const n=this.engine.getActiveClientSideIdsCheckSum();if(o.validateCheckSum(n),!t.lockScene())return;try{this.#et(i)}finally{t.unlockScene()}}this.#B.length&&(this.applyChanges(this.#B),this.#B.length=0)}#nt(t,e,n){const r=this.engine.malloc(4*e);n(t,r);const i=this.engine.heapF32.subarray(r>>2,(r>>2)+e).slice();return this.engine.free(r),i}getLocalTransform(t,e){if(Number.isInteger(e)&&e>=0)return this.#nt(e,16,t.getLocalTransform.bind(t))}getWorldTransform(t,e){if(Number.isInteger(e)&&e>=0)return this.#nt(e,16,t.getWorldTransform.bind(t))}#rt(){return!!this.#W&&(this.#W.createdObjectsCount>0||(this.#W.activatedObjectsCount>0||(this.#W.deactivatedObjectsCount>0||(this.#W.modifiedObjectsCount>0||this.#W.deletedObjectsCount>0))))}#it(t,e,n,r){const{engine:i}=this;if(!t.hasAttribute(e,n))return null;const{ptr:a}=r.$$,s=t.getAttribute(e,n,a);if(s!==_.AquaStatus.Success)return console.warn(`GetAttribute failed for object id ${e} and attribute name ${n}: status ${s}`),null;let c,u;if(0n!=r.clientSideId)({paddedData:c,originalSize:u}=o.get(Number(r.clientSideId)));else{const a=S(n,0,i.dataPtrView(r));c=a.paddedData,u=a.originalSize;const s=o.add({paddedData:a.paddedData,originalSize:a.originalSize}),l=t.takeAttribute(e,n,BigInt(s));if(l!==_.AquaStatus.Success)return o.remove(s),console.warn(`Failed to take attribute ${n} for scene object ${e}: status ${l}`),null}return{paddedData:c,originalSize:u}}#et(t){const{engine:e}=this,{client:n,camera:r,lods:o}=t;if(r&&r.update(),null===this.#W&&(this.#W=new e.SceneChangeIds),n.getSceneChangesCounts(this.#W),!this.#rt())return;e.allocateSceneChangesArrays(this.#W),n.getSceneChanges(this.#W);const u=/* @__PURE__ */new Set;for(const h of e.createdObjectIdsView(this.#W)){const e=n.getSceneObjectType(h);if(e!==_.SceneObjectType.StreamObject){if(e===_.SceneObjectType.ModelRoot){const e=t.getStreamForDescendentId(h);if(!e)continue;const r=new s({id:h,stream:e}),i=this.getLocalTransform(n,h);if(!i)continue;const a=n.getSceneObjectParent(h),o=this.getLocalTransform(n,a);if(!o)continue;const c=this.updateParentedTransform(i,o);if(!c)continue;r.transform=c}else if(e==_.SceneObjectType.GaussianSplats){const e=t.getModelRootForDescendentId(h);if(!e)continue;const r=new i({id:h,modelRoot:e,lodStore:o});r.transform=this.getLocalTransform(n,h),u.add(h);const s=new a({type:"created",lod:r});this.#B.push(s)}else if(e==_.SceneObjectType.VariantSetCollection)t.getStreamForDescendentId(h)?._addVariantCollection(h);else if(e==_.SceneObjectType.VariantSet){const e=t.getStreamForDescendentId(h),r=n.getName(h),i=n.getSceneObjectParent(h);e?._addVariant(i,{id:h,name:r,options:[],nestedSets:[]})}else if(e==_.SceneObjectType.VariantSetOption){const e=t.getStreamForDescendentId(h),r=n.getName(h),i=n.getSceneObjectParent(h);e?._addVariant(i,{id:h,name:r,type:"option"})}}else c.forId(h)}for(const i of e.deletedObjectIdsView(this.#W)){const t=o.forId(i);if(!t)continue;const e=new a({type:"deleted",lod:t});this.#B.push(e)}for(const i of e.modifiedObjectIdsView(this.#W)){const r=n.getSceneObjectType(i);if(r===_.SceneObjectType.LodOctree)t._onFeatureData(i);else if(r===_.SceneObjectType.GaussianSplats){const r=n.getLodIndex(i),s=new e.AttributeInfo,c=new e.AttributeInfo;try{let e=this.#it(n,i,w.SPARK_EXTENDED_SPLAT_LOW,s),u=null,l=!0;if(null===e?(e=this.#it(n,i,w.SPARK_PACKED_SPLAT,s),l=!1):u=this.#it(n,i,w.SPARK_EXTENDED_SPLAT_HIGH,c),null===e){console.error(`Could not retrieve primary splats attribute for scene object ${i}! skipping scene object`);continue}const d=o.forId(i);if(!d){console.warn(`Received modified event for LOD ${i} which does not exist.`);continue}const h=this.#nt(d.id,6,n.getWorldBoundingBox.bind(n)),p=this.#nt(d.id,6,n.getLocalBoundingBox.bind(n));d.splats=e?.paddedData,d.splatsExtendedData=u?.paddedData??null,d.useExtSplats=l,d.bounds=h,d.localBounds=p,d.lodIndex=r,d.paddingCount=(e?.paddedData.length-e.originalSize)/4,this.useSphericalHarmonics&&this.#at(t,i,d);const m=new a({type:"modified",lod:d});if(this.#B.push(m),this.#U.delete(i)){this.#B.push(new a({type:"activated",lod:d}));for(const[,t]of this.#H)this.#B.push(new a({type:"deactivated",lod:t}));this.#H.clear()}}finally{s.delete(),c.delete()}}}if(this.#B.some(t=>"created"===t.type))try{const t=new e.SceneMetadata;n.getSceneMetadata(t),this.onColorSpaceDetected("linear"===t.inputColorSpace),t.delete()}catch(d){console.warn("Failed to read scene metadata:",d)}let l=!1;for(const i of e.activatedObjectIdsView(this.#W))if(n.getSceneObjectType(i)==_.SceneObjectType.GaussianSplats){const t=o.forId(i);if(t&&t.splats){const e=new a({type:"activated",lod:t});this.#B.push(e)}else t&&(this.#U.add(i),l=!0)}for(const i of e.deactivatedObjectIdsView(this.#W))if(n.getSceneObjectType(i)==_.SceneObjectType.GaussianSplats&&(this.#U.delete(i),!u.has(i))){const t=o.forId(i);if(t&&t.splats)if(l)this.#H.set(i,t);else{const e=new a({type:"deactivated",lod:t});this.#B.push(e)}}}#at(t,e,n){const{engine:r}=this,{client:i}=t,a=(t,a,s)=>{const o=n.useExtSplats?a:t;if(i.hasAttribute(e,o)){const t=new r.AttributeInfo;try{const n=this.#it(i,e,o,t);null!==n&&s(n.paddedData,t.maxValue.x)}finally{t.delete()}}};a(w.SPARK_PACKED_SH1,w.SPARK_EXTENDED_SH1,(t,e)=>n.setSh1(t,e)),a(w.SPARK_PACKED_SH2,w.SPARK_EXTENDED_SH2,(t,e)=>n.setSh2(t,e)),a(w.SPARK_PACKED_SH3,w.SPARK_EXTENDED_SH3_A,(t,e)=>n.setSh3(t,e)),a(w.UNUSED,w.SPARK_EXTENDED_SH3_B,(t,e)=>n.sh3ExtendedData=t)}update(){this.#Q=!0,this._update();let t=!1;for(const e of this.#V)e.client.takeRenderRequired()&&(t=!0);return t||this._computeAdditionalRenderNeeded()}applyChanges(t){}_computeAdditionalRenderNeeded(){return!1}onColorSpaceDetected(t){}add(t){this.#V.add(t)}delete(t){this.#V.delete(t),t.miris&&t.close(),0===this.#V.size&&null!==this.#W&&(this.#W.delete(),this.#W=null)}},T=class{update(){const{engine:t}=this,{client:e}=this.scene,n=t.malloc(4*this.#b.length);t.heapF32.set(Float32Array.from(this.#b),n/4),e.setMainCameraTransform(n),t.free(n),e.setMainCameraViewFrustum(this.#st,this.#ot,this.#ct,this.#ut)}#st;get aspect(){return this.#st}set aspect(t){this.#st=t}#ot;get fov(){return this.#ot}set fov(t){this.#ot=t}#ct;get near(){return this.#ct}set near(t){this.#ct=t}#ut;get far(){return this.#ut}set far(t){this.#ut=t}#b;get matrix(){return this.#b}set matrix(t){this.#b=t}constructor({aspect:t,fov:e,near:n,far:r,matrix:i,scene:a}){this.#st=t,this.#ot=e,this.#ct=n,this.#ut=r,this.#b=i,Object.defineProperties(this,{scene:{value:a},miris:{value:a.miris},engine:{value:a.miris.engine}})}},A=class{#j=null;get viewerKey(){return this.#j}set viewerKey(t){t&&this.setAssetViewerKey(t),this.#j=t}constructor({engine:t,context:e}){Object.defineProperties(this,{engine:{value:t,enumerable:!0},handle:{value:t.createClient(e),enumerable:!0}})}dispose(){this.engine.destroyClient(this.handle)!==_.AquaStatus.Success&&console.error(`Failed to destroy client with handle '${this.handle}'`)}addStreamById(...t){return this.engine.addStreamById(this.handle,...t)}destroyClient(...t){return this.engine.destroyClient(this.handle,...t)}getAssetsAsync(...t){return this.engine.getAssetsAsync(this.handle,...t)}getAttribute(...t){return this.engine.getAttribute(this.handle,...t)}getDefaultCameraId(...t){return this.engine.getDefaultCameraId(this.handle,...t)}getViewingVolumeId(...t){return this.engine.getViewingVolumeId(this.handle,...t)}getLocalBoundingBox(...t){return this.engine.getLocalBoundingBox(this.handle,...t)}getWorldBoundingBox(...t){return this.engine.getWorldBoundingBox(this.handle,...t)}getLodIndex(...t){return this.engine.getLodIndex(this.handle,...t)}getSceneChanges(...t){return this.engine.getSceneChanges(this.handle,...t)}getSceneChangesCounts(...t){return this.engine.getSceneChangesCounts(this.handle,...t)}getSceneMetadata(...t){return this.engine.getSceneMetadata(this.handle,...t)}getSceneObjectParent(...t){return this.engine.getSceneObjectParent(this.handle,...t)}getSceneObjectType(...t){return this.engine.getSceneObjectType(this.handle,...t)}getLocalTransform(...t){return this.engine.getLocalTransform(this.handle,...t)}getWorldTransform(...t){return this.engine.getWorldTransform(this.handle,...t)}hasAttribute(...t){return this.engine.hasAttribute(this.handle,...t)}isSceneObjectAncestorOf(...t){return this.engine.isSceneObjectAncestorOf(this.handle,...t)}lockScene(...t){return this.engine.lockScene(this.handle,...t)}removeStream(...t){return this.engine.removeStream(this.handle,...t)}setAssetViewerKey(...t){return this.engine.setAssetViewerKey(this.handle,...t)}setClientSpatialFormat(...t){return this.engine.setClientSpatialFormat(this.handle,...t)}setRuntimeSettings(...t){return this.engine.setRuntimeSettings(this.handle,...t)}setMainCameraTransform(...t){return this.engine.setMainCameraTransform(this.handle,...t)}setMainCameraViewFrustum(...t){return this.engine.setMainCameraViewFrustum(this.handle,...t)}setSceneObjectTransform(...t){return this.engine.setSceneObjectTransform(this.handle,...t)}hasFeature(...t){return this.engine.hasFeature(this.handle,...t)}getFeatureVersion(...t){return this.engine.getFeatureVersion(this.handle,...t)}getFeatureState(...t){return this.engine.getFeatureState(this.handle,...t)}getName(...t){return this.engine.getName(this.handle,...t)}setVariantSelection(...t){return this.engine.setVariantSelection(this.handle,...t)}takeAttribute(...t){return this.engine.takeAttribute(this.handle,...t)}takeEvictedClientSideAttributeIds(...t){return this.engine.takeEvictedClientSideAttributeIds(this.handle,...t)}takeRenderRequired(...t){return this.engine.takeRenderRequired(this.handle,...t)}unlockScene(...t){return this.engine.unlockScene(this.handle,...t)}updateSceneExecution(...t){return this.engine.updateSceneExecution(this.handle,...t)}recordFrameTime(...t){return this.engine.recordFrameTime(this.handle,...t)}},$=class t extends EventTarget{static#e=/* @__PURE__ */new Map;static#t=/* @__PURE__ */new Map;#lt=null;get camera(){return this.#lt}set camera(t){this.#lt=t}#dt=null;static forId(e){return t.#e.get(e)}static forKey(e){return t.#t.get(e)}#n;get key(){return this.#n??null}set key(e){t.#t.delete(this.key),(e||0===e)&&t.#t.set(e,this),this.#n=e}#ht=/* @__PURE__ */new Set;#pt=/* @__PURE__ */new Map;get viewerKey(){return this.client.viewerKey}set viewerKey(t){t&&(this.client.viewerKey=t)}get streams(){return new Set(this.#ht)}#u=new r;get lods(){return this.#u}constructor({miris:e,viewerKey:n}){super(),Object.defineProperties(this,{miris:{value:e,enumerable:!0},engine:{value:e.engine,enumerable:!0},client:{value:new A({engine:e.engine,context:e.sharedContext})}}),n&&(this.viewerKey=n);const r=new this.engine.SpatialFormat;r.metersPerUnit=1,r.upAxis=this.engine.UpAxis.Y,r.matrixOrder=this.engine.MatrixOrder.ColumnMajor,r.handedness=this.engine.Handedness.Right,this.client.setClientSpatialFormat(r),r.delete(),t.#e.set(this.id,this),e.add(this)}dispose(){this.close(),this.client.dispose()}#mt(){const t=this.client.getDefaultCameraId();this.#dt=t>=0?t:null}_getViewingVolumeBounds(){const t=this.client.getViewingVolumeId();if(t<0)return null;const{engine:e,client:n}=this,r=e.malloc(24);try{n.getWorldBoundingBox(t,r);const[i,a,s,o,c,u]=Float32Array.from(e.heapF32.subarray(r/4,r/4+6));return void 0===i||void 0===a||void 0===s||void 0===o||void 0===c||void 0===u?null:{min:[i-o/2,a-c/2,s-u/2],max:[i+o/2,a+c/2,s+u/2]}}finally{e.free(r)}}async fetchAssets(t){if(!this.viewerKey)throw new Error("Could not fetch assets because there is no viewer key");const e=new this.engine.StringVector;let n=[];"string"==typeof t?n=t.split(","):t?.[Symbol.iterator]&&(n=[...t]);for(const s of n)e.push_back(s);const r=await this.client.getAssetsAsync(e),i=[],a=new TextDecoder;for(const{name:s,tags:o,thumbnailUrl:c,uuid:u}of r){const t={name:s,thumbnailUrl:c,uuid:u,tags:[]},e=o.size();for(let n=0;n<e;n+=1){let e=o.get(n);e&&("string"!=typeof e&&(e=a.decode(e)),t.tags.push(e))}i.push(t)}return e.delete(),i}getDefaultCameraTransform(){return null===this.#dt?null:this.miris.getWorldTransform(this.client,this.#dt)}add(t){this.#ht.add(t),this.#pt.set(t.id,t)}getStreamForId(t){return this.#pt.get(t)}getStreamForDescendentId(t){for(const[e,n]of this.#pt)if(this.client.isSceneObjectAncestorOf(e,t))return n;return null}getModelRootForDescendentId(t){for(const[,e]of this.#pt)for(const n of e.modelRoots)if(this.client.isSceneObjectAncestorOf(n.id,t))return n;return null}async _getFeatureMesh(t,e,n){if(!this.client.hasFeature(t,e))return null;if(this.client.getFeatureState(t,e)!==_.FeatureState.Loaded)return null;const r=this.client.getFeatureVersion(t,e);if(1===r){const e=`${n}_v${r}`,i=new this.engine.AttributeInfo;try{if(this.client.getAttribute(t,e,i.$$.ptr)!==_.AquaStatus.Success)return null;if(0n!==i.clientSideId)return o.get(Number(i.clientSideId));const n=this.engine.dataPtrView(i),r=new Uint8Array(n.buffer).subarray(n.byteOffset,n.byteOffset+n.byteLength).slice().buffer,a=o.add(r),s=this.client.takeAttribute(t,e,BigInt(a));return s!==_.AquaStatus.Success?(o.remove(a),console.warn(`Failed to take attribute ${e} for scene object ${t}: status ${s}`),null):r}finally{i.delete()}}return console.warn(`getFeatureMesh: unsupported version ${r} for feature ${e}`),null}async _getDrMap(t){if(!this.client.hasFeature(t,_.Feature.DrMap))return null;if(this.client.getFeatureState(t,_.Feature.DrMap)!==_.FeatureState.Loaded)return null;const e=this.client.getFeatureVersion(t,_.Feature.DrMap);if(1===e||2===e){const n=`drMap_v${e}`,r=new this.engine.AttributeInfo;try{if(this.client.getAttribute(t,n,r.$$.ptr)!==_.AquaStatus.Success)return null;if(0n!==r.clientSideId){const t=o.get(Number(r.clientSideId));return void 0!==t?{bytes:t,version:e}:null}const i=this.engine.dataPtrView(r),a=new Uint8Array(i.buffer).subarray(i.byteOffset,i.byteOffset+i.byteLength).slice(),s=o.add(a);console.log(`_getDrMap is calling takeAttribute for ${n} with id ${s}`);const c=this.client.takeAttribute(t,n,BigInt(s));if(c!==_.AquaStatus.Success){if(o.remove(s),this.client.getAttribute(t,n,r.$$.ptr)===_.AquaStatus.Success&&0n!==r.clientSideId){const t=o.get(Number(r.clientSideId));return void 0!==t?{bytes:t,version:e}:null}return console.warn(`getDrMap: failed to take attribute ${n} for scene object ${t}: status ${c}`),null}return{bytes:a,version:e}}finally{r.delete()}}return console.warn(`getDrMap: unsupported DR map version ${e}`),null}async _onFeatureData(t){const e=await this._getDrMap(t);null!==e&&this.dispatchEvent(new CustomEvent("drmaploaded",{detail:{bytes:e.bytes,version:e.version,sceneObjectId:t}}));const n=await this._getFeatureMesh(t,_.Feature.ReflMesh,"reflMesh");null!==n&&this.dispatchEvent(new CustomEvent("reflmeshloaded",{detail:{buffer:n,sceneObjectId:t}}));const r=await this._getFeatureMesh(t,_.Feature.GlassMesh,"glassMesh");null!==r&&this.dispatchEvent(new CustomEvent("glassmeshloaded",{detail:{buffer:r,sceneObjectId:t}}))}_onSceneLoaded(){this.#mt(),this.dispatchEvent(new Event("sceneloaded"))}delete(t){this.#ht.delete(t),this.#pt.delete(t.id),c.forId(t.id)&&t.end()}close(){for(const t of this.streams)t.end();t.#e.delete(this.id),t.#t.delete(this.key),this.miris.scenes.has(this)&&this.miris.delete(this)}};export{T as Camera,i as Lod,r as LodStore,C as Miris,s as ModelRoot,$ as Scene,c as Stream};
|