UNPKG

jeep-sqlite

Version:
7 lines 307 kB
import{r as t,c as e,g as r}from"./p-2873ae8c.js";const n=typeof global!=="undefined"?global:typeof self!=="undefined"?self:typeof window!=="undefined"?window:{};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}var o=i;var a=s;if(typeof n.setTimeout==="function"){o=setTimeout}if(typeof n.clearTimeout==="function"){a=clearTimeout}function u(t){if(o===setTimeout){return setTimeout(t,0)}if((o===i||!o)&&setTimeout){o=setTimeout;return setTimeout(t,0)}try{return o(t,0)}catch(e){try{return o.call(null,t,0)}catch(e){return o.call(this,t,0)}}}function f(t){if(a===clearTimeout){return clearTimeout(t)}if((a===s||!a)&&clearTimeout){a=clearTimeout;return clearTimeout(t)}try{return a(t)}catch(e){try{return a.call(null,t)}catch(e){return a.call(this,t)}}}var c=[];var h=false;var l;var d=-1;function m(){if(!h||!l){return}h=false;if(l.length){c=l.concat(c)}else{d=-1}if(c.length){w()}}function w(){if(h){return}var t=u(m);h=true;var e=c.length;while(e){l=c;c=[];while(++d<e){if(l){l[d].run()}}d=-1;e=c.length}l=null;h=false;f(t)}function v(t){var e=new Array(arguments.length-1);if(arguments.length>1){for(var r=1;r<arguments.length;r++){e[r-1]=arguments[r]}}c.push(new y(t,e));if(c.length===1&&!h){u(w)}}function y(t,e){this.fun=t;this.array=e}y.prototype.run=function(){this.fun.apply(null,this.array)};var b="browser";var p="browser";var E=true;var g={};var P=[];var S="";var T={};var $={};var k={};function O(){}var A=O;var _=O;var R=O;var N=O;var D=O;var j=O;var I=O;function C(t){throw new Error("process.binding is not supported")}function M(){return"/"}function x(t){throw new Error("process.chdir is not supported")}function L(){return 0}var B=n.performance||{};var F=B.now||B.mozNow||B.msNow||B.oNow||B.webkitNow||function(){return(new Date).getTime()};function U(t){var e=F.call(B)*.001;var r=Math.floor(e);var n=Math.floor(e%1*1e9);if(t){r=r-t[0];n=n-t[1];if(n<0){r--;n+=1e9}}return[r,n]}var q=new Date;function W(){var t=new Date;var e=t-q;return e/1e3}var G={nextTick:v,title:b,browser:E,env:g,argv:P,version:S,versions:T,on:A,addListener:_,once:R,off:N,removeListener:D,removeAllListeners:j,emit:I,binding:C,cwd:M,chdir:x,umask:L,hrtime:U,platform:p,release:$,config:k,uptime:W};const z=G;const H="/Volumes/Development_Lacie/Development/latest/jeep-sqlite/node_modules/sql.js/dist";var V=[];var Q=[];var K=typeof Uint8Array!=="undefined"?Uint8Array:Array;var Z=false;function J(){Z=true;var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var e=0,r=t.length;e<r;++e){V[e]=t[e];Q[t.charCodeAt(e)]=e}Q["-".charCodeAt(0)]=62;Q["_".charCodeAt(0)]=63}function X(t){if(!Z){J()}var e,r,n,i,s,o;var a=t.length;if(a%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}s=t[a-2]==="="?2:t[a-1]==="="?1:0;o=new K(a*3/4-s);n=s>0?a-4:a;var u=0;for(e=0,r=0;e<n;e+=4,r+=3){i=Q[t.charCodeAt(e)]<<18|Q[t.charCodeAt(e+1)]<<12|Q[t.charCodeAt(e+2)]<<6|Q[t.charCodeAt(e+3)];o[u++]=i>>16&255;o[u++]=i>>8&255;o[u++]=i&255}if(s===2){i=Q[t.charCodeAt(e)]<<2|Q[t.charCodeAt(e+1)]>>4;o[u++]=i&255}else if(s===1){i=Q[t.charCodeAt(e)]<<10|Q[t.charCodeAt(e+1)]<<4|Q[t.charCodeAt(e+2)]>>2;o[u++]=i>>8&255;o[u++]=i&255}return o}function Y(t){return V[t>>18&63]+V[t>>12&63]+V[t>>6&63]+V[t&63]}function tt(t,e,r){var n;var i=[];for(var s=e;s<r;s+=3){n=(t[s]<<16)+(t[s+1]<<8)+t[s+2];i.push(Y(n))}return i.join("")}function et(t){if(!Z){J()}var e;var r=t.length;var n=r%3;var i="";var s=[];var o=16383;for(var a=0,u=r-n;a<u;a+=o){s.push(tt(t,a,a+o>u?u:a+o))}if(n===1){e=t[r-1];i+=V[e>>2];i+=V[e<<4&63];i+="=="}else if(n===2){e=(t[r-2]<<8)+t[r-1];i+=V[e>>10];i+=V[e>>4&63];i+=V[e<<2&63];i+="="}s.push(i);return s.join("")}function rt(t,e,r,n,i){var s,o;var a=i*8-n-1;var u=(1<<a)-1;var f=u>>1;var c=-7;var h=r?i-1:0;var l=r?-1:1;var d=t[e+h];h+=l;s=d&(1<<-c)-1;d>>=-c;c+=a;for(;c>0;s=s*256+t[e+h],h+=l,c-=8){}o=s&(1<<-c)-1;s>>=-c;c+=n;for(;c>0;o=o*256+t[e+h],h+=l,c-=8){}if(s===0){s=1-f}else if(s===u){return o?NaN:(d?-1:1)*Infinity}else{o=o+Math.pow(2,n);s=s-f}return(d?-1:1)*o*Math.pow(2,s-n)}function nt(t,e,r,n,i,s){var o,a,u;var f=s*8-i-1;var c=(1<<f)-1;var h=c>>1;var l=i===23?Math.pow(2,-24)-Math.pow(2,-77):0;var d=n?0:s-1;var m=n?1:-1;var w=e<0||e===0&&1/e<0?1:0;e=Math.abs(e);if(isNaN(e)||e===Infinity){a=isNaN(e)?1:0;o=c}else{o=Math.floor(Math.log(e)/Math.LN2);if(e*(u=Math.pow(2,-o))<1){o--;u*=2}if(o+h>=1){e+=l/u}else{e+=l*Math.pow(2,1-h)}if(e*u>=2){o++;u/=2}if(o+h>=c){a=0;o=c}else if(o+h>=1){a=(e*u-1)*Math.pow(2,i);o=o+h}else{a=e*Math.pow(2,h-1)*Math.pow(2,i);o=0}}for(;i>=8;t[r+d]=a&255,d+=m,a/=256,i-=8){}o=o<<i|a;f+=i;for(;f>0;t[r+d]=o&255,d+=m,o/=256,f-=8){}t[r+d-m]|=w*128}var it={}.toString;var st=Array.isArray||function(t){return it.call(t)=="[object Array]"}; /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org> * @license MIT */var ot=50;ft.TYPED_ARRAY_SUPPORT=n.TYPED_ARRAY_SUPPORT!==undefined?n.TYPED_ARRAY_SUPPORT:true;function at(){return ft.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function ut(t,e){if(at()<e){throw new RangeError("Invalid typed array length")}if(ft.TYPED_ARRAY_SUPPORT){t=new Uint8Array(e);t.__proto__=ft.prototype}else{if(t===null){t=new ft(e)}t.length=e}return t}function ft(t,e,r){if(!ft.TYPED_ARRAY_SUPPORT&&!(this instanceof ft)){return new ft(t,e,r)}if(typeof t==="number"){if(typeof e==="string"){throw new Error("If encoding is specified then the first argument must be a string")}return dt(this,t)}return ct(this,t,e,r)}ft.poolSize=8192;ft._augment=function(t){t.__proto__=ft.prototype;return t};function ct(t,e,r,n){if(typeof e==="number"){throw new TypeError('"value" argument must not be a number')}if(typeof ArrayBuffer!=="undefined"&&e instanceof ArrayBuffer){return vt(t,e,r,n)}if(typeof e==="string"){return mt(t,e,r)}return yt(t,e)}ft.from=function(t,e,r){return ct(null,t,e,r)};if(ft.TYPED_ARRAY_SUPPORT){ft.prototype.__proto__=Uint8Array.prototype;ft.__proto__=Uint8Array}function ht(t){if(typeof t!=="number"){throw new TypeError('"size" argument must be a number')}else if(t<0){throw new RangeError('"size" argument must not be negative')}}function lt(t,e,r,n){ht(e);if(e<=0){return ut(t,e)}if(r!==undefined){return typeof n==="string"?ut(t,e).fill(r,n):ut(t,e).fill(r)}return ut(t,e)}ft.alloc=function(t,e,r){return lt(null,t,e,r)};function dt(t,e){ht(e);t=ut(t,e<0?0:bt(e)|0);if(!ft.TYPED_ARRAY_SUPPORT){for(var r=0;r<e;++r){t[r]=0}}return t}ft.allocUnsafe=function(t){return dt(null,t)};ft.allocUnsafeSlow=function(t){return dt(null,t)};function mt(t,e,r){if(typeof r!=="string"||r===""){r="utf8"}if(!ft.isEncoding(r)){throw new TypeError('"encoding" must be a valid string encoding')}var n=Et(e,r)|0;t=ut(t,n);var i=t.write(e,r);if(i!==n){t=t.slice(0,i)}return t}function wt(t,e){var r=e.length<0?0:bt(e.length)|0;t=ut(t,r);for(var n=0;n<r;n+=1){t[n]=e[n]&255}return t}function vt(t,e,r,n){if(r<0||e.byteLength<r){throw new RangeError("'offset' is out of bounds")}if(e.byteLength<r+(n||0)){throw new RangeError("'length' is out of bounds")}if(r===undefined&&n===undefined){e=new Uint8Array(e)}else if(n===undefined){e=new Uint8Array(e,r)}else{e=new Uint8Array(e,r,n)}if(ft.TYPED_ARRAY_SUPPORT){t=e;t.__proto__=ft.prototype}else{t=wt(t,e)}return t}function yt(t,e){if(pt(e)){var r=bt(e.length)|0;t=ut(t,r);if(t.length===0){return t}e.copy(t,0,0,r);return t}if(e){if(typeof ArrayBuffer!=="undefined"&&e.buffer instanceof ArrayBuffer||"length"in e){if(typeof e.length!=="number"||ee(e.length)){return ut(t,0)}return wt(t,e)}if(e.type==="Buffer"&&st(e.data)){return wt(t,e.data)}}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function bt(t){if(t>=at()){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+at().toString(16)+" bytes")}return t|0}ft.isBuffer=re;function pt(t){return!!(t!=null&&t._isBuffer)}ft.compare=function t(e,r){if(!pt(e)||!pt(r)){throw new TypeError("Arguments must be Buffers")}if(e===r)return 0;var n=e.length;var i=r.length;for(var s=0,o=Math.min(n,i);s<o;++s){if(e[s]!==r[s]){n=e[s];i=r[s];break}}if(n<i)return-1;if(i<n)return 1;return 0};ft.isEncoding=function t(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return true;default:return false}};ft.concat=function t(e,r){if(!st(e)){throw new TypeError('"list" argument must be an Array of Buffers')}if(e.length===0){return ft.alloc(0)}var n;if(r===undefined){r=0;for(n=0;n<e.length;++n){r+=e[n].length}}var i=ft.allocUnsafe(r);var s=0;for(n=0;n<e.length;++n){var o=e[n];if(!pt(o)){throw new TypeError('"list" argument must be an Array of Buffers')}o.copy(i,s);s+=o.length}return i};function Et(t,e){if(pt(t)){return t.length}if(typeof ArrayBuffer!=="undefined"&&typeof ArrayBuffer.isView==="function"&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer)){return t.byteLength}if(typeof t!=="string"){t=""+t}var r=t.length;if(r===0)return 0;var n=false;for(;;){switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case undefined:return Zt(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Yt(t).length;default:if(n)return Zt(t).length;e=(""+e).toLowerCase();n=true}}}ft.byteLength=Et;function gt(t,e,r){var n=false;if(e===undefined||e<0){e=0}if(e>this.length){return""}if(r===undefined||r>this.length){r=this.length}if(r<=0){return""}r>>>=0;e>>>=0;if(r<=e){return""}if(!t)t="utf8";while(true){switch(t){case"hex":return xt(this,e,r);case"utf8":case"utf-8":return Dt(this,e,r);case"ascii":return Ct(this,e,r);case"latin1":case"binary":return Mt(this,e,r);case"base64":return Nt(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Lt(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase();n=true}}}ft.prototype._isBuffer=true;function Pt(t,e,r){var n=t[e];t[e]=t[r];t[r]=n}ft.prototype.swap16=function t(){var e=this.length;if(e%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(var r=0;r<e;r+=2){Pt(this,r,r+1)}return this};ft.prototype.swap32=function t(){var e=this.length;if(e%4!==0){throw new RangeError("Buffer size must be a multiple of 32-bits")}for(var r=0;r<e;r+=4){Pt(this,r,r+3);Pt(this,r+1,r+2)}return this};ft.prototype.swap64=function t(){var e=this.length;if(e%8!==0){throw new RangeError("Buffer size must be a multiple of 64-bits")}for(var r=0;r<e;r+=8){Pt(this,r,r+7);Pt(this,r+1,r+6);Pt(this,r+2,r+5);Pt(this,r+3,r+4)}return this};ft.prototype.toString=function t(){var e=this.length|0;if(e===0)return"";if(arguments.length===0)return Dt(this,0,e);return gt.apply(this,arguments)};ft.prototype.equals=function t(e){if(!pt(e))throw new TypeError("Argument must be a Buffer");if(this===e)return true;return ft.compare(this,e)===0};ft.prototype.inspect=function t(){var e="";var r=ot;if(this.length>0){e=this.toString("hex",0,r).match(/.{2}/g).join(" ");if(this.length>r)e+=" ... "}return"<Buffer "+e+">"};ft.prototype.compare=function t(e,r,n,i,s){if(!pt(e)){throw new TypeError("Argument must be a Buffer")}if(r===undefined){r=0}if(n===undefined){n=e?e.length:0}if(i===undefined){i=0}if(s===undefined){s=this.length}if(r<0||n>e.length||i<0||s>this.length){throw new RangeError("out of range index")}if(i>=s&&r>=n){return 0}if(i>=s){return-1}if(r>=n){return 1}r>>>=0;n>>>=0;i>>>=0;s>>>=0;if(this===e)return 0;var o=s-i;var a=n-r;var u=Math.min(o,a);var f=this.slice(i,s);var c=e.slice(r,n);for(var h=0;h<u;++h){if(f[h]!==c[h]){o=f[h];a=c[h];break}}if(o<a)return-1;if(a<o)return 1;return 0};function St(t,e,r,n,i){if(t.length===0)return-1;if(typeof r==="string"){n=r;r=0}else if(r>2147483647){r=2147483647}else if(r<-2147483648){r=-2147483648}r=+r;if(isNaN(r)){r=i?0:t.length-1}if(r<0)r=t.length+r;if(r>=t.length){if(i)return-1;else r=t.length-1}else if(r<0){if(i)r=0;else return-1}if(typeof e==="string"){e=ft.from(e,n)}if(pt(e)){if(e.length===0){return-1}return Tt(t,e,r,n,i)}else if(typeof e==="number"){e=e&255;if(ft.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf==="function"){if(i){return Uint8Array.prototype.indexOf.call(t,e,r)}else{return Uint8Array.prototype.lastIndexOf.call(t,e,r)}}return Tt(t,[e],r,n,i)}throw new TypeError("val must be string, number or Buffer")}function Tt(t,e,r,n,i){var s=1;var o=t.length;var a=e.length;if(n!==undefined){n=String(n).toLowerCase();if(n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le"){if(t.length<2||e.length<2){return-1}s=2;o/=2;a/=2;r/=2}}function u(t,e){if(s===1){return t[e]}else{return t.readUInt16BE(e*s)}}var f;if(i){var c=-1;for(f=r;f<o;f++){if(u(t,f)===u(e,c===-1?0:f-c)){if(c===-1)c=f;if(f-c+1===a)return c*s}else{if(c!==-1)f-=f-c;c=-1}}}else{if(r+a>o)r=o-a;for(f=r;f>=0;f--){var h=true;for(var l=0;l<a;l++){if(u(t,f+l)!==u(e,l)){h=false;break}}if(h)return f}}return-1}ft.prototype.includes=function t(e,r,n){return this.indexOf(e,r,n)!==-1};ft.prototype.indexOf=function t(e,r,n){return St(this,e,r,n,true)};ft.prototype.lastIndexOf=function t(e,r,n){return St(this,e,r,n,false)};function $t(t,e,r,n){r=Number(r)||0;var i=t.length-r;if(!n){n=i}else{n=Number(n);if(n>i){n=i}}var s=e.length;if(s%2!==0)throw new TypeError("Invalid hex string");if(n>s/2){n=s/2}for(var o=0;o<n;++o){var a=parseInt(e.substr(o*2,2),16);if(isNaN(a))return o;t[r+o]=a}return o}function kt(t,e,r,n){return te(Zt(e,t.length-r),t,r,n)}function Ot(t,e,r,n){return te(Jt(e),t,r,n)}function At(t,e,r,n){return Ot(t,e,r,n)}function _t(t,e,r,n){return te(Yt(e),t,r,n)}function Rt(t,e,r,n){return te(Xt(e,t.length-r),t,r,n)}ft.prototype.write=function t(e,r,n,i){if(r===undefined){i="utf8";n=this.length;r=0}else if(n===undefined&&typeof r==="string"){i=r;n=this.length;r=0}else if(isFinite(r)){r=r|0;if(isFinite(n)){n=n|0;if(i===undefined)i="utf8"}else{i=n;n=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}var s=this.length-r;if(n===undefined||n>s)n=s;if(e.length>0&&(n<0||r<0)||r>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!i)i="utf8";var o=false;for(;;){switch(i){case"hex":return $t(this,e,r,n);case"utf8":case"utf-8":return kt(this,e,r,n);case"ascii":return Ot(this,e,r,n);case"latin1":case"binary":return At(this,e,r,n);case"base64":return _t(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Rt(this,e,r,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase();o=true}}};ft.prototype.toJSON=function t(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Nt(t,e,r){if(e===0&&r===t.length){return et(t)}else{return et(t.slice(e,r))}}function Dt(t,e,r){r=Math.min(t.length,r);var n=[];var i=e;while(i<r){var s=t[i];var o=null;var a=s>239?4:s>223?3:s>191?2:1;if(i+a<=r){var u,f,c,h;switch(a){case 1:if(s<128){o=s}break;case 2:u=t[i+1];if((u&192)===128){h=(s&31)<<6|u&63;if(h>127){o=h}}break;case 3:u=t[i+1];f=t[i+2];if((u&192)===128&&(f&192)===128){h=(s&15)<<12|(u&63)<<6|f&63;if(h>2047&&(h<55296||h>57343)){o=h}}break;case 4:u=t[i+1];f=t[i+2];c=t[i+3];if((u&192)===128&&(f&192)===128&&(c&192)===128){h=(s&15)<<18|(u&63)<<12|(f&63)<<6|c&63;if(h>65535&&h<1114112){o=h}}}}if(o===null){o=65533;a=1}else if(o>65535){o-=65536;n.push(o>>>10&1023|55296);o=56320|o&1023}n.push(o);i+=a}return It(n)}var jt=4096;function It(t){var e=t.length;if(e<=jt){return String.fromCharCode.apply(String,t)}var r="";var n=0;while(n<e){r+=String.fromCharCode.apply(String,t.slice(n,n+=jt))}return r}function Ct(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i){n+=String.fromCharCode(t[i]&127)}return n}function Mt(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i){n+=String.fromCharCode(t[i])}return n}function xt(t,e,r){var n=t.length;if(!e||e<0)e=0;if(!r||r<0||r>n)r=n;var i="";for(var s=e;s<r;++s){i+=Kt(t[s])}return i}function Lt(t,e,r){var n=t.slice(e,r);var i="";for(var s=0;s<n.length;s+=2){i+=String.fromCharCode(n[s]+n[s+1]*256)}return i}ft.prototype.slice=function t(e,r){var n=this.length;e=~~e;r=r===undefined?n:~~r;if(e<0){e+=n;if(e<0)e=0}else if(e>n){e=n}if(r<0){r+=n;if(r<0)r=0}else if(r>n){r=n}if(r<e)r=e;var i;if(ft.TYPED_ARRAY_SUPPORT){i=this.subarray(e,r);i.__proto__=ft.prototype}else{var s=r-e;i=new ft(s,undefined);for(var o=0;o<s;++o){i[o]=this[o+e]}}return i};function Bt(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}ft.prototype.readUIntLE=function t(e,r,n){e=e|0;r=r|0;if(!n)Bt(e,r,this.length);var i=this[e];var s=1;var o=0;while(++o<r&&(s*=256)){i+=this[e+o]*s}return i};ft.prototype.readUIntBE=function t(e,r,n){e=e|0;r=r|0;if(!n){Bt(e,r,this.length)}var i=this[e+--r];var s=1;while(r>0&&(s*=256)){i+=this[e+--r]*s}return i};ft.prototype.readUInt8=function t(e,r){if(!r)Bt(e,1,this.length);return this[e]};ft.prototype.readUInt16LE=function t(e,r){if(!r)Bt(e,2,this.length);return this[e]|this[e+1]<<8};ft.prototype.readUInt16BE=function t(e,r){if(!r)Bt(e,2,this.length);return this[e]<<8|this[e+1]};ft.prototype.readUInt32LE=function t(e,r){if(!r)Bt(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};ft.prototype.readUInt32BE=function t(e,r){if(!r)Bt(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};ft.prototype.readIntLE=function t(e,r,n){e=e|0;r=r|0;if(!n)Bt(e,r,this.length);var i=this[e];var s=1;var o=0;while(++o<r&&(s*=256)){i+=this[e+o]*s}s*=128;if(i>=s)i-=Math.pow(2,8*r);return i};ft.prototype.readIntBE=function t(e,r,n){e=e|0;r=r|0;if(!n)Bt(e,r,this.length);var i=r;var s=1;var o=this[e+--i];while(i>0&&(s*=256)){o+=this[e+--i]*s}s*=128;if(o>=s)o-=Math.pow(2,8*r);return o};ft.prototype.readInt8=function t(e,r){if(!r)Bt(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};ft.prototype.readInt16LE=function t(e,r){if(!r)Bt(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};ft.prototype.readInt16BE=function t(e,r){if(!r)Bt(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};ft.prototype.readInt32LE=function t(e,r){if(!r)Bt(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};ft.prototype.readInt32BE=function t(e,r){if(!r)Bt(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};ft.prototype.readFloatLE=function t(e,r){if(!r)Bt(e,4,this.length);return rt(this,e,true,23,4)};ft.prototype.readFloatBE=function t(e,r){if(!r)Bt(e,4,this.length);return rt(this,e,false,23,4)};ft.prototype.readDoubleLE=function t(e,r){if(!r)Bt(e,8,this.length);return rt(this,e,true,52,8)};ft.prototype.readDoubleBE=function t(e,r){if(!r)Bt(e,8,this.length);return rt(this,e,false,52,8)};function Ft(t,e,r,n,i,s){if(!pt(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<s)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}ft.prototype.writeUIntLE=function t(e,r,n,i){e=+e;r=r|0;n=n|0;if(!i){var s=Math.pow(2,8*n)-1;Ft(this,e,r,n,s,0)}var o=1;var a=0;this[r]=e&255;while(++a<n&&(o*=256)){this[r+a]=e/o&255}return r+n};ft.prototype.writeUIntBE=function t(e,r,n,i){e=+e;r=r|0;n=n|0;if(!i){var s=Math.pow(2,8*n)-1;Ft(this,e,r,n,s,0)}var o=n-1;var a=1;this[r+o]=e&255;while(--o>=0&&(a*=256)){this[r+o]=e/a&255}return r+n};ft.prototype.writeUInt8=function t(e,r,n){e=+e;r=r|0;if(!n)Ft(this,e,r,1,255,0);if(!ft.TYPED_ARRAY_SUPPORT)e=Math.floor(e);this[r]=e&255;return r+1};function Ut(t,e,r,n){if(e<0)e=65535+e+1;for(var i=0,s=Math.min(t.length-r,2);i<s;++i){t[r+i]=(e&255<<8*(n?i:1-i))>>>(n?i:1-i)*8}}ft.prototype.writeUInt16LE=function t(e,r,n){e=+e;r=r|0;if(!n)Ft(this,e,r,2,65535,0);if(ft.TYPED_ARRAY_SUPPORT){this[r]=e&255;this[r+1]=e>>>8}else{Ut(this,e,r,true)}return r+2};ft.prototype.writeUInt16BE=function t(e,r,n){e=+e;r=r|0;if(!n)Ft(this,e,r,2,65535,0);if(ft.TYPED_ARRAY_SUPPORT){this[r]=e>>>8;this[r+1]=e&255}else{Ut(this,e,r,false)}return r+2};function qt(t,e,r,n){if(e<0)e=4294967295+e+1;for(var i=0,s=Math.min(t.length-r,4);i<s;++i){t[r+i]=e>>>(n?i:3-i)*8&255}}ft.prototype.writeUInt32LE=function t(e,r,n){e=+e;r=r|0;if(!n)Ft(this,e,r,4,4294967295,0);if(ft.TYPED_ARRAY_SUPPORT){this[r+3]=e>>>24;this[r+2]=e>>>16;this[r+1]=e>>>8;this[r]=e&255}else{qt(this,e,r,true)}return r+4};ft.prototype.writeUInt32BE=function t(e,r,n){e=+e;r=r|0;if(!n)Ft(this,e,r,4,4294967295,0);if(ft.TYPED_ARRAY_SUPPORT){this[r]=e>>>24;this[r+1]=e>>>16;this[r+2]=e>>>8;this[r+3]=e&255}else{qt(this,e,r,false)}return r+4};ft.prototype.writeIntLE=function t(e,r,n,i){e=+e;r=r|0;if(!i){var s=Math.pow(2,8*n-1);Ft(this,e,r,n,s-1,-s)}var o=0;var a=1;var u=0;this[r]=e&255;while(++o<n&&(a*=256)){if(e<0&&u===0&&this[r+o-1]!==0){u=1}this[r+o]=(e/a>>0)-u&255}return r+n};ft.prototype.writeIntBE=function t(e,r,n,i){e=+e;r=r|0;if(!i){var s=Math.pow(2,8*n-1);Ft(this,e,r,n,s-1,-s)}var o=n-1;var a=1;var u=0;this[r+o]=e&255;while(--o>=0&&(a*=256)){if(e<0&&u===0&&this[r+o+1]!==0){u=1}this[r+o]=(e/a>>0)-u&255}return r+n};ft.prototype.writeInt8=function t(e,r,n){e=+e;r=r|0;if(!n)Ft(this,e,r,1,127,-128);if(!ft.TYPED_ARRAY_SUPPORT)e=Math.floor(e);if(e<0)e=255+e+1;this[r]=e&255;return r+1};ft.prototype.writeInt16LE=function t(e,r,n){e=+e;r=r|0;if(!n)Ft(this,e,r,2,32767,-32768);if(ft.TYPED_ARRAY_SUPPORT){this[r]=e&255;this[r+1]=e>>>8}else{Ut(this,e,r,true)}return r+2};ft.prototype.writeInt16BE=function t(e,r,n){e=+e;r=r|0;if(!n)Ft(this,e,r,2,32767,-32768);if(ft.TYPED_ARRAY_SUPPORT){this[r]=e>>>8;this[r+1]=e&255}else{Ut(this,e,r,false)}return r+2};ft.prototype.writeInt32LE=function t(e,r,n){e=+e;r=r|0;if(!n)Ft(this,e,r,4,2147483647,-2147483648);if(ft.TYPED_ARRAY_SUPPORT){this[r]=e&255;this[r+1]=e>>>8;this[r+2]=e>>>16;this[r+3]=e>>>24}else{qt(this,e,r,true)}return r+4};ft.prototype.writeInt32BE=function t(e,r,n){e=+e;r=r|0;if(!n)Ft(this,e,r,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;if(ft.TYPED_ARRAY_SUPPORT){this[r]=e>>>24;this[r+1]=e>>>16;this[r+2]=e>>>8;this[r+3]=e&255}else{qt(this,e,r,false)}return r+4};function Wt(t,e,r,n,i,s){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Gt(t,e,r,n,i){if(!i){Wt(t,e,r,4)}nt(t,e,r,n,23,4);return r+4}ft.prototype.writeFloatLE=function t(e,r,n){return Gt(this,e,r,true,n)};ft.prototype.writeFloatBE=function t(e,r,n){return Gt(this,e,r,false,n)};function zt(t,e,r,n,i){if(!i){Wt(t,e,r,8)}nt(t,e,r,n,52,8);return r+8}ft.prototype.writeDoubleLE=function t(e,r,n){return zt(this,e,r,true,n)};ft.prototype.writeDoubleBE=function t(e,r,n){return zt(this,e,r,false,n)};ft.prototype.copy=function t(e,r,n,i){if(!n)n=0;if(!i&&i!==0)i=this.length;if(r>=e.length)r=e.length;if(!r)r=0;if(i>0&&i<n)i=n;if(i===n)return 0;if(e.length===0||this.length===0)return 0;if(r<0){throw new RangeError("targetStart out of bounds")}if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");if(i>this.length)i=this.length;if(e.length-r<i-n){i=e.length-r+n}var s=i-n;var o;if(this===e&&n<r&&r<i){for(o=s-1;o>=0;--o){e[o+r]=this[o+n]}}else if(s<1e3||!ft.TYPED_ARRAY_SUPPORT){for(o=0;o<s;++o){e[o+r]=this[o+n]}}else{Uint8Array.prototype.set.call(e,this.subarray(n,n+s),r)}return s};ft.prototype.fill=function t(e,r,n,i){if(typeof e==="string"){if(typeof r==="string"){i=r;r=0;n=this.length}else if(typeof n==="string"){i=n;n=this.length}if(e.length===1){var s=e.charCodeAt(0);if(s<256){e=s}}if(i!==undefined&&typeof i!=="string"){throw new TypeError("encoding must be a string")}if(typeof i==="string"&&!ft.isEncoding(i)){throw new TypeError("Unknown encoding: "+i)}}else if(typeof e==="number"){e=e&255}if(r<0||this.length<r||this.length<n){throw new RangeError("Out of range index")}if(n<=r){return this}r=r>>>0;n=n===undefined?this.length:n>>>0;if(!e)e=0;var o;if(typeof e==="number"){for(o=r;o<n;++o){this[o]=e}}else{var a=pt(e)?e:Zt(new ft(e,i).toString());var u=a.length;for(o=0;o<n-r;++o){this[o+r]=a[o%u]}}return this};var Ht=/[^+\/0-9A-Za-z-_]/g;function Vt(t){t=Qt(t).replace(Ht,"");if(t.length<2)return"";while(t.length%4!==0){t=t+"="}return t}function Qt(t){if(t.trim)return t.trim();return t.replace(/^\s+|\s+$/g,"")}function Kt(t){if(t<16)return"0"+t.toString(16);return t.toString(16)}function Zt(t,e){e=e||Infinity;var r;var n=t.length;var i=null;var s=[];for(var o=0;o<n;++o){r=t.charCodeAt(o);if(r>55295&&r<57344){if(!i){if(r>56319){if((e-=3)>-1)s.push(239,191,189);continue}else if(o+1===n){if((e-=3)>-1)s.push(239,191,189);continue}i=r;continue}if(r<56320){if((e-=3)>-1)s.push(239,191,189);i=r;continue}r=(i-55296<<10|r-56320)+65536}else if(i){if((e-=3)>-1)s.push(239,191,189)}i=null;if(r<128){if((e-=1)<0)break;s.push(r)}else if(r<2048){if((e-=2)<0)break;s.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;s.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return s}function Jt(t){var e=[];for(var r=0;r<t.length;++r){e.push(t.charCodeAt(r)&255)}return e}function Xt(t,e){var r,n,i;var s=[];for(var o=0;o<t.length;++o){if((e-=2)<0)break;r=t.charCodeAt(o);n=r>>8;i=r%256;s.push(i);s.push(n)}return s}function Yt(t){return X(Vt(t))}function te(t,e,r,n){for(var i=0;i<n;++i){if(i+r>=e.length||i>=t.length)break;e[i+r]=t[i]}return i}function ee(t){return t!==t}function re(t){return t!=null&&(!!t._isBuffer||ne(t)||ie(t))}function ne(t){return!!t.constructor&&typeof t.constructor.isBuffer==="function"&&t.constructor.isBuffer(t)}function ie(t){return typeof t.readFloatLE==="function"&&typeof t.slice==="function"&&ne(t.slice(0,0))}var se=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof global!=="undefined"?global:typeof self!=="undefined"?self:{};function oe(t){if(t.__esModule)return t;var e=Object.defineProperty({},"__esModule",{value:true});Object.keys(t).forEach((function(r){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:true,get:function(){return t[r]}})}));return e}function ae(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ue={exports:{}};const fe={};const ce=Object.freeze({__proto__:null,default:fe});const he=oe(ce);function le(t,e){var r=0;for(var n=t.length-1;n>=0;n--){var i=t[n];if(i==="."){t.splice(n,1)}else if(i===".."){t.splice(n,1);r++}else if(r){t.splice(n,1);r--}}if(e){for(;r--;r){t.unshift("..")}}return t}var de=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var me=function(t){return de.exec(t).slice(1)};function we(){var t="",e=false;for(var r=arguments.length-1;r>=-1&&!e;r--){var n=r>=0?arguments[r]:"/";if(typeof n!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!n){continue}t=n+"/"+t;e=n.charAt(0)==="/"}t=le(ke(t.split("/"),(function(t){return!!t})),!e).join("/");return(e?"/":"")+t||"."}function ve(t){var e=ye(t),r=Oe(t,-1)==="/";t=le(ke(t.split("/"),(function(t){return!!t})),!e).join("/");if(!t&&!e){t="."}if(t&&r){t+="/"}return(e?"/":"")+t}function ye(t){return t.charAt(0)==="/"}function be(){var t=Array.prototype.slice.call(arguments,0);return ve(ke(t,(function(t,e){if(typeof t!=="string"){throw new TypeError("Arguments to path.join must be strings")}return t})).join("/"))}function pe(t,e){t=we(t).substr(1);e=we(e).substr(1);function r(t){var e=0;for(;e<t.length;e++){if(t[e]!=="")break}var r=t.length-1;for(;r>=0;r--){if(t[r]!=="")break}if(e>r)return[];return t.slice(e,r-e+1)}var n=r(t.split("/"));var i=r(e.split("/"));var s=Math.min(n.length,i.length);var o=s;for(var a=0;a<s;a++){if(n[a]!==i[a]){o=a;break}}var u=[];for(var a=o;a<n.length;a++){u.push("..")}u=u.concat(i.slice(o));return u.join("/")}var Ee="/";var ge=":";function Pe(t){var e=me(t),r=e[0],n=e[1];if(!r&&!n){return"."}if(n){n=n.substr(0,n.length-1)}return r+n}function Se(t,e){var r=me(t)[2];if(e&&r.substr(-1*e.length)===e){r=r.substr(0,r.length-e.length)}return r}function Te(t){return me(t)[3]}const $e={extname:Te,basename:Se,dirname:Pe,sep:Ee,delimiter:ge,relative:pe,join:be,isAbsolute:ye,normalize:ve,resolve:we};function ke(t,e){if(t.filter)return t.filter(e);var r=[];for(var n=0;n<t.length;n++){if(e(t[n],n,t))r.push(t[n])}return r}var Oe="ab".substr(-1)==="b"?function(t,e,r){return t.substr(e,r)}:function(t,e,r){if(e<0)e=t.length+e;return t.substr(e,r)};const Ae=Object.freeze({__proto__:null,resolve:we,normalize:ve,isAbsolute:ye,join:be,relative:pe,sep:Ee,delimiter:ge,dirname:Pe,basename:Se,extname:Te,default:$e});const _e=oe(Ae);(function(t,e){var r=undefined;var n=function(e){if(r){return r}r=new Promise((function(r,n){var i=typeof e!=="undefined"?e:{};var s=i["onAbort"];i["onAbort"]=function(t){n(new Error(t));if(s){s(t)}};i["postRun"]=i["postRun"]||[];i["postRun"].push((function(){r(i)}));t=undefined;var o;o||=typeof i!="undefined"?i:{};var a="object"==typeof window,u="function"==typeof importScripts,f="object"==typeof z&&"object"==typeof z.versions&&"string"==typeof z.versions.node;o.onRuntimeInitialized=function(){function t(t,e){switch(typeof e){case"boolean":H(t,e?1:0);break;case"number":q(t,e);break;case"string":G(t,e,-1,-1);break;case"object":if(null===e)W(t);else if(null!=e.length){var r=Re(e,Ae);z(t,r,e.length,-1);Be(r)}else V(t,"Wrong API use : tried to return a value of an unknown type ("+e+").",-1);break;default:W(t)}}function e(t,e){for(var r=[],n=0;n<t;n+=1){var i=K(e+4*n,"i32"),s=x(i);if(1===s||2===s)i=U(i);else if(3===s)i=B(i);else if(4===s){s=i;i=L(s);s=F(s);for(var o=new Uint8Array(i),a=0;a<i;a+=1)o[a]=P[s+a];i=o}else i=null;r.push(i)}return r}function r(t,e){this.Ka=t;this.db=e;this.Ia=1;this.eb=[]}function n(t,e){this.db=e;e=ut(t)+1;this.Xa=Le(e);if(null===this.Xa)throw Error("Unable to allocate memory for the SQL string");ct(t,S,this.Xa,e);this.cb=this.Xa;this.Ta=this.hb=null}function i(t){this.filename="dbfile_"+(4294967295*Math.random()>>>0);if(null!=t){var e=this.filename,r="/",n=e;r&&(r="string"==typeof r?r:Nt(r),n=e?et(r+"/"+e):r);e=pt(!0,!0);n=Vt(n,(void 0!==e?e:438)&4095|32768,0);if(t){if("string"==typeof t){r=Array(t.length);for(var i=0,o=t.length;i<o;++i)r[i]=t.charCodeAt(i);t=r}re(n,e|146);r=ie(n,577);ue(r,t,0,t.length,0);se(r);re(n,e)}}this.handleError(u(this.filename,s));this.db=K(s,"i32");J(this.db);this.Ya={};this.Ma={}}var s=qe(4),a=o.cwrap,u=a("sqlite3_open","number",["string","number"]),f=a("sqlite3_close_v2","number",["number"]),c=a("sqlite3_exec","number",["number","string","number","number","number"]),h=a("sqlite3_changes","number",["number"]),l=a("sqlite3_prepare_v2","number",["number","string","number","number","number"]),d=a("sqlite3_sql","string",["number"]),m=a("sqlite3_normalized_sql","string",["number"]),w=a("sqlite3_prepare_v2","number",["number","number","number","number","number"]),v=a("sqlite3_bind_text","number",["number","number","number","number","number"]),y=a("sqlite3_bind_blob","number",["number","number","number","number","number"]),b=a("sqlite3_bind_double","number",["number","number","number"]),p=a("sqlite3_bind_int","number",["number","number","number"]),E=a("sqlite3_bind_parameter_index","number",["number","string"]),g=a("sqlite3_step","number",["number"]),T=a("sqlite3_errmsg","string",["number"]),$=a("sqlite3_column_count","number",["number"]),k=a("sqlite3_data_count","number",["number"]),O=a("sqlite3_column_double","number",["number","number"]),A=a("sqlite3_column_text","string",["number","number"]),_=a("sqlite3_column_blob","number",["number","number"]),R=a("sqlite3_column_bytes","number",["number","number"]),N=a("sqlite3_column_type","number",["number","number"]),D=a("sqlite3_column_name","string",["number","number"]),j=a("sqlite3_reset","number",["number"]),I=a("sqlite3_clear_bindings","number",["number"]),C=a("sqlite3_finalize","number",["number"]),M=a("sqlite3_create_function_v2","number","number string number number number number number number number".split(" ")),x=a("sqlite3_value_type","number",["number"]),L=a("sqlite3_value_bytes","number",["number"]),B=a("sqlite3_value_text","string",["number"]),F=a("sqlite3_value_blob","number",["number"]),U=a("sqlite3_value_double","number",["number"]),q=a("sqlite3_result_double","",["number","number"]),W=a("sqlite3_result_null","",["number"]),G=a("sqlite3_result_text","",["number","string","number","number"]),z=a("sqlite3_result_blob","",["number","number","number","number"]),H=a("sqlite3_result_int","",["number","number"]),V=a("sqlite3_result_error","",["number","string","number"]),Q=a("sqlite3_aggregate_context","number",["number","number"]),J=a("RegisterExtensionFunctions","number",["number"]);r.prototype.bind=function(t){if(!this.Ka)throw"Statement closed";this.reset();return Array.isArray(t)?this.vb(t):null!=t&&"object"===typeof t?this.wb(t):!0};r.prototype.step=function(){if(!this.Ka)throw"Statement closed";this.Ia=1;var t=g(this.Ka);switch(t){case 100:return!0;case 101:return!1;default:throw this.db.handleError(t)}};r.prototype.qb=function(t){null==t&&(t=this.Ia,this.Ia+=1);return O(this.Ka,t)};r.prototype.zb=function(t){null==t&&(t=this.Ia,this.Ia+=1);t=A(this.Ka,t);if("function"!==typeof BigInt)throw Error("BigInt is not supported");return BigInt(t)};r.prototype.Ab=function(t){null==t&&(t=this.Ia,this.Ia+=1);return A(this.Ka,t)};r.prototype.getBlob=function(t){null==t&&(t=this.Ia,this.Ia+=1);var e=R(this.Ka,t);t=_(this.Ka,t);for(var r=new Uint8Array(e),n=0;n<e;n+=1)r[n]=P[t+n];return r};r.prototype.get=function(t,e){e=e||{};null!=t&&this.bind(t)&&this.step();t=[];for(var r=k(this.Ka),n=0;n<r;n+=1)switch(N(this.Ka,n)){case 1:var i=e.useBigInt?this.zb(n):this.qb(n);t.push(i);break;case 2:t.push(this.qb(n));break;case 3:t.push(this.Ab(n));break;case 4:t.push(this.getBlob(n));break;default:t.push(null)}return t};r.prototype.getColumnNames=function(){for(var t=[],e=$(this.Ka),r=0;r<e;r+=1)t.push(D(this.Ka,r));return t};r.prototype.getAsObject=function(t,e){t=this.get(t,e);e=this.getColumnNames();for(var r={},n=0;n<e.length;n+=1)r[e[n]]=t[n];return r};r.prototype.getSQL=function(){return d(this.Ka)};r.prototype.getNormalizedSQL=function(){return m(this.Ka)};r.prototype.run=function(t){null!=t&&this.bind(t);this.step();return this.reset()};r.prototype.mb=function(t,e){null==e&&(e=this.Ia,this.Ia+=1);t=ht(t);var r=Re(t,Ae);this.eb.push(r);this.db.handleError(v(this.Ka,e,r,t.length-1,0))};r.prototype.ub=function(t,e){null==e&&(e=this.Ia,this.Ia+=1);var r=Re(t,Ae);this.eb.push(r);this.db.handleError(y(this.Ka,e,r,t.length,0))};r.prototype.lb=function(t,e){null==e&&(e=this.Ia,this.Ia+=1);this.db.handleError((t===(t|0)?p:b)(this.Ka,e,t))};r.prototype.xb=function(t){null==t&&(t=this.Ia,this.Ia+=1);y(this.Ka,t,0,0,0)};r.prototype.nb=function(t,e){null==e&&(e=this.Ia,this.Ia+=1);switch(typeof t){case"string":this.mb(t,e);return;case"number":this.lb(t,e);return;case"bigint":this.mb(t.toString(),e);return;case"boolean":this.lb(t+0,e);return;case"object":if(null===t){this.xb(e);return}if(null!=t.length){this.ub(t,e);return}}throw"Wrong API use : tried to bind a value of an unknown type ("+t+")."};r.prototype.wb=function(t){var e=this;Object.keys(t).forEach((function(r){var n=E(e.Ka,r);0!==n&&e.nb(t[r],n)}));return!0};r.prototype.vb=function(t){for(var e=0;e<t.length;e+=1)this.nb(t[e],e+1);return!0};r.prototype.reset=function(){this.freemem();return 0===I(this.Ka)&&0===j(this.Ka)};r.prototype.freemem=function(){for(var t;void 0!==(t=this.eb.pop());)Be(t)};r.prototype.free=function(){this.freemem();var t=0===C(this.Ka);delete this.db.Ya[this.Ka];this.Ka=0;return t};n.prototype.next=function(){if(null===this.Xa)return{done:!0};null!==this.Ta&&(this.Ta.free(),this.Ta=null);if(!this.db.db)throw this.fb(),Error("Database closed");var t=We(),e=qe(4);Z(s);Z(e);try{this.db.handleError(w(this.db.db,this.cb,-1,s,e));this.cb=K(e,"i32");var n=K(s,"i32");if(0===n)return this.fb(),{done:!0};this.Ta=new r(n,this.db);this.db.Ya[n]=this.Ta;return{value:this.Ta,done:!1}}catch(t){throw this.hb=Y(this.cb),this.fb(),t}finally{Ue(t)}};n.prototype.fb=function(){Be(this.Xa);this.Xa=null};n.prototype.getRemainingSQL=function(){return null!==this.hb?this.hb:Y(this.cb)};"function"===typeof Symbol&&"symbol"===typeof Symbol.iterator&&(n.prototype[Symbol.iterator]=function(){return this});i.prototype.run=function(t,e){if(!this.db)throw"Database closed";if(e){t=this.prepare(t,e);try{t.step()}finally{t.free()}}else this.handleError(c(this.db,t,0,0,s));return this};i.prototype.exec=function(t,e,n){if(!this.db)throw"Database closed";var i=We(),o=null;try{var a=ke(t),u=qe(4);for(t=[];0!==K(a,"i8");){Z(s);Z(u);this.handleError(w(this.db,a,-1,s,u));var f=K(s,"i32");a=K(u,"i32");if(0!==f){var c=null;o=new r(f,this);for(null!=e&&o.bind(e);o.step();)null===c&&(c={columns:o.getColumnNames(),values:[]},t.push(c)),c.values.push(o.get(null,n));o.free()}}return t}catch(t){throw o&&o.free(),t}finally{Ue(i)}};i.prototype.each=function(t,e,r,n,i){"function"===typeof e&&(n=r,r=e,e=void 0);t=this.prepare(t,e);try{for(;t.step();)r(t.getAsObject(null,i))}finally{t.free()}if("function"===typeof n)return n()};i.prototype.prepare=function(t,e){Z(s);this.handleError(l(this.db,t,-1,s,0));t=K(s,"i32");if(0===t)throw"Nothing to prepare";var n=new r(t,this);null!=e&&n.bind(e);return this.Ya[t]=n};i.prototype.iterateStatements=function(t){return new n(t,this)};i.prototype["export"]=function(){Object.values(this.Ya).forEach((function(t){t.free()}));Object.values(this.Ma).forEach(Ie);this.Ma={};this.handleError(f(this.db));var t=fe(this.filename);this.handleError(u(this.filename,s));this.db=K(s,"i32");J(this.db);return t};i.prototype.close=function(){null!==this.db&&(Object.values(this.Ya).forEach((function(t){t.free()})),Object.values(this.Ma).forEach(Ie),this.Ma={},this.handleError(f(this.db)),Xt("/"+this.filename),this.db=null)};i.prototype.handleError=function(t){if(0===t)return null;t=T(this.db);throw Error(t)};i.prototype.getRowsModified=function(){return h(this.db)};i.prototype.create_function=function(r,n){Object.prototype.hasOwnProperty.call(this.Ma,r)&&(Ie(this.Ma[r]),delete this.Ma[r]);var i=Ce((function(r,i,s){i=e(i,s);try{var o=n.apply(null,i)}catch(t){V(r,t,-1);return}t(r,o)}),"viii");this.Ma[r]=i;this.handleError(M(this.db,r,n.length,1,0,i,0,0,0));return this};i.prototype.create_aggregate=function(r,n){var i=n.init||function(){return null},s=n.finalize||function(t){return t},o=n.step;if(!o)throw"An aggregate function must have a step function in "+r;var a={};Object.hasOwnProperty.call(this.Ma,r)&&(Ie(this.Ma[r]),delete this.Ma[r]);n=r+"__finalize";Object.hasOwnProperty.call(this.Ma,n)&&(Ie(this.Ma[n]),delete this.Ma[n]);var u=Ce((function(t,r,n){var s=Q(t,1);Object.hasOwnProperty.call(a,s)||(a[s]=i());r=e(r,n);r=[a[s]].concat(r);try{a[s]=o.apply(null,r)}catch(e){delete a[s],V(t,e,-1)}}),"viii"),f=Ce((function(e){var r=Q(e,1);try{var n=s(a[r])}catch(t){delete a[r];V(e,t,-1);return}t(e,n);delete a[r]}),"vi");this.Ma[r]=u;this.Ma[n]=f;this.handleError(M(this.db,r,o.length-1,1,0,0,u,f,0));return this};o.Database=i};var c=Object.assign({},o),h="./this.program",l="",d,m;if(f){var w=he,v=_e;l=H+"/";m=t=>{t=L(t)?new URL(t):v.normalize(t);return w.readFileSync(t)};d=t=>{t=L(t)?new URL(t):v.normalize(t);return new Promise(((e,r)=>{w.readFile(t,void 0,((t,n)=>{t?r(t):e(n.buffer)}))}))};!o.thisProgram&&1<z.argv.length&&(h=z.argv[1].replace(/\\/g,"/"));z.argv.slice(2);t.exports=o}else if(a||u)u?l=self.location.href:"undefined"!=typeof document&&document.currentScript&&(l=document.currentScript.src),l=l.startsWith("blob:")?"":l.substr(0,l.replace(/[?#].*/,"").lastIndexOf("/")+1),u&&(m=t=>{var e=new XMLHttpRequest;e.open("GET",t,!1);e.responseType="arraybuffer";e.send(null);return new Uint8Array(e.response)}),d=t=>L(t)?new Promise(((e,r)=>{var n=new XMLHttpRequest;n.open("GET",t,!0);n.responseType="arraybuffer";n.onload=()=>{(200==n.status||0==n.status&&n.response)&&r(n.response);e(n.status)};n.onerror=e;n.send(null)})):fetch(t,{credentials:"same-origin"}).then((t=>t.ok?t.arrayBuffer():Promise.reject(Error(t.status+" : "+t.url))));var y=o.print||console.log.bind(console),b=o.printErr||console.error.bind(console);Object.assign(o,c);c=null;o.thisProgram&&(h=o.thisProgram);var p;o.wasmBinary&&(p=o.wasmBinary);var E,g=!1,P,S,T,$,k,O,A;function _(){var t=E.buffer;o.HEAP8=P=new Int8Array(t);o.HEAP16=T=new Int16Array(t);o.HEAPU8=S=new Uint8Array(t);o.HEAPU16=new Uint16Array(t);o.HEAP32=$=new Int32Array(t);o.HEAPU32=k=new Uint32Array(t);o.HEAPF32=O=new Float32Array(t);o.HEAPF64=A=new Float64Array(t)}var R=[],N=[],D=[];function j(){var t=o.preRun.shift();R.unshift(t)}var I=0,C=null;function M(t){o.onAbort?.(t);t="Aborted("+t+")";b(t);g=!0;throw new WebAssembly.RuntimeError(t+". Build with -sASSERTIONS for more info.")}var x=t=>t.startsWith("data:application/octet-stream;base64,"),L=t=>t.startsWith("file://"),B;function F(t){if(t==B&&p)return new Uint8Array(p);if(m)return m(t);throw"both async and sync fetching of the wasm failed"}function U(t){return p?Promise.resolve().then((()=>F(t))):d(t).then((t=>new Uint8Array(t)),(()=>F(t)))}function q(t,e,r){return U(t).then((t=>WebAssembly.instantiate(t,e))).then(r,(t=>{b(`failed to asynchronously prepare wasm: ${t}`);M(t)}))}function W(t,e){var r=B;p||"function"!=typeof WebAssembly.instantiateStreaming||x(r)||L(r)||f||"function"!=typeof fetch?q(r,t,e):fetch(r,{credentials:"same-origin"}).then((n=>WebAssembly.instantiateStreaming(n,t).then(e,(function(n){b(`wasm streaming compile failed: ${n}`);b("falling back to ArrayBuffer instantiation");return q(r,t,e)}))))}var G,V,Q=t=>{for(;0<t.length;)t.shift()(o)};function K(t,e="i8"){e.endsWith("*")&&(e="*");switch(e){case"i1":return P[t];case"i8":return P[t];case"i16":return T[t>>1];case"i32":return $[t>>2];case"i64":M("to do getValue(i64) use WASM_BIGINT");case"float":return O[t>>2];case"double":return A[t>>3];case"*":return k[t>>2];default:M(`invalid type for getValue: ${e}`)}}function Z(t){var e="i32";e.endsWith("*")&&(e="*");switch(e){case"i1":P[t]=0;break;case"i8":P[t]=0;break;case"i16":T[t>>1]=0;break;case"i32":$[t>>2]=0;break;case"i64":M("to do setValue(i64) use WASM_BIGINT");case"float":O[t>>2]=0;break;case"double":A[t>>3]=0;break;case"*":k[t>>2]=0;break;default:M(`invalid type for setValue: ${e}`)}}var J="undefined"!=typeof TextDecoder?new TextDecoder:void 0,X=(t,e,r)=>{var n=e+r;for(r=e;t[r]&&!(r>=n);)++r;if(16<r-e&&t.buffer&&J)return J.decode(t.subarray(e,r));for(n="";e<r;){var i=t[e++];if(i&128){var s=t[e++]&63;if(192==(i&224))n+=String.fromCharCode((i&31)<<6|s);else{var o=t[e++]&63;i=224==(i&240)?(i&15)<<12|s<<6|o:(i&7)<<18|s<<12|o<<6|t[e++]&63;65536>i?n+=String.fromCharCode(i):(i-=65536,n+=String.fromCharCode(55296|i>>10,56320|i&1023))}}else n+=String.fromCharCode(i)}return n},Y=(t,e)=>t?X(S,t,e):"",tt=(t,e)=>{for(var r=0,n=t.length-1;0<=n;n--){var i=t[n];"."===i?t.splice(n,1):".."===i?(t.splice(n,1),r++):r&&(t.splice(n,1),r--)}if(e)for(;r;r--)t.unshift("..");return t},et=t=>{var e="/"===t.charAt(0),r="/"===t.substr(-1);(t=tt(t.split("/").filter((t=>!!t)),!e).join("/"))||e||(t=".");t&&r&&(t+="/");return(e?"/":"")+t},rt=t=>{var e=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(t).slice(1);t=e[0];e=e[1];if(!t&&!e)return".";e&&=e.substr(0,e.length-1);return t+e},nt=t=>{if("/"===t)return"/";t=et(t);t=t.replace(/\/$/,"");var e=t.lastIndexOf("/");return-1===e?t:t.substr(e+1)},it=()=>{if("object"==typeof crypto&&"function"==typeof crypto.getRandomValues)return t=>crypto.getRandomValues(t);if(f)try{var t=require("crypto");if(t.randomFillSync)return e=>t.randomFillSync(e);var e=t.randomBytes;return t=>(t.set(e(t.byteLength)),t)}catch(t){}M("initRandomDevice")},st=t=>(st=it())(t),ot=(...t)=>{for(var e="",r=!1,n=t.length-1;-1<=n&&!r;n--){r=0<=n?t[n]:"/";if("string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");if(!r)return"";e=r+"/"+e;r="/"===r.charAt(0)}e=tt(e.split("/").filter((t=>!!t)),!r).join("/");return(r?"/":"")+e||"."},at=[],ut=t=>{for(var e=0,r=0;r<t.length;++r){var n=t.charCodeAt(r);127>=n?e++:2047>=n?e+=2:55296<=n&&57343>=n?(e+=4,++r):e+=3}return e},ct=(t,e,r,n)=>{if(!(0<n))return 0;var i=r;n=r+n-1;for(var s=0;s<t.length;++s){var o=t.charCodeAt(s);if(55296<=o&&57343>=o){var a=t.charCodeAt(++s);o=65536+((o&1023)<<10)|a&1023}if(127>=o){if(r>=n)break;e[r++]=o}else{if(2047>=o){if(r+1>=n)break;e[r++]=192|o>>6}else{if(65535>=o){if(r+2>=n)break;e[r++]=224|o>>12}else{if(r+3>=n)break;e[r++]=240|o>>18;e[r++]=128|o>>12&63}e[r++]=128|o>>6&63}e[r++]=128|o&63}}e[r]=0;return r-i};function ht(t,e){var r=Array(ut(t)+1);t=ct(t,r,0,r.length);e&&(r.length=t);return r}var lt=[];function dt(t,e){lt[t]={input:[],output:[],Wa:e};zt(t,mt)}var mt={open(t){var e=lt[t.node.rdev];if(!e)throw new kt(43);t.tty=e;t.seekable=!1},close(t){t.tty.Wa.fsync(t.tty)},fsync(t){t.tty.Wa.fsync(t.tty)},read(t,e,r,n){if(!t.tty||!t.tty.Wa.rb)throw new kt(60);for(var i=0,s=0;s<n;s++){try{var o=t.tty.Wa.rb(t.tty)}catch(t){throw new kt(29)}if(void 0===o&&0===i)throw new kt(6);if(null===o||void 0===o)break;i++;e[r+s]=o}i&&(t.node.timestamp=Date.now());return i},write(t,e,r,n){if(!t.tty||!t.tty.Wa.ib)throw new kt(60);try{for(var i=0;i<n;i++)t.tty.Wa.ib(t.tty,e[r+i])}catch(t){throw new kt(29)}n&&(t.node.timestamp=Date.now());return i}},wt={rb(){t:{if(!at.length){var t=null;if(f){var e=ft.alloc(256),r=0,n=z.stdin.fd;try{r=w.readSync(n,e,0,256)}catch(t){if(t.toString().includes("EOF"))r=0;else throw t}0<r&&(t=e.slice(0,r).toString("utf-8"))}else"undefined"!=typeof window&&"function"==typeof window.prompt&&(t=window.prompt("Input: "),null!==t&&(t+="\n"));if(!t){t=null;break t}at=ht(t,!0)}t=at.shift()}return t},ib(t,e){null===e||10===e?(y(X(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},fsync(t){t.output&&0<t.output.length&&(y(X(t.output,0)),t.output=[])},Lb(){return{Gb:25856,Ib:5,Fb:191,Hb:35387,Eb:[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]}},Mb(){return 0},Nb(){return[24,80]}},vt={ib(t,e){null===e||10===e?(b(X(t.output,0)),t.output=[]):0!=e&&t.output.push(e)},fsync(t){t.output&&0<t.output.length&&(b(X(t.output,0)),t.output=[])}};function yt(t,e){var r=t.Ha?t.Ha.length:0;r>=e||(e=Math.max(e,r*(1048576>r?2:1.125)>>>0),0!=r&&(e=Math.max(e,256)),r=t.Ha,t.Ha=new Uint8Array(e),0<t.La&&t.Ha.set(r.subarray(0,t.La),0))}var bt={Pa:null,Qa(){return bt.createNode(null,"/",16895,0)},createNode(t,e,r,n){if(24576===(r&61440)||4096===(r&61440))throw new kt(63);bt.Pa||(bt.Pa={dir:{node:{Oa:bt.Fa.Oa,Na:bt.Fa.Na,lookup:bt.Fa.lookup,$a:bt.Fa.$a,rename:bt.Fa.rename,unlink:bt.Fa.unlink,rmdir:bt.Fa.rmdir,readdir:bt.Fa.readdir,symlink:bt.Fa.symlink},stream:{Sa:bt.Ga.Sa}},file:{node:{Oa:bt.Fa.Oa,Na:bt.Fa.Na},stream:{Sa:bt.Ga.Sa,read:bt.Ga.read,write:bt.Ga.write,kb:bt.Ga.kb,ab:bt.Ga.ab,bb:bt.Ga.bb}},link:{node:{Oa:bt.Fa.Oa,Na:bt.Fa.Na,readlink:bt.Fa.readlink},stream:{}},ob:{node:{Oa:bt.Fa.Oa,Na:bt.Fa.Na},stream:Gt}});r=Ct(t,e,r,n);Mt(r.mode)?(r.Fa=bt.Pa.dir.node,r.Ga=bt.Pa.dir.stream,r.Ha={}):32768===(r.mode&61440)?(r.Fa=bt.Pa.file.node,r.Ga=bt.Pa.file.stream,r.La=0,r.Ha=null):40960===(r.mode&61440)?(r.Fa=bt.Pa.link.node,r.Ga=bt.Pa.link.stream):8192===(r.mode&61440)&&(r.Fa=bt.Pa.ob.node,r.Ga=bt.Pa.ob.stream);r.timestamp=Date.now();t&&(t.Ha[e]=r,t.timestamp=r.timestamp);return r},Kb(t){return t.Ha?t.Ha.subarray?t.Ha.subarray(0,t.La):new Uint8Array(t.Ha):new Uint8Array(0)},Fa:{Oa(t){var e={};e.dev=8192===(t.mode&61440)?t.id:1;e.ino=t.id;e.mode=t.mode;e.nlink=1;e.uid=0;e.gid=0;e.rdev=t.rdev;Mt(t.mode)?e.size=4096:32768===(t.mode&61440)?e.size=t.La:40960===(t.mode&61440)?e.size=t.link.length:e.size=0;e.atime=new Date(t.timestamp);e.mtime=new Date(t.timestamp);e.ctime=new Date(t.timestamp);e.yb=4096;e.blocks=Math.ceil(e.size/e.yb);return e},Na(t,e){void 0!==e.mode&&(t.mode=e.mode);void 0!==e.timestamp&&(t.timestamp=e.timestamp);if(void 0!==e.size&&(e=e.size,t.La!=e))if(0==e)t.Ha=null,t.La=0;else{var r=t.Ha;t.Ha=new Uint8Array(e);r&&t.Ha.set(r.subarray(0,Math.min(e,t.La)));t.La=e}},lookup(){throw Ot[44]},$a(t,e,r,n){return bt.createNode(t,e,r,n)},rename(t,e,r){if(Mt(t.mode)){try{var n=It(e,r)}catch(t){}if(n)for(var i in n.Ha)throw new kt(55)}delete t.parent.Ha[t.name];t.parent.timestamp=Date.now();t.name=r;e.Ha[r]=t;e.timestamp=t.parent.timestamp},unlink(t,e){delete t.Ha[e];t.timestamp=Date.now()},rmdir(t,e){var r=It(t,e),n;for(n in r.Ha)throw new kt(55);delete t.Ha[e];t.timestamp=Date.now()},readdir(t){var e=[".",".."],r;for(r of Object.keys(t.Ha))e.push(r);return e},symlink(t,e,r){t=bt.createNode(t,e,41471,0);t.link=r;return t},readlink(t){if(40960!==(t.mode&61440))throw new kt(28);return t.link}},Ga:{read(t,e,r,n,i){var s=t.node.Ha;if(i>=t.node.La)return 0;t=Math.min(t.node.La-i,n);if(8<t&&s.subarray)e.set(s.subarray(i,i+t),r);else for(n=0;n<t;n++)e[r+n]=s[i+n];return t},write(t,e,r,n,i,s){e.buffer===P.buffer&&(s=!1);if(!n)return 0;t=t.node;t.timestamp=Date.now();if(e.subarray&&(!t.Ha||t.Ha.subarray)){if(s)return t.Ha=e.subarray(r,r+n),t.La=n;if(0===t.La&&0===i)return t.Ha=e.slice(r,r+n),t.La=n;if(i+n<=t.La)return t.Ha.set(e.subarray(r,r+n),i),n}yt(t,i+n);if(t.Ha.subarray&&e.subarray)t.Ha.set(e.subarray(r,r+n),i);else for(s=0;s<n;s++)t.Ha[i+s]=e[r+s];t.La=Math.max(t.La,i+n);return n},Sa(t,e,r){1===r?e+=t.position:2===r&&32768===(t.node.mode&61440)&&(e+=t.node.La);if(0>e)throw new kt(28);return e},kb(t,e,r){yt(t.node,e+r);t.node.La=Math.max(t.node.La,e+r)},ab(t,e,r,n,i){if(32768!==(t.node.mode&61440))throw new kt(43);t=t.node.Ha;if(i&2||t.buffer!==P.buffer){if(0<r||r+e<t.length)t.subarray?t=t.subarray(r,r+e):t=Array.prototype.slice.call(t,r,r+e);r=!0;e=65536*Math.ceil(e/65536);(i=Fe(65536,e))?(S.fill(0,i,i+e),e=i):e=0;if(!e)throw new kt(48);P.set(t,e)}else r=!1,e=t.byteOffset;return{Cb:e,tb:r}},bb(t,e,r,n){bt.Ga.write(t,e,0,n,r,!1);return 0}}},pt=(t,e)=>{var r=0;t&&(r|=365);e&&(r|=146);