
// We are modularizing this manually because the current modularize setting in Emscripten has some issues:
// https://github.com/kripken/emscripten/issues/5820
// In addition, When you use emcc's modularization, it still expects to export a global object called `Module`,
// which is able to be used/called before the WASM is loaded.
// The modularization below exports a promise that loads and resolves to the actual sql.js module.
// That way, this module can't be used before the WASM is finished loading.

// We are going to define a function that a user will call to start loading initializing our Sql.js library
// 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
// Instead, we want to return the previously loaded module

// TODO: Make this not declare a global if used in the browser
var initSqlJsPromise = undefined;

var initSqlJs = function (moduleConfig) {

    if (initSqlJsPromise){
      return initSqlJsPromise;
    }
    // If we're here, we've never called this function before
    initSqlJsPromise = new Promise(function (resolveModule, reject) {

        // We are modularizing this manually because the current modularize setting in Emscripten has some issues:
        // https://github.com/kripken/emscripten/issues/5820

        // The way to affect the loading of emcc compiled modules is to create a variable called `Module` and add
        // properties to it, like `preRun`, `postRun`, etc
        // We are using that to get notified when the WASM has finished loading.
        // Only then will we return our promise

        // If they passed in a moduleConfig object, use that
        // Otherwise, initialize Module to the empty object
        var Module = typeof moduleConfig !== 'undefined' ? moduleConfig : {};

        // EMCC only allows for a single onAbort function (not an array of functions)
        // So if the user defined their own onAbort function, we remember it and call it
        var originalOnAbortFunction = Module['onAbort'];
        Module['onAbort'] = function (errorThatCausedAbort) {
            reject(new Error(errorThatCausedAbort));
            if (originalOnAbortFunction){
              originalOnAbortFunction(errorThatCausedAbort);
            }
        };

        Module['postRun'] = Module['postRun'] || [];
        Module['postRun'].push(function () {
            // When Emscripted calls postRun, this promise resolves with the built Module
            resolveModule(Module);
        });

        // There is a section of code in the emcc-generated code below that looks like this:
        // (Note that this is lowercase `module`)
        // if (typeof module !== 'undefined') {
        //     module['exports'] = Module;
        // }
        // When that runs, it's going to overwrite our own modularization export efforts in shell-post.js!
        // The only way to tell emcc not to emit it is to pass the MODULARIZE=1 or MODULARIZE_INSTANCE=1 flags,
        // but that carries with it additional unnecessary baggage/bugs we don't want either.
        // So, we have three options:
        // 1) We undefine `module`
        // 2) We remember what `module['exports']` was at the beginning of this function and we restore it later
        // 3) We write a script to remove those lines of code as part of the Make process.
        //
        // Since those are the only lines of code that care about module, we will undefine it. It's the most straightforward
        // 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.
        // That's a nice side effect since we're handling the modularization efforts ourselves
        module = undefined;

        // The emcc-generated code and shell-post.js code goes below,
        // meaning that all of it runs inside of this promise. If anything throws an exception, our promise will abort
var k;k||=typeof Module != 'undefined' ? Module : {};var aa=!!globalThis.window,ba=!!globalThis.WorkerGlobalScope;
k.onRuntimeInitialized=function(){function a(f,l){switch(typeof l){case "boolean":$b(f,l?1:0);break;case "number":ac(f,l);break;case "string":bc(f,l,-1,-1);break;case "object":if(null===l)eb(f);else if(null!=l.length){var n=ca(l.length);m.set(l,n);cc(f,n,l.length,-1);da(n)}else ra(f,"Wrong API use : tried to return a value of an unknown type ("+l+").",-1);break;default:eb(f)}}function b(f,l){for(var n=[],p=0;p<f;p+=1){var u=r(l+4*p,"i32"),v=dc(u);if(1===v||2===v)u=ec(u);else if(3===v)u=fc(u);else if(4===
v){v=u;u=gc(v);v=hc(v);for(var K=new Uint8Array(u),I=0;I<u;I+=1)K[I]=m[v+I];u=K}else u=null;n.push(u)}return n}function c(f,l){this.Qa=f;this.db=l;this.Oa=1;this.yb=[]}function d(f,l){this.db=l;this.ob=ea(f);if(null===this.ob)throw Error("Unable to allocate memory for the SQL string");this.ub=this.ob;this.gb=this.Fb=null}function e(f){this.filename="dbfile_"+(4294967295*Math.random()>>>0);if(null!=f){var l=this.filename,n="/",p=l;n&&(n="string"==typeof n?n:fa(n),p=l?ha(n+"/"+l):n);l=ia(!0,!0);p=ja(p,
l);if(f){if("string"==typeof f){n=Array(f.length);for(var u=0,v=f.length;u<v;++u)n[u]=f.charCodeAt(u);f=n}ka(p,l|146);n=la(p,577);ma(n,f,0,f.length,0);na(n);ka(p,l)}}this.handleError(q(this.filename,g));this.db=r(g,"i32");hb(this.db);this.pb={};this.Sa={}}var g=y(4),h=k.cwrap,q=h("sqlite3_open","number",["string","number"]),w=h("sqlite3_close_v2","number",["number"]),t=h("sqlite3_exec","number",["number","string","number","number","number"]),x=h("sqlite3_changes","number",["number"]),D=h("sqlite3_prepare_v2",
"number",["number","string","number","number","number"]),ib=h("sqlite3_sql","string",["number"]),jc=h("sqlite3_normalized_sql","string",["number"]),jb=h("sqlite3_prepare_v2","number",["number","number","number","number","number"]),kc=h("sqlite3_bind_text","number",["number","number","number","number","number"]),kb=h("sqlite3_bind_blob","number",["number","number","number","number","number"]),lc=h("sqlite3_bind_double","number",["number","number","number"]),mc=h("sqlite3_bind_int","number",["number",
"number","number"]),nc=h("sqlite3_bind_parameter_index","number",["number","string"]),oc=h("sqlite3_step","number",["number"]),pc=h("sqlite3_errmsg","string",["number"]),qc=h("sqlite3_column_count","number",["number"]),rc=h("sqlite3_data_count","number",["number"]),sc=h("sqlite3_column_double","number",["number","number"]),lb=h("sqlite3_column_text","string",["number","number"]),tc=h("sqlite3_column_blob","number",["number","number"]),uc=h("sqlite3_column_bytes","number",["number","number"]),vc=h("sqlite3_column_type",
"number",["number","number"]),wc=h("sqlite3_column_name","string",["number","number"]),xc=h("sqlite3_reset","number",["number"]),yc=h("sqlite3_clear_bindings","number",["number"]),zc=h("sqlite3_finalize","number",["number"]),mb=h("sqlite3_create_function_v2","number","number string number number number number number number number".split(" ")),dc=h("sqlite3_value_type","number",["number"]),gc=h("sqlite3_value_bytes","number",["number"]),fc=h("sqlite3_value_text","string",["number"]),hc=h("sqlite3_value_blob",
"number",["number"]),ec=h("sqlite3_value_double","number",["number"]),ac=h("sqlite3_result_double","",["number","number"]),eb=h("sqlite3_result_null","",["number"]),bc=h("sqlite3_result_text","",["number","string","number","number"]),cc=h("sqlite3_result_blob","",["number","number","number","number"]),$b=h("sqlite3_result_int","",["number","number"]),ra=h("sqlite3_result_error","",["number","string","number"]),nb=h("sqlite3_aggregate_context","number",["number","number"]),hb=h("RegisterExtensionFunctions",
"number",["number"]),ob=h("sqlite3_update_hook","number",["number","number","number"]);c.prototype.bind=function(f){if(!this.Qa)throw"Statement closed";this.reset();return Array.isArray(f)?this.Wb(f):null!=f&&"object"===typeof f?this.Xb(f):!0};c.prototype.step=function(){if(!this.Qa)throw"Statement closed";this.Oa=1;var f=oc(this.Qa);switch(f){case 100:return!0;case 101:return!1;default:throw this.db.handleError(f);}};c.prototype.Pb=function(f){null==f&&(f=this.Oa,this.Oa+=1);return sc(this.Qa,f)};
c.prototype.hc=function(f){null==f&&(f=this.Oa,this.Oa+=1);f=lb(this.Qa,f);if("function"!==typeof BigInt)throw Error("BigInt is not supported");return BigInt(f)};c.prototype.mc=function(f){null==f&&(f=this.Oa,this.Oa+=1);return lb(this.Qa,f)};c.prototype.getBlob=function(f){null==f&&(f=this.Oa,this.Oa+=1);var l=uc(this.Qa,f);f=tc(this.Qa,f);for(var n=new Uint8Array(l),p=0;p<l;p+=1)n[p]=m[f+p];return n};c.prototype.get=function(f,l){l=l||{};null!=f&&this.bind(f)&&this.step();f=[];for(var n=rc(this.Qa),
p=0;p<n;p+=1)switch(vc(this.Qa,p)){case 1:var u=l.useBigInt?this.hc(p):this.Pb(p);f.push(u);break;case 2:f.push(this.Pb(p));break;case 3:f.push(this.mc(p));break;case 4:f.push(this.getBlob(p));break;default:f.push(null)}return f};c.prototype.Db=function(){for(var f=[],l=qc(this.Qa),n=0;n<l;n+=1)f.push(wc(this.Qa,n));return f};c.prototype.Ob=function(f,l){f=this.get(f,l);l=this.Db();for(var n={},p=0;p<l.length;p+=1)n[l[p]]=f[p];return n};c.prototype.lc=function(){return ib(this.Qa)};c.prototype.ic=
function(){return jc(this.Qa)};c.prototype.Jb=function(f){null!=f&&this.bind(f);this.step();return this.reset()};c.prototype.Lb=function(f,l){null==l&&(l=this.Oa,this.Oa+=1);f=ea(f);this.yb.push(f);this.db.handleError(kc(this.Qa,l,f,-1,0))};c.prototype.Vb=function(f,l){null==l&&(l=this.Oa,this.Oa+=1);var n=ca(f.length);m.set(f,n);this.yb.push(n);this.db.handleError(kb(this.Qa,l,n,f.length,0))};c.prototype.Kb=function(f,l){null==l&&(l=this.Oa,this.Oa+=1);this.db.handleError((f===(f|0)?mc:lc)(this.Qa,
l,f))};c.prototype.Yb=function(f){null==f&&(f=this.Oa,this.Oa+=1);kb(this.Qa,f,0,0,0)};c.prototype.Mb=function(f,l){null==l&&(l=this.Oa,this.Oa+=1);switch(typeof f){case "string":this.Lb(f,l);return;case "number":this.Kb(f,l);return;case "bigint":this.Lb(f.toString(),l);return;case "boolean":this.Kb(f+0,l);return;case "object":if(null===f){this.Yb(l);return}if(null!=f.length){this.Vb(f,l);return}}throw"Wrong API use : tried to bind a value of an unknown type ("+f+").";};c.prototype.Xb=function(f){var l=
this;Object.keys(f).forEach(function(n){var p=nc(l.Qa,n);0!==p&&l.Mb(f[n],p)});return!0};c.prototype.Wb=function(f){for(var l=0;l<f.length;l+=1)this.Mb(f[l],l+1);return!0};c.prototype.reset=function(){this.Cb();return 0===yc(this.Qa)&&0===xc(this.Qa)};c.prototype.Cb=function(){for(var f;void 0!==(f=this.yb.pop());)da(f)};c.prototype.cb=function(){this.Cb();var f=0===zc(this.Qa);delete this.db.pb[this.Qa];this.Qa=0;return f};d.prototype.next=function(){if(null===this.ob)return{done:!0};null!==this.gb&&
(this.gb.cb(),this.gb=null);if(!this.db.db)throw this.Ab(),Error("Database closed");var f=oa(),l=y(4);pa(g);pa(l);try{this.db.handleError(jb(this.db.db,this.ub,-1,g,l));this.ub=r(l,"i32");var n=r(g,"i32");if(0===n)return this.Ab(),{done:!0};this.gb=new c(n,this.db);this.db.pb[n]=this.gb;return{value:this.gb,done:!1}}catch(p){throw this.Fb=z(this.ub),this.Ab(),p;}finally{qa(f)}};d.prototype.Ab=function(){da(this.ob);this.ob=null};d.prototype.jc=function(){return null!==this.Fb?this.Fb:z(this.ub)};
"function"===typeof Symbol&&"symbol"===typeof Symbol.iterator&&(d.prototype[Symbol.iterator]=function(){return this});e.prototype.Jb=function(f,l){if(!this.db)throw"Database closed";if(l){f=this.Gb(f,l);try{f.step()}finally{f.cb()}}else this.handleError(t(this.db,f,0,0,g));return this};e.prototype.exec=function(f,l,n){if(!this.db)throw"Database closed";var p=null,u=null,v=null;try{v=u=ea(f);var K=y(4);for(f=[];0!==r(v,"i8");){pa(g);pa(K);this.handleError(jb(this.db,v,-1,g,K));var I=r(g,"i32");v=r(K,
"i32");if(0!==I){var H=null;p=new c(I,this);for(null!=l&&p.bind(l);p.step();)null===H&&(H={columns:p.Db(),values:[]},f.push(H)),H.values.push(p.get(null,n));p.cb()}}return f}catch(L){throw p&&p.cb(),L;}finally{u&&da(u)}};e.prototype.ec=function(f,l,n,p,u){"function"===typeof l&&(p=n,n=l,l=void 0);f=this.Gb(f,l);try{for(;f.step();)n(f.Ob(null,u))}finally{f.cb()}if("function"===typeof p)return p()};e.prototype.Gb=function(f,l){pa(g);this.handleError(D(this.db,f,-1,g,0));f=r(g,"i32");if(0===f)throw"Nothing to prepare";
var n=new c(f,this);null!=l&&n.bind(l);return this.pb[f]=n};e.prototype.pc=function(f){return new d(f,this)};e.prototype.fc=function(){Object.values(this.pb).forEach(function(l){l.cb()});Object.values(this.Sa).forEach(A);this.Sa={};this.handleError(w(this.db));var f=sa(this.filename);this.handleError(q(this.filename,g));this.db=r(g,"i32");hb(this.db);return f};e.prototype.close=function(){null!==this.db&&(Object.values(this.pb).forEach(function(f){f.cb()}),Object.values(this.Sa).forEach(A),this.Sa=
{},this.fb&&(A(this.fb),this.fb=void 0),this.handleError(w(this.db)),ta("/"+this.filename),this.db=null)};e.prototype.handleError=function(f){if(0===f)return null;f=pc(this.db);throw Error(f);};e.prototype.kc=function(){return x(this.db)};e.prototype.bc=function(f,l){Object.prototype.hasOwnProperty.call(this.Sa,f)&&(A(this.Sa[f]),delete this.Sa[f]);var n=ua(function(p,u,v){u=b(u,v);try{var K=l.apply(null,u)}catch(I){ra(p,I,-1);return}a(p,K)},"viii");this.Sa[f]=n;this.handleError(mb(this.db,f,l.length,
1,0,n,0,0,0));return this};e.prototype.ac=function(f,l){var n=l.init||function(){return null},p=l.finalize||function(H){return H},u=l.step;if(!u)throw"An aggregate function must have a step function in "+f;var v={};Object.hasOwnProperty.call(this.Sa,f)&&(A(this.Sa[f]),delete this.Sa[f]);l=f+"__finalize";Object.hasOwnProperty.call(this.Sa,l)&&(A(this.Sa[l]),delete this.Sa[l]);var K=ua(function(H,L,Ka){var V=nb(H,1);Object.hasOwnProperty.call(v,V)||(v[V]=n());L=b(L,Ka);L=[v[V]].concat(L);try{v[V]=u.apply(null,
L)}catch(Bc){delete v[V],ra(H,Bc,-1)}},"viii"),I=ua(function(H){var L=nb(H,1);try{var Ka=p(v[L])}catch(V){delete v[L];ra(H,V,-1);return}a(H,Ka);delete v[L]},"vi");this.Sa[f]=K;this.Sa[l]=I;this.handleError(mb(this.db,f,u.length-1,1,0,0,K,I,0));return this};e.prototype.vc=function(f){this.fb&&(ob(this.db,0,0),A(this.fb),this.fb=void 0);if(!f)return this;this.fb=ua(function(l,n,p,u,v){switch(n){case 18:l="insert";break;case 23:l="update";break;case 9:l="delete";break;default:throw"unknown operationCode in updateHook callback: "+
n;}p=z(p);u=z(u);if(v>Number.MAX_SAFE_INTEGER)throw"rowId too big to fit inside a Number";f(l,p,u,Number(v))},"viiiij");ob(this.db,this.fb,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.Db;c.prototype.getAsObject=c.prototype.Ob;c.prototype.getSQL=c.prototype.lc;c.prototype.getNormalizedSQL=c.prototype.ic;c.prototype.run=c.prototype.Jb;c.prototype.reset=c.prototype.reset;c.prototype.freemem=
c.prototype.Cb;c.prototype.free=c.prototype.cb;d.prototype.next=d.prototype.next;d.prototype.getRemainingSQL=d.prototype.jc;e.prototype.run=e.prototype.Jb;e.prototype.exec=e.prototype.exec;e.prototype.each=e.prototype.ec;e.prototype.prepare=e.prototype.Gb;e.prototype.iterateStatements=e.prototype.pc;e.prototype["export"]=e.prototype.fc;e.prototype.close=e.prototype.close;e.prototype.handleError=e.prototype.handleError;e.prototype.getRowsModified=e.prototype.kc;e.prototype.create_function=e.prototype.bc;
e.prototype.create_aggregate=e.prototype.ac;e.prototype.updateHook=e.prototype.vc;k.Database=e};var va="./this.program",wa=globalThis.document?.currentScript?.src;ba&&(wa=self.location.href);var xa="",ya,za;
if(aa||ba){try{xa=(new URL(".",wa)).href}catch{}ba&&(za=a=>{var b=new XMLHttpRequest;b.open("GET",a,!1);b.responseType="arraybuffer";b.send(null);return new Uint8Array(b.response)});ya=async a=>{a=await fetch(a,{credentials:"same-origin"});if(a.ok)return a.arrayBuffer();throw Error(a.status+" : "+a.url);}}var Aa=console.log.bind(console),B=console.error.bind(console),Ba,Ca=!1,Da,m,C,Ea,E,F,Fa,Ga,G;
function Ha(){var a=Ia.buffer;m=new Int8Array(a);Ea=new Int16Array(a);C=new Uint8Array(a);new Uint16Array(a);E=new Int32Array(a);F=new Uint32Array(a);Fa=new Float32Array(a);Ga=new Float64Array(a);G=new BigInt64Array(a);new BigUint64Array(a)}function Ja(a){k.onAbort?.(a);a="Aborted("+a+")";B(a);Ca=!0;throw new WebAssembly.RuntimeError(a+". Build with -sASSERTIONS for more info.");}var La;
async function Ma(a){if(!Ba)try{var b=await ya(a);return new Uint8Array(b)}catch{}if(a==La&&Ba)a=new Uint8Array(Ba);else if(za)a=za(a);else throw"both async and sync fetching of the wasm failed";return a}async function Na(a,b){try{var c=await Ma(a);return await WebAssembly.instantiate(c,b)}catch(d){B(`failed to asynchronously prepare wasm: ${d}`),Ja(d)}}
async function Oa(a){var b=La;if(!Ba)try{var c=fetch(b,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(c,a)}catch(d){B(`wasm streaming compile failed: ${d}`),B("falling back to ArrayBuffer instantiation")}return Na(b,a)}class Pa{name="ExitStatus";constructor(a){this.message=`Program terminated with exit(${a})`;this.status=a}}var Qa=a=>{for(;0<a.length;)a.shift()(k)},Ra=[],Sa=[],Ta=()=>{var a=k.preRun.shift();Sa.push(a)},J=0,Ua=null;
function r(a,b="i8"){b.endsWith("*")&&(b="*");switch(b){case "i1":return m[a];case "i8":return m[a];case "i16":return Ea[a>>1];case "i32":return E[a>>2];case "i64":return G[a>>3];case "float":return Fa[a>>2];case "double":return Ga[a>>3];case "*":return F[a>>2];default:Ja(`invalid type for getValue: ${b}`)}}var Va=!0;
function pa(a){var b="i32";b.endsWith("*")&&(b="*");switch(b){case "i1":m[a]=0;break;case "i8":m[a]=0;break;case "i16":Ea[a>>1]=0;break;case "i32":E[a>>2]=0;break;case "i64":G[a>>3]=BigInt(0);break;case "float":Fa[a>>2]=0;break;case "double":Ga[a>>3]=0;break;case "*":F[a>>2]=0;break;default:Ja(`invalid type for setValue: ${b}`)}}
var Wa=new TextDecoder,Xa=(a,b,c,d)=>{c=b+c;if(d)return c;for(;a[b]&&!(b>=c);)++b;return b},z=(a,b,c)=>a?Wa.decode(C.subarray(a,Xa(C,a,b,c))):"",Ya=(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=Ya(a.split("/").filter(d=>!!d),!b).join("/"))||b||(a=".");a&&c&&(a+="/");return(b?"/":"")+a},Za=a=>{var b=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(a).slice(1);
a=b[0];b=b[1];if(!a&&!b)return".";b&&=b.slice(0,-1);return a+b},$a=a=>a&&a.match(/([^\/]+|\/)\/*$/)[1],ab=()=>a=>crypto.getRandomValues(a),bb=a=>{(bb=ab())(a)},cb=(...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=Ya(b.split("/").filter(e=>!!e),!c).join("/");return(c?"/":"")+b||"."},db=a=>{var b=Xa(a,0);return Wa.decode(a.buffer?a.subarray(0,b):
new Uint8Array(a.slice(0,b)))},fb=[],gb=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},M=(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 h=a.codePointAt(g);if(127>=h){if(c>=d)break;b[c++]=h}else if(2047>=h){if(c+1>=d)break;b[c++]=192|h>>6;b[c++]=128|h&63}else if(65535>=h){if(c+2>=d)break;b[c++]=224|h>>12;b[c++]=128|h>>6&63;b[c++]=128|h&63}else{if(c+3>=d)break;b[c++]=240|h>>18;b[c++]=128|
h>>12&63;b[c++]=128|h>>6&63;b[c++]=128|h&63;g++}}b[c]=0;return c-e},pb=[];function qb(a,b){pb[a]={input:[],output:[],kb:b};rb(a,sb)}
var sb={open(a){var b=pb[a.node.nb];if(!b)throw new N(43);a.Va=b;a.seekable=!1},close(a){a.Va.kb.lb(a.Va)},lb(a){a.Va.kb.lb(a.Va)},read(a,b,c,d){if(!a.Va||!a.Va.kb.Qb)throw new N(60);for(var e=0,g=0;g<d;g++){try{var h=a.Va.kb.Qb(a.Va)}catch(q){throw new N(29);}if(void 0===h&&0===e)throw new N(6);if(null===h||void 0===h)break;e++;b[c+g]=h}e&&(a.node.$a=Date.now());return e},write(a,b,c,d){if(!a.Va||!a.Va.kb.Hb)throw new N(60);try{for(var e=0;e<d;e++)a.Va.kb.Hb(a.Va,b[c+e])}catch(g){throw new N(29);
}d&&(a.node.Ua=a.node.Ta=Date.now());return e}},tb={Qb(){a:{if(!fb.length){var a=null;globalThis.window?.prompt&&(a=window.prompt("Input: "),null!==a&&(a+="\n"));if(!a){var b=null;break a}b=Array(gb(a)+1);a=M(a,b,0,b.length);b.length=a;fb=b}b=fb.shift()}return b},Hb(a,b){null===b||10===b?(Aa(db(a.output)),a.output=[]):0!=b&&a.output.push(b)},lb(a){0<a.output?.length&&(Aa(db(a.output)),a.output=[])},Dc(){return{yc:25856,Ac:5,xc:191,zc:35387,wc:[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]}},Ec(){return 0},Fc(){return[24,80]}},ub={Hb(a,b){null===b||10===b?(B(db(a.output)),a.output=[]):0!=b&&a.output.push(b)},lb(a){0<a.output?.length&&(B(db(a.output)),a.output=[])}},O={Za:null,ab(){return O.createNode(null,"/",16895,0)},createNode(a,b,c,d){if(24576===(c&61440)||4096===(c&61440))throw new N(63);O.Za||(O.Za={dir:{node:{Wa:O.La.Wa,Xa:O.La.Xa,mb:O.La.mb,rb:O.La.rb,Tb:O.La.Tb,xb:O.La.xb,vb:O.La.vb,Ib:O.La.Ib,wb:O.La.wb},stream:{Ya:O.Ma.Ya}},file:{node:{Wa:O.La.Wa,Xa:O.La.Xa},
stream:{Ya:O.Ma.Ya,read:O.Ma.read,write:O.Ma.write,sb:O.Ma.sb,tb:O.Ma.tb}},link:{node:{Wa:O.La.Wa,Xa:O.La.Xa,eb:O.La.eb},stream:{}},Nb:{node:{Wa:O.La.Wa,Xa:O.La.Xa},stream:vb}});c=wb(a,b,c,d);P(c.mode)?(c.La=O.Za.dir.node,c.Ma=O.Za.dir.stream,c.Na={}):32768===(c.mode&61440)?(c.La=O.Za.file.node,c.Ma=O.Za.file.stream,c.Ra=0,c.Na=null):40960===(c.mode&61440)?(c.La=O.Za.link.node,c.Ma=O.Za.link.stream):8192===(c.mode&61440)&&(c.La=O.Za.Nb.node,c.Ma=O.Za.Nb.stream);c.$a=c.Ua=c.Ta=Date.now();a&&(a.Na[b]=
c,a.$a=a.Ua=a.Ta=c.$a);return c},Cc(a){return a.Na?a.Na.subarray?a.Na.subarray(0,a.Ra):new Uint8Array(a.Na):new Uint8Array(0)},La:{Wa(a){var b={};b.cc=8192===(a.mode&61440)?a.id:1;b.oc=a.id;b.mode=a.mode;b.rc=1;b.uid=0;b.nc=0;b.nb=a.nb;P(a.mode)?b.size=4096:32768===(a.mode&61440)?b.size=a.Ra:40960===(a.mode&61440)?b.size=a.link.length:b.size=0;b.$a=new Date(a.$a);b.Ua=new Date(a.Ua);b.Ta=new Date(a.Ta);b.Zb=4096;b.$b=Math.ceil(b.size/b.Zb);return b},Xa(a,b){for(var c of["mode","atime","mtime","ctime"])null!=
b[c]&&(a[c]=b[c]);void 0!==b.size&&(b=b.size,a.Ra!=b&&(0==b?(a.Na=null,a.Ra=0):(c=a.Na,a.Na=new Uint8Array(b),c&&a.Na.set(c.subarray(0,Math.min(b,a.Ra))),a.Ra=b)))},mb(){O.zb||(O.zb=new N(44),O.zb.stack="<generic error, no stack>");throw O.zb;},rb(a,b,c,d){return O.createNode(a,b,c,d)},Tb(a,b,c){try{var d=Q(b,c)}catch(g){}if(d){if(P(a.mode))for(var e in d.Na)throw new N(55);xb(d)}delete a.parent.Na[a.name];b.Na[c]=a;a.name=c;b.Ta=b.Ua=a.parent.Ta=a.parent.Ua=Date.now()},xb(a,b){delete a.Na[b];a.Ta=
a.Ua=Date.now()},vb(a,b){var c=Q(a,b),d;for(d in c.Na)throw new N(55);delete a.Na[b];a.Ta=a.Ua=Date.now()},Ib(a){return[".","..",...Object.keys(a.Na)]},wb(a,b,c){a=O.createNode(a,b,41471,0);a.link=c;return a},eb(a){if(40960!==(a.mode&61440))throw new N(28);return a.link}},Ma:{read(a,b,c,d,e){var g=a.node.Na;if(e>=a.node.Ra)return 0;a=Math.min(a.node.Ra-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;
a=a.node;a.Ua=a.Ta=Date.now();if(b.subarray&&(!a.Na||a.Na.subarray)){if(g)return a.Na=b.subarray(c,c+d),a.Ra=d;if(0===a.Ra&&0===e)return a.Na=b.slice(c,c+d),a.Ra=d;if(e+d<=a.Ra)return a.Na.set(b.subarray(c,c+d),e),d}g=e+d;var h=a.Na?a.Na.length:0;h>=g||(g=Math.max(g,h*(1048576>h?2:1.125)>>>0),0!=h&&(g=Math.max(g,256)),h=a.Na,a.Na=new Uint8Array(g),0<a.Ra&&a.Na.set(h.subarray(0,a.Ra),0));if(a.Na.subarray&&b.subarray)a.Na.set(b.subarray(c,c+d),e);else for(g=0;g<d;g++)a.Na[e+g]=b[c+g];a.Ra=Math.max(a.Ra,
e+d);return d},Ya(a,b,c){1===c?b+=a.position:2===c&&32768===(a.node.mode&61440)&&(b+=a.node.Ra);if(0>b)throw new N(28);return b},sb(a,b,c,d,e){if(32768!==(a.node.mode&61440))throw new N(43);a=a.node.Na;if(e&2||!a||a.buffer!==m.buffer){e=!0;d=65536*Math.ceil(b/65536);var g=yb(65536,d);g&&C.fill(0,g,g+d);d=g;if(!d)throw new N(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{tc:d,Ub:e}},tb(a,b,c,d){O.Ma.write(a,
b,0,d,c,!1);return 0}}},ia=(a,b)=>{var c=0;a&&(c|=365);b&&(c|=146);return c},zb=null,Ab={},Bb=[],Cb=1,R=null,Db=!1,Eb=!0,N=class{name="ErrnoError";constructor(a){this.Pa=a}},Fb=class{qb={};node=null;get flags(){return this.qb.flags}set flags(a){this.qb.flags=a}get position(){return this.qb.position}set position(a){this.qb.position=a}},Gb=class{La={};Ma={};ib=null;constructor(a,b,c,d){a||=this;this.parent=a;this.ab=a.ab;this.id=Cb++;this.name=b;this.mode=c;this.nb=d;this.$a=this.Ua=this.Ta=Date.now()}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={}){if(!a)throw new N(44);b.Bb??(b.Bb=!0);"/"===a.charAt(0)||(a="//"+a);var c=0;a:for(;40>c;c++){a=a.split("/").filter(q=>!!q);for(var d=zb,e="/",g=0;g<a.length;g++){var h=g===a.length-1;if(h&&b.parent)break;if("."!==a[g])if(".."===a[g])if(e=Za(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=Q(d,a[g])}catch(q){if(44===q?.Pa&&h&&b.sc)return{path:e};throw q;}!d.ib||h&&!b.Bb||(d=d.ib.root);if(40960===(d.mode&61440)&&(!h||b.hb)){if(!d.La.eb)throw new N(52);
d=d.La.eb(d);"/"===d.charAt(0)||(d=Za(e)+"/"+d);a=d+"/"+a.slice(g+1).join("/");continue a}}}return{path:e,node:d}}throw new N(32);}function fa(a){for(var b;;){if(a===a.parent)return a=a.ab.Sb,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)%R.length}function xb(a){var b=Hb(a.parent.id,a.name);if(R[b]===a)R[b]=a.jb;else for(b=R[b];b;){if(b.jb===a){b.jb=a.jb;break}b=b.jb}}
function Q(a,b){var c=P(a.mode)?(c=Ib(a,"x"))?c:a.La.mb?0:2:54;if(c)throw new N(c);for(c=R[Hb(a.id,b)];c;c=c.jb){var d=c.name;if(c.parent.id===a.id&&d===b)return c}return a.La.mb(a,b)}function wb(a,b,c,d){a=new Gb(a,b,c,d);b=Hb(a.parent.id,a.name);a.jb=R[b];return R[b]=a}function P(a){return 16384===(a&61440)}function Ib(a,b){return Eb?0:b.includes("r")&&!(a.mode&292)||b.includes("w")&&!(a.mode&146)||b.includes("x")&&!(a.mode&73)?2:0}
function Jb(a,b){if(!P(a.mode))return 54;try{return Q(a,b),20}catch(c){}return Ib(a,"wx")}function Kb(a,b,c){try{var d=Q(a,b)}catch(e){return e.Pa}if(a=Ib(a,"wx"))return a;if(c){if(!P(d.mode))return 54;if(d===d.parent||"/"===fa(d))return 10}else if(P(d.mode))return 31;return 0}function Lb(a){if(!a)throw new N(63);return a}function T(a){a=Bb[a];if(!a)throw new N(8);return a}
function Mb(a,b=-1){a=Object.assign(new Fb,a);if(-1==b)a:{for(b=0;4096>=b;b++)if(!Bb[b])break a;throw new N(33);}a.bb=b;return Bb[b]=a}function Nb(a,b=-1){a=Mb(a,b);a.Ma?.Bc?.(a);return a}function Ob(a,b,c){var d=a?.Ma.Xa;a=d?a:b;d??=b.La.Xa;Lb(d);d(a,c)}var vb={open(a){a.Ma=Ab[a.node.nb].Ma;a.Ma.open?.(a)},Ya(){throw new N(70);}};function rb(a,b){Ab[a]={Ma:b}}
function Pb(a,b){var c="/"===b;if(c&&zb)throw new N(10);if(!c&&b){var d=S(b,{Bb:!1});b=d.path;d=d.node;if(d.ib)throw new N(10);if(!P(d.mode))throw new N(54);}b={type:a,Gc:{},Sb:b,qc:[]};a=a.ab(b);a.ab=b;b.root=a;c?zb=a:d&&(d.ib=b,d.ab&&d.ab.qc.push(b))}function Qb(a,b,c){var d=S(a,{parent:!0}).node;a=$a(a);if(!a)throw new N(28);if("."===a||".."===a)throw new N(20);var e=Jb(d,a);if(e)throw new N(e);if(!d.La.rb)throw new N(63);return d.La.rb(d,a,b,c)}
function ja(a,b=438){return Qb(a,b&4095|32768,0)}function U(a,b=511){return Qb(a,b&1023|16384,0)}function Rb(a,b,c){"undefined"==typeof c&&(c=b,b=438);Qb(a,b|8192,c)}function Sb(a,b){if(!cb(a))throw new N(44);var c=S(b,{parent:!0}).node;if(!c)throw new N(44);b=$a(b);var d=Jb(c,b);if(d)throw new N(d);if(!c.La.wb)throw new N(63);c.La.wb(c,b,a)}
function Tb(a){var b=S(a,{parent:!0}).node;a=$a(a);var c=Q(b,a),d=Kb(b,a,!0);if(d)throw new N(d);if(!b.La.vb)throw new N(63);if(c.ib)throw new N(10);b.La.vb(b,a);xb(c)}function ta(a){var b=S(a,{parent:!0}).node;if(!b)throw new N(44);a=$a(a);var c=Q(b,a),d=Kb(b,a,!1);if(d)throw new N(d);if(!b.La.xb)throw new N(63);if(c.ib)throw new N(10);b.La.xb(b,a);xb(c)}function Ub(a,b){a=S(a,{hb:!b}).node;return Lb(a.La.Wa)(a)}function Vb(a,b,c,d){Ob(a,b,{mode:c&4095|b.mode&-4096,Ta:Date.now(),dc:d})}
function ka(a,b){a="string"==typeof a?S(a,{hb:!0}).node:a;Vb(null,a,b)}function Wb(a,b,c){if(P(b.mode))throw new N(31);if(32768!==(b.mode&61440))throw new N(28);var d=Ib(b,"w");if(d)throw new N(d);Ob(a,b,{size:c,timestamp:Date.now()})}
function la(a,b,c=438){if(""===a)throw new N(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("/");var g=S(a,{hb:!(b&131072),sc:!0});d=g.node;a=g.path}g=!1;if(b&64)if(d){if(b&128)throw new N(20);}else{if(e)throw new N(31);d=Qb(a,c|511,0);g=!0}if(!d)throw new N(44);8192===(d.mode&61440)&&(b&=-513);if(b&65536&&!P(d.mode))throw new N(54);
if(!g&&(d?40960===(d.mode&61440)?e=32:(e=["r","w","rw"][b&3],b&512&&(e+="w"),e=P(d.mode)&&("r"!==e||b&576)?31:Ib(d,e)):e=44,e))throw new N(e);b&512&&!g&&(e=d,e="string"==typeof e?S(e,{hb:!0}).node:e,Wb(null,e,0));b=Mb({node:d,path:fa(d),flags:b&-131713,seekable:!0,position:0,Ma:d.Ma,uc:[],error:!1});b.Ma.open&&b.Ma.open(b);g&&ka(d,c&511);return b}function na(a){if(null===a.bb)throw new N(8);a.Eb&&(a.Eb=null);try{a.Ma.close&&a.Ma.close(a)}catch(b){throw b;}finally{Bb[a.bb]=null}a.bb=null}
function Xb(a,b,c){if(null===a.bb)throw new N(8);if(!a.seekable||!a.Ma.Ya)throw new N(70);if(0!=c&&1!=c&&2!=c)throw new N(28);a.position=a.Ma.Ya(a,b,c);a.uc=[]}function Yb(a,b,c,d,e){if(0>d||0>e)throw new N(28);if(null===a.bb)throw new N(8);if(1===(a.flags&2097155))throw new N(8);if(P(a.node.mode))throw new N(31);if(!a.Ma.read)throw new N(28);var g="undefined"!=typeof e;if(!g)e=a.position;else if(!a.seekable)throw new N(70);b=a.Ma.read(a,b,c,d,e);g||(a.position+=b);return b}
function ma(a,b,c,d,e){if(0>d||0>e)throw new N(28);if(null===a.bb)throw new N(8);if(0===(a.flags&2097155))throw new N(8);if(P(a.node.mode))throw new N(31);if(!a.Ma.write)throw new N(28);a.seekable&&a.flags&1024&&Xb(a,0,2);var g="undefined"!=typeof e;if(!g)e=a.position;else if(!a.seekable)throw new N(70);b=a.Ma.write(a,b,c,d,e,void 0);g||(a.position+=b);return b}
function sa(a){var b=b||0;var c="binary";"utf8"!==c&&"binary"!==c&&Ja(`Invalid encoding type "${c}"`);b=la(a,b);a=Ub(a).size;var d=new Uint8Array(a);Yb(b,d,0,a,0);"utf8"===c&&(d=db(d));na(b);return d}
function W(a,b,c){a=ha("/dev/"+a);var d=ia(!!b,!!c);W.Rb??(W.Rb=64);var e=W.Rb++<<8|0;rb(e,{open(g){g.seekable=!1},close(){c?.buffer?.length&&c(10)},read(g,h,q,w){for(var t=0,x=0;x<w;x++){try{var D=b()}catch(ib){throw new N(29);}if(void 0===D&&0===t)throw new N(6);if(null===D||void 0===D)break;t++;h[q+x]=D}t&&(g.node.$a=Date.now());return t},write(g,h,q,w){for(var t=0;t<w;t++)try{c(h[q+t])}catch(x){throw new N(29);}w&&(g.node.Ua=g.node.Ta=Date.now());return t}});Rb(a,d,e)}var X={};
function Y(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 a+"/"+b}
function Zb(a,b){F[a>>2]=b.cc;F[a+4>>2]=b.mode;F[a+8>>2]=b.rc;F[a+12>>2]=b.uid;F[a+16>>2]=b.nc;F[a+20>>2]=b.nb;G[a+24>>3]=BigInt(b.size);E[a+32>>2]=4096;E[a+36>>2]=b.$b;var c=b.$a.getTime(),d=b.Ua.getTime(),e=b.Ta.getTime();G[a+40>>3]=BigInt(Math.floor(c/1E3));F[a+48>>2]=c%1E3*1E6;G[a+56>>3]=BigInt(Math.floor(d/1E3));F[a+64>>2]=d%1E3*1E6;G[a+72>>3]=BigInt(Math.floor(e/1E3));F[a+80>>2]=e%1E3*1E6;G[a+88>>3]=BigInt(b.oc);return 0}
var ic=void 0,Ac=()=>{var a=E[+ic>>2];ic+=4;return a},Cc=0,Dc=[0,31,60,91,121,152,182,213,244,274,305,335],Ec=[0,31,59,90,120,151,181,212,243,273,304,334],Fc={},Gc=a=>{if(!(a instanceof Pa||"unwind"==a))throw a;},Hc=a=>{Da=a;Va||0<Cc||(k.onExit?.(a),Ca=!0);throw new Pa(a);},Ic=a=>{if(!Ca)try{a()}catch(b){Gc(b)}finally{if(!(Va||0<Cc))try{Da=a=Da,Hc(a)}catch(b){Gc(b)}}},Jc={},Lc=()=>{if(!Kc){var a={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??
"C").replace("-","_")+".UTF-8",_:va||"./this.program"},b;for(b in Jc)void 0===Jc[b]?delete a[b]:a[b]=Jc[b];var c=[];for(b in a)c.push(`${b}=${a[b]}`);Kc=c}return Kc},Kc,Mc=(a,b,c,d)=>{var e={string:t=>{var x=0;if(null!==t&&void 0!==t&&0!==t){x=gb(t)+1;var D=y(x);M(t,C,D,x);x=D}return x},array:t=>{var x=y(t.length);m.set(t,x);return x}};a=k["_"+a];var g=[],h=0;if(d)for(var q=0;q<d.length;q++){var w=e[c[q]];w?(0===h&&(h=oa()),g[q]=w(d[q])):g[q]=d[q]}c=a(...g);return c=function(t){0!==h&&qa(h);return"string"===
b?z(t):"boolean"===b?!!t:t}(c)},ea=a=>{var b=gb(a)+1,c=ca(b);c&&M(a,C,c,b);return c},Nc,Oc=[],A=a=>{Nc.delete(Z.get(a));Z.set(a,null);Oc.push(a)},Pc=a=>{const b=a.length;return[b%128|128,b>>7,...a]},Qc={i:127,p:127,j:126,f:125,d:124,e:111},Rc=a=>Pc(Array.from(a,b=>Qc[b])),ua=(a,b)=>{if(!Nc){Nc=new WeakMap;var c=Z.length;if(Nc)for(var d=0;d<0+c;d++){var e=Z.get(d);e&&Nc.set(e,d)}}if(c=Nc.get(a)||0)return c;c=Oc.length?Oc.pop():Z.grow(1);try{Z.set(c,a)}catch(g){if(!(g instanceof TypeError))throw g;
b=Uint8Array.of(0,97,115,109,1,0,0,0,1,...Pc([1,96,...Rc(b.slice(1)),...Rc("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)}Nc.set(a,c);return c};R=Array(4096);Pb(O,"/");U("/tmp");U("/home");U("/home/web_user");
(function(){U("/dev");rb(259,{read:()=>0,write:(d,e,g,h)=>h,Ya:()=>0});Rb("/dev/null",259);qb(1280,tb);qb(1536,ub);Rb("/dev/tty",1280);Rb("/dev/tty1",1536);var a=new Uint8Array(1024),b=0,c=()=>{0===b&&(bb(a),b=a.byteLength);return a[--b]};W("random",c);W("urandom",c);U("/dev/shm");U("/dev/shm/tmp")})();
(function(){U("/proc");var a=U("/proc/self");U("/proc/self/fd");Pb({ab(){var b=wb(a,"fd",16895,73);b.Ma={Ya:O.Ma.Ya};b.La={mb(c,d){c=+d;var e=T(c);c={parent:null,ab:{Sb:"fake"},La:{eb:()=>e.path},id:c+1};return c.parent=c},Ib(){return Array.from(Bb.entries()).filter(([,c])=>c).map(([c])=>c.toString())}};return b}},"/proc/self/fd")})();k.noExitRuntime&&(Va=k.noExitRuntime);k.print&&(Aa=k.print);k.printErr&&(B=k.printErr);k.wasmBinary&&(Ba=k.wasmBinary);k.thisProgram&&(va=k.thisProgram);
if(k.preInit)for("function"==typeof k.preInit&&(k.preInit=[k.preInit]);0<k.preInit.length;)k.preInit.shift()();k.stackSave=()=>oa();k.stackRestore=a=>qa(a);k.stackAlloc=a=>y(a);k.cwrap=(a,b,c,d)=>{var e=!c||c.every(g=>"number"===g||"boolean"===g);return"string"!==b&&e&&!d?k["_"+a]:(...g)=>Mc(a,b,c,g)};k.addFunction=ua;k.removeFunction=A;k.UTF8ToString=z;k.stringToNewUTF8=ea;k.writeArrayToMemory=(a,b)=>{m.set(a,b)};
var ca,da,yb,Sc,qa,y,oa,Ia,Z,Tc={a:(a,b,c,d)=>Ja(`Assertion failed: ${z(a)}, at: `+[b?z(b):"unknown filename",c,d?z(d):"unknown function"]),i:function(a,b){try{return a=z(a),ka(a,b),0}catch(c){if("undefined"==typeof X||"ErrnoError"!==c.name)throw c;return-c.Pa}},L:function(a,b,c){try{b=z(b);b=Y(a,b);if(c&-8)return-28;var d=S(b,{hb:!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 X||"ErrnoError"!==e.name)throw e;return-e.Pa}},
j:function(a,b){try{var c=T(a);Vb(c,c.node,b,!1);return 0}catch(d){if("undefined"==typeof X||"ErrnoError"!==d.name)throw d;return-d.Pa}},h:function(a){try{var b=T(a);Ob(b,b.node,{timestamp:Date.now(),dc:!1});return 0}catch(c){if("undefined"==typeof X||"ErrnoError"!==c.name)throw c;return-c.Pa}},b:function(a,b,c){ic=c;try{var d=T(a);switch(b){case 0:var e=Ac();if(0>e)break;for(;Bb[e];)e++;return Nb(d,e).bb;case 1:case 2:return 0;case 3:return d.flags;case 4:return e=Ac(),d.flags|=e,0;case 12:return e=
Ac(),Ea[e+0>>1]=2,0;case 13:case 14:return 0}return-28}catch(g){if("undefined"==typeof X||"ErrnoError"!==g.name)throw g;return-g.Pa}},g:function(a,b){try{var c=T(a),d=c.node,e=c.Ma.Wa;a=e?c:d;e??=d.La.Wa;Lb(e);var g=e(a);return Zb(b,g)}catch(h){if("undefined"==typeof X||"ErrnoError"!==h.name)throw h;return-h.Pa}},H:function(a,b){b=-9007199254740992>b||9007199254740992<b?NaN:Number(b);try{if(isNaN(b))return-61;var c=T(a);if(0>b||0===(c.flags&2097155))throw new N(28);Wb(c,c.node,b);return 0}catch(d){if("undefined"==
typeof X||"ErrnoError"!==d.name)throw d;return-d.Pa}},G:function(a,b){try{if(0===b)return-28;var c=gb("/")+1;if(b<c)return-68;M("/",C,a,b);return c}catch(d){if("undefined"==typeof X||"ErrnoError"!==d.name)throw d;return-d.Pa}},K:function(a,b){try{return a=z(a),Zb(b,Ub(a,!0))}catch(c){if("undefined"==typeof X||"ErrnoError"!==c.name)throw c;return-c.Pa}},C:function(a,b,c){try{return b=z(b),b=Y(a,b),U(b,c),0}catch(d){if("undefined"==typeof X||"ErrnoError"!==d.name)throw d;return-d.Pa}},J:function(a,
b,c,d){try{b=z(b);var e=d&256;b=Y(a,b,d&4096);return Zb(c,e?Ub(b,!0):Ub(b))}catch(g){if("undefined"==typeof X||"ErrnoError"!==g.name)throw g;return-g.Pa}},x:function(a,b,c,d){ic=d;try{b=z(b);b=Y(a,b);var e=d?Ac():0;return la(b,c,e).bb}catch(g){if("undefined"==typeof X||"ErrnoError"!==g.name)throw g;return-g.Pa}},v:function(a,b,c,d){try{b=z(b);b=Y(a,b);if(0>=d)return-28;var e=S(b).node;if(!e)throw new N(44);if(!e.La.eb)throw new N(28);var g=e.La.eb(e);var h=Math.min(d,gb(g)),q=m[c+h];M(g,C,c,d+1);
m[c+h]=q;return h}catch(w){if("undefined"==typeof X||"ErrnoError"!==w.name)throw w;return-w.Pa}},u:function(a){try{return a=z(a),Tb(a),0}catch(b){if("undefined"==typeof X||"ErrnoError"!==b.name)throw b;return-b.Pa}},f:function(a,b){try{return a=z(a),Zb(b,Ub(a))}catch(c){if("undefined"==typeof X||"ErrnoError"!==c.name)throw c;return-c.Pa}},r:function(a,b,c){try{b=z(b);b=Y(a,b);if(c)if(512===c)Tb(b);else return-28;else ta(b);return 0}catch(d){if("undefined"==typeof X||"ErrnoError"!==d.name)throw d;
return-d.Pa}},q:function(a,b,c){try{b=z(b);b=Y(a,b,!0);var d=Date.now(),e,g;if(c){var h=F[c>>2]+4294967296*E[c+4>>2],q=E[c+8>>2];1073741823==q?e=d:1073741822==q?e=null:e=1E3*h+q/1E6;c+=16;h=F[c>>2]+4294967296*E[c+4>>2];q=E[c+8>>2];1073741823==q?g=d:1073741822==q?g=null:g=1E3*h+q/1E6}else g=e=d;if(null!==(g??e)){a=e;var w=S(b,{hb:!0}).node;Lb(w.La.Xa)(w,{$a:a,Ua:g})}return 0}catch(t){if("undefined"==typeof X||"ErrnoError"!==t.name)throw t;return-t.Pa}},m:()=>Ja(""),l:()=>{Va=!1;Cc=0},A:function(a,
b){a=-9007199254740992>a||9007199254740992<a?NaN:Number(a);a=new Date(1E3*a);E[b>>2]=a.getSeconds();E[b+4>>2]=a.getMinutes();E[b+8>>2]=a.getHours();E[b+12>>2]=a.getDate();E[b+16>>2]=a.getMonth();E[b+20>>2]=a.getFullYear()-1900;E[b+24>>2]=a.getDay();var c=a.getFullYear();E[b+28>>2]=(0!==c%4||0===c%100&&0!==c%400?Ec:Dc)[a.getMonth()]+a.getDate()-1|0;E[b+36>>2]=-(60*a.getTimezoneOffset());c=(new Date(a.getFullYear(),6,1)).getTimezoneOffset();var d=(new Date(a.getFullYear(),0,1)).getTimezoneOffset();
E[b+32>>2]=(c!=d&&a.getTimezoneOffset()==Math.min(d,c))|0},y:function(a,b,c,d,e,g,h){e=-9007199254740992>e||9007199254740992<e?NaN:Number(e);try{var q=T(d);if(0!==(b&2)&&0===(c&2)&&2!==(q.flags&2097155))throw new N(2);if(1===(q.flags&2097155))throw new N(2);if(!q.Ma.sb)throw new N(43);if(!a)throw new N(28);var w=q.Ma.sb(q,a,e,b,c);var t=w.tc;E[g>>2]=w.Ub;F[h>>2]=t;return 0}catch(x){if("undefined"==typeof X||"ErrnoError"!==x.name)throw x;return-x.Pa}},z:function(a,b,c,d,e,g){g=-9007199254740992>g||
9007199254740992<g?NaN:Number(g);try{var h=T(e);if(c&2){if(32768!==(h.node.mode&61440))throw new N(43);d&2||h.Ma.tb&&h.Ma.tb(h,C.slice(a,a+b),g,b,d)}}catch(q){if("undefined"==typeof X||"ErrnoError"!==q.name)throw q;return-q.Pa}},n:(a,b)=>{Fc[a]&&(clearTimeout(Fc[a].id),delete Fc[a]);if(!b)return 0;var c=setTimeout(()=>{delete Fc[a];Ic(()=>Sc(a,performance.now()))},b);Fc[a]={id:c,Hc: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();
F[a>>2]=60*Math.max(g,e);E[b>>2]=Number(g!=e);b=h=>{var q=Math.abs(h);return`UTC${0<=h?"-":"+"}${String(Math.floor(q/60)).padStart(2,"0")}${String(q%60).padStart(2,"0")}`};a=b(g);b=b(e);e<g?(M(a,C,c,17),M(b,C,d,17)):(M(a,C,d,17),M(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))-Ia.buffer.byteLength+
65535)/65536|0;try{Ia.grow(d);Ha();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 Lc()){var g=b+c;F[a+d>>2]=g;c+=M(e,C,g,Infinity)+1;d+=4}return 0},F:(a,b)=>{var c=Lc();F[a>>2]=c.length;a=0;for(var d of c)a+=gb(d)+1;F[b>>2]=a;return 0},e:function(a){try{var b=T(a);na(b);return 0}catch(c){if("undefined"==typeof X||"ErrnoError"!==c.name)throw c;return c.Pa}},p:function(a,b){try{var c=T(a);m[b]=c.Va?2:P(c.mode)?3:40960===(c.mode&61440)?7:4;Ea[b+2>>1]=0;G[b+
8>>3]=BigInt(0);G[b+16>>3]=BigInt(0);return 0}catch(d){if("undefined"==typeof X||"ErrnoError"!==d.name)throw d;return d.Pa}},w:function(a,b,c,d){try{a:{var e=T(a);a=b;for(var g,h=b=0;h<c;h++){var q=F[a>>2],w=F[a+4>>2];a+=8;var t=Yb(e,m,q,w,g);if(0>t){var x=-1;break a}b+=t;if(t<w)break;"undefined"!=typeof g&&(g+=t)}x=b}F[d>>2]=x;return 0}catch(D){if("undefined"==typeof X||"ErrnoError"!==D.name)throw D;return D.Pa}},D:function(a,b,c,d){b=-9007199254740992>b||9007199254740992<b?NaN:Number(b);try{if(isNaN(b))return 61;
var e=T(a);Xb(e,b,c);G[d>>3]=BigInt(e.position);e.Eb&&0===b&&0===c&&(e.Eb=null);return 0}catch(g){if("undefined"==typeof X||"ErrnoError"!==g.name)throw g;return g.Pa}},I:function(a){try{var b=T(a);return b.Ma?.lb?.(b)}catch(c){if("undefined"==typeof X||"ErrnoError"!==c.name)throw c;return c.Pa}},t:function(a,b,c,d){try{a:{var e=T(a);a=b;for(var g,h=b=0;h<c;h++){var q=F[a>>2],w=F[a+4>>2];a+=8;var t=ma(e,m,q,w,g);if(0>t){var x=-1;break a}b+=t;if(t<w)break;"undefined"!=typeof g&&(g+=t)}x=b}F[d>>2]=x;
return 0}catch(D){if("undefined"==typeof X||"ErrnoError"!==D.name)throw D;return D.Pa}},k:Hc};
function Uc(){function a(){k.calledRun=!0;if(!Ca){if(!k.noFSInit&&!Db){var b,c;Db=!0;b??=k.stdin;c??=k.stdout;d??=k.stderr;b?W("stdin",b):Sb("/dev/tty","/dev/stdin");c?W("stdout",null,c):Sb("/dev/tty","/dev/stdout");d?W("stderr",null,d):Sb("/dev/tty1","/dev/stderr");la("/dev/stdin",0);la("/dev/stdout",1);la("/dev/stderr",1)}Vc.N();Eb=!1;k.onRuntimeInitialized?.();if(k.postRun)for("function"==typeof k.postRun&&(k.postRun=[k.postRun]);k.postRun.length;){var d=k.postRun.shift();Ra.push(d)}Qa(Ra)}}if(0<
J)Ua=Uc;else{if(k.preRun)for("function"==typeof k.preRun&&(k.preRun=[k.preRun]);k.preRun.length;)Ta();Qa(Sa);0<J?Ua=Uc:k.setStatus?(k.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>k.setStatus(""),1);a()},1)):a()}}var Vc;
(async function(){function a(c){c=Vc=c.exports;k._sqlite3_free=c.P;k._sqlite3_value_text=c.Q;k._sqlite3_prepare_v2=c.R;k._sqlite3_step=c.S;k._sqlite3_reset=c.T;k._sqlite3_exec=c.U;k._sqlite3_finalize=c.V;k._sqlite3_column_name=c.W;k._sqlite3_column_text=c.X;k._sqlite3_column_type=c.Y;k._sqlite3_errmsg=c.Z;k._sqlite3_clear_bindings=c._;k._sqlite3_value_blob=c.$;k._sqlite3_value_bytes=c.aa;k._sqlite3_value_double=c.ba;k._sqlite3_value_int=c.ca;k._sqlite3_value_type=c.da;k._sqlite3_result_blob=c.ea;
k._sqlite3_result_double=c.fa;k._sqlite3_result_error=c.ga;k._sqlite3_result_int=c.ha;k._sqlite3_result_int64=c.ia;k._sqlite3_result_null=c.ja;k._sqlite3_result_text=c.ka;k._sqlite3_aggregate_context=c.la;k._sqlite3_column_count=c.ma;k._sqlite3_data_count=c.na;k._sqlite3_column_blob=c.oa;k._sqlite3_column_bytes=c.pa;k._sqlite3_column_double=c.qa;k._sqlite3_bind_blob=c.ra;k._sqlite3_bind_double=c.sa;k._sqlite3_bind_int=c.ta;k._sqlite3_bind_text=c.ua;k._sqlite3_bind_parameter_index=c.va;k._sqlite3_sql=
c.wa;k._sqlite3_normalized_sql=c.xa;k._sqlite3_changes=c.ya;k._sqlite3_close_v2=c.za;k._sqlite3_create_function_v2=c.Aa;k._sqlite3_update_hook=c.Ba;k._sqlite3_open=c.Ca;ca=k._malloc=c.Da;da=k._free=c.Ea;k._RegisterExtensionFunctions=c.Fa;yb=c.Ga;Sc=c.Ha;qa=c.Ia;y=c.Ja;oa=c.Ka;Ia=c.M;Z=c.O;Ha();J--;k.monitorRunDependencies?.(J);0==J&&Ua&&(c=Ua,Ua=null,c());return Vc}J++;k.monitorRunDependencies?.(J);var b={a:Tc};if(k.instantiateWasm)return new Promise(c=>{k.instantiateWasm(b,(d,e)=>{c(a(d,e))})});
La??=k.locateFile?k.locateFile("sql-wasm-browser.wasm",xa):xa+"sql-wasm-browser.wasm";return a((await Oa(b)).instance)})();Uc();


        // The shell-pre.js and emcc-generated code goes above
        return Module;
    }); // The end of the promise being returned

  return initSqlJsPromise;
} // The end of our initSqlJs function

// This bit below is copied almost exactly from what you get when you use the MODULARIZE=1 flag with emcc
// However, we don't want to use the emcc modularization. See shell-pre.js
if (typeof exports === 'object' && typeof module === 'object'){
    module.exports = initSqlJs;
    // This will allow the module to be used in ES6 or CommonJS
    module.exports.default = initSqlJs;
}
else if (typeof define === 'function' && define['amd']) {
    define([], function() { return initSqlJs; });
}
else if (typeof exports === 'object'){
    exports["Module"] = initSqlJs;
}
