wgsl-analyzer-web 0.12.0-next.0

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-APACHE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/LICENSE-MIT ADDED
@@ -0,0 +1,24 @@
1
+
2
+ Permission is hereby granted, free of charge, to any
3
+ person obtaining a copy of this software and associated
4
+ documentation files (the "Software"), to deal in the
5
+ Software without restriction, including without
6
+ limitation the rights to use, copy, modify, merge,
7
+ publish, distribute, sublicense, and/or sell copies of
8
+ the Software, and to permit persons to whom the Software
9
+ is furnished to do so, subject to the following
10
+ conditions:
11
+
12
+ The above copyright notice and this permission notice
13
+ shall be included in all copies or substantial portions
14
+ of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
17
+ ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
18
+ TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19
+ PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
20
+ SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
23
+ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24
+ DEALINGS IN THE SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,83 @@
1
+ # wgsl-analyzer-web
2
+
3
+ Runs the `wgsl-analyzer` language server in a Web Worker.
4
+
5
+ The server is the `wgsl-analyzer` binary compiled to
6
+ `wasm32-unknown-emscripten`, running its ordinary `main_loop`. One crossing into
7
+ or out of wasm carries exactly one complete message body. The package hosts it,
8
+ seeds a workspace into the in-memory filesystem, and exposes the message stream.
9
+
10
+ ## Building
11
+
12
+ ```bash
13
+ # `rust-std` for the `emscripten` target is compiled without the wasm `atomics` feature, so it cannot be linked with `-pthread`
14
+ rustup +nightly component add rust-src
15
+ source /path/to/emsdk/emsdk_env.sh
16
+
17
+ cargo xtask dist-web # add --release for the configuration that ships
18
+ ```
19
+
20
+ The command stages three files in `dist/assets/`: `wgsl_analyzer.js` and
21
+ `wgsl_analyzer.wasm` from the cargo build, and `worker.js` from
22
+ `pnpm --filter wgsl-analyzer-web run build`, which it runs for you. All three
23
+ must be served from the same directory, under exactly those names. The glue
24
+ spawns its pthread pool with
25
+ `new Worker(new URL("wgsl_analyzer.js", import.meta.url))`, so renaming the glue
26
+ makes every pthread 404. That is why the xtask renames cargo's
27
+ `wgsl-analyzer.js` back to `wgsl_analyzer.js`.
28
+
29
+ They live in `dist/assets/` rather than beside the module output in `dist/` so
30
+ that the directory holds nothing else: a host can point a static file server
31
+ straight at it. `wgsl-analyzer-web/assets/*` resolves there too, for bundlers
32
+ that would rather ask the package than hardcode a path.
33
+
34
+ Note `dist/worker.js` also exists and is not the one to serve. `tsc` compiles
35
+ every file under `src/` so that `worker.ts` is typechecked along with the rest,
36
+ and its unbundled output lands there; `dist/assets/worker.js` from esbuild is
37
+ the real artifact.
38
+
39
+ ## Usage
40
+
41
+ `WgslAnalyzerServer.sendMessage` and `.onMessage` carry parsed JSON-RPC objects in both
42
+ directions. That is the whole interface, there are 2 examples showcasing how to use it:
43
+
44
+ | Example | Adapts to |
45
+ | --- | --- |
46
+ | [`js/examples/monaco/src/transport.ts`](../examples/monaco/src/transport.ts) | the `IMessageTransport` that `monaco.lsp` takes |
47
+ | [`js/examples/codemirror/src/transport.ts`](../examples/codemirror/src/transport.ts) | the `Transport` that `@marimo-team/codemirror-languageserver` takes |
48
+
49
+ ## Requirements
50
+
51
+ **A cross-origin isolated page.** The build uses shared memory since the language server relies on
52
+ [pthreads](https://emscripten.org/docs/porting/pthreads.html), so the host must send
53
+ `Cross-Origin-Opener-Policy: same-origin` and `Cross-Origin-Embedder-Policy: require-corp`. Without
54
+ them `SharedArrayBuffer` is unavailable and nothing starts, further information is available in the
55
+ official [docs](https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Cross-Origin-Embedder-Policy#features_that_depend_on_cross-origin_isolation).
56
+
57
+ ## Editing files
58
+
59
+ Edits to an open document should go through `textDocument/didChange` as usual.
60
+
61
+ `writeFile` and `deleteFile` change files in the in-memory filesystem, for
62
+ example files that are added, removed, or edited outside the editor. The server
63
+ does not watch the filesystem, so follow either with a
64
+ `workspace/didChangeWatchedFiles` notification for the file.
65
+
66
+ The worker seeds the workspace after the module is ready but before `main()`
67
+ runs, deliberately not from `preRun`. `preRun` executes before
68
+ `__wasm_call_ctors`, so seeding there would touch WasmFS before its static
69
+ constructors have run.
70
+
71
+ ## What the host has to get right
72
+
73
+ - Serve `worker.js`, `wgsl_analyzer.js` and `wgsl_analyzer.wasm` from one
74
+ directory under those exact names, as above.
75
+ - Be cross-origin isolated, or `SharedArrayBuffer` is missing and nothing starts.
76
+ - Hand `sendMessage` one complete message body.
77
+ - Treat `onMessage`'s argument as one complete message body.
78
+ - Expect stderr through `printErr`, not the LSP stream.
79
+
80
+ Filesystem access uses `-sWASMFS`, emscripten's wasm-side multithreaded
81
+ filesystem. It needs `-sFORCE_FILESYSTEM` alongside it, because WasmFS emits
82
+ only the JS filesystem API it can prove it needs and seeding the workspace calls
83
+ that API directly.
@@ -0,0 +1,2 @@
1
+ async function createWgslAnalyzer(moduleArg={}){var Module=moduleArg;var ENVIRONMENT_IS_WEB=!!globalThis.window;var ENVIRONMENT_IS_WORKER=!!globalThis.WorkerGlobalScope;var ENVIRONMENT_IS_NODE=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";var ENVIRONMENT_IS_PTHREAD=ENVIRONMENT_IS_WORKER&&globalThis.name=="em-pthread";if(ENVIRONMENT_IS_NODE){const{createRequire}=await import("node:module");var require=createRequire(import.meta.url);var worker_threads=require("node:worker_threads");globalThis.Worker=worker_threads.Worker;ENVIRONMENT_IS_WORKER=!worker_threads.isMainThread;ENVIRONMENT_IS_PTHREAD=ENVIRONMENT_IS_WORKER&&worker_threads.workerData=="em-pthread"}var programArgs=[];var thisProgram="./this.program";var quit_=(status,toThrow)=>{throw toThrow};var _scriptName=import.meta.url;var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var readAsync,readBinary;if(ENVIRONMENT_IS_NODE){var fs=require("node:fs");if(_scriptName.startsWith("file:")){scriptDirectory=require("node:path").dirname(require("node:url").fileURLToPath(_scriptName))+"/"}readBinary=filename=>{filename=isFileURI(filename)?new URL(filename):filename;var ret=fs.readFileSync(filename);return ret};readAsync=async(filename,binary=true)=>{filename=isFileURI(filename)?new URL(filename):filename;var ret=fs.readFileSync(filename,binary?undefined:"utf8");return ret};if(process.argv.length>1){thisProgram=process.argv[1].replace(/\\/g,"/")}programArgs=process.argv.slice(2);quit_=(status,toThrow)=>{process.exitCode=status;throw toThrow}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){try{scriptDirectory=new URL(".",_scriptName).href}catch{}if(!ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){readBinary=url=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=async url=>{if(isFileURI(url)){return new Promise((resolve,reject)=>{var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=()=>{if(xhr.status==200||xhr.status==0&&xhr.response){resolve(xhr.response);return}reject(xhr.status)};xhr.onerror=reject;xhr.send(null)})}var response=await fetch(url,{credentials:"same-origin"});if(response.ok){return response.arrayBuffer()}throw new Error(response.status+" : "+response.url)}}}else{}var defaultPrint=console.log.bind(console);var defaultPrintErr=console.error.bind(console);if(ENVIRONMENT_IS_NODE){var utils=require("node:util");var stringify=a=>typeof a=="object"?utils.inspect(a):a;defaultPrint=(...args)=>fs.writeSync(1,args.map(stringify).join(" ")+"\n");defaultPrintErr=(...args)=>fs.writeSync(2,args.map(stringify).join(" ")+"\n")}var out=defaultPrint;var err=defaultPrintErr;var wasmBinary;var wasmModule;var ABORT=false;var EXITSTATUS;var isFileURI=filename=>filename.startsWith("file://");function growMemViews(){if(wasmMemory.buffer!=HEAP8.buffer){updateMemoryViews()}}if(ENVIRONMENT_IS_NODE&&ENVIRONMENT_IS_PTHREAD){globalThis.self=globalThis;var parentPort=worker_threads.parentPort;if(!globalThis.postMessage){parentPort.on("message",msg=>globalThis.onmessage?.({data:msg}));globalThis.postMessage=msg=>parentPort.postMessage(msg)}process.on("uncaughtException",err=>{postMessage({cmd:8,error:err});process.exit(1)})}var startWorker;if(ENVIRONMENT_IS_PTHREAD){var initializedJS=false;self.onunhandledrejection=e=>{throw e.reason||e};function handleMessage(e){try{var msgData=e.data;var cmd=msgData.cmd;if(cmd==1){let messageQueue=[];self.onmessage=e=>messageQueue.push(e);startWorker=()=>{postMessage({cmd:3});for(let msg of messageQueue){handleMessage(msg)}self.onmessage=handleMessage};for(const handler of msgData.handlers){if(!Module[handler]||Module[handler].proxy){Module[handler]=(...args)=>{postMessage({cmd:9,handler,args})};if(handler=="print")out=Module[handler];if(handler=="printErr")err=Module[handler]}}wasmMemory=msgData.wasmMemory;updateMemoryViews();wasmModule=msgData.wasmModule;createWasm();run();startWorker()}else if(cmd==2){establishStackSpace(msgData.pthread_ptr);__emscripten_thread_init(msgData.pthread_ptr,0,0,1,0,0);PThread.threadInitTLS();__emscripten_thread_mailbox_await(msgData.pthread_ptr);if(!initializedJS){initializedJS=true}try{invokeEntryPoint(msgData.start_routine,msgData.arg)}catch(ex){if(ex!="unwind"){throw ex}}}else if(cmd==4){if(initializedJS){checkMailbox()}}else if(cmd){err(`worker: received unknown command ${cmd}`);err(msgData)}}catch(ex){if(runtimeInitialized)__emscripten_thread_crashed();throw ex}}self.onmessage=handleMessage}var runtimeInitialized=false;var runtimeExited=false;function getMemoryBuffer(){return wasmMemory.buffer}function updateMemoryViews(){if(HEAP8?.buffer?.growable)return;var b=getMemoryBuffer();HEAP8=new Int8Array(b);HEAPU8=new Uint8Array(b);HEAP32=new Int32Array(b);HEAPU32=new Uint32Array(b);HEAPF64=new Float64Array(b);HEAP64=new BigInt64Array(b)}function initMemory(){if(ENVIRONMENT_IS_PTHREAD){return}{var INITIAL_MEMORY=536870912;wasmMemory=new WebAssembly.Memory({initial:INITIAL_MEMORY/65536,maximum:65536,shared:true})}updateMemoryViews()}function preRun(){var preRun=Module["preRun"];if(preRun){if(typeof preRun=="function")preRun=[preRun];onPreRuns.push(...preRun)}callRuntimeCallbacks(onPreRuns)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;wasmExports["U"]()}function exitRuntime(){___funcs_on_exit();PThread.terminateRuntime();runtimeExited=true}function postRun(){var postRun=Module["postRun"];if(postRun){if(typeof postRun=="function")postRun=[postRun];onPostRuns.push(...postRun)}callRuntimeCallbacks(onPostRuns)}function abort(what){Module["onAbort"]?.(what);what=`Aborted(${what})`;err(what);ABORT=true;what+=". Build with -sASSERTIONS for more info.";if(runtimeInitialized){___trap()}var e=new WebAssembly.RuntimeError(what);throw e}var wasmBinaryFile;function findWasmBinary(){if(Module["locateFile"]){return locateFile("wgsl_analyzer.wasm")}return new URL("wgsl_analyzer.wasm",import.meta.url).href}function getBinarySync(file){if(readBinary){return readBinary(file)}throw"both async and sync fetching of the wasm failed"}async function getWasmBinary(binaryFile){if(!wasmBinary){try{var response=await readAsync(binaryFile);return new Uint8Array(response)}catch{}}return getBinarySync(binaryFile)}async function instantiateArrayBuffer(binaryFile,imports){try{var binary=await getWasmBinary(binaryFile);var instance=await WebAssembly.instantiate(binary,imports);return instance}catch(reason){err(`failed to asynchronously prepare wasm: ${reason}`);abort(reason)}}async function instantiateAsync(binary,binaryFile,imports){if(!binary&&!isFileURI(binaryFile)&&!ENVIRONMENT_IS_NODE){try{var response=fetch(binaryFile,{credentials:"same-origin"});var instantiationResult=await WebAssembly.instantiateStreaming(response,imports);return instantiationResult}catch(reason){err(`wasm streaming compile failed: ${reason}`);err("falling back to ArrayBuffer instantiation")}}return instantiateArrayBuffer(binaryFile,imports)}function getWasmImports(){assignWasmImports();var imports={a:wasmImports};return imports}async function createWasm(){function receiveInstance(instance,module){wasmExports=instance.exports;wasmExports=applySignatureConversions(wasmExports);registerTLSInit(wasmExports["$a"]);assignWasmExports(wasmExports);wasmModule=module;return wasmExports}function receiveInstantiationResult(result){return receiveInstance(result["instance"],result["module"])}var info=getWasmImports();var instantiateWasm=Module["instantiateWasm"];if(instantiateWasm){return new Promise(resolve=>{instantiateWasm(info,(inst,mod)=>resolve(receiveInstance(inst,mod)))})}if(ENVIRONMENT_IS_PTHREAD){var instance=new WebAssembly.Instance(wasmModule,getWasmImports());return receiveInstance(instance,wasmModule)}wasmBinaryFile??=findWasmBinary();var result=await instantiateAsync(wasmBinary,wasmBinaryFile,info);var exports=receiveInstantiationResult(result);return exports}class ExitStatus{name="ExitStatus";constructor(status){this.message=`Program terminated with exit(${status})`;this.status=status}}var HEAP8;var terminateWorker=worker=>{worker.terminate();worker.onmessage=e=>{}};var cleanupThread=pthread_ptr=>{var worker=PThread.pthreads[pthread_ptr];PThread.returnWorkerToPool(worker)};var callRuntimeCallbacks=callbacks=>{while(callbacks.length>0){callbacks.shift()(Module)}};var onPreRuns=[];var addOnPreRun=cb=>onPreRuns.push(cb);var dependenciesPromise=null;var resolveRunDependencies=async()=>dependenciesPromise;var runDependencies=0;var dependenciesPromiseResolve=null;var removeRunDependency=id=>{runDependencies--;Module["monitorRunDependencies"]?.(runDependencies);if(!runDependencies){dependenciesPromiseResolve()}};var addRunDependency=id=>{if(!runDependencies){dependenciesPromise=new Promise(resolve=>dependenciesPromiseResolve=resolve)}runDependencies++;Module["monitorRunDependencies"]?.(runDependencies)};var spawnThread=threadParams=>{var worker=PThread.getNewWorker();if(!worker){return 6}PThread.pthreads[threadParams.pthread_ptr]=worker;worker.pthread_ptr=threadParams.pthread_ptr;var msg={cmd:2,start_routine:threadParams.startRoutine,arg:threadParams.arg,pthread_ptr:threadParams.pthread_ptr};worker.postMessage(msg,threadParams.transferList);return 0};var runtimeKeepaliveCounter=0;var keepRuntimeAlive=()=>noExitRuntime||runtimeKeepaliveCounter>0;var stackSave=()=>_emscripten_stack_get_current();var stackRestore=val=>__emscripten_stack_restore(val);var stackAlloc=sz=>__emscripten_stack_alloc(sz);var HEAPF64;var HEAP64;var proxyToMainThread=(funcIndex,emAsmAddr,proxyMode,...callArgs)=>{var bufSize=8*callArgs.length*2;var sp=stackSave();var args=stackAlloc(bufSize);var b=args>>>3;for(var arg of callArgs){if(typeof arg=="bigint"){(growMemViews(),HEAP64)[b++>>>0]=1n;(growMemViews(),HEAP64)[b++>>>0]=arg}else{(growMemViews(),HEAP64)[b++>>>0]=0n;(growMemViews(),HEAPF64)[b++>>>0]=arg}}var rtn=__emscripten_run_js_on_main_thread(funcIndex,emAsmAddr,bufSize,args,proxyMode);stackRestore(sp);return rtn};function _proc_exit(code){if(ENVIRONMENT_IS_PTHREAD)return proxyToMainThread(0,0,1,code);EXITSTATUS=code;if(!keepRuntimeAlive()){PThread.terminateAllThreads();Module["onExit"]?.(code);ABORT=true}quit_(code,new ExitStatus(code))}var runtimeKeepalivePop=()=>{runtimeKeepaliveCounter-=1};function exitOnMainThread(returnCode){if(ENVIRONMENT_IS_PTHREAD)return proxyToMainThread(1,0,0,returnCode);runtimeKeepalivePop();_exit(returnCode)}var exitJS=(status,implicit)=>{EXITSTATUS=status;if(ENVIRONMENT_IS_PTHREAD){exitOnMainThread(status);throw"unwind"}if(!keepRuntimeAlive()){exitRuntime()}_proc_exit(status)};var _exit=exitJS;var waitAsyncPolyfilled=!Atomics.waitAsync||globalThis.navigator?.userAgent&&Number((navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./)||[])[2])<91;var HEAP32;var PThread={unusedWorkers:[],tlsInitFunctions:[],pthreads:{},init(){if(!ENVIRONMENT_IS_PTHREAD){PThread.initMainThread()}},initMainThread(){var pthreadPoolSize=8;while(pthreadPoolSize--){PThread.allocateUnusedWorker()}addOnPreRun(async()=>{var pthreadPoolReady=PThread.loadWasmModuleToAllWorkers();addRunDependency("loading-workers");await pthreadPoolReady;removeRunDependency("loading-workers")})},terminateAllThreads:()=>{for(var worker of Object.values(PThread.pthreads)){terminateWorker(worker)}for(var worker of PThread.unusedWorkers){terminateWorker(worker)}PThread.unusedWorkers=[];PThread.pthreads={}},clearMailboxAwait:pthread_ptr=>{if(!waitAsyncPolyfilled){Atomics.notify((growMemViews(),HEAP32),pthread_ptr>>>2)}},terminateRuntime:()=>{PThread.terminateAllThreads();var pthread_ptr=_pthread_self();___set_thread_state(0,0,0,1);PThread.clearMailboxAwait(pthread_ptr)},returnWorkerToPool:worker=>{var pthread_ptr=worker.pthread_ptr;delete PThread.pthreads[pthread_ptr];PThread.unusedWorkers.push(worker);worker.pthread_ptr=0;if(ENVIRONMENT_IS_NODE){worker.unref()}PThread.clearMailboxAwait(pthread_ptr);__emscripten_thread_free_data(pthread_ptr)},threadInitTLS(){PThread.tlsInitFunctions.forEach(f=>f())},loadWasmModuleToWorker:worker=>new Promise(onFinishedLoading=>{worker.onmessage=e=>{var d=e.data;var cmd=d.cmd;if(d.targetThread&&d.targetThread!=_pthread_self()){var targetWorker=PThread.pthreads[d.targetThread];targetWorker?.postMessage(d);return}if(d==="setimmediate"||d==="_si"){worker.postMessage(d);return}switch(cmd){case 4:checkMailbox();break;case 5:spawnThread(d);break;case 6:callUserCallback(()=>cleanupThread(d.thread));break;case 3:if(ENVIRONMENT_IS_NODE&&!worker.strongref){worker.unref()}onFinishedLoading(worker);break;case 8:worker.onerror(d.error);break;case 9:Module[d.handler](...d.args);break;default:if(cmd)err(`worker sent an unknown command ${cmd}`)}};worker.onerror=e=>{var message="worker sent an error!";err(`${message} ${e.filename}:${e.lineno}: ${e.message}`);throw e};if(ENVIRONMENT_IS_NODE){worker.on("message",data=>worker.onmessage({data}));worker.on("error",e=>worker.onerror(e))}var handlers=[];var knownHandlers=["onExit","onAbort","print","printErr"];for(var handler of knownHandlers){if(Module.propertyIsEnumerable(handler)){handlers.push(handler)}}worker.postMessage({cmd:1,handlers,wasmMemory,wasmModule})}),async loadWasmModuleToAllWorkers(){if(ENVIRONMENT_IS_PTHREAD){return}let pthreadPoolReady=Promise.all(PThread.unusedWorkers.map(PThread.loadWasmModuleToWorker));return pthreadPoolReady},allocateUnusedWorker(){var worker;worker=new Worker(new URL("wgsl_analyzer.js",import.meta.url),{type:"module",workerData:"em-pthread",trackUnmanagedFds:false,name:"em-pthread"});PThread.unusedWorkers.push(worker);return worker},getNewWorker(){if(PThread.unusedWorkers.length==0){var newWorker=PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(newWorker)}return PThread.unusedWorkers.pop()}};var onPostRuns=[];var HEAPU32;function establishStackSpace(pthread_ptr){var stackHigh=(growMemViews(),HEAPU32)[pthread_ptr+48>>>2>>>0];var stackSize=(growMemViews(),HEAPU32)[pthread_ptr+52>>>2>>>0];var stackLow=stackHigh-stackSize;_emscripten_stack_set_limits(stackHigh,stackLow);stackRestore(stackHigh)}var getWasmTableEntry=funcPtr=>wasmTable.get(funcPtr);var invokeEntryPoint=(ptr,arg)=>{runtimeKeepaliveCounter=0;noExitRuntime=0;var result=getWasmTableEntry(ptr)(arg);function finish(result){if(keepRuntimeAlive()){EXITSTATUS=result;return}__emscripten_thread_exit(result)}finish(result)};var noExitRuntime=false;var registerTLSInit=tlsInitFunc=>PThread.tlsInitFunctions.push(tlsInitFunc);var runtimeKeepalivePush=()=>{runtimeKeepaliveCounter+=1};var wasmMemory;var INT53_MAX=9007199254740992;var INT53_MIN=-9007199254740992;var bigintToI53Checked=num=>num<INT53_MIN||num>INT53_MAX?NaN:Number(num);function ___call_sighandler(fp,sig){fp>>>=0;return getWasmTableEntry(fp)(sig)}function pthreadCreateProxied(pthread_ptr,attr,startRoutine,arg){if(ENVIRONMENT_IS_PTHREAD)return proxyToMainThread(2,0,1,pthread_ptr,attr,startRoutine,arg);return ___pthread_create_js(pthread_ptr,attr,startRoutine,arg)}var _emscripten_has_threading_support=()=>!!globalThis.SharedArrayBuffer;function ___pthread_create_js(pthread_ptr,attr,startRoutine,arg){pthread_ptr>>>=0;attr>>>=0;startRoutine>>>=0;arg>>>=0;if(!_emscripten_has_threading_support()){return 6}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(!transferList.length||error)){return pthreadCreateProxied(pthread_ptr,attr,startRoutine,arg)}if(error)return error;var threadParams={startRoutine,pthread_ptr,arg,transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd=5;postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}var __abort_js=()=>abort("");function __emscripten_init_main_thread_js(tb){tb>>>=0;var can_block=!ENVIRONMENT_IS_WEB;try{Atomics.wait((growMemViews(),HEAP32),0,0,0);can_block=true}catch(e){}__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1,can_block,16777216,false);PThread.threadInitTLS()}var handleException=e=>{if(e instanceof ExitStatus||e=="unwind"){return EXITSTATUS}quit_(1,e)};var maybeExit=()=>{if(runtimeExited){return}if(!keepRuntimeAlive()){try{if(ENVIRONMENT_IS_PTHREAD){if(_pthread_self())__emscripten_thread_exit(EXITSTATUS);return}_exit(EXITSTATUS)}catch(e){handleException(e)}}};var callUserCallback=func=>{if(runtimeExited||ABORT){return}try{return func()}catch(e){handleException(e)}finally{maybeExit()}};function __emscripten_thread_mailbox_await(pthread_ptr){pthread_ptr>>>=0;if(!waitAsyncPolyfilled){var wait=Atomics.waitAsync((growMemViews(),HEAP32),pthread_ptr>>>2,pthread_ptr);wait.value.then(checkMailbox);var waitingAsync=pthread_ptr+112;Atomics.store((growMemViews(),HEAP32),waitingAsync>>>2,1)}}var checkMailbox=()=>{var pthread_ptr=_pthread_self();if(!pthread_ptr)return;callUserCallback(()=>{__emscripten_thread_mailbox_await(pthread_ptr);__emscripten_check_mailbox()})};function __emscripten_notify_mailbox_postmessage(targetThread,currThreadId){targetThread>>>=0;currThreadId>>>=0;if(targetThread==currThreadId){setTimeout(checkMailbox)}else if(ENVIRONMENT_IS_PTHREAD){postMessage({targetThread,cmd:4})}else{var worker=PThread.pthreads[targetThread];if(!worker){return}worker.postMessage({cmd:4})}}var proxiedJSCallArgs=[];function __emscripten_receive_on_main_thread_js(funcIndex,emAsmAddr,callingThread,bufSize,args,ctx,ctxArgs){emAsmAddr>>>=0;callingThread>>>=0;args>>>=0;ctx>>>=0;ctxArgs>>>=0;proxiedJSCallArgs.length=0;var b=args>>>3;var end=args+bufSize>>>3;while(b<end){var arg;if((growMemViews(),HEAP64)[b++>>>0]){arg=(growMemViews(),HEAP64)[b++>>>0]}else{arg=(growMemViews(),HEAPF64)[b++>>>0]}proxiedJSCallArgs.push(arg)}var func=proxiedFunctionTable[funcIndex];PThread.currentProxiedOperationCallerThread=callingThread;var rtn=func(...proxiedJSCallArgs);PThread.currentProxiedOperationCallerThread=0;if(ctx){rtn.then(rtn=>__emscripten_run_js_on_main_thread_done(ctx,ctxArgs,rtn));return}return rtn}var __emscripten_runtime_keepalive_clear=()=>{noExitRuntime=false;runtimeKeepaliveCounter=0};function __emscripten_thread_cleanup(thread){thread>>>=0;if(!ENVIRONMENT_IS_PTHREAD)cleanupThread(thread);else postMessage({cmd:6,thread})}function __emscripten_thread_set_strongref(thread){thread>>>=0;if(ENVIRONMENT_IS_NODE){var worker=PThread.pthreads[thread];worker.ref();worker.strongref=1}}var isLeapYear=year=>year%4===0&&(year%100!==0||year%400===0);var MONTH_DAYS_LEAP_CUMULATIVE=[0,31,60,91,121,152,182,213,244,274,305,335];var MONTH_DAYS_REGULAR_CUMULATIVE=[0,31,59,90,120,151,181,212,243,273,304,334];var ydayFromDate=date=>{var leap=isLeapYear(date.getFullYear());var monthDaysCumulative=leap?MONTH_DAYS_LEAP_CUMULATIVE:MONTH_DAYS_REGULAR_CUMULATIVE;var yday=monthDaysCumulative[date.getMonth()]+date.getDate()-1;return yday};function __localtime_js(time,tmPtr){time=bigintToI53Checked(time);tmPtr>>>=0;var date=new Date(time*1e3);if(isNaN(date.getTime())){return 1}(growMemViews(),HEAP32)[tmPtr>>>2>>>0]=date.getSeconds();(growMemViews(),HEAP32)[tmPtr+4>>>2>>>0]=date.getMinutes();(growMemViews(),HEAP32)[tmPtr+8>>>2>>>0]=date.getHours();(growMemViews(),HEAP32)[tmPtr+12>>>2>>>0]=date.getDate();(growMemViews(),HEAP32)[tmPtr+16>>>2>>>0]=date.getMonth();(growMemViews(),HEAP32)[tmPtr+20>>>2>>>0]=date.getFullYear()-1900;(growMemViews(),HEAP32)[tmPtr+24>>>2>>>0]=date.getDay();var yday=ydayFromDate(date)|0;(growMemViews(),HEAP32)[tmPtr+28>>>2>>>0]=yday;(growMemViews(),HEAP32)[tmPtr+36>>>2>>>0]=-(date.getTimezoneOffset()*60);var start=new Date(date.getFullYear(),0,1);var summerOffset=new Date(date.getFullYear(),6,1).getTimezoneOffset();var winterOffset=start.getTimezoneOffset();var dst=(summerOffset!=winterOffset&&date.getTimezoneOffset()==Math.min(winterOffset,summerOffset))|0;(growMemViews(),HEAP32)[tmPtr+32>>>2>>>0]=dst;return 0}var stringToUTF8Array=(str,heap,outIdx,maxBytesToWrite)=>{outIdx>>>=0;if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.codePointAt(i);if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++>>>0]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++>>>0]=192|u>>6;heap[outIdx++>>>0]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++>>>0]=224|u>>12;heap[outIdx++>>>0]=128|u>>6&63;heap[outIdx++>>>0]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++>>>0]=240|u>>18;heap[outIdx++>>>0]=128|u>>12&63;heap[outIdx++>>>0]=128|u>>6&63;heap[outIdx++>>>0]=128|u&63;i++}}heap[outIdx>>>0]=0;return outIdx-startIdx};var HEAPU8;var stringToUTF8=(str,outPtr,maxBytesToWrite)=>stringToUTF8Array(str,(growMemViews(),HEAPU8),outPtr,maxBytesToWrite);var __tzset_js=function(timezone,daylight,std_name,dst_name){timezone>>>=0;daylight>>>=0;std_name>>>=0;dst_name>>>=0;var currentYear=(new Date).getFullYear();var winter=new Date(currentYear,0,1);var summer=new Date(currentYear,6,1);var winterOffset=winter.getTimezoneOffset();var summerOffset=summer.getTimezoneOffset();var stdTimezoneOffset=Math.max(winterOffset,summerOffset);(growMemViews(),HEAPU32)[timezone>>>2>>>0]=stdTimezoneOffset*60;(growMemViews(),HEAP32)[daylight>>>2>>>0]=Number(winterOffset!=summerOffset);var extractZone=timezoneOffset=>{var sign=timezoneOffset>=0?"-":"+";var absOffset=Math.abs(timezoneOffset);var hours=String(Math.floor(absOffset/60)).padStart(2,"0");var minutes=String(absOffset%60).padStart(2,"0");return`UTC${sign}${hours}${minutes}`};var winterName=extractZone(winterOffset);var summerName=extractZone(summerOffset);if(summerOffset<winterOffset){stringToUTF8(winterName,std_name,17);stringToUTF8(summerName,dst_name,17)}else{stringToUTF8(winterName,dst_name,17);stringToUTF8(summerName,std_name,17)}};function __wasmfs_copy_preloaded_file_data(index,buffer){buffer>>>=0;return(growMemViews(),HEAPU8).set(wasmFSPreloadedFiles[index].fileData,buffer>>>0)}var wasmFSPreloadedDirs=[];var __wasmfs_get_num_preloaded_dirs=()=>wasmFSPreloadedDirs.length;var wasmFSPreloadedFiles=[];var wasmFSPreloadingFlushed=false;var __wasmfs_get_num_preloaded_files=()=>{wasmFSPreloadingFlushed=true;return wasmFSPreloadedFiles.length};function __wasmfs_get_preloaded_child_path(index,childNameBuffer){childNameBuffer>>>=0;var s=wasmFSPreloadedDirs[index].childName;var len=lengthBytesUTF8(s)+1;stringToUTF8(s,childNameBuffer,len)}var __wasmfs_get_preloaded_file_mode=index=>wasmFSPreloadedFiles[index].mode;function __wasmfs_get_preloaded_file_size(index){return wasmFSPreloadedFiles[index].fileData.length}function __wasmfs_get_preloaded_parent_path(index,parentPathBuffer){parentPathBuffer>>>=0;var s=wasmFSPreloadedDirs[index].parentPath;var len=lengthBytesUTF8(s)+1;stringToUTF8(s,parentPathBuffer,len)}var lengthBytesUTF8=str=>{var len=0;for(var i=0;i<str.length;++i){var c=str.charCodeAt(i);if(c<=127){len++}else if(c<=2047){len+=2}else if(c>=55296&&c<=57343){len+=4;++i}else{len+=3}}return len};function __wasmfs_get_preloaded_path_name(index,fileNameBuffer){fileNameBuffer>>>=0;var s=wasmFSPreloadedFiles[index].pathName;var len=lengthBytesUTF8(s)+1;stringToUTF8(s,fileNameBuffer,len)}function __wasmfs_jsimpl_alloc_file(backend,file){backend>>>=0;file>>>=0;return wasmFS$backends[backend].allocFile(file)}function __wasmfs_jsimpl_free_file(backend,file){backend>>>=0;file>>>=0;return wasmFS$backends[backend].freeFile(file)}function __wasmfs_jsimpl_get_size(backend,file){backend>>>=0;file>>>=0;return wasmFS$backends[backend].getSize(file)}function __wasmfs_jsimpl_read(backend,file,buffer,length,offset){backend>>>=0;file>>>=0;buffer>>>=0;length>>>=0;offset=bigintToI53Checked(offset);if(!wasmFS$backends[backend].read){return-28}return wasmFS$backends[backend].read(file,buffer,length,offset)}function __wasmfs_jsimpl_set_size(backend,file,size){backend>>>=0;file>>>=0;size=bigintToI53Checked(size);return wasmFS$backends[backend].setSize(file,size)}function __wasmfs_jsimpl_write(backend,file,buffer,length,offset){backend>>>=0;file>>>=0;buffer>>>=0;length>>>=0;offset=bigintToI53Checked(offset);if(!wasmFS$backends[backend].write){return-28}return wasmFS$backends[backend].write(file,buffer,length,offset)}var FS_stdin_getChar_buffer=[];var intArrayFromString=(stringy,dontAddNull,length)=>{var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array};var FS_stdin_getChar=()=>{if(!FS_stdin_getChar_buffer.length){var result=null;if(ENVIRONMENT_IS_NODE){var BUFSIZE=256;var buf=Buffer.alloc(BUFSIZE);var bytesRead=0;var fd=process.stdin.fd;try{bytesRead=fs.readSync(fd,buf,0,BUFSIZE)}catch(e){if(e.toString().includes("EOF"))bytesRead=0;else throw e}if(bytesRead>0){result=buf.slice(0,bytesRead).toString("utf-8")}}else if(globalThis.window?.prompt){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else{}if(!result){return null}FS_stdin_getChar_buffer=intArrayFromString(result,true)}return FS_stdin_getChar_buffer.shift()};var __wasmfs_stdin_get_char=()=>{var c=FS_stdin_getChar();if(typeof c==="number"){return c}return-1};var _emscripten_get_now=()=>performance.timeOrigin+performance.now();var _emscripten_date_now=()=>Date.now();var nowIsMonotonic=1;var checkWasiClock=clock_id=>clock_id>=0&&clock_id<=3;function _clock_time_get(clk_id,ignored_precision,ptime){ignored_precision=bigintToI53Checked(ignored_precision);ptime>>>=0;if(!checkWasiClock(clk_id)){return 28}var now;if(clk_id===0){now=_emscripten_date_now()}else if(nowIsMonotonic){now=_emscripten_get_now()}else{return 52}var nsec=Math.round(now*1e3*1e3);(growMemViews(),HEAP64)[ptime>>>3>>>0]=BigInt(nsec);return 0}var _emscripten_check_blocking_allowed=()=>{};var UTF8Decoder=new TextDecoder;var findStringEnd=(heapOrArray,idx,maxBytesToRead,ignoreNul)=>{var maxIdx=idx+maxBytesToRead;if(ignoreNul)return maxIdx;while(heapOrArray[idx]&&!(idx>=maxIdx))++idx;return idx};var UTF8ToString=(ptr,maxBytesToRead,ignoreNul)=>{ptr>>>=0;if(!ptr)return"";var end=findStringEnd((growMemViews(),HEAPU8),ptr,maxBytesToRead,ignoreNul);return UTF8Decoder.decode((growMemViews(),HEAPU8).slice(ptr,end))};function _emscripten_err(str){str>>>=0;return err(UTF8ToString(str))}var _emscripten_exit_with_live_runtime=()=>{runtimeKeepalivePush();throw"unwind"};var getHeapMax=()=>4294901760;function _emscripten_get_heap_max(){return getHeapMax()}var _emscripten_num_logical_cores=()=>ENVIRONMENT_IS_NODE?require("node:os").cpus().length:navigator["hardwareConcurrency"];function _emscripten_out(str){str>>>=0;return out(UTF8ToString(str))}var alignMemory=(size,alignment)=>Math.ceil(size/alignment)*alignment;var growMemory=size=>{var oldHeapSize=wasmMemory.buffer.byteLength;var pages=(size-oldHeapSize+65535)/65536|0;try{wasmMemory.grow(pages);updateMemoryViews();return 1}catch(e){}};function _emscripten_resize_heap(requestedSize){requestedSize>>>=0;var oldSize=(growMemViews(),HEAPU8).length;if(requestedSize<=oldSize){return false}var maxHeapSize=getHeapMax();if(requestedSize>maxHeapSize){return false}for(var cutDown=1;cutDown<=4;cutDown*=2){var overGrownHeapSize=oldSize*(1+.2/cutDown);overGrownHeapSize=Math.min(overGrownHeapSize,requestedSize+100663296);var newSize=Math.min(maxHeapSize,alignMemory(Math.max(requestedSize,overGrownHeapSize),65536));var replacement=growMemory(newSize);if(replacement){return true}}return false}var _emscripten_runtime_keepalive_check=keepRuntimeAlive;var ENV={};var getExecutableName=()=>thisProgram;var getEnvStrings=()=>{if(!getEnvStrings.strings){var lang=(globalThis.navigator?.language??"C").replace("-","_")+".UTF-8";var env={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:lang,_:getExecutableName()};for(var x in ENV){if(ENV[x]===undefined)delete env[x];else env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(`${x}=${env[x]}`)}getEnvStrings.strings=strings}return getEnvStrings.strings};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return proxyToMainThread(3,0,1,__environ,environ_buf);__environ>>>=0;environ_buf>>>=0;var bufSize=0;var envp=0;for(var string of getEnvStrings()){var ptr=environ_buf+bufSize;(growMemViews(),HEAPU32)[__environ+envp>>>2>>>0]=ptr;bufSize+=stringToUTF8(string,ptr,Infinity)+1;envp+=4}return 0}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return proxyToMainThread(4,0,1,penviron_count,penviron_buf_size);penviron_count>>>=0;penviron_buf_size>>>=0;var strings=getEnvStrings();(growMemViews(),HEAPU32)[penviron_count>>>2>>>0]=strings.length;var bufSize=0;for(var string of strings){bufSize+=lengthBytesUTF8(string)+1}(growMemViews(),HEAPU32)[penviron_buf_size>>>2>>>0]=bufSize;return 0}var stringToNewUTF8=str=>{var size=lengthBytesUTF8(str)+1;var ret=_malloc(size);if(ret)stringToUTF8(str,ret,size);return ret};function _lsp_next_message(){if(ENVIRONMENT_IS_PTHREAD)return proxyToMainThread(5,0,2);return Module.lspNextMessage().then(stringToNewUTF8)}var _lsp_send_message=function(body){if(ENVIRONMENT_IS_PTHREAD)return proxyToMainThread(6,0,1,body);body>>>=0;const text=UTF8ToString(body);queueMicrotask(()=>Module.lspOnMessage(text))};var initRandomFill=()=>{if(ENVIRONMENT_IS_NODE){var nodeCrypto=require("node:crypto");return view=>(nodeCrypto.randomFillSync(view),0)}return view=>(view.set(crypto.getRandomValues(new Uint8Array(view.byteLength))),0)};var randomFill=view=>(randomFill=initRandomFill())(view);function _random_get(buffer,size){buffer>>>=0;size>>>=0;return randomFill((growMemViews(),HEAPU8).subarray(buffer>>>0,buffer+size>>>0))}var stringToUTF8OnStack=str=>{var size=lengthBytesUTF8(str)+1;var ret=stackAlloc(size);stringToUTF8(str,ret,size);return ret};var PATH={isAbs:path=>path.charAt(0)==="/",splitPath:filename=>{var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:(parts,allowAboveRoot)=>{var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:path=>{var isAbsolute=PATH.isAbs(path),trailingSlash=path.slice(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(p=>!!p),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:path=>{var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.slice(0,-1)}return root+dir},basename:path=>path&&path.match(/([^\/]+|\/)\/*$/)[1],join:(...paths)=>PATH.normalize(paths.join("/")),join2:(l,r)=>PATH.normalize(l+"/"+r)};var withStackSave=f=>{var stack=stackSave();var ret=f();stackRestore(stack);return ret};var readI53FromI64=ptr=>(growMemViews(),HEAPU32)[ptr>>>2>>>0]+(growMemViews(),HEAP32)[ptr+4>>>2>>>0]*4294967296;var readI53FromU64=ptr=>(growMemViews(),HEAPU32)[ptr>>>2>>>0]+(growMemViews(),HEAPU32)[ptr+4>>>2>>>0]*4294967296;var FS_mknod=(path,mode,dev)=>FS.handleError(withStackSave(()=>{var pathBuffer=stringToUTF8OnStack(path);return __wasmfs_mknod(pathBuffer,mode,dev)}));var FS_create=(path,mode=438)=>{mode&=4095;mode|=32768;return FS_mknod(path,mode,0)};var FS_fileDataToTypedArray=data=>{if(typeof data=="string"){data=intArrayFromString(data,true)}if(!data.subarray){data=new Uint8Array(data)}return data};var FS_writeFile=(path,data)=>{var sp=stackSave();var pathBuffer=stringToUTF8OnStack(path);data=FS_fileDataToTypedArray(data);var len=data.length;var dataBuffer=_malloc(len);(growMemViews(),HEAPU8).set(data,dataBuffer>>>0);var ret=__wasmfs_write_file(pathBuffer,dataBuffer,len);_free(dataBuffer);stackRestore(sp);return ret};var FS_createDataFile=(parent,name,fileData,canRead,canWrite,canOwn)=>{var pathName=name?parent+"/"+name:parent;var mode=FS_getMode(canRead,canWrite);if(!wasmFSPreloadingFlushed){wasmFSPreloadedFiles.push({pathName,fileData,mode})}else{FS_create(pathName,mode);FS_writeFile(pathName,fileData)}};var asyncLoad=async url=>{var arrayBuffer=await readAsync(url);return new Uint8Array(arrayBuffer)};var PATH_FS={resolve:(...args)=>{var resolvedPath="",resolvedAbsolute=false;for(var i=args.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?args[i]:FS.cwd();if(typeof path!="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=PATH.isAbs(path)}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(p=>!!p),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:(from,to)=>{from=PATH_FS.resolve(from).slice(1);to=PATH_FS.resolve(to).slice(1);function trim(arr){var start=0;for(;start<arr.length;start++){if(arr[start]!=="")break}var end=arr.length-1;for(;end>=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i<length;i++){if(fromParts[i]!==toParts[i]){samePartsLength=i;break}}var outputParts=[];for(var i=samePartsLength;i<fromParts.length;i++){outputParts.push("..")}outputParts=outputParts.concat(toParts.slice(samePartsLength));return outputParts.join("/")}};var getUniqueRunDependency=id=>id;var preloadPlugins=[];var FS_handledByPreloadPlugin=async(byteArray,fullname)=>{if(typeof Browser!="undefined")Browser.init();for(var plugin of preloadPlugins){if(plugin["canHandle"](fullname)){return plugin["handle"](byteArray,fullname)}}return byteArray};var FS_preloadFile=async(parent,name,url,canRead,canWrite,dontCreateFile,canOwn,preFinish)=>{var fullname=name?PATH_FS.resolve(PATH.join2(parent,name)):parent;var dep=getUniqueRunDependency(`cp ${fullname}`);addRunDependency(dep);try{var byteArray=url;if(typeof url=="string"){byteArray=await asyncLoad(url)}byteArray=await FS_handledByPreloadPlugin(byteArray,fullname);preFinish?.();if(!dontCreateFile){FS_createDataFile(parent,name,byteArray,canRead,canWrite,canOwn)}}finally{removeRunDependency(dep)}};var FS_createPreloadedFile=(parent,name,url,canRead,canWrite,onload,onerror,dontCreateFile,canOwn,preFinish)=>{FS_preloadFile(parent,name,url,canRead,canWrite,dontCreateFile,canOwn,preFinish).then(onload).catch(onerror)};var FS_getMode=(canRead,canWrite)=>{var mode=0;if(canRead)mode|=292|73;if(canWrite)mode|=146;return mode};var FS_modeStringToFlags=str=>{if(typeof str!="string")return str;var flagModes={r:0,"r+":2,w:512|64|1,"w+":512|64|2,a:1024|64|1,"a+":1024|64|2};var flags=flagModes[str];if(typeof flags=="undefined"){throw new Error(`Unknown file open mode: ${str}`)}return flags};var FS_mkdir=(path,mode=511)=>FS.handleError(withStackSave(()=>{var buffer=stringToUTF8OnStack(path);return __wasmfs_mkdir(buffer,mode)}));var FS_mkdirTree=(path,mode)=>{var dirs=path.split("/");var d="";for(var dir of dirs){if(!dir)continue;if(d||PATH.isAbs(path))d+="/";d+=dir;try{FS_mkdir(d,mode)}catch(e){if(e.errno!=20)throw e}}};var FS_unlink=path=>withStackSave(()=>{var buffer=stringToUTF8OnStack(path);return __wasmfs_unlink(buffer)});var wasmFS$backends={};var wasmFSDevices={};var wasmFSDeviceStreams={};var FS={ErrnoError:class extends Error{name="ErrnoError";message="FS error";constructor(code){super();this.errno=code}},handleError(returnValue){if(returnValue<0){throw new FS.ErrnoError(-returnValue)}return returnValue},createDataFile(parent,name,fileData,canRead,canWrite,canOwn){FS_createDataFile(parent,name,fileData,canRead,canWrite,canOwn)},createPath(parent,path,canRead,canWrite){var parts=path.split("/").reverse();while(parts.length){var part=parts.pop();if(!part)continue;var current=PATH.join2(parent,part);if(!wasmFSPreloadingFlushed){wasmFSPreloadedDirs.push({parentPath:parent,childName:part})}else{try{FS.mkdir(current)}catch(e){if(e.errno!=20)throw e}}parent=current}return current},createPreloadedFile(parent,name,url,canRead,canWrite,onload,onerror,dontCreateFile,canOwn,preFinish){return FS_createPreloadedFile(parent,name,url,canRead,canWrite,onload,onerror,dontCreateFile,canOwn,preFinish)},async preloadFile(parent,name,url,canRead,canWrite,dontCreateFile,canOwn,preFinish){return FS_preloadFile(parent,name,url,canRead,canWrite,dontCreateFile,canOwn,preFinish)},readFile(path,opts={}){opts.encoding=opts.encoding||"binary";if(opts.encoding!=="utf8"&&opts.encoding!=="binary"){throw new Error(`Invalid encoding type "${opts.encoding}"`)}var buf,length;withStackSave(()=>{var bufPtr=stackAlloc(4);var sizePtr=stackAlloc(4);FS.handleError(-__wasmfs_read_file(stringToUTF8OnStack(path),bufPtr,sizePtr));buf=(growMemViews(),HEAPU32)[bufPtr>>>2>>>0];length=readI53FromI64(sizePtr)});return opts.encoding==="utf8"?UTF8ToString(buf,length):(growMemViews(),HEAPU8).slice(buf,buf+length)},cwd:()=>UTF8ToString(__wasmfs_get_cwd()),analyzePath(path){var exists=!!FS.findObject(path);return{exists,object:{contents:exists?FS.readFile(path):null}}},mkdir:(path,mode)=>FS_mkdir(path,mode),mkdirTree:(path,mode)=>FS_mkdirTree(path,mode),rmdir:path=>FS.handleError(withStackSave(()=>__wasmfs_rmdir(stringToUTF8OnStack(path)))),open:(path,flags,mode=438)=>withStackSave(()=>{flags=FS_modeStringToFlags(flags);var buffer=stringToUTF8OnStack(path);var fd=FS.handleError(__wasmfs_open(buffer,flags,mode));return{fd}}),create:(path,mode)=>FS_create(path,mode),close:stream=>FS.handleError(-__wasmfs_close(stream.fd)),unlink:path=>FS_unlink(path),chdir:path=>withStackSave(()=>__wasmfs_chdir(stringToUTF8OnStack(path))),read(stream,buffer,offset,length,position){var seeking=typeof position!="undefined";var dataBuffer=_malloc(length);var bytesRead;if(seeking){bytesRead=__wasmfs_pread(stream.fd,dataBuffer,length,BigInt(position))}else{bytesRead=__wasmfs_read(stream.fd,dataBuffer,length)}if(bytesRead>0){buffer.set((growMemViews(),HEAPU8).subarray(dataBuffer>>>0,dataBuffer+bytesRead>>>0),offset)}_free(dataBuffer);return FS.handleError(bytesRead)},write(stream,buffer,offset,length,position,canOwn){var seeking=typeof position!="undefined";var dataBuffer=_malloc(length);for(var i=0;i<length;i++){(growMemViews(),HEAP8)[dataBuffer+i>>>0]=buffer[offset+i]}var bytesRead;if(seeking){bytesRead=__wasmfs_pwrite(stream.fd,dataBuffer,length,BigInt(position))}else{bytesRead=__wasmfs_write(stream.fd,dataBuffer,length)}_free(dataBuffer);return FS.handleError(bytesRead)},writeFile:(path,data)=>FS_writeFile(path,data),mmap:(stream,length,offset,prot,flags)=>{var buf=FS.handleError(__wasmfs_mmap(length,prot,flags,stream.fd,BigInt(offset)));return{ptr:buf,allocated:true}},msync:(stream,bufferPtr,offset,length,mmapFlags)=>FS.handleError(__wasmfs_msync(bufferPtr,length,mmapFlags)),munmap:(addr,length)=>FS.handleError(__wasmfs_munmap(addr,length)),symlink:(target,linkpath)=>withStackSave(()=>__wasmfs_symlink(stringToUTF8OnStack(target),stringToUTF8OnStack(linkpath))),readlink(path){return withStackSave(()=>{var bufPtr=stackAlloc(4);FS.handleError(__wasmfs_readlink(stringToUTF8OnStack(path),bufPtr));var readBuffer=(growMemViews(),HEAPU32)[bufPtr>>>2>>>0];return UTF8ToString(readBuffer)})},statBufToObject(statBuf){return{dev:(growMemViews(),HEAPU32)[statBuf>>>2>>>0],mode:(growMemViews(),HEAPU32)[statBuf+4>>>2>>>0],nlink:(growMemViews(),HEAPU32)[statBuf+8>>>2>>>0],uid:(growMemViews(),HEAPU32)[statBuf+12>>>2>>>0],gid:(growMemViews(),HEAPU32)[statBuf+16>>>2>>>0],rdev:(growMemViews(),HEAPU32)[statBuf+20>>>2>>>0],size:readI53FromI64(statBuf+24),blksize:(growMemViews(),HEAP32)[statBuf+32>>>2>>>0],blocks:(growMemViews(),HEAP32)[statBuf+36>>>2>>>0],atime:readI53FromI64(statBuf+40),mtime:readI53FromI64(statBuf+56),ctime:readI53FromI64(statBuf+72),ino:readI53FromU64(statBuf+88)}},stat(path){return withStackSave(()=>{var statBuf=stackAlloc(96);FS.handleError(__wasmfs_stat(stringToUTF8OnStack(path),statBuf));return FS.statBufToObject(statBuf)})},lstat(path){return withStackSave(()=>{var statBuf=stackAlloc(96);FS.handleError(__wasmfs_lstat(stringToUTF8OnStack(path),statBuf));return FS.statBufToObject(statBuf)})},chmod(path,mode){return FS.handleError(withStackSave(()=>{var buffer=stringToUTF8OnStack(path);return __wasmfs_chmod(buffer,mode)}))},lchmod(path,mode){return FS.handleError(withStackSave(()=>{var buffer=stringToUTF8OnStack(path);return __wasmfs_lchmod(buffer,mode)}))},fchmod(fd,mode){return FS.handleError(__wasmfs_fchmod(fd,mode))},utime:(path,atime,mtime)=>FS.handleError(withStackSave(()=>__wasmfs_utime(stringToUTF8OnStack(path),atime,mtime))),truncate(path,len){return FS.handleError(withStackSave(()=>__wasmfs_truncate(stringToUTF8OnStack(path),BigInt(len))))},ftruncate(fd,len){return FS.handleError(__wasmfs_ftruncate(fd,BigInt(len)))},findObject(path){var result=withStackSave(()=>__wasmfs_identify(stringToUTF8OnStack(path)));if(result==44){return null}return{isFolder:result==31,isDevice:false}},readdir:path=>withStackSave(()=>{var pathBuffer=stringToUTF8OnStack(path);var entries=[];var state=__wasmfs_readdir_start(pathBuffer);if(!state){throw new Error("No such directory")}var entry;while(entry=__wasmfs_readdir_get(state)){entries.push(UTF8ToString(entry))}__wasmfs_readdir_finish(state);return entries}),mount:(type,opts,mountpoint)=>{var backendPointer=type.createBackend(opts);return FS.handleError(withStackSave(()=>__wasmfs_mount(stringToUTF8OnStack(mountpoint),backendPointer)))},unmount:mountpoint=>FS.handleError(withStackSave(()=>_wasmfs_unmount(stringToUTF8OnStack(mountpoint)))),mknod:(path,mode,dev)=>FS_mknod(path,mode,dev),makedev:(ma,mi)=>ma<<8|mi,registerDevice(dev,ops){var backendPointer=_wasmfs_create_jsimpl_backend();var definedOps={userRead:ops.read,userWrite:ops.write,allocFile:file=>{wasmFSDeviceStreams[file]={}},freeFile:file=>{wasmFSDeviceStreams[file]=undefined},getSize:file=>{},setSize:(file,size)=>0,read:(file,buffer,length,offset)=>{var bufferArray=(growMemViews(),HEAP8).subarray(buffer>>>0,buffer+length>>>0);try{var bytesRead=definedOps.userRead(wasmFSDeviceStreams[file],bufferArray,0,length,offset)}catch(e){return-e.errno}(growMemViews(),HEAP8).set(bufferArray,buffer>>>0);return bytesRead},write:(file,buffer,length,offset)=>{var bufferArray=(growMemViews(),HEAP8).subarray(buffer>>>0,buffer+length>>>0);try{var bytesWritten=definedOps.userWrite(wasmFSDeviceStreams[file],bufferArray,0,length,offset)}catch(e){return-e.errno}(growMemViews(),HEAP8).set(bufferArray,buffer>>>0);return bytesWritten}};wasmFS$backends[backendPointer]=definedOps;wasmFSDevices[dev]=backendPointer},createDevice(parent,name,input,output){if(typeof parent!="string"){throw new Error("Only string paths are accepted")}var path=PATH.join2(parent,name);var mode=FS_getMode(!!input,!!output);FS.createDevice.major??=64;var dev=FS.makedev(FS.createDevice.major++,0);FS.registerDevice(dev,{read(stream,buffer,offset,length,pos){var bytesRead=0;for(var i=0;i<length;i++){var result;try{result=input()}catch(e){throw new FS.ErrnoError(29)}if(result===undefined&&!bytesRead){throw new FS.ErrnoError(6)}if(result===null||result===undefined)break;bytesRead++;buffer[offset+i]=result}return bytesRead},write(stream,buffer,offset,length,pos){for(var i=0;i<length;i++){try{output(buffer[offset+i])}catch(e){throw new FS.ErrnoError(29)}}return i}});return FS.mkdev(path,mode,dev)},mkdev(path,mode,dev){if(typeof dev==="undefined"){dev=mode;mode=438}var deviceBackend=wasmFSDevices[dev];if(!deviceBackend){throw new Error("Invalid device ID.")}return FS.handleError(withStackSave(()=>_wasmfs_create_file(stringToUTF8OnStack(path),mode,deviceBackend)))},rename(oldPath,newPath){return FS.handleError(withStackSave(()=>{var oldPathBuffer=stringToUTF8OnStack(oldPath);var newPathBuffer=stringToUTF8OnStack(newPath);return __wasmfs_rename(oldPathBuffer,newPathBuffer)}))},llseek(stream,offset,whence){return FS.handleError(__wasmfs_llseek(stream.fd,BigInt(offset),whence))}};var FS_createPath=FS.createPath;PThread.init();{initMemory();if(Module["noExitRuntime"])noExitRuntime=Module["noExitRuntime"];if(Module["print"])out=Module["print"];if(Module["printErr"])err=Module["printErr"];if(Module["arguments"])programArgs=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];var preInit=Module["preInit"];if(preInit){if(typeof preInit=="function")Module["preInit"]=preInit=[preInit];while(preInit.length>0){preInit.shift()()}}}Module["callMain"]=callMain;Module["addRunDependency"]=addRunDependency;Module["removeRunDependency"]=removeRunDependency;Module["FS_preloadFile"]=FS_preloadFile;Module["FS_unlink"]=FS_unlink;Module["FS_createPath"]=FS_createPath;Module["FS"]=FS;Module["FS_createDataFile"]=FS_createDataFile;var proxiedFunctionTable=[_proc_exit,exitOnMainThread,pthreadCreateProxied,_environ_get,_environ_sizes_get,_lsp_next_message,_lsp_send_message];var _free,_main,_malloc,__emscripten_tls_init,_pthread_self,__emscripten_proxy_main,___funcs_on_exit,__emscripten_thread_init,___set_thread_state,__emscripten_thread_crashed,__emscripten_run_js_on_main_thread_done,__emscripten_run_js_on_main_thread,__emscripten_thread_free_data,__emscripten_thread_exit,__emscripten_check_mailbox,___trap,_emscripten_stack_set_limits,__emscripten_stack_restore,__emscripten_stack_alloc,_emscripten_stack_get_current,__wasmfs_read_file,__wasmfs_write_file,__wasmfs_mkdir,__wasmfs_rmdir,__wasmfs_open,__wasmfs_mknod,__wasmfs_unlink,__wasmfs_chdir,__wasmfs_symlink,__wasmfs_readlink,__wasmfs_write,__wasmfs_pwrite,__wasmfs_chmod,__wasmfs_fchmod,__wasmfs_lchmod,__wasmfs_llseek,__wasmfs_rename,__wasmfs_read,__wasmfs_pread,__wasmfs_truncate,__wasmfs_ftruncate,__wasmfs_close,__wasmfs_mmap,__wasmfs_msync,__wasmfs_munmap,__wasmfs_utime,__wasmfs_stat,__wasmfs_lstat,__wasmfs_mount,__wasmfs_identify,__wasmfs_readdir_start,__wasmfs_readdir_get,__wasmfs_readdir_finish,__wasmfs_get_cwd,_wasmfs_create_jsimpl_backend,_wasmfs_create_file,_wasmfs_unmount,__indirect_function_table,__RNvNvNvCs1UuzqRJXGGW_7base_db1__1__6___CTOR,__RNvNvNvCs1UuzqRJXGGW_7base_dbs0_1__1__6___CTOR,__RNvNvNvCs1UuzqRJXGGW_7base_dbs1_1__1__6___CTOR,__RNvNvNvCs1UuzqRJXGGW_7base_dbs_1__1__6___CTOR,__RNvNvNvNtCs1UuzqRJXGGW_7base_db17editioned_file_id1__1__6___CTOR,__RNvNvNvNtNtCs1UuzqRJXGGW_7base_db5input7package1__1__6___CTOR,__RNvNvNvNtNtCs1UuzqRJXGGW_7base_db5input7packages0_1__1__6___CTOR,__RNvNvNvNtNtCs1UuzqRJXGGW_7base_db5input7packages_1__1__6___CTOR,__RNvNvNvNvMsk_NtCs1UuzqRJXGGW_7base_db17editioned_file_idNtBb_15EditionedFileId12parse_errors1__1__6___CTOR,__RNvNvNvNvMsk_NtCs1UuzqRJXGGW_7base_db17editioned_file_idNtBb_15EditionedFileId5parse1__1__6___CTOR,__RNvNvNvNvNtNtCs1UuzqRJXGGW_7base_db5input7package12file_package1__1__6___CTOR,__RNvNvNvNvNtNtCs1UuzqRJXGGW_7base_db5input7package12file_packages_1__1__6___CTOR,__RNvNvNvNvNtNtCs1UuzqRJXGGW_7base_db5input7package13package_by_id1__1__6___CTOR,__RNvNvNvNvNtNtCs1UuzqRJXGGW_7base_db5input7package13package_by_ids_1__1__6___CTOR,__RNvNvNvNtCskQX0yDIt0AC_7hir_def2db1__1__6___CTOR,__RNvNvNvNtCskQX0yDIt0AC_7hir_def2dbs0_1__1__6___CTOR,__RNvNvNvNtCskQX0yDIt0AC_7hir_def2dbs1_1__1__6___CTOR,__RNvNvNvNtCskQX0yDIt0AC_7hir_def2dbs2_1__1__6___CTOR,__RNvNvNvNtCskQX0yDIt0AC_7hir_def2dbs3_1__1__6___CTOR,__RNvNvNvNtCskQX0yDIt0AC_7hir_def2dbs4_1__1__6___CTOR,__RNvNvNvNtCskQX0yDIt0AC_7hir_def2dbs5_1__1__6___CTOR,__RNvNvNvNtCskQX0yDIt0AC_7hir_def2dbs6_1__1__6___CTOR,__RNvNvNvNtCskQX0yDIt0AC_7hir_def2dbs_1__1__6___CTOR,__RNvNvNvNvMs1c_NtCskQX0yDIt0AC_7hir_def9item_treeNtBc_8ItemTree2of1__1__6___CTOR,__RNvNvNvNvMs8_NtNtCskQX0yDIt0AC_7hir_def15name_resolution11modules_mapNtBb_10ModulesMap2of1__1__6___CTOR,__RNvNvNvNvMsD_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_18TypeAliasSignature15with_source_map1__1__6___CTOR,__RNvNvNvNvMsD_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_18TypeAliasSignature2of1__1__6___CTOR,__RNvNvNvNvMsI_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_17VariableSignature15with_source_map1__1__6___CTOR,__RNvNvNvNvMsI_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_17VariableSignature2of1__1__6___CTOR,__RNvNvNvNvMsN_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_17ConstantSignature15with_source_map1__1__6___CTOR,__RNvNvNvNvMsN_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_17ConstantSignature2of1__1__6___CTOR,__RNvNvNvNvMsS_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_17OverrideSignature15with_source_map1__1__6___CTOR,__RNvNvNvNvMsS_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_17OverrideSignature2of1__1__6___CTOR,__RNvNvNvNvMsX_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_24AssertStatementSignature15with_source_map1__1__6___CTOR,__RNvNvNvNvMsX_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_24AssertStatementSignature2of1__1__6___CTOR,__RNvNvNvNvMsb_NtCskQX0yDIt0AC_7hir_def6ast_idNtBb_8AstIdMap2of1__1__6___CTOR,__RNvNvNvNvMsd_NtNtCskQX0yDIt0AC_7hir_def4body5scopeNtBb_10ExprScopes2of1__1__6___CTOR,__RNvNvNvNvMse_NtCskQX0yDIt0AC_7hir_def4bodyNtBb_4Body15with_source_map1__1__6___CTOR,__RNvNvNvNvMse_NtCskQX0yDIt0AC_7hir_def4bodyNtBb_4Body2of1__1__6___CTOR,__RNvNvNvNvMsg_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_17FunctionSignature15with_source_map1__1__6___CTOR,__RNvNvNvNvMsg_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_17FunctionSignature2of1__1__6___CTOR,__RNvNvNvNvMsi_NtCskQX0yDIt0AC_7hir_def10item_scopeNtBb_9ItemScope2of1__1__6___CTOR,__RNvNvNvNvMsj_NtCskQX0yDIt0AC_7hir_def10attributesNtBb_19AttributesWithOwner15with_source_map1__1__6___CTOR,__RNvNvNvNvMsj_NtCskQX0yDIt0AC_7hir_def10attributesNtBb_19AttributesWithOwner2of1__1__6___CTOR,__RNvNvNvNvMsy_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_15StructSignature15with_source_map1__1__6___CTOR,__RNvNvNvNvMsy_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_15StructSignature2of1__1__6___CTOR,__RNvNvNvNtCs9ttXuVZZW3z_6hir_ty2db1__1__6___CTOR,__RNvNvNvNtCs9ttXuVZZW3z_6hir_ty2dbs0_1__1__6___CTOR,__RNvNvNvNtCs9ttXuVZZW3z_6hir_ty2dbs1_1__1__6___CTOR,__RNvNvNvNtCs9ttXuVZZW3z_6hir_ty2dbs_1__1__6___CTOR,__RNvNvNvNtCs9ttXuVZZW3z_6hir_ty2ty1__1__6___CTOR,__RNvNvNvNtCs9ttXuVZZW3z_6hir_ty5infer1__1__6___CTOR,__RNvNvNvNtCs9ttXuVZZW3z_6hir_ty8function1__1__6___CTOR,__RNvNvNvNvMsr_NtCs9ttXuVZZW3z_6hir_ty2tyNtBb_4Type16is_constructible1__1__6___CTOR,__RNvNvNvNvCs9KUhL2jd6df_6ide_db10line_index1__1__6___CTOR,__RNvNvNvNvCs9KUhL2jd6df_6ide_db10line_indexs_1__1__6___CTOR,wasmTable;function assignWasmExports(wasmExports){_free=wasmExports["W"];_main=Module["_main"]=wasmExports["X"];_malloc=wasmExports["Y"];__emscripten_tls_init=wasmExports["$a"];_pthread_self=wasmExports["ab"];__emscripten_proxy_main=Module["__emscripten_proxy_main"]=wasmExports["bb"];___funcs_on_exit=wasmExports["cb"];__emscripten_thread_init=wasmExports["db"];___set_thread_state=wasmExports["eb"];__emscripten_thread_crashed=wasmExports["fb"];__emscripten_run_js_on_main_thread_done=wasmExports["gb"];__emscripten_run_js_on_main_thread=wasmExports["hb"];__emscripten_thread_free_data=wasmExports["ib"];__emscripten_thread_exit=wasmExports["jb"];__emscripten_check_mailbox=wasmExports["kb"];___trap=wasmExports["lb"];_emscripten_stack_set_limits=wasmExports["mb"];__emscripten_stack_restore=wasmExports["nb"];__emscripten_stack_alloc=wasmExports["ob"];_emscripten_stack_get_current=wasmExports["pb"];__wasmfs_read_file=wasmExports["qb"];__wasmfs_write_file=wasmExports["rb"];__wasmfs_mkdir=wasmExports["sb"];__wasmfs_rmdir=wasmExports["tb"];__wasmfs_open=wasmExports["ub"];__wasmfs_mknod=wasmExports["vb"];__wasmfs_unlink=wasmExports["wb"];__wasmfs_chdir=wasmExports["xb"];__wasmfs_symlink=wasmExports["yb"];__wasmfs_readlink=wasmExports["zb"];__wasmfs_write=wasmExports["Ab"];__wasmfs_pwrite=wasmExports["Bb"];__wasmfs_chmod=wasmExports["Cb"];__wasmfs_fchmod=wasmExports["Db"];__wasmfs_lchmod=wasmExports["Eb"];__wasmfs_llseek=wasmExports["Fb"];__wasmfs_rename=wasmExports["Gb"];__wasmfs_read=wasmExports["Hb"];__wasmfs_pread=wasmExports["Ib"];__wasmfs_truncate=wasmExports["Jb"];__wasmfs_ftruncate=wasmExports["Kb"];__wasmfs_close=wasmExports["Lb"];__wasmfs_mmap=wasmExports["Mb"];__wasmfs_msync=wasmExports["Nb"];__wasmfs_munmap=wasmExports["Ob"];__wasmfs_utime=wasmExports["Pb"];__wasmfs_stat=wasmExports["Qb"];__wasmfs_lstat=wasmExports["Rb"];__wasmfs_mount=wasmExports["Sb"];__wasmfs_identify=wasmExports["Tb"];__wasmfs_readdir_start=wasmExports["Ub"];__wasmfs_readdir_get=wasmExports["Vb"];__wasmfs_readdir_finish=wasmExports["Wb"];__wasmfs_get_cwd=wasmExports["Xb"];_wasmfs_create_jsimpl_backend=wasmExports["Yb"];_wasmfs_create_file=wasmExports["Zb"];_wasmfs_unmount=wasmExports["_b"];__indirect_function_table=wasmTable=wasmExports["V"];__RNvNvNvCs1UuzqRJXGGW_7base_db1__1__6___CTOR=Module["__RNvNvNvCs1UuzqRJXGGW_7base_db1__1__6___CTOR"]=wasmExports["Z"].value>>>0;__RNvNvNvCs1UuzqRJXGGW_7base_dbs0_1__1__6___CTOR=Module["__RNvNvNvCs1UuzqRJXGGW_7base_dbs0_1__1__6___CTOR"]=wasmExports["_"].value>>>0;__RNvNvNvCs1UuzqRJXGGW_7base_dbs1_1__1__6___CTOR=Module["__RNvNvNvCs1UuzqRJXGGW_7base_dbs1_1__1__6___CTOR"]=wasmExports["$"].value>>>0;__RNvNvNvCs1UuzqRJXGGW_7base_dbs_1__1__6___CTOR=Module["__RNvNvNvCs1UuzqRJXGGW_7base_dbs_1__1__6___CTOR"]=wasmExports["aa"].value>>>0;__RNvNvNvNtCs1UuzqRJXGGW_7base_db17editioned_file_id1__1__6___CTOR=Module["__RNvNvNvNtCs1UuzqRJXGGW_7base_db17editioned_file_id1__1__6___CTOR"]=wasmExports["ba"].value>>>0;__RNvNvNvNtNtCs1UuzqRJXGGW_7base_db5input7package1__1__6___CTOR=Module["__RNvNvNvNtNtCs1UuzqRJXGGW_7base_db5input7package1__1__6___CTOR"]=wasmExports["ca"].value>>>0;__RNvNvNvNtNtCs1UuzqRJXGGW_7base_db5input7packages0_1__1__6___CTOR=Module["__RNvNvNvNtNtCs1UuzqRJXGGW_7base_db5input7packages0_1__1__6___CTOR"]=wasmExports["da"].value>>>0;__RNvNvNvNtNtCs1UuzqRJXGGW_7base_db5input7packages_1__1__6___CTOR=Module["__RNvNvNvNtNtCs1UuzqRJXGGW_7base_db5input7packages_1__1__6___CTOR"]=wasmExports["ea"].value>>>0;__RNvNvNvNvMsk_NtCs1UuzqRJXGGW_7base_db17editioned_file_idNtBb_15EditionedFileId12parse_errors1__1__6___CTOR=Module["__RNvNvNvNvMsk_NtCs1UuzqRJXGGW_7base_db17editioned_file_idNtBb_15EditionedFileId12parse_errors1__1__6___CTOR"]=wasmExports["fa"].value>>>0;__RNvNvNvNvMsk_NtCs1UuzqRJXGGW_7base_db17editioned_file_idNtBb_15EditionedFileId5parse1__1__6___CTOR=Module["__RNvNvNvNvMsk_NtCs1UuzqRJXGGW_7base_db17editioned_file_idNtBb_15EditionedFileId5parse1__1__6___CTOR"]=wasmExports["ga"].value>>>0;__RNvNvNvNvNtNtCs1UuzqRJXGGW_7base_db5input7package12file_package1__1__6___CTOR=Module["__RNvNvNvNvNtNtCs1UuzqRJXGGW_7base_db5input7package12file_package1__1__6___CTOR"]=wasmExports["ha"].value>>>0;__RNvNvNvNvNtNtCs1UuzqRJXGGW_7base_db5input7package12file_packages_1__1__6___CTOR=Module["__RNvNvNvNvNtNtCs1UuzqRJXGGW_7base_db5input7package12file_packages_1__1__6___CTOR"]=wasmExports["ia"].value>>>0;__RNvNvNvNvNtNtCs1UuzqRJXGGW_7base_db5input7package13package_by_id1__1__6___CTOR=Module["__RNvNvNvNvNtNtCs1UuzqRJXGGW_7base_db5input7package13package_by_id1__1__6___CTOR"]=wasmExports["ja"].value>>>0;__RNvNvNvNvNtNtCs1UuzqRJXGGW_7base_db5input7package13package_by_ids_1__1__6___CTOR=Module["__RNvNvNvNvNtNtCs1UuzqRJXGGW_7base_db5input7package13package_by_ids_1__1__6___CTOR"]=wasmExports["ka"].value>>>0;__RNvNvNvNtCskQX0yDIt0AC_7hir_def2db1__1__6___CTOR=Module["__RNvNvNvNtCskQX0yDIt0AC_7hir_def2db1__1__6___CTOR"]=wasmExports["la"].value>>>0;__RNvNvNvNtCskQX0yDIt0AC_7hir_def2dbs0_1__1__6___CTOR=Module["__RNvNvNvNtCskQX0yDIt0AC_7hir_def2dbs0_1__1__6___CTOR"]=wasmExports["ma"].value>>>0;__RNvNvNvNtCskQX0yDIt0AC_7hir_def2dbs1_1__1__6___CTOR=Module["__RNvNvNvNtCskQX0yDIt0AC_7hir_def2dbs1_1__1__6___CTOR"]=wasmExports["na"].value>>>0;__RNvNvNvNtCskQX0yDIt0AC_7hir_def2dbs2_1__1__6___CTOR=Module["__RNvNvNvNtCskQX0yDIt0AC_7hir_def2dbs2_1__1__6___CTOR"]=wasmExports["oa"].value>>>0;__RNvNvNvNtCskQX0yDIt0AC_7hir_def2dbs3_1__1__6___CTOR=Module["__RNvNvNvNtCskQX0yDIt0AC_7hir_def2dbs3_1__1__6___CTOR"]=wasmExports["pa"].value>>>0;__RNvNvNvNtCskQX0yDIt0AC_7hir_def2dbs4_1__1__6___CTOR=Module["__RNvNvNvNtCskQX0yDIt0AC_7hir_def2dbs4_1__1__6___CTOR"]=wasmExports["qa"].value>>>0;__RNvNvNvNtCskQX0yDIt0AC_7hir_def2dbs5_1__1__6___CTOR=Module["__RNvNvNvNtCskQX0yDIt0AC_7hir_def2dbs5_1__1__6___CTOR"]=wasmExports["ra"].value>>>0;__RNvNvNvNtCskQX0yDIt0AC_7hir_def2dbs6_1__1__6___CTOR=Module["__RNvNvNvNtCskQX0yDIt0AC_7hir_def2dbs6_1__1__6___CTOR"]=wasmExports["sa"].value>>>0;__RNvNvNvNtCskQX0yDIt0AC_7hir_def2dbs_1__1__6___CTOR=Module["__RNvNvNvNtCskQX0yDIt0AC_7hir_def2dbs_1__1__6___CTOR"]=wasmExports["ta"].value>>>0;__RNvNvNvNvMs1c_NtCskQX0yDIt0AC_7hir_def9item_treeNtBc_8ItemTree2of1__1__6___CTOR=Module["__RNvNvNvNvMs1c_NtCskQX0yDIt0AC_7hir_def9item_treeNtBc_8ItemTree2of1__1__6___CTOR"]=wasmExports["ua"].value>>>0;__RNvNvNvNvMs8_NtNtCskQX0yDIt0AC_7hir_def15name_resolution11modules_mapNtBb_10ModulesMap2of1__1__6___CTOR=Module["__RNvNvNvNvMs8_NtNtCskQX0yDIt0AC_7hir_def15name_resolution11modules_mapNtBb_10ModulesMap2of1__1__6___CTOR"]=wasmExports["va"].value>>>0;__RNvNvNvNvMsD_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_18TypeAliasSignature15with_source_map1__1__6___CTOR=Module["__RNvNvNvNvMsD_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_18TypeAliasSignature15with_source_map1__1__6___CTOR"]=wasmExports["wa"].value>>>0;__RNvNvNvNvMsD_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_18TypeAliasSignature2of1__1__6___CTOR=Module["__RNvNvNvNvMsD_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_18TypeAliasSignature2of1__1__6___CTOR"]=wasmExports["xa"].value>>>0;__RNvNvNvNvMsI_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_17VariableSignature15with_source_map1__1__6___CTOR=Module["__RNvNvNvNvMsI_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_17VariableSignature15with_source_map1__1__6___CTOR"]=wasmExports["ya"].value>>>0;__RNvNvNvNvMsI_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_17VariableSignature2of1__1__6___CTOR=Module["__RNvNvNvNvMsI_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_17VariableSignature2of1__1__6___CTOR"]=wasmExports["za"].value>>>0;__RNvNvNvNvMsN_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_17ConstantSignature15with_source_map1__1__6___CTOR=Module["__RNvNvNvNvMsN_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_17ConstantSignature15with_source_map1__1__6___CTOR"]=wasmExports["Aa"].value>>>0;__RNvNvNvNvMsN_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_17ConstantSignature2of1__1__6___CTOR=Module["__RNvNvNvNvMsN_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_17ConstantSignature2of1__1__6___CTOR"]=wasmExports["Ba"].value>>>0;__RNvNvNvNvMsS_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_17OverrideSignature15with_source_map1__1__6___CTOR=Module["__RNvNvNvNvMsS_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_17OverrideSignature15with_source_map1__1__6___CTOR"]=wasmExports["Ca"].value>>>0;__RNvNvNvNvMsS_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_17OverrideSignature2of1__1__6___CTOR=Module["__RNvNvNvNvMsS_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_17OverrideSignature2of1__1__6___CTOR"]=wasmExports["Da"].value>>>0;__RNvNvNvNvMsX_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_24AssertStatementSignature15with_source_map1__1__6___CTOR=Module["__RNvNvNvNvMsX_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_24AssertStatementSignature15with_source_map1__1__6___CTOR"]=wasmExports["Ea"].value>>>0;__RNvNvNvNvMsX_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_24AssertStatementSignature2of1__1__6___CTOR=Module["__RNvNvNvNvMsX_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_24AssertStatementSignature2of1__1__6___CTOR"]=wasmExports["Fa"].value>>>0;__RNvNvNvNvMsb_NtCskQX0yDIt0AC_7hir_def6ast_idNtBb_8AstIdMap2of1__1__6___CTOR=Module["__RNvNvNvNvMsb_NtCskQX0yDIt0AC_7hir_def6ast_idNtBb_8AstIdMap2of1__1__6___CTOR"]=wasmExports["Ga"].value>>>0;__RNvNvNvNvMsd_NtNtCskQX0yDIt0AC_7hir_def4body5scopeNtBb_10ExprScopes2of1__1__6___CTOR=Module["__RNvNvNvNvMsd_NtNtCskQX0yDIt0AC_7hir_def4body5scopeNtBb_10ExprScopes2of1__1__6___CTOR"]=wasmExports["Ha"].value>>>0;__RNvNvNvNvMse_NtCskQX0yDIt0AC_7hir_def4bodyNtBb_4Body15with_source_map1__1__6___CTOR=Module["__RNvNvNvNvMse_NtCskQX0yDIt0AC_7hir_def4bodyNtBb_4Body15with_source_map1__1__6___CTOR"]=wasmExports["Ia"].value>>>0;__RNvNvNvNvMse_NtCskQX0yDIt0AC_7hir_def4bodyNtBb_4Body2of1__1__6___CTOR=Module["__RNvNvNvNvMse_NtCskQX0yDIt0AC_7hir_def4bodyNtBb_4Body2of1__1__6___CTOR"]=wasmExports["Ja"].value>>>0;__RNvNvNvNvMsg_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_17FunctionSignature15with_source_map1__1__6___CTOR=Module["__RNvNvNvNvMsg_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_17FunctionSignature15with_source_map1__1__6___CTOR"]=wasmExports["Ka"].value>>>0;__RNvNvNvNvMsg_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_17FunctionSignature2of1__1__6___CTOR=Module["__RNvNvNvNvMsg_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_17FunctionSignature2of1__1__6___CTOR"]=wasmExports["La"].value>>>0;__RNvNvNvNvMsi_NtCskQX0yDIt0AC_7hir_def10item_scopeNtBb_9ItemScope2of1__1__6___CTOR=Module["__RNvNvNvNvMsi_NtCskQX0yDIt0AC_7hir_def10item_scopeNtBb_9ItemScope2of1__1__6___CTOR"]=wasmExports["Ma"].value>>>0;__RNvNvNvNvMsj_NtCskQX0yDIt0AC_7hir_def10attributesNtBb_19AttributesWithOwner15with_source_map1__1__6___CTOR=Module["__RNvNvNvNvMsj_NtCskQX0yDIt0AC_7hir_def10attributesNtBb_19AttributesWithOwner15with_source_map1__1__6___CTOR"]=wasmExports["Na"].value>>>0;__RNvNvNvNvMsj_NtCskQX0yDIt0AC_7hir_def10attributesNtBb_19AttributesWithOwner2of1__1__6___CTOR=Module["__RNvNvNvNvMsj_NtCskQX0yDIt0AC_7hir_def10attributesNtBb_19AttributesWithOwner2of1__1__6___CTOR"]=wasmExports["Oa"].value>>>0;__RNvNvNvNvMsy_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_15StructSignature15with_source_map1__1__6___CTOR=Module["__RNvNvNvNvMsy_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_15StructSignature15with_source_map1__1__6___CTOR"]=wasmExports["Pa"].value>>>0;__RNvNvNvNvMsy_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_15StructSignature2of1__1__6___CTOR=Module["__RNvNvNvNvMsy_NtCskQX0yDIt0AC_7hir_def9signatureNtBb_15StructSignature2of1__1__6___CTOR"]=wasmExports["Qa"].value>>>0;__RNvNvNvNtCs9ttXuVZZW3z_6hir_ty2db1__1__6___CTOR=Module["__RNvNvNvNtCs9ttXuVZZW3z_6hir_ty2db1__1__6___CTOR"]=wasmExports["Ra"].value>>>0;__RNvNvNvNtCs9ttXuVZZW3z_6hir_ty2dbs0_1__1__6___CTOR=Module["__RNvNvNvNtCs9ttXuVZZW3z_6hir_ty2dbs0_1__1__6___CTOR"]=wasmExports["Sa"].value>>>0;__RNvNvNvNtCs9ttXuVZZW3z_6hir_ty2dbs1_1__1__6___CTOR=Module["__RNvNvNvNtCs9ttXuVZZW3z_6hir_ty2dbs1_1__1__6___CTOR"]=wasmExports["Ta"].value>>>0;__RNvNvNvNtCs9ttXuVZZW3z_6hir_ty2dbs_1__1__6___CTOR=Module["__RNvNvNvNtCs9ttXuVZZW3z_6hir_ty2dbs_1__1__6___CTOR"]=wasmExports["Ua"].value>>>0;__RNvNvNvNtCs9ttXuVZZW3z_6hir_ty2ty1__1__6___CTOR=Module["__RNvNvNvNtCs9ttXuVZZW3z_6hir_ty2ty1__1__6___CTOR"]=wasmExports["Va"].value>>>0;__RNvNvNvNtCs9ttXuVZZW3z_6hir_ty5infer1__1__6___CTOR=Module["__RNvNvNvNtCs9ttXuVZZW3z_6hir_ty5infer1__1__6___CTOR"]=wasmExports["Wa"].value>>>0;__RNvNvNvNtCs9ttXuVZZW3z_6hir_ty8function1__1__6___CTOR=Module["__RNvNvNvNtCs9ttXuVZZW3z_6hir_ty8function1__1__6___CTOR"]=wasmExports["Xa"].value>>>0;__RNvNvNvNvMsr_NtCs9ttXuVZZW3z_6hir_ty2tyNtBb_4Type16is_constructible1__1__6___CTOR=Module["__RNvNvNvNvMsr_NtCs9ttXuVZZW3z_6hir_ty2tyNtBb_4Type16is_constructible1__1__6___CTOR"]=wasmExports["Ya"].value>>>0;__RNvNvNvNvCs9KUhL2jd6df_6ide_db10line_index1__1__6___CTOR=Module["__RNvNvNvNvCs9KUhL2jd6df_6ide_db10line_index1__1__6___CTOR"]=wasmExports["Za"].value>>>0;__RNvNvNvNvCs9KUhL2jd6df_6ide_db10line_indexs_1__1__6___CTOR=Module["__RNvNvNvNvCs9KUhL2jd6df_6ide_db10line_indexs_1__1__6___CTOR"]=wasmExports["_a"].value>>>0}var wasmImports;function assignWasmImports(){wasmImports={J:___call_sighandler,L:___pthread_create_js,l:__abort_js,P:__emscripten_init_main_thread_js,G:__emscripten_notify_mailbox_postmessage,j:__emscripten_receive_on_main_thread_js,K:__emscripten_runtime_keepalive_clear,h:__emscripten_thread_cleanup,O:__emscripten_thread_mailbox_await,g:__emscripten_thread_set_strongref,M:__localtime_js,N:__tzset_js,B:__wasmfs_copy_preloaded_file_data,z:__wasmfs_get_num_preloaded_dirs,A:__wasmfs_get_num_preloaded_files,x:__wasmfs_get_preloaded_child_path,v:__wasmfs_get_preloaded_file_mode,C:__wasmfs_get_preloaded_file_size,y:__wasmfs_get_preloaded_parent_path,w:__wasmfs_get_preloaded_path_name,u:__wasmfs_jsimpl_alloc_file,f:__wasmfs_jsimpl_free_file,s:__wasmfs_jsimpl_get_size,r:__wasmfs_jsimpl_read,p:__wasmfs_jsimpl_set_size,q:__wasmfs_jsimpl_write,E:__wasmfs_stdin_get_char,k:_clock_time_get,i:_emscripten_check_blocking_allowed,b:_emscripten_date_now,c:_emscripten_err,R:_emscripten_exit_with_live_runtime,H:_emscripten_get_heap_max,d:_emscripten_get_now,I:_emscripten_num_logical_cores,D:_emscripten_out,F:_emscripten_resize_heap,t:_emscripten_runtime_keepalive_check,n:_environ_get,o:_environ_sizes_get,e:_exit,T:_lsp_next_message,S:_lsp_send_message,a:wasmMemory,m:_proc_exit,Q:_random_get}}function applySignatureConversions(wasmExports){wasmExports=Object.assign({},wasmExports);var makeWrapper_pp=f=>a0=>f(a0)>>>0;var makeWrapper_p=f=>()=>f()>>>0;var makeWrapper_ppp=f=>(a0,a1)=>f(a0,a1)>>>0;var makeWrapper_pp____=f=>(a0,a1,a2,a3,a4)=>f(a0,a1,a2,a3,a4)>>>0;wasmExports["Y"]=makeWrapper_pp(wasmExports["Y"]);wasmExports["$a"]=makeWrapper_p(wasmExports["$a"]);wasmExports["ab"]=makeWrapper_p(wasmExports["ab"]);wasmExports["emscripten_builtin_memalign"]=makeWrapper_ppp(wasmExports["emscripten_builtin_memalign"]);wasmExports["ob"]=makeWrapper_pp(wasmExports["ob"]);wasmExports["pb"]=makeWrapper_p(wasmExports["pb"]);wasmExports["Mb"]=makeWrapper_pp____(wasmExports["Mb"]);wasmExports["Ub"]=makeWrapper_pp(wasmExports["Ub"]);wasmExports["Vb"]=makeWrapper_pp(wasmExports["Vb"]);wasmExports["Xb"]=makeWrapper_p(wasmExports["Xb"]);wasmExports["Yb"]=makeWrapper_p(wasmExports["Yb"]);wasmExports["wasmfs_create_memory_backend"]=makeWrapper_p(wasmExports["wasmfs_create_memory_backend"]);return wasmExports}function callMain(args=[]){var entryFunction=__emscripten_proxy_main;runtimeKeepalivePush();args.unshift(thisProgram);var argc=args.length;var argv=stackAlloc((argc+1)*4);var argv_ptr=argv;for(var arg of args){(growMemViews(),HEAPU32)[argv_ptr>>>2>>>0]=stringToUTF8OnStack(arg);argv_ptr+=4}(growMemViews(),HEAPU32)[argv_ptr>>>2>>>0]=0;try{var ret=entryFunction(argc,argv);exitJS(ret,true);return ret}catch(e){return handleException(e)}}async function run(args=programArgs){if(ENVIRONMENT_IS_PTHREAD){initRuntime();return}preRun();if(runDependencies){await resolveRunDependencies()}var setStatus=Module["setStatus"];if(setStatus){setStatus("Running...");await new Promise(resolve=>setTimeout(resolve,1));setTimeout(setStatus,1,"")}if(ABORT)return;initRuntime();Module["onRuntimeInitialized"]?.();var noInitialRun=Module["noInitialRun"]||true;if(!noInitialRun)callMain(args);postRun()}var wasmExports;if(!ENVIRONMENT_IS_PTHREAD){wasmExports=await createWasm();await run()}
2
+ ;return Module}export default createWgslAnalyzer;var isPthread=globalThis.name=="em-pthread";var isNode=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer";if(isNode)isPthread=(await import("node:worker_threads")).workerData==="em-pthread";isPthread&&createWgslAnalyzer();
Binary file
@@ -0,0 +1,91 @@
1
+ // src/fs.ts
2
+ function writeFile(fs, path, contents) {
3
+ const slash = path.lastIndexOf("/");
4
+ if (slash > 0) fs.mkdirTree(path.slice(0, slash));
5
+ fs.writeFile(path, contents);
6
+ }
7
+ function seedWorkspace(fs, root, files) {
8
+ fs.mkdirTree(root);
9
+ for (const [relative, contents] of Object.entries(files)) {
10
+ writeFile(fs, `${root}/${relative.replace(/^\/+/, "")}`, contents);
11
+ }
12
+ }
13
+
14
+ // src/host.ts
15
+ async function startHost(factory, options) {
16
+ const { root } = options;
17
+ const resolve = (relativePath) => `${root}/${relativePath.replace(/^\/+/, "")}`;
18
+ const inbox = new TransformStream();
19
+ const reader = inbox.readable.getReader();
20
+ const writer = inbox.writable.getWriter();
21
+ let exited = false;
22
+ const module = await factory({
23
+ noInitialRun: true,
24
+ printErr: options.onStderr,
25
+ onExit: (code) => {
26
+ exited = true;
27
+ queueMicrotask(() => options.onExit(code));
28
+ },
29
+ lspNextMessage: () => reader.read().then(({ value }) => value),
30
+ lspOnMessage: (body) => options.onMessage(JSON.parse(body))
31
+ });
32
+ seedWorkspace(module.FS, root, options.files);
33
+ module.FS.chdir(root);
34
+ if (module.FS.cwd() !== root) throw new Error(`cannot change directory to ${root}`);
35
+ module.callMain(options.args);
36
+ return {
37
+ send: (message) => {
38
+ if (!exited) void writer.write(JSON.stringify(message));
39
+ },
40
+ writeFile: (relativePath, contents) => {
41
+ if (!exited) writeFile(module.FS, resolve(relativePath), contents);
42
+ },
43
+ deleteFile: (relativePath) => {
44
+ const path = resolve(relativePath);
45
+ if (!exited && module.FS.analyzePath(path).exists) module.FS.unlink(path);
46
+ }
47
+ };
48
+ }
49
+
50
+ // src/worker.ts
51
+ var post = (message) => {
52
+ self.postMessage(message);
53
+ };
54
+ var host = null;
55
+ self.onmessage = (event) => {
56
+ const message = event.data;
57
+ switch (message.type) {
58
+ case "boot":
59
+ boot(message).catch((error) => {
60
+ post({
61
+ type: "error",
62
+ message: String(error),
63
+ stack: error instanceof Error ? error.stack : void 0
64
+ });
65
+ });
66
+ break;
67
+ case "lsp":
68
+ host?.send(message.message);
69
+ break;
70
+ case "writeFile":
71
+ host?.writeFile(message.path, message.contents);
72
+ break;
73
+ case "deleteFile":
74
+ host?.deleteFile(message.path);
75
+ break;
76
+ default:
77
+ break;
78
+ }
79
+ };
80
+ async function boot(message) {
81
+ const { default: createWgslAnalyzer } = await import("./wgsl_analyzer.js");
82
+ host = await startHost(createWgslAnalyzer, {
83
+ root: message.root,
84
+ files: message.files,
85
+ args: message.args,
86
+ onMessage: (lsp) => post({ type: "lsp", message: lsp }),
87
+ onStderr: (line) => post({ type: "stderr", line }),
88
+ onExit: (code) => post({ type: "exit", code })
89
+ });
90
+ post({ type: "ready" });
91
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * The emscripten module surface this package drives.
3
+ */
4
+ import type { EmscriptenFs } from "./fs.js";
5
+ /** The emscripten module members this package touches. */
6
+ export interface EmscriptenModule {
7
+ FS: EmscriptenFs;
8
+ callMain(args: readonly string[]): void;
9
+ }
10
+ export interface ModuleOptions {
11
+ noInitialRun: boolean;
12
+ printErr: (line: string) => void;
13
+ onExit: (code: number) => void;
14
+ /**
15
+ * Resolves to the next message for the server. It may run inside another call into the
16
+ * module, so it must not call into the module itself, and it must never reject.
17
+ */
18
+ lspNextMessage: () => Promise<string>;
19
+ /** Receives one message from the server, from a microtask. */
20
+ lspOnMessage: (body: string) => void;
21
+ }
22
+ export type ModuleFactory = (options: ModuleOptions) => Promise<EmscriptenModule>;
23
+ //# sourceMappingURL=emscripten.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emscripten.d.ts","sourceRoot":"","sources":["../src/emscripten.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,0DAA0D;AAC1D,MAAM,WAAW,gBAAgB;IAChC,EAAE,EAAE,YAAY,CAAC;IAEjB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;CACxC;AAED,MAAM,WAAW,aAAa;IAC7B,YAAY,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAE/B;;;OAGG;IACH,cAAc,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IACtC,8DAA8D;IAC9D,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAED,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * The emscripten module surface this package drives.
3
+ */
4
+ export {};
5
+ //# sourceMappingURL=emscripten.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emscripten.js","sourceRoot":"","sources":["../src/emscripten.ts"],"names":[],"mappings":"AAAA;;GAEG"}
package/dist/fs.d.ts ADDED
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Seeding the emscripten in-memory filesystem.
3
+ *
4
+ * This runs once the module factory has resolved, and before `callMain`,
5
+ * so the workspace is already on disk by the time the server's VFS scans it.
6
+ */
7
+ /**
8
+ * The subset of emscripten's `FS` module this package relies on.
9
+ *
10
+ * https://emscripten.org/docs/api_reference/Filesystem-API.html#new-file-system-wasmfs
11
+ */
12
+ export interface EmscriptenFs {
13
+ mkdirTree(path: string): void;
14
+ writeFile(path: string, data: string | Uint8Array): void;
15
+ unlink(path: string): void;
16
+ chdir(path: string): void;
17
+ cwd(): string;
18
+ analyzePath(path: string): {
19
+ exists: boolean;
20
+ };
21
+ }
22
+ /** Writes one file, creating its parent directories first. */
23
+ export declare function writeFile(fs: EmscriptenFs, path: string, contents: string | Uint8Array): void;
24
+ /** Populates `root` with `files`, whose keys are paths relative to it. */
25
+ export declare function seedWorkspace(fs: EmscriptenFs, root: string, files: Record<string, string | Uint8Array>): void;
26
+ //# sourceMappingURL=fs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../src/fs.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;GAIG;AACH,MAAM,WAAW,YAAY;IAC5B,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAAC;IACzD,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,GAAG,IAAI,MAAM,CAAC;IACd,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG;QAAE,MAAM,EAAE,OAAO,CAAA;KAAE,CAAC;CAC/C;AAED,8DAA8D;AAC9D,wBAAgB,SAAS,CAAC,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAI7F;AAED,0EAA0E;AAC1E,wBAAgB,aAAa,CAC5B,EAAE,EAAE,YAAY,EAChB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CAAC,GACxC,IAAI,CAKN"}