@weapp-sqlite/sqljs 0.2.1 → 0.3.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 +9 -5
- package/dist/assets/sql-wasm-browser.wasm +0 -0
- package/dist/assets/sql-wasm-lite.wasm +0 -0
- package/dist/assets/sql-wasm.wasm +0 -0
- package/dist/full-browser.cjs +15 -0
- package/dist/full-browser.d.cts +5 -0
- package/dist/full-browser.d.mts +5 -0
- package/dist/full-browser.mjs +8 -0
- package/dist/full.cjs +7 -4
- package/dist/full.mjs +5 -2
- package/dist/lite.cjs +8 -2370
- package/dist/lite.mjs +6 -2391
- package/dist/manifest.json +77 -5
- package/dist/node.cjs +1 -7
- package/dist/node.mjs +1 -5
- package/dist/{rolldown-runtime-y5ARvAq5.cjs → rolldown-runtime-VH7oDXx4.cjs} +0 -7
- package/dist/vendor/LICENSE.sql.js +44 -0
- package/dist/vendor/package.json +3 -0
- package/dist/vendor/sql-wasm-browser.js +184 -0
- package/dist/vendor/sql-wasm-lite.js +187 -0
- package/dist/vendor/sql-wasm.js +187 -0
- package/package.json +14 -5
package/dist/manifest.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"engine": "sql.js-wasm
|
|
2
|
+
"engine": "sql.js-wasm",
|
|
3
3
|
"sqlJs": {
|
|
4
4
|
"version": "1.14.2",
|
|
5
5
|
"source": "https://github.com/sql-js/sql.js/tree/v1.14.2",
|
|
@@ -33,12 +33,84 @@
|
|
|
33
33
|
},
|
|
34
34
|
"artifacts": {
|
|
35
35
|
"sql-wasm-lite.js": {
|
|
36
|
-
"bytes":
|
|
37
|
-
"sha256": "
|
|
36
|
+
"bytes": 46915,
|
|
37
|
+
"sha256": "adbda97ca7e03edf6bdf33c8ca3694bc67da5803aaea1458f759d8b543ea6c96"
|
|
38
38
|
},
|
|
39
39
|
"sql-wasm-lite.wasm": {
|
|
40
|
-
"bytes":
|
|
41
|
-
"sha256": "
|
|
40
|
+
"bytes": 546993,
|
|
41
|
+
"sha256": "bd1e11a26f9e89f15b389d5f346329b78f6565256964468c6475c2607aea1558"
|
|
42
|
+
},
|
|
43
|
+
"sql-wasm.js": {
|
|
44
|
+
"bytes": 47265,
|
|
45
|
+
"sha256": "80019b7435e900c6cbb1c250682f51f29c889dfcb0a15f39040095c8ce693307"
|
|
46
|
+
},
|
|
47
|
+
"sql-wasm.wasm": {
|
|
48
|
+
"bytes": 659329,
|
|
49
|
+
"sha256": "57988c1aee5e6193f07789492e1967f52ebaa4b8e4d8e77e81cf2894ae42362f"
|
|
50
|
+
},
|
|
51
|
+
"sql-wasm-browser.js": {
|
|
52
|
+
"bytes": 45859,
|
|
53
|
+
"sha256": "bbf60e2c67ccf6ae1d09c6073934a3b62a6dc036b63c5defebf22fa209bdc7de"
|
|
54
|
+
},
|
|
55
|
+
"sql-wasm-browser.wasm": {
|
|
56
|
+
"bytes": 659329,
|
|
57
|
+
"sha256": "57988c1aee5e6193f07789492e1967f52ebaa4b8e4d8e77e81cf2894ae42362f"
|
|
58
|
+
},
|
|
59
|
+
"package.json": {
|
|
60
|
+
"bytes": 25,
|
|
61
|
+
"sha256": "8005a3491db7d92f36ac66369861589f9c47123d3a7c71e643fc2c06168cd45a"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"capabilities": [
|
|
65
|
+
"exportSnapshot",
|
|
66
|
+
"execWithMetadata"
|
|
67
|
+
],
|
|
68
|
+
"variants": {
|
|
69
|
+
"full": {
|
|
70
|
+
"included": [
|
|
71
|
+
"fts3",
|
|
72
|
+
"normalize",
|
|
73
|
+
"extension-functions"
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
"lite": {
|
|
77
|
+
"included": [
|
|
78
|
+
"tables",
|
|
79
|
+
"indexes",
|
|
80
|
+
"transactions",
|
|
81
|
+
"triggers",
|
|
82
|
+
"cte",
|
|
83
|
+
"json1",
|
|
84
|
+
"alter-table",
|
|
85
|
+
"parameters",
|
|
86
|
+
"blob",
|
|
87
|
+
"import-export"
|
|
88
|
+
],
|
|
89
|
+
"excluded": [
|
|
90
|
+
"fts3",
|
|
91
|
+
"normalize",
|
|
92
|
+
"extension-functions"
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
"licenses": {
|
|
97
|
+
"LICENSE.sql.js": {
|
|
98
|
+
"bytes": 2199,
|
|
99
|
+
"sha256": "60a3f6e4d7b29b4321359e683b36cf198d24f58e24582070f56e6fa89d5ee2be"
|
|
100
|
+
},
|
|
101
|
+
"LICENSE.sqlite.md": {
|
|
102
|
+
"bytes": 159,
|
|
103
|
+
"sha256": "b8325ebddd14ecb6886050451754543a382efd41bd4adb86ddad389c939b32c1"
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"patches": {
|
|
107
|
+
"sqljs-reliability.patch": {
|
|
108
|
+
"bytes": 4824,
|
|
109
|
+
"sha256": "e9772269d3590b4bf7e43784bf312f143cff013c61fba151fb04bf9455c2bfae"
|
|
110
|
+
},
|
|
111
|
+
"sqljs-lite.patch": {
|
|
112
|
+
"bytes": 4409,
|
|
113
|
+
"sha256": "ff01ef73b176f021dddda1c71b0c64cae7726156783d02186fc5783c923d741e"
|
|
42
114
|
}
|
|
43
115
|
}
|
|
44
116
|
}
|
package/dist/node.cjs
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_rolldown_runtime = require("./rolldown-runtime-y5ARvAq5.cjs");
|
|
3
|
-
let node_module = require("node:module");
|
|
4
|
-
let node_path = require("node:path");
|
|
5
|
-
node_path = require_rolldown_runtime.__toESM(node_path, 1);
|
|
6
2
|
let node_url = require("node:url");
|
|
7
3
|
//#region src/node.ts
|
|
8
|
-
const require$1 = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
|
|
9
4
|
function sqliteWasmAssetName(variant, target) {
|
|
10
5
|
if (variant === "lite") return "sql-wasm-lite.wasm";
|
|
11
6
|
return target === "web" ? "sql-wasm-browser.wasm" : "sql-wasm.wasm";
|
|
12
7
|
}
|
|
13
8
|
function resolveSqliteWasmAsset(variant, target) {
|
|
14
|
-
|
|
15
|
-
return node_path.default.join(node_path.default.dirname(require$1.resolve("sql.js")), sqliteWasmAssetName(variant, target));
|
|
9
|
+
return (0, node_url.fileURLToPath)(new URL(`./assets/${sqliteWasmAssetName(variant, target)}`, require("url").pathToFileURL(__filename).href));
|
|
16
10
|
}
|
|
17
11
|
//#endregion
|
|
18
12
|
exports.resolveSqliteWasmAsset = resolveSqliteWasmAsset;
|
package/dist/node.mjs
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import { createRequire } from "node:module";
|
|
2
|
-
import path from "node:path";
|
|
3
1
|
import { fileURLToPath } from "node:url";
|
|
4
2
|
//#region src/node.ts
|
|
5
|
-
const require = createRequire(import.meta.url);
|
|
6
3
|
function sqliteWasmAssetName(variant, target) {
|
|
7
4
|
if (variant === "lite") return "sql-wasm-lite.wasm";
|
|
8
5
|
return target === "web" ? "sql-wasm-browser.wasm" : "sql-wasm.wasm";
|
|
9
6
|
}
|
|
10
7
|
function resolveSqliteWasmAsset(variant, target) {
|
|
11
|
-
|
|
12
|
-
return path.join(path.dirname(require.resolve("sql.js")), sqliteWasmAssetName(variant, target));
|
|
8
|
+
return fileURLToPath(new URL(`./assets/${sqliteWasmAssetName(variant, target)}`, import.meta.url));
|
|
13
9
|
}
|
|
14
10
|
//#endregion
|
|
15
11
|
export { resolveSqliteWasmAsset, sqliteWasmAssetName };
|
|
@@ -5,7 +5,6 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
9
8
|
var __copyProps = (to, from, except, desc) => {
|
|
10
9
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
10
|
key = keys[i];
|
|
@@ -21,12 +20,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
21
20
|
enumerable: true
|
|
22
21
|
}) : target, mod));
|
|
23
22
|
//#endregion
|
|
24
|
-
Object.defineProperty(exports, "__commonJSMin", {
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function() {
|
|
27
|
-
return __commonJSMin;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
23
|
Object.defineProperty(exports, "__toESM", {
|
|
31
24
|
enumerable: true,
|
|
32
25
|
get: function() {
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
MIT license
|
|
2
|
+
===========
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2017 sql.js authors (see AUTHORS)
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
# Some portions of the Makefile taken from:
|
|
27
|
+
Copyright 2017 Ryusei Yamaguchi
|
|
28
|
+
|
|
29
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
30
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
31
|
+
the Software without restriction, including without limitation the rights to
|
|
32
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
33
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
34
|
+
subject to the following conditions:
|
|
35
|
+
|
|
36
|
+
The above copyright notice and this permission notice shall be included in all
|
|
37
|
+
copies or substantial portions of the Software.
|
|
38
|
+
|
|
39
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
40
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
41
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
42
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
43
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
44
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
|
|
2
|
+
// We are modularizing this manually because the current modularize setting in Emscripten has some issues:
|
|
3
|
+
// https://github.com/kripken/emscripten/issues/5820
|
|
4
|
+
// In addition, When you use emcc's modularization, it still expects to export a global object called `Module`,
|
|
5
|
+
// which is able to be used/called before the WASM is loaded.
|
|
6
|
+
// The modularization below exports a promise that loads and resolves to the actual sql.js module.
|
|
7
|
+
// That way, this module can't be used before the WASM is finished loading.
|
|
8
|
+
|
|
9
|
+
// We are going to define a function that a user will call to start loading initializing our Sql.js library
|
|
10
|
+
// However, that function might be called multiple times, and on subsequent calls, we don't actually want it to instantiate a new instance of the Module
|
|
11
|
+
// Instead, we want to return the previously loaded module
|
|
12
|
+
|
|
13
|
+
// TODO: Make this not declare a global if used in the browser
|
|
14
|
+
var initSqlJsPromise = undefined;
|
|
15
|
+
|
|
16
|
+
var initSqlJs = function (moduleConfig) {
|
|
17
|
+
|
|
18
|
+
if (initSqlJsPromise){
|
|
19
|
+
return initSqlJsPromise;
|
|
20
|
+
}
|
|
21
|
+
// If we're here, we've never called this function before
|
|
22
|
+
initSqlJsPromise = new Promise(function (resolveModule, reject) {
|
|
23
|
+
|
|
24
|
+
// We are modularizing this manually because the current modularize setting in Emscripten has some issues:
|
|
25
|
+
// https://github.com/kripken/emscripten/issues/5820
|
|
26
|
+
|
|
27
|
+
// The way to affect the loading of emcc compiled modules is to create a variable called `Module` and add
|
|
28
|
+
// properties to it, like `preRun`, `postRun`, etc
|
|
29
|
+
// We are using that to get notified when the WASM has finished loading.
|
|
30
|
+
// Only then will we return our promise
|
|
31
|
+
|
|
32
|
+
// If they passed in a moduleConfig object, use that
|
|
33
|
+
// Otherwise, initialize Module to the empty object
|
|
34
|
+
var Module = typeof moduleConfig !== 'undefined' ? moduleConfig : {};
|
|
35
|
+
|
|
36
|
+
// EMCC only allows for a single onAbort function (not an array of functions)
|
|
37
|
+
// So if the user defined their own onAbort function, we remember it and call it
|
|
38
|
+
var originalOnAbortFunction = Module['onAbort'];
|
|
39
|
+
Module['onAbort'] = function (errorThatCausedAbort) {
|
|
40
|
+
reject(new Error(errorThatCausedAbort));
|
|
41
|
+
if (originalOnAbortFunction){
|
|
42
|
+
originalOnAbortFunction(errorThatCausedAbort);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
Module['postRun'] = Module['postRun'] || [];
|
|
47
|
+
Module['postRun'].push(function () {
|
|
48
|
+
// When Emscripted calls postRun, this promise resolves with the built Module
|
|
49
|
+
resolveModule(Module);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
// There is a section of code in the emcc-generated code below that looks like this:
|
|
53
|
+
// (Note that this is lowercase `module`)
|
|
54
|
+
// if (typeof module !== 'undefined') {
|
|
55
|
+
// module['exports'] = Module;
|
|
56
|
+
// }
|
|
57
|
+
// When that runs, it's going to overwrite our own modularization export efforts in shell-post.js!
|
|
58
|
+
// The only way to tell emcc not to emit it is to pass the MODULARIZE=1 or MODULARIZE_INSTANCE=1 flags,
|
|
59
|
+
// but that carries with it additional unnecessary baggage/bugs we don't want either.
|
|
60
|
+
// So, we have three options:
|
|
61
|
+
// 1) We undefine `module`
|
|
62
|
+
// 2) We remember what `module['exports']` was at the beginning of this function and we restore it later
|
|
63
|
+
// 3) We write a script to remove those lines of code as part of the Make process.
|
|
64
|
+
//
|
|
65
|
+
// Since those are the only lines of code that care about module, we will undefine it. It's the most straightforward
|
|
66
|
+
// of the options, and has the side effect of reducing emcc's efforts to modify the module if its output were to change in the future.
|
|
67
|
+
// That's a nice side effect since we're handling the modularization efforts ourselves
|
|
68
|
+
module = undefined;
|
|
69
|
+
|
|
70
|
+
// The emcc-generated code and shell-post.js code goes below,
|
|
71
|
+
// meaning that all of it runs inside of this promise. If anything throws an exception, our promise will abort
|
|
72
|
+
var l;l||=typeof Module != 'undefined' ? Module : {};var aa=!!globalThis.window,ba=!!globalThis.WorkerGlobalScope;
|
|
73
|
+
l.onRuntimeInitialized=function(){function a(f,h){switch(typeof h){case "boolean":bc(f,h?1:0);break;case "number":cc(f,h);break;case "string":dc(f,h,-1,-1);break;case "object":if(null===h)eb(f);else if(null!=h.length){var n=ca(h.length);m.set(h,n);ec(f,n,h.length,-1);da(n)}else ua(f,"Wrong API use : tried to return a value of an unknown type ("+h+").",-1);break;default:eb(f)}}function b(f,h){for(var n=[],p=0;p<f;p+=1){var r=t(h+4*p,"i32"),v=fc(r);if(1===v||2===v)r=gc(r);else if(3===v)r=hc(r);else if(4===
|
|
74
|
+
v){v=r;r=ic(v);v=jc(v);for(var J=new Uint8Array(r),H=0;H<r;H+=1)J[H]=m[v+H];r=J}else r=null;n.push(r)}return n}function c(f,h){this.Sa=f;this.db=h;this.Qa=1;this.Ab=[]}function d(f,h){this.db=h;this.qb=ea(f);if(null===this.qb)throw Error("Unable to allocate memory for the SQL string");this.wb=this.qb;this.ib=this.Hb=null}function e(f){this.filename="dbfile_"+(4294967295*Math.random()>>>0);if(null!=f){var h=this.filename,n="/",p=h;n&&(n="string"==typeof n?n:fa(n),p=h?ha(n+"/"+h):n);h=ia(!0,!0);p=ja(p,
|
|
75
|
+
h);if(f){if("string"==typeof f){n=Array(f.length);for(var r=0,v=f.length;r<v;++r)n[r]=f.charCodeAt(r);f=n}ka(p,h|146);n=la(p,577);ma(n,f,0,f.length,0);na(n);ka(p,h)}}this.handleError(q(this.filename,g));this.db=t(g,"i32");hb(this.db);this.rb={};this.Ua={}}var g=y(4),k=l.cwrap,q=k("sqlite3_open","number",["string","number"]),w=k("sqlite3_close_v2","number",["number"]),u=k("sqlite3_exec","number",["number","string","number","number","number"]),x=k("sqlite3_changes","number",["number"]),E=k("sqlite3_stmt_readonly",
|
|
76
|
+
"number",["number"]),ib=k("sqlite3_serialize","number",["number","string","number","number"]),lc=k("sqlite3_free",null,["number"]),mc=k("sqlite3_prepare_v2","number",["number","string","number","number","number"]),nc=k("sqlite3_sql","string",["number"]),oc=k("sqlite3_normalized_sql","string",["number"]),jb=k("sqlite3_prepare_v2","number",["number","number","number","number","number"]),pc=k("sqlite3_bind_text","number",["number","number","number","number","number"]),kb=k("sqlite3_bind_blob","number",
|
|
77
|
+
["number","number","number","number","number"]),qc=k("sqlite3_bind_double","number",["number","number","number"]),rc=k("sqlite3_bind_int","number",["number","number","number"]),sc=k("sqlite3_bind_parameter_index","number",["number","string"]),tc=k("sqlite3_step","number",["number"]),uc=k("sqlite3_errmsg","string",["number"]),vc=k("sqlite3_column_count","number",["number"]),wc=k("sqlite3_data_count","number",["number"]),xc=k("sqlite3_column_double","number",["number","number"]),lb=k("sqlite3_column_text",
|
|
78
|
+
"string",["number","number"]),yc=k("sqlite3_column_blob","number",["number","number"]),zc=k("sqlite3_column_bytes","number",["number","number"]),Ac=k("sqlite3_column_type","number",["number","number"]),Bc=k("sqlite3_column_name","string",["number","number"]),Cc=k("sqlite3_reset","number",["number"]),Dc=k("sqlite3_clear_bindings","number",["number"]),Ec=k("sqlite3_finalize","number",["number"]),mb=k("sqlite3_create_function_v2","number","number string number number number number number number number".split(" ")),
|
|
79
|
+
fc=k("sqlite3_value_type","number",["number"]),ic=k("sqlite3_value_bytes","number",["number"]),hc=k("sqlite3_value_text","string",["number"]),jc=k("sqlite3_value_blob","number",["number"]),gc=k("sqlite3_value_double","number",["number"]),cc=k("sqlite3_result_double","",["number","number"]),eb=k("sqlite3_result_null","",["number"]),dc=k("sqlite3_result_text","",["number","string","number","number"]),ec=k("sqlite3_result_blob","",["number","number","number","number"]),bc=k("sqlite3_result_int","",["number",
|
|
80
|
+
"number"]),ua=k("sqlite3_result_error","",["number","string","number"]),nb=k("sqlite3_aggregate_context","number",["number","number"]),hb=k("RegisterExtensionFunctions","number",["number"]),ob=k("sqlite3_update_hook","number",["number","number","number"]);c.prototype.bind=function(f){if(!this.Sa)throw"Statement closed";this.reset();return Array.isArray(f)?this.Zb(f):null!=f&&"object"===typeof f?this.$b(f):!0};c.prototype.step=function(){if(!this.Sa)throw"Statement closed";this.Qa=1;var f=tc(this.Sa);
|
|
81
|
+
switch(f){case 100:return!0;case 101:return!1;default:throw this.db.handleError(f);}};c.prototype.Sb=function(f){null==f&&(f=this.Qa,this.Qa+=1);return xc(this.Sa,f)};c.prototype.lc=function(f){null==f&&(f=this.Qa,this.Qa+=1);f=lb(this.Sa,f);if("function"!==typeof BigInt)throw Error("BigInt is not supported");return BigInt(f)};c.prototype.qc=function(f){null==f&&(f=this.Qa,this.Qa+=1);return lb(this.Sa,f)};c.prototype.getBlob=function(f){null==f&&(f=this.Qa,this.Qa+=1);var h=zc(this.Sa,f);f=yc(this.Sa,
|
|
82
|
+
f);for(var n=new Uint8Array(h),p=0;p<h;p+=1)n[p]=m[f+p];return n};c.prototype.get=function(f,h){h=h||{};null!=f&&this.bind(f)&&this.step();f=[];for(var n=wc(this.Sa),p=0;p<n;p+=1)switch(Ac(this.Sa,p)){case 1:var r=h.useBigInt?this.lc(p):this.Sb(p);f.push(r);break;case 2:f.push(this.Sb(p));break;case 3:f.push(this.qc(p));break;case 4:f.push(this.getBlob(p));break;default:f.push(null)}return f};c.prototype.Fb=function(){for(var f=[],h=vc(this.Sa),n=0;n<h;n+=1)f.push(Bc(this.Sa,n));return f};c.prototype.Rb=
|
|
83
|
+
function(f,h){f=this.get(f,h);h=this.Fb();for(var n={},p=0;p<h.length;p+=1)n[h[p]]=f[p];return n};c.prototype.pc=function(){return nc(this.Sa)};c.prototype.mc=function(){return oc(this.Sa)};c.prototype.Lb=function(f){null!=f&&this.bind(f);this.step();return this.reset()};c.prototype.Nb=function(f,h){null==h&&(h=this.Qa,this.Qa+=1);f=ea(f);this.Ab.push(f);this.db.handleError(pc(this.Sa,h,f,-1,0))};c.prototype.Yb=function(f,h){null==h&&(h=this.Qa,this.Qa+=1);var n=ca(f.length);m.set(f,n);this.Ab.push(n);
|
|
84
|
+
this.db.handleError(kb(this.Sa,h,n,f.length,0))};c.prototype.Mb=function(f,h){null==h&&(h=this.Qa,this.Qa+=1);this.db.handleError((f===(f|0)?rc:qc)(this.Sa,h,f))};c.prototype.ac=function(f){null==f&&(f=this.Qa,this.Qa+=1);kb(this.Sa,f,0,0,0)};c.prototype.Ob=function(f,h){null==h&&(h=this.Qa,this.Qa+=1);switch(typeof f){case "string":this.Nb(f,h);return;case "number":this.Mb(f,h);return;case "bigint":this.Nb(f.toString(),h);return;case "boolean":this.Mb(f+0,h);return;case "object":if(null===f){this.ac(h);
|
|
85
|
+
return}if(null!=f.length){this.Yb(f,h);return}}throw"Wrong API use : tried to bind a value of an unknown type ("+f+").";};c.prototype.$b=function(f){var h=this;Object.keys(f).forEach(function(n){var p=sc(h.Sa,n);0!==p&&h.Ob(f[n],p)});return!0};c.prototype.Zb=function(f){for(var h=0;h<f.length;h+=1)this.Ob(f[h],h+1);return!0};c.prototype.reset=function(){this.Eb();return 0===Dc(this.Sa)&&0===Cc(this.Sa)};c.prototype.Eb=function(){for(var f;void 0!==(f=this.Ab.pop());)da(f)};c.prototype.fb=function(){this.Eb();
|
|
86
|
+
var f=0===Ec(this.Sa);delete this.db.rb[this.Sa];this.Sa=0;return f};d.prototype.next=function(){if(null===this.qb)return{done:!0};null!==this.ib&&(this.ib.fb(),this.ib=null);if(!this.db.db)throw this.Cb(),Error("Database closed");var f=oa(),h=y(4);z(g);z(h);try{this.db.handleError(jb(this.db.db,this.wb,-1,g,h));this.wb=t(h,"i32");var n=t(g,"i32");if(0===n)return this.Cb(),{done:!0};this.ib=new c(n,this.db);this.db.rb[n]=this.ib;return{value:this.ib,done:!1}}catch(p){throw this.Hb=A(this.wb),this.Cb(),
|
|
87
|
+
p;}finally{pa(f)}};d.prototype.Cb=function(){da(this.qb);this.qb=null};d.prototype.nc=function(){return null!==this.Hb?this.Hb:A(this.wb)};"function"===typeof Symbol&&"symbol"===typeof Symbol.iterator&&(d.prototype[Symbol.iterator]=function(){return this});e.prototype.Lb=function(f,h){if(!this.db)throw"Database closed";if(h){f=this.Ib(f,h);try{f.step()}finally{f.fb()}}else this.handleError(u(this.db,f,0,0,g));return this};e.prototype.exec=function(f,h,n){return this.Qb(f,h,n).results};e.prototype.Qb=
|
|
88
|
+
function(f,h,n){if(!this.db)throw"Database closed";var p=oa(),r=null,v=null,J=null;try{J=v=ea(f);var H=y(4);f=[];for(var M=!0;0!==t(J,"i8");){z(g);z(H);this.handleError(jb(this.db,J,-1,g,H));var I=t(g,"i32");J=t(H,"i32");if(0!==I){E(I)||(M=!1);var S=null;r=new c(I,this);for(null!=h&&r.bind(h);r.step();)null===S&&(S={columns:r.Fb(),values:[]},f.push(S)),S.values.push(r.get(null,n));r.fb()}}return{results:f,readOnly:M}}catch(Q){throw r&&r.fb(),Q;}finally{v&&da(v),pa(p)}};e.prototype.ic=function(f,h,
|
|
89
|
+
n,p,r){"function"===typeof h&&(p=n,n=h,h=void 0);f=this.Ib(f,h);try{for(;f.step();)n(f.Rb(null,r))}finally{f.fb()}if("function"===typeof p)return p()};e.prototype.Ib=function(f,h){z(g);this.handleError(mc(this.db,f,-1,g,0));f=t(g,"i32");if(0===f)throw"Nothing to prepare";var n=new c(f,this);null!=h&&n.bind(h);return this.rb[f]=n};e.prototype.tc=function(f){return new d(f,this)};e.prototype.jc=function(){Object.values(this.rb).forEach(function(h){h.fb()});Object.values(this.Ua).forEach(B);this.Ua=
|
|
90
|
+
{};this.handleError(w(this.db));var f=qa(this.filename);this.handleError(q(this.filename,g));this.db=t(g,"i32");hb(this.db);return f};e.prototype.kc=function(){if(!this.db)throw Error("Database closed");var f=oa(),h=0;try{var n=y(8);z(n);z(n+4);h=ib(this.db,"main",n,0)>>>0;var p=t(n,"i32")>>>0,r=t(n+4,"i32")>>>0;if(!h||0!==r||p>C.length||h>C.length-p)throw Error("Unable to serialize SQLite database.");return C.slice(h,h+p)}finally{h&&lc(h),pa(f)}};e.prototype.close=function(){null!==this.db&&(Object.values(this.rb).forEach(function(f){f.fb()}),
|
|
91
|
+
Object.values(this.Ua).forEach(B),this.Ua={},this.hb&&(B(this.hb),this.hb=void 0),this.handleError(w(this.db)),ra("/"+this.filename),this.db=null)};e.prototype.handleError=function(f){if(0===f)return null;f=uc(this.db);throw Error(f);};e.prototype.oc=function(){return x(this.db)};e.prototype.ec=function(f,h){Object.prototype.hasOwnProperty.call(this.Ua,f)&&(B(this.Ua[f]),delete this.Ua[f]);var n=sa(function(p,r,v){r=b(r,v);try{var J=h.apply(null,r)}catch(H){ua(p,H,-1);return}a(p,J)},"viii");this.Ua[f]=
|
|
92
|
+
n;this.handleError(mb(this.db,f,h.length,1,0,n,0,0,0));return this};e.prototype.dc=function(f,h){var n=h.init||function(){return null},p=h.finalize||function(M){return M},r=h.step;if(!r)throw"An aggregate function must have a step function in "+f;var v={};Object.hasOwnProperty.call(this.Ua,f)&&(B(this.Ua[f]),delete this.Ua[f]);h=f+"__finalize";Object.hasOwnProperty.call(this.Ua,h)&&(B(this.Ua[h]),delete this.Ua[h]);var J=sa(function(M,I,S){var Q=nb(M,1);Object.hasOwnProperty.call(v,Q)||(v[Q]=n());
|
|
93
|
+
I=b(I,S);I=[v[Q]].concat(I);try{v[Q]=r.apply(null,I)}catch(Gc){delete v[Q],ua(M,Gc,-1)}},"viii"),H=sa(function(M){var I=nb(M,1);try{var S=p(v[I])}catch(Q){delete v[I];ua(M,Q,-1);return}a(M,S);delete v[I]},"vi");this.Ua[f]=J;this.Ua[h]=H;this.handleError(mb(this.db,f,r.length-1,1,0,0,J,H,0));return this};e.prototype.zc=function(f){this.hb&&(ob(this.db,0,0),B(this.hb),this.hb=void 0);if(!f)return this;this.hb=sa(function(h,n,p,r,v){switch(n){case 18:h="insert";break;case 23:h="update";break;case 9:h=
|
|
94
|
+
"delete";break;default:throw"unknown operationCode in updateHook callback: "+n;}p=A(p);r=A(r);if(v>Number.MAX_SAFE_INTEGER)throw"rowId too big to fit inside a Number";f(h,p,r,Number(v))},"viiiij");ob(this.db,this.hb,0);return this};c.prototype.bind=c.prototype.bind;c.prototype.step=c.prototype.step;c.prototype.get=c.prototype.get;c.prototype.getColumnNames=c.prototype.Fb;c.prototype.getAsObject=c.prototype.Rb;c.prototype.getSQL=c.prototype.pc;c.prototype.getNormalizedSQL=c.prototype.mc;c.prototype.run=
|
|
95
|
+
c.prototype.Lb;c.prototype.reset=c.prototype.reset;c.prototype.freemem=c.prototype.Eb;c.prototype.free=c.prototype.fb;d.prototype.next=d.prototype.next;d.prototype.getRemainingSQL=d.prototype.nc;e.prototype.run=e.prototype.Lb;e.prototype.exec=e.prototype.exec;e.prototype.execWithMetadata=e.prototype.Qb;e.prototype.each=e.prototype.ic;e.prototype.prepare=e.prototype.Ib;e.prototype.iterateStatements=e.prototype.tc;e.prototype["export"]=e.prototype.jc;e.prototype.exportSnapshot=e.prototype.kc;e.prototype.close=
|
|
96
|
+
e.prototype.close;e.prototype.handleError=e.prototype.handleError;e.prototype.getRowsModified=e.prototype.oc;e.prototype.create_function=e.prototype.ec;e.prototype.create_aggregate=e.prototype.dc;e.prototype.updateHook=e.prototype.zc;l.Database=e};var ta="./this.program",va=globalThis.document?.currentScript?.src;ba&&(va=self.location.href);var wa="",xa,ya;
|
|
97
|
+
if(aa||ba){try{wa=(new URL(".",va)).href}catch{}ba&&(ya=a=>{var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)});xa=async a=>{a=await fetch(a,{credentials:"same-origin"});if(a.ok)return a.arrayBuffer();throw Error(a.status+" : "+a.url);}}var za=console.log.bind(console),D=console.error.bind(console),Aa,Ba=!1,Ca,m,C,Da,F,G,Ea,Fa,K;
|
|
98
|
+
function Ga(){var a=Ha.buffer;m=new Int8Array(a);Da=new Int16Array(a);C=new Uint8Array(a);new Uint16Array(a);F=new Int32Array(a);G=new Uint32Array(a);Ea=new Float32Array(a);Fa=new Float64Array(a);K=new BigInt64Array(a);new BigUint64Array(a)}function Ia(a){l.onAbort?.(a);a="Aborted("+a+")";D(a);Ba=!0;throw new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");}var Ja;
|
|
99
|
+
async function Ka(a){if(!Aa)try{var b=await xa(a);return new Uint8Array(b)}catch{}if(a==Ja&&Aa)a=new Uint8Array(Aa);else if(ya)a=ya(a);else throw"both async and sync fetching of the wasm failed";return a}async function La(a,b){try{var c=await Ka(a);return await WebAssembly.instantiate(c,b)}catch(d){D(`failed to asynchronously prepare wasm: ${d}`),Ia(d)}}
|
|
100
|
+
async function Ma(a){var b=Ja;if(!Aa)try{var c=fetch(b,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(c,a)}catch(d){D(`wasm streaming compile failed: ${d}`),D("falling back to ArrayBuffer instantiation")}return La(b,a)}class Na{name="ExitStatus";constructor(a){this.message=`Program terminated with exit(${a})`;this.status=a}}var Oa=a=>{for(;0<a.length;)a.shift()(l)},Pa=[],Qa=[],Ra=()=>{var a=l.preRun.shift();Qa.push(a)},L=0,Sa=null;
|
|
101
|
+
function t(a,b="i8"){b.endsWith("*")&&(b="*");switch(b){case "i1":return m[a];case "i8":return m[a];case "i16":return Da[a>>1];case "i32":return F[a>>2];case "i64":return K[a>>3];case "float":return Ea[a>>2];case "double":return Fa[a>>3];case "*":return G[a>>2];default:Ia(`invalid type for getValue: ${b}`)}}var Ta=!0;
|
|
102
|
+
function z(a){var b="i32";b.endsWith("*")&&(b="*");switch(b){case "i1":m[a]=0;break;case "i8":m[a]=0;break;case "i16":Da[a>>1]=0;break;case "i32":F[a>>2]=0;break;case "i64":K[a>>3]=BigInt(0);break;case "float":Ea[a>>2]=0;break;case "double":Fa[a>>3]=0;break;case "*":G[a>>2]=0;break;default:Ia(`invalid type for setValue: ${b}`)}}
|
|
103
|
+
var Ua=new TextDecoder,Va=(a,b,c,d)=>{c=b+c;if(d)return c;for(;a[b]&&!(b>=c);)++b;return b},A=(a,b,c)=>a?Ua.decode(C.subarray(a,Va(C,a,b,c))):"",Wa=(a,b)=>{for(var c=0,d=a.length-1;0<=d;d--){var e=a[d];"."===e?a.splice(d,1):".."===e?(a.splice(d,1),c++):c&&(a.splice(d,1),c--)}if(b)for(;c;c--)a.unshift("..");return a},ha=a=>{var b="/"===a.charAt(0),c="/"===a.slice(-1);(a=Wa(a.split("/").filter(d=>!!d),!b).join("/"))||b||(a=".");a&&c&&(a+="/");return(b?"/":"")+a},Xa=a=>{var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);
|
|
104
|
+
a=b[0];b=b[1];if(!a&&!b)return".";b&&=b.slice(0,-1);return a+b},Ya=a=>a&&a.match(/([^\/]+|\/)\/*$/)[1],Za=()=>a=>crypto.getRandomValues(a),$a=a=>{($a=Za())(a)},ab=(...a)=>{for(var b="",c=!1,d=a.length-1;-1<=d&&!c;d--){c=0<=d?a[d]:"/";if("string"!=typeof c)throw new TypeError("Arguments to path.resolve must be strings");if(!c)return"";b=c+"/"+b;c="/"===c.charAt(0)}b=Wa(b.split("/").filter(e=>!!e),!c).join("/");return(c?"/":"")+b||"."},bb=a=>{var b=Va(a,0);return Ua.decode(a.buffer?a.subarray(0,b):
|
|
105
|
+
new Uint8Array(a.slice(0,b)))},cb=[],db=a=>{for(var b=0,c=0;c<a.length;++c){var d=a.charCodeAt(c);127>=d?b++:2047>=d?b+=2:55296<=d&&57343>=d?(b+=4,++c):b+=3}return b},N=(a,b,c,d)=>{if(!(0<d))return 0;var e=c;d=c+d-1;for(var g=0;g<a.length;++g){var k=a.codePointAt(g);if(127>=k){if(c>=d)break;b[c++]=k}else if(2047>=k){if(c+1>=d)break;b[c++]=192|k>>6;b[c++]=128|k&63}else if(65535>=k){if(c+2>=d)break;b[c++]=224|k>>12;b[c++]=128|k>>6&63;b[c++]=128|k&63}else{if(c+3>=d)break;b[c++]=240|k>>18;b[c++]=128|
|
|
106
|
+
k>>12&63;b[c++]=128|k>>6&63;b[c++]=128|k&63;g++}}b[c]=0;return c-e},fb=[];function gb(a,b){fb[a]={input:[],output:[],mb:b};pb(a,qb)}
|
|
107
|
+
var qb={open(a){var b=fb[a.node.pb];if(!b)throw new O(43);a.Xa=b;a.seekable=!1},close(a){a.Xa.mb.nb(a.Xa)},nb(a){a.Xa.mb.nb(a.Xa)},read(a,b,c,d){if(!a.Xa||!a.Xa.mb.Tb)throw new O(60);for(var e=0,g=0;g<d;g++){try{var k=a.Xa.mb.Tb(a.Xa)}catch(q){throw new O(29);}if(void 0===k&&0===e)throw new O(6);if(null===k||void 0===k)break;e++;b[c+g]=k}e&&(a.node.bb=Date.now());return e},write(a,b,c,d){if(!a.Xa||!a.Xa.mb.Jb)throw new O(60);try{for(var e=0;e<d;e++)a.Xa.mb.Jb(a.Xa,b[c+e])}catch(g){throw new O(29);
|
|
108
|
+
}d&&(a.node.Wa=a.node.Va=Date.now());return e}},rb={Tb(){a:{if(!cb.length){var a=null;globalThis.window?.prompt&&(a=window.prompt("Input: "),null!==a&&(a+="\n"));if(!a){var b=null;break a}b=Array(db(a)+1);a=N(a,b,0,b.length);b.length=a;cb=b}b=cb.shift()}return b},Jb(a,b){null===b||10===b?(za(bb(a.output)),a.output=[]):0!=b&&a.output.push(b)},nb(a){0<a.output?.length&&(za(bb(a.output)),a.output=[])},Hc(){return{Cc:25856,Ec:5,Bc:191,Dc:35387,Ac:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,
|
|
109
|
+
0,0,0,0,0,0,0,0,0,0,0]}},Ic(){return 0},Jc(){return[24,80]}},sb={Jb(a,b){null===b||10===b?(D(bb(a.output)),a.output=[]):0!=b&&a.output.push(b)},nb(a){0<a.output?.length&&(D(bb(a.output)),a.output=[])}},P={ab:null,cb(){return P.createNode(null,"/",16895,0)},createNode(a,b,c,d){if(24576===(c&61440)||4096===(c&61440))throw new O(63);P.ab||(P.ab={dir:{node:{Ya:P.Na.Ya,Za:P.Na.Za,ob:P.Na.ob,tb:P.Na.tb,Wb:P.Na.Wb,zb:P.Na.zb,xb:P.Na.xb,Kb:P.Na.Kb,yb:P.Na.yb},stream:{$a:P.Oa.$a}},file:{node:{Ya:P.Na.Ya,Za:P.Na.Za},
|
|
110
|
+
stream:{$a:P.Oa.$a,read:P.Oa.read,write:P.Oa.write,ub:P.Oa.ub,vb:P.Oa.vb}},link:{node:{Ya:P.Na.Ya,Za:P.Na.Za,gb:P.Na.gb},stream:{}},Pb:{node:{Ya:P.Na.Ya,Za:P.Na.Za},stream:tb}});c=ub(a,b,c,d);R(c.mode)?(c.Na=P.ab.dir.node,c.Oa=P.ab.dir.stream,c.Pa={}):32768===(c.mode&61440)?(c.Na=P.ab.file.node,c.Oa=P.ab.file.stream,c.Ta=0,c.Pa=null):40960===(c.mode&61440)?(c.Na=P.ab.link.node,c.Oa=P.ab.link.stream):8192===(c.mode&61440)&&(c.Na=P.ab.Pb.node,c.Oa=P.ab.Pb.stream);c.bb=c.Wa=c.Va=Date.now();a&&(a.Pa[b]=
|
|
111
|
+
c,a.bb=a.Wa=a.Va=c.bb);return c},Gc(a){return a.Pa?a.Pa.subarray?a.Pa.subarray(0,a.Ta):new Uint8Array(a.Pa):new Uint8Array(0)},Na:{Ya(a){var b={};b.fc=8192===(a.mode&61440)?a.id:1;b.sc=a.id;b.mode=a.mode;b.vc=1;b.uid=0;b.rc=0;b.pb=a.pb;R(a.mode)?b.size=4096:32768===(a.mode&61440)?b.size=a.Ta:40960===(a.mode&61440)?b.size=a.link.length:b.size=0;b.bb=new Date(a.bb);b.Wa=new Date(a.Wa);b.Va=new Date(a.Va);b.bc=4096;b.cc=Math.ceil(b.size/b.bc);return b},Za(a,b){for(var c of["mode","atime","mtime","ctime"])null!=
|
|
112
|
+
b[c]&&(a[c]=b[c]);void 0!==b.size&&(b=b.size,a.Ta!=b&&(0==b?(a.Pa=null,a.Ta=0):(c=a.Pa,a.Pa=new Uint8Array(b),c&&a.Pa.set(c.subarray(0,Math.min(b,a.Ta))),a.Ta=b)))},ob(){P.Bb||(P.Bb=new O(44),P.Bb.stack="<generic error, no stack>");throw P.Bb;},tb(a,b,c,d){return P.createNode(a,b,c,d)},Wb(a,b,c){try{var d=vb(b,c)}catch(g){}if(d){if(R(a.mode))for(var e in d.Pa)throw new O(55);wb(d)}delete a.parent.Pa[a.name];b.Pa[c]=a;a.name=c;b.Va=b.Wa=a.parent.Va=a.parent.Wa=Date.now()},zb(a,b){delete a.Pa[b];a.Va=
|
|
113
|
+
a.Wa=Date.now()},xb(a,b){var c=vb(a,b),d;for(d in c.Pa)throw new O(55);delete a.Pa[b];a.Va=a.Wa=Date.now()},Kb(a){return[".","..",...Object.keys(a.Pa)]},yb(a,b,c){a=P.createNode(a,b,41471,0);a.link=c;return a},gb(a){if(40960!==(a.mode&61440))throw new O(28);return a.link}},Oa:{read(a,b,c,d,e){var g=a.node.Pa;if(e>=a.node.Ta)return 0;a=Math.min(a.node.Ta-e,d);if(8<a&&g.subarray)b.set(g.subarray(e,e+a),c);else for(d=0;d<a;d++)b[c+d]=g[e+d];return a},write(a,b,c,d,e,g){b.buffer===m.buffer&&(g=!1);if(!d)return 0;
|
|
114
|
+
a=a.node;a.Wa=a.Va=Date.now();if(b.subarray&&(!a.Pa||a.Pa.subarray)){if(g)return a.Pa=b.subarray(c,c+d),a.Ta=d;if(0===a.Ta&&0===e)return a.Pa=b.slice(c,c+d),a.Ta=d;if(e+d<=a.Ta)return a.Pa.set(b.subarray(c,c+d),e),d}g=e+d;var k=a.Pa?a.Pa.length:0;k>=g||(g=Math.max(g,k*(1048576>k?2:1.125)>>>0),0!=k&&(g=Math.max(g,256)),k=a.Pa,a.Pa=new Uint8Array(g),0<a.Ta&&a.Pa.set(k.subarray(0,a.Ta),0));if(a.Pa.subarray&&b.subarray)a.Pa.set(b.subarray(c,c+d),e);else for(g=0;g<d;g++)a.Pa[e+g]=b[c+g];a.Ta=Math.max(a.Ta,
|
|
115
|
+
e+d);return d},$a(a,b,c){1===c?b+=a.position:2===c&&32768===(a.node.mode&61440)&&(b+=a.node.Ta);if(0>b)throw new O(28);return b},ub(a,b,c,d,e){if(32768!==(a.node.mode&61440))throw new O(43);a=a.node.Pa;if(e&2||!a||a.buffer!==m.buffer){e=!0;d=65536*Math.ceil(b/65536);var g=xb(65536,d);g&&C.fill(0,g,g+d);d=g;if(!d)throw new O(48);if(a){if(0<c||c+b<a.length)a.subarray?a=a.subarray(c,c+b):a=Array.prototype.slice.call(a,c,c+b);m.set(a,d)}}else e=!1,d=a.byteOffset;return{xc:d,Xb:e}},vb(a,b,c,d){P.Oa.write(a,
|
|
116
|
+
b,0,d,c,!1);return 0}}},ia=(a,b)=>{var c=0;a&&(c|=365);b&&(c|=146);return c},yb=null,zb={},Ab=[],Bb=1,T=null,Cb=!1,Db=!0,Eb={},O=class{name="ErrnoError";constructor(a){this.Ra=a}},Fb=class{sb={};node=null;get flags(){return this.sb.flags}set flags(a){this.sb.flags=a}get position(){return this.sb.position}set position(a){this.sb.position=a}},Gb=class{Na={};Oa={};kb=null;constructor(a,b,c,d){a||=this;this.parent=a;this.cb=a.cb;this.id=Bb++;this.name=b;this.mode=c;this.pb=d;this.bb=this.Wa=this.Va=Date.now()}get read(){return 365===
|
|
117
|
+
(this.mode&365)}set read(a){a?this.mode|=365:this.mode&=-366}get write(){return 146===(this.mode&146)}set write(a){a?this.mode|=146:this.mode&=-147}};
|
|
118
|
+
function U(a,b={}){if(!a)throw new O(44);b.Db??(b.Db=!0);"/"===a.charAt(0)||(a="//"+a);var c=0;a:for(;40>c;c++){a=a.split("/").filter(q=>!!q);for(var d=yb,e="/",g=0;g<a.length;g++){var k=g===a.length-1;if(k&&b.parent)break;if("."!==a[g])if(".."===a[g])if(e=Xa(e),d===d.parent){a=e+"/"+a.slice(g+1).join("/");c--;continue a}else d=d.parent;else{e=ha(e+"/"+a[g]);try{d=vb(d,a[g])}catch(q){if(44===q?.Ra&&k&&b.wc)return{path:e};throw q;}!d.kb||k&&!b.Db||(d=d.kb.root);if(40960===(d.mode&61440)&&(!k||b.jb)){if(!d.Na.gb)throw new O(52);
|
|
119
|
+
d=d.Na.gb(d);"/"===d.charAt(0)||(d=Xa(e)+"/"+d);a=d+"/"+a.slice(g+1).join("/");continue a}}}return{path:e,node:d}}throw new O(32);}function fa(a){for(var b;;){if(a===a.parent)return a=a.cb.Vb,b?"/"!==a[a.length-1]?`${a}/${b}`:a+b:a;b=b?`${a.name}/${b}`:a.name;a=a.parent}}function Hb(a,b){for(var c=0,d=0;d<b.length;d++)c=(c<<5)-c+b.charCodeAt(d)|0;return(a+c>>>0)%T.length}function wb(a){var b=Hb(a.parent.id,a.name);if(T[b]===a)T[b]=a.lb;else for(b=T[b];b;){if(b.lb===a){b.lb=a.lb;break}b=b.lb}}
|
|
120
|
+
function vb(a,b){var c=R(a.mode)?(c=Ib(a,"x"))?c:a.Na.ob?0:2:54;if(c)throw new O(c);for(c=T[Hb(a.id,b)];c;c=c.lb){var d=c.name;if(c.parent.id===a.id&&d===b)return c}return a.Na.ob(a,b)}function ub(a,b,c,d){a=new Gb(a,b,c,d);b=Hb(a.parent.id,a.name);a.lb=T[b];return T[b]=a}function R(a){return 16384===(a&61440)}function Jb(a){var b=["r","w","rw"][a&3];a&512&&(b+="w");return b}
|
|
121
|
+
function Ib(a,b){if(Db)return 0;if(!b.includes("r")||a.mode&292){if(b.includes("w")&&!(a.mode&146)||b.includes("x")&&!(a.mode&73))return 2}else return 2;return 0}function Kb(a,b){if(!R(a.mode))return 54;try{return vb(a,b),20}catch(c){}return Ib(a,"wx")}function Lb(a,b,c){try{var d=vb(a,b)}catch(e){return e.Ra}if(a=Ib(a,"wx"))return a;if(c){if(!R(d.mode))return 54;if(d===d.parent||"/"===fa(d))return 10}else if(R(d.mode))return 31;return 0}function Mb(a){if(!a)throw new O(63);return a}
|
|
122
|
+
function V(a){a=Ab[a];if(!a)throw new O(8);return a}function Nb(a,b=-1){a=Object.assign(new Fb,a);if(-1==b)a:{for(b=0;4096>=b;b++)if(!Ab[b])break a;throw new O(33);}a.eb=b;return Ab[b]=a}function Ob(a,b=-1){a=Nb(a,b);a.Oa?.Fc?.(a);return a}function Pb(a,b,c){var d=a?.Oa.Za;a=d?a:b;d??=b.Na.Za;Mb(d);d(a,c)}var tb={open(a){a.Oa=zb[a.node.pb].Oa;a.Oa.open?.(a)},$a(){throw new O(70);}};function pb(a,b){zb[a]={Oa:b}}
|
|
123
|
+
function Qb(a,b){var c="/"===b;if(c&&yb)throw new O(10);if(!c&&b){var d=U(b,{Db:!1});b=d.path;d=d.node;if(d.kb)throw new O(10);if(!R(d.mode))throw new O(54);}b={type:a,Kc:{},Vb:b,uc:[]};a=a.cb(b);a.cb=b;b.root=a;c?yb=a:d&&(d.kb=b,d.cb&&d.cb.uc.push(b))}function Rb(a,b,c){var d=U(a,{parent:!0}).node;a=Ya(a);if(!a)throw new O(28);if("."===a||".."===a)throw new O(20);var e=Kb(d,a);if(e)throw new O(e);if(!d.Na.tb)throw new O(63);return d.Na.tb(d,a,b,c)}
|
|
124
|
+
function ja(a,b=438){return Rb(a,b&4095|32768,0)}function W(a,b=511){return Rb(a,b&1023|16384,0)}function Sb(a,b,c){"undefined"==typeof c&&(c=b,b=438);Rb(a,b|8192,c)}function Tb(a,b){if(!ab(a))throw new O(44);var c=U(b,{parent:!0}).node;if(!c)throw new O(44);b=Ya(b);var d=Kb(c,b);if(d)throw new O(d);if(!c.Na.yb)throw new O(63);c.Na.yb(c,b,a)}
|
|
125
|
+
function Ub(a){var b=U(a,{parent:!0}).node;a=Ya(a);var c=vb(b,a),d=Lb(b,a,!0);if(d)throw new O(d);if(!b.Na.xb)throw new O(63);if(c.kb)throw new O(10);b.Na.xb(b,a);wb(c)}function ra(a){var b=U(a,{parent:!0}).node;if(!b)throw new O(44);a=Ya(a);var c=vb(b,a),d=Lb(b,a,!1);if(d)throw new O(d);if(!b.Na.zb)throw new O(63);if(c.kb)throw new O(10);b.Na.zb(b,a);wb(c)}function Vb(a,b){a=U(a,{jb:!b}).node;return Mb(a.Na.Ya)(a)}function Wb(a,b,c,d){Pb(a,b,{mode:c&4095|b.mode&-4096,Va:Date.now(),hc:d})}
|
|
126
|
+
function ka(a,b){a="string"==typeof a?U(a,{jb:!0}).node:a;Wb(null,a,b)}function Xb(a,b,c){if(R(b.mode))throw new O(31);if(32768!==(b.mode&61440))throw new O(28);var d=Ib(b,"w");if(d)throw new O(d);Pb(a,b,{size:c,timestamp:Date.now()})}
|
|
127
|
+
function la(a,b,c=438){if(""===a)throw new O(44);if("string"==typeof b){var d={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[b];if("undefined"==typeof d)throw Error(`Unknown file open mode: ${b}`);b=d}c=b&64?c&4095|32768:0;if("object"==typeof a)d=a;else{var e=a.endsWith("/");a=U(a,{jb:!(b&131072),wc:!0});d=a.node;a=a.path}var g=!1;if(b&64)if(d){if(b&128)throw new O(20);}else{if(e)throw new O(31);d=Rb(a,c|511,0);g=!0}if(!d)throw new O(44);8192===(d.mode&61440)&&(b&=-513);if(b&65536&&!R(d.mode))throw new O(54);
|
|
128
|
+
if(!g&&(e=d?40960===(d.mode&61440)?32:R(d.mode)&&("r"!==Jb(b)||b&576)?31:Ib(d,Jb(b)):44))throw new O(e);b&512&&!g&&(e=d,e="string"==typeof e?U(e,{jb:!0}).node:e,Xb(null,e,0));b&=-131713;e=Nb({node:d,path:fa(d),flags:b,seekable:!0,position:0,Oa:d.Oa,yc:[],error:!1});e.Oa.open&&e.Oa.open(e);g&&ka(d,c&511);!l.logReadFiles||b&1||a in Eb||(Eb[a]=1);return e}function na(a){if(null===a.eb)throw new O(8);a.Gb&&(a.Gb=null);try{a.Oa.close&&a.Oa.close(a)}catch(b){throw b;}finally{Ab[a.eb]=null}a.eb=null}
|
|
129
|
+
function Yb(a,b,c){if(null===a.eb)throw new O(8);if(!a.seekable||!a.Oa.$a)throw new O(70);if(0!=c&&1!=c&&2!=c)throw new O(28);a.position=a.Oa.$a(a,b,c);a.yc=[]}function Zb(a,b,c,d,e){if(0>d||0>e)throw new O(28);if(null===a.eb)throw new O(8);if(1===(a.flags&2097155))throw new O(8);if(R(a.node.mode))throw new O(31);if(!a.Oa.read)throw new O(28);var g="undefined"!=typeof e;if(!g)e=a.position;else if(!a.seekable)throw new O(70);b=a.Oa.read(a,b,c,d,e);g||(a.position+=b);return b}
|
|
130
|
+
function ma(a,b,c,d,e){if(0>d||0>e)throw new O(28);if(null===a.eb)throw new O(8);if(0===(a.flags&2097155))throw new O(8);if(R(a.node.mode))throw new O(31);if(!a.Oa.write)throw new O(28);a.seekable&&a.flags&1024&&Yb(a,0,2);var g="undefined"!=typeof e;if(!g)e=a.position;else if(!a.seekable)throw new O(70);b=a.Oa.write(a,b,c,d,e,void 0);g||(a.position+=b);return b}
|
|
131
|
+
function qa(a){var b=b||0;var c="binary";"utf8"!==c&&"binary"!==c&&Ia(`Invalid encoding type "${c}"`);b=la(a,b);a=Vb(a).size;var d=new Uint8Array(a);Zb(b,d,0,a,0);"utf8"===c&&(d=bb(d));na(b);return d}
|
|
132
|
+
function X(a,b,c){a=ha("/dev/"+a);var d=ia(!!b,!!c);X.Ub??(X.Ub=64);var e=X.Ub++<<8|0;pb(e,{open(g){g.seekable=!1},close(){c?.buffer?.length&&c(10)},read(g,k,q,w){for(var u=0,x=0;x<w;x++){try{var E=b()}catch(ib){throw new O(29);}if(void 0===E&&0===u)throw new O(6);if(null===E||void 0===E)break;u++;k[q+x]=E}u&&(g.node.bb=Date.now());return u},write(g,k,q,w){for(var u=0;u<w;u++)try{c(k[q+u])}catch(x){throw new O(29);}w&&(g.node.Wa=g.node.Va=Date.now());return u}});Sb(a,d,e)}var Y={};
|
|
133
|
+
function $b(a,b,c){if("/"===b.charAt(0))return b;a=-100===a?"/":V(a).path;if(0==b.length){if(!c)throw new O(44);return a}return a+"/"+b}
|
|
134
|
+
function ac(a,b){G[a>>2]=b.fc;G[a+4>>2]=b.mode;G[a+8>>2]=b.vc;G[a+12>>2]=b.uid;G[a+16>>2]=b.rc;G[a+20>>2]=b.pb;K[a+24>>3]=BigInt(b.size);F[a+32>>2]=4096;F[a+36>>2]=b.cc;var c=b.bb.getTime(),d=b.Wa.getTime(),e=b.Va.getTime();K[a+40>>3]=BigInt(Math.floor(c/1E3));G[a+48>>2]=c%1E3*1E6;K[a+56>>3]=BigInt(Math.floor(d/1E3));G[a+64>>2]=d%1E3*1E6;K[a+72>>3]=BigInt(Math.floor(e/1E3));G[a+80>>2]=e%1E3*1E6;K[a+88>>3]=BigInt(b.sc);return 0}
|
|
135
|
+
var kc=void 0,Fc=()=>{var a=F[+kc>>2];kc+=4;return a},Hc=0,Ic=[0,31,60,91,121,152,182,213,244,274,305,335],Jc=[0,31,59,90,120,151,181,212,243,273,304,334],Kc={},Lc=a=>{if(!(a instanceof Na||"unwind"==a))throw a;},Mc=a=>{Ca=a;Ta||0<Hc||(l.onExit?.(a),Ba=!0);throw new Na(a);},Nc=a=>{if(!Ba)try{a()}catch(b){Lc(b)}finally{if(!(Ta||0<Hc))try{Ca=a=Ca,Mc(a)}catch(b){Lc(b)}}},Oc={},Qc=()=>{if(!Pc){var a={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??
|
|
136
|
+
"C").replace("-","_")+".UTF-8",_:ta||"./this.program"},b;for(b in Oc)void 0===Oc[b]?delete a[b]:a[b]=Oc[b];var c=[];for(b in a)c.push(`${b}=${a[b]}`);Pc=c}return Pc},Pc,Rc=(a,b,c,d)=>{var e={string:u=>{var x=0;if(null!==u&&void 0!==u&&0!==u){x=db(u)+1;var E=y(x);N(u,C,E,x);x=E}return x},array:u=>{var x=y(u.length);m.set(u,x);return x}};a=l["_"+a];var g=[],k=0;if(d)for(var q=0;q<d.length;q++){var w=e[c[q]];w?(0===k&&(k=oa()),g[q]=w(d[q])):g[q]=d[q]}c=a(...g);return c=function(u){0!==k&&pa(k);return"string"===
|
|
137
|
+
b?A(u):"boolean"===b?!!u:u}(c)},ea=a=>{var b=db(a)+1,c=ca(b);c&&N(a,C,c,b);return c},Sc,Tc=[],B=a=>{Sc.delete(Z.get(a));Z.set(a,null);Tc.push(a)},Uc=a=>{const b=a.length;return[b%128|128,b>>7,...a]},Vc={i:127,p:127,j:126,f:125,d:124,e:111},Wc=a=>Uc(Array.from(a,b=>Vc[b])),sa=(a,b)=>{if(!Sc){Sc=new WeakMap;var c=Z.length;if(Sc)for(var d=0;d<0+c;d++){var e=Z.get(d);e&&Sc.set(e,d)}}if(c=Sc.get(a)||0)return c;c=Tc.length?Tc.pop():Z.grow(1);try{Z.set(c,a)}catch(g){if(!(g instanceof TypeError))throw g;
|
|
138
|
+
b=Uint8Array.of(0,97,115,109,1,0,0,0,1,...Uc([1,96,...Wc(b.slice(1)),...Wc("v"===b[0]?"":b[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);b=new WebAssembly.Module(b);b=(new WebAssembly.Instance(b,{e:{f:a}})).exports.f;Z.set(c,b)}Sc.set(a,c);return c};T=Array(4096);Qb(P,"/");W("/tmp");W("/home");W("/home/web_user");
|
|
139
|
+
(function(){W("/dev");pb(259,{read:()=>0,write:(d,e,g,k)=>k,$a:()=>0});Sb("/dev/null",259);gb(1280,rb);gb(1536,sb);Sb("/dev/tty",1280);Sb("/dev/tty1",1536);var a=new Uint8Array(1024),b=0,c=()=>{0===b&&($a(a),b=a.byteLength);return a[--b]};X("random",c);X("urandom",c);W("/dev/shm");W("/dev/shm/tmp")})();
|
|
140
|
+
(function(){W("/proc");var a=W("/proc/self");W("/proc/self/fd");Qb({cb(){var b=ub(a,"fd",16895,73);b.Oa={$a:P.Oa.$a};b.Na={ob(c,d){c=+d;var e=V(c);c={parent:null,cb:{Vb:"fake"},Na:{gb:()=>e.path},id:c+1};return c.parent=c},Kb(){return Array.from(Ab.entries()).filter(([,c])=>c).map(([c])=>c.toString())}};return b}},"/proc/self/fd")})();l.noExitRuntime&&(Ta=l.noExitRuntime);l.print&&(za=l.print);l.printErr&&(D=l.printErr);l.wasmBinary&&(Aa=l.wasmBinary);l.thisProgram&&(ta=l.thisProgram);
|
|
141
|
+
if(l.preInit)for("function"==typeof l.preInit&&(l.preInit=[l.preInit]);0<l.preInit.length;)l.preInit.shift()();l.stackSave=()=>oa();l.stackRestore=a=>pa(a);l.stackAlloc=a=>y(a);l.cwrap=(a,b,c,d)=>{var e=!c||c.every(g=>"number"===g||"boolean"===g);return"string"!==b&&e&&!d?l["_"+a]:(...g)=>Rc(a,b,c,g)};l.addFunction=sa;l.removeFunction=B;l.UTF8ToString=A;l.stringToNewUTF8=ea;l.writeArrayToMemory=(a,b)=>{m.set(a,b)};
|
|
142
|
+
var ca,da,xb,Xc,pa,y,oa,Ha,Z,Yc={a:(a,b,c,d)=>Ia(`Assertion failed: ${A(a)}, at: `+[b?A(b):"unknown filename",c,d?A(d):"unknown function"]),i:function(a,b){try{return a=A(a),ka(a,b),0}catch(c){if("undefined"==typeof Y||"ErrnoError"!==c.name)throw c;return-c.Ra}},L:function(a,b,c){try{b=A(b);b=$b(a,b);if(c&-8)return-28;var d=U(b,{jb:!0}).node;if(!d)return-44;a="";c&4&&(a+="r");c&2&&(a+="w");c&1&&(a+="x");return a&&Ib(d,a)?-2:0}catch(e){if("undefined"==typeof Y||"ErrnoError"!==e.name)throw e;return-e.Ra}},
|
|
143
|
+
j:function(a,b){try{var c=V(a);Wb(c,c.node,b,!1);return 0}catch(d){if("undefined"==typeof Y||"ErrnoError"!==d.name)throw d;return-d.Ra}},h:function(a){try{var b=V(a);Pb(b,b.node,{timestamp:Date.now(),hc:!1});return 0}catch(c){if("undefined"==typeof Y||"ErrnoError"!==c.name)throw c;return-c.Ra}},b:function(a,b,c){kc=c;try{var d=V(a);switch(b){case 0:var e=Fc();if(0>e)break;for(;Ab[e];)e++;return Ob(d,e).eb;case 1:case 2:return 0;case 3:return d.flags;case 4:return e=Fc(),d.flags|=e,0;case 12:return e=
|
|
144
|
+
Fc(),Da[e+0>>1]=2,0;case 13:case 14:return 0}return-28}catch(g){if("undefined"==typeof Y||"ErrnoError"!==g.name)throw g;return-g.Ra}},g:function(a,b){try{var c=V(a),d=c.node,e=c.Oa.Ya;a=e?c:d;e??=d.Na.Ya;Mb(e);var g=e(a);return ac(b,g)}catch(k){if("undefined"==typeof Y||"ErrnoError"!==k.name)throw k;return-k.Ra}},H:function(a,b){b=-9007199254740992>b||9007199254740992<b?NaN:Number(b);try{if(isNaN(b))return-61;var c=V(a);if(0>b||0===(c.flags&2097155))throw new O(28);Xb(c,c.node,b);return 0}catch(d){if("undefined"==
|
|
145
|
+
typeof Y||"ErrnoError"!==d.name)throw d;return-d.Ra}},G:function(a,b){try{if(0===b)return-28;var c=db("/")+1;if(b<c)return-68;N("/",C,a,b);return c}catch(d){if("undefined"==typeof Y||"ErrnoError"!==d.name)throw d;return-d.Ra}},K:function(a,b){try{return a=A(a),ac(b,Vb(a,!0))}catch(c){if("undefined"==typeof Y||"ErrnoError"!==c.name)throw c;return-c.Ra}},C:function(a,b,c){try{return b=A(b),b=$b(a,b),W(b,c),0}catch(d){if("undefined"==typeof Y||"ErrnoError"!==d.name)throw d;return-d.Ra}},J:function(a,
|
|
146
|
+
b,c,d){try{b=A(b);var e=d&256;b=$b(a,b,d&4096);return ac(c,e?Vb(b,!0):Vb(b))}catch(g){if("undefined"==typeof Y||"ErrnoError"!==g.name)throw g;return-g.Ra}},x:function(a,b,c,d){kc=d;try{b=A(b);b=$b(a,b);var e=d?Fc():0;return la(b,c,e).eb}catch(g){if("undefined"==typeof Y||"ErrnoError"!==g.name)throw g;return-g.Ra}},v:function(a,b,c,d){try{b=A(b);b=$b(a,b);if(0>=d)return-28;var e=U(b).node;if(!e)throw new O(44);if(!e.Na.gb)throw new O(28);var g=e.Na.gb(e);var k=Math.min(d,db(g)),q=m[c+k];N(g,C,c,d+
|
|
147
|
+
1);m[c+k]=q;return k}catch(w){if("undefined"==typeof Y||"ErrnoError"!==w.name)throw w;return-w.Ra}},u:function(a){try{return a=A(a),Ub(a),0}catch(b){if("undefined"==typeof Y||"ErrnoError"!==b.name)throw b;return-b.Ra}},f:function(a,b){try{return a=A(a),ac(b,Vb(a))}catch(c){if("undefined"==typeof Y||"ErrnoError"!==c.name)throw c;return-c.Ra}},r:function(a,b,c){try{b=A(b);b=$b(a,b);if(c)if(512===c)Ub(b);else return-28;else ra(b);return 0}catch(d){if("undefined"==typeof Y||"ErrnoError"!==d.name)throw d;
|
|
148
|
+
return-d.Ra}},q:function(a,b,c){try{b=A(b);b=$b(a,b,!0);var d=Date.now(),e,g;if(c){var k=G[c>>2]+4294967296*F[c+4>>2],q=F[c+8>>2];1073741823==q?e=d:1073741822==q?e=null:e=1E3*k+q/1E6;c+=16;k=G[c>>2]+4294967296*F[c+4>>2];q=F[c+8>>2];1073741823==q?g=d:1073741822==q?g=null:g=1E3*k+q/1E6}else g=e=d;if(null!==(g??e)){a=e;var w=U(b,{jb:!0}).node;Mb(w.Na.Za)(w,{bb:a,Wa:g})}return 0}catch(u){if("undefined"==typeof Y||"ErrnoError"!==u.name)throw u;return-u.Ra}},m:()=>Ia(""),l:()=>{Ta=!1;Hc=0},A:function(a,
|
|
149
|
+
b){a=-9007199254740992>a||9007199254740992<a?NaN:Number(a);a=new Date(1E3*a);F[b>>2]=a.getSeconds();F[b+4>>2]=a.getMinutes();F[b+8>>2]=a.getHours();F[b+12>>2]=a.getDate();F[b+16>>2]=a.getMonth();F[b+20>>2]=a.getFullYear()-1900;F[b+24>>2]=a.getDay();var c=a.getFullYear();F[b+28>>2]=(0!==c%4||0===c%100&&0!==c%400?Jc:Ic)[a.getMonth()]+a.getDate()-1|0;F[b+36>>2]=-(60*a.getTimezoneOffset());c=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var d=(new Date(a.getFullYear(),0,1)).getTimezoneOffset();
|
|
150
|
+
F[b+32>>2]=(c!=d&&a.getTimezoneOffset()==Math.min(d,c))|0},y:function(a,b,c,d,e,g,k){e=-9007199254740992>e||9007199254740992<e?NaN:Number(e);try{var q=V(d);if(0!==(b&2)&&0===(c&2)&&2!==(q.flags&2097155))throw new O(2);if(1===(q.flags&2097155))throw new O(2);if(!q.Oa.ub)throw new O(43);if(!a)throw new O(28);var w=q.Oa.ub(q,a,e,b,c);var u=w.xc;F[g>>2]=w.Xb;G[k>>2]=u;return 0}catch(x){if("undefined"==typeof Y||"ErrnoError"!==x.name)throw x;return-x.Ra}},z:function(a,b,c,d,e,g){g=-9007199254740992>g||
|
|
151
|
+
9007199254740992<g?NaN:Number(g);try{var k=V(e);if(c&2){if(32768!==(k.node.mode&61440))throw new O(43);d&2||k.Oa.vb&&k.Oa.vb(k,C.slice(a,a+b),g,b,d)}}catch(q){if("undefined"==typeof Y||"ErrnoError"!==q.name)throw q;return-q.Ra}},n:(a,b)=>{Kc[a]&&(clearTimeout(Kc[a].id),delete Kc[a]);if(!b)return 0;var c=setTimeout(()=>{delete Kc[a];Nc(()=>Xc(a,performance.now()))},b);Kc[a]={id:c,Lc:b};return 0},B:(a,b,c,d)=>{var e=(new Date).getFullYear(),g=(new Date(e,0,1)).getTimezoneOffset();e=(new Date(e,6,1)).getTimezoneOffset();
|
|
152
|
+
G[a>>2]=60*Math.max(g,e);F[b>>2]=Number(g!=e);b=k=>{var q=Math.abs(k);return`UTC${0<=k?"-":"+"}${String(Math.floor(q/60)).padStart(2,"0")}${String(q%60).padStart(2,"0")}`};a=b(g);b=b(e);e<g?(N(a,C,c,17),N(b,C,d,17)):(N(a,C,d,17),N(b,C,c,17))},d:()=>Date.now(),s:()=>2147483648,c:()=>performance.now(),o:a=>{var b=C.length;a>>>=0;if(2147483648<a)return!1;for(var c=1;4>=c;c*=2){var d=b*(1+.2/c);d=Math.min(d,a+100663296);a:{d=(Math.min(2147483648,65536*Math.ceil(Math.max(a,d)/65536))-Ha.buffer.byteLength+
|
|
153
|
+
65535)/65536|0;try{Ha.grow(d);Ga();var e=1;break a}catch(g){}e=void 0}if(e)return!0}return!1},E:(a,b)=>{var c=0,d=0,e;for(e of Qc()){var g=b+c;G[a+d>>2]=g;c+=N(e,C,g,Infinity)+1;d+=4}return 0},F:(a,b)=>{var c=Qc();G[a>>2]=c.length;a=0;for(var d of c)a+=db(d)+1;G[b>>2]=a;return 0},e:function(a){try{var b=V(a);na(b);return 0}catch(c){if("undefined"==typeof Y||"ErrnoError"!==c.name)throw c;return c.Ra}},p:function(a,b){try{var c=V(a);m[b]=c.Xa?2:R(c.mode)?3:40960===(c.mode&61440)?7:4;Da[b+2>>1]=0;K[b+
|
|
154
|
+
8>>3]=BigInt(0);K[b+16>>3]=BigInt(0);return 0}catch(d){if("undefined"==typeof Y||"ErrnoError"!==d.name)throw d;return d.Ra}},w:function(a,b,c,d){try{a:{var e=V(a);a=b;for(var g,k=b=0;k<c;k++){var q=G[a>>2],w=G[a+4>>2];a+=8;var u=Zb(e,m,q,w,g);if(0>u){var x=-1;break a}b+=u;if(u<w)break;"undefined"!=typeof g&&(g+=u)}x=b}G[d>>2]=x;return 0}catch(E){if("undefined"==typeof Y||"ErrnoError"!==E.name)throw E;return E.Ra}},D:function(a,b,c,d){b=-9007199254740992>b||9007199254740992<b?NaN:Number(b);try{if(isNaN(b))return 61;
|
|
155
|
+
var e=V(a);Yb(e,b,c);K[d>>3]=BigInt(e.position);e.Gb&&0===b&&0===c&&(e.Gb=null);return 0}catch(g){if("undefined"==typeof Y||"ErrnoError"!==g.name)throw g;return g.Ra}},I:function(a){try{var b=V(a);return b.Oa?.nb?.(b)}catch(c){if("undefined"==typeof Y||"ErrnoError"!==c.name)throw c;return c.Ra}},t:function(a,b,c,d){try{a:{var e=V(a);a=b;for(var g,k=b=0;k<c;k++){var q=G[a>>2],w=G[a+4>>2];a+=8;var u=ma(e,m,q,w,g);if(0>u){var x=-1;break a}b+=u;if(u<w)break;"undefined"!=typeof g&&(g+=u)}x=b}G[d>>2]=x;
|
|
156
|
+
return 0}catch(E){if("undefined"==typeof Y||"ErrnoError"!==E.name)throw E;return E.Ra}},k:Mc};
|
|
157
|
+
function Zc(){function a(){l.calledRun=!0;if(!Ba){if(!l.noFSInit&&!Cb){var b,c;Cb=!0;b??=l.stdin;c??=l.stdout;d??=l.stderr;b?X("stdin",b):Tb("/dev/tty","/dev/stdin");c?X("stdout",null,c):Tb("/dev/tty","/dev/stdout");d?X("stderr",null,d):Tb("/dev/tty1","/dev/stderr");la("/dev/stdin",0);la("/dev/stdout",1);la("/dev/stderr",1)}$c.N();Db=!1;l.onRuntimeInitialized?.();if(l.postRun)for("function"==typeof l.postRun&&(l.postRun=[l.postRun]);l.postRun.length;){var d=l.postRun.shift();Pa.push(d)}Oa(Pa)}}if(0<
|
|
158
|
+
L)Sa=Zc;else{if(l.preRun)for("function"==typeof l.preRun&&(l.preRun=[l.preRun]);l.preRun.length;)Ra();Oa(Qa);0<L?Sa=Zc:l.setStatus?(l.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>l.setStatus(""),1);a()},1)):a()}}var $c;
|
|
159
|
+
(async function(){function a(c){c=$c=c.exports;l._sqlite3_free=c.P;l._sqlite3_value_text=c.Q;l._sqlite3_serialize=c.R;l._sqlite3_prepare_v2=c.S;l._sqlite3_step=c.T;l._sqlite3_reset=c.U;l._sqlite3_exec=c.V;l._sqlite3_finalize=c.W;l._sqlite3_column_name=c.X;l._sqlite3_column_text=c.Y;l._sqlite3_column_type=c.Z;l._sqlite3_errmsg=c._;l._sqlite3_clear_bindings=c.$;l._sqlite3_value_blob=c.aa;l._sqlite3_value_bytes=c.ba;l._sqlite3_value_double=c.ca;l._sqlite3_value_int=c.da;l._sqlite3_value_type=c.ea;l._sqlite3_result_blob=
|
|
160
|
+
c.fa;l._sqlite3_result_double=c.ga;l._sqlite3_result_error=c.ha;l._sqlite3_result_int=c.ia;l._sqlite3_result_int64=c.ja;l._sqlite3_result_null=c.ka;l._sqlite3_result_text=c.la;l._sqlite3_aggregate_context=c.ma;l._sqlite3_column_count=c.na;l._sqlite3_data_count=c.oa;l._sqlite3_column_blob=c.pa;l._sqlite3_column_bytes=c.qa;l._sqlite3_column_double=c.ra;l._sqlite3_bind_blob=c.sa;l._sqlite3_bind_double=c.ta;l._sqlite3_bind_int=c.ua;l._sqlite3_bind_text=c.va;l._sqlite3_bind_parameter_index=c.wa;l._sqlite3_stmt_readonly=
|
|
161
|
+
c.xa;l._sqlite3_sql=c.ya;l._sqlite3_normalized_sql=c.za;l._sqlite3_changes=c.Aa;l._sqlite3_close_v2=c.Ba;l._sqlite3_create_function_v2=c.Ca;l._sqlite3_update_hook=c.Da;l._sqlite3_open=c.Ea;ca=l._malloc=c.Fa;da=l._free=c.Ga;l._RegisterExtensionFunctions=c.Ha;xb=c.Ia;Xc=c.Ja;pa=c.Ka;y=c.La;oa=c.Ma;Ha=c.M;Z=c.O;Ga();L--;l.monitorRunDependencies?.(L);0==L&&Sa&&(c=Sa,Sa=null,c());return $c}L++;l.monitorRunDependencies?.(L);var b={a:Yc};if(l.instantiateWasm)return new Promise(c=>{l.instantiateWasm(b,(d,
|
|
162
|
+
e)=>{c(a(d,e))})});Ja??=l.locateFile?l.locateFile("sql-wasm-browser.wasm",wa):wa+"sql-wasm-browser.wasm";return a((await Ma(b)).instance)})();Zc();
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
// The shell-pre.js and emcc-generated code goes above
|
|
166
|
+
return Module;
|
|
167
|
+
}); // The end of the promise being returned
|
|
168
|
+
|
|
169
|
+
return initSqlJsPromise;
|
|
170
|
+
} // The end of our initSqlJs function
|
|
171
|
+
|
|
172
|
+
// This bit below is copied almost exactly from what you get when you use the MODULARIZE=1 flag with emcc
|
|
173
|
+
// However, we don't want to use the emcc modularization. See shell-pre.js
|
|
174
|
+
if (typeof exports === 'object' && typeof module === 'object'){
|
|
175
|
+
module.exports = initSqlJs;
|
|
176
|
+
// This will allow the module to be used in ES6 or CommonJS
|
|
177
|
+
module.exports.default = initSqlJs;
|
|
178
|
+
}
|
|
179
|
+
else if (typeof define === 'function' && define['amd']) {
|
|
180
|
+
define([], function() { return initSqlJs; });
|
|
181
|
+
}
|
|
182
|
+
else if (typeof exports === 'object'){
|
|
183
|
+
exports["Module"] = initSqlJs;
|
|
184
|
+
}
|