!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var r=t();for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}(this,(function(){return(()=>{var __webpack_modules__={870:(e,t,r)=>{"use strict";r.r(t),r.d(t,{createEndpoint:()=>o,expose:()=>l,proxy:()=>v,proxyMarker:()=>n,releaseProxy:()=>i,transfer:()=>_,transferHandlers:()=>u,windowEndpoint:()=>g,wrap:()=>f});const n=Symbol("Comlink.proxy"),o=Symbol("Comlink.endpoint"),i=Symbol("Comlink.releaseProxy"),s=Symbol("Comlink.thrown"),a=e=>"object"==typeof e&&null!==e||"function"==typeof e,u=new Map([["proxy",{canHandle:e=>a(e)&&e[n],serialize(e){const{port1:t,port2:r}=new MessageChannel;return l(e,t),[r,[r]]},deserialize:e=>(e.start(),f(e))}],["throw",{canHandle:e=>a(e)&&s in e,serialize({value:e}){let t;return t=e instanceof Error?{isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:{isError:!1,value:e},[t,[]]},deserialize(e){if(e.isError)throw Object.assign(new Error(e.value.message),e.value);throw e.value}}]]);function l(e,t=self){t.addEventListener("message",(function r(n){if(!n||!n.data)return;const{id:o,type:i,path:a}=Object.assign({path:[]},n.data),u=(n.data.argumentList||[]).map(w);let f;try{const t=a.slice(0,-1).reduce(((e,t)=>e[t]),e),r=a.reduce(((e,t)=>e[t]),e);switch(i){case 0:f=r;break;case 1:t[a.slice(-1)[0]]=w(n.data.value),f=!0;break;case 2:f=r.apply(t,u);break;case 3:f=v(new r(...u));break;case 4:{const{port1:t,port2:r}=new MessageChannel;l(e,r),f=_(t,[t])}break;case 5:f=void 0}}catch(e){f={value:e,[s]:0}}Promise.resolve(f).catch((e=>({value:e,[s]:0}))).then((e=>{const[n,s]=b(e);t.postMessage(Object.assign(Object.assign({},n),{id:o}),s),5===i&&(t.removeEventListener("message",r),c(t))}))})),t.start&&t.start()}function c(e){(function(e){return"MessagePort"===e.constructor.name})(e)&&e.close()}function f(e,t){return h(e,[],t)}function d(e){if(e)throw new Error("Proxy has been released and is not useable")}function h(e,t=[],r=function(){}){let n=!1;const s=new Proxy(r,{get(r,o){if(d(n),o===i)return()=>y(e,{type:5,path:t.map((e=>e.toString()))}).then((()=>{c(e),n=!0}));if("then"===o){if(0===t.length)return{then:()=>s};const r=y(e,{type:0,path:t.map((e=>e.toString()))}).then(w);return r.then.bind(r)}return h(e,[...t,o])},set(r,o,i){d(n);const[s,a]=b(i);return y(e,{type:1,path:[...t,o].map((e=>e.toString())),value:s},a).then(w)},apply(r,i,s){d(n);const a=t[t.length-1];if(a===o)return y(e,{type:4}).then(w);if("bind"===a)return h(e,t.slice(0,-1));const[u,l]=m(s);return y(e,{type:2,path:t.map((e=>e.toString())),argumentList:u},l).then(w)},construct(r,o){d(n);const[i,s]=m(o);return y(e,{type:3,path:t.map((e=>e.toString())),argumentList:i},s).then(w)}});return s}function m(e){const t=e.map(b);return[t.map((e=>e[0])),(r=t.map((e=>e[1])),Array.prototype.concat.apply([],r))];var r}const p=new WeakMap;function _(e,t){return p.set(e,t),e}function v(e){return Object.assign(e,{[n]:!0})}function g(e,t=self,r="*"){return{postMessage:(t,n)=>e.postMessage(t,r,n),addEventListener:t.addEventListener.bind(t),removeEventListener:t.removeEventListener.bind(t)}}function b(e){for(const[t,r]of u)if(r.canHandle(e)){const[n,o]=r.serialize(e);return[{type:3,name:t,value:n},o]}return[{type:0,value:e},p.get(e)||[]]}function w(e){switch(e.type){case 3:return u.get(e.name).deserialize(e.value);case 0:return e.value}}function y(e,t,r){return new Promise((n=>{const o=new Array(4).fill(0).map((()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16))).join("-");e.addEventListener("message",(function t(r){r.data&&r.data.id&&r.data.id===o&&(e.removeEventListener("message",t),n(r.data))})),e.start&&e.start(),e.postMessage(Object.assign({id:o},t),r)}))}},794:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createLazyFile=t.LazyUint8Array=void 0;class r{constructor(e){this.serverChecked=!1,this.chunks=[],this.totalFetchedBytes=0,this.totalRequests=0,this.readPages=[],this.readHeads=[],this.lastGet=-1,this._chunkSize=e.requestChunkSize,this.maxSpeed=Math.round((e.maxReadSpeed||5242880)/this._chunkSize),this.maxReadHeads=e.maxReadHeads??3,this.rangeMapper=e.rangeMapper,this.logPageReads=e.logPageReads??!1,e.fileLength&&(this._length=e.fileLength),this.requestLimiter=null==e.requestLimiter?e=>{}:e.requestLimiter}copyInto(e,t,r,n){if(n>=this.length)return 0;const o=n+(r=Math.min(this.length-n,r));let i=0;for(;i=n&&ethis.maxReadHeads;)this.readHeads.pop();return t}getChunk(e){let t=!0;if(void 0===this.chunks[e]){t=!1;const r=this.moveReadHead(e),n=r.speed,o=r.startChunk*this.chunkSize;let i=(r.startChunk+n)*this.chunkSize-1;i=Math.min(i,this.length-1);const s=this.doXHR(o,i);for(let e=0;e=s.byteLength)break;const n=(e+1)*this.chunkSize>s.byteLength?s.byteLength-e*this.chunkSize:this.chunkSize;this.chunks[t]=new Uint8Array(s,e*this.chunkSize,n)}}if(void 0===this.chunks[e])throw new Error("doXHR failed (bug)!");return!this.logPageReads||this.lastGet==e||(this.lastGet=e,this.readPages.push({pageno:e,wasCached:t,prefetch:t?0:this.readHeads[0].speed-1})),this.chunks[e]}checkServer(){var e=new XMLHttpRequest;const t=this.rangeMapper(0,0).headUrl;if(e.open("HEAD",t,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+t+". Status: "+e.status);var r=Number(e.getResponseHeader("Content-length")),n="bytes"===e.getResponseHeader("Accept-Ranges");const o=e.getResponseHeader("Content-Encoding");var i=o&&"identity"!==o;if(!n){const t="Warning: The server did not respond with Accept-Ranges=bytes. It either does not support byte serving or does not advertise it (`Accept-Ranges: bytes` header missing), or your database is hosted on CORS and the server doesn't mark the accept-ranges header as exposed. This may lead to incorrect results.";console.warn(t,"(seen response headers:",e.getAllResponseHeaders(),")")}if(i&&console.warn(`Warning: The server responded with ${o} encoding to a HEAD request. Ignoring since it may not do so for Range HTTP requests, but this will lead to incorrect results otherwise since the ranges will be based on the compressed data instead of the uncompressed data.`),i&&(r=null),!this._length){if(!r)throw console.error("response headers",e.getAllResponseHeaders()),Error("Length of the file not known. It must either be supplied in the config or given by the HTTP server.");this._length=r}this.serverChecked=!0}get length(){return this.serverChecked||this.checkServer(),this._length}get chunkSize(){return this.serverChecked||this.checkServer(),this._chunkSize}doXHR(e,t){if(console.log(`[xhr of size ${(t+1-e)/1024} KiB @ ${e/1024} KiB]`),this.requestLimiter(t-e),this.totalFetchedBytes+=t-e,this.totalRequests++,e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>this.length-1)throw new Error("only "+this.length+" bytes available! programmer error!");const{fromByte:r,toByte:n,url:o}=this.rangeMapper(e,t);var i=new XMLHttpRequest;if(i.open("GET",o,!1),this.length!==this.chunkSize&&i.setRequestHeader("Range","bytes="+r+"-"+n),i.responseType="arraybuffer",i.overrideMimeType&&i.overrideMimeType("text/plain; charset=x-user-defined"),i.send(null),!(i.status>=200&&i.status<300||304===i.status))throw new Error("Couldn't load "+o+". Status: "+i.status);if(void 0!==i.response)return i.response;throw Error("xhr did not return uint8array")}}t.LazyUint8Array=r,t.createLazyFile=function(e,t,n,o,i,s){var a=new r(s),u={isDevice:!1,contents:a},l=e.createFile(t,n,u,o,i);l.contents=a,Object.defineProperties(l,{usedBytes:{get:function(){return this.contents.length}}});var c={};return Object.keys(l.stream_ops).forEach((function(t){var r=l.stream_ops[t];c[t]=function(){return e.forceLoadFile(l),r.apply(null,arguments)}})),c.read=function(t,r,n,o,i){return e.forceLoadFile(l),t.node.contents.copyInto(r,n,o,i)},l.stream_ops=c,l}},630:function(__unused_webpack_module,exports,__webpack_require__){"use strict";var __createBinding=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),__importStar=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&__createBinding(t,e,r);return __setModuleDefault(t,e),t},__importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.toObjects=void 0;const Comlink=__importStar(__webpack_require__(870)),sql_wasm_js_1=__importDefault(__webpack_require__(365)),sql_wasm_wasm_1=__importDefault(__webpack_require__(720)),lazyFile_1=__webpack_require__(794),vtab_1=__webpack_require__(457);function initTransferHandlers(e){Comlink.transferHandlers.set("WORKERSQLPROXIES",{canHandle:t=>{let r=t instanceof e.Database,n=t&&t.db&&t.db instanceof e.Database;return r||n},serialize(e){const{port1:t,port2:r}=new MessageChannel;return Comlink.expose(e,t),[r,[r]]},deserialize:e=>{}})}async function init(e){const t=await sql_wasm_js_1.default({locateFile:t=>e});return initTransferHandlers(t),t}function toObjects(e){return e.flatMap((e=>e.values.map((t=>{const r={};for(let n=0;n{if("jsonconfig"===e.from){const t=new URL(e.configUrl,location.href),r=await fetch(t.toString());if(!r.ok)throw console.error("httpvfs config error",await r.text()),Error(`Could not load httpvfs config: ${r.status}: ${r.statusText}`);const n=await r.json();return{from:"inline",config:"chunked"===n.serverMode?{...n,urlPrefix:new URL(n.urlPrefix,t).toString()}:{...n,url:new URL(n.url,t).toString(),headUrl:n.headUrl?new URL(n.headUrl,t).toString():new URL(n.url,t).toString()},virtualFilename:e.virtualFilename}}return e}));return Promise.all(t)}sql_wasm_wasm_1.default,exports.toObjects=toObjects;const mod={db:null,inited:!1,sqljs:null,bytesRead:0,async SplitFileHttpDatabase(e,t,r,n=1/0){if(this.inited)throw Error("sorry, only one db is supported right now");this.inited=!0,this.sqljs||(this.sqljs=init(e));const o=await this.sqljs;this.bytesRead=0;let i=e=>{if(this.bytesRead+e>n)throw this.bytesRead=0,new o.FS.ErrnoError(6);this.bytesRead+=e};const s=new Map,a=await fetchConfigs(t);let u;for(const{config:e,virtualFilename:t}of a){const n="chunked"===e.serverMode?e.urlPrefix:e.url;let a;console.log("constructing url database",n);let l=e.cacheBust?"?cb="+e.cacheBust:"";a="chunked"==e.serverMode?(t,r)=>{const n=t/e.serverChunkSize|0,o=t%e.serverChunkSize,i=o+(r-t);return{url:e.urlPrefix+String(n).padStart(e.suffixLength,"0")+l,headUrl:e.headUrl??e.urlPrefix+String(n).padStart(e.suffixLength,"0")+l,fromByte:o,toByte:i}}:(t,r)=>({url:e.url+l,headUrl:e.headUrl?e.headUrl+l:e.url+l,fromByte:t,toByte:r});const c=t||n.replace(/\//g,"_");r||(r=c,u=e),console.log("constructing url database",n,"filename",c);const f=lazyFile_1.createLazyFile(o.FS,"/",c,!0,!0,{rangeMapper:a,requestChunkSize:e.requestChunkSize,fileLength:"chunked"===e.serverMode?e.databaseLengthBytes:void 0,logPageReads:!0,maxReadHeads:3,requestLimiter:i});s.set(c,f)}if(this.db=new o.CustomDatabase(r),u){const e=(await this.db.exec("pragma page_size; pragma cache_size=0"))[0].values[0][0];e!==u.requestChunkSize&&console.warn(`Chunk size does not match page size: pragma page_size = ${e} but chunkSize = ${u.requestChunkSize}`)}return this.db.lazyFiles=s,this.db.create_vtab(vtab_1.SeriesVtab),this.db.query=(...e)=>toObjects(this.db.exec(...e)),this.db},getResetAccessedPages(e){if(!this.db)return[];const t=this.db.lazyFiles.get(e||this.db.filename);if(!t)throw Error("unknown lazy file");const r=[...t.contents.readPages];return t.contents.readPages=[],r},getStats(e){const t=this.db;if(!t)return null;const r=t.lazyFiles.get(e||t.filename);if(!r)throw Error("unknown lazy file");return{filename:t.filename,totalBytes:r.contents.length,totalFetchedBytes:r.contents.totalFetchedBytes,totalRequests:r.contents.totalRequests}},async evalCode(code){return await eval(`(async function (db) {\n ${code}\n })`)(this.db)}};Comlink.expose(mod)},457:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.SeriesVtab=void 0,function(e){e[e.idx=0]="idx",e[e.id=1]="id",e[e.tagName=2]="tagName",e[e.textContent=3]="textContent",e[e.innerHTML=4]="innerHTML",e[e.outerHTML=5]="outerHTML",e[e.className=6]="className",e[e.parent=7]="parent",e[e.selector=8]="selector",e[e.querySelector=9]="querySelector"}(r||(r={}));const n=Object.keys(r).map((e=>r[e])).filter((e=>"string"==typeof e));function o(e){const t={};for(let n=0;n`");const s=this.module.getValue(t+64,"i32");return this.module.setValue(t+20,s,"i32"),0}catch(t){return console.error("xbestindex",t),this.setVtabError(e,String(t)),21}}xFilter(e,t,o,s,a){if(console.log("xfilter",s),1!==s)return console.error("did not get a single argument to xFilter"),21;const u=this.module.extract_value(a+0),l=this.getCursor(e);l.querySelector=u;const c=t,f=n.filter((e=>c&1<=t.elements.length)}xColumn(e,t,n){const o=this.getCursor(e),i=o.elements[o.index];if(r[n]in i)this.module.set_return_value(t,i[r[n]]);else switch(n){case r.idx:this.module.set_return_value(t,o.index);break;case r.querySelector:this.module.set_return_value(t,o.querySelector);break;default:throw Error(`unknown column ${r[n]}`)}return 0}setVtabError(e,t){const r=this.module.lengthBytesUTF8(t)+1,n=this.module.sqlite3_malloc(r);console.log("writing error",t,r),this.module.stringToUTF8(t,n,r),this.module.setValue(e+8,n,"i32")}xUpdate(e,t,r,n){try{const[e,n,...s]=Array.from({length:t},((e,t)=>this.module.extract_value(r+4*t)));if(e)if(e&&!n)console.log("DELETE",e),i({type:"delete",selector:e});else{if(e!==n)throw"The selector row can't be set";i({type:"update",value:o(s)})}else console.assert(null===n),i({type:"insert",value:o(s)});return 0}catch(t){return this.setVtabError(e,String(t)),21}}xRowid(e,t){throw Error("xRowid not implemented")}xFindFunction(e,t,r,n,o){return"match"!==this.module.UTF8ToString(r)?0:(this.module.setValue(n,this.module.addFunction(((e,t,r)=>{this.module.set_return_value(e,!0)}),"viii"),"i32"),150)}}},365:function(e,t){var r=void 0,n=function(t){return r||(r=new Promise((function(r,n){var o=(i=void 0!==t?t:{}).onAbort;i.onAbort=function(e){n(new Error(e)),o&&o(e)},i.postRun=i.postRun||[],i.postRun.push((function(){r(i)})),e=void 0;var i=void 0!==i?i:{},s=Object.assign;i.onRuntimeInitialized=function(){var e=Ue(4),t=i.cwrap,r=t("sqlite3_open","number",["string","number"]),n=(t("sqlite3_open_v2","number",["string","number","number","string"]),t("sqlite3_close_v2","number",["number"])),o=t("sqlite3_exec","number",["number","string","number","number","number"]),s=t("sqlite3_changes","number",["number"]),a=t("sqlite3_prepare_v2","number",["number","string","number","number","number"]),u=t("sqlite3_sql","string",["number"]),l=t("sqlite3_normalized_sql","string",["number"]),c=t("sqlite3_prepare_v2","number",["number","number","number","number","number"]),f=t("sqlite3_bind_text","number",["number","number","number","number","number"]),d=t("sqlite3_bind_blob","number",["number","number","number","number","number"]),h=t("sqlite3_bind_double","number",["number","number","number"]),m=t("sqlite3_bind_int","number",["number","number","number"]),p=t("sqlite3_bind_parameter_index","number",["number","string"]),_=t("sqlite3_step","number",["number"]),v=t("sqlite3_errmsg","string",["number"]),g=t("sqlite3_column_count","number",["number"]),b=t("sqlite3_data_count","number",["number"]),w=t("sqlite3_column_double","number",["number","number"]),y=t("sqlite3_column_text","string",["number","number"]),E=t("sqlite3_column_blob","number",["number","number"]),k=t("sqlite3_column_bytes","number",["number","number"]),S=t("sqlite3_column_type","number",["number","number"]),D=t("sqlite3_column_name","string",["number","number"]),A=t("sqlite3_reset","number",["number"]),R=t("sqlite3_clear_bindings","number",["number"]),P=t("sqlite3_finalize","number",["number"]),T=t("sqlite3_create_module_v2","number",["number","string","number","number","number"]),O=t("sqlite3_create_function_v2","number",["number","string","number","number","number","number","number","number","number"]),L=t("sqlite3_value_type","number",["number"]),B=t("sqlite3_value_bytes","number",["number"]),N=t("sqlite3_value_text","string",["number"]),H=t("sqlite3_value_blob","number",["number"]),U=t("sqlite3_value_double","number",["number"]),I=t("sqlite3_result_double","",["number","number"]),$=t("sqlite3_result_null","",["number"]),K=t("sqlite3_result_text","",["number","string","number","number"]),Y=t("sqlite3_result_blob","",["number","number","number","number"]),Q=t("sqlite3_result_int","",["number","number"]),J=t("sqlite3_result_error","",["number","string","number"]),Z=t("sqlite3_malloc","number",["number"]);i.sqlite3_malloc=Z;var ee=t("RegisterExtensionFunctions","number",["number"]);function te(e,t){this.stmt=e,this.db=t,this.pos=1,this.allocatedmem=[]}function re(e,t){this.db=t;var r=G(e)+1;if(this.sqlPtr=Te(r),null===this.sqlPtr)throw new Error("Unable to allocate memory for the SQL string");X(e,this.sqlPtr,r),this.nextSqlPtr=this.sqlPtr,this.nextSqlString=null,this.activeStatement=null}function ne(t){this.filename="dbfile_"+(4294967295*Math.random()>>>0),null!=t&&Se.createDataFile("/",this.filename,t,!0,!0);const n=r(this.filename,e);this.db=F(e,"i32"),this.handleError(n),ee(this.db),this.statements={},this.functions={}}function oe(t){this.filename=t;const n=r(this.filename,e);this.db=F(e,"i32"),this.handleError(n),ee(this.db),this.statements={},this.functions={}}te.prototype.bind=function(e){if(!this.stmt)throw"Statement closed";return this.reset(),Array.isArray(e)?this.bindFromArray(e):null==e||"object"!=typeof e||this.bindFromObject(e)},te.prototype.bind_=te.prototype.bind,te.prototype.step=function(){if(!this.stmt)throw"Statement closed";this.pos=1;var e=_(this.stmt);switch(e){case 100:return!0;case 101:return!1;default:throw this.db.handleError(e)}},te.prototype.getNumber=function(e){return null==e&&(e=this.pos,this.pos+=1),w(this.stmt,e)},te.prototype.getString=function(e){return null==e&&(e=this.pos,this.pos+=1),y(this.stmt,e)},te.prototype.getBlob=function(e){null==e&&(e=this.pos,this.pos+=1);for(var t=k(this.stmt,e),r=E(this.stmt,e),n=new Uint8Array(t),o=0;o1&&(p=process.argv[1].replace(/\\/g,"/")),m=process.argv.slice(2),void 0!==e&&(e.exports=i),i.inspect=function(){return"[Emscripten Module object]"}):(_||v)&&(v?b=self.location.href:"undefined"!=typeof document&&document.currentScript&&(b=document.currentScript.src),b=0!==b.indexOf("blob:")?b.substr(0,b.replace(/[?#].*/,"").lastIndexOf("/")+1):"",a=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},v&&(l=function(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),u=function(e,t,r){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=function(){200==n.status||0==n.status&&n.response?t(n.response):r()},n.onerror=r,n.send(null)});var w=i.print||console.log.bind(console),y=i.printErr||console.warn.bind(console);s(i,h),h=null,i.arguments&&(m=i.arguments),i.thisProgram&&(p=i.thisProgram),i.quit&&i.quit;var E,k,S=[];function q(e,t){if(E||(E=new WeakMap,function(e,t){for(var r=0;r<0+t;r++){var n=pe(r);n&&E.set(n,r)}}(0,Y.length)),E.has(e))return E.get(e);var r=function(){if(S.length)return S.pop();try{Y.grow(1)}catch(e){if(!(e instanceof RangeError))throw e;throw"Unable to grow wasm table. Set ALLOW_TABLE_GROWTH."}return Y.length-1}();try{_e(r,e)}catch(n){if(!(n instanceof TypeError))throw n;_e(r,function(e,t){if("function"==typeof WebAssembly.Function){for(var r={i:"i32",j:"i64",f:"f32",d:"f64"},n={parameters:[],results:"v"==t[0]?[]:[r[t[0]]]},o=1;o>0]=t;break;case"i16":L[e>>1]=t;break;case"i32":B[e>>2]=t;break;case"i64":ee=[t>>>0,(Z=t,+Math.abs(Z)>=1?Z>0?(0|Math.min(+Math.floor(Z/4294967296),4294967295))>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],B[e>>2]=ee[0],B[e+4>>2]=ee[1];break;case"float":N[e>>2]=t;break;case"double":H[e>>3]=t;break;default:le("invalid type for setValue: "+r)}}function F(e,t,r){switch("*"===(t=t||"i8").charAt(t.length-1)&&(t="i32"),t){case"i1":case"i8":return C[e>>0];case"i16":return L[e>>1];case"i32":case"i64":return B[e>>2];case"float":return N[e>>2];case"double":return Number(H[e>>3]);default:le("invalid type for getValue: "+t)}return null}"object"!=typeof WebAssembly&&le("no native wasm support detected");var A=!1;function R(e){return i["_"+e]}function P(e,t,r,n,o){var i={string:function(e){var t=0;if(null!=e&&0!==e){var r=1+(e.length<<2);X(e,t=Ue(r),r)}return t},array:function(e){var t=Ue(e.length);return function(e,t){C.set(e,t)}(e,t),t}},s=R(e),a=[],u=0;if(n)for(var l=0;l=n);)++o;if(o-t>16&&e.subarray&&U)return U.decode(e.subarray(t,o));for(var i="";t>10,56320|1023&l)}}else i+=String.fromCharCode((31&s)<<6|a)}else i+=String.fromCharCode(s)}return i}function V(e,t){return e?I(O,e,t):""}function W(e,t,r,n){if(!(n>0))return 0;for(var o=r,i=r+n-1,s=0;s=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&e.charCodeAt(++s)),a<=127){if(r>=i)break;t[r++]=a}else if(a<=2047){if(r+1>=i)break;t[r++]=192|a>>6,t[r++]=128|63&a}else if(a<=65535){if(r+2>=i)break;t[r++]=224|a>>12,t[r++]=128|a>>6&63,t[r++]=128|63&a}else{if(r+3>=i)break;t[r++]=240|a>>18,t[r++]=128|a>>12&63,t[r++]=128|a>>6&63,t[r++]=128|63&a}}return t[r]=0,r-o}function X(e,t,r){return W(e,O,t,r)}function G(e){for(var t=0,r=0;r=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&e.charCodeAt(++r)),n<=127?++t:t+=n<=2047?2:n<=65535?3:4}return t}function $(e){var t=G(e)+1,r=Te(t);return r&&W(e,C,r,t),r}function K(e){T=e,i.HEAP8=C=new Int8Array(e),i.HEAP16=L=new Int16Array(e),i.HEAP32=B=new Int32Array(e),i.HEAPU8=O=new Uint8Array(e),i.HEAPU16=new Uint16Array(e),i.HEAPU32=new Uint32Array(e),i.HEAPF32=N=new Float32Array(e),i.HEAPF64=H=new Float64Array(e)}i.INITIAL_MEMORY;var Y,Q,J,Z,ee,te=[],re=[],ne=[],oe=0,ie=null,se=null;function ae(e){oe++,i.monitorRunDependencies&&i.monitorRunDependencies(oe)}function ue(e){if(oe--,i.monitorRunDependencies&&i.monitorRunDependencies(oe),0==oe&&(null!==ie&&(clearInterval(ie),ie=null),se)){var t=se;se=null,t()}}function le(e){throw i.onAbort&&i.onAbort(e),y(e="Aborted("+e+")"),A=!0,e+=". Build with -s ASSERTIONS=1 for more info.",new WebAssembly.RuntimeError(e)}function ce(e){return e.startsWith("data:application/octet-stream;base64,")}function fe(e){return e.startsWith("file://")}function de(e){try{if(e==Q&&k)return new Uint8Array(k);if(l)return l(e);throw"both async and sync fetching of the wasm failed"}catch(e){le(e)}}function he(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var r=t.func;"number"==typeof r?void 0===t.arg?pe(r)():pe(r)(t.arg):r(void 0===t.arg?null:t.arg)}else t(i)}}i.preloadedImages={},i.preloadedAudios={},ce(Q="sql-wasm.wasm")||(J=Q,Q=i.locateFile?i.locateFile(J,b):b+J);var me=[];function pe(e){var t=me[e];return t||(e>=me.length&&(me.length=e+1),me[e]=t=Y.get(e)),t}function _e(e,t){Y.set(e,t),me[e]=t}function ve(){ve.called||(ve.called=!0,function(){var e=(new Date).getFullYear(),t=new Date(e,0,1),r=new Date(e,6,1),n=t.getTimezoneOffset(),o=r.getTimezoneOffset(),i=Math.max(n,o);function s(e){var t=e.toTimeString().match(/\(([A-Za-z ]+)\)$/);return t?t[1]:"GMT"}B[Be()>>2]=60*i,B[Le()>>2]=Number(n!=o);var a=s(t),u=s(r),l=$(a),c=$(u);o>2]=l,B[Oe()+4>>2]=c):(B[Oe()>>2]=c,B[Oe()+4>>2]=l)}())}var ge={splitPath:function(e){return/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1)},normalizeArray:function(e,t){for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r;r--)e.unshift("..");return e},normalize:function(e){var t="/"===e.charAt(0),r="/"===e.substr(-1);return(e=ge.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},dirname:function(e){var t=ge.splitPath(e),r=t[0],n=t[1];return r||n?(n&&(n=n.substr(0,n.length-1)),r+n):"."},basename:function(e){if("/"===e)return"/";var t=(e=(e=ge.normalize(e)).replace(/\/$/,"")).lastIndexOf("/");return-1===t?e:e.substr(t+1)},extname:function(e){return ge.splitPath(e)[3]},join:function(){var e=Array.prototype.slice.call(arguments,0);return ge.normalize(e.join("/"))},join2:function(e,t){return ge.normalize(e+"/"+t)}},be={resolve:function(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:Se.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,t="/"===n.charAt(0)}return(t?"/":"")+(e=ge.normalizeArray(e.split("/").filter((function(e){return!!e})),!t).join("/"))||"."},relative:function(e,t){function r(e){for(var t=0;t=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=be.resolve(e).substr(1),t=be.resolve(t).substr(1);for(var n=r(e.split("/")),o=r(t.split("/")),i=Math.min(n.length,o.length),s=i,a=0;a0?r.slice(0,n).toString("utf-8"):null}else"undefined"!=typeof window&&"function"==typeof window.prompt?null!==(t=window.prompt("Input: "))&&(t+="\n"):"function"==typeof readline&&null!==(t=readline())&&(t+="\n");if(!t)return null;e.input=Re(t,!0)}return e.input.shift()},put_char:function(e,t){null===t||10===t?(w(I(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(w(I(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,t){null===t||10===t?(y(I(e.output,0)),e.output=[]):0!=t&&e.output.push(t)},flush:function(e){e.output&&e.output.length>0&&(y(I(e.output,0)),e.output=[])}}};function ye(e){e=function(e,t){return 65536*Math.ceil(e/65536)}(e);var t=Ie(65536,e);return t?(function(e,t){O.fill(0,e,e+t)}(t,e),t):0}var Ee={ops_table:null,mount:function(e){return Ee.createNode(null,"/",16895,0)},createNode:function(e,t,r,n){if(Se.isBlkdev(r)||Se.isFIFO(r))throw new Se.ErrnoError(63);Ee.ops_table||(Ee.ops_table={dir:{node:{getattr:Ee.node_ops.getattr,setattr:Ee.node_ops.setattr,lookup:Ee.node_ops.lookup,mknod:Ee.node_ops.mknod,rename:Ee.node_ops.rename,unlink:Ee.node_ops.unlink,rmdir:Ee.node_ops.rmdir,readdir:Ee.node_ops.readdir,symlink:Ee.node_ops.symlink},stream:{llseek:Ee.stream_ops.llseek}},file:{node:{getattr:Ee.node_ops.getattr,setattr:Ee.node_ops.setattr},stream:{llseek:Ee.stream_ops.llseek,read:Ee.stream_ops.read,write:Ee.stream_ops.write,allocate:Ee.stream_ops.allocate,mmap:Ee.stream_ops.mmap,msync:Ee.stream_ops.msync}},link:{node:{getattr:Ee.node_ops.getattr,setattr:Ee.node_ops.setattr,readlink:Ee.node_ops.readlink},stream:{}},chrdev:{node:{getattr:Ee.node_ops.getattr,setattr:Ee.node_ops.setattr},stream:Se.chrdev_stream_ops}});var o=Se.createNode(e,t,r,n);return Se.isDir(o.mode)?(o.node_ops=Ee.ops_table.dir.node,o.stream_ops=Ee.ops_table.dir.stream,o.contents={}):Se.isFile(o.mode)?(o.node_ops=Ee.ops_table.file.node,o.stream_ops=Ee.ops_table.file.stream,o.usedBytes=0,o.contents=null):Se.isLink(o.mode)?(o.node_ops=Ee.ops_table.link.node,o.stream_ops=Ee.ops_table.link.stream):Se.isChrdev(o.mode)&&(o.node_ops=Ee.ops_table.chrdev.node,o.stream_ops=Ee.ops_table.chrdev.stream),o.timestamp=Date.now(),e&&(e.contents[t]=o,e.timestamp=o.timestamp),o},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array(0)},expandFileStorage:function(e,t){var r=e.contents?e.contents.length:0;if(!(r>=t)){t=Math.max(t,r*(r<1048576?2:1.125)>>>0),0!=r&&(t=Math.max(t,256));var n=e.contents;e.contents=new Uint8Array(t),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,t){if(e.usedBytes!=t)if(0==t)e.contents=null,e.usedBytes=0;else{var r=e.contents;e.contents=new Uint8Array(t),r&&e.contents.set(r.subarray(0,Math.min(t,e.usedBytes))),e.usedBytes=t}},node_ops:{getattr:function(e){var t={};return t.dev=Se.isChrdev(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,Se.isDir(e.mode)?t.size=4096:Se.isFile(e.mode)?t.size=e.usedBytes:Se.isLink(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.blksize=4096,t.blocks=Math.ceil(t.size/t.blksize),t},setattr:function(e,t){void 0!==t.mode&&(e.mode=t.mode),void 0!==t.timestamp&&(e.timestamp=t.timestamp),void 0!==t.size&&Ee.resizeFileStorage(e,t.size)},lookup:function(e,t){throw Se.genericErrors[44]},mknod:function(e,t,r,n){return Ee.createNode(e,t,r,n)},rename:function(e,t,r){if(Se.isDir(e.mode)){var n;try{n=Se.lookupNode(t,r)}catch(e){}if(n)for(var o in n.contents)throw new Se.ErrnoError(55)}delete e.parent.contents[e.name],e.parent.timestamp=Date.now(),e.name=r,t.contents[r]=e,t.timestamp=e.parent.timestamp,e.parent=t},unlink:function(e,t){delete e.contents[t],e.timestamp=Date.now()},rmdir:function(e,t){var r=Se.lookupNode(e,t);for(var n in r.contents)throw new Se.ErrnoError(55);delete e.contents[t],e.timestamp=Date.now()},readdir:function(e){var t=[".",".."];for(var r in e.contents)e.contents.hasOwnProperty(r)&&t.push(r);return t},symlink:function(e,t,r){var n=Ee.createNode(e,t,41471,0);return n.link=r,n},readlink:function(e){if(!Se.isLink(e.mode))throw new Se.ErrnoError(28);return e.link}},stream_ops:{read:function(e,t,r,n,o){var i=e.node.contents;if(o>=e.node.usedBytes)return 0;var s=Math.min(e.node.usedBytes-o,n);if(s>8&&i.subarray)t.set(i.subarray(o,o+s),r);else for(var a=0;a0||n+r8)throw new Se.ErrnoError(32);for(var o=ge.normalizeArray(e.split("/").filter((function(e){return!!e})),!1),i=Se.root,s="/",a=0;a40)throw new Se.ErrnoError(32)}}return{path:s,node:i}},getPath:function(e){for(var t;;){if(Se.isRoot(e)){var r=e.mount.mountpoint;return t?"/"!==r[r.length-1]?r+"/"+t:r+t:r}t=t?e.name+"/"+t:e.name,e=e.parent}},hashName:function(e,t){for(var r=0,n=0;n>>0)%Se.nameTable.length},hashAddNode:function(e){var t=Se.hashName(e.parent.id,e.name);e.name_next=Se.nameTable[t],Se.nameTable[t]=e},hashRemoveNode:function(e){var t=Se.hashName(e.parent.id,e.name);if(Se.nameTable[t]===e)Se.nameTable[t]=e.name_next;else for(var r=Se.nameTable[t];r;){if(r.name_next===e){r.name_next=e.name_next;break}r=r.name_next}},lookupNode:function(e,t){var r=Se.mayLookup(e);if(r)throw new Se.ErrnoError(r,e);for(var n=Se.hashName(e.id,t),o=Se.nameTable[n];o;o=o.name_next){var i=o.name;if(o.parent.id===e.id&&i===t)return o}return Se.lookup(e,t)},createNode:function(e,t,r,n){var o=new Se.FSNode(e,t,r,n);return Se.hashAddNode(o),o},destroyNode:function(e){Se.hashRemoveNode(e)},isRoot:function(e){return e===e.parent},isMountpoint:function(e){return!!e.mounted},isFile:function(e){return 32768==(61440&e)},isDir:function(e){return 16384==(61440&e)},isLink:function(e){return 40960==(61440&e)},isChrdev:function(e){return 8192==(61440&e)},isBlkdev:function(e){return 24576==(61440&e)},isFIFO:function(e){return 4096==(61440&e)},isSocket:function(e){return 49152==(49152&e)},flagModes:{r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},modeStringToFlags:function(e){var t=Se.flagModes[e];if(void 0===t)throw new Error("Unknown file open mode: "+e);return t},flagsToPermissionString:function(e){var t=["r","w","rw"][3&e];return 512&e&&(t+="w"),t},nodePermissions:function(e,t){return Se.ignorePermissions||(!t.includes("r")||292&e.mode)&&(!t.includes("w")||146&e.mode)&&(!t.includes("x")||73&e.mode)?0:2},mayLookup:function(e){return Se.nodePermissions(e,"x")||(e.node_ops.lookup?0:2)},mayCreate:function(e,t){try{return Se.lookupNode(e,t),20}catch(e){}return Se.nodePermissions(e,"wx")},mayDelete:function(e,t,r){var n;try{n=Se.lookupNode(e,t)}catch(e){return e.errno}var o=Se.nodePermissions(e,"wx");if(o)return o;if(r){if(!Se.isDir(n.mode))return 54;if(Se.isRoot(n)||Se.getPath(n)===Se.cwd())return 10}else if(Se.isDir(n.mode))return 31;return 0},mayOpen:function(e,t){return e?Se.isLink(e.mode)?32:Se.isDir(e.mode)&&("r"!==Se.flagsToPermissionString(t)||512&t)?31:Se.nodePermissions(e,Se.flagsToPermissionString(t)):44},MAX_OPEN_FDS:4096,nextfd:function(e,t){e=e||0,t=t||Se.MAX_OPEN_FDS;for(var r=e;r<=t;r++)if(!Se.streams[r])return r;throw new Se.ErrnoError(33)},getStream:function(e){return Se.streams[e]},createStream:function(e,t,r){Se.FSStream||(Se.FSStream=function(){},Se.FSStream.prototype={object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}});var n=new Se.FSStream;for(var o in e)n[o]=e[o];e=n;var i=Se.nextfd(t,r);return e.fd=i,Se.streams[i]=e,e},closeStream:function(e){Se.streams[e]=null},chrdev_stream_ops:{open:function(e){var t=Se.getDevice(e.node.rdev);e.stream_ops=t.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:function(){throw new Se.ErrnoError(70)}},major:function(e){return e>>8},minor:function(e){return 255&e},makedev:function(e,t){return e<<8|t},registerDevice:function(e,t){Se.devices[e]={stream_ops:t}},getDevice:function(e){return Se.devices[e]},getMounts:function(e){for(var t=[],r=[e];r.length;){var n=r.pop();t.push(n),r.push.apply(r,n.mounts)}return t},syncfs:function(e,t){"function"==typeof e&&(t=e,e=!1),Se.syncFSRequests++,Se.syncFSRequests>1&&y("warning: "+Se.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var r=Se.getMounts(Se.root.mount),n=0;function o(e){return Se.syncFSRequests--,t(e)}function i(e){if(e)return i.errored?void 0:(i.errored=!0,o(e));++n>=r.length&&o(null)}r.forEach((function(t){if(!t.type.syncfs)return i(null);t.type.syncfs(t,e,i)}))},mount:function(e,t,r){var n,o="/"===r,i=!r;if(o&&Se.root)throw new Se.ErrnoError(10);if(!o&&!i){var s=Se.lookupPath(r,{follow_mount:!1});if(r=s.path,n=s.node,Se.isMountpoint(n))throw new Se.ErrnoError(10);if(!Se.isDir(n.mode))throw new Se.ErrnoError(54)}var a={type:e,opts:t,mountpoint:r,mounts:[]},u=e.mount(a);return u.mount=a,a.root=u,o?Se.root=u:n&&(n.mounted=a,n.mount&&n.mount.mounts.push(a)),u},unmount:function(e){var t=Se.lookupPath(e,{follow_mount:!1});if(!Se.isMountpoint(t.node))throw new Se.ErrnoError(28);var r=t.node,n=r.mounted,o=Se.getMounts(n);Object.keys(Se.nameTable).forEach((function(e){for(var t=Se.nameTable[e];t;){var r=t.name_next;o.includes(t.mount)&&Se.destroyNode(t),t=r}})),r.mounted=null;var i=r.mount.mounts.indexOf(n);r.mount.mounts.splice(i,1)},lookup:function(e,t){return e.node_ops.lookup(e,t)},mknod:function(e,t,r){var n=Se.lookupPath(e,{parent:!0}).node,o=ge.basename(e);if(!o||"."===o||".."===o)throw new Se.ErrnoError(28);var i=Se.mayCreate(n,o);if(i)throw new Se.ErrnoError(i);if(!n.node_ops.mknod)throw new Se.ErrnoError(63);return n.node_ops.mknod(n,o,t,r)},create:function(e,t){return t=void 0!==t?t:438,t&=4095,t|=32768,Se.mknod(e,t,0)},mkdir:function(e,t){return t=void 0!==t?t:511,t&=1023,t|=16384,Se.mknod(e,t,0)},mkdirTree:function(e,t){for(var r=e.split("/"),n="",o=0;othis.length-1||e<0)){var t=e%this.chunkSize,r=e/this.chunkSize|0;return this.getter(r)[t]}},i.prototype.setDataGetter=function(e){this.getter=e},i.prototype.cacheLength=function(){var e=new XMLHttpRequest;if(e.open("HEAD",r,!1),e.send(null),!(e.status>=200&&e.status<300||304===e.status))throw new Error("Couldn't load "+r+". Status: "+e.status);var t,n=Number(e.getResponseHeader("Content-length")),o=(t=e.getResponseHeader("Accept-Ranges"))&&"bytes"===t,i=(t=e.getResponseHeader("Content-Encoding"))&&"gzip"===t,s=1048576;o||(s=n);var a=this;a.setDataGetter((function(e){var t=e*s,o=(e+1)*s-1;if(o=Math.min(o,n-1),void 0===a.chunks[e]&&(a.chunks[e]=function(e,t){if(e>t)throw new Error("invalid range ("+e+", "+t+") or no bytes requested!");if(t>n-1)throw new Error("only "+n+" bytes available! programmer error!");var o=new XMLHttpRequest;if(o.open("GET",r,!1),n!==s&&o.setRequestHeader("Range","bytes="+e+"-"+t),"undefined"!=typeof Uint8Array&&(o.responseType="arraybuffer"),o.overrideMimeType&&o.overrideMimeType("text/plain; charset=x-user-defined"),o.send(null),!(o.status>=200&&o.status<300||304===o.status))throw new Error("Couldn't load "+r+". Status: "+o.status);return void 0!==o.response?new Uint8Array(o.response||[]):Re(o.responseText||"",!0)}(t,o)),void 0===a.chunks[e])throw new Error("doXHR failed!");return a.chunks[e]})),!i&&n||(s=n=1,n=this.getter(0).length,s=n,w("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=n,this._chunkSize=s,this.lengthKnown=!0},"undefined"!=typeof XMLHttpRequest){if(!v)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var s=new i;Object.defineProperties(s,{length:{get:function(){return this.lengthKnown||this.cacheLength(),this._length}},chunkSize:{get:function(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}});var a={isDevice:!1,contents:s}}else a={isDevice:!1,url:r};var u=Se.createFile(e,t,a,n,o);a.contents?u.contents=a.contents:a.url&&(u.contents=null,u.url=a.url),Object.defineProperties(u,{usedBytes:{get:function(){return this.contents.length}}});var l={};return Object.keys(u.stream_ops).forEach((function(e){var t=u.stream_ops[e];l[e]=function(){return Se.forceLoadFile(u),t.apply(null,arguments)}})),l.read=function(e,t,r,n,o){Se.forceLoadFile(u);var i=e.node.contents;if(o>=i.length)return 0;var s=Math.min(i.length-o,n);if(i.slice)for(var a=0;a>2]=n.dev,B[r+4>>2]=0,B[r+8>>2]=n.ino,B[r+12>>2]=n.mode,B[r+16>>2]=n.nlink,B[r+20>>2]=n.uid,B[r+24>>2]=n.gid,B[r+28>>2]=n.rdev,B[r+32>>2]=0,ee=[n.size>>>0,(Z=n.size,+Math.abs(Z)>=1?Z>0?(0|Math.min(+Math.floor(Z/4294967296),4294967295))>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],B[r+40>>2]=ee[0],B[r+44>>2]=ee[1],B[r+48>>2]=4096,B[r+52>>2]=n.blocks,B[r+56>>2]=n.atime.getTime()/1e3|0,B[r+60>>2]=0,B[r+64>>2]=n.mtime.getTime()/1e3|0,B[r+68>>2]=0,B[r+72>>2]=n.ctime.getTime()/1e3|0,B[r+76>>2]=0,ee=[n.ino>>>0,(Z=n.ino,+Math.abs(Z)>=1?Z>0?(0|Math.min(+Math.floor(Z/4294967296),4294967295))>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],B[r+80>>2]=ee[0],B[r+84>>2]=ee[1],0},doMsync:function(e,t,r,n,o){var i=O.slice(e,e+r);Se.msync(t,i,o,r,n)},doMkdir:function(e,t){return"/"===(e=ge.normalize(e))[e.length-1]&&(e=e.substr(0,e.length-1)),Se.mkdir(e,t,0),0},doMknod:function(e,t,r){switch(61440&t){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}return Se.mknod(e,t,r),0},doReadlink:function(e,t,r){if(r<=0)return-28;var n=Se.readlink(e),o=Math.min(r,G(n)),i=C[t+o];return X(n,t,r+1),C[t+o]=i,o},doAccess:function(e,t){if(-8&t)return-28;var r=Se.lookupPath(e,{follow:!0}).node;if(!r)return-44;var n="";return 4&t&&(n+="r"),2&t&&(n+="w"),1&t&&(n+="x"),n&&Se.nodePermissions(r,n)?-2:0},doDup:function(e,t,r){var n=Se.getStream(r);return n&&Se.close(n),Se.open(e,t,0,r,r).fd},doReadv:function(e,t,r,n){for(var o=0,i=0;i>2],a=B[t+(8*i+4)>>2],u=Se.read(e,C,s,a,n);if(u<0)return-1;if(o+=u,u>2],a=B[t+(8*i+4)>>2],u=Se.write(e,C,s,a,n);if(u<0)return-1;o+=u}return o},varargs:void 0,get:function(){return qe.varargs+=4,B[qe.varargs-4>>2]},getStr:function(e){return V(e)},getStreamFromFD:function(e){var t=Se.getStream(e);if(!t)throw new Se.ErrnoError(8);return t},get64:function(e,t){return e}};function xe(e){return B[je()>>2]=e,e}function De(e){try{return D.grow(e-T.byteLength+65535>>>16),K(D.buffer),1}catch(e){}}ke=g?function(){var e=process.hrtime();return 1e3*e[0]+e[1]/1e6}:function(){return performance.now()};var Me={};function Fe(){if(!Fe.strings){var e={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",_:p||"./this.program"};for(var t in Me)void 0===Me[t]?delete e[t]:e[t]=Me[t];var r=[];for(var t in e)r.push(t+"="+e[t]);Fe.strings=r}return Fe.strings}var Ae=function(e,t,r,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=Se.nextInode++,this.name=t,this.mode=r,this.node_ops={},this.stream_ops={},this.rdev=n};function Re(e,t,r){var n=r>0?r:G(e)+1,o=new Array(n),i=W(e,o,0,o.length);return t&&(o.length=i),o}Object.defineProperties(Ae.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}},isFolder:{get:function(){return Se.isDir(this.mode)}},isDevice:{get:function(){return Se.isChrdev(this.mode)}}}),Se.FSNode=Ae,Se.staticInit();var Pe,ze={a:function(e,t,r,n){le("Assertion failed: "+V(e)+", at: "+[t?V(t):"unknown filename",r,n?V(n):"unknown function"])},y:function(e,t){return function(e,t){ve();var r=new Date(1e3*B[e>>2]);B[t>>2]=r.getSeconds(),B[t+4>>2]=r.getMinutes(),B[t+8>>2]=r.getHours(),B[t+12>>2]=r.getDate(),B[t+16>>2]=r.getMonth(),B[t+20>>2]=r.getFullYear()-1900,B[t+24>>2]=r.getDay();var n=new Date(r.getFullYear(),0,1),o=(r.getTime()-n.getTime())/864e5|0;B[t+28>>2]=o,B[t+36>>2]=-60*r.getTimezoneOffset();var i=new Date(r.getFullYear(),6,1).getTimezoneOffset(),s=n.getTimezoneOffset(),a=0|(i!=s&&r.getTimezoneOffset()==Math.min(s,i));B[t+32>>2]=a;var u=B[Oe()+(a?4:0)>>2];return B[t+40>>2]=u,t}(e,t)},k:function(e,t){try{return e=qe.getStr(e),qe.doAccess(e,t)}catch(e){if(void 0===Se||!(e instanceof Se.ErrnoError))throw e;return-e.errno}},i:function(e,t){try{return e=qe.getStr(e),Se.chmod(e,t),0}catch(e){if(void 0===Se||!(e instanceof Se.ErrnoError))throw e;return-e.errno}},g:function(e,t,r){try{return e=qe.getStr(e),Se.chown(e,t,r),0}catch(e){if(void 0===Se||!(e instanceof Se.ErrnoError))throw e;return-e.errno}},j:function(e,t){try{return Se.fchmod(e,t),0}catch(e){if(void 0===Se||!(e instanceof Se.ErrnoError))throw e;return-e.errno}},h:function(e,t,r){try{return Se.fchown(e,t,r),0}catch(e){if(void 0===Se||!(e instanceof Se.ErrnoError))throw e;return-e.errno}},b:function(e,t,r){qe.varargs=r;try{var n=qe.getStreamFromFD(e);switch(t){case 0:return(o=qe.get())<0?-28:Se.open(n.path,n.flags,0,o).fd;case 1:case 2:return 0;case 3:return n.flags;case 4:var o=qe.get();return n.flags|=o,0;case 5:return o=qe.get(),L[o+0>>1]=2,0;case 6:case 7:return 0;case 16:case 8:return-28;case 9:return xe(28),-1;default:return-28}}catch(e){if(void 0===Se||!(e instanceof Se.ErrnoError))throw e;return-e.errno}},J:function(e,t){try{var r=qe.getStreamFromFD(e);return qe.doStat(Se.stat,r.path,t)}catch(e){if(void 0===Se||!(e instanceof Se.ErrnoError))throw e;return-e.errno}},G:function(e,t,r,n){try{t=qe.getStr(t);var o=256&n,i=4096&n;return n&=-4353,t=qe.calculateAt(e,t,i),qe.doStat(o?Se.lstat:Se.stat,t,r)}catch(e){if(void 0===Se||!(e instanceof Se.ErrnoError))throw e;return-e.errno}},E:function(e,t,r){try{var n=qe.get64(t,r);return Se.ftruncate(e,n),0}catch(e){if(void 0===Se||!(e instanceof Se.ErrnoError))throw e;return-e.errno}},D:function(e,t){try{if(0===t)return-28;var r=Se.cwd();return t>>=0)>n)return!1;for(var o=1;o<=4;o*=2){var i=r*(1+.2/o);if(i=Math.min(i,e+100663296),De(Math.min(n,((t=Math.max(e,i))%65536>0&&(t+=65536-t%65536),t))))return!0}return!1},B:function(e,t){var r=0;return Fe().forEach((function(n,o){var i=t+r;B[e+4*o>>2]=i,function(e,t,r){for(var n=0;n>0]=e.charCodeAt(n);C[t>>0]=0}(n,i),r+=n.length+1})),0},C:function(e,t){var r=Fe();B[e>>2]=r.length;var n=0;return r.forEach((function(e){n+=e.length+1})),B[t>>2]=n,0},d:function(e){try{var t=qe.getStreamFromFD(e);return Se.close(t),0}catch(e){if(void 0===Se||!(e instanceof Se.ErrnoError))throw e;return e.errno}},o:function(e,t){try{var r=qe.getStreamFromFD(e),n=r.tty?2:Se.isDir(r.mode)?3:Se.isLink(r.mode)?7:4;return C[t>>0]=n,0}catch(e){if(void 0===Se||!(e instanceof Se.ErrnoError))throw e;return e.errno}},t:function(e,t,r,n){try{var o=qe.getStreamFromFD(e),i=qe.doReadv(o,t,r);return B[n>>2]=i,0}catch(e){if(void 0===Se||!(e instanceof Se.ErrnoError))throw e;return e.errno}},l:function(e,t,r,n,o){try{var i=qe.getStreamFromFD(e),s=4294967296*r+(t>>>0),a=9007199254740992;return s<=-a||s>=a?-61:(Se.llseek(i,s,n),ee=[i.position>>>0,(Z=i.position,+Math.abs(Z)>=1?Z>0?(0|Math.min(+Math.floor(Z/4294967296),4294967295))>>>0:~~+Math.ceil((Z-+(~~Z>>>0))/4294967296)>>>0:0)],B[o>>2]=ee[0],B[o+4>>2]=ee[1],i.getdents&&0===s&&0===n&&(i.getdents=null),0)}catch(e){if(void 0===Se||!(e instanceof Se.ErrnoError))throw e;return e.errno}},F:function(e){try{var t=qe.getStreamFromFD(e);return t.stream_ops&&t.stream_ops.fsync?-t.stream_ops.fsync(t):0}catch(e){if(void 0===Se||!(e instanceof Se.ErrnoError))throw e;return e.errno}},n:function(e,t,r,n){try{var o=qe.getStreamFromFD(e),i=qe.doWritev(o,t,r);return B[n>>2]=i,0}catch(e){if(void 0===Se||!(e instanceof Se.ErrnoError))throw e;return e.errno}},f:function(e){var t=Date.now();return B[e>>2]=t/1e3|0,B[e+4>>2]=t%1e3*1e3|0,0},K:function(e){var t=Date.now()/1e3|0;return e&&(B[e>>2]=t),t},A:function(e,t){var r;if(t){var n=t+8;r=1e3*B[n>>2],r+=B[n+4>>2]/1e3}else r=Date.now();return function(e,t){e=V(e);try{return Se.utime(e,t,t),0}catch(e){if(!(e instanceof Se.ErrnoError))throw e+" : "+(r=function(){var e=new Error;if(!e.stack){try{throw new Error}catch(t){e=t}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}(),i.extraStackTrace&&(r+="\n"+i.extraStackTrace()),r.replace(/\b_Z[\w\d_]+/g,(function(e){return e==e?e:e+" ["+e+"]"})));return xe(e.errno),-1}var r}(e,r)}},je=(function(){var e={a:ze};function t(e,t){var r,n=e.exports;i.asm=n,K((D=i.asm.L).buffer),Y=i.asm.Fa,r=i.asm.M,re.unshift(r),ue()}function r(e){t(e.instance)}function n(t){return function(){if(!k&&(_||v)){if("function"==typeof fetch&&!fe(Q))return fetch(Q,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+Q+"'";return e.arrayBuffer()})).catch((function(){return de(Q)}));if(u)return new Promise((function(e,t){u(Q,(function(t){e(new Uint8Array(t))}),t)}))}return Promise.resolve().then((function(){return de(Q)}))}().then((function(t){return WebAssembly.instantiate(t,e)})).then((function(e){return e})).then(t,(function(e){y("failed to asynchronously prepare wasm: "+e),le(e)}))}if(ae(),i.instantiateWasm)try{return i.instantiateWasm(e,t)}catch(e){return y("Module.instantiateWasm callback failed with error: "+e),!1}k||"function"!=typeof WebAssembly.instantiateStreaming||ce(Q)||fe(Q)||"function"!=typeof fetch?n(r):fetch(Q,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(r,(function(e){return y("wasm streaming compile failed: "+e),y("falling back to ArrayBuffer instantiation"),n(r)}))}))}(),i.___wasm_call_ctors=function(){return(i.___wasm_call_ctors=i.asm.M).apply(null,arguments)},i._sqlite3_malloc=function(){return(i._sqlite3_malloc=i.asm.N).apply(null,arguments)},i._sqlite3_free=function(){return(i._sqlite3_free=i.asm.O).apply(null,arguments)},i.___errno_location=function(){return(je=i.___errno_location=i.asm.P).apply(null,arguments)}),Te=(i._sqlite3_finalize=function(){return(i._sqlite3_finalize=i.asm.Q).apply(null,arguments)},i._sqlite3_reset=function(){return(i._sqlite3_reset=i.asm.R).apply(null,arguments)},i._sqlite3_clear_bindings=function(){return(i._sqlite3_clear_bindings=i.asm.S).apply(null,arguments)},i._sqlite3_value_blob=function(){return(i._sqlite3_value_blob=i.asm.T).apply(null,arguments)},i._sqlite3_value_text=function(){return(i._sqlite3_value_text=i.asm.U).apply(null,arguments)},i._sqlite3_value_bytes=function(){return(i._sqlite3_value_bytes=i.asm.V).apply(null,arguments)},i._sqlite3_value_double=function(){return(i._sqlite3_value_double=i.asm.W).apply(null,arguments)},i._sqlite3_value_int=function(){return(i._sqlite3_value_int=i.asm.X).apply(null,arguments)},i._sqlite3_value_type=function(){return(i._sqlite3_value_type=i.asm.Y).apply(null,arguments)},i._sqlite3_result_blob=function(){return(i._sqlite3_result_blob=i.asm.Z).apply(null,arguments)},i._sqlite3_result_double=function(){return(i._sqlite3_result_double=i.asm._).apply(null,arguments)},i._sqlite3_result_error=function(){return(i._sqlite3_result_error=i.asm.$).apply(null,arguments)},i._sqlite3_result_int=function(){return(i._sqlite3_result_int=i.asm.aa).apply(null,arguments)},i._sqlite3_result_int64=function(){return(i._sqlite3_result_int64=i.asm.ba).apply(null,arguments)},i._sqlite3_result_null=function(){return(i._sqlite3_result_null=i.asm.ca).apply(null,arguments)},i._sqlite3_result_text=function(){return(i._sqlite3_result_text=i.asm.da).apply(null,arguments)},i._sqlite3_step=function(){return(i._sqlite3_step=i.asm.ea).apply(null,arguments)},i._sqlite3_column_count=function(){return(i._sqlite3_column_count=i.asm.fa).apply(null,arguments)},i._sqlite3_data_count=function(){return(i._sqlite3_data_count=i.asm.ga).apply(null,arguments)},i._sqlite3_column_blob=function(){return(i._sqlite3_column_blob=i.asm.ha).apply(null,arguments)},i._sqlite3_column_bytes=function(){return(i._sqlite3_column_bytes=i.asm.ia).apply(null,arguments)},i._sqlite3_column_double=function(){return(i._sqlite3_column_double=i.asm.ja).apply(null,arguments)},i._sqlite3_column_text=function(){return(i._sqlite3_column_text=i.asm.ka).apply(null,arguments)},i._sqlite3_column_type=function(){return(i._sqlite3_column_type=i.asm.la).apply(null,arguments)},i._sqlite3_column_name=function(){return(i._sqlite3_column_name=i.asm.ma).apply(null,arguments)},i._sqlite3_bind_blob=function(){return(i._sqlite3_bind_blob=i.asm.na).apply(null,arguments)},i._sqlite3_bind_double=function(){return(i._sqlite3_bind_double=i.asm.oa).apply(null,arguments)},i._sqlite3_bind_int=function(){return(i._sqlite3_bind_int=i.asm.pa).apply(null,arguments)},i._sqlite3_bind_text=function(){return(i._sqlite3_bind_text=i.asm.qa).apply(null,arguments)},i._sqlite3_bind_parameter_index=function(){return(i._sqlite3_bind_parameter_index=i.asm.ra).apply(null,arguments)},i._sqlite3_sql=function(){return(i._sqlite3_sql=i.asm.sa).apply(null,arguments)},i._sqlite3_normalized_sql=function(){return(i._sqlite3_normalized_sql=i.asm.ta).apply(null,arguments)},i._sqlite3_errmsg=function(){return(i._sqlite3_errmsg=i.asm.ua).apply(null,arguments)},i._sqlite3_exec=function(){return(i._sqlite3_exec=i.asm.va).apply(null,arguments)},i._sqlite3_prepare_v2=function(){return(i._sqlite3_prepare_v2=i.asm.wa).apply(null,arguments)},i._sqlite3_create_module_v2=function(){return(i._sqlite3_create_module_v2=i.asm.xa).apply(null,arguments)},i._sqlite3_declare_vtab=function(){return(i._sqlite3_declare_vtab=i.asm.ya).apply(null,arguments)},i._sqlite3_changes=function(){return(i._sqlite3_changes=i.asm.za).apply(null,arguments)},i._sqlite3_close_v2=function(){return(i._sqlite3_close_v2=i.asm.Aa).apply(null,arguments)},i._sqlite3_create_function_v2=function(){return(i._sqlite3_create_function_v2=i.asm.Ba).apply(null,arguments)},i._sqlite3_open=function(){return(i._sqlite3_open=i.asm.Ca).apply(null,arguments)},i._malloc=function(){return(Te=i._malloc=i.asm.Da).apply(null,arguments)}),Ce=i._free=function(){return(Ce=i._free=i.asm.Ea).apply(null,arguments)},Oe=(i._RegisterExtensionFunctions=function(){return(i._RegisterExtensionFunctions=i.asm.Ga).apply(null,arguments)},i.__get_tzname=function(){return(Oe=i.__get_tzname=i.asm.Ha).apply(null,arguments)}),Le=i.__get_daylight=function(){return(Le=i.__get_daylight=i.asm.Ia).apply(null,arguments)},Be=i.__get_timezone=function(){return(Be=i.__get_timezone=i.asm.Ja).apply(null,arguments)},Ne=i.stackSave=function(){return(Ne=i.stackSave=i.asm.Ka).apply(null,arguments)},He=i.stackRestore=function(){return(He=i.stackRestore=i.asm.La).apply(null,arguments)},Ue=i.stackAlloc=function(){return(Ue=i.stackAlloc=i.asm.Ma).apply(null,arguments)},Ie=i._memalign=function(){return(Ie=i._memalign=i.asm.Na).apply(null,arguments)};function Ve(e){function t(){Pe||(Pe=!0,i.calledRun=!0,A||(i.noFSInit||Se.init.initialized||Se.init(),Se.ignorePermissions=!1,we.init(),he(re),i.onRuntimeInitialized&&i.onRuntimeInitialized(),function(){if(i.postRun)for("function"==typeof i.postRun&&(i.postRun=[i.postRun]);i.postRun.length;)e=i.postRun.shift(),ne.unshift(e);var e;he(ne)}()))}e=e||m,oe>0||(function(){if(i.preRun)for("function"==typeof i.preRun&&(i.preRun=[i.preRun]);i.preRun.length;)e=i.preRun.shift(),te.unshift(e);var e;he(te)}(),oe>0||(i.setStatus?(i.setStatus("Running..."),setTimeout((function(){setTimeout((function(){i.setStatus("")}),1),t()}),1)):t()))}if(i.ccall=P,i.cwrap=function(e,t,r,n){var o=(r=r||[]).every((function(e){return"number"===e}));return"string"!==t&&o&&!n?R(e):function(){return P(e,t,r,arguments)}},i.setValue=M,i.getValue=F,i.UTF8ToString=V,i.stringToUTF8=X,i.lengthBytesUTF8=G,i.addFunction=q,i.stackSave=Ne,i.stackRestore=He,i.stackAlloc=Ue,se=function e(){Pe||Ve(),Pe||(se=e)},i.run=Ve,i.preInit)for("function"==typeof i.preInit&&(i.preInit=[i.preInit]);i.preInit.length>0;)i.preInit.pop()();return Ve(),i})))};"object"==typeof t&&"object"==typeof e?(e.exports=n,e.exports.default=n):"function"==typeof define&&define.amd?define([],(function(){return n})):"object"==typeof t&&(t.Module=n)},720:(e,t,r)=>{"use strict";e.exports=r.p+"sql-wasm.wasm"}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.exports}__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.p="";var __webpack_exports__=__webpack_require__(630);return __webpack_exports__})()})); //# sourceMappingURL=sqlite.worker.js.map