@neuralsea/workspace-indexer 0.3.5 → 0.4.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.
@@ -0,0 +1,2097 @@
1
+ import {
2
+ __commonJS,
3
+ __require
4
+ } from "./chunk-MCKGQKYU.js";
5
+
6
+ // node_modules/sql.js/dist/sql-wasm.js
7
+ var require_sql_wasm = __commonJS({
8
+ "node_modules/sql.js/dist/sql-wasm.js"(exports, module) {
9
+ var initSqlJsPromise = void 0;
10
+ var initSqlJs = function(moduleConfig) {
11
+ if (initSqlJsPromise) {
12
+ return initSqlJsPromise;
13
+ }
14
+ initSqlJsPromise = new Promise(function(resolveModule, reject) {
15
+ var Module = typeof moduleConfig !== "undefined" ? moduleConfig : {};
16
+ var originalOnAbortFunction = Module["onAbort"];
17
+ Module["onAbort"] = function(errorThatCausedAbort) {
18
+ reject(new Error(errorThatCausedAbort));
19
+ if (originalOnAbortFunction) {
20
+ originalOnAbortFunction(errorThatCausedAbort);
21
+ }
22
+ };
23
+ Module["postRun"] = Module["postRun"] || [];
24
+ Module["postRun"].push(function() {
25
+ resolveModule(Module);
26
+ });
27
+ module = void 0;
28
+ var f;
29
+ f ||= typeof Module != "undefined" ? Module : {};
30
+ var aa = "object" == typeof window, ba = "undefined" != typeof WorkerGlobalScope, ca = "object" == typeof process && "object" == typeof process.versions && "string" == typeof process.versions.node && "renderer" != process.type;
31
+ "use strict";
32
+ f.onRuntimeInitialized = function() {
33
+ function a(g, l) {
34
+ switch (typeof l) {
35
+ case "boolean":
36
+ dc(g, l ? 1 : 0);
37
+ break;
38
+ case "number":
39
+ ec(g, l);
40
+ break;
41
+ case "string":
42
+ fc(g, l, -1, -1);
43
+ break;
44
+ case "object":
45
+ if (null === l) lb(g);
46
+ else if (null != l.length) {
47
+ var n = da(l, ea);
48
+ gc(g, n, l.length, -1);
49
+ fa(n);
50
+ } else va(g, "Wrong API use : tried to return a value of an unknown type (" + l + ").", -1);
51
+ break;
52
+ default:
53
+ lb(g);
54
+ }
55
+ }
56
+ function b(g, l) {
57
+ for (var n = [], r = 0; r < g; r += 1) {
58
+ var t = m(l + 4 * r, "i32"), y = hc(t);
59
+ if (1 === y || 2 === y) t = ic(t);
60
+ else if (3 === y) t = jc(t);
61
+ else if (4 === y) {
62
+ y = t;
63
+ t = kc(y);
64
+ y = lc(y);
65
+ for (var L = new Uint8Array(t), J = 0; J < t; J += 1) L[J] = p[y + J];
66
+ t = L;
67
+ } else t = null;
68
+ n.push(t);
69
+ }
70
+ return n;
71
+ }
72
+ function c(g, l) {
73
+ this.Qa = g;
74
+ this.db = l;
75
+ this.Oa = 1;
76
+ this.lb = [];
77
+ }
78
+ function d(g, l) {
79
+ this.db = l;
80
+ l = ha(g) + 1;
81
+ this.eb = ia(l);
82
+ if (null === this.eb) throw Error("Unable to allocate memory for the SQL string");
83
+ u(g, x, this.eb, l);
84
+ this.kb = this.eb;
85
+ this.Za = this.pb = null;
86
+ }
87
+ function e(g) {
88
+ this.filename = "dbfile_" + (4294967295 * Math.random() >>> 0);
89
+ if (null != g) {
90
+ var l = this.filename, n = "/", r = l;
91
+ n && (n = "string" == typeof n ? n : ja(n), r = l ? ka(n + "/" + l) : n);
92
+ l = la(true, true);
93
+ r = ma(r, l);
94
+ if (g) {
95
+ if ("string" == typeof g) {
96
+ n = Array(g.length);
97
+ for (var t = 0, y = g.length; t < y; ++t) n[t] = g.charCodeAt(t);
98
+ g = n;
99
+ }
100
+ na(r, l | 146);
101
+ n = oa(r, 577);
102
+ pa(n, g, 0, g.length, 0);
103
+ qa(n);
104
+ na(r, l);
105
+ }
106
+ }
107
+ this.handleError(q(this.filename, h));
108
+ this.db = m(h, "i32");
109
+ ob(this.db);
110
+ this.fb = {};
111
+ this.Sa = {};
112
+ }
113
+ var h = z(4), k = f.cwrap, q = k("sqlite3_open", "number", ["string", "number"]), w = k("sqlite3_close_v2", "number", ["number"]), v = k("sqlite3_exec", "number", ["number", "string", "number", "number", "number"]), C = k("sqlite3_changes", "number", ["number"]), G = k("sqlite3_prepare_v2", "number", ["number", "string", "number", "number", "number"]), pb = k("sqlite3_sql", "string", ["number"]), nc = k("sqlite3_normalized_sql", "string", ["number"]), qb = k("sqlite3_prepare_v2", "number", ["number", "number", "number", "number", "number"]), oc = k("sqlite3_bind_text", "number", ["number", "number", "number", "number", "number"]), rb = k("sqlite3_bind_blob", "number", ["number", "number", "number", "number", "number"]), pc = k("sqlite3_bind_double", "number", ["number", "number", "number"]), qc = k(
114
+ "sqlite3_bind_int",
115
+ "number",
116
+ ["number", "number", "number"]
117
+ ), rc = k("sqlite3_bind_parameter_index", "number", ["number", "string"]), sc = k("sqlite3_step", "number", ["number"]), tc = k("sqlite3_errmsg", "string", ["number"]), uc = k("sqlite3_column_count", "number", ["number"]), vc = k("sqlite3_data_count", "number", ["number"]), wc = k("sqlite3_column_double", "number", ["number", "number"]), sb = k("sqlite3_column_text", "string", ["number", "number"]), xc = k("sqlite3_column_blob", "number", ["number", "number"]), yc = k("sqlite3_column_bytes", "number", [
118
+ "number",
119
+ "number"
120
+ ]), zc = k("sqlite3_column_type", "number", ["number", "number"]), Ac = k("sqlite3_column_name", "string", ["number", "number"]), Bc = k("sqlite3_reset", "number", ["number"]), Cc = k("sqlite3_clear_bindings", "number", ["number"]), Dc = k("sqlite3_finalize", "number", ["number"]), tb = k("sqlite3_create_function_v2", "number", "number string number number number number number number number".split(" ")), hc = k("sqlite3_value_type", "number", ["number"]), kc = k("sqlite3_value_bytes", "number", ["number"]), jc = k(
121
+ "sqlite3_value_text",
122
+ "string",
123
+ ["number"]
124
+ ), lc = k("sqlite3_value_blob", "number", ["number"]), ic = k("sqlite3_value_double", "number", ["number"]), ec = k("sqlite3_result_double", "", ["number", "number"]), lb = k("sqlite3_result_null", "", ["number"]), fc = k("sqlite3_result_text", "", ["number", "string", "number", "number"]), gc = k("sqlite3_result_blob", "", ["number", "number", "number", "number"]), dc = k("sqlite3_result_int", "", ["number", "number"]), va = k("sqlite3_result_error", "", ["number", "string", "number"]), ub = k(
125
+ "sqlite3_aggregate_context",
126
+ "number",
127
+ ["number", "number"]
128
+ ), ob = k("RegisterExtensionFunctions", "number", ["number"]), vb = k("sqlite3_update_hook", "number", ["number", "number", "number"]);
129
+ c.prototype.bind = function(g) {
130
+ if (!this.Qa) throw "Statement closed";
131
+ this.reset();
132
+ return Array.isArray(g) ? this.Cb(g) : null != g && "object" === typeof g ? this.Db(g) : true;
133
+ };
134
+ c.prototype.step = function() {
135
+ if (!this.Qa) throw "Statement closed";
136
+ this.Oa = 1;
137
+ var g = sc(this.Qa);
138
+ switch (g) {
139
+ case 100:
140
+ return true;
141
+ case 101:
142
+ return false;
143
+ default:
144
+ throw this.db.handleError(g);
145
+ }
146
+ };
147
+ c.prototype.wb = function(g) {
148
+ null == g && (g = this.Oa, this.Oa += 1);
149
+ return wc(this.Qa, g);
150
+ };
151
+ c.prototype.Gb = function(g) {
152
+ null == g && (g = this.Oa, this.Oa += 1);
153
+ g = sb(this.Qa, g);
154
+ if ("function" !== typeof BigInt) throw Error("BigInt is not supported");
155
+ return BigInt(g);
156
+ };
157
+ c.prototype.Hb = function(g) {
158
+ null == g && (g = this.Oa, this.Oa += 1);
159
+ return sb(this.Qa, g);
160
+ };
161
+ c.prototype.getBlob = function(g) {
162
+ null == g && (g = this.Oa, this.Oa += 1);
163
+ var l = yc(this.Qa, g);
164
+ g = xc(this.Qa, g);
165
+ for (var n = new Uint8Array(l), r = 0; r < l; r += 1) n[r] = p[g + r];
166
+ return n;
167
+ };
168
+ c.prototype.get = function(g, l) {
169
+ l = l || {};
170
+ null != g && this.bind(g) && this.step();
171
+ g = [];
172
+ for (var n = vc(this.Qa), r = 0; r < n; r += 1) switch (zc(this.Qa, r)) {
173
+ case 1:
174
+ var t = l.useBigInt ? this.Gb(r) : this.wb(r);
175
+ g.push(t);
176
+ break;
177
+ case 2:
178
+ g.push(this.wb(r));
179
+ break;
180
+ case 3:
181
+ g.push(this.Hb(r));
182
+ break;
183
+ case 4:
184
+ g.push(this.getBlob(r));
185
+ break;
186
+ default:
187
+ g.push(null);
188
+ }
189
+ return g;
190
+ };
191
+ c.prototype.getColumnNames = function() {
192
+ for (var g = [], l = uc(this.Qa), n = 0; n < l; n += 1) g.push(Ac(this.Qa, n));
193
+ return g;
194
+ };
195
+ c.prototype.getAsObject = function(g, l) {
196
+ g = this.get(g, l);
197
+ l = this.getColumnNames();
198
+ for (var n = {}, r = 0; r < l.length; r += 1) n[l[r]] = g[r];
199
+ return n;
200
+ };
201
+ c.prototype.getSQL = function() {
202
+ return pb(this.Qa);
203
+ };
204
+ c.prototype.getNormalizedSQL = function() {
205
+ return nc(this.Qa);
206
+ };
207
+ c.prototype.run = function(g) {
208
+ null != g && this.bind(g);
209
+ this.step();
210
+ return this.reset();
211
+ };
212
+ c.prototype.sb = function(g, l) {
213
+ null == l && (l = this.Oa, this.Oa += 1);
214
+ g = ra(g);
215
+ var n = da(g, ea);
216
+ this.lb.push(n);
217
+ this.db.handleError(oc(this.Qa, l, n, g.length - 1, 0));
218
+ };
219
+ c.prototype.Bb = function(g, l) {
220
+ null == l && (l = this.Oa, this.Oa += 1);
221
+ var n = da(g, ea);
222
+ this.lb.push(n);
223
+ this.db.handleError(rb(
224
+ this.Qa,
225
+ l,
226
+ n,
227
+ g.length,
228
+ 0
229
+ ));
230
+ };
231
+ c.prototype.rb = function(g, l) {
232
+ null == l && (l = this.Oa, this.Oa += 1);
233
+ this.db.handleError((g === (g | 0) ? qc : pc)(this.Qa, l, g));
234
+ };
235
+ c.prototype.Eb = function(g) {
236
+ null == g && (g = this.Oa, this.Oa += 1);
237
+ rb(this.Qa, g, 0, 0, 0);
238
+ };
239
+ c.prototype.tb = function(g, l) {
240
+ null == l && (l = this.Oa, this.Oa += 1);
241
+ switch (typeof g) {
242
+ case "string":
243
+ this.sb(g, l);
244
+ return;
245
+ case "number":
246
+ this.rb(g, l);
247
+ return;
248
+ case "bigint":
249
+ this.sb(g.toString(), l);
250
+ return;
251
+ case "boolean":
252
+ this.rb(g + 0, l);
253
+ return;
254
+ case "object":
255
+ if (null === g) {
256
+ this.Eb(l);
257
+ return;
258
+ }
259
+ if (null != g.length) {
260
+ this.Bb(
261
+ g,
262
+ l
263
+ );
264
+ return;
265
+ }
266
+ }
267
+ throw "Wrong API use : tried to bind a value of an unknown type (" + g + ").";
268
+ };
269
+ c.prototype.Db = function(g) {
270
+ var l = this;
271
+ Object.keys(g).forEach(function(n) {
272
+ var r = rc(l.Qa, n);
273
+ 0 !== r && l.tb(g[n], r);
274
+ });
275
+ return true;
276
+ };
277
+ c.prototype.Cb = function(g) {
278
+ for (var l = 0; l < g.length; l += 1) this.tb(g[l], l + 1);
279
+ return true;
280
+ };
281
+ c.prototype.reset = function() {
282
+ this.freemem();
283
+ return 0 === Cc(this.Qa) && 0 === Bc(this.Qa);
284
+ };
285
+ c.prototype.freemem = function() {
286
+ for (var g; void 0 !== (g = this.lb.pop()); ) fa(g);
287
+ };
288
+ c.prototype.free = function() {
289
+ this.freemem();
290
+ var g = 0 === Dc(this.Qa);
291
+ delete this.db.fb[this.Qa];
292
+ this.Qa = 0;
293
+ return g;
294
+ };
295
+ d.prototype.next = function() {
296
+ if (null === this.eb) return { done: true };
297
+ null !== this.Za && (this.Za.free(), this.Za = null);
298
+ if (!this.db.db) throw this.mb(), Error("Database closed");
299
+ var g = sa(), l = z(4);
300
+ ta(h);
301
+ ta(l);
302
+ try {
303
+ this.db.handleError(qb(this.db.db, this.kb, -1, h, l));
304
+ this.kb = m(l, "i32");
305
+ var n = m(h, "i32");
306
+ if (0 === n) return this.mb(), { done: true };
307
+ this.Za = new c(n, this.db);
308
+ this.db.fb[n] = this.Za;
309
+ return { value: this.Za, done: false };
310
+ } catch (r) {
311
+ throw this.pb = ua(this.kb), this.mb(), r;
312
+ } finally {
313
+ wa(g);
314
+ }
315
+ };
316
+ d.prototype.mb = function() {
317
+ fa(this.eb);
318
+ this.eb = null;
319
+ };
320
+ d.prototype.getRemainingSQL = function() {
321
+ return null !== this.pb ? this.pb : ua(this.kb);
322
+ };
323
+ "function" === typeof Symbol && "symbol" === typeof Symbol.iterator && (d.prototype[Symbol.iterator] = function() {
324
+ return this;
325
+ });
326
+ e.prototype.run = function(g, l) {
327
+ if (!this.db) throw "Database closed";
328
+ if (l) {
329
+ g = this.prepare(g, l);
330
+ try {
331
+ g.step();
332
+ } finally {
333
+ g.free();
334
+ }
335
+ } else this.handleError(v(this.db, g, 0, 0, h));
336
+ return this;
337
+ };
338
+ e.prototype.exec = function(g, l, n) {
339
+ if (!this.db) throw "Database closed";
340
+ var r = sa(), t = null;
341
+ try {
342
+ var y = xa(g), L = z(4);
343
+ for (g = []; 0 !== m(y, "i8"); ) {
344
+ ta(h);
345
+ ta(L);
346
+ this.handleError(qb(this.db, y, -1, h, L));
347
+ var J = m(h, "i32");
348
+ y = m(L, "i32");
349
+ if (0 !== J) {
350
+ var I = null;
351
+ t = new c(J, this);
352
+ for (null != l && t.bind(l); t.step(); ) null === I && (I = { columns: t.getColumnNames(), values: [] }, g.push(I)), I.values.push(t.get(null, n));
353
+ t.free();
354
+ }
355
+ }
356
+ return g;
357
+ } catch (M) {
358
+ throw t && t.free(), M;
359
+ } finally {
360
+ wa(r);
361
+ }
362
+ };
363
+ e.prototype.each = function(g, l, n, r, t) {
364
+ "function" === typeof l && (r = n, n = l, l = void 0);
365
+ g = this.prepare(g, l);
366
+ try {
367
+ for (; g.step(); ) n(g.getAsObject(
368
+ null,
369
+ t
370
+ ));
371
+ } finally {
372
+ g.free();
373
+ }
374
+ if ("function" === typeof r) return r();
375
+ };
376
+ e.prototype.prepare = function(g, l) {
377
+ ta(h);
378
+ this.handleError(G(this.db, g, -1, h, 0));
379
+ g = m(h, "i32");
380
+ if (0 === g) throw "Nothing to prepare";
381
+ var n = new c(g, this);
382
+ null != l && n.bind(l);
383
+ return this.fb[g] = n;
384
+ };
385
+ e.prototype.iterateStatements = function(g) {
386
+ return new d(g, this);
387
+ };
388
+ e.prototype["export"] = function() {
389
+ Object.values(this.fb).forEach(function(l) {
390
+ l.free();
391
+ });
392
+ Object.values(this.Sa).forEach(A);
393
+ this.Sa = {};
394
+ this.handleError(w(this.db));
395
+ var g = ya(this.filename);
396
+ this.handleError(q(
397
+ this.filename,
398
+ h
399
+ ));
400
+ this.db = m(h, "i32");
401
+ ob(this.db);
402
+ return g;
403
+ };
404
+ e.prototype.close = function() {
405
+ null !== this.db && (Object.values(this.fb).forEach(function(g) {
406
+ g.free();
407
+ }), Object.values(this.Sa).forEach(A), this.Sa = {}, this.Ya && (A(this.Ya), this.Ya = void 0), this.handleError(w(this.db)), za("/" + this.filename), this.db = null);
408
+ };
409
+ e.prototype.handleError = function(g) {
410
+ if (0 === g) return null;
411
+ g = tc(this.db);
412
+ throw Error(g);
413
+ };
414
+ e.prototype.getRowsModified = function() {
415
+ return C(this.db);
416
+ };
417
+ e.prototype.create_function = function(g, l) {
418
+ Object.prototype.hasOwnProperty.call(
419
+ this.Sa,
420
+ g
421
+ ) && (A(this.Sa[g]), delete this.Sa[g]);
422
+ var n = Aa(function(r, t, y) {
423
+ t = b(t, y);
424
+ try {
425
+ var L = l.apply(null, t);
426
+ } catch (J) {
427
+ va(r, J, -1);
428
+ return;
429
+ }
430
+ a(r, L);
431
+ }, "viii");
432
+ this.Sa[g] = n;
433
+ this.handleError(tb(this.db, g, l.length, 1, 0, n, 0, 0, 0));
434
+ return this;
435
+ };
436
+ e.prototype.create_aggregate = function(g, l) {
437
+ var n = l.init || function() {
438
+ return null;
439
+ }, r = l.finalize || function(I) {
440
+ return I;
441
+ }, t = l.step;
442
+ if (!t) throw "An aggregate function must have a step function in " + g;
443
+ var y = {};
444
+ Object.hasOwnProperty.call(this.Sa, g) && (A(this.Sa[g]), delete this.Sa[g]);
445
+ l = g + "__finalize";
446
+ Object.hasOwnProperty.call(this.Sa, l) && (A(this.Sa[l]), delete this.Sa[l]);
447
+ var L = Aa(function(I, M, Ra) {
448
+ var X = ub(I, 1);
449
+ Object.hasOwnProperty.call(y, X) || (y[X] = n());
450
+ M = b(M, Ra);
451
+ M = [y[X]].concat(M);
452
+ try {
453
+ y[X] = t.apply(null, M);
454
+ } catch (Fc) {
455
+ delete y[X], va(I, Fc, -1);
456
+ }
457
+ }, "viii"), J = Aa(function(I) {
458
+ var M = ub(I, 1);
459
+ try {
460
+ var Ra = r(y[M]);
461
+ } catch (X) {
462
+ delete y[M];
463
+ va(I, X, -1);
464
+ return;
465
+ }
466
+ a(I, Ra);
467
+ delete y[M];
468
+ }, "vi");
469
+ this.Sa[g] = L;
470
+ this.Sa[l] = J;
471
+ this.handleError(tb(this.db, g, t.length - 1, 1, 0, 0, L, J, 0));
472
+ return this;
473
+ };
474
+ e.prototype.updateHook = function(g) {
475
+ this.Ya && (vb(this.db, 0, 0), A(this.Ya), this.Ya = void 0);
476
+ g && (this.Ya = Aa(function(l, n, r, t, y) {
477
+ switch (n) {
478
+ case 18:
479
+ l = "insert";
480
+ break;
481
+ case 23:
482
+ l = "update";
483
+ break;
484
+ case 9:
485
+ l = "delete";
486
+ break;
487
+ default:
488
+ throw "unknown operationCode in updateHook callback: " + n;
489
+ }
490
+ r = r ? B(x, r) : "";
491
+ t = t ? B(x, t) : "";
492
+ if (y > Number.MAX_SAFE_INTEGER) throw "rowId too big to fit inside a Number";
493
+ g(l, r, t, Number(y));
494
+ }, "viiiij"), vb(this.db, this.Ya, 0));
495
+ };
496
+ f.Database = e;
497
+ };
498
+ var Ba = { ...f }, Ca = "./this.program", Da = (a, b) => {
499
+ throw b;
500
+ }, D = "", Ea, Fa;
501
+ if (ca) {
502
+ var fs = __require("fs");
503
+ __require("path");
504
+ D = __dirname + "/";
505
+ Fa = (a) => {
506
+ a = Ga(a) ? new URL(a) : a;
507
+ return fs.readFileSync(a);
508
+ };
509
+ Ea = async (a) => {
510
+ a = Ga(a) ? new URL(a) : a;
511
+ return fs.readFileSync(a, void 0);
512
+ };
513
+ !f.thisProgram && 1 < process.argv.length && (Ca = process.argv[1].replace(/\\/g, "/"));
514
+ process.argv.slice(2);
515
+ "undefined" != typeof module && (module.exports = f);
516
+ Da = (a, b) => {
517
+ process.exitCode = a;
518
+ throw b;
519
+ };
520
+ } else if (aa || ba) ba ? D = self.location.href : "undefined" != typeof document && document.currentScript && (D = document.currentScript.src), D = D.startsWith("blob:") ? "" : D.slice(0, D.replace(/[?#].*/, "").lastIndexOf("/") + 1), ba && (Fa = (a) => {
521
+ var b = new XMLHttpRequest();
522
+ b.open("GET", a, false);
523
+ b.responseType = "arraybuffer";
524
+ b.send(null);
525
+ return new Uint8Array(b.response);
526
+ }), Ea = async (a) => {
527
+ if (Ga(a)) return new Promise((c, d) => {
528
+ var e = new XMLHttpRequest();
529
+ e.open("GET", a, true);
530
+ e.responseType = "arraybuffer";
531
+ e.onload = () => {
532
+ 200 == e.status || 0 == e.status && e.response ? c(e.response) : d(e.status);
533
+ };
534
+ e.onerror = d;
535
+ e.send(null);
536
+ });
537
+ var b = await fetch(a, { credentials: "same-origin" });
538
+ if (b.ok) return b.arrayBuffer();
539
+ throw Error(b.status + " : " + b.url);
540
+ };
541
+ var Ha = f.print || console.log.bind(console), Ia = f.printErr || console.error.bind(console);
542
+ Object.assign(f, Ba);
543
+ Ba = null;
544
+ f.thisProgram && (Ca = f.thisProgram);
545
+ var Ja = f.wasmBinary, Ka, La = false, Ma, p, x, Na, E, F, Oa, H, Pa, Ga = (a) => a.startsWith("file://");
546
+ function Qa() {
547
+ var a = Ka.buffer;
548
+ f.HEAP8 = p = new Int8Array(a);
549
+ f.HEAP16 = Na = new Int16Array(a);
550
+ f.HEAPU8 = x = new Uint8Array(a);
551
+ f.HEAPU16 = new Uint16Array(a);
552
+ f.HEAP32 = E = new Int32Array(a);
553
+ f.HEAPU32 = F = new Uint32Array(a);
554
+ f.HEAPF32 = Oa = new Float32Array(a);
555
+ f.HEAPF64 = Pa = new Float64Array(a);
556
+ f.HEAP64 = H = new BigInt64Array(a);
557
+ f.HEAPU64 = new BigUint64Array(a);
558
+ }
559
+ var K = 0, Sa = null;
560
+ function Ta(a) {
561
+ f.onAbort?.(a);
562
+ a = "Aborted(" + a + ")";
563
+ Ia(a);
564
+ La = true;
565
+ throw new WebAssembly.RuntimeError(a + ". Build with -sASSERTIONS for more info.");
566
+ }
567
+ var Ua;
568
+ async function Va(a) {
569
+ if (!Ja) try {
570
+ var b = await Ea(a);
571
+ return new Uint8Array(b);
572
+ } catch {
573
+ }
574
+ if (a == Ua && Ja) a = new Uint8Array(Ja);
575
+ else if (Fa) a = Fa(a);
576
+ else throw "both async and sync fetching of the wasm failed";
577
+ return a;
578
+ }
579
+ async function Wa(a, b) {
580
+ try {
581
+ var c = await Va(a);
582
+ return await WebAssembly.instantiate(c, b);
583
+ } catch (d) {
584
+ Ia(`failed to asynchronously prepare wasm: ${d}`), Ta(d);
585
+ }
586
+ }
587
+ async function Xa(a) {
588
+ var b = Ua;
589
+ if (!Ja && "function" == typeof WebAssembly.instantiateStreaming && !Ga(b) && !ca) try {
590
+ var c = fetch(b, { credentials: "same-origin" });
591
+ return await WebAssembly.instantiateStreaming(c, a);
592
+ } catch (d) {
593
+ Ia(`wasm streaming compile failed: ${d}`), Ia("falling back to ArrayBuffer instantiation");
594
+ }
595
+ return Wa(b, a);
596
+ }
597
+ class Ya {
598
+ name = "ExitStatus";
599
+ constructor(a) {
600
+ this.message = `Program terminated with exit(${a})`;
601
+ this.status = a;
602
+ }
603
+ }
604
+ var Za = (a) => {
605
+ for (; 0 < a.length; ) a.shift()(f);
606
+ }, $a = [], ab = [], bb = () => {
607
+ var a = f.preRun.shift();
608
+ ab.unshift(a);
609
+ };
610
+ function m(a, b = "i8") {
611
+ b.endsWith("*") && (b = "*");
612
+ switch (b) {
613
+ case "i1":
614
+ return p[a];
615
+ case "i8":
616
+ return p[a];
617
+ case "i16":
618
+ return Na[a >> 1];
619
+ case "i32":
620
+ return E[a >> 2];
621
+ case "i64":
622
+ return H[a >> 3];
623
+ case "float":
624
+ return Oa[a >> 2];
625
+ case "double":
626
+ return Pa[a >> 3];
627
+ case "*":
628
+ return F[a >> 2];
629
+ default:
630
+ Ta(`invalid type for getValue: ${b}`);
631
+ }
632
+ }
633
+ var cb = f.noExitRuntime || true;
634
+ function ta(a) {
635
+ var b = "i32";
636
+ b.endsWith("*") && (b = "*");
637
+ switch (b) {
638
+ case "i1":
639
+ p[a] = 0;
640
+ break;
641
+ case "i8":
642
+ p[a] = 0;
643
+ break;
644
+ case "i16":
645
+ Na[a >> 1] = 0;
646
+ break;
647
+ case "i32":
648
+ E[a >> 2] = 0;
649
+ break;
650
+ case "i64":
651
+ H[a >> 3] = BigInt(0);
652
+ break;
653
+ case "float":
654
+ Oa[a >> 2] = 0;
655
+ break;
656
+ case "double":
657
+ Pa[a >> 3] = 0;
658
+ break;
659
+ case "*":
660
+ F[a >> 2] = 0;
661
+ break;
662
+ default:
663
+ Ta(`invalid type for setValue: ${b}`);
664
+ }
665
+ }
666
+ var db = "undefined" != typeof TextDecoder ? new TextDecoder() : void 0, B = (a, b = 0, c = NaN) => {
667
+ var d = b + c;
668
+ for (c = b; a[c] && !(c >= d); ) ++c;
669
+ if (16 < c - b && a.buffer && db) return db.decode(a.subarray(b, c));
670
+ for (d = ""; b < c; ) {
671
+ var e = a[b++];
672
+ if (e & 128) {
673
+ var h = a[b++] & 63;
674
+ if (192 == (e & 224)) d += String.fromCharCode((e & 31) << 6 | h);
675
+ else {
676
+ var k = a[b++] & 63;
677
+ e = 224 == (e & 240) ? (e & 15) << 12 | h << 6 | k : (e & 7) << 18 | h << 12 | k << 6 | a[b++] & 63;
678
+ 65536 > e ? d += String.fromCharCode(e) : (e -= 65536, d += String.fromCharCode(55296 | e >> 10, 56320 | e & 1023));
679
+ }
680
+ } else d += String.fromCharCode(e);
681
+ }
682
+ return d;
683
+ }, ua = (a, b) => a ? B(x, a, b) : "", eb = (a, b) => {
684
+ for (var c = 0, d = a.length - 1; 0 <= d; d--) {
685
+ var e = a[d];
686
+ "." === e ? a.splice(d, 1) : ".." === e ? (a.splice(d, 1), c++) : c && (a.splice(d, 1), c--);
687
+ }
688
+ if (b) for (; c; c--) a.unshift("..");
689
+ return a;
690
+ }, ka = (a) => {
691
+ var b = "/" === a.charAt(0), c = "/" === a.slice(-1);
692
+ (a = eb(a.split("/").filter((d) => !!d), !b).join("/")) || b || (a = ".");
693
+ a && c && (a += "/");
694
+ return (b ? "/" : "") + a;
695
+ }, fb = (a) => {
696
+ var b = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);
697
+ a = b[0];
698
+ b = b[1];
699
+ if (!a && !b) return ".";
700
+ b &&= b.slice(0, -1);
701
+ return a + b;
702
+ }, gb = (a) => a && a.match(/([^\/]+|\/)\/*$/)[1], hb = () => {
703
+ if (ca) {
704
+ var a = __require("crypto");
705
+ return (b) => a.randomFillSync(b);
706
+ }
707
+ return (b) => crypto.getRandomValues(b);
708
+ }, ib = (a) => {
709
+ (ib = hb())(a);
710
+ }, jb = (...a) => {
711
+ for (var b = "", c = false, d = a.length - 1; -1 <= d && !c; d--) {
712
+ c = 0 <= d ? a[d] : "/";
713
+ if ("string" != typeof c) throw new TypeError("Arguments to path.resolve must be strings");
714
+ if (!c) return "";
715
+ b = c + "/" + b;
716
+ c = "/" === c.charAt(0);
717
+ }
718
+ b = eb(b.split("/").filter((e) => !!e), !c).join("/");
719
+ return (c ? "/" : "") + b || ".";
720
+ }, kb = [], ha = (a) => {
721
+ for (var b = 0, c = 0; c < a.length; ++c) {
722
+ var d = a.charCodeAt(c);
723
+ 127 >= d ? b++ : 2047 >= d ? b += 2 : 55296 <= d && 57343 >= d ? (b += 4, ++c) : b += 3;
724
+ }
725
+ return b;
726
+ }, u = (a, b, c, d) => {
727
+ if (!(0 < d)) return 0;
728
+ var e = c;
729
+ d = c + d - 1;
730
+ for (var h = 0; h < a.length; ++h) {
731
+ var k = a.charCodeAt(h);
732
+ if (55296 <= k && 57343 >= k) {
733
+ var q = a.charCodeAt(++h);
734
+ k = 65536 + ((k & 1023) << 10) | q & 1023;
735
+ }
736
+ if (127 >= k) {
737
+ if (c >= d) break;
738
+ b[c++] = k;
739
+ } else {
740
+ if (2047 >= k) {
741
+ if (c + 1 >= d) break;
742
+ b[c++] = 192 | k >> 6;
743
+ } else {
744
+ if (65535 >= k) {
745
+ if (c + 2 >= d) break;
746
+ b[c++] = 224 | k >> 12;
747
+ } else {
748
+ if (c + 3 >= d) break;
749
+ b[c++] = 240 | k >> 18;
750
+ b[c++] = 128 | k >> 12 & 63;
751
+ }
752
+ b[c++] = 128 | k >> 6 & 63;
753
+ }
754
+ b[c++] = 128 | k & 63;
755
+ }
756
+ }
757
+ b[c] = 0;
758
+ return c - e;
759
+ }, ra = (a, b) => {
760
+ var c = Array(ha(a) + 1);
761
+ a = u(a, c, 0, c.length);
762
+ b && (c.length = a);
763
+ return c;
764
+ }, mb = [];
765
+ function nb(a, b) {
766
+ mb[a] = { input: [], output: [], cb: b };
767
+ wb(a, xb);
768
+ }
769
+ var xb = { open(a) {
770
+ var b = mb[a.node.rdev];
771
+ if (!b) throw new N(43);
772
+ a.tty = b;
773
+ a.seekable = false;
774
+ }, close(a) {
775
+ a.tty.cb.fsync(a.tty);
776
+ }, fsync(a) {
777
+ a.tty.cb.fsync(a.tty);
778
+ }, read(a, b, c, d) {
779
+ if (!a.tty || !a.tty.cb.xb) throw new N(60);
780
+ for (var e = 0, h = 0; h < d; h++) {
781
+ try {
782
+ var k = a.tty.cb.xb(a.tty);
783
+ } catch (q) {
784
+ throw new N(29);
785
+ }
786
+ if (void 0 === k && 0 === e) throw new N(6);
787
+ if (null === k || void 0 === k) break;
788
+ e++;
789
+ b[c + h] = k;
790
+ }
791
+ e && (a.node.atime = Date.now());
792
+ return e;
793
+ }, write(a, b, c, d) {
794
+ if (!a.tty || !a.tty.cb.qb) throw new N(60);
795
+ try {
796
+ for (var e = 0; e < d; e++) a.tty.cb.qb(a.tty, b[c + e]);
797
+ } catch (h) {
798
+ throw new N(29);
799
+ }
800
+ d && (a.node.mtime = a.node.ctime = Date.now());
801
+ return e;
802
+ } }, yb = { xb() {
803
+ a: {
804
+ if (!kb.length) {
805
+ var a = null;
806
+ if (ca) {
807
+ var b = Buffer.alloc(256), c = 0, d = process.stdin.fd;
808
+ try {
809
+ c = fs.readSync(d, b, 0, 256);
810
+ } catch (e) {
811
+ if (e.toString().includes("EOF")) c = 0;
812
+ else throw e;
813
+ }
814
+ 0 < c && (a = b.slice(0, c).toString("utf-8"));
815
+ } else "undefined" != typeof window && "function" == typeof window.prompt && (a = window.prompt("Input: "), null !== a && (a += "\n"));
816
+ if (!a) {
817
+ a = null;
818
+ break a;
819
+ }
820
+ kb = ra(a, true);
821
+ }
822
+ a = kb.shift();
823
+ }
824
+ return a;
825
+ }, qb(a, b) {
826
+ null === b || 10 === b ? (Ha(B(a.output)), a.output = []) : 0 != b && a.output.push(b);
827
+ }, fsync(a) {
828
+ 0 < a.output?.length && (Ha(B(a.output)), a.output = []);
829
+ }, Tb() {
830
+ return { Ob: 25856, Qb: 5, Nb: 191, Pb: 35387, Mb: [3, 28, 127, 21, 4, 0, 1, 0, 17, 19, 26, 0, 18, 15, 23, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] };
831
+ }, Ub() {
832
+ return 0;
833
+ }, Vb() {
834
+ return [24, 80];
835
+ } }, zb = { qb(a, b) {
836
+ null === b || 10 === b ? (Ia(B(a.output)), a.output = []) : 0 != b && a.output.push(b);
837
+ }, fsync(a) {
838
+ 0 < a.output?.length && (Ia(B(a.output)), a.output = []);
839
+ } }, O = { Wa: null, Xa() {
840
+ return O.createNode(null, "/", 16895, 0);
841
+ }, createNode(a, b, c, d) {
842
+ if (24576 === (c & 61440) || 4096 === (c & 61440)) throw new N(63);
843
+ O.Wa || (O.Wa = { dir: { node: { Ta: O.La.Ta, Ua: O.La.Ua, lookup: O.La.lookup, hb: O.La.hb, rename: O.La.rename, unlink: O.La.unlink, rmdir: O.La.rmdir, readdir: O.La.readdir, symlink: O.La.symlink }, stream: { Va: O.Ma.Va } }, file: { node: { Ta: O.La.Ta, Ua: O.La.Ua }, stream: { Va: O.Ma.Va, read: O.Ma.read, write: O.Ma.write, ib: O.Ma.ib, jb: O.Ma.jb } }, link: { node: { Ta: O.La.Ta, Ua: O.La.Ua, readlink: O.La.readlink }, stream: {} }, ub: { node: { Ta: O.La.Ta, Ua: O.La.Ua }, stream: Ab } });
844
+ c = Bb(a, b, c, d);
845
+ P(c.mode) ? (c.La = O.Wa.dir.node, c.Ma = O.Wa.dir.stream, c.Na = {}) : 32768 === (c.mode & 61440) ? (c.La = O.Wa.file.node, c.Ma = O.Wa.file.stream, c.Ra = 0, c.Na = null) : 40960 === (c.mode & 61440) ? (c.La = O.Wa.link.node, c.Ma = O.Wa.link.stream) : 8192 === (c.mode & 61440) && (c.La = O.Wa.ub.node, c.Ma = O.Wa.ub.stream);
846
+ c.atime = c.mtime = c.ctime = Date.now();
847
+ a && (a.Na[b] = c, a.atime = a.mtime = a.ctime = c.atime);
848
+ return c;
849
+ }, Sb(a) {
850
+ return a.Na ? a.Na.subarray ? a.Na.subarray(0, a.Ra) : new Uint8Array(a.Na) : new Uint8Array(0);
851
+ }, La: { Ta(a) {
852
+ var b = {};
853
+ b.dev = 8192 === (a.mode & 61440) ? a.id : 1;
854
+ b.ino = a.id;
855
+ b.mode = a.mode;
856
+ b.nlink = 1;
857
+ b.uid = 0;
858
+ b.gid = 0;
859
+ b.rdev = a.rdev;
860
+ P(a.mode) ? b.size = 4096 : 32768 === (a.mode & 61440) ? b.size = a.Ra : 40960 === (a.mode & 61440) ? b.size = a.link.length : b.size = 0;
861
+ b.atime = new Date(a.atime);
862
+ b.mtime = new Date(a.mtime);
863
+ b.ctime = new Date(a.ctime);
864
+ b.blksize = 4096;
865
+ b.blocks = Math.ceil(b.size / b.blksize);
866
+ return b;
867
+ }, Ua(a, b) {
868
+ for (var c of ["mode", "atime", "mtime", "ctime"]) null != b[c] && (a[c] = b[c]);
869
+ void 0 !== b.size && (b = b.size, a.Ra != b && (0 == b ? (a.Na = null, a.Ra = 0) : (c = a.Na, a.Na = new Uint8Array(b), c && a.Na.set(c.subarray(0, Math.min(b, a.Ra))), a.Ra = b)));
870
+ }, lookup() {
871
+ throw O.vb;
872
+ }, hb(a, b, c, d) {
873
+ return O.createNode(a, b, c, d);
874
+ }, rename(a, b, c) {
875
+ try {
876
+ var d = Q(b, c);
877
+ } catch (h) {
878
+ }
879
+ if (d) {
880
+ if (P(a.mode)) for (var e in d.Na) throw new N(55);
881
+ Cb(d);
882
+ }
883
+ delete a.parent.Na[a.name];
884
+ b.Na[c] = a;
885
+ a.name = c;
886
+ b.ctime = b.mtime = a.parent.ctime = a.parent.mtime = Date.now();
887
+ }, unlink(a, b) {
888
+ delete a.Na[b];
889
+ a.ctime = a.mtime = Date.now();
890
+ }, rmdir(a, b) {
891
+ var c = Q(a, b), d;
892
+ for (d in c.Na) throw new N(55);
893
+ delete a.Na[b];
894
+ a.ctime = a.mtime = Date.now();
895
+ }, readdir(a) {
896
+ return [".", "..", ...Object.keys(a.Na)];
897
+ }, symlink(a, b, c) {
898
+ a = O.createNode(a, b, 41471, 0);
899
+ a.link = c;
900
+ return a;
901
+ }, readlink(a) {
902
+ if (40960 !== (a.mode & 61440)) throw new N(28);
903
+ return a.link;
904
+ } }, Ma: { read(a, b, c, d, e) {
905
+ var h = a.node.Na;
906
+ if (e >= a.node.Ra) return 0;
907
+ a = Math.min(a.node.Ra - e, d);
908
+ if (8 < a && h.subarray) b.set(h.subarray(e, e + a), c);
909
+ else for (d = 0; d < a; d++) b[c + d] = h[e + d];
910
+ return a;
911
+ }, write(a, b, c, d, e, h) {
912
+ b.buffer === p.buffer && (h = false);
913
+ if (!d) return 0;
914
+ a = a.node;
915
+ a.mtime = a.ctime = Date.now();
916
+ if (b.subarray && (!a.Na || a.Na.subarray)) {
917
+ if (h) return a.Na = b.subarray(c, c + d), a.Ra = d;
918
+ if (0 === a.Ra && 0 === e) return a.Na = b.slice(c, c + d), a.Ra = d;
919
+ if (e + d <= a.Ra) return a.Na.set(b.subarray(
920
+ c,
921
+ c + d
922
+ ), e), d;
923
+ }
924
+ h = e + d;
925
+ var k = a.Na ? a.Na.length : 0;
926
+ k >= h || (h = Math.max(h, k * (1048576 > k ? 2 : 1.125) >>> 0), 0 != k && (h = Math.max(h, 256)), k = a.Na, a.Na = new Uint8Array(h), 0 < a.Ra && a.Na.set(k.subarray(0, a.Ra), 0));
927
+ if (a.Na.subarray && b.subarray) a.Na.set(b.subarray(c, c + d), e);
928
+ else for (h = 0; h < d; h++) a.Na[e + h] = b[c + h];
929
+ a.Ra = Math.max(a.Ra, e + d);
930
+ return d;
931
+ }, Va(a, b, c) {
932
+ 1 === c ? b += a.position : 2 === c && 32768 === (a.node.mode & 61440) && (b += a.node.Ra);
933
+ if (0 > b) throw new N(28);
934
+ return b;
935
+ }, ib(a, b, c, d, e) {
936
+ if (32768 !== (a.node.mode & 61440)) throw new N(43);
937
+ a = a.node.Na;
938
+ if (e & 2 || !a || a.buffer !== p.buffer) {
939
+ e = true;
940
+ d = 65536 * Math.ceil(b / 65536);
941
+ var h = Db(65536, d);
942
+ h && x.fill(0, h, h + d);
943
+ d = h;
944
+ if (!d) throw new N(48);
945
+ if (a) {
946
+ if (0 < c || c + b < a.length) a.subarray ? a = a.subarray(c, c + b) : a = Array.prototype.slice.call(a, c, c + b);
947
+ p.set(a, d);
948
+ }
949
+ } else e = false, d = a.byteOffset;
950
+ return { Kb: d, Ab: e };
951
+ }, jb(a, b, c, d) {
952
+ O.Ma.write(a, b, 0, d, c, false);
953
+ return 0;
954
+ } } }, la = (a, b) => {
955
+ var c = 0;
956
+ a && (c |= 365);
957
+ b && (c |= 146);
958
+ return c;
959
+ }, Eb = null, Fb = {}, Gb = [], Hb = 1, R = null, Ib = false, Jb = true, Kb = {}, N = class {
960
+ name = "ErrnoError";
961
+ constructor(a) {
962
+ this.Pa = a;
963
+ }
964
+ }, Lb = class {
965
+ gb = {};
966
+ node = null;
967
+ get flags() {
968
+ return this.gb.flags;
969
+ }
970
+ set flags(a) {
971
+ this.gb.flags = a;
972
+ }
973
+ get position() {
974
+ return this.gb.position;
975
+ }
976
+ set position(a) {
977
+ this.gb.position = a;
978
+ }
979
+ }, Mb = class {
980
+ La = {};
981
+ Ma = {};
982
+ ab = null;
983
+ constructor(a, b, c, d) {
984
+ a ||= this;
985
+ this.parent = a;
986
+ this.Xa = a.Xa;
987
+ this.id = Hb++;
988
+ this.name = b;
989
+ this.mode = c;
990
+ this.rdev = d;
991
+ this.atime = this.mtime = this.ctime = Date.now();
992
+ }
993
+ get read() {
994
+ return 365 === (this.mode & 365);
995
+ }
996
+ set read(a) {
997
+ a ? this.mode |= 365 : this.mode &= -366;
998
+ }
999
+ get write() {
1000
+ return 146 === (this.mode & 146);
1001
+ }
1002
+ set write(a) {
1003
+ a ? this.mode |= 146 : this.mode &= -147;
1004
+ }
1005
+ };
1006
+ function S(a, b = {}) {
1007
+ if (!a) throw new N(44);
1008
+ b.nb ?? (b.nb = true);
1009
+ "/" === a.charAt(0) || (a = "//" + a);
1010
+ var c = 0;
1011
+ a: for (; 40 > c; c++) {
1012
+ a = a.split("/").filter((q) => !!q);
1013
+ for (var d = Eb, e = "/", h = 0; h < a.length; h++) {
1014
+ var k = h === a.length - 1;
1015
+ if (k && b.parent) break;
1016
+ if ("." !== a[h]) if (".." === a[h]) e = fb(e), d = d.parent;
1017
+ else {
1018
+ e = ka(e + "/" + a[h]);
1019
+ try {
1020
+ d = Q(d, a[h]);
1021
+ } catch (q) {
1022
+ if (44 === q?.Pa && k && b.Jb) return { path: e };
1023
+ throw q;
1024
+ }
1025
+ !d.ab || k && !b.nb || (d = d.ab.root);
1026
+ if (40960 === (d.mode & 61440) && (!k || b.$a)) {
1027
+ if (!d.La.readlink) throw new N(52);
1028
+ d = d.La.readlink(d);
1029
+ "/" === d.charAt(0) || (d = fb(e) + "/" + d);
1030
+ a = d + "/" + a.slice(h + 1).join("/");
1031
+ continue a;
1032
+ }
1033
+ }
1034
+ }
1035
+ return { path: e, node: d };
1036
+ }
1037
+ throw new N(32);
1038
+ }
1039
+ function ja(a) {
1040
+ for (var b; ; ) {
1041
+ if (a === a.parent) return a = a.Xa.zb, b ? "/" !== a[a.length - 1] ? `${a}/${b}` : a + b : a;
1042
+ b = b ? `${a.name}/${b}` : a.name;
1043
+ a = a.parent;
1044
+ }
1045
+ }
1046
+ function Nb(a, b) {
1047
+ for (var c = 0, d = 0; d < b.length; d++) c = (c << 5) - c + b.charCodeAt(d) | 0;
1048
+ return (a + c >>> 0) % R.length;
1049
+ }
1050
+ function Cb(a) {
1051
+ var b = Nb(a.parent.id, a.name);
1052
+ if (R[b] === a) R[b] = a.bb;
1053
+ else for (b = R[b]; b; ) {
1054
+ if (b.bb === a) {
1055
+ b.bb = a.bb;
1056
+ break;
1057
+ }
1058
+ b = b.bb;
1059
+ }
1060
+ }
1061
+ function Q(a, b) {
1062
+ var c = P(a.mode) ? (c = Ob(a, "x")) ? c : a.La.lookup ? 0 : 2 : 54;
1063
+ if (c) throw new N(c);
1064
+ for (c = R[Nb(a.id, b)]; c; c = c.bb) {
1065
+ var d = c.name;
1066
+ if (c.parent.id === a.id && d === b) return c;
1067
+ }
1068
+ return a.La.lookup(a, b);
1069
+ }
1070
+ function Bb(a, b, c, d) {
1071
+ a = new Mb(a, b, c, d);
1072
+ b = Nb(a.parent.id, a.name);
1073
+ a.bb = R[b];
1074
+ return R[b] = a;
1075
+ }
1076
+ function P(a) {
1077
+ return 16384 === (a & 61440);
1078
+ }
1079
+ function Pb(a) {
1080
+ var b = ["r", "w", "rw"][a & 3];
1081
+ a & 512 && (b += "w");
1082
+ return b;
1083
+ }
1084
+ function Ob(a, b) {
1085
+ if (Jb) return 0;
1086
+ if (!b.includes("r") || a.mode & 292) {
1087
+ if (b.includes("w") && !(a.mode & 146) || b.includes("x") && !(a.mode & 73)) return 2;
1088
+ } else return 2;
1089
+ return 0;
1090
+ }
1091
+ function Qb(a, b) {
1092
+ if (!P(a.mode)) return 54;
1093
+ try {
1094
+ return Q(a, b), 20;
1095
+ } catch (c) {
1096
+ }
1097
+ return Ob(a, "wx");
1098
+ }
1099
+ function Rb(a, b, c) {
1100
+ try {
1101
+ var d = Q(a, b);
1102
+ } catch (e) {
1103
+ return e.Pa;
1104
+ }
1105
+ if (a = Ob(a, "wx")) return a;
1106
+ if (c) {
1107
+ if (!P(d.mode)) return 54;
1108
+ if (d === d.parent || "/" === ja(d)) return 10;
1109
+ } else if (P(d.mode)) return 31;
1110
+ return 0;
1111
+ }
1112
+ function Sb(a) {
1113
+ if (!a) throw new N(63);
1114
+ return a;
1115
+ }
1116
+ function T(a) {
1117
+ a = Gb[a];
1118
+ if (!a) throw new N(8);
1119
+ return a;
1120
+ }
1121
+ function Tb(a, b = -1) {
1122
+ a = Object.assign(new Lb(), a);
1123
+ if (-1 == b) a: {
1124
+ for (b = 0; 4096 >= b; b++) if (!Gb[b]) break a;
1125
+ throw new N(33);
1126
+ }
1127
+ a.fd = b;
1128
+ return Gb[b] = a;
1129
+ }
1130
+ function Ub(a, b = -1) {
1131
+ a = Tb(a, b);
1132
+ a.Ma?.Rb?.(a);
1133
+ return a;
1134
+ }
1135
+ function Vb(a, b, c) {
1136
+ var d = a?.Ma.Ua;
1137
+ a = d ? a : b;
1138
+ d ??= b.La.Ua;
1139
+ Sb(d);
1140
+ d(a, c);
1141
+ }
1142
+ var Ab = { open(a) {
1143
+ a.Ma = Fb[a.node.rdev].Ma;
1144
+ a.Ma.open?.(a);
1145
+ }, Va() {
1146
+ throw new N(70);
1147
+ } };
1148
+ function wb(a, b) {
1149
+ Fb[a] = { Ma: b };
1150
+ }
1151
+ function Wb(a, b) {
1152
+ var c = "/" === b;
1153
+ if (c && Eb) throw new N(10);
1154
+ if (!c && b) {
1155
+ var d = S(b, { nb: false });
1156
+ b = d.path;
1157
+ d = d.node;
1158
+ if (d.ab) throw new N(10);
1159
+ if (!P(d.mode)) throw new N(54);
1160
+ }
1161
+ b = { type: a, Wb: {}, zb: b, Ib: [] };
1162
+ a = a.Xa(b);
1163
+ a.Xa = b;
1164
+ b.root = a;
1165
+ c ? Eb = a : d && (d.ab = b, d.Xa && d.Xa.Ib.push(b));
1166
+ }
1167
+ function Xb(a, b, c) {
1168
+ var d = S(a, { parent: true }).node;
1169
+ a = gb(a);
1170
+ if (!a) throw new N(28);
1171
+ if ("." === a || ".." === a) throw new N(20);
1172
+ var e = Qb(d, a);
1173
+ if (e) throw new N(e);
1174
+ if (!d.La.hb) throw new N(63);
1175
+ return d.La.hb(d, a, b, c);
1176
+ }
1177
+ function ma(a, b = 438) {
1178
+ return Xb(a, b & 4095 | 32768, 0);
1179
+ }
1180
+ function U(a, b = 511) {
1181
+ return Xb(a, b & 1023 | 16384, 0);
1182
+ }
1183
+ function Yb(a, b, c) {
1184
+ "undefined" == typeof c && (c = b, b = 438);
1185
+ Xb(a, b | 8192, c);
1186
+ }
1187
+ function Zb(a, b) {
1188
+ if (!jb(a)) throw new N(44);
1189
+ var c = S(b, { parent: true }).node;
1190
+ if (!c) throw new N(44);
1191
+ b = gb(b);
1192
+ var d = Qb(c, b);
1193
+ if (d) throw new N(d);
1194
+ if (!c.La.symlink) throw new N(63);
1195
+ c.La.symlink(c, b, a);
1196
+ }
1197
+ function $b(a) {
1198
+ var b = S(a, { parent: true }).node;
1199
+ a = gb(a);
1200
+ var c = Q(b, a), d = Rb(b, a, true);
1201
+ if (d) throw new N(d);
1202
+ if (!b.La.rmdir) throw new N(63);
1203
+ if (c.ab) throw new N(10);
1204
+ b.La.rmdir(b, a);
1205
+ Cb(c);
1206
+ }
1207
+ function za(a) {
1208
+ var b = S(a, { parent: true }).node;
1209
+ if (!b) throw new N(44);
1210
+ a = gb(a);
1211
+ var c = Q(b, a), d = Rb(b, a, false);
1212
+ if (d) throw new N(d);
1213
+ if (!b.La.unlink) throw new N(63);
1214
+ if (c.ab) throw new N(10);
1215
+ b.La.unlink(b, a);
1216
+ Cb(c);
1217
+ }
1218
+ function ac(a, b) {
1219
+ a = S(a, { $a: !b }).node;
1220
+ return Sb(a.La.Ta)(a);
1221
+ }
1222
+ function bc(a, b, c, d) {
1223
+ Vb(a, b, { mode: c & 4095 | b.mode & -4096, ctime: Date.now(), Fb: d });
1224
+ }
1225
+ function na(a, b) {
1226
+ a = "string" == typeof a ? S(a, { $a: true }).node : a;
1227
+ bc(null, a, b);
1228
+ }
1229
+ function cc(a, b, c) {
1230
+ if (P(b.mode)) throw new N(31);
1231
+ if (32768 !== (b.mode & 61440)) throw new N(28);
1232
+ var d = Ob(b, "w");
1233
+ if (d) throw new N(d);
1234
+ Vb(a, b, { size: c, timestamp: Date.now() });
1235
+ }
1236
+ function oa(a, b, c = 438) {
1237
+ if ("" === a) throw new N(44);
1238
+ if ("string" == typeof b) {
1239
+ var d = { r: 0, "r+": 2, w: 577, "w+": 578, a: 1089, "a+": 1090 }[b];
1240
+ if ("undefined" == typeof d) throw Error(`Unknown file open mode: ${b}`);
1241
+ b = d;
1242
+ }
1243
+ c = b & 64 ? c & 4095 | 32768 : 0;
1244
+ if ("object" == typeof a) d = a;
1245
+ else {
1246
+ var e = a.endsWith("/");
1247
+ a = S(a, { $a: !(b & 131072), Jb: true });
1248
+ d = a.node;
1249
+ a = a.path;
1250
+ }
1251
+ var h = false;
1252
+ if (b & 64) if (d) {
1253
+ if (b & 128) throw new N(20);
1254
+ } else {
1255
+ if (e) throw new N(31);
1256
+ d = Xb(a, c | 511, 0);
1257
+ h = true;
1258
+ }
1259
+ if (!d) throw new N(44);
1260
+ 8192 === (d.mode & 61440) && (b &= -513);
1261
+ if (b & 65536 && !P(d.mode)) throw new N(54);
1262
+ if (!h && (e = d ? 40960 === (d.mode & 61440) ? 32 : P(d.mode) && ("r" !== Pb(b) || b & 576) ? 31 : Ob(d, Pb(b)) : 44)) throw new N(e);
1263
+ b & 512 && !h && (e = d, e = "string" == typeof e ? S(e, { $a: true }).node : e, cc(null, e, 0));
1264
+ b &= -131713;
1265
+ e = Tb({ node: d, path: ja(d), flags: b, seekable: true, position: 0, Ma: d.Ma, Lb: [], error: false });
1266
+ e.Ma.open && e.Ma.open(e);
1267
+ h && na(d, c & 511);
1268
+ !f.logReadFiles || b & 1 || a in Kb || (Kb[a] = 1);
1269
+ return e;
1270
+ }
1271
+ function qa(a) {
1272
+ if (null === a.fd) throw new N(8);
1273
+ a.ob && (a.ob = null);
1274
+ try {
1275
+ a.Ma.close && a.Ma.close(a);
1276
+ } catch (b) {
1277
+ throw b;
1278
+ } finally {
1279
+ Gb[a.fd] = null;
1280
+ }
1281
+ a.fd = null;
1282
+ }
1283
+ function mc(a, b, c) {
1284
+ if (null === a.fd) throw new N(8);
1285
+ if (!a.seekable || !a.Ma.Va) throw new N(70);
1286
+ if (0 != c && 1 != c && 2 != c) throw new N(28);
1287
+ a.position = a.Ma.Va(a, b, c);
1288
+ a.Lb = [];
1289
+ }
1290
+ function Ec(a, b, c, d, e) {
1291
+ if (0 > d || 0 > e) throw new N(28);
1292
+ if (null === a.fd) throw new N(8);
1293
+ if (1 === (a.flags & 2097155)) throw new N(8);
1294
+ if (P(a.node.mode)) throw new N(31);
1295
+ if (!a.Ma.read) throw new N(28);
1296
+ var h = "undefined" != typeof e;
1297
+ if (!h) e = a.position;
1298
+ else if (!a.seekable) throw new N(70);
1299
+ b = a.Ma.read(a, b, c, d, e);
1300
+ h || (a.position += b);
1301
+ return b;
1302
+ }
1303
+ function pa(a, b, c, d, e) {
1304
+ if (0 > d || 0 > e) throw new N(28);
1305
+ if (null === a.fd) throw new N(8);
1306
+ if (0 === (a.flags & 2097155)) throw new N(8);
1307
+ if (P(a.node.mode)) throw new N(31);
1308
+ if (!a.Ma.write) throw new N(28);
1309
+ a.seekable && a.flags & 1024 && mc(a, 0, 2);
1310
+ var h = "undefined" != typeof e;
1311
+ if (!h) e = a.position;
1312
+ else if (!a.seekable) throw new N(70);
1313
+ b = a.Ma.write(a, b, c, d, e, void 0);
1314
+ h || (a.position += b);
1315
+ return b;
1316
+ }
1317
+ function ya(a) {
1318
+ var b = "binary";
1319
+ if ("utf8" !== b && "binary" !== b) throw Error(`Invalid encoding type "${b}"`);
1320
+ var c;
1321
+ var d = oa(a, d || 0);
1322
+ a = ac(a).size;
1323
+ var e = new Uint8Array(a);
1324
+ Ec(d, e, 0, a, 0);
1325
+ "utf8" === b ? c = B(e) : "binary" === b && (c = e);
1326
+ qa(d);
1327
+ return c;
1328
+ }
1329
+ function V(a, b, c) {
1330
+ a = ka("/dev/" + a);
1331
+ var d = la(!!b, !!c);
1332
+ V.yb ?? (V.yb = 64);
1333
+ var e = V.yb++ << 8 | 0;
1334
+ wb(e, { open(h) {
1335
+ h.seekable = false;
1336
+ }, close() {
1337
+ c?.buffer?.length && c(10);
1338
+ }, read(h, k, q, w) {
1339
+ for (var v = 0, C = 0; C < w; C++) {
1340
+ try {
1341
+ var G = b();
1342
+ } catch (pb) {
1343
+ throw new N(29);
1344
+ }
1345
+ if (void 0 === G && 0 === v) throw new N(6);
1346
+ if (null === G || void 0 === G) break;
1347
+ v++;
1348
+ k[q + C] = G;
1349
+ }
1350
+ v && (h.node.atime = Date.now());
1351
+ return v;
1352
+ }, write(h, k, q, w) {
1353
+ for (var v = 0; v < w; v++) try {
1354
+ c(k[q + v]);
1355
+ } catch (C) {
1356
+ throw new N(29);
1357
+ }
1358
+ w && (h.node.mtime = h.node.ctime = Date.now());
1359
+ return v;
1360
+ } });
1361
+ Yb(a, d, e);
1362
+ }
1363
+ var W = {};
1364
+ function Gc(a, b, c) {
1365
+ if ("/" === b.charAt(0)) return b;
1366
+ a = -100 === a ? "/" : T(a).path;
1367
+ if (0 == b.length) {
1368
+ if (!c) throw new N(44);
1369
+ return a;
1370
+ }
1371
+ return a + "/" + b;
1372
+ }
1373
+ function Hc(a, b) {
1374
+ E[a >> 2] = b.dev;
1375
+ E[a + 4 >> 2] = b.mode;
1376
+ F[a + 8 >> 2] = b.nlink;
1377
+ E[a + 12 >> 2] = b.uid;
1378
+ E[a + 16 >> 2] = b.gid;
1379
+ E[a + 20 >> 2] = b.rdev;
1380
+ H[a + 24 >> 3] = BigInt(b.size);
1381
+ E[a + 32 >> 2] = 4096;
1382
+ E[a + 36 >> 2] = b.blocks;
1383
+ var c = b.atime.getTime(), d = b.mtime.getTime(), e = b.ctime.getTime();
1384
+ H[a + 40 >> 3] = BigInt(Math.floor(c / 1e3));
1385
+ F[a + 48 >> 2] = c % 1e3 * 1e6;
1386
+ H[a + 56 >> 3] = BigInt(Math.floor(d / 1e3));
1387
+ F[a + 64 >> 2] = d % 1e3 * 1e6;
1388
+ H[a + 72 >> 3] = BigInt(Math.floor(e / 1e3));
1389
+ F[a + 80 >> 2] = e % 1e3 * 1e6;
1390
+ H[a + 88 >> 3] = BigInt(b.ino);
1391
+ return 0;
1392
+ }
1393
+ var Ic = void 0, Jc = () => {
1394
+ var a = E[+Ic >> 2];
1395
+ Ic += 4;
1396
+ return a;
1397
+ }, Kc = 0, Lc = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335], Mc = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334], Nc = {}, Oc = (a) => {
1398
+ Ma = a;
1399
+ cb || 0 < Kc || (f.onExit?.(a), La = true);
1400
+ Da(a, new Ya(a));
1401
+ }, Pc = (a) => {
1402
+ if (!La) try {
1403
+ if (a(), !(cb || 0 < Kc)) try {
1404
+ Ma = a = Ma, Oc(a);
1405
+ } catch (b) {
1406
+ b instanceof Ya || "unwind" == b || Da(1, b);
1407
+ }
1408
+ } catch (b) {
1409
+ b instanceof Ya || "unwind" == b || Da(1, b);
1410
+ }
1411
+ }, Qc = {}, Sc = () => {
1412
+ if (!Rc) {
1413
+ var a = { USER: "web_user", LOGNAME: "web_user", PATH: "/", PWD: "/", HOME: "/home/web_user", LANG: ("object" == typeof navigator && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8", _: Ca || "./this.program" }, b;
1414
+ for (b in Qc) void 0 === Qc[b] ? delete a[b] : a[b] = Qc[b];
1415
+ var c = [];
1416
+ for (b in a) c.push(`${b}=${a[b]}`);
1417
+ Rc = c;
1418
+ }
1419
+ return Rc;
1420
+ }, Rc, xa = (a) => {
1421
+ var b = ha(a) + 1, c = z(b);
1422
+ u(a, x, c, b);
1423
+ return c;
1424
+ }, Tc = (a, b, c, d) => {
1425
+ var e = { string: (v) => {
1426
+ var C = 0;
1427
+ null !== v && void 0 !== v && 0 !== v && (C = xa(v));
1428
+ return C;
1429
+ }, array: (v) => {
1430
+ var C = z(v.length);
1431
+ p.set(v, C);
1432
+ return C;
1433
+ } };
1434
+ a = f["_" + a];
1435
+ var h = [], k = 0;
1436
+ if (d) for (var q = 0; q < d.length; q++) {
1437
+ var w = e[c[q]];
1438
+ w ? (0 === k && (k = sa()), h[q] = w(d[q])) : h[q] = d[q];
1439
+ }
1440
+ c = a(...h);
1441
+ return c = (function(v) {
1442
+ 0 !== k && wa(k);
1443
+ return "string" === b ? v ? B(x, v) : "" : "boolean" === b ? !!v : v;
1444
+ })(c);
1445
+ }, ea = 0, da = (a, b) => {
1446
+ b = 1 == b ? z(a.length) : ia(a.length);
1447
+ a.subarray || a.slice || (a = new Uint8Array(a));
1448
+ x.set(a, b);
1449
+ return b;
1450
+ }, Uc, Vc = [], Y, A = (a) => {
1451
+ Uc.delete(Y.get(a));
1452
+ Y.set(a, null);
1453
+ Vc.push(a);
1454
+ }, Aa = (a, b) => {
1455
+ if (!Uc) {
1456
+ Uc = /* @__PURE__ */ new WeakMap();
1457
+ var c = Y.length;
1458
+ if (Uc) for (var d = 0; d < 0 + c; d++) {
1459
+ var e = Y.get(d);
1460
+ e && Uc.set(e, d);
1461
+ }
1462
+ }
1463
+ if (c = Uc.get(a) || 0) return c;
1464
+ if (Vc.length) c = Vc.pop();
1465
+ else {
1466
+ try {
1467
+ Y.grow(1);
1468
+ } catch (w) {
1469
+ if (!(w instanceof RangeError)) throw w;
1470
+ throw "Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.";
1471
+ }
1472
+ c = Y.length - 1;
1473
+ }
1474
+ try {
1475
+ Y.set(c, a);
1476
+ } catch (w) {
1477
+ if (!(w instanceof TypeError)) throw w;
1478
+ if ("function" == typeof WebAssembly.Function) {
1479
+ var h = WebAssembly.Function;
1480
+ d = { i: "i32", j: "i64", f: "f32", d: "f64", e: "externref", p: "i32" };
1481
+ e = { parameters: [], results: "v" == b[0] ? [] : [d[b[0]]] };
1482
+ for (var k = 1; k < b.length; ++k) e.parameters.push(d[b[k]]);
1483
+ b = new h(e, a);
1484
+ } else {
1485
+ d = [1];
1486
+ e = b.slice(0, 1);
1487
+ b = b.slice(1);
1488
+ k = { i: 127, p: 127, j: 126, f: 125, d: 124, e: 111 };
1489
+ d.push(96);
1490
+ var q = b.length;
1491
+ 128 > q ? d.push(q) : d.push(q % 128 | 128, q >> 7);
1492
+ for (h of b) d.push(k[h]);
1493
+ "v" == e ? d.push(0) : d.push(1, k[e]);
1494
+ b = [0, 97, 115, 109, 1, 0, 0, 0, 1];
1495
+ h = d.length;
1496
+ 128 > h ? b.push(h) : b.push(h % 128 | 128, h >> 7);
1497
+ b.push(...d);
1498
+ b.push(2, 7, 1, 1, 101, 1, 102, 0, 0, 7, 5, 1, 1, 102, 0, 0);
1499
+ b = new WebAssembly.Module(new Uint8Array(b));
1500
+ b = new WebAssembly.Instance(b, { e: { f: a } }).exports.f;
1501
+ }
1502
+ Y.set(c, b);
1503
+ }
1504
+ Uc.set(a, c);
1505
+ return c;
1506
+ };
1507
+ R = Array(4096);
1508
+ Wb(O, "/");
1509
+ U("/tmp");
1510
+ U("/home");
1511
+ U("/home/web_user");
1512
+ (function() {
1513
+ U("/dev");
1514
+ wb(259, { read: () => 0, write: (d, e, h, k) => k, Va: () => 0 });
1515
+ Yb("/dev/null", 259);
1516
+ nb(1280, yb);
1517
+ nb(1536, zb);
1518
+ Yb("/dev/tty", 1280);
1519
+ Yb("/dev/tty1", 1536);
1520
+ var a = new Uint8Array(1024), b = 0, c = () => {
1521
+ 0 === b && (ib(a), b = a.byteLength);
1522
+ return a[--b];
1523
+ };
1524
+ V("random", c);
1525
+ V("urandom", c);
1526
+ U("/dev/shm");
1527
+ U("/dev/shm/tmp");
1528
+ })();
1529
+ (function() {
1530
+ U("/proc");
1531
+ var a = U("/proc/self");
1532
+ U("/proc/self/fd");
1533
+ Wb({ Xa() {
1534
+ var b = Bb(a, "fd", 16895, 73);
1535
+ b.Ma = { Va: O.Ma.Va };
1536
+ b.La = { lookup(c, d) {
1537
+ c = +d;
1538
+ var e = T(c);
1539
+ c = { parent: null, Xa: { zb: "fake" }, La: { readlink: () => e.path }, id: c + 1 };
1540
+ return c.parent = c;
1541
+ }, readdir() {
1542
+ return Array.from(Gb.entries()).filter(([, c]) => c).map(([c]) => c.toString());
1543
+ } };
1544
+ return b;
1545
+ } }, "/proc/self/fd");
1546
+ })();
1547
+ O.vb = new N(44);
1548
+ O.vb.stack = "<generic error, no stack>";
1549
+ var Xc = { a: (a, b, c, d) => Ta(`Assertion failed: ${a ? B(x, a) : ""}, at: ` + [b ? b ? B(x, b) : "" : "unknown filename", c, d ? d ? B(x, d) : "" : "unknown function"]), i: function(a, b) {
1550
+ try {
1551
+ return a = a ? B(x, a) : "", na(a, b), 0;
1552
+ } catch (c) {
1553
+ if ("undefined" == typeof W || "ErrnoError" !== c.name) throw c;
1554
+ return -c.Pa;
1555
+ }
1556
+ }, L: function(a, b, c) {
1557
+ try {
1558
+ b = b ? B(x, b) : "";
1559
+ b = Gc(a, b);
1560
+ if (c & -8) return -28;
1561
+ var d = S(b, { $a: true }).node;
1562
+ if (!d) return -44;
1563
+ a = "";
1564
+ c & 4 && (a += "r");
1565
+ c & 2 && (a += "w");
1566
+ c & 1 && (a += "x");
1567
+ return a && Ob(d, a) ? -2 : 0;
1568
+ } catch (e) {
1569
+ if ("undefined" == typeof W || "ErrnoError" !== e.name) throw e;
1570
+ return -e.Pa;
1571
+ }
1572
+ }, j: function(a, b) {
1573
+ try {
1574
+ var c = T(a);
1575
+ bc(c, c.node, b, false);
1576
+ return 0;
1577
+ } catch (d) {
1578
+ if ("undefined" == typeof W || "ErrnoError" !== d.name) throw d;
1579
+ return -d.Pa;
1580
+ }
1581
+ }, h: function(a) {
1582
+ try {
1583
+ var b = T(a);
1584
+ Vb(b, b.node, { timestamp: Date.now(), Fb: false });
1585
+ return 0;
1586
+ } catch (c) {
1587
+ if ("undefined" == typeof W || "ErrnoError" !== c.name) throw c;
1588
+ return -c.Pa;
1589
+ }
1590
+ }, b: function(a, b, c) {
1591
+ Ic = c;
1592
+ try {
1593
+ var d = T(a);
1594
+ switch (b) {
1595
+ case 0:
1596
+ var e = Jc();
1597
+ if (0 > e) break;
1598
+ for (; Gb[e]; ) e++;
1599
+ return Ub(d, e).fd;
1600
+ case 1:
1601
+ case 2:
1602
+ return 0;
1603
+ case 3:
1604
+ return d.flags;
1605
+ case 4:
1606
+ return e = Jc(), d.flags |= e, 0;
1607
+ case 12:
1608
+ return e = Jc(), Na[e + 0 >> 1] = 2, 0;
1609
+ case 13:
1610
+ case 14:
1611
+ return 0;
1612
+ }
1613
+ return -28;
1614
+ } catch (h) {
1615
+ if ("undefined" == typeof W || "ErrnoError" !== h.name) throw h;
1616
+ return -h.Pa;
1617
+ }
1618
+ }, g: function(a, b) {
1619
+ try {
1620
+ var c = T(a), d = c.node, e = c.Ma.Ta;
1621
+ a = e ? c : d;
1622
+ e ??= d.La.Ta;
1623
+ Sb(e);
1624
+ var h = e(a);
1625
+ return Hc(b, h);
1626
+ } catch (k) {
1627
+ if ("undefined" == typeof W || "ErrnoError" !== k.name) throw k;
1628
+ return -k.Pa;
1629
+ }
1630
+ }, H: function(a, b) {
1631
+ b = -9007199254740992 > b || 9007199254740992 < b ? NaN : Number(b);
1632
+ try {
1633
+ if (isNaN(b)) return 61;
1634
+ var c = T(a);
1635
+ if (0 > b || 0 === (c.flags & 2097155)) throw new N(28);
1636
+ cc(c, c.node, b);
1637
+ return 0;
1638
+ } catch (d) {
1639
+ if ("undefined" == typeof W || "ErrnoError" !== d.name) throw d;
1640
+ return -d.Pa;
1641
+ }
1642
+ }, G: function(a, b) {
1643
+ try {
1644
+ if (0 === b) return -28;
1645
+ var c = ha("/") + 1;
1646
+ if (b < c) return -68;
1647
+ u("/", x, a, b);
1648
+ return c;
1649
+ } catch (d) {
1650
+ if ("undefined" == typeof W || "ErrnoError" !== d.name) throw d;
1651
+ return -d.Pa;
1652
+ }
1653
+ }, K: function(a, b) {
1654
+ try {
1655
+ return a = a ? B(x, a) : "", Hc(b, ac(a, true));
1656
+ } catch (c) {
1657
+ if ("undefined" == typeof W || "ErrnoError" !== c.name) throw c;
1658
+ return -c.Pa;
1659
+ }
1660
+ }, C: function(a, b, c) {
1661
+ try {
1662
+ return b = b ? B(x, b) : "", b = Gc(a, b), U(b, c), 0;
1663
+ } catch (d) {
1664
+ if ("undefined" == typeof W || "ErrnoError" !== d.name) throw d;
1665
+ return -d.Pa;
1666
+ }
1667
+ }, J: function(a, b, c, d) {
1668
+ try {
1669
+ b = b ? B(x, b) : "";
1670
+ var e = d & 256;
1671
+ b = Gc(a, b, d & 4096);
1672
+ return Hc(c, e ? ac(b, true) : ac(b));
1673
+ } catch (h) {
1674
+ if ("undefined" == typeof W || "ErrnoError" !== h.name) throw h;
1675
+ return -h.Pa;
1676
+ }
1677
+ }, x: function(a, b, c, d) {
1678
+ Ic = d;
1679
+ try {
1680
+ b = b ? B(x, b) : "";
1681
+ b = Gc(a, b);
1682
+ var e = d ? Jc() : 0;
1683
+ return oa(b, c, e).fd;
1684
+ } catch (h) {
1685
+ if ("undefined" == typeof W || "ErrnoError" !== h.name) throw h;
1686
+ return -h.Pa;
1687
+ }
1688
+ }, v: function(a, b, c, d) {
1689
+ try {
1690
+ b = b ? B(x, b) : "";
1691
+ b = Gc(a, b);
1692
+ if (0 >= d) return -28;
1693
+ var e = S(b).node;
1694
+ if (!e) throw new N(44);
1695
+ if (!e.La.readlink) throw new N(28);
1696
+ var h = e.La.readlink(e);
1697
+ var k = Math.min(d, ha(h)), q = p[c + k];
1698
+ u(h, x, c, d + 1);
1699
+ p[c + k] = q;
1700
+ return k;
1701
+ } catch (w) {
1702
+ if ("undefined" == typeof W || "ErrnoError" !== w.name) throw w;
1703
+ return -w.Pa;
1704
+ }
1705
+ }, u: function(a) {
1706
+ try {
1707
+ return a = a ? B(x, a) : "", $b(a), 0;
1708
+ } catch (b) {
1709
+ if ("undefined" == typeof W || "ErrnoError" !== b.name) throw b;
1710
+ return -b.Pa;
1711
+ }
1712
+ }, f: function(a, b) {
1713
+ try {
1714
+ return a = a ? B(x, a) : "", Hc(b, ac(a));
1715
+ } catch (c) {
1716
+ if ("undefined" == typeof W || "ErrnoError" !== c.name) throw c;
1717
+ return -c.Pa;
1718
+ }
1719
+ }, r: function(a, b, c) {
1720
+ try {
1721
+ return b = b ? B(x, b) : "", b = Gc(a, b), 0 === c ? za(b) : 512 === c ? $b(b) : Ta("Invalid flags passed to unlinkat"), 0;
1722
+ } catch (d) {
1723
+ if ("undefined" == typeof W || "ErrnoError" !== d.name) throw d;
1724
+ return -d.Pa;
1725
+ }
1726
+ }, q: function(a, b, c) {
1727
+ try {
1728
+ b = b ? B(x, b) : "";
1729
+ b = Gc(a, b, true);
1730
+ var d = Date.now(), e, h;
1731
+ if (c) {
1732
+ var k = F[c >> 2] + 4294967296 * E[c + 4 >> 2], q = E[c + 8 >> 2];
1733
+ 1073741823 == q ? e = d : 1073741822 == q ? e = null : e = 1e3 * k + q / 1e6;
1734
+ c += 16;
1735
+ k = F[c >> 2] + 4294967296 * E[c + 4 >> 2];
1736
+ q = E[c + 8 >> 2];
1737
+ 1073741823 == q ? h = d : 1073741822 == q ? h = null : h = 1e3 * k + q / 1e6;
1738
+ } else h = e = d;
1739
+ if (null !== (h ?? e)) {
1740
+ a = e;
1741
+ var w = S(b, { $a: true }).node;
1742
+ Sb(w.La.Ua)(w, { atime: a, mtime: h });
1743
+ }
1744
+ return 0;
1745
+ } catch (v) {
1746
+ if ("undefined" == typeof W || "ErrnoError" !== v.name) throw v;
1747
+ return -v.Pa;
1748
+ }
1749
+ }, m: () => Ta(""), l: () => {
1750
+ cb = false;
1751
+ Kc = 0;
1752
+ }, A: function(a, b) {
1753
+ a = -9007199254740992 > a || 9007199254740992 < a ? NaN : Number(a);
1754
+ a = new Date(1e3 * a);
1755
+ E[b >> 2] = a.getSeconds();
1756
+ E[b + 4 >> 2] = a.getMinutes();
1757
+ E[b + 8 >> 2] = a.getHours();
1758
+ E[b + 12 >> 2] = a.getDate();
1759
+ E[b + 16 >> 2] = a.getMonth();
1760
+ E[b + 20 >> 2] = a.getFullYear() - 1900;
1761
+ E[b + 24 >> 2] = a.getDay();
1762
+ var c = a.getFullYear();
1763
+ E[b + 28 >> 2] = (0 !== c % 4 || 0 === c % 100 && 0 !== c % 400 ? Mc : Lc)[a.getMonth()] + a.getDate() - 1 | 0;
1764
+ E[b + 36 >> 2] = -(60 * a.getTimezoneOffset());
1765
+ c = new Date(
1766
+ a.getFullYear(),
1767
+ 6,
1768
+ 1
1769
+ ).getTimezoneOffset();
1770
+ var d = new Date(a.getFullYear(), 0, 1).getTimezoneOffset();
1771
+ E[b + 32 >> 2] = (c != d && a.getTimezoneOffset() == Math.min(d, c)) | 0;
1772
+ }, y: function(a, b, c, d, e, h, k) {
1773
+ e = -9007199254740992 > e || 9007199254740992 < e ? NaN : Number(e);
1774
+ try {
1775
+ if (isNaN(e)) return 61;
1776
+ var q = T(d);
1777
+ if (0 !== (b & 2) && 0 === (c & 2) && 2 !== (q.flags & 2097155)) throw new N(2);
1778
+ if (1 === (q.flags & 2097155)) throw new N(2);
1779
+ if (!q.Ma.ib) throw new N(43);
1780
+ if (!a) throw new N(28);
1781
+ var w = q.Ma.ib(q, a, e, b, c);
1782
+ var v = w.Kb;
1783
+ E[h >> 2] = w.Ab;
1784
+ F[k >> 2] = v;
1785
+ return 0;
1786
+ } catch (C) {
1787
+ if ("undefined" == typeof W || "ErrnoError" !== C.name) throw C;
1788
+ return -C.Pa;
1789
+ }
1790
+ }, z: function(a, b, c, d, e, h) {
1791
+ h = -9007199254740992 > h || 9007199254740992 < h ? NaN : Number(h);
1792
+ try {
1793
+ var k = T(e);
1794
+ if (c & 2) {
1795
+ c = h;
1796
+ if (32768 !== (k.node.mode & 61440)) throw new N(43);
1797
+ if (!(d & 2)) {
1798
+ var q = x.slice(a, a + b);
1799
+ k.Ma.jb && k.Ma.jb(k, q, c, b, d);
1800
+ }
1801
+ }
1802
+ } catch (w) {
1803
+ if ("undefined" == typeof W || "ErrnoError" !== w.name) throw w;
1804
+ return -w.Pa;
1805
+ }
1806
+ }, n: (a, b) => {
1807
+ Nc[a] && (clearTimeout(Nc[a].id), delete Nc[a]);
1808
+ if (!b) return 0;
1809
+ var c = setTimeout(() => {
1810
+ delete Nc[a];
1811
+ Pc(() => Wc(a, performance.now()));
1812
+ }, b);
1813
+ Nc[a] = {
1814
+ id: c,
1815
+ Xb: b
1816
+ };
1817
+ return 0;
1818
+ }, B: (a, b, c, d) => {
1819
+ var e = (/* @__PURE__ */ new Date()).getFullYear(), h = new Date(e, 0, 1).getTimezoneOffset();
1820
+ e = new Date(e, 6, 1).getTimezoneOffset();
1821
+ F[a >> 2] = 60 * Math.max(h, e);
1822
+ E[b >> 2] = Number(h != e);
1823
+ b = (k) => {
1824
+ var q = Math.abs(k);
1825
+ return `UTC${0 <= k ? "-" : "+"}${String(Math.floor(q / 60)).padStart(2, "0")}${String(q % 60).padStart(2, "0")}`;
1826
+ };
1827
+ a = b(h);
1828
+ b = b(e);
1829
+ e < h ? (u(a, x, c, 17), u(b, x, d, 17)) : (u(a, x, d, 17), u(b, x, c, 17));
1830
+ }, d: () => Date.now(), s: () => 2147483648, c: () => performance.now(), o: (a) => {
1831
+ var b = x.length;
1832
+ a >>>= 0;
1833
+ if (2147483648 < a) return false;
1834
+ for (var c = 1; 4 >= c; c *= 2) {
1835
+ var d = b * (1 + 0.2 / c);
1836
+ d = Math.min(d, a + 100663296);
1837
+ a: {
1838
+ d = (Math.min(2147483648, 65536 * Math.ceil(Math.max(a, d) / 65536)) - Ka.buffer.byteLength + 65535) / 65536 | 0;
1839
+ try {
1840
+ Ka.grow(d);
1841
+ Qa();
1842
+ var e = 1;
1843
+ break a;
1844
+ } catch (h) {
1845
+ }
1846
+ e = void 0;
1847
+ }
1848
+ if (e) return true;
1849
+ }
1850
+ return false;
1851
+ }, E: (a, b) => {
1852
+ var c = 0;
1853
+ Sc().forEach((d, e) => {
1854
+ var h = b + c;
1855
+ e = F[a + 4 * e >> 2] = h;
1856
+ for (h = 0; h < d.length; ++h) p[e++] = d.charCodeAt(h);
1857
+ p[e] = 0;
1858
+ c += d.length + 1;
1859
+ });
1860
+ return 0;
1861
+ }, F: (a, b) => {
1862
+ var c = Sc();
1863
+ F[a >> 2] = c.length;
1864
+ var d = 0;
1865
+ c.forEach((e) => d += e.length + 1);
1866
+ F[b >> 2] = d;
1867
+ return 0;
1868
+ }, e: function(a) {
1869
+ try {
1870
+ var b = T(a);
1871
+ qa(b);
1872
+ return 0;
1873
+ } catch (c) {
1874
+ if ("undefined" == typeof W || "ErrnoError" !== c.name) throw c;
1875
+ return c.Pa;
1876
+ }
1877
+ }, p: function(a, b) {
1878
+ try {
1879
+ var c = T(a);
1880
+ p[b] = c.tty ? 2 : P(c.mode) ? 3 : 40960 === (c.mode & 61440) ? 7 : 4;
1881
+ Na[b + 2 >> 1] = 0;
1882
+ H[b + 8 >> 3] = BigInt(0);
1883
+ H[b + 16 >> 3] = BigInt(0);
1884
+ return 0;
1885
+ } catch (d) {
1886
+ if ("undefined" == typeof W || "ErrnoError" !== d.name) throw d;
1887
+ return d.Pa;
1888
+ }
1889
+ }, w: function(a, b, c, d) {
1890
+ try {
1891
+ a: {
1892
+ var e = T(a);
1893
+ a = b;
1894
+ for (var h, k = b = 0; k < c; k++) {
1895
+ var q = F[a >> 2], w = F[a + 4 >> 2];
1896
+ a += 8;
1897
+ var v = Ec(e, p, q, w, h);
1898
+ if (0 > v) {
1899
+ var C = -1;
1900
+ break a;
1901
+ }
1902
+ b += v;
1903
+ if (v < w) break;
1904
+ "undefined" != typeof h && (h += v);
1905
+ }
1906
+ C = b;
1907
+ }
1908
+ F[d >> 2] = C;
1909
+ return 0;
1910
+ } catch (G) {
1911
+ if ("undefined" == typeof W || "ErrnoError" !== G.name) throw G;
1912
+ return G.Pa;
1913
+ }
1914
+ }, D: function(a, b, c, d) {
1915
+ b = -9007199254740992 > b || 9007199254740992 < b ? NaN : Number(b);
1916
+ try {
1917
+ if (isNaN(b)) return 61;
1918
+ var e = T(a);
1919
+ mc(e, b, c);
1920
+ H[d >> 3] = BigInt(e.position);
1921
+ e.ob && 0 === b && 0 === c && (e.ob = null);
1922
+ return 0;
1923
+ } catch (h) {
1924
+ if ("undefined" == typeof W || "ErrnoError" !== h.name) throw h;
1925
+ return h.Pa;
1926
+ }
1927
+ }, I: function(a) {
1928
+ try {
1929
+ var b = T(a);
1930
+ return b.Ma?.fsync ? b.Ma.fsync(b) : 0;
1931
+ } catch (c) {
1932
+ if ("undefined" == typeof W || "ErrnoError" !== c.name) throw c;
1933
+ return c.Pa;
1934
+ }
1935
+ }, t: function(a, b, c, d) {
1936
+ try {
1937
+ a: {
1938
+ var e = T(a);
1939
+ a = b;
1940
+ for (var h, k = b = 0; k < c; k++) {
1941
+ var q = F[a >> 2], w = F[a + 4 >> 2];
1942
+ a += 8;
1943
+ var v = pa(e, p, q, w, h);
1944
+ if (0 > v) {
1945
+ var C = -1;
1946
+ break a;
1947
+ }
1948
+ b += v;
1949
+ if (v < w) break;
1950
+ "undefined" != typeof h && (h += v);
1951
+ }
1952
+ C = b;
1953
+ }
1954
+ F[d >> 2] = C;
1955
+ return 0;
1956
+ } catch (G) {
1957
+ if ("undefined" == typeof W || "ErrnoError" !== G.name) throw G;
1958
+ return G.Pa;
1959
+ }
1960
+ }, k: Oc }, Z;
1961
+ (async function() {
1962
+ function a(c) {
1963
+ Z = c.exports;
1964
+ Ka = Z.M;
1965
+ Qa();
1966
+ Y = Z.O;
1967
+ K--;
1968
+ f.monitorRunDependencies?.(K);
1969
+ 0 == K && Sa && (c = Sa, Sa = null, c());
1970
+ return Z;
1971
+ }
1972
+ K++;
1973
+ f.monitorRunDependencies?.(K);
1974
+ var b = { a: Xc };
1975
+ if (f.instantiateWasm) return new Promise((c) => {
1976
+ f.instantiateWasm(b, (d, e) => {
1977
+ a(d, e);
1978
+ c(d.exports);
1979
+ });
1980
+ });
1981
+ Ua ??= f.locateFile ? f.locateFile("sql-wasm.wasm", D) : D + "sql-wasm.wasm";
1982
+ return a((await Xa(b)).instance);
1983
+ })();
1984
+ f._sqlite3_free = (a) => (f._sqlite3_free = Z.P)(a);
1985
+ f._sqlite3_value_text = (a) => (f._sqlite3_value_text = Z.Q)(a);
1986
+ f._sqlite3_prepare_v2 = (a, b, c, d, e) => (f._sqlite3_prepare_v2 = Z.R)(a, b, c, d, e);
1987
+ f._sqlite3_step = (a) => (f._sqlite3_step = Z.S)(a);
1988
+ f._sqlite3_reset = (a) => (f._sqlite3_reset = Z.T)(a);
1989
+ f._sqlite3_exec = (a, b, c, d, e) => (f._sqlite3_exec = Z.U)(a, b, c, d, e);
1990
+ f._sqlite3_finalize = (a) => (f._sqlite3_finalize = Z.V)(a);
1991
+ f._sqlite3_column_name = (a, b) => (f._sqlite3_column_name = Z.W)(a, b);
1992
+ f._sqlite3_column_text = (a, b) => (f._sqlite3_column_text = Z.X)(a, b);
1993
+ f._sqlite3_column_type = (a, b) => (f._sqlite3_column_type = Z.Y)(a, b);
1994
+ f._sqlite3_errmsg = (a) => (f._sqlite3_errmsg = Z.Z)(a);
1995
+ f._sqlite3_clear_bindings = (a) => (f._sqlite3_clear_bindings = Z._)(a);
1996
+ f._sqlite3_value_blob = (a) => (f._sqlite3_value_blob = Z.$)(a);
1997
+ f._sqlite3_value_bytes = (a) => (f._sqlite3_value_bytes = Z.aa)(a);
1998
+ f._sqlite3_value_double = (a) => (f._sqlite3_value_double = Z.ba)(a);
1999
+ f._sqlite3_value_int = (a) => (f._sqlite3_value_int = Z.ca)(a);
2000
+ f._sqlite3_value_type = (a) => (f._sqlite3_value_type = Z.da)(a);
2001
+ f._sqlite3_result_blob = (a, b, c, d) => (f._sqlite3_result_blob = Z.ea)(a, b, c, d);
2002
+ f._sqlite3_result_double = (a, b) => (f._sqlite3_result_double = Z.fa)(a, b);
2003
+ f._sqlite3_result_error = (a, b, c) => (f._sqlite3_result_error = Z.ga)(a, b, c);
2004
+ f._sqlite3_result_int = (a, b) => (f._sqlite3_result_int = Z.ha)(a, b);
2005
+ f._sqlite3_result_int64 = (a, b) => (f._sqlite3_result_int64 = Z.ia)(a, b);
2006
+ f._sqlite3_result_null = (a) => (f._sqlite3_result_null = Z.ja)(a);
2007
+ f._sqlite3_result_text = (a, b, c, d) => (f._sqlite3_result_text = Z.ka)(a, b, c, d);
2008
+ f._sqlite3_aggregate_context = (a, b) => (f._sqlite3_aggregate_context = Z.la)(a, b);
2009
+ f._sqlite3_column_count = (a) => (f._sqlite3_column_count = Z.ma)(a);
2010
+ f._sqlite3_data_count = (a) => (f._sqlite3_data_count = Z.na)(a);
2011
+ f._sqlite3_column_blob = (a, b) => (f._sqlite3_column_blob = Z.oa)(a, b);
2012
+ f._sqlite3_column_bytes = (a, b) => (f._sqlite3_column_bytes = Z.pa)(a, b);
2013
+ f._sqlite3_column_double = (a, b) => (f._sqlite3_column_double = Z.qa)(a, b);
2014
+ f._sqlite3_bind_blob = (a, b, c, d, e) => (f._sqlite3_bind_blob = Z.ra)(a, b, c, d, e);
2015
+ f._sqlite3_bind_double = (a, b, c) => (f._sqlite3_bind_double = Z.sa)(a, b, c);
2016
+ f._sqlite3_bind_int = (a, b, c) => (f._sqlite3_bind_int = Z.ta)(a, b, c);
2017
+ f._sqlite3_bind_text = (a, b, c, d, e) => (f._sqlite3_bind_text = Z.ua)(a, b, c, d, e);
2018
+ f._sqlite3_bind_parameter_index = (a, b) => (f._sqlite3_bind_parameter_index = Z.va)(a, b);
2019
+ f._sqlite3_sql = (a) => (f._sqlite3_sql = Z.wa)(a);
2020
+ f._sqlite3_normalized_sql = (a) => (f._sqlite3_normalized_sql = Z.xa)(a);
2021
+ f._sqlite3_changes = (a) => (f._sqlite3_changes = Z.ya)(a);
2022
+ f._sqlite3_close_v2 = (a) => (f._sqlite3_close_v2 = Z.za)(a);
2023
+ f._sqlite3_create_function_v2 = (a, b, c, d, e, h, k, q, w) => (f._sqlite3_create_function_v2 = Z.Aa)(a, b, c, d, e, h, k, q, w);
2024
+ f._sqlite3_update_hook = (a, b, c) => (f._sqlite3_update_hook = Z.Ba)(a, b, c);
2025
+ f._sqlite3_open = (a, b) => (f._sqlite3_open = Z.Ca)(a, b);
2026
+ var ia = f._malloc = (a) => (ia = f._malloc = Z.Da)(a), fa = f._free = (a) => (fa = f._free = Z.Ea)(a);
2027
+ f._RegisterExtensionFunctions = (a) => (f._RegisterExtensionFunctions = Z.Fa)(a);
2028
+ var Db = (a, b) => (Db = Z.Ga)(a, b), Wc = (a, b) => (Wc = Z.Ha)(a, b), wa = (a) => (wa = Z.Ia)(a), z = (a) => (z = Z.Ja)(a), sa = () => (sa = Z.Ka)();
2029
+ f.stackSave = () => sa();
2030
+ f.stackRestore = (a) => wa(a);
2031
+ f.stackAlloc = (a) => z(a);
2032
+ f.cwrap = (a, b, c, d) => {
2033
+ var e = !c || c.every((h) => "number" === h || "boolean" === h);
2034
+ return "string" !== b && e && !d ? f["_" + a] : (...h) => Tc(a, b, c, h);
2035
+ };
2036
+ f.addFunction = Aa;
2037
+ f.removeFunction = A;
2038
+ f.UTF8ToString = ua;
2039
+ f.ALLOC_NORMAL = ea;
2040
+ f.allocate = da;
2041
+ f.allocateUTF8OnStack = xa;
2042
+ function Yc() {
2043
+ function a() {
2044
+ f.calledRun = true;
2045
+ if (!La) {
2046
+ if (!f.noFSInit && !Ib) {
2047
+ var b, c;
2048
+ Ib = true;
2049
+ d ??= f.stdin;
2050
+ b ??= f.stdout;
2051
+ c ??= f.stderr;
2052
+ d ? V("stdin", d) : Zb("/dev/tty", "/dev/stdin");
2053
+ b ? V("stdout", null, b) : Zb("/dev/tty", "/dev/stdout");
2054
+ c ? V("stderr", null, c) : Zb("/dev/tty1", "/dev/stderr");
2055
+ oa("/dev/stdin", 0);
2056
+ oa("/dev/stdout", 1);
2057
+ oa("/dev/stderr", 1);
2058
+ }
2059
+ Z.N();
2060
+ Jb = false;
2061
+ f.onRuntimeInitialized?.();
2062
+ if (f.postRun) for ("function" == typeof f.postRun && (f.postRun = [f.postRun]); f.postRun.length; ) {
2063
+ var d = f.postRun.shift();
2064
+ $a.unshift(d);
2065
+ }
2066
+ Za($a);
2067
+ }
2068
+ }
2069
+ if (0 < K) Sa = Yc;
2070
+ else {
2071
+ if (f.preRun) for ("function" == typeof f.preRun && (f.preRun = [f.preRun]); f.preRun.length; ) bb();
2072
+ Za(ab);
2073
+ 0 < K ? Sa = Yc : f.setStatus ? (f.setStatus("Running..."), setTimeout(() => {
2074
+ setTimeout(() => f.setStatus(""), 1);
2075
+ a();
2076
+ }, 1)) : a();
2077
+ }
2078
+ }
2079
+ if (f.preInit) for ("function" == typeof f.preInit && (f.preInit = [f.preInit]); 0 < f.preInit.length; ) f.preInit.pop()();
2080
+ Yc();
2081
+ return Module;
2082
+ });
2083
+ return initSqlJsPromise;
2084
+ };
2085
+ if (typeof exports === "object" && typeof module === "object") {
2086
+ module.exports = initSqlJs;
2087
+ module.exports.default = initSqlJs;
2088
+ } else if (typeof define === "function" && define["amd"]) {
2089
+ define([], function() {
2090
+ return initSqlJs;
2091
+ });
2092
+ } else if (typeof exports === "object") {
2093
+ exports["Module"] = initSqlJs;
2094
+ }
2095
+ }
2096
+ });
2097
+ export default require_sql_wasm();