motely-wasm 16.0.0 → 17.2.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/README.md +42 -88
- package/bin/dotnet.native.wasm +0 -0
- package/boot.d.mts +35 -0
- package/boot.mjs +69 -0
- package/config.d.mts +4 -0
- package/config.mjs +45 -0
- package/dotnet/dotnet.d.ts +2 -0
- package/{types → dotnet}/dotnet.g.d.ts +0 -4
- package/dotnet/dotnet.js +4 -0
- package/dotnet/dotnet.native.d.ts +2 -0
- package/dotnet/dotnet.native.js +16 -0
- package/dotnet/dotnet.runtime.d.ts +2 -0
- package/dotnet/dotnet.runtime.js +3 -0
- package/{types/modules.d.ts → dotnet/index.d.mts} +1 -13
- package/dotnet/index.mjs +3 -0
- package/event.mjs +65 -0
- package/exports.d.mts +3 -0
- package/exports.mjs +6 -0
- package/generated/bootsharp/file-system.g.d.mts +193 -0
- package/generated/bootsharp/file-system.g.mjs +33 -0
- package/generated/common.g.mjs +8 -0
- package/generated/imports.g.d.mts +2 -0
- package/generated/imports.g.mjs +7 -0
- package/generated/index.g.d.mts +15 -0
- package/generated/index.g.mjs +18 -0
- package/generated/instances.g.mjs +12 -0
- package/generated/motely/wasm.g.d.mts +12 -0
- package/generated/resources.g.d.mts +3 -0
- package/generated/resources.g.mjs +16 -0
- package/generated/serialization.g.mjs +135 -0
- package/{types/imports.d.ts → imports.d.mts} +1 -1
- package/imports.mjs +6 -0
- package/index.d.mts +21 -0
- package/index.mjs +8 -1339
- package/instances.d.mts +7 -0
- package/instances.mjs +54 -0
- package/jaml.schema.json +310 -278
- package/package.json +10 -42
- package/resources.d.mts +39 -0
- package/resources.mjs +18 -0
- package/{types/runtime.d.ts → runtime.d.mts} +1 -1
- package/runtime.mjs +14 -0
- package/{types/serialization.d.ts → serialization.d.mts} +11 -4
- package/serialization.mjs +331 -0
- package/smoke.mjs +36 -0
- package/sync-version.mjs +10 -0
- package/types/bindings.g.d.ts +0 -251
- package/types/boot.d.ts +0 -38
- package/types/config.d.ts +0 -6
- package/types/decoder.d.ts +0 -1
- package/types/exports.d.ts +0 -3
- package/types/index.d.ts +0 -22
- package/types/instances.d.ts +0 -14
- package/types/resources.d.ts +0 -24
- package/types/resources.g.d.ts +0 -3
- /package/{types/event.d.ts → event.d.mts} +0 -0
package/README.md
CHANGED
|
@@ -1,111 +1,65 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Motely.Wasm
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Bootsharp host for the browser/JavaScript Motely package. It keeps all Bootsharp attributes, dependency injection, and JavaScript interop concerns out of the core `Motely` library.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
- **Single-threaded.** No `SharedArrayBuffer`, no COOP/COEP headers required — runs on Vercel, Cloudflare Pages, GitHub Pages, MCP Apps iframes, and every other locked-down host.
|
|
7
|
-
- **Browser + Node + Deno + Bun + Edge.** Pure ES module, no Node-only APIs.
|
|
8
|
-
- **Typed.** Generated TypeScript declarations for the full Motely / JAML surface ship in `types/`.
|
|
5
|
+
## Build
|
|
9
6
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
```bash
|
|
13
|
-
npm install motely-wasm
|
|
7
|
+
```powershell
|
|
8
|
+
dotnet publish Motely.Wasm/Motely.Wasm.csproj -c Debug
|
|
14
9
|
```
|
|
15
10
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
```ts
|
|
19
|
-
import motely, { MotelyWasm, MotelyWasmEvents } from "motely-wasm";
|
|
11
|
+
Debug publishes use the regular .NET browser WASM toolchain and are the quickest way to verify the contract. Release publishes enable Bootsharp's NativeAOT-LLVM path; install Binaryen's `wasm-opt` for fully optimized release output.
|
|
20
12
|
|
|
21
|
-
|
|
13
|
+
Bootsharp alpha packages are resolved from user-level NuGet feeds. The sponsor-only `Bootsharp.FileSystem` extension is consumed from a local Bootsharp Extra checkout through the `BootsharpExtraRoot` MSBuild property. Set it in your environment or user-local MSBuild props; do not commit personal drive paths.
|
|
22
14
|
|
|
23
|
-
|
|
24
|
-
name: Blueprint Copy Engine
|
|
25
|
-
deck: Red
|
|
26
|
-
stake: White
|
|
27
|
-
must:
|
|
28
|
-
- rareJoker: Blueprint
|
|
29
|
-
antes: [1, 2, 3]
|
|
30
|
-
should:
|
|
31
|
-
- rareJoker: Brainstorm
|
|
32
|
-
score: 80
|
|
33
|
-
`;
|
|
34
|
-
|
|
35
|
-
// Events are mutable handler slots — assign your callback, do NOT call .subscribe().
|
|
36
|
-
MotelyWasmEvents.notifyResult = (seed, score, tallyColumns) => console.log(seed, score, tallyColumns);
|
|
37
|
-
MotelyWasmEvents.notifyProgress = (seedsSearched, matchingSeeds) => { /* … */ };
|
|
38
|
-
MotelyWasmEvents.notifyComplete = (status, totalSeedsSearched, matchingSeeds) => { /* … */ };
|
|
39
|
-
|
|
40
|
-
const search = MotelyWasm.startRandomSearch(jaml, 10_000);
|
|
41
|
-
// later: search.cancel(); search.dispose();
|
|
42
|
-
```
|
|
15
|
+
The generated ES module is written to `motely-wasm/`:
|
|
43
16
|
|
|
44
|
-
|
|
17
|
+
- `motely-wasm/index.mjs` and generated bindings
|
|
18
|
+
- `motely-wasm/package.json`
|
|
19
|
+
- `motely-wasm/bin/` runtime and WASM binaries
|
|
45
20
|
|
|
46
|
-
|
|
21
|
+
Bootsharp writes the ES module package skeleton during publish. `Motely.Wasm/sync-package.mjs` runs immediately afterward to add the Motely npm metadata, version, README, schema export, and publish hooks.
|
|
47
22
|
|
|
48
|
-
|
|
49
|
-
|---|---|
|
|
50
|
-
| `startSequentialSearch(jaml, batchCharCount, startBatch, endBatch)` | Deterministic walk through a slice of the 35⁸ ≈ 2.25T seed space. |
|
|
51
|
-
| `startRandomSearch(jaml, randomSeedCount)` | Random sampling. |
|
|
52
|
-
| `startSeedListSearch(jaml, seeds[])` | Verify a known list of seeds against a JAML filter. |
|
|
53
|
-
| `startKeywordSearch(jaml, keywordsCsv, paddingChars)` | Match seeds containing keywords (CSV input, padding controls anchoring). |
|
|
54
|
-
| `startAestheticSearch(jaml, JamlAesthetic)` | Curated themed pools: `Palindrome`, `Psychosis`, `Gross`, `Nsfw`, `Funny`, `Balatro`. |
|
|
23
|
+
## JavaScript Usage
|
|
55
24
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
## Single-seed inspection
|
|
59
|
-
|
|
60
|
-
```ts
|
|
61
|
-
const ctx = MotelyWasm.createSearchContext("DPADD313", JamlDeck.Red, JamlStake.White);
|
|
62
|
-
const boss = ctx.getBossForAnte(1);
|
|
63
|
-
// + voucher / tag / booster / shop item / joker / tarot / spectral / planet streams,
|
|
64
|
-
// each with a *Chunk variant for batched pulls.
|
|
65
|
-
ctx.dispose();
|
|
66
|
-
```
|
|
25
|
+
Bootsharp 0.8's browser boot API takes the runtime resource root directly. File-system imports must be wired before booting when the JAML library APIs are used:
|
|
67
26
|
|
|
68
|
-
|
|
27
|
+
```js
|
|
28
|
+
import bootsharp, { Motely } from "./motely-wasm/index.mjs";
|
|
29
|
+
import { IFileMounter } from "./motely-wasm/bootsharp/file-system.g.mjs";
|
|
30
|
+
import * as fs from "@rewaffle/bootsharp-file-system";
|
|
69
31
|
|
|
70
|
-
|
|
32
|
+
fs.init(IFileMounter);
|
|
33
|
+
await bootsharp.boot("/bin");
|
|
71
34
|
|
|
72
|
-
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
35
|
+
const version = Motely.version();
|
|
36
|
+
const result = Motely.loadJaml(`
|
|
37
|
+
must:
|
|
38
|
+
- joker: Blueprint
|
|
39
|
+
antes: [1]
|
|
40
|
+
`);
|
|
41
|
+
if (!result.ok) console.error(result.error);
|
|
78
42
|
```
|
|
79
43
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
### Content Security Policy
|
|
44
|
+
When serving from the repository root, `/bin` must resolve to `motely-wasm/bin`. If the module is hosted under a subpath, pass that subpath's binary root, for example `await bootsharp.boot("/motely-wasm/bin")`.
|
|
83
45
|
|
|
84
|
-
|
|
46
|
+
Node usage is not supported: Bootsharp boots by `fetch()`ing wasm/assemblies, and Node's built-in `fetch` does not handle `file://`. Serve the package over HTTP, or run in a real browser.
|
|
85
47
|
|
|
86
|
-
|
|
87
|
-
script-src https://unpkg.com https://cdn.jsdelivr.net
|
|
88
|
-
connect-src https://unpkg.com https://cdn.jsdelivr.net
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
## Types
|
|
92
|
-
|
|
93
|
-
```ts
|
|
94
|
-
import type {
|
|
95
|
-
IMotelyWasmSearch,
|
|
96
|
-
IMotelyWasmSearchContext,
|
|
97
|
-
MotelyWasmSearchSnapshot,
|
|
98
|
-
MotelyWasmSearchCompletion,
|
|
99
|
-
JamlDeck, JamlStake, JamlAesthetic,
|
|
100
|
-
} from "motely-wasm";
|
|
101
|
-
```
|
|
48
|
+
## Exported Contract
|
|
102
49
|
|
|
103
|
-
The generated `
|
|
50
|
+
The generated `Motely` namespace currently exposes these JAML helpers:
|
|
104
51
|
|
|
105
|
-
|
|
52
|
+
- `version()` → string (assembly informational version)
|
|
53
|
+
- `loadJaml(yaml)` → `{ ok: boolean, error: string | null }`
|
|
54
|
+
- `explainJaml(yaml)` → `{ ok: boolean, error: string | null, explanation: string | null }`
|
|
106
55
|
|
|
107
|
-
|
|
56
|
+
And these file-system helpers backed by `Bootsharp.FileSystem`:
|
|
108
57
|
|
|
109
|
-
|
|
58
|
+
- `pickRoot(options?)` → `Promise<string | null>`
|
|
59
|
+
- `mountRoot(root, options?)` → `Promise<string>`
|
|
60
|
+
- `unmountRoot(root)` → `Promise<void>`
|
|
61
|
+
- `readTextFile(root, uri)` → `Promise<string>`
|
|
62
|
+
- `writeTextFile(root, uri, text)` → `Promise<void>`
|
|
63
|
+
- `onFileChanges` — event of `Change[]`
|
|
110
64
|
|
|
111
|
-
|
|
65
|
+
Search and seed analysis are not yet exported. `analyzeSeed`, `analyzeJamlSeed`, `analyzeJamlSeeds`, and `searchJamlPage` are planned; track them in `Motely.Wasm/Program.cs` before relying on them.
|
|
Binary file
|
package/boot.d.mts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { RuntimeConfig, RuntimeAPI } from "./dotnet/index.mjs";
|
|
2
|
+
import { BootResources } from "./resources.mjs";
|
|
3
|
+
/** Lifecycle status of the runtime module. */
|
|
4
|
+
export declare enum BootStatus {
|
|
5
|
+
/** Ready to boot. */
|
|
6
|
+
Standby = 0,
|
|
7
|
+
/** Async boot process is in progress. */
|
|
8
|
+
Booting = 1,
|
|
9
|
+
/** Booted and ready for interop. */
|
|
10
|
+
Booted = 2
|
|
11
|
+
}
|
|
12
|
+
/** Custom configuration of the runtime boot process. */
|
|
13
|
+
export type BootOptions = {
|
|
14
|
+
/** Custom runtime configuration. */
|
|
15
|
+
readonly config?: RuntimeConfig;
|
|
16
|
+
/** Customization hook for creating the runtime instance. */
|
|
17
|
+
readonly create?: (config: RuntimeConfig) => Promise<RuntimeAPI>;
|
|
18
|
+
/** Customization hook for binding imported C# APIs. */
|
|
19
|
+
readonly import?: (runtime: RuntimeAPI) => Promise<void>;
|
|
20
|
+
/** Customization hook for binding exported C# APIs. */
|
|
21
|
+
readonly export?: (runtime: RuntimeAPI) => Promise<void>;
|
|
22
|
+
/** Customization hook for starting the runtime. */
|
|
23
|
+
readonly run?: (runtime: RuntimeAPI) => Promise<void>;
|
|
24
|
+
};
|
|
25
|
+
/** Returns current runtime module lifecycle state. */
|
|
26
|
+
export declare function getStatus(): BootStatus;
|
|
27
|
+
/** Initializes the runtime and binds C# APIs.
|
|
28
|
+
* @param resources Either URL to the boot resources root (eg, <code>/bin</code>) or the preloaded content.
|
|
29
|
+
* @param options Allows customizing the boot process and the runtime behaviour.
|
|
30
|
+
* @return Promise that resolves into the runtime instance when the initialization is finished. */
|
|
31
|
+
export declare function boot(resources: string | BootResources, options?: BootOptions): Promise<RuntimeAPI>;
|
|
32
|
+
/** Terminates the runtime and removes WASM module from memory.
|
|
33
|
+
* @param code Exit code; will use 0 (normal exit) by default.
|
|
34
|
+
* @param reason Exit reason description (optional). */
|
|
35
|
+
export declare function exit(code?: number, reason?: string): Promise<void>;
|
package/boot.mjs
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { app } from "./dotnet/index.mjs";
|
|
2
|
+
import { fetchResources } from "./resources.mjs";
|
|
3
|
+
import { buildConfig } from "./config.mjs";
|
|
4
|
+
import { bindImports } from "./imports.mjs";
|
|
5
|
+
import { bindExports } from "./exports.mjs";
|
|
6
|
+
import { setRuntime } from "./runtime.mjs";
|
|
7
|
+
/** Lifecycle status of the runtime module. */
|
|
8
|
+
export var BootStatus;
|
|
9
|
+
(function (BootStatus) {
|
|
10
|
+
/** Ready to boot. */
|
|
11
|
+
BootStatus[BootStatus["Standby"] = 0] = "Standby";
|
|
12
|
+
/** Async boot process is in progress. */
|
|
13
|
+
BootStatus[BootStatus["Booting"] = 1] = "Booting";
|
|
14
|
+
/** Booted and ready for interop. */
|
|
15
|
+
BootStatus[BootStatus["Booted"] = 2] = "Booted";
|
|
16
|
+
})(BootStatus || (BootStatus = {}));
|
|
17
|
+
let status = BootStatus.Standby;
|
|
18
|
+
/** Returns current runtime module lifecycle state. */
|
|
19
|
+
export function getStatus() {
|
|
20
|
+
return status;
|
|
21
|
+
}
|
|
22
|
+
/** Initializes the runtime and binds C# APIs.
|
|
23
|
+
* @param resources Either URL to the boot resources root (eg, <code>/bin</code>) or the preloaded content.
|
|
24
|
+
* @param options Allows customizing the boot process and the runtime behaviour.
|
|
25
|
+
* @return Promise that resolves into the runtime instance when the initialization is finished. */
|
|
26
|
+
export async function boot(resources, options) {
|
|
27
|
+
if (status === BootStatus.Booted)
|
|
28
|
+
throw Error("Failed to boot the C# runtime: already booted.");
|
|
29
|
+
if (status === BootStatus.Booting)
|
|
30
|
+
throw Error("Failed to boot the C# runtime: already booting.");
|
|
31
|
+
status = BootStatus.Booting;
|
|
32
|
+
const runtime = await createRuntime(resources, options ?? {});
|
|
33
|
+
status = BootStatus.Booted;
|
|
34
|
+
return runtime;
|
|
35
|
+
}
|
|
36
|
+
/** Terminates the runtime and removes WASM module from memory.
|
|
37
|
+
* @param code Exit code; will use 0 (normal exit) by default.
|
|
38
|
+
* @param reason Exit reason description (optional). */
|
|
39
|
+
export async function exit(code, reason) {
|
|
40
|
+
/* v8 ignore start -- @preserve */ // Uncoverable, as exit terminates the host test process.
|
|
41
|
+
if (status !== BootStatus.Booted)
|
|
42
|
+
throw Error("Failed to exit the C# runtime: not booted.");
|
|
43
|
+
try {
|
|
44
|
+
app.exit(code ?? 0, reason);
|
|
45
|
+
}
|
|
46
|
+
catch { }
|
|
47
|
+
finally {
|
|
48
|
+
status = BootStatus.Standby;
|
|
49
|
+
}
|
|
50
|
+
/* v8 ignore stop -- @preserve */
|
|
51
|
+
}
|
|
52
|
+
async function createRuntime(res, opt) {
|
|
53
|
+
const cfg = opt.config ?? buildConfig(typeof res === "string" ? await fetchResources(res) : res);
|
|
54
|
+
const runtime = await opt.create?.(cfg) || await app.dotnet.withConfig(cfg).create();
|
|
55
|
+
setRuntime(runtime);
|
|
56
|
+
if (opt.import)
|
|
57
|
+
await opt.import(runtime);
|
|
58
|
+
else
|
|
59
|
+
bindImports(runtime);
|
|
60
|
+
if (opt.run)
|
|
61
|
+
await opt.run(runtime);
|
|
62
|
+
else
|
|
63
|
+
await runtime.runMain(cfg.mainAssemblyName, []);
|
|
64
|
+
if (opt.export)
|
|
65
|
+
await opt.export(runtime);
|
|
66
|
+
else
|
|
67
|
+
await bindExports(runtime, cfg.mainAssemblyName);
|
|
68
|
+
return runtime;
|
|
69
|
+
}
|
package/config.d.mts
ADDED
package/config.mjs
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { manifest } from "./resources.mjs";
|
|
2
|
+
import * as nativeModule from "./dotnet/dotnet.native.js";
|
|
3
|
+
import * as runtimeModule from "./dotnet/dotnet.runtime.js";
|
|
4
|
+
/** Builds .NET runtime configuration from the specified boot resources. */
|
|
5
|
+
export function buildConfig(resources) {
|
|
6
|
+
return {
|
|
7
|
+
resources: {
|
|
8
|
+
wasmNative: [resolveAsset({ name: manifest.wasm, content: resources.wasm })],
|
|
9
|
+
jsModuleNative: [resolveModule("dotnet.native.js", nativeModule)],
|
|
10
|
+
jsModuleRuntime: [resolveModule("dotnet.runtime.js", runtimeModule)],
|
|
11
|
+
assembly: resources.assemblies?.map((resolveAsset)),
|
|
12
|
+
icu: resources.icu?.map((resolveAsset)),
|
|
13
|
+
wasmSymbols: resources.symbols?.map(resolveSymbols),
|
|
14
|
+
pdb: resources.pdb?.map((resolveAsset))
|
|
15
|
+
},
|
|
16
|
+
mainAssemblyName: manifest.entryAssemblyName,
|
|
17
|
+
globalizationMode: resolveGlobalizationMode(),
|
|
18
|
+
debugLevel: resources.symbols ? -1 : undefined
|
|
19
|
+
};
|
|
20
|
+
function resolveModule(name, exports) {
|
|
21
|
+
return { name, moduleExports: exports };
|
|
22
|
+
}
|
|
23
|
+
function resolveAsset(res) {
|
|
24
|
+
return { name: res.name, virtualPath: res.name, buffer: res.content };
|
|
25
|
+
}
|
|
26
|
+
function resolveSymbols(res) {
|
|
27
|
+
// Use 'resolveAsset<SymbolsAsset>()' once https://github.com/dotnet/runtime/pull/127087 is merged.
|
|
28
|
+
const txt = new TextDecoder("utf-8").decode(res.content);
|
|
29
|
+
return {
|
|
30
|
+
name: res.name,
|
|
31
|
+
pendingDownload: {
|
|
32
|
+
name: res.name,
|
|
33
|
+
url: res.name,
|
|
34
|
+
response: Promise.resolve(new Response(txt, { status: 200 }))
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function resolveGlobalizationMode() {
|
|
39
|
+
if (!resources.icu)
|
|
40
|
+
return "invariant";
|
|
41
|
+
if (resources.icu.some(res => res.name === "icudt.dat"))
|
|
42
|
+
return "all";
|
|
43
|
+
return "sharded";
|
|
44
|
+
}
|
|
45
|
+
}
|
package/dotnet/dotnet.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
//! Licensed to the .NET Foundation under one or more agreements.
|
|
2
|
+
//! The .NET Foundation licenses this file to you under the MIT license.
|
|
3
|
+
/*! bundlerFriendlyImports */
|
|
4
|
+
const e=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,8,1,6,0,6,64,25,11,11])),t=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,15,1,13,0,65,1,253,15,65,2,253,15,253,128,2,11])),o=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),n=Symbol.for("wasm promise_control");function r(e,t){let o=null;const r=new Promise(function(n,r){o={isDone:!1,promise:null,resolve:t=>{o.isDone||(o.isDone=!0,n(t),e&&e())},reject:e=>{o.isDone||(o.isDone=!0,r(e),t&&t())}}});o.promise=r;const i=r;return i[n]=o,{promise:i,promise_control:o}}function i(e){return e[n]}function s(e){e&&function(e){return void 0!==e[n]}(e)||Fe(!1,"Promise is not controllable")}const a="__mono_message__",l=["debug","log","trace","warn","info","error"],c="MONO_WASM: ";let d,u,f,m,g,p;function h(e){m=e}function w(e){if(Me.diagnosticTracing){const t="function"==typeof e?e():e;console.debug(c+t)}}function b(e,...t){console.info(c+e,...t)}function y(e,...t){console.info(e,...t)}function v(e,...t){console.warn(c+e,...t)}function E(e,...t){if(t&&t.length>0&&t[0]&&"object"==typeof t[0]){if(t[0].silent)return;if(t[0].toString)return void console.error(c+e,t[0].toString())}console.error(c+e,...t)}function _(e,t,o){return function(...n){try{let r=n[0];if(void 0===r)r="undefined";else if(null===r)r="null";else if("function"==typeof r)r=r.toString();else if("string"!=typeof r)try{r=JSON.stringify(r)}catch(e){r=r.toString()}t(o?JSON.stringify({method:e,payload:r,arguments:n.slice(1)}):[e+r,...n.slice(1)])}catch(e){f.error(`proxyConsole failed: ${e}`)}}}function T(e,t,o){u=t,m=e,f={...t};const n=`${o}/console`.replace("https://","wss://").replace("http://","ws://");d=new WebSocket(n),d.addEventListener("error",R),d.addEventListener("close",A),function(){for(const e of l)u[e]=_(`console.${e}`,x,!0)}()}function j(e){let t=30;const o=()=>{d?0==d.bufferedAmount||0==t?(e&&y(e),function(){for(const e of l)u[e]=_(`console.${e}`,f.log,!1)}(),d.removeEventListener("error",R),d.removeEventListener("close",A),d.close(1e3,e),d=void 0):(t--,globalThis.setTimeout(o,100)):e&&f&&f.log(e)};o()}function x(e){d&&d.readyState===WebSocket.OPEN?d.send(e):f.log(e)}function R(e){f.error(`[${m}] proxy console websocket error: ${e}`,e)}function A(e){f.debug(`[${m}] proxy console websocket closed: ${e}`,e)}function S(){Me.preferredIcuAsset=D(Me.config);let e="invariant"==Me.config.globalizationMode;if(!e)if(Me.preferredIcuAsset)Me.diagnosticTracing&&w("ICU data archive(s) available, disabling invariant mode");else{if("custom"===Me.config.globalizationMode||"all"===Me.config.globalizationMode||"sharded"===Me.config.globalizationMode){const e="invariant globalization mode is inactive and no ICU data archives are available";throw E(`ERROR: ${e}`),new Error(e)}Me.diagnosticTracing&&w("ICU data archive(s) not available, using invariant globalization mode"),e=!0,Me.preferredIcuAsset=null}const t="DOTNET_SYSTEM_GLOBALIZATION_INVARIANT",o=Me.config.environmentVariables;if(void 0===o[t]&&e&&(o[t]="1"),void 0===o.TZ)try{const e=Intl.DateTimeFormat().resolvedOptions().timeZone||null;e&&(o.TZ=e)}catch(e){b("failed to detect timezone, will fallback to UTC")}}function D(e){var t;if((null===(t=e.resources)||void 0===t?void 0:t.icu)&&"invariant"!=e.globalizationMode){const t=e.applicationCulture||(Ce?globalThis.navigator&&globalThis.navigator.languages&&globalThis.navigator.languages[0]:Intl.DateTimeFormat().resolvedOptions().locale);e.applicationCulture||(e.applicationCulture=t);const o=e.resources.icu;let n=null;if("custom"===e.globalizationMode){if(o.length>=1)return o[0].name}else t&&"all"!==e.globalizationMode?"sharded"===e.globalizationMode&&(n=function(e){const t=e.split("-")[0];return"en"===t||["fr","fr-FR","it","it-IT","de","de-DE","es","es-ES"].includes(e)?"icudt_EFIGS.dat":["zh","ko","ja"].includes(t)?"icudt_CJK.dat":"icudt_no_CJK.dat"}(t)):n="icudt.dat";if(n)for(let e=0;e<o.length;e++){const t=o[e];if(t.virtualPath===n)return t.name}}return e.globalizationMode="invariant",null}(new Date).valueOf();const O=class{constructor(e){this.url=e}toString(){return this.url}};async function C(e,t){try{const o="function"==typeof globalThis.fetch;if(Ae){const n=e.startsWith("file://");if(!n&&o)return globalThis.fetch(e,t||{credentials:"same-origin"});g||(p=await import(/*@vite-ignore*//*webpackIgnore:true*//*! webpackIgnore: true */"node:url"),g=await import(/*@vite-ignore*//*webpackIgnore:true*//*! webpackIgnore: true */"node:fs")),n&&(e=p.fileURLToPath(e));const r=await g.promises.readFile(e);return{ok:!0,headers:{length:0,get:()=>null},url:e,arrayBuffer:()=>r,json:()=>JSON.parse(r),text:()=>{throw new Error("NotImplementedException")}}}if(o)return globalThis.fetch(e,t||{credentials:"same-origin"});if("function"==typeof read)return{ok:!0,url:e,headers:{length:0,get:()=>null},arrayBuffer:()=>new Uint8Array(read(e,"binary")),json:()=>JSON.parse(read(e,"utf8")),text:()=>read(e,"utf8")}}catch(t){return{ok:!1,url:e,status:500,headers:{length:0,get:()=>null},statusText:"ERR28: "+t,arrayBuffer:()=>{throw t},json:()=>{throw t},text:()=>{throw t}}}throw new Error("No fetch implementation available")}function k(e){return"string"!=typeof e&&Fe(!1,"url must be a string"),!P(e)&&0!==e.indexOf("./")&&0!==e.indexOf("../")&&globalThis.URL&&globalThis.document&&globalThis.document.baseURI&&(e=new URL(/*@vite-ignore*//*webpackIgnore:true*/e,globalThis.document.baseURI).toString()),e}const I=/^[a-zA-Z][a-zA-Z\d+\-.]*?:\/\//,M=/[a-zA-Z]:[\\/]/;function P(e){return Ae||ke?e.startsWith("/")||e.startsWith("\\")||-1!==e.indexOf("///")||M.test(e):I.test(e)}let U,L=0;const N=[],$=[],z=new Map,W={"js-module-threads":!0,"js-module-runtime":!0,"js-module-dotnet":!0,"js-module-native":!0,"js-module-diagnostics":!0},F={...W,"js-module-library-initializer":!0},B={...W,dotnetwasm:!0,heap:!0,manifest:!0},V={...F,manifest:!0},H={...F,dotnetwasm:!0},J={dotnetwasm:!0,symbols:!0},q={...F,dotnetwasm:!0,symbols:!0},Z={symbols:!0};function Q(e){return!("icu"==e.behavior&&e.name!=Me.preferredIcuAsset)}function G(e,t,o){null!=t||(t=[]),Fe(1==t.length,`Expect to have one ${o} asset in resources`);const n=t[0];return n.behavior=o,K(n),e.push(n),n}function K(e){B[e.behavior]&&z.set(e.behavior,e)}function X(e){Fe(B[e],`Unknown single asset behavior ${e}`);const t=z.get(e);if(t&&!t.resolvedUrl)if(t.resolvedUrl=Me.locateFile(t.name),W[t.behavior]){const e=me(t);e?("string"!=typeof e&&Fe(!1,"loadBootResource response for 'dotnetjs' type should be a URL string"),t.resolvedUrl=e):t.resolvedUrl=le(t.resolvedUrl,t.behavior)}else if("dotnetwasm"!==t.behavior)throw new Error(`Unknown single asset behavior ${e}`);return t}function Y(e){const t=X(e);return Fe(t,`Single asset for ${e} not found`),t}let ee=!1;async function te(){if(!ee){ee=!0,Me.diagnosticTracing&&w("mono_download_assets");try{const e=[],t=[],o=(e,t)=>{!q[e.behavior]&&Q(e)&&Me.expected_instantiated_assets_count++,!H[e.behavior]&&Q(e)&&(Me.expected_downloaded_assets_count++,t.push(ie(e)))};for(const t of N)o(t,e);for(const e of $)o(e,t);Me.allDownloadsQueued.promise_control.resolve(),Promise.all([...e,...t]).then(()=>{Me.allDownloadsFinished.promise_control.resolve()}).catch(e=>{throw Me.err("Error in mono_download_assets: "+e),Ke(1,e),e}),await Me.runtimeModuleLoaded.promise;const n=async e=>{const t=await e;if(t.buffer){if(!q[t.behavior]){t.buffer&&"object"==typeof t.buffer||Fe(!1,"asset buffer must be array-like or buffer-like or promise of these"),"string"!=typeof t.resolvedUrl&&Fe(!1,"resolvedUrl must be string");const e=t.resolvedUrl,o=await t.buffer,n=new Uint8Array(o);ge(t),await Ie.beforeOnRuntimeInitialized.promise,await Ie.afterInstantiateWasm.promise,Ie.instantiate_asset(t,e,n)}}else J[t.behavior]?("symbols"===t.behavior&&(await Ie.instantiate_symbols_asset(t),ge(t)),J[t.behavior]&&++Me.actual_downloaded_assets_count):(t.isOptional||Fe(!1,"Expected asset to have the downloaded buffer"),!H[t.behavior]&&Q(t)&&Me.expected_downloaded_assets_count--,!q[t.behavior]&&Q(t)&&Me.expected_instantiated_assets_count--)},r=[],i=[];for(const t of e)r.push(n(t));for(const e of t)i.push(n(e));Promise.all(r).then(()=>{Oe||Ie.coreAssetsInMemory.promise_control.resolve()}).catch(e=>{throw Me.err("Error in mono_download_assets: "+e),Ke(1,e),e}),Promise.all(i).then(async()=>{Oe||(await Ie.coreAssetsInMemory.promise,Ie.allAssetsInMemory.promise_control.resolve())}).catch(e=>{throw Me.err("Error in mono_download_assets: "+e),Ke(1,e),e})}catch(e){throw Me.err("Error in mono_download_assets: "+e),e}}}let oe=!1;function ne(){if(oe)return;oe=!0;const e=Me.config,t=[];if(e.assets)for(const t of e.assets)"object"!=typeof t&&Fe(!1,`asset must be object, it was ${typeof t} : ${t}`),"string"!=typeof t.behavior&&Fe(!1,"asset behavior must be known string"),"string"!=typeof t.name&&Fe(!1,"asset name must be string"),t.resolvedUrl&&"string"!=typeof t.resolvedUrl&&Fe(!1,"asset resolvedUrl could be string"),t.hash&&"string"!=typeof t.hash&&Fe(!1,"asset resolvedUrl could be string"),t.pendingDownload&&"object"!=typeof t.pendingDownload&&Fe(!1,"asset pendingDownload could be object"),t.isCore?N.push(t):$.push(t),K(t);else if(e.resources){const o=e.resources;o.wasmNative||Fe(!1,"resources.wasmNative must be defined"),o.jsModuleNative||Fe(!1,"resources.jsModuleNative must be defined"),o.jsModuleRuntime||Fe(!1,"resources.jsModuleRuntime must be defined"),G($,o.wasmNative,"dotnetwasm"),G(t,o.jsModuleNative,"js-module-native"),G(t,o.jsModuleRuntime,"js-module-runtime"),o.jsModuleDiagnostics&&G(t,o.jsModuleDiagnostics,"js-module-diagnostics");const n=(e,t,o)=>{const n=e;n.behavior=t,o?(n.isCore=!0,N.push(n)):$.push(n)};if(o.coreAssembly)for(let e=0;e<o.coreAssembly.length;e++)n(o.coreAssembly[e],"assembly",!0);if(o.assembly)for(let e=0;e<o.assembly.length;e++)n(o.assembly[e],"assembly",!o.coreAssembly);if(0!=e.debugLevel&&Me.isDebuggingSupported()){if(o.corePdb)for(let e=0;e<o.corePdb.length;e++)n(o.corePdb[e],"pdb",!0);if(o.pdb)for(let e=0;e<o.pdb.length;e++)n(o.pdb[e],"pdb",!o.corePdb)}if(e.loadAllSatelliteResources&&o.satelliteResources)for(const e in o.satelliteResources)for(let t=0;t<o.satelliteResources[e].length;t++){const r=o.satelliteResources[e][t];r.culture=e,n(r,"resource",!o.coreAssembly)}if(o.coreVfs)for(let e=0;e<o.coreVfs.length;e++)n(o.coreVfs[e],"vfs",!0);if(o.vfs)for(let e=0;e<o.vfs.length;e++)n(o.vfs[e],"vfs",!o.coreVfs);const r=D(e);if(r&&o.icu)for(let e=0;e<o.icu.length;e++){const t=o.icu[e];t.name===r&&n(t,"icu",!1)}if(o.wasmSymbols)for(let e=0;e<o.wasmSymbols.length;e++)n(o.wasmSymbols[e],"symbols",!1)}if(e.appsettings)for(let t=0;t<e.appsettings.length;t++){const o=e.appsettings[t],n=pe(o);"appsettings.json"!==n&&n!==`appsettings.${e.applicationEnvironment}.json`||$.push({name:o,behavior:"vfs",noCache:!0,useCredentials:!0})}e.assets=[...N,...$,...t]}async function re(e){const t=await ie(e);return await t.pendingDownloadInternal.response,t.buffer}async function ie(e){try{return await se(e)}catch(t){if(!Me.enableDownloadRetry)throw t;if(ke||Ae)throw t;if(e.pendingDownload&&e.pendingDownloadInternal==e.pendingDownload)throw t;if(e.resolvedUrl&&-1!=e.resolvedUrl.indexOf("file://"))throw t;if(t&&404==t.status)throw t;e.pendingDownloadInternal=void 0,await Me.allDownloadsQueued.promise;try{return Me.diagnosticTracing&&w(`Retrying download '${e.name}'`),await se(e)}catch(t){return e.pendingDownloadInternal=void 0,await new Promise(e=>globalThis.setTimeout(e,100)),Me.diagnosticTracing&&w(`Retrying download (2) '${e.name}' after delay`),await se(e)}}}async function se(e){for(;U;)await U.promise;try{++L,L==Me.maxParallelDownloads&&(Me.diagnosticTracing&&w("Throttling further parallel downloads"),U=r());const t=await async function(e){if(e.pendingDownload&&(e.pendingDownloadInternal=e.pendingDownload),e.pendingDownloadInternal&&e.pendingDownloadInternal.response)return e.pendingDownloadInternal.response;if(e.buffer){const t=await e.buffer;return e.resolvedUrl||(e.resolvedUrl="undefined://"+e.name),e.pendingDownloadInternal={url:e.resolvedUrl,name:e.name,response:Promise.resolve({ok:!0,arrayBuffer:()=>t,json:()=>JSON.parse(new TextDecoder("utf-8").decode(t)),text:()=>{throw new Error("NotImplementedException")},headers:{get:()=>{}}})},e.pendingDownloadInternal.response}const t=e.loadRemote&&Me.config.remoteSources?Me.config.remoteSources:[""];let o;for(let n of t){n=n.trim(),"./"===n&&(n="");const t=ae(e,n);e.name===t?Me.diagnosticTracing&&w(`Attempting to download '${t}'`):Me.diagnosticTracing&&w(`Attempting to download '${t}' for ${e.name}`);try{e.resolvedUrl=t;const n=ue(e);if(e.pendingDownloadInternal=n,o=await n.response,!o||!o.ok)continue;return o}catch(e){o||(o={ok:!1,url:t,status:0,statusText:""+e});continue}}const n=e.isOptional||e.name.match(/\.pdb$/)&&Me.config.ignorePdbLoadErrors;if(o||Fe(!1,`Response undefined ${e.name}`),!n){const t=new Error(`download '${o.url}' for ${e.name} failed ${o.status} ${o.statusText}`);throw t.status=o.status,t}b(`optional download '${o.url}' for ${e.name} failed ${o.status} ${o.statusText}`)}(e);return t?(J[e.behavior]||(e.buffer=await t.arrayBuffer(),++Me.actual_downloaded_assets_count),e):e}finally{if(--L,U&&L==Me.maxParallelDownloads-1){Me.diagnosticTracing&&w("Resuming more parallel downloads");const e=U;U=void 0,e.promise_control.resolve()}}}function ae(e,t){let o;return null==t&&Fe(!1,`sourcePrefix must be provided for ${e.name}`),e.resolvedUrl?o=e.resolvedUrl:(o=""===t?"assembly"===e.behavior||"pdb"===e.behavior?e.name:"resource"===e.behavior&&e.culture&&""!==e.culture?`${e.culture}/${e.name}`:e.name:t+e.name,o=le(Me.locateFile(o),e.behavior)),o&&"string"==typeof o||Fe(!1,"attemptUrl need to be path or url string"),o}function le(e,t){return Me.modulesUniqueQuery&&V[t]&&(e+=Me.modulesUniqueQuery),e}let ce=0;const de=new Set;function ue(e){try{e.resolvedUrl||Fe(!1,"Request's resolvedUrl must be set");const t=function(e){let t=e.resolvedUrl;if(Me.loadBootResource){const o=me(e);if(o instanceof Promise)return o;"string"==typeof o&&(t=o)}const o={};return Me.config.disableNoCacheFetch||(o.cache="no-cache"),e.useCredentials?o.credentials="include":!Me.config.disableIntegrityCheck&&e.hash&&(o.integrity=e.hash),Me.fetch_like(t,o)}(e),o={name:e.name,url:e.resolvedUrl,response:t};return de.add(e.name),o.response.then(()=>{"assembly"==e.behavior&&Me.loadedAssemblies.push(e.name),ce++,Me.onDownloadResourceProgress&&Me.onDownloadResourceProgress(ce,de.size)}),o}catch(t){const o={ok:!1,url:e.resolvedUrl,status:500,statusText:"ERR29: "+t,arrayBuffer:()=>{throw t},json:()=>{throw t}};return{name:e.name,url:e.resolvedUrl,response:Promise.resolve(o)}}}const fe={resource:"assembly",assembly:"assembly",pdb:"pdb",icu:"globalization",vfs:"configuration",manifest:"manifest",dotnetwasm:"dotnetwasm","js-module-dotnet":"dotnetjs","js-module-native":"dotnetjs","js-module-runtime":"dotnetjs","js-module-threads":"dotnetjs"};function me(e){var t;if(Me.loadBootResource){const o=null!==(t=e.hash)&&void 0!==t?t:"",n=e.resolvedUrl,r=fe[e.behavior];if(r){const t=Me.loadBootResource(r,e.name,n,o,e.behavior);return"string"==typeof t?k(t):t}}}function ge(e){e.pendingDownloadInternal=null,e.pendingDownload=null,e.buffer=null,e.moduleExports=null}function pe(e){let t=e.lastIndexOf("/");return t>=0&&t++,e.substring(t)}async function he(e){e&&await Promise.all((null!=e?e:[]).map(e=>async function(e){try{const t=e.name;if(!e.moduleExports){const o=le(Me.locateFile(t),"js-module-library-initializer");Me.diagnosticTracing&&w(`Attempting to import '${o}' for ${e}`),e.moduleExports=await import(/*@vite-ignore*//*webpackIgnore:true*//*! webpackIgnore: true */o)}Me.libraryInitializers.push({scriptName:t,exports:e.moduleExports})}catch(t){v(`Failed to import library initializer '${e}': ${t}`)}}(e)))}async function we(e,t){if(!Me.libraryInitializers)return;const o=[];for(let n=0;n<Me.libraryInitializers.length;n++){const r=Me.libraryInitializers[n];r.exports[e]&&o.push(be(r.scriptName,e,()=>r.exports[e](...t)))}await Promise.all(o)}async function be(e,t,o){try{await o()}catch(o){throw v(`Failed to invoke '${t}' on library initializer '${e}': ${o}`),Ke(1,o),o}}function ye(e,t){if(e===t)return e;const o={...t};return void 0!==o.assets&&o.assets!==e.assets&&(o.assets=[...e.assets||[],...o.assets||[]]),void 0!==o.resources&&(o.resources=Ee(e.resources||{assembly:[],jsModuleNative:[],jsModuleRuntime:[],wasmNative:[]},o.resources)),void 0!==o.environmentVariables&&(o.environmentVariables={...e.environmentVariables||{},...o.environmentVariables||{}}),void 0!==o.runtimeOptions&&o.runtimeOptions!==e.runtimeOptions&&(o.runtimeOptions=[...e.runtimeOptions||[],...o.runtimeOptions||[]]),Object.assign(e,o)}function ve(e,t){if(e===t)return e;const o={...t};return o.config&&(e.config||(e.config={}),o.config=ye(e.config,o.config)),Object.assign(e,o)}function Ee(e,t){if(e===t)return e;const o={...t};return void 0!==o.coreAssembly&&(o.coreAssembly=[...e.coreAssembly||[],...o.coreAssembly||[]]),void 0!==o.assembly&&(o.assembly=[...e.assembly||[],...o.assembly||[]]),void 0!==o.lazyAssembly&&(o.lazyAssembly=[...e.lazyAssembly||[],...o.lazyAssembly||[]]),void 0!==o.corePdb&&(o.corePdb=[...e.corePdb||[],...o.corePdb||[]]),void 0!==o.pdb&&(o.pdb=[...e.pdb||[],...o.pdb||[]]),void 0!==o.jsModuleWorker&&(o.jsModuleWorker=[...e.jsModuleWorker||[],...o.jsModuleWorker||[]]),void 0!==o.jsModuleNative&&(o.jsModuleNative=[...e.jsModuleNative||[],...o.jsModuleNative||[]]),void 0!==o.jsModuleDiagnostics&&(o.jsModuleDiagnostics=[...e.jsModuleDiagnostics||[],...o.jsModuleDiagnostics||[]]),void 0!==o.jsModuleRuntime&&(o.jsModuleRuntime=[...e.jsModuleRuntime||[],...o.jsModuleRuntime||[]]),void 0!==o.wasmSymbols&&(o.wasmSymbols=[...e.wasmSymbols||[],...o.wasmSymbols||[]]),void 0!==o.wasmNative&&(o.wasmNative=[...e.wasmNative||[],...o.wasmNative||[]]),void 0!==o.icu&&(o.icu=[...e.icu||[],...o.icu||[]]),void 0!==o.satelliteResources&&(o.satelliteResources=function(e,t){if(e===t)return e;for(const o in t)e[o]=[...e[o]||[],...t[o]||[]];return e}(e.satelliteResources||{},o.satelliteResources||{})),void 0!==o.modulesAfterConfigLoaded&&(o.modulesAfterConfigLoaded=[...e.modulesAfterConfigLoaded||[],...o.modulesAfterConfigLoaded||[]]),void 0!==o.modulesAfterRuntimeReady&&(o.modulesAfterRuntimeReady=[...e.modulesAfterRuntimeReady||[],...o.modulesAfterRuntimeReady||[]]),void 0!==o.extensions&&(o.extensions={...e.extensions||{},...o.extensions||{}}),void 0!==o.vfs&&(o.vfs=[...e.vfs||[],...o.vfs||[]]),Object.assign(e,o)}function _e(){const e=Me.config;if(e.environmentVariables=e.environmentVariables||{},e.runtimeOptions=e.runtimeOptions||[],e.resources=e.resources||{assembly:[],jsModuleNative:[],jsModuleWorker:[],jsModuleRuntime:[],wasmNative:[],vfs:[],satelliteResources:{}},e.assets){Me.diagnosticTracing&&w("config.assets is deprecated, use config.resources instead");for(const t of e.assets){const o={};switch(t.behavior){case"assembly":o.assembly=[t];break;case"pdb":o.pdb=[t];break;case"resource":o.satelliteResources={},o.satelliteResources[t.culture]=[t];break;case"icu":o.icu=[t];break;case"symbols":o.wasmSymbols=[t];break;case"vfs":o.vfs=[t];break;case"dotnetwasm":o.wasmNative=[t];break;case"js-module-threads":o.jsModuleWorker=[t];break;case"js-module-runtime":o.jsModuleRuntime=[t];break;case"js-module-native":o.jsModuleNative=[t];break;case"js-module-diagnostics":o.jsModuleDiagnostics=[t];break;case"js-module-dotnet":break;default:throw new Error(`Unexpected behavior ${t.behavior} of asset ${t.name}`)}Ee(e.resources,o)}}e.debugLevel,e.applicationEnvironment||(e.applicationEnvironment="Production"),e.applicationCulture&&(e.environmentVariables.LANG=`${e.applicationCulture}.UTF-8`),Ie.diagnosticTracing=Me.diagnosticTracing=!!e.diagnosticTracing,Ie.waitForDebugger=e.waitForDebugger,Me.maxParallelDownloads=e.maxParallelDownloads||Me.maxParallelDownloads,Me.enableDownloadRetry=void 0!==e.enableDownloadRetry?e.enableDownloadRetry:Me.enableDownloadRetry}let Te=!1;async function je(e){var t,o;if(Te)return void await Me.afterConfigLoaded.promise;let n;try{if((null===(t=Me.config)||void 0===t?void 0:t.resources)||(Me.config||(Me.config={}),Me.config.resources={assembly:[],jsModuleNative:[{name:"dotnet.native.js"}],jsModuleWorker:[],jsModuleRuntime:[{name:"dotnet.runtime.js"}],wasmNative:[{name:"dotnet.native.wasm"}],vfs:[],satelliteResources:{}}),e.configSrc||Me.config&&0!==Object.keys(Me.config).length&&(Me.config.assets||Me.config.resources)||(e.configSrc="dotnet.boot.js"),n=e.configSrc,Te=!0,n&&(Me.diagnosticTracing&&w("mono_wasm_load_config"),await async function(e){const t=e.configSrc,o=Me.locateFile(t);let n=null;void 0!==Me.loadBootResource&&(n=Me.loadBootResource("manifest",t,o,"","manifest"));let r,i=null;if(n)if("string"==typeof n)n.includes(".json")?(i=await s(k(n)),r=await Re(i)):r=(await import(/*@vite-ignore*//*webpackIgnore:true*/k(n))).config;else{const e=await n;"function"==typeof e.json?(i=e,r=await Re(i)):r=e.config}else o.includes(".json")?(i=await s(le(o,"manifest")),r=await Re(i)):r=(await import(/*@vite-ignore*//*webpackIgnore:true*/le(o,"manifest"))).config;function s(e){return Me.fetch_like(e,{method:"GET",credentials:"include",cache:"no-cache"})}Me.config.applicationEnvironment&&(r.applicationEnvironment=Me.config.applicationEnvironment),ye(Me.config,r)}(e)),_e(),await he(null===(o=Me.config.resources)||void 0===o?void 0:o.modulesAfterConfigLoaded),await we("onRuntimeConfigLoaded",[Me.config]),e.onConfigLoaded)try{await e.onConfigLoaded(Me.config,Ue),_e()}catch(e){throw E("onConfigLoaded() failed",e),e}_e(),Me.afterConfigLoaded.promise_control.resolve(Me.config)}catch(t){const o=`Failed to load config file ${n} ${t} ${null==t?void 0:t.stack}`;throw Me.config=e.config=Object.assign(Me.config,{message:o,error:t,isError:!0}),Ke(1,new Error(o)),t}}function xe(){return!!globalThis.navigator&&(Me.isChromium||Me.isFirefox)}async function Re(e){const t=Me.config,o=await e.json();t.applicationEnvironment||o.applicationEnvironment||(o.applicationEnvironment=e.headers.get("Blazor-Environment")||e.headers.get("DotNet-Environment")||void 0),o.environmentVariables||(o.environmentVariables={});const n=e.headers.get("DOTNET-MODIFIABLE-ASSEMBLIES");n&&(o.environmentVariables.DOTNET_MODIFIABLE_ASSEMBLIES=n);const r=e.headers.get("ASPNETCORE-BROWSER-TOOLS");return r&&(o.environmentVariables.__ASPNETCORE_BROWSER_TOOLS=r),o}"function"!=typeof importScripts||globalThis.onmessage||(globalThis.dotnetSidecar=!0);const Ae="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,Se="function"==typeof importScripts,De=Se&&"undefined"!=typeof dotnetSidecar,Oe=Se&&!De,Ce="object"==typeof window||Se&&!Ae,ke=!Ce&&!Ae;let Ie={},Me={},Pe={},Ue={},Le={},Ne=!1;const $e={},ze={config:$e},We={mono:{},binding:{},internal:Le,module:ze,loaderHelpers:Me,runtimeHelpers:Ie,diagnosticHelpers:Pe,api:Ue};function Fe(e,t){if(e)return;const o="Assert failed: "+("function"==typeof t?t():t),n=new Error(o);E(o,n),Ie.nativeAbort(n)}function Be(){return void 0!==Me.exitCode}function Ve(){return Ie.runtimeReady&&!Be()}function He(){Be()&&Fe(!1,`.NET runtime already exited with ${Me.exitCode} ${Me.exitReason}. You can use runtime.runMain() which doesn't exit the runtime.`),Ie.runtimeReady||Fe(!1,".NET runtime didn't start yet. Please call dotnet.create() first.")}function Je(){Ce&&(globalThis.addEventListener("unhandledrejection",Ye),globalThis.addEventListener("error",et))}let qe,Ze;function Qe(e){Ze&&Ze(e),Ke(e,Me.exitReason)}function Ge(e){qe&&qe(e||Me.exitReason),Ke(1,e||Me.exitReason)}function Ke(e,t){var o;const n=t&&"object"==typeof t;e=n&&"number"==typeof t.status?t.status:void 0===e?-1:e;const r=n&&"string"==typeof t.message?t.message:""+t;(t=n?t:Ie.ExitStatus?function(e,t){const o=new Ie.ExitStatus(e);return o.message=t,o.toString=()=>t,o}(e,r):new Error("Exit with code "+e+" "+r)).status=e,t.message||(t.message=r);const i=""+(t.stack||(new Error).stack);try{Object.defineProperty(t,"stack",{get:()=>i})}catch(e){}const s=!!t.silent;if(t.silent=!0,Be())Me.diagnosticTracing&&w("mono_exit called after exit");else{try{ze.onAbort==Ge&&(ze.onAbort=qe),ze.onExit==Qe&&(ze.onExit=Ze),Ce&&(globalThis.removeEventListener("unhandledrejection",Ye),globalThis.removeEventListener("error",et)),Ie.runtimeReady?(Ie.jiterpreter_dump_stats&&Ie.jiterpreter_dump_stats(!1),0===e&&(null===(o=Me.config)||void 0===o?void 0:o.interopCleanupOnExit)&&Ie.forceDisposeProxies(!0,!0)):(Me.diagnosticTracing&&w(`abort_startup, reason: ${t}`),function(e){Me.allDownloadsQueued.promise_control.reject(e),Me.allDownloadsFinished.promise_control.reject(e),Me.afterConfigLoaded.promise_control.reject(e),Me.wasmCompilePromise.promise_control.reject(e),Me.runtimeModuleLoaded.promise_control.reject(e),Ie.dotnetReady&&(Ie.dotnetReady.promise_control.reject(e),Ie.afterInstantiateWasm.promise_control.reject(e),Ie.afterPreRun.promise_control.reject(e),Ie.beforeOnRuntimeInitialized.promise_control.reject(e),Ie.afterOnRuntimeInitialized.promise_control.reject(e),Ie.afterPostRun.promise_control.reject(e))}(t))}catch(e){v("mono_exit A failed",e)}try{s||(function(e,t){if(0!==e&&t){const e=Ie.ExitStatus&&t instanceof Ie.ExitStatus?w:E;"string"==typeof t?e(t):(void 0===t.stack&&(t.stack=(new Error).stack+""),t.message?e(Ie.stringify_as_error_with_stack?Ie.stringify_as_error_with_stack(t.message+"\n"+t.stack):t.message+"\n"+t.stack):e(JSON.stringify(t)))}!Oe&&Me.config&&(Me.config.logExitCode?Me.config.forwardConsoleLogsToWS?j("WASM EXIT "+e):y("WASM EXIT "+e):Me.config.forwardConsoleLogsToWS&&j())}(e,t),function(e){if(Ce&&!Oe&&Me.config&&Me.config.appendElementOnExit&&document){const t=document.createElement("label");t.id="tests_done",0!==e&&(t.style.background="red"),t.innerHTML=""+e,document.body.appendChild(t)}}(e))}catch(e){v("mono_exit B failed",e)}Me.exitCode=e,Me.exitReason||(Me.exitReason=t),!Oe&&Ie.runtimeReady&&ze.runtimeKeepalivePop()}if(Me.config&&Me.config.asyncFlushOnExit&&0===e)throw(async()=>{try{await async function(){try{const e=await import(/*@vite-ignore*//*webpackIgnore:true*//*! webpackIgnore: true */"node:process"),t=e=>new Promise((t,o)=>{e.on("error",o),e.end("","utf8",t)}),o=t(e.stderr),n=t(e.stdout);let r;const i=new Promise(e=>{r=setTimeout(()=>e("timeout"),1e3)});await Promise.race([Promise.all([n,o]),i]),clearTimeout(r)}catch(e){E(`flushing std* streams failed: ${e}`)}}()}finally{Xe(e,t)}})(),t;Xe(e,t)}function Xe(e,t){if(Ie.runtimeReady&&Ie.nativeExit)try{Ie.nativeExit(e)}catch(e){!Ie.ExitStatus||e instanceof Ie.ExitStatus||v("set_exit_code_and_quit_now failed: "+e.toString())}if(0!==e||!Ce)throw Ae?process.exit(e):Ie.quit&&Ie.quit(e,t),t}function Ye(e){tt(e,e.reason,"rejection")}function et(e){tt(e,e.error,"error")}function tt(e,t,o){e.preventDefault();try{t||(t=new Error("Unhandled "+o)),void 0===t.stack&&(t.stack=(new Error).stack),t.stack=t.stack+"",t.silent||(E("Unhandled error:",t),Ke(1,t))}catch(e){}}!function(n){if(Ne)throw new Error("Loader module already loaded");Ne=!0,Ie=n.runtimeHelpers,Me=n.loaderHelpers,Pe=n.diagnosticHelpers,Ue=n.api,Le=n.internal,Object.assign(Ue,{INTERNAL:Le,invokeLibraryInitializers:we}),Object.assign(n.module,{config:ye($e,{environmentVariables:{}})});const a={mono_wasm_bindings_is_ready:!1,config:n.module.config,diagnosticTracing:!1,nativeAbort:e=>{throw e||new Error("abort")},nativeExit:e=>{throw new Error("exit:"+e)}},l={gitHash:"430bff23a1a0b566d103fcbea797880ef1c0eb28",config:n.module.config,diagnosticTracing:!1,maxParallelDownloads:16,enableDownloadRetry:!0,_loaded_files:[],loadedFiles:[],loadedAssemblies:[],libraryInitializers:[],workerNextNumber:1,actual_downloaded_assets_count:0,actual_instantiated_assets_count:0,expected_downloaded_assets_count:0,expected_instantiated_assets_count:0,afterConfigLoaded:r(),allDownloadsQueued:r(),allDownloadsFinished:r(),wasmCompilePromise:r(),runtimeModuleLoaded:r(),loadingWorkers:r(),is_exited:Be,is_runtime_running:Ve,assert_runtime_running:He,mono_exit:Ke,createPromiseController:r,getPromiseController:i,assertIsControllablePromise:s,mono_download_assets:te,resolve_single_asset_path:Y,setup_proxy_console:T,set_thread_prefix:h,installUnhandledErrorHandler:Je,retrieve_asset_download:re,invokeLibraryInitializers:we,isDebuggingSupported:xe,exceptions:e,simd:o,relaxedSimd:t};Object.assign(Ie,a),Object.assign(Me,l)}(We);let ot,nt,rt,it=!1,st=!1;async function at(e){if(!st){if(st=!0,Ce&&Me.config.forwardConsoleLogsToWS&&void 0!==globalThis.WebSocket&&T("main",globalThis.console,globalThis.location.origin),ze||Fe(!1,"Null moduleConfig"),Me.config||Fe(!1,"Null moduleConfig.config"),"function"==typeof e){const t=e(We.api);if(t.ready)throw new Error("Module.ready couldn't be redefined.");Object.assign(ze,t),ve(ze,t)}else{if("object"!=typeof e)throw new Error("Can't use moduleFactory callback of createDotnetRuntime function.");ve(ze,e)}await async function(e){if(Ae){const e=await import(/*@vite-ignore*//*webpackIgnore:true*//*! webpackIgnore: true */"node:process"),t=14;if(e.versions.node.split(".")[0]<t)throw new Error(`NodeJS at '${e.execPath}' has too low version '${e.versions.node}', please use at least ${t}. See also https://aka.ms/dotnet-wasm-features`)}const t=/*! webpackIgnore: true */"file:///c:/x.js",o=t.indexOf("?");var n;if(o>0&&(Me.modulesUniqueQuery=t.substring(o)),Me.scriptUrl=t.replace(/\\/g,"/").replace(/[?#].*/,""),Me.scriptDirectory=(n=Me.scriptUrl).slice(0,n.lastIndexOf("/"))+"/",Me.locateFile=e=>"URL"in globalThis&&globalThis.URL!==O?new URL(/*@vite-ignore*//*webpackIgnore:true*/e,Me.scriptDirectory).toString():P(e)?e:Me.scriptDirectory+e,Me.fetch_like=C,Me.out=console.log,Me.err=console.error,Me.onDownloadResourceProgress=e.onDownloadResourceProgress,Ce&&globalThis.navigator){const e=globalThis.navigator,t=e.userAgentData&&e.userAgentData.brands;t&&t.length>0?Me.isChromium=t.some(e=>"Google Chrome"===e.brand||"Microsoft Edge"===e.brand||"Chromium"===e.brand):e.userAgent&&(Me.isChromium=e.userAgent.includes("Chrome"),Me.isFirefox=e.userAgent.includes("Firefox"))}void 0===globalThis.URL&&(globalThis.URL=O)}(ze)}}async function lt(e){return await at(e),qe=ze.onAbort,Ze=ze.onExit,ze.onAbort=Ge,ze.onExit=Qe,ze.ENVIRONMENT_IS_PTHREAD?async function(){(function(){const e=new MessageChannel,t=e.port1,o=e.port2;t.addEventListener("message",e=>{var n,r;n=JSON.parse(e.data.config),r=JSON.parse(e.data.monoThreadInfo),it?Me.diagnosticTracing&&w("mono config already received"):(ye(Me.config,n),Ie.monoThreadInfo=r,_e(),Me.diagnosticTracing&&w("mono config received"),it=!0,Me.afterConfigLoaded.promise_control.resolve(Me.config),Ce&&n.forwardConsoleLogsToWS&&void 0!==globalThis.WebSocket&&Me.setup_proxy_console("worker-idle",console,globalThis.location.origin)),t.close(),o.close()},{once:!0}),t.start(),self.postMessage({[a]:{monoCmd:"preload",port:o}},[o])})(),await Me.afterConfigLoaded.promise,function(){const e=Me.config;e.assets||Fe(!1,"config.assets must be defined");for(const t of e.assets)K(t),Z[t.behavior]&&$.push(t)}(),setTimeout(async()=>{try{await te()}catch(e){Ke(1,e)}},0);const e=ct(),t=await Promise.all(e);return await dt(t),ze}():async function(){var e;await je(ze),ne();const t=ct();(async function(){try{const e=Y("dotnetwasm");await ie(e),e&&e.pendingDownloadInternal&&e.pendingDownloadInternal.response||Fe(!1,"Can't load dotnet.native.wasm");const t=await e.pendingDownloadInternal.response,o=t.headers&&t.headers.get?t.headers.get("Content-Type"):void 0;let n;if("function"==typeof WebAssembly.compileStreaming&&"application/wasm"===o)n=await WebAssembly.compileStreaming(t);else{Ce&&"application/wasm"!==o&&true;const e=await t.arrayBuffer();Me.diagnosticTracing&&w("instantiate_wasm_module buffered"),n=ke?await Promise.resolve(new WebAssembly.Module(e)):await WebAssembly.compile(e)}e.pendingDownloadInternal=null,e.pendingDownload=null,e.buffer=null,e.moduleExports=null,Me.wasmCompilePromise.promise_control.resolve(n)}catch(e){Me.wasmCompilePromise.promise_control.reject(e)}})(),setTimeout(async()=>{try{S(),await te()}catch(e){Ke(1,e)}},0);const o=await Promise.all(t);return await dt(o),await Ie.dotnetReady.promise,await he(null===(e=Me.config.resources)||void 0===e?void 0:e.modulesAfterRuntimeReady),await we("onRuntimeReady",[We.api]),Ue}()}function ct(){const e=Y("js-module-runtime"),t=Y("js-module-native");if(ot&&nt)return[ot,nt,rt];"object"==typeof e.moduleExports?ot=e.moduleExports:(Me.diagnosticTracing&&w(`Attempting to import '${e.resolvedUrl}' for ${e.name}`),ot=import(/*@vite-ignore*//*webpackIgnore:true*//*! webpackIgnore: true */e.resolvedUrl)),"object"==typeof t.moduleExports?nt=t.moduleExports:(Me.diagnosticTracing&&w(`Attempting to import '${t.resolvedUrl}' for ${t.name}`),nt=import(/*@vite-ignore*//*webpackIgnore:true*//*! webpackIgnore: true */t.resolvedUrl));const o=X("js-module-diagnostics");return o&&("object"==typeof o.moduleExports?rt=o.moduleExports:(Me.diagnosticTracing&&w(`Attempting to import '${o.resolvedUrl}' for ${o.name}`),rt=import(/*@vite-ignore*//*webpackIgnore:true*//*! webpackIgnore: true */o.resolvedUrl))),[ot,nt,rt]}async function dt(e){const{initializeExports:t,initializeReplacements:o,configureRuntimeStartup:n,configureEmscriptenStartup:r,configureWorkerStartup:i,setRuntimeGlobals:s,passEmscriptenInternals:a}=e[0],{default:l}=e[1],c=e[2];s(We),t(We),c&&c.setRuntimeGlobals(We),await n(ze),Me.runtimeModuleLoaded.promise_control.resolve(),l(()=>(Object.assign(ze,{__dotnet_runtime:{initializeReplacements:o,configureEmscriptenStartup:r,configureWorkerStartup:i,passEmscriptenInternals:a}}),ze)).catch(e=>{if(e.message&&e.message.toLowerCase().includes("out of memory"))throw new Error(".NET runtime has failed to start, because too much memory was requested. Please decrease the memory by adjusting EmccMaximumHeapSize. See also https://aka.ms/dotnet-wasm-features");throw e})}const ut=new class{withModuleConfig(e){try{return ve(ze,e),this}catch(e){throw Ke(1,e),e}}withOnConfigLoaded(e){try{return ve(ze,{onConfigLoaded:e}),this}catch(e){throw Ke(1,e),e}}withConsoleForwarding(){try{return ye($e,{forwardConsoleLogsToWS:!0}),this}catch(e){throw Ke(1,e),e}}withExitOnUnhandledError(){try{return ye($e,{exitOnUnhandledError:!0}),Je(),this}catch(e){throw Ke(1,e),e}}withAsyncFlushOnExit(){try{return ye($e,{asyncFlushOnExit:!0}),this}catch(e){throw Ke(1,e),e}}withExitCodeLogging(){try{return ye($e,{logExitCode:!0}),this}catch(e){throw Ke(1,e),e}}withElementOnExit(){try{return ye($e,{appendElementOnExit:!0}),this}catch(e){throw Ke(1,e),e}}withInteropCleanupOnExit(){try{return ye($e,{interopCleanupOnExit:!0}),this}catch(e){throw Ke(1,e),e}}withDumpThreadsOnNonZeroExit(){try{return ye($e,{dumpThreadsOnNonZeroExit:!0}),this}catch(e){throw Ke(1,e),e}}withWaitingForDebugger(e){try{return ye($e,{waitForDebugger:e}),this}catch(e){throw Ke(1,e),e}}withInterpreterPgo(e,t){try{return ye($e,{interpreterPgo:e,interpreterPgoSaveDelay:t}),$e.runtimeOptions?$e.runtimeOptions.push("--interp-pgo-recording"):$e.runtimeOptions=["--interp-pgo-recording"],this}catch(e){throw Ke(1,e),e}}withConfig(e){try{return ye($e,e),this}catch(e){throw Ke(1,e),e}}withConfigSrc(e){try{return e&&"string"==typeof e||Fe(!1,"must be file path or URL"),ve(ze,{configSrc:e}),this}catch(e){throw Ke(1,e),e}}withVirtualWorkingDirectory(e){try{return e&&"string"==typeof e||Fe(!1,"must be directory path"),ye($e,{virtualWorkingDirectory:e}),this}catch(e){throw Ke(1,e),e}}withEnvironmentVariable(e,t){try{const o={};return o[e]=t,ye($e,{environmentVariables:o}),this}catch(e){throw Ke(1,e),e}}withEnvironmentVariables(e){try{return e&&"object"==typeof e||Fe(!1,"must be dictionary object"),ye($e,{environmentVariables:e}),this}catch(e){throw Ke(1,e),e}}withDiagnosticTracing(e){try{return"boolean"!=typeof e&&Fe(!1,"must be boolean"),ye($e,{diagnosticTracing:e}),this}catch(e){throw Ke(1,e),e}}withDebugging(e){try{return null!=e&&"number"==typeof e||Fe(!1,"must be number"),ye($e,{debugLevel:e}),this}catch(e){throw Ke(1,e),e}}withApplicationArguments(...e){try{return e&&Array.isArray(e)||Fe(!1,"must be array of strings"),ye($e,{applicationArguments:e}),this}catch(e){throw Ke(1,e),e}}withRuntimeOptions(e){try{return e&&Array.isArray(e)||Fe(!1,"must be array of strings"),$e.runtimeOptions?$e.runtimeOptions.push(...e):$e.runtimeOptions=e,this}catch(e){throw Ke(1,e),e}}withMainAssembly(e){try{return ye($e,{mainAssemblyName:e}),this}catch(e){throw Ke(1,e),e}}withApplicationArgumentsFromQuery(){try{if(!globalThis.window)throw new Error("Missing window to the query parameters from");if(void 0===globalThis.URLSearchParams)throw new Error("URLSearchParams is supported");const e=new URLSearchParams(globalThis.window.location.search).getAll("arg");return this.withApplicationArguments(...e)}catch(e){throw Ke(1,e),e}}withApplicationEnvironment(e){try{return ye($e,{applicationEnvironment:e}),this}catch(e){throw Ke(1,e),e}}withApplicationCulture(e){try{return ye($e,{applicationCulture:e}),this}catch(e){throw Ke(1,e),e}}withResourceLoader(e){try{return Me.loadBootResource=e,this}catch(e){throw Ke(1,e),e}}async download(){try{await async function(){at(ze),await je(ze),ne(),S(),te(),await Me.allDownloadsFinished.promise}()}catch(e){throw Ke(1,e),e}}async create(){try{return this.instance||(this.instance=await async function(){return await lt(ze),We.api}()),this.instance}catch(e){throw Ke(1,e),e}}async run(){try{return ze.config||Fe(!1,"Null moduleConfig.config"),this.instance||await this.create(),this.instance.runMainAndExit()}catch(e){throw Ke(1,e),e}}},ft=Ke,mt=lt;ke||"function"==typeof globalThis.URL||Fe(!1,"This browser/engine doesn't support URL API. Please use a modern version. See also https://aka.ms/dotnet-wasm-features"),"function"!=typeof globalThis.BigInt64Array&&Fe(!1,"This browser/engine doesn't support BigInt64Array API. Please use a modern version. See also https://aka.ms/dotnet-wasm-features"),globalThis.performance&&"function"==typeof globalThis.performance.now||Fe(!1,"This browser/engine doesn't support performance.now. Please use a modern version."),ke||globalThis.crypto&&"object"==typeof globalThis.crypto.subtle||Fe(!1,"This engine doesn't support crypto.subtle. Please use a modern version."),ke||globalThis.crypto&&"function"==typeof globalThis.crypto.getRandomValues||Fe(!1,"This engine doesn't support crypto.getRandomValues. Please use a modern version."),Ae&&"function"!=typeof process.exit&&Fe(!1,"This engine doesn't support process.exit. Please use a modern version."),ut.withConfig(/*! dotnetBootConfig */{});export{mt as default,ut as dotnet,ft as exit};
|