You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
64 KiB
29 lines
64 KiB
2 weeks ago
|
import{X as Re}from"./index-BLqts8WY.js";var mn={};/*! *****************************************************************************
|
||
|
Copyright (c) Microsoft Corporation.
|
||
|
|
||
|
Permission to use, copy, modify, and/or distribute this software for any
|
||
|
purpose with or without fee is hereby granted.
|
||
|
|
||
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
||
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
||
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
||
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
||
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||
|
PERFORMANCE OF THIS SOFTWARE.
|
||
|
***************************************************************************** */var fn=function(){return fn=Object.assign||function(v){for(var s,m=1,w=arguments.length;m<w;m++){s=arguments[m];for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&(v[p]=s[p])}return v},fn.apply(this,arguments)};function en(g,v,s,m){function w(p){return p instanceof s?p:new s(function(o){o(p)})}return new(s||(s=Promise))(function(p,o){function j(_){try{u(m.next(_))}catch(F){o(F)}}function R(_){try{u(m.throw(_))}catch(F){o(F)}}function u(_){_.done?p(_.value):w(_.value).then(j,R)}u((m=m.apply(g,[])).next())})}function We(g,v){var s={label:0,sent:function(){if(p[0]&1)throw p[1];return p[1]},trys:[],ops:[]},m,w,p,o;return o={next:j(0),throw:j(1),return:j(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function j(u){return function(_){return R([u,_])}}function R(u){if(m)throw new TypeError("Generator is already executing.");for(;s;)try{if(m=1,w&&(p=u[0]&2?w.return:u[0]?w.throw||((p=w.return)&&p.call(w),0):w.next)&&!(p=p.call(w,u[1])).done)return p;switch(w=0,p&&(u=[u[0]&2,p.value]),u[0]){case 0:case 1:p=u;break;case 4:return s.label++,{value:u[1],done:!1};case 5:s.label++,w=u[1],u=[0];continue;case 7:u=s.ops.pop(),s.trys.pop();continue;default:if(p=s.trys,!(p=p.length>0&&p[p.length-1])&&(u[0]===6||u[0]===2)){s=0;continue}if(u[0]===3&&(!p||u[1]>p[0]&&u[1]<p[3])){s.label=u[1];break}if(u[0]===6&&s.label<p[1]){s.label=p[1],p=u;break}if(p&&s.label<p[2]){s.label=p[2],s.ops.push(u);break}p[2]&&s.ops.pop(),s.trys.pop();continue}u=v.call(g,s)}catch(_){u=[6,_],w=0}finally{m=p=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function _n(g){var v=[g.schema.primKey].concat(g.schema.indexes);return v.map(function(s){return s.src}).join(",")}function Nn(g){for(var v={},s=0,m=g.tables;s<m.length;s++){var w=m[s];v[w.name]=w.schema}return v}function gn(g,v){return new Promise(function(s,m){var w=new FileReader;w.onabort=function(p){return m(new Error("file read aborted"))},w.onerror=function(p){return m(p.target.error)},w.onload=function(p){return s(p.target.result)},v==="binary"?w.readAsArrayBuffer(g):w.readAsText(g)})}function wn(g,v){if(typeof FileReaderSync>"u")throw new Error("FileReaderSync missing. Reading blobs synchronously requires code to run from within a web worker. Use TSON.encapsulateAsync() to do it from the main thread.");var s=new FileReaderSync,m=v==="binary"?s.readAsArrayBuffer(g):s.readAsText(g);return m}var hn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function bn(g,v){return v={exports:{}},g(v,v.exports),v.exports}var pn=bn(function(g,v){(function(s,m){g.exports=m()})(hn,function(){function s(l){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?s=function(y){return typeof y}:s=function(y){return y&&typeof Symbol=="function"&&y.constructor===Symbol&&y!==Symbol.prototype?"symbol":typeof y},s(l)}function m(l,y,h,d,A,G,H){try{var W=l[G](H),C=W.value}catch(Ae){h(Ae);return}W.done?y(C):Promise.resolve(C).then(d,A)}function w(l){return function(){var y=this,h=arguments;return new Promise(function(d,A){var G=l.apply(y,h);function H(C){m(G,d,A,H,W,"next",C)}function W(C){m(G,d,A,H,W,"throw",C)}H(void 0)})}}function p(l,y){if(!(l instanceof y))throw new TypeError("Cannot call a class as a function")}function o(l,y){for(var h=0;h<y.length;h++){var d=y[h];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(l,d.key,d)}}function j(l,y,h){return o(l.prototype,y),l}function R(l,y,h){return y in l?Object.defineProperty(l,y,{value:h,enumerable:!0,configurable:!0,writable:!0}):l[y]=h,l}function u(l,y){var h=Object.keys(l);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(l);y&&(d=d.filter(function(A){return Object.getOwnPropertyDescriptor(l,A).enumerable})),h.push.apply(h,d)}return h}function _(l){for(var y=1;y<arguments.length;y++){var h=arguments[y]!=null?arguments[y]:{};y%2?u(Object(h),!0).forEach(function(d){R(l,d,h[d])}):Object.getOwnPropertyDescriptors?Object.de
|
||
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function R(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function u(t){return(u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n})(t)}function _(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function F(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function pe(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ve(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),n.push.apply(n,i)}return n}function J(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ve(Object(n),!0).forEach(function(i){pe(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ve(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function V(t,e){return function(i){if(Array.isArray(i))return i}(t)||function(i,a){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(i)))){var O=[],T=!0,B=!1,E=void 0;try{for(var L,Y=i[Symbol.iterator]();!(T=(L=Y.next()).done)&&(O.push(L.value),!a||O.length!==a);T=!0);}catch(q){B=!0,E=q}finally{try{T||Y.return==null||Y.return()}finally{if(B)throw E}}return O}}(t,e)||Ee(t,e)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
||
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function ee(t){return function(n){if(Array.isArray(n))return me(n)}(t)||function(n){if(typeof Symbol<"u"&&Symbol.iterator in Object(n))return Array.from(n)}(t)||Ee(t)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
||
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function Ee(t,e){if(t){if(typeof t=="string")return me(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?me(t,e):void 0}}function me(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var N=function t(e){_(this,t),this.p=new Promise(e)};N.__typeson__type__="TypesonPromise",typeof Symbol<"u"&&(N.prototype[Symbol.toStringTag]="TypesonPromise"),N.prototype.then=function(t,e){var n=this;return new N(function(i,a){n.p.then(function(O){i(t?t(O):O)}).catch(function(O){return e?e(O):Promise.reject(O)}).then(i,a)})},N.prototype.catch=function(t){return this.then(null,t)},N.resolve=function(t){return new N(function(e){e(t)})},N.reject=function(t){return new N(function(e,n){n(t)})},["all","race"].forEach(function(t){N[t]=function(e){return new N(function(n,i){Promise[t](e.map(function(a){return a&&a.constructor&&a.constructor.__typeson__type__==="TypesonPromise"?a.p:a})).then(n,i)})}});var Ne={}.toString,K={}.hasOwnProperty,te=Object.getPrototypeOf,re=K.toString;function Pe(t,e){return f(t)&&typeof t.then=="function"&&(!e||typeof t.catch=="function")}function c(t){return Ne.call(t).slice(8,-1)}function r(t,e){if(!t||u(t)!=="object")return!1;var n=te(t);if(!n)return e===null;var i=K.call(n,"constructor")&&n.constructor;return typeof i!="function"?e===null:e===i||e!==null&&re.call(i)===re.call(e)||typeof e=="function"&&typeof i.__typeson__type__=="string"&&i.__typeson__type__===e.__typeson__type__}function b(t){return!(!t||c(t)!=="Object")&&(!te(t)||r(t,Object))}function f(t){return t&&u(t)==="object"}function Z(t){return t.replace(/~/g,"~0").replace(/\./g,"~1")}function M(t){return t.replace(/~1/g,".").replace(/~0/g,"~")}function ie(t,e){if(e==="")return t;var n=e.indexOf(".");if(n>-1){var i=t[M(e.slice(0,n))];return i===void 0?void 0:ie(i,e.slice(n+1))}return t[M(e)]}function he(t,e,n){if(e==="")return n;var i=e.indexOf(".");return i>-1?he(t[M(e.slice(0,i))],e.slice(i+1),n):(t[M(e)]=n,t)}function Se(t,e,n){return t&&t.then||(t=Promise.resolve(t)),e?t.then(e):t}var Be=Object.keys,_e=Array.isArray,ce={}.hasOwnProperty,be=["type","replaced","iterateIn","iterateUnsetNumeric"];function Ce(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];try{return Promise.resolve(t.apply(this,e))}catch(i){return Promise.reject(i)}}}function Me(t,e){if(t.keypath==="")return-1;var n=t.keypath.match(/\./g)||0,i=e.keypath.match(/\./g)||0;return n&&(n=n.length),i&&(i=i.length),n>i?-1:n<i?1:t.keypath<e.keypath?-1:t.keypath>e.keypath}var $=function(){function t(e){_(this,t),this.options=e,this.plainObjectReplacers=[],this.nonplainObjectReplacers=[],this.revivers={},this.types={}}return function(n,i,a){return F(n.prototype,i),n}(t,[{key:"stringify",value:function(n,i,a,O){O=J(J(J({},this.options),O),{},{stringification:!0});var T=this.encapsulate(n,null,O);return _e(T)?JSON.stringify(T[0],i,a):T.then(function(B){return JSON.stringify(B,i,a)})}},{key:"stringifySync",value:function(n,i,a,O){return this.stringify(n,i,a,J(J({throwOnBadSyncType:!0},O),{},{sync:!0}))}},{key:"stringifyAsync",value:function(n,i,a,O){return this.stringify(n,i,a,J(J({throwOnBadSyncType:!0},O),{},{sync:!1}))}},{key:"parse",value:function(n,i,a){return a=J(J(J({},this.options),a),{},{parse:!0}),this.revive(JSON.parse(n,i),a)}},{key:"parseSync",value:function(n,i,a){return this.parse(n,i,J(J({throwOnBadSyncType:!0},a),{},{sync:!0}))}},{key:"parseAsync",value:function(n,i,a){return this.parse(n,i,J(J({throwOnBadSyncType:!0},a),{},{sync:!1}))}},{key:"specialTypeNames",value:function(n,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return a.returnTypeNames=!0,this.encapsulate(n,i,a)}},{key:"rootTypeName",value:function(n,i){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return a.iterateNone=!0,this.encapsulate(n,i,a)}},{key:"encaps
|
||
|
`).join(`
|
||
|
`)),Z=f.lastIndexOf("]"),p.push(f.substring(0,Z)),M=null,ie=0,he=!0,Se=function(){var ce,be,Ce,Me,$,y,ye,ke,l,y;return We(this,function(h){switch(h.label){case 0:return u&&Re.ignoreTransaction(function(){return u(_)}),ce=M==null?re.limit(r):re.where(":id").above(M).limit(r),[4,ce.toArray()];case 1:return be=h.sent(),be.length===0?[2,"break"]:(M!=null&&ie>0&&(p.push(","),j&&p.push(`
|
||
|
`)),he=be.length===r,c?(Ce=V?be.filter(function(d){return V(te,d)}):be,Me=ee?Ce.map(function(d){return ee(te,d).value}):Ce,$=Me.map(function(d){return Je.encapsulate(d)}),Je.mustFinalize()?[4,Re.waitFor(Je.finalize($))]:[3,3]):[3,4]);case 2:h.sent(),h.label=3;case 3:return y=JSON.stringify($,void 0,j?2:void 0),j&&(y=y.split(`
|
||
|
`).join(`
|
||
|
`)),p.push(new Blob([y.substring(1,y.length-1)])),ie=Me.length,M=be.length>0?Re.getByKeyPath(be[be.length-1],Pe.keyPath):null,[3,8];case 4:return[4,ce.primaryKeys()];case 5:return ye=h.sent(),ke=ye.map(function(d,A){return[d,be[A]]}),V&&(ke=ke.filter(function(d){var A=d[0],G=d[1];return V(te,G,A)})),ee&&(ke=ke.map(function(d){var A=d[0],G=d[1],H=ee(te,G,A);return[H.key,H.value]})),l=ke.map(function(d){return Je.encapsulate(d)}),Je.mustFinalize()?[4,Re.waitFor(Je.finalize(l))]:[3,7];case 6:h.sent(),h.label=7;case 7:y=JSON.stringify(l,void 0,j?2:void 0),j&&(y=y.split(`
|
||
|
`).join(`
|
||
|
`)),p.push(new Blob([y.substring(1,y.length-1)])),ie=ke.length,M=ye.length>0?ye[ye.length-1]:null,h.label=8;case 8:return _.completedRows+=be.length,[2]}})},_e.label=1;case 1:return he?[5,Se()]:[3,3];case 2:return Be=_e.sent(),Be==="break"?[3,3]:[3,1];case 3:return p.push(f.substr(Z)),_.completedTables+=1,_.completedTables<_.totalTables&&p.push(","),[2]}})},me=0,N=o,K.label=2;case 2:return me<N.length?(Ne=N[me].name,[5,Ee(Ne)]):[3,5];case 3:K.sent(),K.label=4;case 4:return me++,[3,2];case 5:return p.push(pe.substr(ve)),_.done=!0,u&&Re.ignoreTransaction(function(){return u(_)}),[2]}})})}var m,w,p,o,j,R,u,_;return We(this,function(F){switch(F.label){case 0:v=v||{},m=v.skipTables?v.skipTables:[],w=g.tables.filter(function(pe){return!m.includes(pe.name)}),p=[],o=w.map(function(pe){return{name:pe.name,schema:_n(pe),rowCount:0}}),j=v.prettyJson,R={formatName:"dexie",formatVersion:1,data:{databaseName:g.name,databaseVersion:g.verno,tables:o,data:[]}},u=v.progressCallback,_={done:!1,completedRows:0,completedTables:0,totalRows:NaN,totalTables:o.length},F.label=1;case 1:return F.trys.push([1,,6,7]),v.noTransaction?[4,s()]:[3,3];case 2:return F.sent(),[3,5];case 3:return[4,g.transaction("r",g.tables,s)];case 4:F.sent(),F.label=5;case 5:return[3,7];case 6:return Je.finalize(),[7];case 7:return[2,new Blob(p,{type:"text/json"})]}})})}var Un=1,Ln={Stream:function(){}},Rn=bn(function(g,v){(function(s){var m=typeof process=="object"&&mn?mn:self;s.parser=function(c){return new ve(c)},s.CParser=ve,s.CStream=V,s.createStream=J,s.MAX_BUFFER_LENGTH=10*1024*1024,s.DEBUG=m.CDEBUG==="debug",s.INFO=m.CDEBUG==="debug"||m.CDEBUG==="info",s.EVENTS=["value","string","key","openobject","closeobject","openarray","closearray","error","end","ready"];var w={textNode:void 0,numberNode:""},p=s.EVENTS.filter(function(c){return c!=="error"&&c!=="end"}),o=0,j;s.STATE={BEGIN:o++,VALUE:o++,OPEN_OBJECT:o++,CLOSE_OBJECT:o++,OPEN_ARRAY:o++,CLOSE_ARRAY:o++,TEXT_ESCAPE:o++,STRING:o++,BACKSLASH:o++,END:o++,OPEN_KEY:o++,CLOSE_KEY:o++,TRUE:o++,TRUE2:o++,TRUE3:o++,FALSE:o++,FALSE2:o++,FALSE3:o++,FALSE4:o++,NULL:o++,NULL2:o++,NULL3:o++,NUMBER_DECIMAL_POINT:o++,NUMBER_DIGIT:o++};for(var R in s.STATE)s.STATE[s.STATE[R]]=R;o=s.STATE;const u={tab:9,lineFeed:10,carriageReturn:13,space:32,doubleQuote:34,plus:43,comma:44,minus:45,period:46,_0:48,_9:57,colon:58,E:69,openBracket:91,backslash:92,closeBracket:93,a:97,b:98,e:101,f:102,l:108,n:110,r:114,s:115,t:116,u:117,openBrace:123,closeBrace:125};Object.create||(Object.create=function(c){function r(){this.__proto__=c}return r.prototype=c,new r}),Object.getPrototypeOf||(Object.getPrototypeOf=function(c){return c.__proto__}),Object.keys||(Object.keys=function(c){var r=[];for(var b in c)c.hasOwnProperty(b)&&r.push(b);return r});function _(c){var r=Math.max(s.MAX_BUFFER_LENGTH,10),b=0;for(var f in w){var Z=c[f]===void 0?0:c[f].length;if(Z>r)switch(f){case"text":closeText(c);break;default:K(c,"Max buffer length exceeded: "+f)}b=Math.max(b,Z)}c.bufferCheckPosition=s.MAX_BUFFER_LENGTH-b+c.position}function F(c){for(var r in w)c[r]=w[r]}var pe=/[\\"\n]/g;function ve(c){if(!(this instanceof ve))return new ve(c);var r=this;F(r),r.bufferCheckPosition=s.MAX_BUFFER_LENGTH,r.q=r.c=r.p="",r.opt=c||{},r.closed=r.closedRoot=r.sawRoot=!1,r.tag=r.error=null,r.state=o.BEGIN,r.stack=new Array,r.position=r.column=0,r.line=1,r.slashed=!1,r.unicodeI=0,r.unicodeS=null,r.depth=0,ee(r,"onready")}ve.prototype={end:function(){te(this)},write:Pe,resume:function(){return this.error=null,this},close:function(){return this.write(null)}};try{j=Ln.Stream}catch{j=function(){}}function J(c){return new V(c)}function V(c){if(!(this instanceof V))return new V(c);this._parser=new ve(c),this.writable=!0,this.readable=!0,this.bytes_remaining=0,this.bytes_in_sequence=0,this.temp_buffs={2:new Buffer(2),3:new Buffer(3),4:new Buffer(4)},this.string="";var r=this;j.apply(r),this._parser.onend=function(){r.emit("end")},this._parser.onerror=function(b){r.emit("error",b),r._parser.error=null},p.forEach(function(b){Object.defineProperty(r,"on"+b,{get:function(){return r._par
|
||
|
Line: `+c.line+`
|
||
|
Column: `+c.column+`
|
||
|
Char: `+c.c,r=new Error(r),c.error=r,ee(c,"onerror",r),c}function te(c){return(c.state!==o.VALUE||c.depth!==0)&&K(c,"Unexpected end"),me(c),c.c="",c.closed=!0,ee(c,"onend"),ve.call(c,c.opt),c}function re(c){return c===u.carriageReturn||c===u.lineFeed||c===u.space||c===u.tab}function Pe(c){var r=this;if(this.error)throw this.error;if(r.closed)return K(r,"Cannot write after close. Assign an onready handler.");if(c===null)return te(r);var b=0,f=c.charCodeAt(0),Z=r.p;for(s.DEBUG&&console.log("write -> ["+c+"]");f&&(Z=f,r.c=f=c.charCodeAt(b++),Z!==f?r.p=Z:Z=r.p,!!f);)switch(s.DEBUG&&console.log(b,f,s.STATE[r.state]),r.position++,f===u.lineFeed?(r.line++,r.column=0):r.column++,r.state){case o.BEGIN:f===u.openBrace?r.state=o.OPEN_OBJECT:f===u.openBracket?r.state=o.OPEN_ARRAY:re(f)||K(r,"Non-whitespace before {[.");continue;case o.OPEN_KEY:case o.OPEN_OBJECT:if(re(f))continue;if(r.state===o.OPEN_KEY)r.stack.push(o.CLOSE_KEY);else if(f===u.closeBrace){ee(r,"onopenobject"),this.depth++,ee(r,"oncloseobject"),this.depth--,r.state=r.stack.pop()||o.VALUE;continue}else r.stack.push(o.CLOSE_OBJECT);f===u.doubleQuote?r.state=o.STRING:K(r,'Malformed object key should start with "');continue;case o.CLOSE_KEY:case o.CLOSE_OBJECT:if(re(f))continue;r.state,o.CLOSE_KEY,f===u.colon?(r.state===o.CLOSE_OBJECT?(r.stack.push(o.CLOSE_OBJECT),me(r,"onopenobject"),this.depth++):me(r,"onkey"),r.state=o.VALUE):f===u.closeBrace?(Ee(r,"oncloseobject"),this.depth--,r.state=r.stack.pop()||o.VALUE):f===u.comma?(r.state===o.CLOSE_OBJECT&&r.stack.push(o.CLOSE_OBJECT),me(r),r.state=o.OPEN_KEY):K(r,"Bad object");continue;case o.OPEN_ARRAY:case o.VALUE:if(re(f))continue;if(r.state===o.OPEN_ARRAY)if(ee(r,"onopenarray"),this.depth++,r.state=o.VALUE,f===u.closeBracket){ee(r,"onclosearray"),this.depth--,r.state=r.stack.pop()||o.VALUE;continue}else r.stack.push(o.CLOSE_ARRAY);f===u.doubleQuote?r.state=o.STRING:f===u.openBrace?r.state=o.OPEN_OBJECT:f===u.openBracket?r.state=o.OPEN_ARRAY:f===u.t?r.state=o.TRUE:f===u.f?r.state=o.FALSE:f===u.n?r.state=o.NULL:f===u.minus?r.numberNode+="-":u._0<=f&&f<=u._9?(r.numberNode+=String.fromCharCode(f),r.state=o.NUMBER_DIGIT):K(r,"Bad value");continue;case o.CLOSE_ARRAY:if(f===u.comma)r.stack.push(o.CLOSE_ARRAY),me(r,"onvalue"),r.state=o.VALUE;else if(f===u.closeBracket)Ee(r,"onclosearray"),this.depth--,r.state=r.stack.pop()||o.VALUE;else{if(re(f))continue;K(r,"Bad array")}continue;case o.STRING:r.textNode===void 0&&(r.textNode="");var M=b-1,ie=r.slashed,he=r.unicodeI;e:for(;;){for(s.DEBUG&&console.log(b,f,s.STATE[r.state],ie);he>0;)if(r.unicodeS+=String.fromCharCode(f),f=c.charCodeAt(b++),r.position++,he===4?(r.textNode+=String.fromCharCode(parseInt(r.unicodeS,16)),he=0,M=b-1):he++,!f)break e;if(f===u.doubleQuote&&!ie){r.state=r.stack.pop()||o.VALUE,r.textNode+=c.substring(M,b-1),r.position+=b-1-M;break}if(f===u.backslash&&!ie&&(ie=!0,r.textNode+=c.substring(M,b-1),r.position+=b-1-M,f=c.charCodeAt(b++),r.position++,!f))break;if(ie){if(ie=!1,f===u.n?r.textNode+=`
|
||
|
`:f===u.r?r.textNode+="\r":f===u.t?r.textNode+=" ":f===u.f?r.textNode+="\f":f===u.b?r.textNode+="\b":f===u.u?(he=1,r.unicodeS=""):r.textNode+=String.fromCharCode(f),f=c.charCodeAt(b++),r.position++,M=b-1,f)continue;break}pe.lastIndex=b;var Se=pe.exec(c);if(Se===null){b=c.length+1,r.textNode+=c.substring(M,b-1),r.position+=b-1-M;break}if(b=Se.index+1,f=c.charCodeAt(Se.index),!f){r.textNode+=c.substring(M,b-1),r.position+=b-1-M;break}}r.slashed=ie,r.unicodeI=he;continue;case o.TRUE:f===u.r?r.state=o.TRUE2:K(r,"Invalid true started with t"+f);continue;case o.TRUE2:f===u.u?r.state=o.TRUE3:K(r,"Invalid true started with tr"+f);continue;case o.TRUE3:f===u.e?(ee(r,"onvalue",!0),r.state=r.stack.pop()||o.VALUE):K(r,"Invalid true started with tru"+f);continue;case o.FALSE:f===u.a?r.state=o.FALSE2:K(r,"Invalid false started with f"+f);continue;case o.FALSE2:f===u.l?r.state=o.FALSE3:K(r,"Invalid false started with fa"+f);continue;case o.FALSE3:f===u.s?r.state=o.FALSE4:K(r,"Invalid false started with fal"+f);continue;case o.FALSE4:f===u.e?(ee(r,"onvalue",!1),r.state=r.stack.pop()||o.VALUE):K(r,"Invalid false started with fals"+f);continue;case o.NULL:f===u.u?r.state=o.NULL2:K(r,"Invalid null started with n"+f);continue;case o.NULL2:f===u.l?r.state=o.NULL3:K(r,"Invalid null started with nu"+f);continue;case o.NULL3:f===u.l?(ee(r,"onvalue",null),r.state=r.stack.pop()||o.VALUE):K(r,"Invalid null started with nul"+f);continue;case o.NUMBER_DECIMAL_POINT:f===u.period?(r.numberNode+=".",r.state=o.NUMBER_DIGIT):K(r,"Leading zero not followed by .");continue;case o.NUMBER_DIGIT:u._0<=f&&f<=u._9?r.numberNode+=String.fromCharCode(f):f===u.period?(r.numberNode.indexOf(".")!==-1&&K(r,"Invalid number has two dots"),r.numberNode+="."):f===u.e||f===u.E?((r.numberNode.indexOf("e")!==-1||r.numberNode.indexOf("E")!==-1)&&K(r,"Invalid number has two exponential"),r.numberNode+="e"):f===u.plus||f===u.minus?(Z===u.e||Z===u.E||K(r,"Invalid symbol in number"),r.numberNode+=String.fromCharCode(f)):(N(r),b--,r.state=r.stack.pop()||o.VALUE);continue;default:K(r,"Unknown state: "+r.state)}return r.position>=r.bufferCheckPosition&&_(r),r}})(v)});function xn(g){var v=0,s=Fn(),m={pullAsync:function(w){return en(this,void 0,void 0,function(){var p,o,j;return We(this,function(R){switch(R.label){case 0:return p=g.slice(v,v+w),v+=w,[4,gn(p,"text")];case 1:return o=R.sent(),j=s.write(o),m.result=j||{},[2,j]}})})},pullSync:function(w){var p=g.slice(v,v+w);v+=w;var o=wn(p,"text"),j=s.write(o);return m.result=j||{},j},done:function(){return s.done()},eof:function(){return v>=g.size},result:{}};return m}function Fn(g){var v=Rn.parser(),s=0,m,w=[],p,o,j=!1,R=!1;return v.onopenobject=function(u){var _={};_.incomplete=!0,m||(m=_),p&&(w.push([o,p,R]),R?p.push(_):p[o]=_),p=_,o=u,R=!1,++s},v.onkey=function(u){return o=u},v.onvalue=function(u){return R?p.push(u):p[o]=u},v.oncloseobject=function(){var u;delete p.incomplete,o=null,--s===0?j=!0:(u=w.pop(),o=u[0],p=u[1],R=u[2])},v.onopenarray=function(){var u=[];u.incomplete=!0,m||(m=u),p&&(w.push([o,p,R]),R?p.push(u):p[o]=u),p=u,R=!0,o=null,++s},v.onclosearray=function(){var u;delete p.incomplete,o=null,--s===0?j=!0:(u=w.pop(),o=u[0],p=u[1],R=u[2])},{write:function(u){return v.write(u),m},done:function(){return j}}}var An=1024;function Kn(g,v){return en(this,void 0,void 0,function(){var s,m,w,p;return We(this,function(o){switch(o.label){case 0:return v=v||{},s=v.chunkSizeBytes||An*1024,[4,En(g,s)];case 1:return m=o.sent(),w=m.result.data,p=new Re(v.name!==void 0?v.name:w.databaseName),p.version(w.databaseVersion).stores(Nn(w)),[4,Tn(p,m,v.name!==void 0?fn(fn({},v),{acceptNameDiff:!0}):v)];case 2:return o.sent(),[2,p]}})})}function Tn(g,v,s){return en(this,void 0,void 0,function(){function m(){return en(this,void 0,void 0,function(){var V,ee,Ee,me,N;return We(this,function(Ne){switch(Ne.label){case 0:V=function(K){var te,re,Pe,c,r,b,f,Z,M,ie,he,Se,Be;return We(this,function(_e){switch(_e.label){case 0:if(u.includes(K.tableName))return[2,"continue"];if(!K.rows)return[2,"break"];if(!K.rows.incomplete&&K.rows.length===0)return[2,"cont
|