]> BookStack Code Mirror - website/blob - themes/bookstack/static/libs/sql-wasm.js
Started playing with webidx based search
[website] / themes / bookstack / static / libs / sql-wasm.js
1
2 // sql.js 1.10.1
3 // Copyright (c) 2017 sql.js authors (see AUTHORS)
4 // https://github.com/sql-js/sql.js/blob/master/LICENSE
5 // https://github.com/sql-js/sql.js/blob/master/AUTHORS
6 // MIT license
7 // Fetched via cdnjs: https://cdnjs.cloudflare.com/ajax/libs/sql.js/1.10.1/sql-wasm.min.js
8 var initSqlJsPromise=void 0,initSqlJs=function(Dt){return initSqlJsPromise=initSqlJsPromise||new Promise(function(A,I){var B,S,x,O,G,R,a,e=void 0!==Dt?Dt:{},H=e.onAbort,t=(e.onAbort=function(e){I(new Error(e)),H&&H(e)},e.postRun=e.postRun||[],e.postRun.push(function(){A(e)}),module=void 0,(B||=void 0!==e?e:{}).onRuntimeInitialized=function(){function u(e,t){switch(typeof t){case"boolean":C(e,t?1:0);break;case"number":W(e,t);break;case"string":J(e,t,-1,-1);break;case"object":var r;null===t?R(e):null!=t.length?(r=Mt(t,kt),K(e,r,t.length,-1),Ht(r)):H(e,"Wrong API use : tried to return a value of an unknown type ("+t+").",-1);break;default:R(e)}}function l(e,t){for(var r=[],n=0;n<e;n+=1){var i=Y(t+4*n,"i32");if(1===(a=D(i))||2===a)i=F(i);else if(3===a)i=U(i);else if(4===a){for(var i=P(a=i),a=z(a),o=new Uint8Array(i),s=0;s<i;s+=1)o[s]=Q[a+s];i=o}else i=null;r.push(i)}return r}function f(e,t){this.La=e,this.db=t,this.Ja=1,this.fb=[]}function t(e,t){if(this.db=t,t=$(e)+1,this.Ya=Rt(t),null===this.Ya)throw Error("Unable to allocate memory for the SQL string");Z(e,V,this.Ya,t),this.eb=this.Ya,this.Ua=this.ib=null}function e(e){if(this.filename="dbfile_"+(4294967295*Math.random()>>>0),null!=e){var t=this.filename,r=t;if((n="/")&&(n="string"==typeof n?n:He(n),r=t?X(n+"/"+t):n),r=Ke(r,4095&(void 0!==(t=Ae(!0,!0))?t:438)|32768,0),e){if("string"==typeof e){for(var n=Array(e.length),i=0,a=e.length;i<a;++i)n[i]=e.charCodeAt(i);e=n}Ze(r,146|t),it(n=ee(r,577),e,0,e.length,0),tt(n),Ze(r,t)}}this.handleError(o(this.filename,h)),this.db=Y(h,"i32"),N(this.db),this.Za={},this.Na={}}var h=re(4),r=B.cwrap,o=r("sqlite3_open","number",["string","number"]),n=r("sqlite3_close_v2","number",["number"]),i=r("sqlite3_exec","number",["number","string","number","number","number"]),a=r("sqlite3_changes","number",["number"]),s=r("sqlite3_prepare_v2","number",["number","string","number","number","number"]),c=r("sqlite3_sql","string",["number"]),d=r("sqlite3_normalized_sql","string",["number"]),b=r("sqlite3_prepare_v2","number",["number","number","number","number","number"]),m=r("sqlite3_bind_text","number",["number","number","number","number","number"]),p=r("sqlite3_bind_blob","number",["number","number","number","number","number"]),w=r("sqlite3_bind_double","number",["number","number","number"]),_=r("sqlite3_bind_int","number",["number","number","number"]),v=r("sqlite3_bind_parameter_index","number",["number","string"]),y=r("sqlite3_step","number",["number"]),g=r("sqlite3_errmsg","string",["number"]),q=r("sqlite3_column_count","number",["number"]),E=r("sqlite3_data_count","number",["number"]),k=r("sqlite3_column_double","number",["number","number"]),M=r("sqlite3_column_text","string",["number","number"]),A=r("sqlite3_column_blob","number",["number","number"]),I=r("sqlite3_column_bytes","number",["number","number"]),S=r("sqlite3_column_type","number",["number","number"]),x=r("sqlite3_column_name","string",["number","number"]),O=r("sqlite3_reset","number",["number"]),j=r("sqlite3_clear_bindings","number",["number"]),T=r("sqlite3_finalize","number",["number"]),G=r("sqlite3_create_function_v2","number","number string number number number number number number number".split(" ")),D=r("sqlite3_value_type","number",["number"]),P=r("sqlite3_value_bytes","number",["number"]),U=r("sqlite3_value_text","string",["number"]),z=r("sqlite3_value_blob","number",["number"]),F=r("sqlite3_value_double","number",["number"]),W=r("sqlite3_result_double","",["number","number"]),R=r("sqlite3_result_null","",["number"]),J=r("sqlite3_result_text","",["number","string","number","number"]),K=r("sqlite3_result_blob","",["number","number","number","number"]),C=r("sqlite3_result_int","",["number","number"]),H=r("sqlite3_result_error","",["number","string","number"]),L=r("sqlite3_aggregate_context","number",["number","number"]),N=r("RegisterExtensionFunctions","number",["number"]);f.prototype.bind=function(e){if(this.La)return this.reset(),Array.isArray(e)?this.wb(e):null==e||"object"!=typeof e||this.xb(e);throw"Statement closed"},f.prototype.step=function(){if(!this.La)throw"Statement closed";this.Ja=1;var e=y(this.La);switch(e){case 100:return!0;case 101:return!1;default:throw this.db.handleError(e)}},f.prototype.rb=function(e){return null==e&&(e=this.Ja,this.Ja+=1),k(this.La,e)},f.prototype.Ab=function(e){if(null==e&&(e=this.Ja,this.Ja+=1),e=M(this.La,e),"function"!=typeof BigInt)throw Error("BigInt is not supported");return BigInt(e)},f.prototype.Bb=function(e){return null==e&&(e=this.Ja,this.Ja+=1),M(this.La,e)},f.prototype.getBlob=function(e){null==e&&(e=this.Ja,this.Ja+=1);var t=I(this.La,e);e=A(this.La,e);for(var r=new Uint8Array(t),n=0;n<t;n+=1)r[n]=Q[e+n];return r},f.prototype.get=function(e,t){t=t||{},null!=e&&this.bind(e)&&this.step(),e=[];for(var r=E(this.La),n=0;n<r;n+=1)switch(S(this.La,n)){case 1:var i=t.useBigInt?this.Ab(n):this.rb(n);e.push(i);break;case 2:e.push(this.rb(n));break;case 3:e.push(this.Bb(n));break;case 4:e.push(this.getBlob(n));break;default:e.push(null)}return e},f.prototype.getColumnNames=function(){for(var e=[],t=q(this.La),r=0;r<t;r+=1)e.push(x(this.La,r));return e},f.prototype.getAsObject=function(e,t){e=this.get(e,t),t=this.getColumnNames();for(var r={},n=0;n<t.length;n+=1)r[t[n]]=e[n];return r},f.prototype.getSQL=function(){return c(this.La)},f.prototype.getNormalizedSQL=function(){return d(this.La)},f.prototype.run=function(e){return null!=e&&this.bind(e),this.step(),this.reset()},f.prototype.nb=function(e,t){null==t&&(t=this.Ja,this.Ja+=1),e=ge(e);var r=Mt(e,kt);this.fb.push(r),this.db.handleError(m(this.La,t,r,e.length-1,0))},f.prototype.vb=function(e,t){null==t&&(t=this.Ja,this.Ja+=1);var r=Mt(e,kt);this.fb.push(r),this.db.handleError(p(this.La,t,r,e.length,0))},f.prototype.mb=function(e,t){null==t&&(t=this.Ja,this.Ja+=1),this.db.handleError((e===(0|e)?_:w)(this.La,t,e))},f.prototype.yb=function(e){null==e&&(e=this.Ja,this.Ja+=1),p(this.La,e,0,0,0)},f.prototype.ob=function(e,t){switch(null==t&&(t=this.Ja,this.Ja+=1),typeof e){case"string":return void this.nb(e,t);case"number":return void this.mb(e,t);case"bigint":return void this.nb(e.toString(),t);case"boolean":return void this.mb(e+0,t);case"object":if(null===e)return void this.yb(t);if(null!=e.length)return void this.vb(e,t)}throw"Wrong API use : tried to bind a value of an unknown type ("+e+")."},f.prototype.xb=function(r){var n=this;return Object.keys(r).forEach(function(e){var t=v(n.La,e);0!==t&&n.ob(r[e],t)}),!0},f.prototype.wb=function(e){for(var t=0;t<e.length;t+=1)this.ob(e[t],t+1);return!0},f.prototype.reset=function(){return this.freemem(),0===j(this.La)&&0===O(this.La)},f.prototype.freemem=function(){for(var e;void 0!==(e=this.fb.pop());)Ht(e)},f.prototype.free=function(){this.freemem();var e=0===T(this.La);return delete this.db.Za[this.La],this.La=0,e},t.prototype.next=function(){if(null===this.Ya)return{done:!0};if(null!==this.Ua&&(this.Ua.free(),this.Ua=null),!this.db.db)throw this.gb(),Error("Database closed");var e=Nt(),t=re(4);ce(h),ce(t);try{this.db.handleError(b(this.db.db,this.eb,-1,h,t)),this.eb=Y(t,"i32");var r=Y(h,"i32");return 0===r?(this.gb(),{done:!0}):(this.Ua=new f(r,this.db),this.db.Za[r]=this.Ua,{value:this.Ua,done:!1})}catch(e){throw this.ib=be(this.eb),this.gb(),e}finally{jt(e)}},t.prototype.gb=function(){Ht(this.Ya),this.Ya=null},t.prototype.getRemainingSQL=function(){return null!==this.ib?this.ib:be(this.eb)},"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator&&(t.prototype[Symbol.iterator]=function(){return this}),e.prototype.run=function(e,t){if(!this.db)throw"Database closed";if(t){e=this.prepare(e,t);try{e.step()}finally{e.free()}}else this.handleError(i(this.db,e,0,0,h));return this},e.prototype.exec=function(e,t,r){if(!this.db)throw"Database closed";var n=Nt(),i=null;try{var a=Et(e),o=re(4);for(e=[];0!==Y(a,"i8");){ce(h),ce(o),this.handleError(b(this.db,a,-1,h,o));var s=Y(h,"i32"),a=Y(o,"i32");if(0!==s){var u=null,i=new f(s,this);for(null!=t&&i.bind(t);i.step();)null===u&&(u={columns:i.getColumnNames(),values:[]},e.push(u)),u.values.push(i.get(null,r));i.free()}}return e}catch(e){throw i&&i.free(),e}finally{jt(n)}},e.prototype.each=function(e,t,r,n,i){"function"==typeof t&&(n=r,r=t,t=void 0),e=this.prepare(e,t);try{for(;e.step();)r(e.getAsObject(null,i))}finally{e.free()}if("function"==typeof n)return n()},e.prototype.prepare=function(e,t){if(ce(h),this.handleError(s(this.db,e,-1,h,0)),0===(e=Y(h,"i32")))throw"Nothing to prepare";var r=new f(e,this);return null!=t&&r.bind(t),this.Za[e]=r},e.prototype.iterateStatements=function(e){return new t(e,this)},e.prototype.export=function(){Object.values(this.Za).forEach(function(e){e.free()}),Object.values(this.Na).forEach(te),this.Na={},this.handleError(n(this.db));e=this.filename,t=ee(e,0),e=Xe(e).size,r=new Uint8Array(e),nt(t,r,0,e,0),e=r,tt(t);var e,t,r=e;return this.handleError(o(this.filename,h)),this.db=Y(h,"i32"),N(this.db),r},e.prototype.close=function(){null!==this.db&&(Object.values(this.Za).forEach(function(e){e.free()}),Object.values(this.Na).forEach(te),this.Na={},this.handleError(n(this.db)),Ve("/"+this.filename),this.db=null)},e.prototype.handleError=function(e){if(0===e)return null;throw e=g(this.db),Error(e)},e.prototype.getRowsModified=function(){return a(this.db)},e.prototype.create_function=function(e,i){Object.prototype.hasOwnProperty.call(this.Na,e)&&(te(this.Na[e]),delete this.Na[e]);var t=It(function(t,e,r){e=l(e,r);try{var n=i.apply(null,e)}catch(e){return void H(t,e,-1)}u(t,n)},"viii");return this.Na[e]=t,this.handleError(G(this.db,e,i.length,1,0,t,0,0,0)),this},e.prototype.create_aggregate=function(e,t){var i=t.init||function(){return null},n=t.finalize||function(e){return e},a=t.step;if(!a)throw"An aggregate function must have a step function in "+e;var o={},r=(Object.hasOwnProperty.call(this.Na,e)&&(te(this.Na[e]),delete this.Na[e]),t=e+"__finalize",Object.hasOwnProperty.call(this.Na,t)&&(te(this.Na[t]),delete this.Na[t]),It(function(t,e,r){var n=L(t,1);Object.hasOwnProperty.call(o,n)||(o[n]=i()),e=l(e,r),e=[o[n]].concat(e);try{o[n]=a.apply(null,e)}catch(e){delete o[n],H(t,e,-1)}},"viii")),s=It(function(t){var r=L(t,1);try{var e=n(o[r])}catch(e){return delete o[r],void H(t,e,-1)}u(t,e),delete o[r]},"vi");return this.Na[e]=r,this.Na[t]=s,this.handleError(G(this.db,e,a.length-1,1,0,0,r,s,0)),this},B.Database=e},Object.assign({},B)),L="./this.program",N="object"==typeof window,j="function"==typeof importScripts,T="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node,r="",D=(T?(S=require("fs"),x=require("path"),r=j?x.dirname(r)+"/":__dirname+"/",O=(e,t)=>(e=ue(e)?new URL(e):x.normalize(e),S.readFileSync(e,t?void 0:"utf8")),G=e=>e=(e=O(e,!0)).buffer?e:new Uint8Array(e),R=(e,r,n,i=!0)=>{e=ue(e)?new URL(e):x.normalize(e),S.readFile(e,i?void 0:"utf8",(e,t)=>{e?n(e):r(i?t.buffer:t)})},!B.thisProgram&&1<process.argv.length&&(L=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2),"undefined"!=typeof module&&(module.exports=B),B.inspect=()=>"[Emscripten Module object]"):(N||j)&&(j?r=self.location.href:"undefined"!=typeof document&&document.currentScript&&(r=document.currentScript.src),r=0!==r.indexOf("blob:")?r.substr(0,r.replace(/[?#].*/,"").lastIndexOf("/")+1):"",O=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},j&&(G=e=>{var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),R=(e,t,r)=>{var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=()=>{200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)}),B.print||console.log.bind(console)),o=B.printErr||console.error.bind(console);Object.assign(B,t),B.thisProgram&&(L=B.thisProgram),B.wasmBinary&&(a=B.wasmBinary),"object"!=typeof WebAssembly&&i("no native wasm support detected");var P,Q,V,U,h,c,z,F,W=!1;function J(){var e=P.buffer;B.HEAP8=Q=new Int8Array(e),B.HEAP16=U=new Int16Array(e),B.HEAPU8=V=new Uint8Array(e),B.HEAPU16=new Uint16Array(e),B.HEAP32=h=new Int32Array(e),B.HEAPU32=c=new Uint32Array(e),B.HEAPF32=z=new Float32Array(e),B.HEAPF64=F=new Float64Array(e)}var K=[],C=[],ne=[];var s=0,ie=null,ae=null;function i(e){throw B.onAbort?.(e),o(e="Aborted("+e+")"),W=!0,new WebAssembly.RuntimeError(e+". Build with -sASSERTIONS for more info.")}var oe,se=e=>e.startsWith("data:application/octet-stream;base64,"),ue=e=>e.startsWith("file://");function le(e){if(e==oe&&a)return new Uint8Array(a);if(G)return G(e);throw"both async and sync fetching of the wasm failed"}function fe(e,t,r){return function(r){if(!a&&(N||j)){if("function"==typeof fetch&&!ue(r))return fetch(r,{credentials:"same-origin"}).then(e=>{if(e.ok)return e.arrayBuffer();throw"failed to load wasm binary file at '"+r+"'"}).catch(()=>le(r));if(R)return new Promise((t,e)=>{R(r,e=>t(new Uint8Array(e)),e)})}return Promise.resolve().then(()=>le(r))}(e).then(e=>WebAssembly.instantiate(e,t)).then(e=>e).then(r,e=>{o("failed to asynchronously prepare wasm: "+e),i(e)})}se(oe="sql-wasm.wasm")||(t=oe,oe=B.locateFile?B.locateFile(t,r):r+t);var u,l,he=e=>{for(;0<e.length;)e.shift()(B)};function Y(e,t="i8"){switch(t=t.endsWith("*")?"*":t){case"i1":case"i8":return Q[e>>0];case"i16":return U[e>>1];case"i32":return h[e>>2];case"i64":i("to do getValue(i64) use WASM_BIGINT");case"float":return z[e>>2];case"double":return F[e>>3];case"*":return c[e>>2];default:i("invalid type for getValue: "+t)}}function ce(e){var t="i32";switch(t=t.endsWith("*")?"*":t){case"i1":case"i8":Q[e>>0]=0;break;case"i16":U[e>>1]=0;break;case"i32":h[e>>2]=0;break;case"i64":i("to do setValue(i64) use WASM_BIGINT");case"float":z[e>>2]=0;break;case"double":F[e>>3]=0;break;case"*":c[e>>2]=0;break;default:i("invalid type for setValue: "+t)}}var de="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0,d=(e,t,r)=>{var n=t+r;for(r=t;e[r]&&!(n<=r);)++r;if(16<r-t&&e.buffer&&de)return de.decode(e.subarray(t,r));for(n="";t<r;){var i,a,o=e[t++];128&o?(i=63&e[t++],192==(224&o)?n+=String.fromCharCode((31&o)<<6|i):(a=63&e[t++],(o=224==(240&o)?(15&o)<<12|i<<6|a:(7&o)<<18|i<<12|a<<6|63&e[t++])<65536?n+=String.fromCharCode(o):(o-=65536,n+=String.fromCharCode(55296|o>>10,56320|1023&o)))):n+=String.fromCharCode(o)}return n},be=(e,t)=>e?d(V,e,t):"",me=(e,t)=>{for(var r=0,n=e.length-1;0<=n;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},X=e=>{var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=(e=me(e.split("/").filter(e=>!!e),!t).join("/"))||t?e:".")&&r&&(e+="/"),(t?"/":"")+e},pe=e=>{var t=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1);return e=t[0],t=t[1],e||t?e+(t&&=t.substr(0,t.length-1)):"."},we=e=>{if("/"===e)return"/";var t=(e=(e=X(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},_e=e=>(_e=(()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return e=>crypto.getRandomValues(e);if(T)try{var t=require("crypto");if(t.randomFillSync)return e=>t.randomFillSync(e);var r=t.randomBytes;return e=>(e.set(r(e.byteLength)),e)}catch(e){}i("initRandomDevice")})())(e);function ve(){for(var e="",t=!1,r=arguments.length-1;-1<=r&&!t;r--){if("string"!=typeof(t=0<=r?arguments[r]:"/"))throw new TypeError("Arguments to path.resolve must be strings");if(!t)return"";e=t+"/"+e,t="/"===t.charAt(0)}return(t?"/":"")+(e=me(e.split("/").filter(e=>!!e),!t).join("/"))||"."}var ye=[],$=e=>{for(var t=0,r=0;r<e.length;++r){var n=e.charCodeAt(r);n<=127?t++:n<=2047?t+=2:55296<=n&&n<=57343?(t+=4,++r):t+=3}return t},Z=(e,t,r,n)=>{if(!(0<n))return 0;var i=r;n=r+n-1;for(var a=0;a<e.length;++a){var o=e.charCodeAt(a);if((o=55296<=o&&o<=57343?65536+((1023&o)<<10)|1023&e.charCodeAt(++a):o)<=127){if(n<=r)break;t[r++]=o}else{if(o<=2047){if(n<=r+1)break;t[r++]=192|o>>6}else{if(o<=65535){if(n<=r+2)break;t[r++]=224|o>>12}else{if(n<=r+3)break;t[r++]=240|o>>18,t[r++]=128|o>>12&63}t[r++]=128|o>>6&63}t[r++]=128|63&o}}return t[r]=0,r-i};function ge(e,t){var r=Array($(e)+1);return e=Z(e,r,0,r.length),t&&(r.length=e),r}var qe=[];function Ee(e,t){qe[e]={input:[],output:[],Xa:t},We(e,ke)}var ke={open(e){var t=qe[e.node.rdev];if(!t)throw new m(43);e.tty=t,e.seekable=!1},close(e){e.tty.Xa.fsync(e.tty)},fsync(e){e.tty.Xa.fsync(e.tty)},read(e,t,r,n){if(!e.tty||!e.tty.Xa.sb)throw new m(60);for(var i=0,a=0;a<n;a++){try{var o=e.tty.Xa.sb(e.tty)}catch(e){throw new m(29)}if(void 0===o&&0===i)throw new m(6);if(null==o)break;i++,t[r+a]=o}return i&&(e.node.timestamp=Date.now()),i},write(e,t,r,n){if(!e.tty||!e.tty.Xa.jb)throw new m(60);try{for(var i=0;i<n;i++)e.tty.Xa.jb(e.tty,t[r+i])}catch(e){throw new m(29)}return n&&(e.node.timestamp=Date.now()),i}},r={sb(){e:{if(!ye.length){var e=null;if(T){var t=Buffer.alloc(256),r=0,n=process.stdin.fd;try{r=S.readSync(n,t)}catch(e){if(!e.toString().includes("EOF"))throw e;r=0}e=0<r?t.slice(0,r).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(e=window.prompt("Input: "))&&(e+="\n"):"function"==typeof readline&&(null!==(e=readline())&&(e+="\n"));if(!e){e=null;break e}ye=ge(e,!0)}e=ye.shift()}return e},jb(e,t){null===t||10===t?(D(d(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&0<e.output.length&&(D(d(e.output,0)),e.output=[])},Mb(){return{Ib:25856,Kb:5,Hb:191,Jb:35387,Gb:[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]}},Nb(){return 0},Ob(){return[24,80]}},t={jb(e,t){null===t||10===t?(o(d(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},fsync(e){e.output&&0<e.output.length&&(o(d(e.output,0)),e.output=[])}};function Me(e,t){var r=e.Ia?e.Ia.length:0;t<=r||(t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256)),r=e.Ia,e.Ia=new Uint8Array(t),0<e.Ma&&e.Ia.set(r.subarray(0,e.Ma),0))}var f={Qa:null,Ra(){return f.createNode(null,"/",16895,0)},createNode(e,t,r,n){if(24576==(61440&r)||4096==(61440&r))throw new m(63);return f.Qa||(f.Qa={dir:{node:{Pa:f.Ga.Pa,Oa:f.Ga.Oa,lookup:f.Ga.lookup,ab:f.Ga.ab,rename:f.Ga.rename,unlink:f.Ga.unlink,rmdir:f.Ga.rmdir,readdir:f.Ga.readdir,symlink:f.Ga.symlink},stream:{Ta:f.Ha.Ta}},file:{node:{Pa:f.Ga.Pa,Oa:f.Ga.Oa},stream:{Ta:f.Ha.Ta,read:f.Ha.read,write:f.Ha.write,lb:f.Ha.lb,bb:f.Ha.bb,cb:f.Ha.cb}},link:{node:{Pa:f.Ga.Pa,Oa:f.Ga.Oa,readlink:f.Ga.readlink},stream:{}},pb:{node:{Pa:f.Ga.Pa,Oa:f.Ga.Oa},stream:Fe}}),_((r=je(e,t,r,n)).mode)?(r.Ga=f.Qa.dir.node,r.Ha=f.Qa.dir.stream,r.Ia={}):32768==(61440&r.mode)?(r.Ga=f.Qa.file.node,r.Ha=f.Qa.file.stream,r.Ma=0,r.Ia=null):40960==(61440&r.mode)?(r.Ga=f.Qa.link.node,r.Ha=f.Qa.link.stream):8192==(61440&r.mode)&&(r.Ga=f.Qa.pb.node,r.Ha=f.Qa.pb.stream),r.timestamp=Date.now(),e&&(e.Ia[t]=r,e.timestamp=r.timestamp),r},Lb(e){return e.Ia?e.Ia.subarray?e.Ia.subarray(0,e.Ma):new Uint8Array(e.Ia):new Uint8Array(0)},Ga:{Pa(e){var t={};return t.dev=8192==(61440&e.mode)?e.id:1,t.ino=e.id,t.mode=e.mode,t.nlink=1,t.uid=0,t.gid=0,t.rdev=e.rdev,_(e.mode)?t.size=4096:32768==(61440&e.mode)?t.size=e.Ma:40960==(61440&e.mode)?t.size=e.link.length:t.size=0,t.atime=new Date(e.timestamp),t.mtime=new Date(e.timestamp),t.ctime=new Date(e.timestamp),t.zb=4096,t.blocks=Math.ceil(t.size/t.zb),t},Oa(e,t){var r;void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&(t=t.size,e.Ma!=t)&&(0==t?(e.Ia=null,e.Ma=0):(r=e.Ia,e.Ia=new Uint8Array(t),r&&e.Ia.set(r.subarray(0,Math.min(t,e.Ma))),e.Ma=t))},lookup(){throw Re[44]},ab(e,t,r,n){return f.createNode(e,t,r,n)},rename(e,t,r){if(_(e.mode)){try{var n=w(t,r)}catch(e){}if(n)for(var i in n.Ia)throw new m(55)}delete e.parent.Ia[e.name],e.parent.timestamp=Date.now(),e.name=r,t.Ia[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink(e,t){delete e.Ia[t],e.timestamp=Date.now()},rmdir(e,t){for(var r in w(e,t).Ia)throw new m(55);delete e.Ia[t],e.timestamp=Date.now()},readdir(e){var t,r=[".",".."];for(t of Object.keys(e.Ia))r.push(t);return r},symlink(e,t,r){return(e=f.createNode(e,t,41471,0)).link=r,e},readlink(e){if(40960!=(61440&e.mode))throw new m(28);return e.link}},Ha:{read(e,t,r,n,i){var a=e.node.Ia;if(i>=e.node.Ma)return 0;if(8<(e=Math.min(e.node.Ma-i,n))&&a.subarray)t.set(a.subarray(i,i+e),r);else for(n=0;n<e;n++)t[r+n]=a[i+n];return e},write(e,t,r,n,i,a){if(t.buffer===Q.buffer&&(a=!1),!n)return 0;if((e=e.node).timestamp=Date.now(),t.subarray&&(!e.Ia||e.Ia.subarray)){if(a)return e.Ia=t.subarray(r,r+n),e.Ma=n;if(0===e.Ma&&0===i)return e.Ia=t.slice(r,r+n),e.Ma=n;if(i+n<=e.Ma)return e.Ia.set(t.subarray(r,r+n),i),n}if(Me(e,i+n),e.Ia.subarray&&t.subarray)e.Ia.set(t.subarray(r,r+n),i);else for(a=0;a<n;a++)e.Ia[i+a]=t[r+a];return e.Ma=Math.max(e.Ma,i+n),n},Ta(e,t,r){if(1===r?t+=e.position:2===r&&32768==(61440&e.node.mode)&&(t+=e.node.Ma),t<0)throw new m(28);return t},lb(e,t,r){Me(e.node,t+r),e.node.Ma=Math.max(e.node.Ma,t+r)},bb(e,t,r,n,i){if(32768!=(61440&e.node.mode))throw new m(43);if(e=e.node.Ia,2&i||e.buffer!==Q.buffer){if((0<r||r+t<e.length)&&(e=e.subarray?e.subarray(r,r+t):Array.prototype.slice.call(e,r,r+t)),r=!0,t=65536*Math.ceil(t/65536),!(t=(i=Lt(65536,t))?(V.fill(0,i,i+t),i):0))throw new m(48);Q.set(e,t)}else r=!1,t=e.byteOffset;return{Db:t,ub:r}},cb(e,t,r,n){return f.Ha.write(e,t,0,n,r,!1),0}}},Ae=(e,t)=>{var r=0;return e&&(r|=365),t&&(r|=146),r},Ie=null,Se={},xe=[],Oe=1,b=null,Ge=!0,m=null,Re={};function p(e,t={}){if(!(e=ve(e)))return{path:"",node:null};if(8<(t=Object.assign({qb:!0,kb:0},t)).kb)throw new m(32);e=e.split("/").filter(e=>!!e);for(var r=Ie,n="/",i=0;i<e.length;i++){var a=i===e.length-1;if(a&&t.parent)break;if(r=w(r,e[i]),n=X(n+"/"+e[i]),!r.Va||a&&!t.qb||(r=r.Va.root),!a||t.Sa)for(a=0;40960==(61440&r.mode);)if(r=Ye(n),r=p(n=ve(pe(n),r),{kb:t.kb+1}).node,40<a++)throw new m(32)}return{path:n,node:r}}function He(e){for(var t;;){if(e===e.parent)return e=e.Ra.tb,t?"/"!==e[e.length-1]?e+"/"+t:e+t:e;t=t?e.name+"/"+t:e.name,e=e.parent}}function Le(e,t){for(var r=0,n=0;n<t.length;n++)r=(r<<5)-r+t.charCodeAt(n)|0;return(e+r>>>0)%b.length}function Ne(e){var t=Le(e.parent.id,e.name);if(b[t]===e)b[t]=e.Wa;else for(t=b[t];t;){if(t.Wa===e){t.Wa=e.Wa;break}t=t.Wa}}function w(e,t){var r;if(r=(r=v(e,"x"))?r:e.Ga.lookup?0:2)throw new m(r,e);for(r=b[Le(e.id,t)];r;r=r.Wa){var n=r.name;if(r.parent.id===e.id&&n===t)return r}return e.Ga.lookup(e,t)}function je(e,t,r,n){return t=Le((e=new St(e,t,r,n)).parent.id,e.name),e.Wa=b[t],b[t]=e}function _(e){return 16384==(61440&e)}function Te(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t}function v(e,t){return!Ge&&(t.includes("r")&&!(292&e.mode)||t.includes("w")&&!(146&e.mode)||t.includes("x")&&!(73&e.mode))?2:0}function De(e,t){try{return w(e,t),20}catch(e){}return v(e,"wx")}function Pe(e,t,r){try{var n=w(e,t)}catch(e){return e.Ka}if(e=v(e,"wx"))return e;if(r){if(!_(n.mode))return 54;if(n===n.parent||"/"===He(n))return 10}else if(_(n.mode))return 31;return 0}function y(e){if(e=xe[e])return e;throw new m(8)}function Ue(e,t=-1){return ut||((ut=function(){this.$a={}}).prototype={},Object.defineProperties(ut.prototype,{object:{get(){return this.node},set(e){this.node=e}},flags:{get(){return this.$a.flags},set(e){this.$a.flags=e}},position:{get(){return this.$a.position},set(e){this.$a.position=e}}})),e=Object.assign(new ut,e),-1==t&&(t=function(){for(var e=0;e<=4096;e++)if(!xe[e])return e;throw new m(33)}()),e.fd=t,xe[t]=e}var ze,Fe={open(e){e.Ha=Se[e.node.rdev].Ha,e.Ha.open?.(e)},Ta(){throw new m(70)}};function We(e,t){Se[e]={Ha:t}}function Je(e,t){var r="/"===t,n=!t;if(r&&Ie)throw new m(10);if(!r&&!n){var i=p(t,{qb:!1});if(t=i.path,(i=i.node).Va)throw new m(10);if(!_(i.mode))throw new m(54)}((e=e.Ra(t={type:e,Pb:{},tb:t,Cb:[]})).Ra=t).root=e,r?Ie=e:i&&(i.Va=t,i.Ra&&i.Ra.Cb.push(t))}function Ke(e,t,r){var n=p(e,{parent:!0}).node;if(!(e=we(e))||"."===e||".."===e)throw new m(28);var i=De(n,e);if(i)throw new m(i);if(n.Ga.ab)return n.Ga.ab(n,e,t,r);throw new m(63)}function n(e,t){return Ke(e,1023&(void 0!==t?t:511)|16384,0)}function Ce(e,t,r){void 0===r&&(r=t,t=438),Ke(e,8192|t,r)}function Be(e,t){if(!ve(e))throw new m(44);var r=p(t,{parent:!0}).node;if(!r)throw new m(44);var n=De(r,t=we(t));if(n)throw new m(n);if(!r.Ga.symlink)throw new m(63);r.Ga.symlink(r,t,e)}function Qe(e){var t=p(e,{parent:!0}).node,r=w(t,e=we(e)),n=Pe(t,e,!0);if(n)throw new m(n);if(!t.Ga.rmdir)throw new m(63);if(r.Va)throw new m(10);t.Ga.rmdir(t,e),Ne(r)}function Ve(e){var t=p(e,{parent:!0}).node;if(!t)throw new m(44);var r=w(t,e=we(e)),n=Pe(t,e,!1);if(n)throw new m(n);if(!t.Ga.unlink)throw new m(63);if(r.Va)throw new m(10);t.Ga.unlink(t,e),Ne(r)}function Ye(e){if(!(e=p(e).node))throw new m(44);if(e.Ga.readlink)return ve(He(e.parent),e.Ga.readlink(e));throw new m(28)}function Xe(e,t){if(!(e=p(e,{Sa:!t}).node))throw new m(44);if(e.Ga.Pa)return e.Ga.Pa(e);throw new m(63)}function $e(e){return Xe(e,!0)}function Ze(e,t){if(!(e="string"==typeof e?p(e,{Sa:!0}).node:e).Ga.Oa)throw new m(63);e.Ga.Oa(e,{mode:4095&t|-4096&e.mode,timestamp:Date.now()})}function et(e,t){if(t<0)throw new m(28);if(!(e="string"==typeof e?p(e,{Sa:!0}).node:e).Ga.Oa)throw new m(63);if(_(e.mode))throw new m(31);if(32768!=(61440&e.mode))throw new m(28);var r=v(e,"w");if(r)throw new m(r);e.Ga.Oa(e,{size:t,timestamp:Date.now()})}function ee(e,t,r){if(""===e)throw new m(44);if("string"==typeof t){var n={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090}[t];if(void 0===n)throw Error("Unknown file open mode: "+t);t=n}if(r=64&t?4095&(void 0===r?438:r)|32768:0,"object"==typeof e)var i=e;else{e=X(e);try{i=p(e,{Sa:!(131072&t)}).node}catch(e){}}if(n=!1,64&t)if(i){if(128&t)throw new m(20)}else i=Ke(e,r,0),n=!0;if(!i)throw new m(44);if(8192==(61440&i.mode)&&(t&=-513),65536&t&&!_(i.mode))throw new m(54);if(!n&&(r=i?40960==(61440&i.mode)?32:_(i.mode)&&("r"!==Te(t)||512&t)?31:v(i,Te(t)):44))throw new m(r);return 512&t&&!n&&et(i,0),t&=-131713,(i=Ue({node:i,path:He(i),flags:t,seekable:!0,position:0,Ha:i.Ha,Fb:[],error:!1})).Ha.open&&i.Ha.open(i),!B.logReadFiles||1&t||(e in(lt||={})||(lt[e]=1)),i}function tt(e){if(null===e.fd)throw new m(8);e.hb&&(e.hb=null);try{e.Ha.close&&e.Ha.close(e)}catch(e){throw e}finally{xe[e.fd]=null}e.fd=null}function rt(e,t,r){if(null===e.fd)throw new m(8);if(!e.seekable||!e.Ha.Ta)throw new m(70);if(0!=r&&1!=r&&2!=r)throw new m(28);e.position=e.Ha.Ta(e,t,r),e.Fb=[]}function nt(e,t,r,n,i){if(n<0||i<0)throw new m(28);if(null===e.fd)throw new m(8);if(1==(2097155&e.flags))throw new m(8);if(_(e.node.mode))throw new m(31);if(!e.Ha.read)throw new m(28);var a=void 0!==i;if(a){if(!e.seekable)throw new m(70)}else i=e.position;return t=e.Ha.read(e,t,r,n,i),a||(e.position+=t),t}function it(e,t,r,n,i){if(n<0||i<0)throw new m(28);if(null===e.fd)throw new m(8);if(0==(2097155&e.flags))throw new m(8);if(_(e.node.mode))throw new m(31);if(!e.Ha.write)throw new m(28);e.seekable&&1024&e.flags&&rt(e,0,2);var a=void 0!==i;if(a){if(!e.seekable)throw new m(70)}else i=e.position;return t=e.Ha.write(e,t,r,n,i,void 0),a||(e.position+=t),t}function at(){m||((m=function(e,t){this.name="ErrnoError",this.node=t,this.Eb=function(e){this.Ka=e},this.Eb(e),this.message="FS error"}).prototype=Error(),m.prototype.constructor=m,[44].forEach(e=>{Re[e]=new m(e),Re[e].stack="<generic error, no stack>"}))}function ot(e,s,a){e=X("/dev/"+e);var t=Ae(!!s,!!a),r=(st||=64,st++<<8|0);We(r,{open(e){e.seekable=!1},close(){a?.buffer?.length&&a(10)},read(e,t,r,n){for(var i=0,a=0;a<n;a++){try{var o=s()}catch(e){throw new m(29)}if(void 0===o&&0===i)throw new m(6);if(null==o)break;i++,t[r+a]=o}return i&&(e.node.timestamp=Date.now()),i},write(e,t,r,n){for(var i=0;i<n;i++)try{a(t[r+i])}catch(e){throw new m(29)}return n&&(e.node.timestamp=Date.now()),i}}),Ce(e,t,r)}var st,ut,lt,g={};function q(e,t,r){if("/"===t.charAt(0))return t;if(e=-100===e?"/":y(e).path,0!=t.length)return X(e+"/"+t);if(r)return e;throw new m(44)}function ft(e,t,r){try{var n=e(t)}catch(e){if(e&&e.node&&X(t)!==X(He(e.node)))return-54;throw e}h[r>>2]=n.dev,h[r+4>>2]=n.mode,c[r+8>>2]=n.nlink,h[r+12>>2]=n.uid,h[r+16>>2]=n.gid,h[r+20>>2]=n.rdev,l=[n.size>>>0,(u=n.size,1<=+Math.abs(u)?0<u?+Math.floor(u/4294967296)>>>0:~~+Math.ceil((u-(~~u>>>0))/4294967296)>>>0:0)],h[r+24>>2]=l[0],h[r+28>>2]=l[1],h[r+32>>2]=4096,h[r+36>>2]=n.blocks,e=n.atime.getTime(),t=n.mtime.getTime();var i=n.ctime.getTime();return l=[Math.floor(e/1e3)>>>0,(u=Math.floor(e/1e3),1<=+Math.abs(u)?0<u?+Math.floor(u/4294967296)>>>0:~~+Math.ceil((u-(~~u>>>0))/4294967296)>>>0:0)],h[r+40>>2]=l[0],h[r+44>>2]=l[1],c[r+48>>2]=e%1e3*1e3,l=[Math.floor(t/1e3)>>>0,(u=Math.floor(t/1e3),1<=+Math.abs(u)?0<u?+Math.floor(u/4294967296)>>>0:~~+Math.ceil((u-(~~u>>>0))/4294967296)>>>0:0)],h[r+56>>2]=l[0],h[r+60>>2]=l[1],c[r+64>>2]=t%1e3*1e3,l=[Math.floor(i/1e3)>>>0,(u=Math.floor(i/1e3),1<=+Math.abs(u)?0<u?+Math.floor(u/4294967296)>>>0:~~+Math.ceil((u-(~~u>>>0))/4294967296)>>>0:0)],h[r+72>>2]=l[0],h[r+76>>2]=l[1],c[r+80>>2]=i%1e3*1e3,l=[n.ino>>>0,(u=n.ino,1<=+Math.abs(u)?0<u?+Math.floor(u/4294967296)>>>0:~~+Math.ceil((u-(~~u>>>0))/4294967296)>>>0:0)],h[r+88>>2]=l[0],h[r+92>>2]=l[1],0}var ht=void 0;function ct(){var e=h[+ht>>2];return ht+=4,e}var dt,E,k,bt,mt,pt,wt=(e,t)=>t+2097152>>>0<4194305-!!e?(e>>>0)+4294967296*t:NaN,_t=[0,31,60,91,121,152,182,213,244,274,305,335],vt=[0,31,59,90,120,151,181,212,243,273,304,334],yt=e=>{var t=$(e)+1,r=Rt(t);return r&&Z(e,V,r,t),r},gt={},qt=()=>{if(!dt){var e,t={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",_:L||"./this.program"};for(e in gt)void 0===gt[e]?delete t[e]:t[e]=gt[e];var r=[];for(e in t)r.push(e+"="+t[e]);dt=r}return dt},Et=e=>{var t=$(e)+1,r=re(t);return Z(e,V,r,t),r},kt=0,Mt=(e,t)=>(t=(1==t?re:Rt)(e.length),e.subarray||e.slice||(e=new Uint8Array(e)),V.set(e,t),t),At=[],te=e=>{E.delete(k.get(e)),k.set(e,null),At.push(e)},It=(t,r)=>{if(!E){E=new WeakMap;var n=k.length;if(E)for(var i=0;i<0+n;i++){var a=k.get(i);a&&E.set(a,i)}}if(n=E.get(t)||0)return n;if(At.length)n=At.pop();else{try{k.grow(1)}catch(e){if(e instanceof RangeError)throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.";throw e}n=k.length-1}try{k.set(n,t)}catch(e){if(!(e instanceof TypeError))throw e;if("function"==typeof WebAssembly.Function){for(var i=WebAssembly.Function,a={i:"i32",j:"i64",f:"f32",d:"f64",e:"externref",p:"i32"},o={parameters:[],results:"v"==r[0]?[]:[a[r[0]]]},s=1;s<r.length;++s)o.parameters.push(a[r[s]]);r=new i(o,t)}else{for(i=[1],a=r.slice(0,1),r=r.slice(1),o={i:127,p:127,j:126,f:125,d:124,e:111},i.push(96),(s=r.length)<128?i.push(s):i.push(s%128|128,s>>7),s=0;s<r.length;++s)i.push(o[r[s]]);"v"==a?i.push(0):i.push(1,o[a]),r=[0,97,115,109,1,0,0,0,1],(a=i.length)<128?r.push(a):r.push(a%128|128,a>>7),r.push.apply(r,i),r.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),r=new WebAssembly.Module(new Uint8Array(r)),r=new WebAssembly.Instance(r,{e:{f:t}}).exports.f}k.set(n,r)}return E.set(t,n),n};function St(e,t,r,n){this.parent=e||=this,this.Ra=e.Ra,this.Va=null,this.id=Oe++,this.name=t,this.mode=r,this.Ga={},this.Ha={},this.rdev=n}Object.defineProperties(St.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}}}),at(),b=Array(4096),Je(f,"/"),n("/tmp"),n("/home"),n("/home/web_user"),n("/dev"),We(259,{read:()=>0,write:(e,t,r,n)=>n}),Ce("/dev/null",259),Ee(1280,r),Ee(1536,t),Ce("/dev/tty",1280),Ce("/dev/tty1",1536),bt=new Uint8Array(1024),mt=0,ot("random",r=()=>(0===mt&&(mt=_e(bt).byteLength),bt[--mt])),ot("urandom",r),n("/dev/shm"),n("/dev/shm/tmp"),n("/proc"),pt=n("/proc/self"),n("/proc/self/fd"),Je({Ra(){var e=je(pt,"fd",16895,73);return e.Ga={lookup(e,t){var r=y(+t);return(e={parent:null,Ra:{tb:"fake"},Ga:{readlink:()=>r.path}}).parent=e}},e}},"/proc/self/fd");var xt,Ot={a:(e,t,r,n)=>{i(`Assertion failed: ${e?d(V,e):""}, at: `+[t?d(V,t):"unknown filename",r,n?d(V,n):"unknown function"])},h:function(e,t){try{return Ze(e=e?d(V,e):"",t),0}catch(e){if(void 0===g||"ErrnoError"!==e.name)throw e;return-e.Ka}},H:function(e,t,r){try{if(t=q(e,t=t?d(V,t):""),-8&r)return-28;var n=p(t,{Sa:!0}).node;return n?(e="",4&r&&(e+="r"),2&r&&(e+="w"),1&r&&(e+="x"),e&&v(n,e)?-2:0):-44}catch(e){if(void 0===g||"ErrnoError"!==e.name)throw e;return-e.Ka}},i:function(e,t){try{return Ze(y(e).node,t),0}catch(e){if(void 0===g||"ErrnoError"!==e.name)throw e;return-e.Ka}},g:function(e){try{var t=y(e).node,r="string"==typeof t?p(t,{Sa:!0}).node:t;if(r.Ga.Oa)return r.Ga.Oa(r,{timestamp:Date.now()}),0;throw new m(63)}catch(e){if(void 0===g||"ErrnoError"!==e.name)throw e;return-e.Ka}},b:function(e,t,r){ht=r;try{var n=y(e);switch(t){case 0:var i=ct();if(i<0)return-28;for(;xe[i];)i++;return Ue(n,i).fd;case 1:case 2:return 0;case 3:return n.flags;case 4:return i=ct(),n.flags|=i,0;case 5:return i=ct(),U[i+0>>1]=2,0;case 6:case 7:return 0;case 16:case 8:return-28;case 9:return h[Gt()>>2]=28,-1;default:return-28}}catch(e){if(void 0===g||"ErrnoError"!==e.name)throw e;return-e.Ka}},f:function(e,t){try{return ft(Xe,y(e).path,t)}catch(e){if(void 0===g||"ErrnoError"!==e.name)throw e;return-e.Ka}},n:function(e,t,r){t=wt(t,r);try{if(isNaN(t))return 61;var n=y(e);if(0==(2097155&n.flags))throw new m(28);return et(n.node,t),0}catch(e){if(void 0===g||"ErrnoError"!==e.name)throw e;return-e.Ka}},C:function(e,t){try{if(0===t)return-28;var r=$("/")+1;return t<r?-68:(Z("/",V,e,t),r)}catch(e){if(void 0===g||"ErrnoError"!==e.name)throw e;return-e.Ka}},F:function(e,t){try{return ft($e,e=e?d(V,e):"",t)}catch(e){if(void 0===g||"ErrnoError"!==e.name)throw e;return-e.Ka}},z:function(e,t,r){try{return t=q(e,t=t?d(V,t):""),n(t="/"===(t=X(t))[t.length-1]?t.substr(0,t.length-1):t,r),0}catch(e){if(void 0===g||"ErrnoError"!==e.name)throw e;return-e.Ka}},E:function(e,t,r,n){try{return ft(256&n?$e:Xe,t=q(e,t=t?d(V,t):"",4096&n),r)}catch(e){if(void 0===g||"ErrnoError"!==e.name)throw e;return-e.Ka}},y:function(e,t,r,n){ht=n;try{return ee(t=q(e,t=t?d(V,t):""),r,n?ct():0).fd}catch(e){if(void 0===g||"ErrnoError"!==e.name)throw e;return-e.Ka}},w:function(e,t,r,n){try{if(t=q(e,t=t?d(V,t):""),n<=0)return-28;var i=Ye(t),a=Math.min(n,$(i)),o=Q[r+a];return Z(i,V,r,n+1),Q[r+a]=o,a}catch(e){if(void 0===g||"ErrnoError"!==e.name)throw e;return-e.Ka}},v:function(e){try{return Qe(e=e?d(V,e):""),0}catch(e){if(void 0===g||"ErrnoError"!==e.name)throw e;return-e.Ka}},G:function(e,t){try{return ft(Xe,e=e?d(V,e):"",t)}catch(e){if(void 0===g||"ErrnoError"!==e.name)throw e;return-e.Ka}},r:function(e,t,r){try{return t=q(e,t=t?d(V,t):""),0===r?Ve(t):512===r?Qe(t):i("Invalid flags passed to unlinkat"),0}catch(e){if(void 0===g||"ErrnoError"!==e.name)throw e;return-e.Ka}},q:function(e,t,r){try{t=q(e,t=t?d(V,t):"",!0),i=r?(n=1e3*(c[r>>2]+4294967296*h[r+4>>2])+h[r+8>>2]/1e6,1e3*(c[(r+=16)>>2]+4294967296*h[r+4>>2])+h[r+8>>2]/1e6):n=Date.now(),e=n;var n,i,a=p(t,{Sa:!0}).node;return a.Ga.Oa(a,{timestamp:Math.max(e,i)}),0}catch(e){if(void 0===g||"ErrnoError"!==e.name)throw e;return-e.Ka}},l:function(e,t,r){e=new Date(1e3*wt(e,t)),h[r>>2]=e.getSeconds(),h[r+4>>2]=e.getMinutes(),h[r+8>>2]=e.getHours(),h[r+12>>2]=e.getDate(),h[r+16>>2]=e.getMonth(),h[r+20>>2]=e.getFullYear()-1900,h[r+24>>2]=e.getDay(),t=e.getFullYear(),h[r+28>>2]=(0!=t%4||0==t%100&&0!=t%400?vt:_t)[e.getMonth()]+e.getDate()-1|0,h[r+36>>2]=-60*e.getTimezoneOffset(),t=new Date(e.getFullYear(),6,1).getTimezoneOffset();var n=new Date(e.getFullYear(),0,1).getTimezoneOffset();h[r+32>>2]=0|(t!=n&&e.getTimezoneOffset()==Math.min(n,t))},j:function(e,t,r,n,i,a,o,s){i=wt(i,a);try{if(isNaN(i))return 61;var u=y(n);if(0!=(2&t)&&0==(2&r)&&2!=(2097155&u.flags))throw new m(2);if(1==(2097155&u.flags))throw new m(2);if(!u.Ha.bb)throw new m(43);var l=u.Ha.bb(u,e,i,t,r),f=l.Db;return h[o>>2]=l.ub,c[s>>2]=f,0}catch(e){if(void 0===g||"ErrnoError"!==e.name)throw e;return-e.Ka}},k:function(e,t,r,n,i,a,o){a=wt(a,o);try{if(isNaN(a))return 61;var s,u=y(i);if(2&r){if(32768!=(61440&u.node.mode))throw new m(43);2&n||(s=V.slice(e,e+t),u.Ha.cb&&u.Ha.cb(u,s,a,t,n))}}catch(e){if(void 0===g||"ErrnoError"!==e.name)throw e;return-e.Ka}},s:(e,t,r)=>{function n(e){return(e=e.toTimeString().match(/\(([A-Za-z ]+)\)$/))?e[1]:"GMT"}var i=(new Date).getFullYear(),a=new Date(i,0,1),o=new Date(i,6,1),i=a.getTimezoneOffset(),s=o.getTimezoneOffset();c[e>>2]=60*Math.max(i,s),h[t>>2]=Number(i!=s),e=n(a),t=n(o),e=yt(e),t=yt(t),s<i?(c[r>>2]=e,c[r+4>>2]=t):(c[r>>2]=t,c[r+4>>2]=e)},d:()=>Date.now(),t:()=>2147483648,c:()=>performance.now(),o:e=>{var t=V.length;if(2147483648<(e>>>=0))return!1;for(var r=1;r<=4;r*=2){var n=t*(1+.2/r),n=Math.min(n,e+100663296),i=Math;n=Math.max(e,n);e:{i=(i.min.call(i,2147483648,n+(65536-n%65536)%65536)-P.buffer.byteLength+65535)/65536;try{P.grow(i),J();var a=1;break e}catch(e){}a=void 0}if(a)return!0}return!1},A:(n,i)=>{var a=0;return qt().forEach((e,t)=>{var r=i+a;for(t=c[n+4*t>>2]=r,r=0;r<e.length;++r)Q[t++>>0]=e.charCodeAt(r);Q[t>>0]=0,a+=e.length+1}),0},B:(e,t)=>{var r=qt(),n=(c[e>>2]=r.length,0);return r.forEach(e=>n+=e.length+1),c[t>>2]=n,0},e:function(e){try{return tt(y(e)),0}catch(e){if(void 0===g||"ErrnoError"!==e.name)throw e;return e.Ka}},p:function(e,t){try{var r=y(e);return Q[t>>0]=r.tty?2:_(r.mode)?3:40960==(61440&r.mode)?7:4,U[t+2>>1]=0,l=[0,(u=0,1<=+Math.abs(u)?0<u?+Math.floor(u/4294967296)>>>0:~~+Math.ceil((u-(~~u>>>0))/4294967296)>>>0:0)],h[t+8>>2]=l[0],h[t+12>>2]=l[1],l=[0,(u=0,1<=+Math.abs(u)?0<u?+Math.floor(u/4294967296)>>>0:~~+Math.ceil((u-(~~u>>>0))/4294967296)>>>0:0)],h[t+16>>2]=l[0],h[t+20>>2]=l[1],0}catch(e){if(void 0===g||"ErrnoError"!==e.name)throw e;return e.Ka}},x:function(e,t,r,n){try{e:{var i=y(e);e=t;for(var a,o=t=0;o<r;o++){var s=c[e>>2],u=c[e+4>>2],l=(e+=8,nt(i,Q,s,u,a));if(l<0){var f=-1;break e}if(t+=l,l<u)break;void 0!==a&&(a+=l)}f=t}return c[n>>2]=f,0}catch(e){if(void 0===g||"ErrnoError"!==e.name)throw e;return e.Ka}},m:function(e,t,r,n,i){t=wt(t,r);try{if(isNaN(t))return 61;var a=y(e);return rt(a,t,n),l=[a.position>>>0,(u=a.position,1<=+Math.abs(u)?0<u?+Math.floor(u/4294967296)>>>0:~~+Math.ceil((u-(~~u>>>0))/4294967296)>>>0:0)],h[i>>2]=l[0],h[i+4>>2]=l[1],a.hb&&0===t&&0===n&&(a.hb=null),0}catch(e){if(void 0===g||"ErrnoError"!==e.name)throw e;return e.Ka}},D:function(e){try{var t=y(e);return t.Ha?.fsync?t.Ha.fsync(t):0}catch(e){if(void 0===g||"ErrnoError"!==e.name)throw e;return e.Ka}},u:function(e,t,r,n){try{e:{var i=y(e);e=t;for(var a,o=t=0;o<r;o++){var s=c[e>>2],u=c[e+4>>2],l=(e+=8,it(i,Q,s,u,a));if(l<0){var f=-1;break e}t+=l,void 0!==a&&(a+=l)}f=t}return c[n>>2]=f,0}catch(e){if(void 0===g||"ErrnoError"!==e.name)throw e;return e.Ka}}},M=function(){function t(e){return M=e.exports,P=M.I,J(),k=M.Aa,C.unshift(M.J),s--,B.monitorRunDependencies?.(s),0==s&&(null!==ie&&(clearInterval(ie),ie=null),ae&&(e=ae,ae=null,e())),M}var r,n,i,e={a:Ot};if(s++,B.monitorRunDependencies?.(s),B.instantiateWasm)try{return B.instantiateWasm(e,t)}catch(e){return o("Module.instantiateWasm callback failed with error: "+e),!1}return r=e,n=function(e){t(e.instance)},i=oe,a||"function"!=typeof WebAssembly.instantiateStreaming||se(i)||ue(i)||T||"function"!=typeof fetch?fe(i,r,n):fetch(i,{credentials:"same-origin"}).then(e=>WebAssembly.instantiateStreaming(e,r).then(n,function(e){return o("wasm streaming compile failed: "+e),o("falling back to ArrayBuffer instantiation"),fe(i,r,n)})),{}}(),Gt=(B._sqlite3_free=e=>(B._sqlite3_free=M.K)(e),B._sqlite3_value_text=e=>(B._sqlite3_value_text=M.L)(e),()=>(Gt=M.M)()),Rt=(B._sqlite3_prepare_v2=(e,t,r,n,i)=>(B._sqlite3_prepare_v2=M.N)(e,t,r,n,i),B._sqlite3_step=e=>(B._sqlite3_step=M.O)(e),B._sqlite3_finalize=e=>(B._sqlite3_finalize=M.P)(e),B._sqlite3_reset=e=>(B._sqlite3_reset=M.Q)(e),B._sqlite3_clear_bindings=e=>(B._sqlite3_clear_bindings=M.R)(e),B._sqlite3_value_blob=e=>(B._sqlite3_value_blob=M.S)(e),B._sqlite3_value_bytes=e=>(B._sqlite3_value_bytes=M.T)(e),B._sqlite3_value_double=e=>(B._sqlite3_value_double=M.U)(e),B._sqlite3_value_int=e=>(B._sqlite3_value_int=M.V)(e),B._sqlite3_value_type=e=>(B._sqlite3_value_type=M.W)(e),B._sqlite3_result_blob=(e,t,r,n)=>(B._sqlite3_result_blob=M.X)(e,t,r,n),B._sqlite3_result_double=(e,t)=>(B._sqlite3_result_double=M.Y)(e,t),B._sqlite3_result_error=(e,t,r)=>(B._sqlite3_result_error=M.Z)(e,t,r),B._sqlite3_result_int=(e,t)=>(B._sqlite3_result_int=M._)(e,t),B._sqlite3_result_int64=(e,t,r)=>(B._sqlite3_result_int64=M.$)(e,t,r),B._sqlite3_result_null=e=>(B._sqlite3_result_null=M.aa)(e),B._sqlite3_result_text=(e,t,r,n)=>(B._sqlite3_result_text=M.ba)(e,t,r,n),B._sqlite3_aggregate_context=(e,t)=>(B._sqlite3_aggregate_context=M.ca)(e,t),B._sqlite3_column_count=e=>(B._sqlite3_column_count=M.da)(e),B._sqlite3_data_count=e=>(B._sqlite3_data_count=M.ea)(e),B._sqlite3_column_blob=(e,t)=>(B._sqlite3_column_blob=M.fa)(e,t),B._sqlite3_column_bytes=(e,t)=>(B._sqlite3_column_bytes=M.ga)(e,t),B._sqlite3_column_double=(e,t)=>(B._sqlite3_column_double=M.ha)(e,t),B._sqlite3_column_text=(e,t)=>(B._sqlite3_column_text=M.ia)(e,t),B._sqlite3_column_type=(e,t)=>(B._sqlite3_column_type=M.ja)(e,t),B._sqlite3_column_name=(e,t)=>(B._sqlite3_column_name=M.ka)(e,t),B._sqlite3_bind_blob=(e,t,r,n,i)=>(B._sqlite3_bind_blob=M.la)(e,t,r,n,i),B._sqlite3_bind_double=(e,t,r)=>(B._sqlite3_bind_double=M.ma)(e,t,r),B._sqlite3_bind_int=(e,t,r)=>(B._sqlite3_bind_int=M.na)(e,t,r),B._sqlite3_bind_text=(e,t,r,n,i)=>(B._sqlite3_bind_text=M.oa)(e,t,r,n,i),B._sqlite3_bind_parameter_index=(e,t)=>(B._sqlite3_bind_parameter_index=M.pa)(e,t),B._sqlite3_sql=e=>(B._sqlite3_sql=M.qa)(e),B._sqlite3_normalized_sql=e=>(B._sqlite3_normalized_sql=M.ra)(e),B._sqlite3_errmsg=e=>(B._sqlite3_errmsg=M.sa)(e),B._sqlite3_exec=(e,t,r,n,i)=>(B._sqlite3_exec=M.ta)(e,t,r,n,i),B._sqlite3_changes=e=>(B._sqlite3_changes=M.ua)(e),B._sqlite3_close_v2=e=>(B._sqlite3_close_v2=M.va)(e),B._sqlite3_create_function_v2=(e,t,r,n,i,a,o,s,u)=>(B._sqlite3_create_function_v2=M.wa)(e,t,r,n,i,a,o,s,u),B._sqlite3_open=(e,t)=>(B._sqlite3_open=M.xa)(e,t),B._malloc=e=>(Rt=B._malloc=M.ya)(e)),Ht=B._free=e=>(Ht=B._free=M.za)(e),Lt=(B._RegisterExtensionFunctions=e=>(B._RegisterExtensionFunctions=M.Ba)(e),(e,t)=>(Lt=M.Ca)(e,t)),Nt=()=>(Nt=M.Da)(),jt=e=>(jt=M.Ea)(e),re=e=>(re=M.Fa)(e);function Tt(){function e(){if(!xt&&(xt=!0,B.calledRun=!0,!W)){if(B.noFSInit||ze||(ze=!0,at(),B.stdin=B.stdin,B.stdout=B.stdout,B.stderr=B.stderr,B.stdin?ot("stdin",B.stdin):Be("/dev/tty","/dev/stdin"),B.stdout?ot("stdout",null,B.stdout):Be("/dev/tty","/dev/stdout"),B.stderr?ot("stderr",null,B.stderr):Be("/dev/tty1","/dev/stderr"),ee("/dev/stdin",0),ee("/dev/stdout",1),ee("/dev/stderr",1)),Ge=!1,he(C),B.onRuntimeInitialized&&B.onRuntimeInitialized(),B.postRun)for("function"==typeof B.postRun&&(B.postRun=[B.postRun]);B.postRun.length;){var e=B.postRun.shift();ne.unshift(e)}he(ne)}}if(!(0<s)){if(B.preRun)for("function"==typeof B.preRun&&(B.preRun=[B.preRun]);B.preRun.length;)t=void 0,t=B.preRun.shift(),K.unshift(t);he(K),0<s||(B.setStatus?(B.setStatus("Running..."),setTimeout(function(){setTimeout(function(){B.setStatus("")},1),e()},1)):e())}var t}if(B.stackAlloc=re,B.stackSave=Nt,B.stackRestore=jt,B.cwrap=(l,f,h,e)=>{var t=!h||h.every(e=>"number"===e||"boolean"===e);return"string"!==f&&t&&!e?B["_"+l]:function(){var e=l,t=f,r=h,n=arguments,i={string:e=>{var t=0;return t=null!=e&&0!==e?Et(e):t},array:e=>{var t=re(e.length);return Q.set(e,t),t}},a=(e=B["_"+e],[]),o=0;if(n)for(var s=0;s<n.length;s++){var u=i[r[s]];u?(0===o&&(o=Nt()),a[s]=u(n[s])):a[s]=n[s]}return e=r=e.apply(null,a),0!==o&&jt(o),"string"===t?e?d(V,e):"":"boolean"===t?!!e:e}},B.addFunction=It,B.removeFunction=te,B.UTF8ToString=be,B.ALLOC_NORMAL=kt,B.allocate=Mt,B.allocateUTF8OnStack=Et,ae=function e(){xt||Tt(),xt||(ae=e)},B.preInit)for("function"==typeof B.preInit&&(B.preInit=[B.preInit]);0<B.preInit.length;)B.preInit.pop()();return Tt(),e})};"object"==typeof exports&&"object"==typeof module?(module.exports=initSqlJs,module.exports.default=initSqlJs):"function"==typeof define&&define.amd?define([],function(){return initSqlJs}):"object"==typeof exports&&(exports.Module=initSqlJs);