forked from rhashimoto/wa-sqlite
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwa-sqlite.mjs
143 lines (138 loc) · 56.1 KB
/
wa-sqlite.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
var Module = (() => {
var _scriptName = import.meta.url;
return (
function(moduleArg = {}) {
var moduleRtn;
var d=moduleArg,aa,ba,ca=new Promise((a,b)=>{aa=a;ba=b}),da="object"==typeof window,ea="function"==typeof importScripts,ha=Object.assign({},d),ia="./this.program",ja=(a,b)=>{throw b;},g="",ka,la;
if(da||ea)ea?g=self.location.href:"undefined"!=typeof document&&document.currentScript&&(g=document.currentScript.src),_scriptName&&(g=_scriptName),g.startsWith("blob:")?g="":g=g.substr(0,g.replace(/[?#].*/,"").lastIndexOf("/")+1),ea&&(la=a=>{var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)}),ka=a=>fetch(a,{credentials:"same-origin"}).then(b=>b.ok?b.arrayBuffer():Promise.reject(Error(b.status+" : "+b.url)));
var ma=d.print||console.log.bind(console),r=d.printErr||console.error.bind(console);Object.assign(d,ha);ha=null;d.thisProgram&&(ia=d.thisProgram);d.quit&&(ja=d.quit);var na;d.wasmBinary&&(na=d.wasmBinary);var oa,pa=!1,u,v,w,qa,x,z,ra,sa;
function ta(){var a=oa.buffer;d.HEAP8=u=new Int8Array(a);d.HEAP16=w=new Int16Array(a);d.HEAPU8=v=new Uint8Array(a);d.HEAPU16=qa=new Uint16Array(a);d.HEAP32=x=new Int32Array(a);d.HEAPU32=z=new Uint32Array(a);d.HEAPF32=ra=new Float32Array(a);d.HEAPF64=sa=new Float64Array(a)}var ua=[],va=[],wa=[],xa=[];function ya(){var a=d.preRun.shift();ua.unshift(a)}var B=0,za=null,Aa=null;
function C(a){d.onAbort?.(a);a="Aborted("+a+")";r(a);pa=!0;a=new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");ba(a);throw a;}var Ba=a=>a.startsWith("data:application/octet-stream;base64,"),Ca;function Da(a){if(a==Ca&&na)return new Uint8Array(na);if(la)return la(a);throw"both async and sync fetching of the wasm failed";}function Ea(a){return na?Promise.resolve().then(()=>Da(a)):ka(a).then(b=>new Uint8Array(b),()=>Da(a))}
function Fa(a,b,c){return Ea(a).then(e=>WebAssembly.instantiate(e,b)).then(c,e=>{r(`failed to asynchronously prepare wasm: ${e}`);C(e)})}function Ga(a,b){var c=Ca;return na||"function"!=typeof WebAssembly.instantiateStreaming||Ba(c)||"function"!=typeof fetch?Fa(c,a,b):fetch(c,{credentials:"same-origin"}).then(e=>WebAssembly.instantiateStreaming(e,a).then(b,function(f){r(`wasm streaming compile failed: ${f}`);r("falling back to ArrayBuffer instantiation");return Fa(c,a,b)}))}var D,F;
function Ha(a){this.name="ExitStatus";this.message=`Program terminated with exit(${a})`;this.status=a}var Ia=a=>{for(;0<a.length;)a.shift()(d)};function H(a,b="i8"){b.endsWith("*")&&(b="*");switch(b){case "i1":return u[a];case "i8":return u[a];case "i16":return w[a>>1];case "i32":return x[a>>2];case "i64":C("to do getValue(i64) use WASM_BIGINT");case "float":return ra[a>>2];case "double":return sa[a>>3];case "*":return z[a>>2];default:C(`invalid type for getValue: ${b}`)}}
var Ja=d.noExitRuntime||!0;function I(a,b,c="i8"){c.endsWith("*")&&(c="*");switch(c){case "i1":u[a]=b;break;case "i8":u[a]=b;break;case "i16":w[a>>1]=b;break;case "i32":x[a>>2]=b;break;case "i64":C("to do setValue(i64) use WASM_BIGINT");case "float":ra[a>>2]=b;break;case "double":sa[a>>3]=b;break;case "*":z[a>>2]=b;break;default:C(`invalid type for setValue: ${c}`)}}
var Ka="undefined"!=typeof TextDecoder?new TextDecoder:void 0,J=(a,b,c)=>{var e=b+c;for(c=b;a[c]&&!(c>=e);)++c;if(16<c-b&&a.buffer&&Ka)return Ka.decode(a.subarray(b,c));for(e="";b<c;){var f=a[b++];if(f&128){var h=a[b++]&63;if(192==(f&224))e+=String.fromCharCode((f&31)<<6|h);else{var k=a[b++]&63;f=224==(f&240)?(f&15)<<12|h<<6|k:(f&7)<<18|h<<12|k<<6|a[b++]&63;65536>f?e+=String.fromCharCode(f):(f-=65536,e+=String.fromCharCode(55296|f>>10,56320|f&1023))}}else e+=String.fromCharCode(f)}return e},La=(a,
b)=>{for(var c=0,e=a.length-1;0<=e;e--){var f=a[e];"."===f?a.splice(e,1):".."===f?(a.splice(e,1),c++):c&&(a.splice(e,1),c--)}if(b)for(;c;c--)a.unshift("..");return a},Ma=a=>{var b="/"===a.charAt(0),c="/"===a.substr(-1);(a=La(a.split("/").filter(e=>!!e),!b).join("/"))||b||(a=".");a&&c&&(a+="/");return(b?"/":"")+a},Na=a=>{var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);a=b[0];b=b[1];if(!a&&!b)return".";b&&=b.substr(0,b.length-1);return a+b},Oa=a=>{if("/"===a)return"/";
a=Ma(a);a=a.replace(/\/$/,"");var b=a.lastIndexOf("/");return-1===b?a:a.substr(b+1)},Pa=()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return a=>crypto.getRandomValues(a);C("initRandomDevice")},Qa=a=>(Qa=Pa())(a),Ra=(...a)=>{for(var b="",c=!1,e=a.length-1;-1<=e&&!c;e--){c=0<=e?a[e]:"/";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=La(b.split("/").filter(f=>!!f),!c).join("/");return(c?
"/":"")+b||"."},Sa=[],Ta=a=>{for(var b=0,c=0;c<a.length;++c){var e=a.charCodeAt(c);127>=e?b++:2047>=e?b+=2:55296<=e&&57343>=e?(b+=4,++c):b+=3}return b},K=(a,b,c,e)=>{if(!(0<e))return 0;var f=c;e=c+e-1;for(var h=0;h<a.length;++h){var k=a.charCodeAt(h);if(55296<=k&&57343>=k){var n=a.charCodeAt(++h);k=65536+((k&1023)<<10)|n&1023}if(127>=k){if(c>=e)break;b[c++]=k}else{if(2047>=k){if(c+1>=e)break;b[c++]=192|k>>6}else{if(65535>=k){if(c+2>=e)break;b[c++]=224|k>>12}else{if(c+3>=e)break;b[c++]=240|k>>18;b[c++]=
128|k>>12&63}b[c++]=128|k>>6&63}b[c++]=128|k&63}}b[c]=0;return c-f};function Ua(a,b,c){c=Array(0<c?c:Ta(a)+1);a=K(a,c,0,c.length);b&&(c.length=a);return c}var Va=[];function Wa(a,b){Va[a]={input:[],Bf:[],Nf:b};Xa(a,Ya)}
var Ya={open(a){var b=Va[a.node.Qf];if(!b)throw new N(43);a.Cf=b;a.seekable=!1},close(a){a.Cf.Nf.Kf(a.Cf)},Kf(a){a.Cf.Nf.Kf(a.Cf)},read(a,b,c,e){if(!a.Cf||!a.Cf.Nf.fg)throw new N(60);for(var f=0,h=0;h<e;h++){try{var k=a.Cf.Nf.fg(a.Cf)}catch(n){throw new N(29);}if(void 0===k&&0===f)throw new N(6);if(null===k||void 0===k)break;f++;b[c+h]=k}f&&(a.node.timestamp=Date.now());return f},write(a,b,c,e){if(!a.Cf||!a.Cf.Nf.$f)throw new N(60);try{for(var f=0;f<e;f++)a.Cf.Nf.$f(a.Cf,b[c+f])}catch(h){throw new N(29);
}e&&(a.node.timestamp=Date.now());return f}},Za={fg(){a:{if(!Sa.length){var a=null;"undefined"!=typeof window&&"function"==typeof window.prompt&&(a=window.prompt("Input: "),null!==a&&(a+="\n"));if(!a){a=null;break a}Sa=Ua(a,!0)}a=Sa.shift()}return a},$f(a,b){null===b||10===b?(ma(J(a.Bf,0)),a.Bf=[]):0!=b&&a.Bf.push(b)},Kf(a){a.Bf&&0<a.Bf.length&&(ma(J(a.Bf,0)),a.Bf=[])},Fg(){return{Ag:25856,Cg:5,zg:191,Bg:35387,yg:[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]}},Gg(){return 0},
Hg(){return[24,80]}},$a={$f(a,b){null===b||10===b?(r(J(a.Bf,0)),a.Bf=[]):0!=b&&a.Bf.push(b)},Kf(a){a.Bf&&0<a.Bf.length&&(r(J(a.Bf,0)),a.Bf=[])}};function ab(a,b){var c=a.xf?a.xf.length:0;c>=b||(b=Math.max(b,c*(1048576>c?2:1.125)>>>0),0!=c&&(b=Math.max(b,256)),c=a.xf,a.xf=new Uint8Array(b),0<a.zf&&a.xf.set(c.subarray(0,a.zf),0))}
var O={Ef:null,Ff(){return O.createNode(null,"/",16895,0)},createNode(a,b,c,e){if(24576===(c&61440)||4096===(c&61440))throw new N(63);O.Ef||(O.Ef={dir:{node:{Df:O.vf.Df,Af:O.vf.Af,Of:O.vf.Of,Sf:O.vf.Sf,kg:O.vf.kg,Xf:O.vf.Xf,Vf:O.vf.Vf,jg:O.vf.jg,Wf:O.vf.Wf},stream:{Jf:O.wf.Jf}},file:{node:{Df:O.vf.Df,Af:O.vf.Af},stream:{Jf:O.wf.Jf,read:O.wf.read,write:O.wf.write,cg:O.wf.cg,Tf:O.wf.Tf,Uf:O.wf.Uf}},link:{node:{Df:O.vf.Df,Af:O.vf.Af,Rf:O.vf.Rf},stream:{}},dg:{node:{Df:O.vf.Df,Af:O.vf.Af},stream:bb}});
c=cb(a,b,c,e);P(c.mode)?(c.vf=O.Ef.dir.node,c.wf=O.Ef.dir.stream,c.xf={}):32768===(c.mode&61440)?(c.vf=O.Ef.file.node,c.wf=O.Ef.file.stream,c.zf=0,c.xf=null):40960===(c.mode&61440)?(c.vf=O.Ef.link.node,c.wf=O.Ef.link.stream):8192===(c.mode&61440)&&(c.vf=O.Ef.dg.node,c.wf=O.Ef.dg.stream);c.timestamp=Date.now();a&&(a.xf[b]=c,a.timestamp=c.timestamp);return c},Eg(a){return a.xf?a.xf.subarray?a.xf.subarray(0,a.zf):new Uint8Array(a.xf):new Uint8Array(0)},vf:{Df(a){var b={};b.qg=8192===(a.mode&61440)?a.id:
1;b.hg=a.id;b.mode=a.mode;b.vg=1;b.uid=0;b.sg=0;b.Qf=a.Qf;P(a.mode)?b.size=4096:32768===(a.mode&61440)?b.size=a.zf:40960===(a.mode&61440)?b.size=a.link.length:b.size=0;b.mg=new Date(a.timestamp);b.ug=new Date(a.timestamp);b.pg=new Date(a.timestamp);b.ng=4096;b.og=Math.ceil(b.size/b.ng);return b},Af(a,b){void 0!==b.mode&&(a.mode=b.mode);void 0!==b.timestamp&&(a.timestamp=b.timestamp);if(void 0!==b.size&&(b=b.size,a.zf!=b))if(0==b)a.xf=null,a.zf=0;else{var c=a.xf;a.xf=new Uint8Array(b);c&&a.xf.set(c.subarray(0,
Math.min(b,a.zf)));a.zf=b}},Of(){throw db[44];},Sf(a,b,c,e){return O.createNode(a,b,c,e)},kg(a,b,c){if(P(a.mode)){try{var e=Q(b,c)}catch(h){}if(e)for(var f in e.xf)throw new N(55);}delete a.parent.xf[a.name];a.parent.timestamp=Date.now();a.name=c;b.xf[c]=a;b.timestamp=a.parent.timestamp},Xf(a,b){delete a.xf[b];a.timestamp=Date.now()},Vf(a,b){var c=Q(a,b),e;for(e in c.xf)throw new N(55);delete a.xf[b];a.timestamp=Date.now()},jg(a){var b=[".",".."],c;for(c of Object.keys(a.xf))b.push(c);return b},Wf(a,
b,c){a=O.createNode(a,b,41471,0);a.link=c;return a},Rf(a){if(40960!==(a.mode&61440))throw new N(28);return a.link}},wf:{read(a,b,c,e,f){var h=a.node.xf;if(f>=a.node.zf)return 0;a=Math.min(a.node.zf-f,e);if(8<a&&h.subarray)b.set(h.subarray(f,f+a),c);else for(e=0;e<a;e++)b[c+e]=h[f+e];return a},write(a,b,c,e,f,h){b.buffer===u.buffer&&(h=!1);if(!e)return 0;a=a.node;a.timestamp=Date.now();if(b.subarray&&(!a.xf||a.xf.subarray)){if(h)return a.xf=b.subarray(c,c+e),a.zf=e;if(0===a.zf&&0===f)return a.xf=b.slice(c,
c+e),a.zf=e;if(f+e<=a.zf)return a.xf.set(b.subarray(c,c+e),f),e}ab(a,f+e);if(a.xf.subarray&&b.subarray)a.xf.set(b.subarray(c,c+e),f);else for(h=0;h<e;h++)a.xf[f+h]=b[c+h];a.zf=Math.max(a.zf,f+e);return e},Jf(a,b,c){1===c?b+=a.position:2===c&&32768===(a.node.mode&61440)&&(b+=a.node.zf);if(0>b)throw new N(28);return b},cg(a,b,c){ab(a.node,b+c);a.node.zf=Math.max(a.node.zf,b+c)},Tf(a,b,c,e,f){if(32768!==(a.node.mode&61440))throw new N(43);a=a.node.xf;if(f&2||a.buffer!==u.buffer){if(0<c||c+b<a.length)a.subarray?
a=a.subarray(c,c+b):a=Array.prototype.slice.call(a,c,c+b);c=!0;b=65536*Math.ceil(b/65536);(f=eb(65536,b))?(v.fill(0,f,f+b),b=f):b=0;if(!b)throw new N(48);u.set(a,b)}else c=!1,b=a.byteOffset;return{wg:b,lg:c}},Uf(a,b,c,e){O.wf.write(a,b,0,e,c,!1);return 0}}},fb=(a,b)=>{var c=0;a&&(c|=365);b&&(c|=146);return c},gb=null,hb={},ib=[],jb=1,R=null,kb=!0,N=class{constructor(a){this.name="ErrnoError";this.yf=a}},db={},lb=class{constructor(){this.Yf={};this.node=null}get flags(){return this.Yf.flags}set flags(a){this.Yf.flags=
a}get position(){return this.Yf.position}set position(a){this.Yf.position=a}},mb=class{constructor(a,b,c,e){a||=this;this.parent=a;this.Ff=a.Ff;this.Lf=null;this.id=jb++;this.name=b;this.mode=c;this.vf={};this.wf={};this.Qf=e}get read(){return 365===(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}};
function S(a,b={}){a=Ra(a);if(!a)return{path:"",node:null};b=Object.assign({eg:!0,ag:0},b);if(8<b.ag)throw new N(32);a=a.split("/").filter(k=>!!k);for(var c=gb,e="/",f=0;f<a.length;f++){var h=f===a.length-1;if(h&&b.parent)break;c=Q(c,a[f]);e=Ma(e+"/"+a[f]);c.Lf&&(!h||h&&b.eg)&&(c=c.Lf.root);if(!h||b.If)for(h=0;40960===(c.mode&61440);)if(c=nb(e),e=Ra(Na(e),c),c=S(e,{ag:b.ag+1}).node,40<h++)throw new N(32);}return{path:e,node:c}}
function ob(a){for(var b;;){if(a===a.parent)return a=a.Ff.ig,b?"/"!==a[a.length-1]?`${a}/${b}`:a+b:a;b=b?`${a.name}/${b}`:a.name;a=a.parent}}function pb(a,b){for(var c=0,e=0;e<b.length;e++)c=(c<<5)-c+b.charCodeAt(e)|0;return(a+c>>>0)%R.length}function qb(a){var b=pb(a.parent.id,a.name);if(R[b]===a)R[b]=a.Mf;else for(b=R[b];b;){if(b.Mf===a){b.Mf=a.Mf;break}b=b.Mf}}
function Q(a,b){var c=P(a.mode)?(c=rb(a,"x"))?c:a.vf.Of?0:2:54;if(c)throw new N(c);for(c=R[pb(a.id,b)];c;c=c.Mf){var e=c.name;if(c.parent.id===a.id&&e===b)return c}return a.vf.Of(a,b)}function cb(a,b,c,e){a=new mb(a,b,c,e);b=pb(a.parent.id,a.name);a.Mf=R[b];return R[b]=a}function P(a){return 16384===(a&61440)}function sb(a){var b=["r","w","rw"][a&3];a&512&&(b+="w");return b}
function rb(a,b){if(kb)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 tb(a,b){try{return Q(a,b),20}catch(c){}return rb(a,"wx")}function ub(a,b,c){try{var e=Q(a,b)}catch(f){return f.yf}if(a=rb(a,"wx"))return a;if(c){if(!P(e.mode))return 54;if(e===e.parent||"/"===ob(e))return 10}else if(P(e.mode))return 31;return 0}function T(a){a=ib[a];if(!a)throw new N(8);return a}
function vb(a,b=-1){a=Object.assign(new lb,a);if(-1==b)a:{for(b=0;4096>=b;b++)if(!ib[b])break a;throw new N(33);}a.Gf=b;return ib[b]=a}function wb(a,b=-1){a=vb(a,b);a.wf?.Dg?.(a);return a}var bb={open(a){a.wf=hb[a.node.Qf].wf;a.wf.open?.(a)},Jf(){throw new N(70);}};function Xa(a,b){hb[a]={wf:b}}
function xb(a,b){var c="/"===b;if(c&&gb)throw new N(10);if(!c&&b){var e=S(b,{eg:!1});b=e.path;e=e.node;if(e.Lf)throw new N(10);if(!P(e.mode))throw new N(54);}b={type:a,Ig:{},ig:b,tg:[]};a=a.Ff(b);a.Ff=b;b.root=a;c?gb=a:e&&(e.Lf=b,e.Ff&&e.Ff.tg.push(b))}function yb(a,b,c){var e=S(a,{parent:!0}).node;a=Oa(a);if(!a||"."===a||".."===a)throw new N(28);var f=tb(e,a);if(f)throw new N(f);if(!e.vf.Sf)throw new N(63);return e.vf.Sf(e,a,b,c)}function U(a,b){return yb(a,(void 0!==b?b:511)&1023|16384,0)}
function zb(a,b,c){"undefined"==typeof c&&(c=b,b=438);yb(a,b|8192,c)}function Ab(a,b){if(!Ra(a))throw new N(44);var c=S(b,{parent:!0}).node;if(!c)throw new N(44);b=Oa(b);var e=tb(c,b);if(e)throw new N(e);if(!c.vf.Wf)throw new N(63);c.vf.Wf(c,b,a)}function Bb(a){var b=S(a,{parent:!0}).node;a=Oa(a);var c=Q(b,a),e=ub(b,a,!0);if(e)throw new N(e);if(!b.vf.Vf)throw new N(63);if(c.Lf)throw new N(10);b.vf.Vf(b,a);qb(c)}
function nb(a){a=S(a).node;if(!a)throw new N(44);if(!a.vf.Rf)throw new N(28);return Ra(ob(a.parent),a.vf.Rf(a))}function Cb(a,b){a=S(a,{If:!b}).node;if(!a)throw new N(44);if(!a.vf.Df)throw new N(63);return a.vf.Df(a)}function Db(a){return Cb(a,!0)}function Eb(a,b){a="string"==typeof a?S(a,{If:!0}).node:a;if(!a.vf.Af)throw new N(63);a.vf.Af(a,{mode:b&4095|a.mode&-4096,timestamp:Date.now()})}
function Fb(a,b){if(0>b)throw new N(28);a="string"==typeof a?S(a,{If:!0}).node:a;if(!a.vf.Af)throw new N(63);if(P(a.mode))throw new N(31);if(32768!==(a.mode&61440))throw new N(28);var c=rb(a,"w");if(c)throw new N(c);a.vf.Af(a,{size:b,timestamp:Date.now()})}
function Gb(a,b,c){if(""===a)throw new N(44);if("string"==typeof b){var e={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[b];if("undefined"==typeof e)throw Error(`Unknown file open mode: ${b}`);b=e}c=b&64?("undefined"==typeof c?438:c)&4095|32768:0;if("object"==typeof a)var f=a;else{a=Ma(a);try{f=S(a,{If:!(b&131072)}).node}catch(h){}}e=!1;if(b&64)if(f){if(b&128)throw new N(20);}else f=yb(a,c,0),e=!0;if(!f)throw new N(44);8192===(f.mode&61440)&&(b&=-513);if(b&65536&&!P(f.mode))throw new N(54);if(!e&&(c=
f?40960===(f.mode&61440)?32:P(f.mode)&&("r"!==sb(b)||b&512)?31:rb(f,sb(b)):44))throw new N(c);b&512&&!e&&Fb(f,0);b&=-131713;f=vb({node:f,path:ob(f),flags:b,seekable:!0,position:0,wf:f.wf,xg:[],error:!1});f.wf.open&&f.wf.open(f);!d.logReadFiles||b&1||(Hb||={},a in Hb||(Hb[a]=1));return f}function Ib(a,b,c){if(null===a.Gf)throw new N(8);if(!a.seekable||!a.wf.Jf)throw new N(70);if(0!=c&&1!=c&&2!=c)throw new N(28);a.position=a.wf.Jf(a,b,c);a.xg=[]}var Jb;
function Kb(a,b,c){a=Ma("/dev/"+a);var e=fb(!!b,!!c);Lb||=64;var f=Lb++<<8|0;Xa(f,{open(h){h.seekable=!1},close(){c?.buffer?.length&&c(10)},read(h,k,n,l){for(var m=0,p=0;p<l;p++){try{var q=b()}catch(t){throw new N(29);}if(void 0===q&&0===m)throw new N(6);if(null===q||void 0===q)break;m++;k[n+p]=q}m&&(h.node.timestamp=Date.now());return m},write(h,k,n,l){for(var m=0;m<l;m++)try{c(k[n+m])}catch(p){throw new N(29);}l&&(h.node.timestamp=Date.now());return m}});zb(a,e,f)}var Lb,W={},Hb;
function X(a,b,c){if("/"===b.charAt(0))return b;a=-100===a?"/":T(a).path;if(0==b.length){if(!c)throw new N(44);return a}return Ma(a+"/"+b)}
function Mb(a,b,c){a=a(b);x[c>>2]=a.qg;x[c+4>>2]=a.mode;z[c+8>>2]=a.vg;x[c+12>>2]=a.uid;x[c+16>>2]=a.sg;x[c+20>>2]=a.Qf;F=[a.size>>>0,(D=a.size,1<=+Math.abs(D)?0<D?+Math.floor(D/4294967296)>>>0:~~+Math.ceil((D-+(~~D>>>0))/4294967296)>>>0:0)];x[c+24>>2]=F[0];x[c+28>>2]=F[1];x[c+32>>2]=4096;x[c+36>>2]=a.og;b=a.mg.getTime();var e=a.ug.getTime(),f=a.pg.getTime();F=[Math.floor(b/1E3)>>>0,(D=Math.floor(b/1E3),1<=+Math.abs(D)?0<D?+Math.floor(D/4294967296)>>>0:~~+Math.ceil((D-+(~~D>>>0))/4294967296)>>>0:
0)];x[c+40>>2]=F[0];x[c+44>>2]=F[1];z[c+48>>2]=b%1E3*1E3;F=[Math.floor(e/1E3)>>>0,(D=Math.floor(e/1E3),1<=+Math.abs(D)?0<D?+Math.floor(D/4294967296)>>>0:~~+Math.ceil((D-+(~~D>>>0))/4294967296)>>>0:0)];x[c+56>>2]=F[0];x[c+60>>2]=F[1];z[c+64>>2]=e%1E3*1E3;F=[Math.floor(f/1E3)>>>0,(D=Math.floor(f/1E3),1<=+Math.abs(D)?0<D?+Math.floor(D/4294967296)>>>0:~~+Math.ceil((D-+(~~D>>>0))/4294967296)>>>0:0)];x[c+72>>2]=F[0];x[c+76>>2]=F[1];z[c+80>>2]=f%1E3*1E3;F=[a.hg>>>0,(D=a.hg,1<=+Math.abs(D)?0<D?+Math.floor(D/
4294967296)>>>0:~~+Math.ceil((D-+(~~D>>>0))/4294967296)>>>0:0)];x[c+88>>2]=F[0];x[c+92>>2]=F[1];return 0}var Nb=void 0;function Ob(){var a=x[+Nb>>2];Nb+=4;return a}
var Pb=(a,b)=>b+2097152>>>0<4194305-!!a?(a>>>0)+4294967296*b:NaN,Qb=[0,31,60,91,121,152,182,213,244,274,305,335],Rb=[0,31,59,90,120,151,181,212,243,273,304,334],Sb={},Ub=()=>{if(!Tb){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",_:ia||"./this.program"},b;for(b in Sb)void 0===Sb[b]?delete a[b]:a[b]=Sb[b];var c=[];for(b in a)c.push(`${b}=${a[b]}`);Tb=c}return Tb},
Tb;function Vb(){}function Wb(){}function Xb(){}function Yb(){}function Zb(){}function $b(){}function ac(){}function bc(){}function cc(){}function dc(){}function ec(){}function fc(){}function gc(){}function hc(){}function ic(){}function jc(){}function kc(){}function lc(){}function mc(){}function nc(){}function oc(){}function pc(){}function qc(){}function rc(){}function sc(){}function tc(){}function uc(){}function vc(){}function wc(){}function xc(){}function yc(){}function zc(){}function Ac(){}
function Bc(){}function Cc(){}function Dc(){}function Ec(){}function Fc(){}function Gc(){}
var Hc,Ic,Jc=[],Y=(a,b,c,e)=>{var f={string:m=>{var p=0;if(null!==m&&void 0!==m&&0!==m){p=Ta(m)+1;var q=Kc(p);K(m,v,q,p);p=q}return p},array:m=>{var p=Kc(m.length);u.set(m,p);return p}};a=d["_"+a];var h=[],k=0;if(e)for(var n=0;n<e.length;n++){var l=f[c[n]];l?(0===k&&(k=Lc()),h[n]=l(e[n])):h[n]=e[n]}c=a(...h);return c=function(m){0!==k&&Mc(k);return"string"===b?m?J(v,m):"":"boolean"===b?!!m:m}(c)},Nc="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;
[44].forEach(a=>{db[a]=new N(a);db[a].stack="<generic error, no stack>"});R=Array(4096);xb(O,"/");U("/tmp");U("/home");U("/home/web_user");(function(){U("/dev");Xa(259,{read:()=>0,write:(e,f,h,k)=>k});zb("/dev/null",259);Wa(1280,Za);Wa(1536,$a);zb("/dev/tty",1280);zb("/dev/tty1",1536);var a=new Uint8Array(1024),b=0,c=()=>{0===b&&(b=Qa(a).byteLength);return a[--b]};Kb("random",c);Kb("urandom",c);U("/dev/shm");U("/dev/shm/tmp")})();
(function(){U("/proc");var a=U("/proc/self");U("/proc/self/fd");xb({Ff(){var b=cb(a,"fd",16895,73);b.vf={Of(c,e){var f=T(+e);c={parent:null,Ff:{ig:"fake"},vf:{Rf:()=>f.path}};return c.parent=c}};return b}},"/proc/self/fd")})();
(function(){const a=new Map;d.setAuthorizer=function(b,c,e){c?a.set(b,{f:c,bg:e}):a.delete(b);return Y("set_authorizer","number",["number"],[b])};Vb=function(b,c,e,f,h,k){if(a.has(b)){const {f:n,bg:l}=a.get(b);return n(l,c,e?e?J(v,e):"":null,f?f?J(v,f):"":null,h?h?J(v,h):"":null,k?k?J(v,k):"":null)}return 0}})();
(function(){const a=new Map,b=new Map;d.createFunction=function(c,e,f,h,k,n){const l=a.size;a.set(l,{f:n,Hf:k});return Y("create_function","number","number string number number number number".split(" "),[c,e,f,h,l,0])};d.createAggregate=function(c,e,f,h,k,n,l){const m=a.size;a.set(m,{step:n,rg:l,Hf:k});return Y("create_function","number","number string number number number number".split(" "),[c,e,f,h,m,1])};d.getFunctionUserData=function(c){return b.get(c)};Xb=function(c,e,f,h){c=a.get(c);b.set(e,
c.Hf);c.f(e,new Uint32Array(v.buffer,h,f));b.delete(e)};Zb=function(c,e,f,h){c=a.get(c);b.set(e,c.Hf);c.step(e,new Uint32Array(v.buffer,h,f));b.delete(e)};Wb=function(c,e){c=a.get(c);b.set(e,c.Hf);c.rg(e);b.delete(e)}})();(function(){const a=new Map;d.progressHandler=function(b,c,e,f){e?a.set(b,{f:e,bg:f}):a.delete(b);return Y("progress_handler",null,["number","number"],[b,c])};Yb=function(b){if(a.has(b)){const {f:c,bg:e}=a.get(b);return c(e)}return 0}})();
(function(){function a(l,m){const p=`get${l}`,q=`set${l}`;return new Proxy(new DataView(v.buffer,m,"Int32"===l?4:8),{get(t,y){if(y===p)return function(A,G){if(!G)throw Error("must be little endian");return t[y](A,G)};if(y===q)return function(A,G,E){if(!E)throw Error("must be little endian");return t[y](A,G,E)};if("string"===typeof y&&y.match(/^(get)|(set)/))throw Error("invalid type");return t[y]}})}const b="object"===typeof Asyncify,c=new Map,e=new Map,f=new Map,h=b?new Set:null,k=b?new Set:null,
n=new Map;pc=function(l,m,p,q){n.set(l?J(v,l):"",{size:m,Pf:Array.from(new Uint32Array(v.buffer,q,p))})};d.createModule=function(l,m,p,q){b&&(p.handleAsync=Asyncify.gg);const t=c.size;c.set(t,{module:p,Hf:q});q=0;p.xCreate&&(q|=1);p.xConnect&&(q|=2);p.xBestIndex&&(q|=4);p.xDisconnect&&(q|=8);p.xDestroy&&(q|=16);p.xOpen&&(q|=32);p.xClose&&(q|=64);p.xFilter&&(q|=128);p.xNext&&(q|=256);p.xEof&&(q|=512);p.xColumn&&(q|=1024);p.xRowid&&(q|=2048);p.xUpdate&&(q|=4096);p.xBegin&&(q|=8192);p.xSync&&(q|=16384);
p.xCommit&&(q|=32768);p.xRollback&&(q|=65536);p.xFindFunction&&(q|=131072);p.xRename&&(q|=262144);return Y("create_module","number",["number","string","number","number"],[l,m,t,q])};fc=function(l,m,p,q,t,y){m=c.get(m);e.set(t,m);if(b){h.delete(t);for(const A of h)e.delete(A)}q=Array.from(new Uint32Array(v.buffer,q,p)).map(A=>A?J(v,A):"");return m.module.xCreate(l,m.Hf,q,t,a("Int32",y))};ec=function(l,m,p,q,t,y){m=c.get(m);e.set(t,m);if(b){h.delete(t);for(const A of h)e.delete(A)}q=Array.from(new Uint32Array(v.buffer,
q,p)).map(A=>A?J(v,A):"");return m.module.xConnect(l,m.Hf,q,t,a("Int32",y))};ac=function(l,m){var p=e.get(l),q=n.get("sqlite3_index_info").Pf;const t={};t.nConstraint=H(m+q[0],"i32");t.aConstraint=[];var y=H(m+q[1],"*"),A=n.get("sqlite3_index_constraint").size;for(var G=0;G<t.nConstraint;++G){var E=t.aConstraint,M=E.push,L=y+G*A,fa=n.get("sqlite3_index_constraint").Pf,V={};V.iColumn=H(L+fa[0],"i32");V.op=H(L+fa[1],"i8");V.usable=!!H(L+fa[2],"i8");M.call(E,V)}t.nOrderBy=H(m+q[2],"i32");t.aOrderBy=
[];y=H(m+q[3],"*");A=n.get("sqlite3_index_orderby").size;for(G=0;G<t.nOrderBy;++G)E=t.aOrderBy,M=E.push,L=y+G*A,fa=n.get("sqlite3_index_orderby").Pf,V={},V.iColumn=H(L+fa[0],"i32"),V.desc=!!H(L+fa[1],"i8"),M.call(E,V);t.aConstraintUsage=[];for(y=0;y<t.nConstraint;++y)t.aConstraintUsage.push({argvIndex:0,omit:!1});t.idxNum=H(m+q[5],"i32");t.idxStr=null;t.orderByConsumed=!!H(m+q[8],"i8");t.estimatedCost=H(m+q[9],"double");t.estimatedRows=H(m+q[10],"i32");t.idxFlags=H(m+q[11],"i32");t.colUsed=H(m+q[12],
"i32");l=p.module.xBestIndex(l,t);p=n.get("sqlite3_index_info").Pf;q=H(m+p[4],"*");y=n.get("sqlite3_index_constraint_usage").size;for(M=0;M<t.nConstraint;++M)A=q+M*y,E=t.aConstraintUsage[M],L=n.get("sqlite3_index_constraint_usage").Pf,I(A+L[0],E.argvIndex,"i32"),I(A+L[1],E.omit?1:0,"i8");I(m+p[5],t.idxNum,"i32");"string"===typeof t.idxStr&&(q=Ta(t.idxStr),y=Y("sqlite3_malloc","number",["number"],[q+1]),K(t.idxStr,v,y,q+1),I(m+p[6],y,"*"),I(m+p[7],1,"i32"));I(m+p[8],t.orderByConsumed,"i32");I(m+p[9],
t.estimatedCost,"double");I(m+p[10],t.estimatedRows,"i32");I(m+p[11],t.idxFlags,"i32");return l};hc=function(l){const m=e.get(l);b?h.add(l):e.delete(l);return m.module.xDisconnect(l)};gc=function(l){const m=e.get(l);b?h.add(l):e.delete(l);return m.module.xDestroy(l)};lc=function(l,m){const p=e.get(l);f.set(m,p);if(b){k.delete(m);for(const q of k)f.delete(q)}return p.module.xOpen(l,m)};bc=function(l){const m=f.get(l);b?k.add(l):f.delete(l);return m.module.xClose(l)};ic=function(l){return f.get(l).module.xEof(l)?
1:0};jc=function(l,m,p,q,t){const y=f.get(l);p=p?p?J(v,p):"":null;t=new Uint32Array(v.buffer,t,q);return y.module.xFilter(l,m,p,t)};kc=function(l){return f.get(l).module.xNext(l)};cc=function(l,m,p){return f.get(l).module.xColumn(l,m,p)};oc=function(l,m){return f.get(l).module.xRowid(l,a("BigInt64",m))};rc=function(l,m,p,q){const t=e.get(l);p=new Uint32Array(v.buffer,p,m);return t.module.xUpdate(l,p,a("BigInt64",q))};$b=function(l){return e.get(l).module.xBegin(l)};qc=function(l){return e.get(l).module.xSync(l)};
dc=function(l){return e.get(l).module.xCommit(l)};nc=function(l){return e.get(l).module.xRollback(l)};mc=function(l,m){const p=e.get(l);m=m?J(v,m):"";return p.module.xRename(l,m)}})();
(function(){function a(h,k){const n=`get${h}`,l=`set${h}`;return new Proxy(new DataView(v.buffer,k,"Int32"===h?4:8),{get(m,p){if(p===n)return function(q,t){if(!t)throw Error("must be little endian");return m[p](q,t)};if(p===l)return function(q,t,y){if(!y)throw Error("must be little endian");return m[p](q,t,y)};if("string"===typeof p&&p.match(/^(get)|(set)/))throw Error("invalid type");return m[p]}})}const b="object"===typeof Asyncify;b&&(d.handleAsync=Asyncify.gg);const c=new Map,e=new Map;d.registerVFS=
function(h,k){if(Y("sqlite3_vfs_find","number",["string"],[h.name]))throw Error(`VFS '${h.name}' already registered`);b&&(h.handleAsync=Asyncify.gg);var n=h.mxPathName??64;const l=d._malloc(4);k=Y("register_vfs","number",["string","number","number","number"],[h.name,n,k?1:0,l]);k||(n=H(l,"*"),c.set(n,h));d._free(l);return k};const f=b?new Set:null;uc=function(h){const k=e.get(h);b?f.add(h):e.delete(h);return k.xClose(h)};Bc=function(h,k,n,l,m){return e.get(h).xRead(h,v.subarray(k,k+n),4294967296*
m+l+(0>l?2**32:0))};Gc=function(h,k,n,l,m){return e.get(h).xWrite(h,v.subarray(k,k+n),4294967296*m+l+(0>l?2**32:0))};Ec=function(h,k,n){return e.get(h).xTruncate(h,4294967296*n+k+(0>k?2**32:0))};Dc=function(h,k){return e.get(h).xSync(h,k)};yc=function(h,k){const n=e.get(h);k=a("BigInt64",k);return n.xFileSize(h,k)};zc=function(h,k){return e.get(h).xLock(h,k)};Fc=function(h,k){return e.get(h).xUnlock(h,k)};tc=function(h,k){const n=e.get(h);k=a("Int32",k);return n.xCheckReservedLock(h,k)};xc=function(h,
k,n){const l=e.get(h);n=new DataView(v.buffer,n);return l.xFileControl(h,k,n)};Cc=function(h){return e.get(h).xSectorSize(h)};wc=function(h){return e.get(h).xDeviceCharacteristics(h)};Ac=function(h,k,n,l,m){h=c.get(h);e.set(n,h);if(b){f.delete(n);for(var p of f)e.delete(p)}p=null;if(l&64){p=1;const q=[];for(;p;){const t=v[k++];if(t)q.push(t);else switch(v[k]||(p=null),p){case 1:q.push(63);p=2;break;case 2:q.push(61);p=3;break;case 3:q.push(38),p=2}}p=(new TextDecoder).decode(new Uint8Array(q))}else k&&
(p=k?J(v,k):"");m=a("Int32",m);return h.xOpen(p,n,l,m)};vc=function(h,k,n){return c.get(h).xDelete(k?J(v,k):"",n)};sc=function(h,k,n,l){h=c.get(h);l=a("Int32",l);return h.xAccess(k?J(v,k):"",n,l)}})();
var Oc={a:(a,b,c,e)=>{C(`Assertion failed: ${a?J(v,a):""}, at: `+[b?b?J(v,b):"":"unknown filename",c,e?e?J(v,e):"":"unknown function"])},N:function(a,b){try{return a=a?J(v,a):"",Eb(a,b),0}catch(c){if("undefined"==typeof W||"ErrnoError"!==c.name)throw c;return-c.yf}},Q:function(a,b,c){try{b=b?J(v,b):"";b=X(a,b);if(c&-8)return-28;var e=S(b,{If:!0}).node;if(!e)return-44;a="";c&4&&(a+="r");c&2&&(a+="w");c&1&&(a+="x");return a&&rb(e,a)?-2:0}catch(f){if("undefined"==typeof W||"ErrnoError"!==f.name)throw f;
return-f.yf}},O:function(a,b){try{var c=T(a);Eb(c.node,b);return 0}catch(e){if("undefined"==typeof W||"ErrnoError"!==e.name)throw e;return-e.yf}},M:function(a){try{var b=T(a).node;var c="string"==typeof b?S(b,{If:!0}).node:b;if(!c.vf.Af)throw new N(63);c.vf.Af(c,{timestamp:Date.now()});return 0}catch(e){if("undefined"==typeof W||"ErrnoError"!==e.name)throw e;return-e.yf}},b:function(a,b,c){Nb=c;try{var e=T(a);switch(b){case 0:var f=Ob();if(0>f)break;for(;ib[f];)f++;return wb(e,f).Gf;case 1:case 2:return 0;
case 3:return e.flags;case 4:return f=Ob(),e.flags|=f,0;case 12:return f=Ob(),w[f+0>>1]=2,0;case 13:case 14:return 0}return-28}catch(h){if("undefined"==typeof W||"ErrnoError"!==h.name)throw h;return-h.yf}},L:function(a,b){try{var c=T(a);return Mb(Cb,c.path,b)}catch(e){if("undefined"==typeof W||"ErrnoError"!==e.name)throw e;return-e.yf}},n:function(a,b,c){b=Pb(b,c);try{if(isNaN(b))return 61;var e=T(a);if(0===(e.flags&2097155))throw new N(28);Fb(e.node,b);return 0}catch(f){if("undefined"==typeof W||
"ErrnoError"!==f.name)throw f;return-f.yf}},F:function(a,b){try{if(0===b)return-28;var c=Ta("/")+1;if(b<c)return-68;K("/",v,a,b);return c}catch(e){if("undefined"==typeof W||"ErrnoError"!==e.name)throw e;return-e.yf}},J:function(a,b){try{return a=a?J(v,a):"",Mb(Db,a,b)}catch(c){if("undefined"==typeof W||"ErrnoError"!==c.name)throw c;return-c.yf}},C:function(a,b,c){try{return b=b?J(v,b):"",b=X(a,b),b=Ma(b),"/"===b[b.length-1]&&(b=b.substr(0,b.length-1)),U(b,c),0}catch(e){if("undefined"==typeof W||"ErrnoError"!==
e.name)throw e;return-e.yf}},I:function(a,b,c,e){try{b=b?J(v,b):"";var f=e&256;b=X(a,b,e&4096);return Mb(f?Db:Cb,b,c)}catch(h){if("undefined"==typeof W||"ErrnoError"!==h.name)throw h;return-h.yf}},A:function(a,b,c,e){Nb=e;try{b=b?J(v,b):"";b=X(a,b);var f=e?Ob():0;return Gb(b,c,f).Gf}catch(h){if("undefined"==typeof W||"ErrnoError"!==h.name)throw h;return-h.yf}},y:function(a,b,c,e){try{b=b?J(v,b):"";b=X(a,b);if(0>=e)return-28;var f=nb(b),h=Math.min(e,Ta(f)),k=u[c+h];K(f,v,c,e+1);u[c+h]=k;return h}catch(n){if("undefined"==
typeof W||"ErrnoError"!==n.name)throw n;return-n.yf}},x:function(a){try{return a=a?J(v,a):"",Bb(a),0}catch(b){if("undefined"==typeof W||"ErrnoError"!==b.name)throw b;return-b.yf}},K:function(a,b){try{return a=a?J(v,a):"",Mb(Cb,a,b)}catch(c){if("undefined"==typeof W||"ErrnoError"!==c.name)throw c;return-c.yf}},u:function(a,b,c){try{b=b?J(v,b):"";b=X(a,b);if(0===c){a=b;var e=S(a,{parent:!0}).node;if(!e)throw new N(44);var f=Oa(a),h=Q(e,f),k=ub(e,f,!1);if(k)throw new N(k);if(!e.vf.Xf)throw new N(63);
if(h.Lf)throw new N(10);e.vf.Xf(e,f);qb(h)}else 512===c?Bb(b):C("Invalid flags passed to unlinkat");return 0}catch(n){if("undefined"==typeof W||"ErrnoError"!==n.name)throw n;return-n.yf}},t:function(a,b,c){try{b=b?J(v,b):"";b=X(a,b,!0);if(c){var e=z[c>>2]+4294967296*x[c+4>>2],f=x[c+8>>2];h=1E3*e+f/1E6;c+=16;e=z[c>>2]+4294967296*x[c+4>>2];f=x[c+8>>2];k=1E3*e+f/1E6}else var h=Date.now(),k=h;a=h;var n=S(b,{If:!0}).node;n.vf.Af(n,{timestamp:Math.max(a,k)});return 0}catch(l){if("undefined"==typeof W||
"ErrnoError"!==l.name)throw l;return-l.yf}},k:function(a,b,c){a=new Date(1E3*Pb(a,b));x[c>>2]=a.getSeconds();x[c+4>>2]=a.getMinutes();x[c+8>>2]=a.getHours();x[c+12>>2]=a.getDate();x[c+16>>2]=a.getMonth();x[c+20>>2]=a.getFullYear()-1900;x[c+24>>2]=a.getDay();b=a.getFullYear();x[c+28>>2]=(0!==b%4||0===b%100&&0!==b%400?Rb:Qb)[a.getMonth()]+a.getDate()-1|0;x[c+36>>2]=-(60*a.getTimezoneOffset());b=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var e=(new Date(a.getFullYear(),0,1)).getTimezoneOffset();
x[c+32>>2]=(b!=e&&a.getTimezoneOffset()==Math.min(e,b))|0},i:function(a,b,c,e,f,h,k,n){f=Pb(f,h);try{if(isNaN(f))return 61;var l=T(e);if(0!==(b&2)&&0===(c&2)&&2!==(l.flags&2097155))throw new N(2);if(1===(l.flags&2097155))throw new N(2);if(!l.wf.Tf)throw new N(43);var m=l.wf.Tf(l,a,f,b,c);var p=m.wg;x[k>>2]=m.lg;z[n>>2]=p;return 0}catch(q){if("undefined"==typeof W||"ErrnoError"!==q.name)throw q;return-q.yf}},j:function(a,b,c,e,f,h,k){h=Pb(h,k);try{var n=T(f);if(c&2){if(32768!==(n.node.mode&61440))throw new N(43);
e&2||n.wf.Uf&&n.wf.Uf(n,v.slice(a,a+b),h,b,e)}}catch(l){if("undefined"==typeof W||"ErrnoError"!==l.name)throw l;return-l.yf}},B:(a,b,c,e)=>{var f=(new Date).getFullYear(),h=(new Date(f,0,1)).getTimezoneOffset();f=(new Date(f,6,1)).getTimezoneOffset();z[a>>2]=60*Math.max(h,f);x[b>>2]=Number(h!=f);b=k=>{var n=Math.abs(k);return`UTC${0<=k?"-":"+"}${String(Math.floor(n/60)).padStart(2,"0")}${String(n%60).padStart(2,"0")}`};a=b(h);b=b(f);f<h?(K(a,v,c,17),K(b,v,e,17)):(K(a,v,e,17),K(b,v,c,17))},e:()=>Date.now(),
d:()=>performance.now(),r:a=>{var b=v.length;a>>>=0;if(2147483648<a)return!1;for(var c=1;4>=c;c*=2){var e=b*(1+.2/c);e=Math.min(e,a+100663296);var f=Math;e=Math.max(a,e);a:{f=(f.min.call(f,2147483648,e+(65536-e%65536)%65536)-oa.buffer.byteLength+65535)/65536;try{oa.grow(f);ta();var h=1;break a}catch(k){}h=void 0}if(h)return!0}return!1},D:(a,b)=>{var c=0;Ub().forEach((e,f)=>{var h=b+c;f=z[a+4*f>>2]=h;for(h=0;h<e.length;++h)u[f++]=e.charCodeAt(h);u[f]=0;c+=e.length+1});return 0},E:(a,b)=>{var c=Ub();
z[a>>2]=c.length;var e=0;c.forEach(f=>e+=f.length+1);z[b>>2]=e;return 0},f:function(a){try{var b=T(a);if(null===b.Gf)throw new N(8);b.Zf&&(b.Zf=null);try{b.wf.close&&b.wf.close(b)}catch(c){throw c;}finally{ib[b.Gf]=null}b.Gf=null;return 0}catch(c){if("undefined"==typeof W||"ErrnoError"!==c.name)throw c;return c.yf}},s:function(a,b){try{var c=T(a);u[b]=c.Cf?2:P(c.mode)?3:40960===(c.mode&61440)?7:4;w[b+2>>1]=0;F=[0,(D=0,1<=+Math.abs(D)?0<D?+Math.floor(D/4294967296)>>>0:~~+Math.ceil((D-+(~~D>>>0))/4294967296)>>>
0:0)];x[b+8>>2]=F[0];x[b+12>>2]=F[1];F=[0,(D=0,1<=+Math.abs(D)?0<D?+Math.floor(D/4294967296)>>>0:~~+Math.ceil((D-+(~~D>>>0))/4294967296)>>>0:0)];x[b+16>>2]=F[0];x[b+20>>2]=F[1];return 0}catch(e){if("undefined"==typeof W||"ErrnoError"!==e.name)throw e;return e.yf}},z:function(a,b,c,e){try{a:{var f=T(a);a=b;for(var h,k=b=0;k<c;k++){var n=z[a>>2],l=z[a+4>>2];a+=8;var m=f,p=h,q=u;if(0>l||0>p)throw new N(28);if(null===m.Gf)throw new N(8);if(1===(m.flags&2097155))throw new N(8);if(P(m.node.mode))throw new N(31);
if(!m.wf.read)throw new N(28);var t="undefined"!=typeof p;if(!t)p=m.position;else if(!m.seekable)throw new N(70);var y=m.wf.read(m,q,n,l,p);t||(m.position+=y);var A=y;if(0>A){var G=-1;break a}b+=A;if(A<l)break;"undefined"!=typeof h&&(h+=A)}G=b}z[e>>2]=G;return 0}catch(E){if("undefined"==typeof W||"ErrnoError"!==E.name)throw E;return E.yf}},m:function(a,b,c,e,f){b=Pb(b,c);try{if(isNaN(b))return 61;var h=T(a);Ib(h,b,e);F=[h.position>>>0,(D=h.position,1<=+Math.abs(D)?0<D?+Math.floor(D/4294967296)>>>
0:~~+Math.ceil((D-+(~~D>>>0))/4294967296)>>>0:0)];x[f>>2]=F[0];x[f+4>>2]=F[1];h.Zf&&0===b&&0===e&&(h.Zf=null);return 0}catch(k){if("undefined"==typeof W||"ErrnoError"!==k.name)throw k;return k.yf}},G:function(a){try{var b=T(a);return b.wf?.Kf?b.wf.Kf(b):0}catch(c){if("undefined"==typeof W||"ErrnoError"!==c.name)throw c;return c.yf}},v:function(a,b,c,e){try{a:{var f=T(a);a=b;for(var h,k=b=0;k<c;k++){var n=z[a>>2],l=z[a+4>>2];a+=8;var m=f,p=n,q=l,t=h,y=u;if(0>q||0>t)throw new N(28);if(null===m.Gf)throw new N(8);
if(0===(m.flags&2097155))throw new N(8);if(P(m.node.mode))throw new N(31);if(!m.wf.write)throw new N(28);m.seekable&&m.flags&1024&&Ib(m,0,2);var A="undefined"!=typeof t;if(!A)t=m.position;else if(!m.seekable)throw new N(70);var G=m.wf.write(m,y,p,q,t,void 0);A||(m.position+=G);var E=G;if(0>E){var M=-1;break a}b+=E;"undefined"!=typeof h&&(h+=E)}M=b}z[e>>2]=M;return 0}catch(L){if("undefined"==typeof W||"ErrnoError"!==L.name)throw L;return L.yf}},sa:Vb,P:Wb,ha:Xb,ca:Yb,Z:Zb,la:$b,w:ac,g:bc,oa:cc,ja:dc,
ea:ec,fa:fc,h:gc,l:hc,pa:ic,ra:jc,qa:kc,da:lc,ga:mc,ia:nc,na:oc,c:pc,ka:qc,ma:rc,H:function(a,b,c,e){(0,globalThis.__onTablesChanged)?.(a,b,c,e)},aa:sc,V:tc,$:uc,ba:vc,S:wc,U:xc,Y:yc,X:zc,R:Ac,q:Bc,T:Cc,_:Dc,o:Ec,W:Fc,p:Gc},Z=function(){function a(c){Z=c.exports;oa=Z.ta;ta();Hc=Z.pf;va.unshift(Z.ua);B--;d.monitorRunDependencies?.(B);0==B&&(null!==za&&(clearInterval(za),za=null),Aa&&(c=Aa,Aa=null,c()));return Z}var b={a:Oc};B++;d.monitorRunDependencies?.(B);if(d.instantiateWasm)try{return d.instantiateWasm(b,
a)}catch(c){r(`Module.instantiateWasm callback failed with error: ${c}`),ba(c)}Ca||=d.locateFile?Ba("wa-sqlite.wasm")?"wa-sqlite.wasm":d.locateFile?d.locateFile("wa-sqlite.wasm",g):g+"wa-sqlite.wasm":(new URL("wa-sqlite.wasm",import.meta.url)).href;Ga(b,function(c){a(c.instance)}).catch(ba);return{}}();d._sqlite3_auto_extension=a=>(d._sqlite3_auto_extension=Z.va)(a);d._sqlite3_free=a=>(d._sqlite3_free=Z.wa)(a);d._sqlite3_malloc=a=>(d._sqlite3_malloc=Z.xa)(a);
d._sqlite3_bind_blob=(a,b,c,e,f)=>(d._sqlite3_bind_blob=Z.ya)(a,b,c,e,f);d._sqlite3_shutdown=()=>(d._sqlite3_shutdown=Z.za)();d._sqlite3_bind_int=(a,b,c)=>(d._sqlite3_bind_int=Z.Aa)(a,b,c);d._sqlite3_bind_int64=(a,b,c,e)=>(d._sqlite3_bind_int64=Z.Ba)(a,b,c,e);d._sqlite3_bind_double=(a,b,c)=>(d._sqlite3_bind_double=Z.Ca)(a,b,c);d._sqlite3_bind_null=(a,b)=>(d._sqlite3_bind_null=Z.Da)(a,b);d._sqlite3_clear_bindings=a=>(d._sqlite3_clear_bindings=Z.Ea)(a);
d._sqlite3_bind_text=(a,b,c,e,f)=>(d._sqlite3_bind_text=Z.Fa)(a,b,c,e,f);d._sqlite3_bind_pointer=(a,b,c,e,f)=>(d._sqlite3_bind_pointer=Z.Ga)(a,b,c,e,f);d._sqlite3_bind_value=(a,b,c)=>(d._sqlite3_bind_value=Z.Ha)(a,b,c);d._sqlite3_close=a=>(d._sqlite3_close=Z.Ia)(a);d._sqlite3_vtab_config=(a,b,c)=>(d._sqlite3_vtab_config=Z.Ja)(a,b,c);d._sqlite3_commit_hook=(a,b,c)=>(d._sqlite3_commit_hook=Z.Ka)(a,b,c);d._sqlite3_column_type=(a,b)=>(d._sqlite3_column_type=Z.La)(a,b);
d._sqlite3_column_count=a=>(d._sqlite3_column_count=Z.Ma)(a);d._sqlite3_column_text=(a,b)=>(d._sqlite3_column_text=Z.Na)(a,b);d._sqlite3_column_blob=(a,b)=>(d._sqlite3_column_blob=Z.Oa)(a,b);d._sqlite3_column_bytes=(a,b)=>(d._sqlite3_column_bytes=Z.Pa)(a,b);d._sqlite3_column_value=(a,b)=>(d._sqlite3_column_value=Z.Qa)(a,b);d._sqlite3_column_double=(a,b)=>(d._sqlite3_column_double=Z.Ra)(a,b);d._sqlite3_column_int=(a,b)=>(d._sqlite3_column_int=Z.Sa)(a,b);
d._sqlite3_column_int64=(a,b)=>(d._sqlite3_column_int64=Z.Ta)(a,b);d._sqlite3_column_name=(a,b)=>(d._sqlite3_column_name=Z.Ua)(a,b);d._sqlite3_context_db_handle=a=>(d._sqlite3_context_db_handle=Z.Va)(a);d._sqlite3_create_function_v2=(a,b,c,e,f,h,k,n,l)=>(d._sqlite3_create_function_v2=Z.Wa)(a,b,c,e,f,h,k,n,l);d._sqlite3_create_module_v2=(a,b,c,e,f)=>(d._sqlite3_create_module_v2=Z.Xa)(a,b,c,e,f);d._sqlite3_declare_vtab=(a,b)=>(d._sqlite3_declare_vtab=Z.Ya)(a,b);
d._sqlite3_errcode=a=>(d._sqlite3_errcode=Z.Za)(a);d._sqlite3_errmsg=a=>(d._sqlite3_errmsg=Z._a)(a);d._sqlite3_exec=(a,b,c,e,f)=>(d._sqlite3_exec=Z.$a)(a,b,c,e,f);d._sqlite3_finalize=a=>(d._sqlite3_finalize=Z.ab)(a);d._sqlite3_get_auxdata=(a,b)=>(d._sqlite3_get_auxdata=Z.bb)(a,b);d._sqlite3_next_stmt=(a,b)=>(d._sqlite3_next_stmt=Z.cb)(a,b);d._sqlite3_open=(a,b)=>(d._sqlite3_open=Z.db)(a,b);d._sqlite3_prepare_v2=(a,b,c,e,f)=>(d._sqlite3_prepare_v2=Z.eb)(a,b,c,e,f);
d._sqlite3_prepare_v3=(a,b,c,e,f,h)=>(d._sqlite3_prepare_v3=Z.fb)(a,b,c,e,f,h);d._sqlite3_randomness=(a,b)=>(d._sqlite3_randomness=Z.gb)(a,b);d._sqlite3_result_int=(a,b)=>(d._sqlite3_result_int=Z.hb)(a,b);d._sqlite3_result_blob=(a,b,c,e)=>(d._sqlite3_result_blob=Z.ib)(a,b,c,e);d._sqlite3_result_int64=(a,b,c)=>(d._sqlite3_result_int64=Z.jb)(a,b,c);d._sqlite3_result_double=(a,b)=>(d._sqlite3_result_double=Z.kb)(a,b);d._sqlite3_result_null=a=>(d._sqlite3_result_null=Z.lb)(a);
d._sqlite3_result_pointer=(a,b,c,e)=>(d._sqlite3_result_pointer=Z.mb)(a,b,c,e);d._sqlite3_result_error=(a,b,c)=>(d._sqlite3_result_error=Z.nb)(a,b,c);d._sqlite3_result_error_code=(a,b)=>(d._sqlite3_result_error_code=Z.ob)(a,b);d._sqlite3_result_value=(a,b)=>(d._sqlite3_result_value=Z.pb)(a,b);d._sqlite3_result_text=(a,b,c,e)=>(d._sqlite3_result_text=Z.qb)(a,b,c,e);d._sqlite3_result_subtype=(a,b)=>(d._sqlite3_result_subtype=Z.rb)(a,b);
d._sqlite3_set_authorizer=(a,b,c)=>(d._sqlite3_set_authorizer=Z.sb)(a,b,c);d._sqlite3_set_auxdata=(a,b,c,e)=>(d._sqlite3_set_auxdata=Z.tb)(a,b,c,e);d._sqlite3_sql=a=>(d._sqlite3_sql=Z.ub)(a);d._sqlite3_reset=a=>(d._sqlite3_reset=Z.vb)(a);d._sqlite3_value_text=a=>(d._sqlite3_value_text=Z.wb)(a);d._sqlite3_value_type=a=>(d._sqlite3_value_type=Z.xb)(a);d._sqlite3_value_bytes=a=>(d._sqlite3_value_bytes=Z.yb)(a);d._sqlite3_value_blob=a=>(d._sqlite3_value_blob=Z.zb)(a);
d._sqlite3_value_int=a=>(d._sqlite3_value_int=Z.Ab)(a);d._sqlite3_value_int64=a=>(d._sqlite3_value_int64=Z.Bb)(a);d._sqlite3_value_double=a=>(d._sqlite3_value_double=Z.Cb)(a);d._sqlite3_value_pointer=(a,b)=>(d._sqlite3_value_pointer=Z.Db)(a,b);d._sqlite3_vtab_distinct=a=>(d._sqlite3_vtab_distinct=Z.Eb)(a);d._sqlite3_get_autocommit=a=>(d._sqlite3_get_autocommit=Z.Fb)(a);d._sqlite3_step=a=>(d._sqlite3_step=Z.Gb)(a);d._sqlite3_status64=(a,b,c,e)=>(d._sqlite3_status64=Z.Hb)(a,b,c,e);
d._sqlite3_status=(a,b,c,e)=>(d._sqlite3_status=Z.Ib)(a,b,c,e);d._sqlite3_db_status=(a,b,c,e,f)=>(d._sqlite3_db_status=Z.Jb)(a,b,c,e,f);d._sqlite3_msize=a=>(d._sqlite3_msize=Z.Kb)(a);d._sqlite3_vfs_find=a=>(d._sqlite3_vfs_find=Z.Lb)(a);d._sqlite3_vfs_register=(a,b)=>(d._sqlite3_vfs_register=Z.Mb)(a,b);d._sqlite3_vfs_unregister=a=>(d._sqlite3_vfs_unregister=Z.Nb)(a);d._sqlite3_release_memory=a=>(d._sqlite3_release_memory=Z.Ob)(a);
d._sqlite3_soft_heap_limit64=(a,b)=>(d._sqlite3_soft_heap_limit64=Z.Pb)(a,b);d._sqlite3_memory_used=()=>(d._sqlite3_memory_used=Z.Qb)();d._sqlite3_hard_heap_limit64=(a,b)=>(d._sqlite3_hard_heap_limit64=Z.Rb)(a,b);d._sqlite3_memory_highwater=a=>(d._sqlite3_memory_highwater=Z.Sb)(a);d._sqlite3_malloc64=(a,b)=>(d._sqlite3_malloc64=Z.Tb)(a,b);d._sqlite3_realloc=(a,b)=>(d._sqlite3_realloc=Z.Ub)(a,b);d._sqlite3_realloc64=(a,b,c)=>(d._sqlite3_realloc64=Z.Vb)(a,b,c);
d._sqlite3_str_vappendf=(a,b,c)=>(d._sqlite3_str_vappendf=Z.Wb)(a,b,c);d._sqlite3_str_append=(a,b,c)=>(d._sqlite3_str_append=Z.Xb)(a,b,c);d._sqlite3_str_appendchar=(a,b,c)=>(d._sqlite3_str_appendchar=Z.Yb)(a,b,c);d._sqlite3_str_appendall=(a,b)=>(d._sqlite3_str_appendall=Z.Zb)(a,b);d._sqlite3_str_appendf=(a,b,c)=>(d._sqlite3_str_appendf=Z._b)(a,b,c);d._sqlite3_str_finish=a=>(d._sqlite3_str_finish=Z.$b)(a);d._sqlite3_str_errcode=a=>(d._sqlite3_str_errcode=Z.ac)(a);
d._sqlite3_str_length=a=>(d._sqlite3_str_length=Z.bc)(a);d._sqlite3_str_value=a=>(d._sqlite3_str_value=Z.cc)(a);d._sqlite3_str_reset=a=>(d._sqlite3_str_reset=Z.dc)(a);d._sqlite3_str_new=a=>(d._sqlite3_str_new=Z.ec)(a);d._sqlite3_vmprintf=(a,b)=>(d._sqlite3_vmprintf=Z.fc)(a,b);d._sqlite3_mprintf=(a,b)=>(d._sqlite3_mprintf=Z.gc)(a,b);d._sqlite3_vsnprintf=(a,b,c,e)=>(d._sqlite3_vsnprintf=Z.hc)(a,b,c,e);d._sqlite3_snprintf=(a,b,c,e)=>(d._sqlite3_snprintf=Z.ic)(a,b,c,e);
d._sqlite3_log=(a,b,c)=>(d._sqlite3_log=Z.jc)(a,b,c);d._sqlite3_stricmp=(a,b)=>(d._sqlite3_stricmp=Z.kc)(a,b);d._sqlite3_strnicmp=(a,b,c)=>(d._sqlite3_strnicmp=Z.lc)(a,b,c);d._sqlite3_os_init=()=>(d._sqlite3_os_init=Z.mc)();d._sqlite3_os_end=()=>(d._sqlite3_os_end=Z.nc)();d._sqlite3_serialize=(a,b,c,e)=>(d._sqlite3_serialize=Z.oc)(a,b,c,e);d._sqlite3_deserialize=(a,b,c,e,f,h,k,n)=>(d._sqlite3_deserialize=Z.pc)(a,b,c,e,f,h,k,n);d._sqlite3_database_file_object=a=>(d._sqlite3_database_file_object=Z.qc)(a);
d._sqlite3_backup_init=(a,b,c,e)=>(d._sqlite3_backup_init=Z.rc)(a,b,c,e);d._sqlite3_backup_step=(a,b)=>(d._sqlite3_backup_step=Z.sc)(a,b);d._sqlite3_backup_finish=a=>(d._sqlite3_backup_finish=Z.tc)(a);d._sqlite3_backup_remaining=a=>(d._sqlite3_backup_remaining=Z.uc)(a);d._sqlite3_backup_pagecount=a=>(d._sqlite3_backup_pagecount=Z.vc)(a);d._sqlite3_value_bytes16=a=>(d._sqlite3_value_bytes16=Z.wc)(a);d._sqlite3_value_subtype=a=>(d._sqlite3_value_subtype=Z.xc)(a);
d._sqlite3_value_text16=a=>(d._sqlite3_value_text16=Z.yc)(a);d._sqlite3_value_text16be=a=>(d._sqlite3_value_text16be=Z.zc)(a);d._sqlite3_value_text16le=a=>(d._sqlite3_value_text16le=Z.Ac)(a);d._sqlite3_value_encoding=a=>(d._sqlite3_value_encoding=Z.Bc)(a);d._sqlite3_value_nochange=a=>(d._sqlite3_value_nochange=Z.Cc)(a);d._sqlite3_value_frombind=a=>(d._sqlite3_value_frombind=Z.Dc)(a);d._sqlite3_value_dup=a=>(d._sqlite3_value_dup=Z.Ec)(a);d._sqlite3_value_free=a=>(d._sqlite3_value_free=Z.Fc)(a);
d._sqlite3_result_blob64=(a,b,c,e,f)=>(d._sqlite3_result_blob64=Z.Gc)(a,b,c,e,f);d._sqlite3_result_error16=(a,b,c)=>(d._sqlite3_result_error16=Z.Hc)(a,b,c);d._sqlite3_result_text64=(a,b,c,e,f,h)=>(d._sqlite3_result_text64=Z.Ic)(a,b,c,e,f,h);d._sqlite3_result_text16=(a,b,c,e)=>(d._sqlite3_result_text16=Z.Jc)(a,b,c,e);d._sqlite3_result_text16be=(a,b,c,e)=>(d._sqlite3_result_text16be=Z.Kc)(a,b,c,e);d._sqlite3_result_text16le=(a,b,c,e)=>(d._sqlite3_result_text16le=Z.Lc)(a,b,c,e);
d._sqlite3_result_error_toobig=a=>(d._sqlite3_result_error_toobig=Z.Mc)(a);d._sqlite3_result_zeroblob=(a,b)=>(d._sqlite3_result_zeroblob=Z.Nc)(a,b);d._sqlite3_result_zeroblob64=(a,b,c)=>(d._sqlite3_result_zeroblob64=Z.Oc)(a,b,c);d._sqlite3_result_error_nomem=a=>(d._sqlite3_result_error_nomem=Z.Pc)(a);d._sqlite3_user_data=a=>(d._sqlite3_user_data=Z.Qc)(a);d._sqlite3_vtab_nochange=a=>(d._sqlite3_vtab_nochange=Z.Rc)(a);d._sqlite3_vtab_in_first=(a,b)=>(d._sqlite3_vtab_in_first=Z.Sc)(a,b);
d._sqlite3_vtab_in_next=(a,b)=>(d._sqlite3_vtab_in_next=Z.Tc)(a,b);d._sqlite3_aggregate_context=(a,b)=>(d._sqlite3_aggregate_context=Z.Uc)(a,b);d._sqlite3_data_count=a=>(d._sqlite3_data_count=Z.Vc)(a);d._sqlite3_column_bytes16=(a,b)=>(d._sqlite3_column_bytes16=Z.Wc)(a,b);d._sqlite3_column_text16=(a,b)=>(d._sqlite3_column_text16=Z.Xc)(a,b);d._sqlite3_column_name16=(a,b)=>(d._sqlite3_column_name16=Z.Yc)(a,b);d._sqlite3_bind_blob64=(a,b,c,e,f,h)=>(d._sqlite3_bind_blob64=Z.Zc)(a,b,c,e,f,h);
d._sqlite3_bind_text64=(a,b,c,e,f,h,k)=>(d._sqlite3_bind_text64=Z._c)(a,b,c,e,f,h,k);d._sqlite3_bind_text16=(a,b,c,e,f)=>(d._sqlite3_bind_text16=Z.$c)(a,b,c,e,f);d._sqlite3_bind_zeroblob=(a,b,c)=>(d._sqlite3_bind_zeroblob=Z.ad)(a,b,c);d._sqlite3_bind_zeroblob64=(a,b,c,e)=>(d._sqlite3_bind_zeroblob64=Z.bd)(a,b,c,e);d._sqlite3_bind_parameter_count=a=>(d._sqlite3_bind_parameter_count=Z.cd)(a);d._sqlite3_bind_parameter_name=(a,b)=>(d._sqlite3_bind_parameter_name=Z.dd)(a,b);
d._sqlite3_bind_parameter_index=(a,b)=>(d._sqlite3_bind_parameter_index=Z.ed)(a,b);d._sqlite3_db_handle=a=>(d._sqlite3_db_handle=Z.fd)(a);d._sqlite3_stmt_readonly=a=>(d._sqlite3_stmt_readonly=Z.gd)(a);d._sqlite3_stmt_isexplain=a=>(d._sqlite3_stmt_isexplain=Z.hd)(a);d._sqlite3_stmt_explain=(a,b)=>(d._sqlite3_stmt_explain=Z.id)(a,b);d._sqlite3_stmt_busy=a=>(d._sqlite3_stmt_busy=Z.jd)(a);d._sqlite3_stmt_status=(a,b,c)=>(d._sqlite3_stmt_status=Z.kd)(a,b,c);
d._sqlite3_expanded_sql=a=>(d._sqlite3_expanded_sql=Z.ld)(a);d._sqlite3_value_numeric_type=a=>(d._sqlite3_value_numeric_type=Z.md)(a);d._sqlite3_blob_open=(a,b,c,e,f,h,k,n)=>(d._sqlite3_blob_open=Z.nd)(a,b,c,e,f,h,k,n);d._sqlite3_blob_close=a=>(d._sqlite3_blob_close=Z.od)(a);d._sqlite3_blob_read=(a,b,c,e)=>(d._sqlite3_blob_read=Z.pd)(a,b,c,e);d._sqlite3_blob_write=(a,b,c,e)=>(d._sqlite3_blob_write=Z.qd)(a,b,c,e);d._sqlite3_blob_bytes=a=>(d._sqlite3_blob_bytes=Z.rd)(a);
d._sqlite3_blob_reopen=(a,b,c)=>(d._sqlite3_blob_reopen=Z.sd)(a,b,c);d._sqlite3_strglob=(a,b)=>(d._sqlite3_strglob=Z.td)(a,b);d._sqlite3_strlike=(a,b,c)=>(d._sqlite3_strlike=Z.ud)(a,b,c);d._sqlite3_cancel_auto_extension=a=>(d._sqlite3_cancel_auto_extension=Z.vd)(a);d._sqlite3_reset_auto_extension=()=>(d._sqlite3_reset_auto_extension=Z.wd)();d._sqlite3_prepare=(a,b,c,e,f)=>(d._sqlite3_prepare=Z.xd)(a,b,c,e,f);d._sqlite3_prepare16=(a,b,c,e,f)=>(d._sqlite3_prepare16=Z.yd)(a,b,c,e,f);
d._sqlite3_prepare16_v2=(a,b,c,e,f)=>(d._sqlite3_prepare16_v2=Z.zd)(a,b,c,e,f);d._sqlite3_prepare16_v3=(a,b,c,e,f,h)=>(d._sqlite3_prepare16_v3=Z.Ad)(a,b,c,e,f,h);d._sqlite3_get_table=(a,b,c,e,f,h)=>(d._sqlite3_get_table=Z.Bd)(a,b,c,e,f,h);d._sqlite3_free_table=a=>(d._sqlite3_free_table=Z.Cd)(a);d._sqlite3_create_module=(a,b,c,e)=>(d._sqlite3_create_module=Z.Dd)(a,b,c,e);d._sqlite3_drop_modules=(a,b)=>(d._sqlite3_drop_modules=Z.Ed)(a,b);d._sqlite3_vtab_on_conflict=a=>(d._sqlite3_vtab_on_conflict=Z.Fd)(a);
d._sqlite3_vtab_collation=(a,b)=>(d._sqlite3_vtab_collation=Z.Gd)(a,b);d._sqlite3_vtab_in=(a,b,c)=>(d._sqlite3_vtab_in=Z.Hd)(a,b,c);d._sqlite3_vtab_rhs_value=(a,b,c)=>(d._sqlite3_vtab_rhs_value=Z.Id)(a,b,c);d._sqlite3_keyword_name=(a,b,c)=>(d._sqlite3_keyword_name=Z.Jd)(a,b,c);d._sqlite3_keyword_count=()=>(d._sqlite3_keyword_count=Z.Kd)();d._sqlite3_keyword_check=(a,b)=>(d._sqlite3_keyword_check=Z.Ld)(a,b);d._sqlite3_complete=a=>(d._sqlite3_complete=Z.Md)(a);
d._sqlite3_complete16=a=>(d._sqlite3_complete16=Z.Nd)(a);d._sqlite3_libversion=()=>(d._sqlite3_libversion=Z.Od)();d._sqlite3_libversion_number=()=>(d._sqlite3_libversion_number=Z.Pd)();d._sqlite3_threadsafe=()=>(d._sqlite3_threadsafe=Z.Qd)();d._sqlite3_initialize=()=>(d._sqlite3_initialize=Z.Rd)();d._sqlite3_config=(a,b)=>(d._sqlite3_config=Z.Sd)(a,b);d._sqlite3_db_mutex=a=>(d._sqlite3_db_mutex=Z.Td)(a);d._sqlite3_db_release_memory=a=>(d._sqlite3_db_release_memory=Z.Ud)(a);
d._sqlite3_db_cacheflush=a=>(d._sqlite3_db_cacheflush=Z.Vd)(a);d._sqlite3_db_config=(a,b,c)=>(d._sqlite3_db_config=Z.Wd)(a,b,c);d._sqlite3_last_insert_rowid=a=>(d._sqlite3_last_insert_rowid=Z.Xd)(a);d._sqlite3_set_last_insert_rowid=(a,b,c)=>(d._sqlite3_set_last_insert_rowid=Z.Yd)(a,b,c);d._sqlite3_changes64=a=>(d._sqlite3_changes64=Z.Zd)(a);d._sqlite3_changes=a=>(d._sqlite3_changes=Z._d)(a);d._sqlite3_total_changes64=a=>(d._sqlite3_total_changes64=Z.$d)(a);
d._sqlite3_total_changes=a=>(d._sqlite3_total_changes=Z.ae)(a);d._sqlite3_txn_state=(a,b)=>(d._sqlite3_txn_state=Z.be)(a,b);d._sqlite3_close_v2=a=>(d._sqlite3_close_v2=Z.ce)(a);d._sqlite3_busy_handler=(a,b,c)=>(d._sqlite3_busy_handler=Z.de)(a,b,c);d._sqlite3_progress_handler=(a,b,c,e)=>(d._sqlite3_progress_handler=Z.ee)(a,b,c,e);d._sqlite3_busy_timeout=(a,b)=>(d._sqlite3_busy_timeout=Z.fe)(a,b);d._sqlite3_interrupt=a=>(d._sqlite3_interrupt=Z.ge)(a);
d._sqlite3_is_interrupted=a=>(d._sqlite3_is_interrupted=Z.he)(a);d._sqlite3_create_function=(a,b,c,e,f,h,k,n)=>(d._sqlite3_create_function=Z.ie)(a,b,c,e,f,h,k,n);d._sqlite3_create_window_function=(a,b,c,e,f,h,k,n,l,m)=>(d._sqlite3_create_window_function=Z.je)(a,b,c,e,f,h,k,n,l,m);d._sqlite3_create_function16=(a,b,c,e,f,h,k,n)=>(d._sqlite3_create_function16=Z.ke)(a,b,c,e,f,h,k,n);d._sqlite3_overload_function=(a,b,c)=>(d._sqlite3_overload_function=Z.le)(a,b,c);
d._sqlite3_trace_v2=(a,b,c,e)=>(d._sqlite3_trace_v2=Z.me)(a,b,c,e);d._sqlite3_update_hook=(a,b,c)=>(d._sqlite3_update_hook=Z.ne)(a,b,c);d._sqlite3_rollback_hook=(a,b,c)=>(d._sqlite3_rollback_hook=Z.oe)(a,b,c);d._sqlite3_autovacuum_pages=(a,b,c,e)=>(d._sqlite3_autovacuum_pages=Z.pe)(a,b,c,e);d._sqlite3_wal_autocheckpoint=(a,b)=>(d._sqlite3_wal_autocheckpoint=Z.qe)(a,b);d._sqlite3_wal_hook=(a,b,c)=>(d._sqlite3_wal_hook=Z.re)(a,b,c);
d._sqlite3_wal_checkpoint_v2=(a,b,c,e,f)=>(d._sqlite3_wal_checkpoint_v2=Z.se)(a,b,c,e,f);d._sqlite3_wal_checkpoint=(a,b)=>(d._sqlite3_wal_checkpoint=Z.te)(a,b);d._sqlite3_error_offset=a=>(d._sqlite3_error_offset=Z.ue)(a);d._sqlite3_errmsg16=a=>(d._sqlite3_errmsg16=Z.ve)(a);d._sqlite3_extended_errcode=a=>(d._sqlite3_extended_errcode=Z.we)(a);d._sqlite3_system_errno=a=>(d._sqlite3_system_errno=Z.xe)(a);d._sqlite3_errstr=a=>(d._sqlite3_errstr=Z.ye)(a);
d._sqlite3_limit=(a,b,c)=>(d._sqlite3_limit=Z.ze)(a,b,c);d._sqlite3_open_v2=(a,b,c,e)=>(d._sqlite3_open_v2=Z.Ae)(a,b,c,e);d._sqlite3_open16=(a,b)=>(d._sqlite3_open16=Z.Be)(a,b);d._sqlite3_create_collation=(a,b,c,e,f)=>(d._sqlite3_create_collation=Z.Ce)(a,b,c,e,f);d._sqlite3_create_collation_v2=(a,b,c,e,f,h)=>(d._sqlite3_create_collation_v2=Z.De)(a,b,c,e,f,h);d._sqlite3_create_collation16=(a,b,c,e,f)=>(d._sqlite3_create_collation16=Z.Ee)(a,b,c,e,f);
d._sqlite3_collation_needed=(a,b,c)=>(d._sqlite3_collation_needed=Z.Fe)(a,b,c);d._sqlite3_collation_needed16=(a,b,c)=>(d._sqlite3_collation_needed16=Z.Ge)(a,b,c);d._sqlite3_get_clientdata=(a,b)=>(d._sqlite3_get_clientdata=Z.He)(a,b);d._sqlite3_set_clientdata=(a,b,c,e)=>(d._sqlite3_set_clientdata=Z.Ie)(a,b,c,e);d._sqlite3_table_column_metadata=(a,b,c,e,f,h,k,n,l)=>(d._sqlite3_table_column_metadata=Z.Je)(a,b,c,e,f,h,k,n,l);d._sqlite3_sleep=a=>(d._sqlite3_sleep=Z.Ke)(a);
d._sqlite3_extended_result_codes=(a,b)=>(d._sqlite3_extended_result_codes=Z.Le)(a,b);d._sqlite3_file_control=(a,b,c,e)=>(d._sqlite3_file_control=Z.Me)(a,b,c,e);d._sqlite3_test_control=(a,b)=>(d._sqlite3_test_control=Z.Ne)(a,b);d._sqlite3_create_filename=(a,b,c,e,f)=>(d._sqlite3_create_filename=Z.Oe)(a,b,c,e,f);d._sqlite3_free_filename=a=>(d._sqlite3_free_filename=Z.Pe)(a);d._sqlite3_uri_parameter=(a,b)=>(d._sqlite3_uri_parameter=Z.Qe)(a,b);d._sqlite3_uri_key=(a,b)=>(d._sqlite3_uri_key=Z.Re)(a,b);
d._sqlite3_uri_boolean=(a,b,c)=>(d._sqlite3_uri_boolean=Z.Se)(a,b,c);d._sqlite3_uri_int64=(a,b,c,e)=>(d._sqlite3_uri_int64=Z.Te)(a,b,c,e);d._sqlite3_filename_database=a=>(d._sqlite3_filename_database=Z.Ue)(a);d._sqlite3_filename_journal=a=>(d._sqlite3_filename_journal=Z.Ve)(a);d._sqlite3_filename_wal=a=>(d._sqlite3_filename_wal=Z.We)(a);d._sqlite3_db_name=(a,b)=>(d._sqlite3_db_name=Z.Xe)(a,b);d._sqlite3_db_filename=(a,b)=>(d._sqlite3_db_filename=Z.Ye)(a,b);
d._sqlite3_db_readonly=(a,b)=>(d._sqlite3_db_readonly=Z.Ze)(a,b);d._sqlite3_compileoption_used=a=>(d._sqlite3_compileoption_used=Z._e)(a);d._sqlite3_compileoption_get=a=>(d._sqlite3_compileoption_get=Z.$e)(a);d._sqlite3_sourceid=()=>(d._sqlite3_sourceid=Z.af)();d._malloc=a=>(d._malloc=Z.bf)(a);d._free=a=>(d._free=Z.cf)(a);d._RegisterExtensionFunctions=a=>(d._RegisterExtensionFunctions=Z.df)(a);d._set_authorizer=a=>(d._set_authorizer=Z.ef)(a);
d._create_function=(a,b,c,e,f,h)=>(d._create_function=Z.ff)(a,b,c,e,f,h);d._on_tables_changed=(a,b,c,e,f,h)=>(d._on_tables_changed=Z.gf)(a,b,c,e,f,h);d._register_table_update_hook=a=>(d._register_table_update_hook=Z.hf)(a);d._create_module=(a,b,c,e)=>(d._create_module=Z.jf)(a,b,c,e);d._progress_handler=(a,b)=>(d._progress_handler=Z.kf)(a,b);d._register_vfs=(a,b,c,e)=>(d._register_vfs=Z.lf)(a,b,c,e);d._getSqliteFree=()=>(d._getSqliteFree=Z.mf)();var Pc=d._main=(a,b)=>(Pc=d._main=Z.nf)(a,b);
d._setup_powersync=()=>(d._setup_powersync=Z.of)();var eb=(a,b)=>(eb=Z.qf)(a,b),Qc=()=>(Qc=Z.rf)(),Mc=a=>(Mc=Z.sf)(a),Kc=a=>(Kc=Z.tf)(a),Lc=()=>(Lc=Z.uf)();d._sqlite3_version=46872;d.getTempRet0=()=>Qc();d.ccall=Y;d.cwrap=(a,b,c,e)=>{var f=!c||c.every(h=>"number"===h||"boolean"===h);return"string"!==b&&f&&!e?d["_"+a]:(...h)=>Y(a,b,c,h,e)};
d.addFunction=(a,b)=>{if(!Ic){Ic=new WeakMap;var c=Hc.length;if(Ic)for(var e=0;e<0+c;e++){var f=Hc.get(e);f&&Ic.set(f,e)}}if(c=Ic.get(a)||0)return c;if(Jc.length)c=Jc.pop();else{try{Hc.grow(1)}catch(n){if(!(n instanceof RangeError))throw n;throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.";}c=Hc.length-1}try{Hc.set(c,a)}catch(n){if(!(n instanceof TypeError))throw n;if("function"==typeof WebAssembly.Function){e=WebAssembly.Function;f={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"};for(var h=
{parameters:[],results:"v"==b[0]?[]:[f[b[0]]]},k=1;k<b.length;++k)h.parameters.push(f[b[k]]);b=new e(h,a)}else{e=[1];f=b.slice(0,1);b=b.slice(1);h={i:127,p:127,j:126,f:125,d:124,e:111};e.push(96);k=b.length;128>k?e.push(k):e.push(k%128|128,k>>7);for(k=0;k<b.length;++k)e.push(h[b[k]]);"v"==f?e.push(0):e.push(1,h[f]);b=[0,97,115,109,1,0,0,0,1];f=e.length;128>f?b.push(f):b.push(f%128|128,f>>7);b.push(...e);b.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);b=new WebAssembly.Module(new Uint8Array(b));b=(new WebAssembly.Instance(b,
{e:{f:a}})).exports.f}Hc.set(c,b)}Ic.set(a,c);return c};d.setValue=I;d.getValue=H;d.UTF8ToString=(a,b)=>a?J(v,a,b):"";d.stringToUTF8=(a,b,c)=>K(a,v,b,c);d.lengthBytesUTF8=Ta;d.intArrayFromString=Ua;d.intArrayToString=function(a){for(var b=[],c=0;c<a.length;c++){var e=a[c];255<e&&(e&=255);b.push(String.fromCharCode(e))}return b.join("")};d.AsciiToString=a=>{for(var b="";;){var c=v[a++];if(!c)return b;b+=String.fromCharCode(c)}};
d.UTF16ToString=(a,b)=>{var c=a>>1;for(var e=c+b/2;!(c>=e)&&qa[c];)++c;c<<=1;if(32<c-a&&Nc)return Nc.decode(v.subarray(a,c));c="";for(e=0;!(e>=b/2);++e){var f=w[a+2*e>>1];if(0==f)break;c+=String.fromCharCode(f)}return c};d.stringToUTF16=(a,b,c)=>{c??=2147483647;if(2>c)return 0;c-=2;var e=b;c=c<2*a.length?c/2:a.length;for(var f=0;f<c;++f)w[b>>1]=a.charCodeAt(f),b+=2;w[b>>1]=0;return b-e};
d.UTF32ToString=(a,b)=>{for(var c=0,e="";!(c>=b/4);){var f=x[a+4*c>>2];if(0==f)break;++c;65536<=f?(f-=65536,e+=String.fromCharCode(55296|f>>10,56320|f&1023)):e+=String.fromCharCode(f)}return e};d.stringToUTF32=(a,b,c)=>{c??=2147483647;if(4>c)return 0;var e=b;c=e+c-4;for(var f=0;f<a.length;++f){var h=a.charCodeAt(f);if(55296<=h&&57343>=h){var k=a.charCodeAt(++f);h=65536+((h&1023)<<10)|k&1023}x[b>>2]=h;b+=4;if(b+4>c)break}x[b>>2]=0;return b-e};d.writeArrayToMemory=(a,b)=>{u.set(a,b)};var Rc;
Aa=function Sc(){Rc||Tc();Rc||(Aa=Sc)};
function Tc(){function a(){if(!Rc&&(Rc=!0,d.calledRun=!0,!pa)){d.noFSInit||Jb||(Jb=!0,d.stdin=d.stdin,d.stdout=d.stdout,d.stderr=d.stderr,d.stdin?Kb("stdin",d.stdin):Ab("/dev/tty","/dev/stdin"),d.stdout?Kb("stdout",null,d.stdout):Ab("/dev/tty","/dev/stdout"),d.stderr?Kb("stderr",null,d.stderr):Ab("/dev/tty1","/dev/stderr"),Gb("/dev/stdin",0),Gb("/dev/stdout",1),Gb("/dev/stderr",1));kb=!1;Ia(va);Ia(wa);aa(d);d.onRuntimeInitialized?.();if(Uc){var b=Pc;try{var c=b(0,0);Ja||(d.onExit?.(c),pa=!0);ja(c,
new Ha(c))}catch(e){e instanceof Ha||"unwind"==e||ja(1,e)}}if(d.postRun)for("function"==typeof d.postRun&&(d.postRun=[d.postRun]);d.postRun.length;)b=d.postRun.shift(),xa.unshift(b);Ia(xa)}}if(!(0<B)){if(d.preRun)for("function"==typeof d.preRun&&(d.preRun=[d.preRun]);d.preRun.length;)ya();Ia(ua);0<B||(d.setStatus?(d.setStatus("Running..."),setTimeout(function(){setTimeout(function(){d.setStatus("")},1);a()},1)):a())}}if(d.preInit)for("function"==typeof d.preInit&&(d.preInit=[d.preInit]);0<d.preInit.length;)d.preInit.pop()();
var Uc=!0;d.noInitialRun&&(Uc=!1);Tc();moduleRtn=ca;
return moduleRtn;
}
);
})();
export default Module;