Files
2025-02-13 23:19:32 +01:00

2 lines
104 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*! For license information please see nedb.min.js.LICENSE.txt */
(()=>{var e={100:e=>{e.exports={}},159:e=>{e.exports.uid=e=>(e=>{const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=e.length%3;let n,o="";for(let a=0,s=e.length-r;a<s;a+=3)n=(e[a]<<16)+(e[a+1]<<8)+e[a+2],o+=t[(i=n)>>18&63]+t[i>>12&63]+t[i>>6&63]+t[63&i];var i;return 1===r?(n=e[e.length-1],o+=t[n>>2],o+=t[n<<4&63],o+="=="):2===r&&(n=(e[e.length-2]<<8)+e[e.length-1],o+=t[n>>10],o+=t[n>>4&63],o+=t[n<<2&63],o+="="),o})((e=>{const t=new Array(e);for(let r,n=0;n<e;n++)0==(3&n)&&(r=4294967296*Math.random()),t[n]=r>>>((3&n)<<3)&255;return t})(Math.ceil(Math.max(8,2*e)))).replace(/[+/]/g,"").slice(0,e)},909:(e,t,r)=>{const n=r(483).createInstance({name:"NeDB",storeName:"nedbdata"}),o=async(e,t,r)=>{try{await n.setItem(e,t)}catch(e){console.warn("An error happened while writing, skip")}};e.exports.existsAsync=async e=>{try{return null!==await n.getItem(e)}catch(e){return!1}},e.exports.renameAsync=async(e,t)=>{try{const r=await n.getItem(e);null===r?await n.removeItem(t):(await n.setItem(t,r),await n.removeItem(e))}catch(e){console.warn("An error happened while renaming, skip")}},e.exports.writeFileAsync=o,e.exports.crashSafeWriteFileLinesAsync=async(e,t)=>{t.push(""),await o(e,t.join("\n"))},e.exports.appendFileAsync=async(e,t,r)=>{try{const r=await n.getItem(e)||"";await n.setItem(e,r+t)}catch(e){console.warn("An error happened appending to file writing, skip")}},e.exports.readFileAsync=async(e,t)=>{try{return await n.getItem(e)||""}catch(e){return console.warn("An error happened while reading, skip"),""}},e.exports.unlinkAsync=async e=>{try{await n.removeItem(e)}catch(e){console.warn("An error happened while unlinking, skip")}},e.exports.mkdirAsync=(e,t)=>Promise.resolve(),e.exports.ensureDatafileIntegrityAsync=e=>Promise.resolve(),e.exports.ensureParentDirectoryExistsAsync=async(e,t)=>Promise.resolve()},578:(e,t,r)=>{const n=r(118),{callbackify:o}=r(539);e.exports=class{constructor(e,t,r){this.db=e,this.query=t||{},r&&(this.mapFn=r),this._limit=void 0,this._skip=void 0,this._sort=void 0,this._projection=void 0}limit(e){return this._limit=e,this}skip(e){return this._skip=e,this}sort(e){return this._sort=e,this}projection(e){return this._projection=e,this}_project(e){const t=[];let r;if(void 0===this._projection||0===Object.keys(this._projection).length)return e;const o=0!==this._projection._id,{_id:i,...a}=this._projection;this._projection=a;const s=Object.keys(this._projection);return s.forEach((e=>{if(void 0!==r&&this._projection[e]!==r)throw new Error("Can't both keep and omit fields except for _id");r=this._projection[e]})),e.forEach((e=>{let i;1===r?(i={$set:{}},s.forEach((t=>{i.$set[t]=n.getDotValue(e,t),void 0===i.$set[t]&&delete i.$set[t]})),i=n.modify({},i)):(i={$unset:{}},s.forEach((e=>{i.$unset[e]=!0})),i=n.modify(e,i)),o?i._id=e._id:delete i._id,t.push(i)})),t}async _execAsync(){let e=[],t=0,r=0;const o=await this.db._getCandidatesAsync(this.query);for(const i of o)if(n.match(i,this.query))if(this._sort)e.push(i);else if(this._skip&&this._skip>r)r+=1;else if(e.push(i),t+=1,this._limit&&this._limit<=t)break;if(this._sort){const t=Object.entries(this._sort).map((([e,t])=>({key:e,direction:t})));e.sort(((e,r)=>{for(const o of t){const t=o.direction*n.compareThings(n.getDotValue(e,o.key),n.getDotValue(r,o.key),this.db.compareStrings);if(0!==t)return t}return 0}));const r=this._limit||e.length,o=this._skip||0;e=e.slice(o,o+r)}return e=this._project(e),this.mapFn?this.mapFn(e):e}exec(e){o((()=>this.execAsync()))(e)}execAsync(){return this.db.executor.pushAsync((()=>this._execAsync()))}then(e,t){return this.execAsync().then(e,t)}catch(e){return this.execAsync().catch(e)}finally(e){return this.execAsync().finally(e)}}},797:(e,t,r)=>{const{EventEmitter:n}=r(187),{callbackify:o,deprecate:i}=r(539),a=r(578),s=r(159),c=r(196),u=r(98),f=r(118),l=r(328),{isDate:h,pick:p,filterIndexNames:y}=r(988);e.exports=class extends n{constructor(e){let t;super(),"string"==typeof e?i((()=>{t=e,this.inMemoryOnly=!1}),"@seald-io/nedb: Giving a string to the Datastore constructor is deprecated and will be removed in the next major version. Please use an options object with an argument 'filename'.")():(t=(e=e||{}).filename,this.inMemoryOnly=e.inMemoryOnly||!1,this.autoload=e.autoload||!1,this.timestampData=e.timestampData||!1),t&&"string"==typeof t&&0!==t.length?this.filename=t:(this.filename=null,this.inMemoryOnly=!0),this.compareStrings=e.compareStrings,this.persistence=new l({db:this,afterSerialization:e.afterSerialization,beforeDeserialization:e.beforeDeserialization,corruptAlertThreshold:e.corruptAlertThreshold,modes:e.modes,testSerializationHooks:e.testSerializationHooks}),this.executor=new c,this.inMemoryOnly&&(this.executor.ready=!0),this.indexes={},this.indexes._id=new u({fieldName:"_id",unique:!0}),this.ttlIndexes={},this.autoload?(this.autoloadPromise=this.loadDatabaseAsync(),this.autoloadPromise.then((()=>{e.onload&&e.onload()}),(t=>{if(!e.onload)throw t;e.onload(t)}))):this.autoloadPromise=null,this._autocompactionIntervalId=null}compactDatafileAsync(){return this.executor.pushAsync((()=>this.persistence.persistCachedDatabaseAsync()))}compactDatafile(e){const t=this.compactDatafileAsync();"function"==typeof e&&o((()=>t))(e)}setAutocompactionInterval(e){if(Number.isNaN(Number(e)))throw new Error("Interval must be a non-NaN number");const t=Math.max(Number(e),5e3);this.stopAutocompaction(),this._autocompactionIntervalId=setInterval((()=>{this.compactDatafile()}),t)}stopAutocompaction(){this._autocompactionIntervalId&&(clearInterval(this._autocompactionIntervalId),this._autocompactionIntervalId=null)}loadDatabase(e){const t=this.loadDatabaseAsync();"function"==typeof e&&o((()=>t))(e)}dropDatabaseAsync(){return this.persistence.dropDatabaseAsync()}dropDatabase(e){const t=this.dropDatabaseAsync();"function"==typeof e&&o((()=>t))(e)}loadDatabaseAsync(){return this.executor.pushAsync((()=>this.persistence.loadDatabaseAsync()),!0)}getAllData(){return this.indexes._id.getAll()}_resetIndexes(e){for(const t of Object.values(this.indexes))t.reset(e)}ensureIndex(e={},t){const r=this.ensureIndexAsync(e);"function"==typeof t&&o((()=>r))(t)}async ensureIndexAsync(e={}){if(!e.fieldName){const e=new Error("Cannot create an index without a fieldName");throw e.missingFieldName=!0,e}const t=[].concat(e.fieldName).sort();if(t.some((e=>e.includes(","))))throw new Error("Cannot use comma in index fieldName");const r={...e,fieldName:t.join(",")};if(!this.indexes[r.fieldName]){this.indexes[r.fieldName]=new u(r),void 0!==e.expireAfterSeconds&&(this.ttlIndexes[r.fieldName]=r.expireAfterSeconds);try{this.indexes[r.fieldName].insert(this.getAllData())}catch(e){throw delete this.indexes[r.fieldName],e}await this.executor.pushAsync((()=>this.persistence.persistNewStateAsync([{$$indexCreated:r}])),!0)}}removeIndex(e,t=(()=>{})){const r=this.removeIndexAsync(e);o((()=>r))(t)}async removeIndexAsync(e){delete this.indexes[e],await this.executor.pushAsync((()=>this.persistence.persistNewStateAsync([{$$indexRemoved:e}])),!0)}_addToIndexes(e){let t,r;const n=Object.keys(this.indexes);for(let o=0;o<n.length;o+=1)try{this.indexes[n[o]].insert(e)}catch(e){t=o,r=e;break}if(r){for(let r=0;r<t;r+=1)this.indexes[n[r]].remove(e);throw r}}_removeFromIndexes(e){for(const t of Object.values(this.indexes))t.remove(e)}_updateIndexes(e,t){let r,n;const o=Object.keys(this.indexes);for(let i=0;i<o.length;i+=1)try{this.indexes[o[i]].update(e,t)}catch(e){r=i,n=e;break}if(n){for(let n=0;n<r;n+=1)this.indexes[o[n]].revertUpdate(e,t);throw n}}_getRawCandidates(e){const t=Object.keys(this.indexes);let r;if(r=Object.entries(e).filter(y(t)).pop(),r)return this.indexes[r[0]].getMatching(r[1]);const n=t.filter((e=>-1!==e.indexOf(","))).map((e=>e.split(","))).filter((t=>Object.entries(e).filter(y(t)).length===t.length));return n.length>0?this.indexes[n[0]].getMatching(p(e,n[0])):(r=Object.entries(e).filter((([r,n])=>!(!e[r]||!Object.prototype.hasOwnProperty.call(e[r],"$in"))&&t.includes(r))).pop(),r?this.indexes[r[0]].getMatching(r[1].$in):(r=Object.entries(e).filter((([r,n])=>!(!e[r]||!(Object.prototype.hasOwnProperty.call(e[r],"$lt")||Object.prototype.hasOwnProperty.call(e[r],"$lte")||Object.prototype.hasOwnProperty.call(e[r],"$gt")||Object.prototype.hasOwnProperty.call(e[r],"$gte")))&&t.includes(r))).pop(),r?this.indexes[r[0]].getBetweenBounds(r[1]):this.getAllData()))}async _getCandidatesAsync(e,t=!1){const r=[],n=this._getRawCandidates(e);if(t)r.push(...n);else{const e=[],t=Object.keys(this.ttlIndexes);n.forEach((n=>{t.every((e=>!(void 0!==n[e]&&h(n[e])&&Date.now()>n[e].getTime()+1e3*this.ttlIndexes[e])))?r.push(n):e.push(n._id)}));for(const t of e)await this._removeAsync({_id:t},{})}return r}async _insertAsync(e){const t=this._prepareDocumentForInsertion(e);return this._insertInCache(t),await this.persistence.persistNewStateAsync(Array.isArray(t)?t:[t]),f.deepCopy(t)}_createNewId(){let e=s.uid(16);return this.indexes._id.getMatching(e).length>0&&(e=this._createNewId()),e}_prepareDocumentForInsertion(e){let t;if(Array.isArray(e))t=[],e.forEach((e=>{t.push(this._prepareDocumentForInsertion(e))}));else{t=f.deepCopy(e),void 0===t._id&&(t._id=this._createNewId());const r=new Date;this.timestampData&&void 0===t.createdAt&&(t.createdAt=r),this.timestampData&&void 0===t.updatedAt&&(t.updatedAt=r),f.checkObject(t)}return t}_insertInCache(e){Array.isArray(e)?this._insertMultipleDocsInCache(e):this._addToIndexes(e)}_insertMultipleDocsInCache(e){let t,r;for(let n=0;n<e.length;n+=1)try{this._addToIndexes(e[n])}catch(e){r=e,t=n;break}if(r){for(let r=0;r<t;r+=1)this._removeFromIndexes(e[r]);throw r}}insert(e,t){const r=this.insertAsync(e);"function"==typeof t&&o((()=>r))(t)}insertAsync(e){return this.executor.pushAsync((()=>this._insertAsync(e)))}count(e,t){const r=this.countAsync(e);if("function"!=typeof t)return r;o(r.execAsync.bind(r))(t)}countAsync(e){return new a(this,e,(e=>e.length))}find(e,t,r){1===arguments.length?t={}:2===arguments.length&&"function"==typeof t&&(r=t,t={});const n=this.findAsync(e,t);if("function"!=typeof r)return n;o(n.execAsync.bind(n))(r)}findAsync(e,t={}){const r=new a(this,e,(e=>e.map((e=>f.deepCopy(e)))));return r.projection(t),r}findOne(e,t,r){1===arguments.length?t={}:2===arguments.length&&"function"==typeof t&&(r=t,t={});const n=this.findOneAsync(e,t);if("function"!=typeof r)return n;o(n.execAsync.bind(n))(r)}findOneAsync(e,t={}){const r=new a(this,e,(e=>1===e.length?f.deepCopy(e[0]):null));return r.projection(t).limit(1),r}async _updateAsync(e,t,r){const n=void 0!==r.multi&&r.multi;if(void 0!==r.upsert&&r.upsert){const r=new a(this,e);if(1!==(await r.limit(1)._execAsync()).length){let r;try{f.checkObject(t),r=t}catch(n){r=f.modify(f.deepCopy(e,!0),t)}return{numAffected:1,affectedDocuments:await this._insertAsync(r),upsert:!0}}}let o,i=0;const s=[];let c;const u=await this._getCandidatesAsync(e);for(const r of u)f.match(r,e)&&(n||0===i)&&(i+=1,this.timestampData&&(c=r.createdAt),o=f.modify(r,t),this.timestampData&&(o.createdAt=c,o.updatedAt=new Date),s.push({oldDoc:r,newDoc:o}));this._updateIndexes(s);const l=s.map((e=>e.newDoc));if(await this.persistence.persistNewStateAsync(l),r.returnUpdatedDocs){let e=[];return l.forEach((t=>{e.push(f.deepCopy(t))})),n||(e=e[0]),{numAffected:i,affectedDocuments:e,upsert:!1}}return{numAffected:i,upsert:!1,affectedDocuments:null}}update(e,t,r,n){"function"==typeof r&&(n=r,r={}),o(((e,t,r)=>this.updateAsync(e,t,r)))(e,t,r,((e,t={})=>{n&&n(e,t.numAffected,t.affectedDocuments,t.upsert)}))}updateAsync(e,t,r={}){return this.executor.pushAsync((()=>this._updateAsync(e,t,r)))}async _removeAsync(e,t={}){const r=void 0!==t.multi&&t.multi,n=await this._getCandidatesAsync(e,!0),o=[];let i=0;return n.forEach((t=>{f.match(t,e)&&(r||0===i)&&(i+=1,o.push({$$deleted:!0,_id:t._id}),this._removeFromIndexes(t))})),await this.persistence.persistNewStateAsync(o),i}remove(e,t,r){"function"==typeof t&&(r=t,t={});const n=r||(()=>{});o(((e,t)=>this.removeAsync(e,t)))(e,t,n)}removeAsync(e,t={}){return this.executor.pushAsync((()=>this._removeAsync(e,t)))}}},196:(e,t,r)=>{const n=r(496);e.exports=class{constructor(){this.ready=!1,this.queue=new n,this.buffer=null,this._triggerBuffer=null,this.resetBuffer()}pushAsync(e,t=!1){return this.ready||t?this.queue.waterfall(e)():this.buffer.waterfall(e)()}processBuffer(){this.ready=!0,this._triggerBuffer(),this.queue.waterfall((()=>this.buffer.guardian))}resetBuffer(){this.buffer=new n,this.buffer.chain(new Promise((e=>{this._triggerBuffer=e}))),this.ready&&this._triggerBuffer()}}},98:(e,t,r)=>{const n=r(908).AVLTree,o=r(118),{uniq:i,isDate:a}=r(988),s=(e,t)=>e===t,c=e=>null===e?"$null":"string"==typeof e?"$string"+e:"boolean"==typeof e?"$boolean"+e:"number"==typeof e?"$number"+e:a(e)?"$date"+e.getTime():e;e.exports=class{constructor(e){if(this.fieldName=e.fieldName,"string"!=typeof this.fieldName)throw new Error("fieldName must be a string");this._fields=this.fieldName.split(","),this.unique=e.unique||!1,this.sparse=e.sparse||!1,this.treeOptions={unique:this.unique,compareKeys:o.compareThings,checkValueEquality:s},this.tree=new n(this.treeOptions)}reset(e){this.tree=new n(this.treeOptions),e&&this.insert(e)}insert(e){let t,r,n;if(Array.isArray(e))return void this.insertMultipleDocs(e);const a=o.getDotValues(e,this._fields);if(!(void 0===a||"object"==typeof a&&null!==a&&Object.values(a).every((e=>void 0===e)))||!this.sparse)if(Array.isArray(a)){t=i(a,c);for(let o=0;o<t.length;o+=1)try{this.tree.insert(t[o],e)}catch(e){n=e,r=o;break}if(n){for(let n=0;n<r;n+=1)this.tree.delete(t[n],e);throw n}}else this.tree.insert(a,e)}insertMultipleDocs(e){let t,r;for(let n=0;n<e.length;n+=1)try{this.insert(e[n])}catch(e){t=e,r=n;break}if(t){for(let t=0;t<r;t+=1)this.remove(e[t]);throw t}}remove(e){if(Array.isArray(e))return void e.forEach((e=>{this.remove(e)}));const t=o.getDotValues(e,this._fields);void 0===t&&this.sparse||(Array.isArray(t)?i(t,c).forEach((t=>{this.tree.delete(t,e)})):this.tree.delete(t,e))}update(e,t){if(Array.isArray(e))this.updateMultipleDocs(e);else{this.remove(e);try{this.insert(t)}catch(t){throw this.insert(e),t}}}updateMultipleDocs(e){let t,r;for(let t=0;t<e.length;t+=1)this.remove(e[t].oldDoc);for(let n=0;n<e.length;n+=1)try{this.insert(e[n].newDoc)}catch(e){r=e,t=n;break}if(r){for(let r=0;r<t;r+=1)this.remove(e[r].newDoc);for(let t=0;t<e.length;t+=1)this.insert(e[t].oldDoc);throw r}}revertUpdate(e,t){const r=[];Array.isArray(e)?(e.forEach((e=>{r.push({oldDoc:e.newDoc,newDoc:e.oldDoc})})),this.update(r)):this.update(t,e)}getMatching(e){if(Array.isArray(e)){const t={},r=[];return e.forEach((e=>{this.getMatching(e).forEach((e=>{t[e._id]=e}))})),Object.keys(t).forEach((e=>{r.push(t[e])})),r}return this.tree.search(e)}getBetweenBounds(e){return this.tree.betweenBounds(e)}getAll(){const e=[];return this.tree.executeOnEveryNode((t=>{e.push(...t.data)})),e}}},118:(e,t,r)=>{const{uniq:n,isDate:o,isRegExp:i}=r(988),a=(e,t)=>{if("number"==typeof e&&(e=e.toString()),!("$"!==e[0]||"$$date"===e&&"number"==typeof t||"$$deleted"===e&&!0===t||"$$indexCreated"===e||"$$indexRemoved"===e))throw new Error("Field names cannot begin with the $ character");if(-1!==e.indexOf("."))throw new Error("Field names cannot contain a .")},s=e=>{if(Array.isArray(e)&&e.forEach((e=>{s(e)})),"object"==typeof e&&null!==e)for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(a(t,e[t]),s(e[t]))};function c(e,t){if("boolean"==typeof e||"number"==typeof e||"string"==typeof e||null===e||o(e))return e;if(Array.isArray(e))return e.map((e=>c(e,t)));if("object"==typeof e){const r={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(!t||"$"!==n[0]&&-1===n.indexOf("."))&&(r[n]=c(e[n],t));return r}}const u=e=>"boolean"==typeof e||"number"==typeof e||"string"==typeof e||null===e||o(e)||Array.isArray(e),f=(e,t)=>e<t?-1:e>t?1:0,l=(e,t)=>{const r=Math.min(e.length,t.length);for(let n=0;n<r;n+=1){const r=h(e[n],t[n]);if(0!==r)return r}return f(e.length,t.length)},h=(e,t,r)=>{const n=r||f;if(void 0===e)return void 0===t?0:-1;if(void 0===t)return 1;if(null===e)return null===t?0:-1;if(null===t)return 1;if("number"==typeof e)return"number"==typeof t?f(e,t):-1;if("number"==typeof t)return"number"==typeof e?f(e,t):1;if("string"==typeof e)return"string"==typeof t?n(e,t):-1;if("string"==typeof t)return"string"==typeof e?n(e,t):1;if("boolean"==typeof e)return"boolean"==typeof t?f(e,t):-1;if("boolean"==typeof t)return"boolean"==typeof e?f(e,t):1;if(o(e))return o(t)?f(e.getTime(),t.getTime()):-1;if(o(t))return o(e)?f(e.getTime(),t.getTime()):1;if(Array.isArray(e))return Array.isArray(t)?l(e,t):-1;if(Array.isArray(t))return Array.isArray(e)?l(e,t):1;const i=Object.keys(e).sort(),a=Object.keys(t).sort();for(let r=0;r<Math.min(i.length,a.length);r+=1){const n=h(e[i[r]],t[a[r]]);if(0!==n)return n}return f(i.length,a.length)},p=(e,t=!1)=>(r,n,o)=>{const i=(r,n,o)=>{const a="string"==typeof n?n.split("."):n;if(1===a.length)e(r,n,o);else{if(void 0===r[a[0]]){if(t)return;r[a[0]]={}}i(r[a[0]],a.slice(1),o)}};return i(r,n,o)},y=(e,t,r)=>{if(Object.prototype.hasOwnProperty.call(e,t)||(e[t]=[]),!Array.isArray(e[t]))throw new Error("Can't $addToSet an element on non-array values");if(null!==r&&"object"==typeof r&&r.$each){if(Object.keys(r).length>1)throw new Error("Can't use another field in conjunction with $each");if(!Array.isArray(r.$each))throw new Error("$each requires an array value");r.$each.forEach((r=>{y(e,t,r)}))}else{let n=!0;e[t].forEach((e=>{0===h(e,r)&&(n=!1)})),n&&e[t].push(r)}},d={$set:p(((e,t,r)=>{e[t]=r})),$unset:p(((e,t,r)=>{delete e[t]}),!0),$min:p(((e,t,r)=>{(void 0===e[t]||r<e[t])&&(e[t]=r)})),$max:p(((e,t,r)=>{(void 0===e[t]||r>e[t])&&(e[t]=r)})),$inc:p(((e,t,r)=>{if("number"!=typeof r)throw new Error(`${r} must be a number`);if("number"!=typeof e[t]){if(Object.prototype.hasOwnProperty.call(e,t))throw new Error("Don't use the $inc modifier on non-number fields");e[t]=r}else e[t]+=r})),$pull:p(((e,t,r)=>{if(!Array.isArray(e[t]))throw new Error("Can't $pull an element from non-array values");const n=e[t];for(let e=n.length-1;e>=0;e-=1)O(n[e],r)&&n.splice(e,1)})),$pop:p(((e,t,r)=>{if(!Array.isArray(e[t]))throw new Error("Can't $pop an element from non-array values");if("number"!=typeof r)throw new Error(`${r} isn't an integer, can't use it with $pop`);0!==r&&(e[t]=r>0?e[t].slice(0,e[t].length-1):e[t].slice(1))})),$addToSet:p(y),$push:p(((e,t,r)=>{if(Object.prototype.hasOwnProperty.call(e,t)||(e[t]=[]),!Array.isArray(e[t]))throw new Error("Can't $push an element on non-array values");if(null!==r&&"object"==typeof r&&r.$slice&&void 0===r.$each&&(r.$each=[]),null!==r&&"object"==typeof r&&r.$each){if(Object.keys(r).length>=3||2===Object.keys(r).length&&void 0===r.$slice)throw new Error("Can only use $slice in cunjunction with $each when $push to array");if(!Array.isArray(r.$each))throw new Error("$each requires an array value");if(r.$each.forEach((r=>{e[t].push(r)})),void 0===r.$slice||"number"!=typeof r.$slice)return;if(0===r.$slice)e[t]=[];else{let n,o;const i=e[t].length;r.$slice<0?(n=Math.max(0,i+r.$slice),o=i):r.$slice>0&&(n=0,o=Math.min(i,r.$slice)),e[t]=e[t].slice(n,o)}}else e[t].push(r)}))},g=(e,t)=>{const r="string"==typeof t?t.split("."):t;if(e){if(0===r.length)return e;if(1===r.length)return e[r[0]];if(Array.isArray(e[r[0]])){const t=parseInt(r[1],10);return"number"!=typeof t||isNaN(t)?e[r[0]].map((e=>g(e,r.slice(1)))):g(e[r[0]][t],r.slice(2))}return g(e[r[0]],r.slice(1))}},m=(e,t)=>{if(null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e||null===t||"string"==typeof t||"boolean"==typeof t||"number"==typeof t)return e===t;if(o(e)||o(t))return o(e)&&o(t)&&e.getTime()===t.getTime();if((!Array.isArray(e)||!Array.isArray(t))&&(Array.isArray(e)||Array.isArray(t))||void 0===e||void 0===t)return!1;let r,n;try{r=Object.keys(e),n=Object.keys(t)}catch(e){return!1}if(r.length!==n.length)return!1;for(const o of r){if(-1===n.indexOf(o))return!1;if(!m(e[o],t[o]))return!1}return!0},v=(e,t)=>!("string"!=typeof e&&"number"!=typeof e&&!o(e)&&"string"!=typeof t&&"number"!=typeof t&&!o(t))&&typeof e==typeof t,b={$lt:(e,t)=>v(e,t)&&e<t,$lte:(e,t)=>v(e,t)&&e<=t,$gt:(e,t)=>v(e,t)&&e>t,$gte:(e,t)=>v(e,t)&&e>=t,$ne:(e,t)=>void 0===e||!m(e,t),$in:(e,t)=>{if(!Array.isArray(t))throw new Error("$in operator called with a non-array");for(const r of t)if(m(e,r))return!0;return!1},$nin:(e,t)=>{if(!Array.isArray(t))throw new Error("$nin operator called with a non-array");return!b.$in(e,t)},$regex:(e,t)=>{if(!i(t))throw new Error("$regex operator called with non regular expression");return"string"==typeof e&&t.test(e)},$exists:(e,t)=>(t=!(!t&&""!==t),void 0===e?!t:t),$size:(e,t)=>{if(!Array.isArray(e))return!1;if(t%1!=0)throw new Error("$size operator called without an integer");return e.length===t},$elemMatch:(e,t)=>!!Array.isArray(e)&&e.some((e=>O(e,t)))},w={$size:!0,$elemMatch:!0},A={$or:(e,t)=>{if(!Array.isArray(t))throw new Error("$or operator used without an array");for(let r=0;r<t.length;r+=1)if(O(e,t[r]))return!0;return!1},$and:(e,t)=>{if(!Array.isArray(t))throw new Error("$and operator used without an array");for(let r=0;r<t.length;r+=1)if(!O(e,t[r]))return!1;return!0},$not:(e,t)=>!O(e,t),$where:(e,t)=>{if("function"!=typeof t)throw new Error("$where operator used without a function");const r=t.call(e);if("boolean"!=typeof r)throw new Error("$where function must return boolean");return r}},O=(e,t)=>{if(u(e)||u(t))return x({needAKey:e},"needAKey",t);for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const n=t[r];if("$"===r[0]){if(!A[r])throw new Error(`Unknown logical operator ${r}`);if(!A[r](e,n))return!1}else if(!x(e,r,n))return!1}return!0};function x(e,t,r,n){const o=g(e,t);if(Array.isArray(o)&&!n){if(Array.isArray(r))return x(e,t,r,!0);if(null!==r&&"object"==typeof r&&!i(r))for(const n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&w[n])return x(e,t,r,!0);for(const e of o)if(x({k:e},"k",r))return!0;return!1}if(null!==r&&"object"==typeof r&&!i(r)&&!Array.isArray(r)){const e=Object.keys(r),t=e.map((e=>e[0])),n=t.filter((e=>"$"===e));if(0!==n.length&&n.length!==t.length)throw new Error("You cannot mix operators and normal fields");if(n.length>0){for(const t of e){if(!b[t])throw new Error(`Unknown comparison function ${t}`);if(!b[t](o,r[t]))return!1}return!0}}return i(r)?b.$regex(o,r):m(o,r)}e.exports.serialize=e=>JSON.stringify(e,(function(e,t){if(a(e,t),void 0!==t)return null===t?null:"function"==typeof this[e].getTime?{$$date:this[e].getTime()}:t})),e.exports.deserialize=e=>JSON.parse(e,(function(e,t){return"$$date"===e?new Date(t):"string"==typeof t||"number"==typeof t||"boolean"==typeof t||null===t?t:t&&t.$$date?t.$$date:t})),e.exports.deepCopy=c,e.exports.checkObject=s,e.exports.isPrimitiveType=u,e.exports.modify=(e,t)=>{const r=Object.keys(t),o=r.map((e=>e[0])),i=o.filter((e=>"$"===e));let a,u;if(-1!==r.indexOf("_id")&&t._id!==e._id)throw new Error("You cannot change a document's _id");if(0!==i.length&&i.length!==o.length)throw new Error("You cannot mix modifiers and normal fields");if(0===i.length?(a=c(t),a._id=e._id):(u=n(r),a=c(e),u.forEach((e=>{if(!d[e])throw new Error(`Unknown modifier ${e}`);if("object"!=typeof t[e])throw new Error(`Modifier ${e}'s argument must be an object`);Object.keys(t[e]).forEach((r=>{d[e](a,r,t[e][r])}))}))),s(a),e._id!==a._id)throw new Error("You can't change a document's _id");return a},e.exports.getDotValue=g,e.exports.getDotValues=(e,t)=>{if(!Array.isArray(t))throw new Error("fields must be an Array");if(t.length>1){const r={};for(const n of t)r[n]=g(e,n);return r}return g(e,t[0])},e.exports.match=O,e.exports.areThingsEqual=m,e.exports.compareThings=h},328:(e,t,r)=>{const{deprecate:n}=r(539),o=r(100),i=r(159),a=r(98),s=r(118),c=r(909);class u{constructor(e){if(this.db=e.db,this.inMemoryOnly=this.db.inMemoryOnly,this.filename=this.db.filename,this.corruptAlertThreshold=void 0!==e.corruptAlertThreshold?e.corruptAlertThreshold:.1,this.modes=void 0!==e.modes?e.modes:{fileMode:420,dirMode:493},void 0===this.modes.fileMode&&(this.modes.fileMode=420),void 0===this.modes.dirMode&&(this.modes.dirMode=493),!this.inMemoryOnly&&this.filename&&"~"===this.filename.charAt(this.filename.length-1))throw new Error("The datafile name can't end with a ~, which is reserved for crash safe backup files");if(e.afterSerialization&&!e.beforeDeserialization)throw new Error("Serialization hook defined but deserialization hook undefined, cautiously refusing to start NeDB to prevent dataloss");if(!e.afterSerialization&&e.beforeDeserialization)throw new Error("Serialization hook undefined but deserialization hook defined, cautiously refusing to start NeDB to prevent dataloss");if(this.afterSerialization=e.afterSerialization||(e=>e),this.beforeDeserialization=e.beforeDeserialization||(e=>e),void 0===e.testSerializationHooks||e.testSerializationHooks)for(let e=1;e<30;e+=1)for(let t=0;t<10;t+=1){const t=i.uid(e);if(this.beforeDeserialization(this.afterSerialization(t))!==t)throw new Error("beforeDeserialization is not the reverse of afterSerialization, cautiously refusing to start NeDB to prevent dataloss")}}async persistCachedDatabaseAsync(){const e=[];this.inMemoryOnly||(this.db.getAllData().forEach((t=>{e.push(this.afterSerialization(s.serialize(t)))})),Object.keys(this.db.indexes).forEach((t=>{"_id"!==t&&e.push(this.afterSerialization(s.serialize({$$indexCreated:{fieldName:this.db.indexes[t].fieldName,unique:this.db.indexes[t].unique,sparse:this.db.indexes[t].sparse}})))})),await c.crashSafeWriteFileLinesAsync(this.filename,e,this.modes),this.db.emit("compaction.done"))}compactDatafile(e){n((e=>this.db.compactDatafile(e)),"@seald-io/nedb: calling Datastore#persistence#compactDatafile is deprecated, please use Datastore#compactDatafile, it will be removed in the next major version.")(e)}setAutocompactionInterval(e){n((e=>this.db.setAutocompactionInterval(e)),"@seald-io/nedb: calling Datastore#persistence#setAutocompactionInterval is deprecated, please use Datastore#setAutocompactionInterval, it will be removed in the next major version.")(e)}stopAutocompaction(){n((()=>this.db.stopAutocompaction()),"@seald-io/nedb: calling Datastore#persistence#stopAutocompaction is deprecated, please use Datastore#stopAutocompaction, it will be removed in the next major version.")()}async persistNewStateAsync(e){let t="";this.inMemoryOnly||(e.forEach((e=>{t+=this.afterSerialization(s.serialize(e))+"\n"})),0!==t.length&&await c.appendFileAsync(this.filename,t,{encoding:"utf8",mode:this.modes.fileMode}))}treatRawData(e){const t=e.split("\n"),r={},n={};let o=t.length,i=0;for(const e of t)if(""!==e)try{const t=s.deserialize(this.beforeDeserialization(e));t._id?!0===t.$$deleted?delete r[t._id]:r[t._id]=t:t.$$indexCreated&&null!=t.$$indexCreated.fieldName?n[t.$$indexCreated.fieldName]=t.$$indexCreated:"string"==typeof t.$$indexRemoved&&delete n[t.$$indexRemoved]}catch(e){i+=1}else o--;if(o>0){const e=i/o;if(e>this.corruptAlertThreshold){const t=new Error(`${Math.floor(100*e)}% of the data file is corrupt, more than given corruptAlertThreshold (${Math.floor(100*this.corruptAlertThreshold)}%). Cautiously refusing to start NeDB to prevent dataloss.`);throw t.corruptionRate=e,t.corruptItems=i,t.dataLength=o,t}}return{data:Object.values(r),indexes:n}}treatRawStreamAsync(e){return new Promise(((t,r)=>{const n={},i={};let a=0;const c=o(e);let u=0;c.on("data",(e=>{if(""!==e){try{const t=s.deserialize(this.beforeDeserialization(e));t._id?!0===t.$$deleted?delete n[t._id]:n[t._id]=t:t.$$indexCreated&&null!=t.$$indexCreated.fieldName?i[t.$$indexCreated.fieldName]=t.$$indexCreated:"string"==typeof t.$$indexRemoved&&delete i[t.$$indexRemoved]}catch(e){a+=1}u++}})),c.on("end",(()=>{if(u>0){const e=a/u;if(e>this.corruptAlertThreshold){const t=new Error(`${Math.floor(100*e)}% of the data file is corrupt, more than given corruptAlertThreshold (${Math.floor(100*this.corruptAlertThreshold)}%). Cautiously refusing to start NeDB to prevent dataloss.`);return t.corruptionRate=e,t.corruptItems=a,t.dataLength=u,void r(t,null)}}const e=Object.values(n);t({data:e,indexes:i})})),c.on("error",(function(e){r(e,null)}))}))}async loadDatabaseAsync(){if(this.db._resetIndexes(),this.inMemoryOnly)return;let e;if(await u.ensureParentDirectoryExistsAsync(this.filename,this.modes.dirMode),await c.ensureDatafileIntegrityAsync(this.filename,this.modes.fileMode),c.readFileStream){const t=c.readFileStream(this.filename,{encoding:"utf8",mode:this.modes.fileMode});e=await this.treatRawStreamAsync(t)}else{const t=await c.readFileAsync(this.filename,{encoding:"utf8",mode:this.modes.fileMode});e=this.treatRawData(t)}Object.keys(e.indexes).forEach((t=>{this.db.indexes[t]=new a(e.indexes[t])}));try{this.db._resetIndexes(e.data)}catch(e){throw this.db._resetIndexes(),e}await this.db.persistence.persistCachedDatabaseAsync(),this.db.executor.processBuffer()}async dropDatabaseAsync(){this.db.stopAutocompaction(),this.db.executor.ready=!1,this.db.executor.resetBuffer(),await this.db.executor.queue.guardian,this.db.indexes={},this.db.indexes._id=new a({fieldName:"_id",unique:!0}),this.db.ttlIndexes={},this.db.inMemoryOnly||await this.db.executor.pushAsync((async()=>{await c.existsAsync(this.filename)&&await c.unlinkAsync(this.filename)}),!0)}static async ensureParentDirectoryExistsAsync(e,t=493){return c.ensureParentDirectoryExistsAsync(e,t)}}e.exports=u},988:e=>{const t=e=>"object"==typeof e&&null!==e,r=e=>t(e)&&"[object Date]"===Object.prototype.toString.call(e);e.exports.uniq=(e,t)=>t?[...new Map(e.map((e=>[t(e),e]))).values()]:[...new Set(e)],e.exports.isDate=r,e.exports.isRegExp=e=>t(e)&&"[object RegExp]"===Object.prototype.toString.call(e),e.exports.pick=(e,t)=>t.reduce(((t,r)=>(e&&Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]),t)),{}),e.exports.filterIndexNames=e=>([t,n])=>!("string"!=typeof n&&"number"!=typeof n&&"boolean"!=typeof n&&!r(n)&&null!==n)&&e.includes(t)},496:e=>{e.exports=class{constructor(){this.guardian=Promise.resolve()}waterfall(e){return(...t)=>(this.guardian=this.guardian.then((()=>e(...t).then((e=>({error:!1,result:e})),(e=>({error:!0,result:e}))))),this.guardian.then((({error:e,result:t})=>e?Promise.reject(t):Promise.resolve(t))))}chain(e){return this.waterfall((()=>e))()}}},908:(e,t,r)=>{r(902),e.exports.AVLTree=r(522)},522:(e,t,r)=>{const n=r(902),o=r(639);class i{constructor(e){this.tree=new a(e)}checkIsAVLT(){this.tree.checkIsAVLT()}insert(e,t){const r=this.tree.insert(e,t);r&&(this.tree=r)}delete(e,t){const r=this.tree.delete(e,t);r&&(this.tree=r)}}class a extends n{constructor(e){super(),e=e||{},this.left=null,this.right=null,this.parent=void 0!==e.parent?e.parent:null,Object.prototype.hasOwnProperty.call(e,"key")&&(this.key=e.key),this.data=Object.prototype.hasOwnProperty.call(e,"value")?[e.value]:[],this.unique=e.unique||!1,this.compareKeys=e.compareKeys||o.defaultCompareKeysFunction,this.checkValueEquality=e.checkValueEquality||o.defaultCheckValueEquality}checkHeightCorrect(){if(!Object.prototype.hasOwnProperty.call(this,"key"))return;if(this.left&&void 0===this.left.height)throw new Error("Undefined height for node "+this.left.key);if(this.right&&void 0===this.right.height)throw new Error("Undefined height for node "+this.right.key);if(void 0===this.height)throw new Error("Undefined height for node "+this.key);const e=this.left?this.left.height:0,t=this.right?this.right.height:0;if(this.height!==1+Math.max(e,t))throw new Error("Height constraint failed for node "+this.key);this.left&&this.left.checkHeightCorrect(),this.right&&this.right.checkHeightCorrect()}balanceFactor(){return(this.left?this.left.height:0)-(this.right?this.right.height:0)}checkBalanceFactors(){if(Math.abs(this.balanceFactor())>1)throw new Error("Tree is unbalanced at node "+this.key);this.left&&this.left.checkBalanceFactors(),this.right&&this.right.checkBalanceFactors()}checkIsAVLT(){super.checkIsBST(),this.checkHeightCorrect(),this.checkBalanceFactors()}rightRotation(){const e=this,t=this.left;if(!t)return e;const r=t.right;e.parent?(t.parent=e.parent,e.parent.left===e?e.parent.left=t:e.parent.right=t):t.parent=null,t.right=e,e.parent=t,e.left=r,r&&(r.parent=e);const n=t.left?t.left.height:0,o=r?r.height:0,i=e.right?e.right.height:0;return e.height=Math.max(o,i)+1,t.height=Math.max(n,e.height)+1,t}leftRotation(){const e=this,t=this.right;if(!t)return this;const r=t.left;e.parent?(t.parent=e.parent,e.parent.left===e?e.parent.left=t:e.parent.right=t):t.parent=null,t.left=e,e.parent=t,e.right=r,r&&(r.parent=e);const n=e.left?e.left.height:0,o=r?r.height:0,i=t.right?t.right.height:0;return e.height=Math.max(n,o)+1,t.height=Math.max(i,e.height)+1,t}rightTooSmall(){return this.balanceFactor()<=1?this:(this.left.balanceFactor()<0&&this.left.leftRotation(),this.rightRotation())}leftTooSmall(){return this.balanceFactor()>=-1?this:(this.right.balanceFactor()>0&&this.right.rightRotation(),this.leftRotation())}rebalanceAlongPath(e){let t,r,n=this;if(!Object.prototype.hasOwnProperty.call(this,"key"))return delete this.height,this;for(r=e.length-1;r>=0;r-=1)e[r].height=1+Math.max(e[r].left?e[r].left.height:0,e[r].right?e[r].right.height:0),e[r].balanceFactor()>1&&(t=e[r].rightTooSmall(),0===r&&(n=t)),e[r].balanceFactor()<-1&&(t=e[r].leftTooSmall(),0===r&&(n=t));return n}insert(e,t){const r=[];let n=this;if(!Object.prototype.hasOwnProperty.call(this,"key"))return this.key=e,this.data.push(t),this.height=1,this;for(;;){if(0===n.compareKeys(n.key,e)){if(n.unique){const t=new Error(`Can't insert key ${JSON.stringify(e)}, it violates the unique constraint`);throw t.key=e,t.errorType="uniqueViolated",t}return n.data.push(t),this}if(r.push(n),n.compareKeys(e,n.key)<0){if(!n.left){r.push(n.createLeftChild({key:e,value:t}));break}n=n.left}else{if(!n.right){r.push(n.createRightChild({key:e,value:t}));break}n=n.right}}return this.rebalanceAlongPath(r)}delete(e,t){const r=[];let n,o=this;const i=[];if(!Object.prototype.hasOwnProperty.call(this,"key"))return this;for(;0!==o.compareKeys(e,o.key);)if(i.push(o),o.compareKeys(e,o.key)<0){if(!o.left)return this;o=o.left}else{if(!o.right)return this;o=o.right}if(o.data.length>1&&void 0!==t)return o.data.forEach((function(e){o.checkValueEquality(e,t)||r.push(e)})),o.data=r,this;if(!o.left&&!o.right)return o===this?(delete o.key,o.data=[],delete o.height,this):(o.parent.left===o?o.parent.left=null:o.parent.right=null,this.rebalanceAlongPath(i));if(!o.left||!o.right)return n=o.left?o.left:o.right,o===this?(n.parent=null,n):(o.parent.left===o?(o.parent.left=n,n.parent=o.parent):(o.parent.right=n,n.parent=o.parent),this.rebalanceAlongPath(i));if(i.push(o),n=o.left,!n.right)return o.key=n.key,o.data=n.data,o.left=n.left,n.left&&(n.left.parent=o),this.rebalanceAlongPath(i);for(;n.right;)i.push(n),n=n.right;return o.key=n.key,o.data=n.data,n.parent.right=n.left,n.left&&(n.left.parent=n.parent),this.rebalanceAlongPath(i)}}i._AVLTree=a,["getNumberOfKeys","search","betweenBounds","prettyPrint","executeOnEveryNode"].forEach((function(e){i.prototype[e]=function(){return this.tree[e].apply(this.tree,arguments)}})),e.exports=i},902:(e,t,r)=>{const n=r(639);function o(e,t){for(let r=0;r<t.length;r+=1)e.push(t[r])}e.exports=class{constructor(e){e=e||{},this.left=null,this.right=null,this.parent=void 0!==e.parent?e.parent:null,Object.prototype.hasOwnProperty.call(e,"key")&&(this.key=e.key),this.data=Object.prototype.hasOwnProperty.call(e,"value")?[e.value]:[],this.unique=e.unique||!1,this.compareKeys=e.compareKeys||n.defaultCompareKeysFunction,this.checkValueEquality=e.checkValueEquality||n.defaultCheckValueEquality}getMaxKeyDescendant(){return this.right?this.right.getMaxKeyDescendant():this}getMaxKey(){return this.getMaxKeyDescendant().key}getMinKeyDescendant(){return this.left?this.left.getMinKeyDescendant():this}getMinKey(){return this.getMinKeyDescendant().key}checkAllNodesFullfillCondition(e){Object.prototype.hasOwnProperty.call(this,"key")&&(e(this.key,this.data),this.left&&this.left.checkAllNodesFullfillCondition(e),this.right&&this.right.checkAllNodesFullfillCondition(e))}checkNodeOrdering(){Object.prototype.hasOwnProperty.call(this,"key")&&(this.left&&(this.left.checkAllNodesFullfillCondition((e=>{if(this.compareKeys(e,this.key)>=0)throw new Error(`Tree with root ${this.key} is not a binary search tree`)})),this.left.checkNodeOrdering()),this.right&&(this.right.checkAllNodesFullfillCondition((e=>{if(this.compareKeys(e,this.key)<=0)throw new Error(`Tree with root ${this.key} is not a binary search tree`)})),this.right.checkNodeOrdering()))}checkInternalPointers(){if(this.left){if(this.left.parent!==this)throw new Error(`Parent pointer broken for key ${this.key}`);this.left.checkInternalPointers()}if(this.right){if(this.right.parent!==this)throw new Error(`Parent pointer broken for key ${this.key}`);this.right.checkInternalPointers()}}checkIsBST(){if(this.checkNodeOrdering(),this.checkInternalPointers(),this.parent)throw new Error("The root shouldn't have a parent")}getNumberOfKeys(){let e;return Object.prototype.hasOwnProperty.call(this,"key")?(e=1,this.left&&(e+=this.left.getNumberOfKeys()),this.right&&(e+=this.right.getNumberOfKeys()),e):0}createSimilar(e){return(e=e||{}).unique=this.unique,e.compareKeys=this.compareKeys,e.checkValueEquality=this.checkValueEquality,new this.constructor(e)}createLeftChild(e){const t=this.createSimilar(e);return t.parent=this,this.left=t,t}createRightChild(e){const t=this.createSimilar(e);return t.parent=this,this.right=t,t}insert(e,t){if(!Object.prototype.hasOwnProperty.call(this,"key"))return this.key=e,void this.data.push(t);if(0!==this.compareKeys(this.key,e))this.compareKeys(e,this.key)<0?this.left?this.left.insert(e,t):this.createLeftChild({key:e,value:t}):this.right?this.right.insert(e,t):this.createRightChild({key:e,value:t});else{if(this.unique){const t=new Error(`Can't insert key ${JSON.stringify(e)}, it violates the unique constraint`);throw t.key=e,t.errorType="uniqueViolated",t}this.data.push(t)}}search(e){return Object.prototype.hasOwnProperty.call(this,"key")?0===this.compareKeys(this.key,e)?this.data:this.compareKeys(e,this.key)<0?this.left?this.left.search(e):[]:this.right?this.right.search(e):[]:[]}getLowerBoundMatcher(e){return Object.prototype.hasOwnProperty.call(e,"$gt")||Object.prototype.hasOwnProperty.call(e,"$gte")?Object.prototype.hasOwnProperty.call(e,"$gt")&&Object.prototype.hasOwnProperty.call(e,"$gte")?0===this.compareKeys(e.$gte,e.$gt)?t=>this.compareKeys(t,e.$gt)>0:this.compareKeys(e.$gte,e.$gt)>0?t=>this.compareKeys(t,e.$gte)>=0:t=>this.compareKeys(t,e.$gt)>0:Object.prototype.hasOwnProperty.call(e,"$gt")?t=>this.compareKeys(t,e.$gt)>0:t=>this.compareKeys(t,e.$gte)>=0:()=>!0}getUpperBoundMatcher(e){return Object.prototype.hasOwnProperty.call(e,"$lt")||Object.prototype.hasOwnProperty.call(e,"$lte")?Object.prototype.hasOwnProperty.call(e,"$lt")&&Object.prototype.hasOwnProperty.call(e,"$lte")?0===this.compareKeys(e.$lte,e.$lt)?t=>this.compareKeys(t,e.$lt)<0:this.compareKeys(e.$lte,e.$lt)<0?t=>this.compareKeys(t,e.$lte)<=0:t=>this.compareKeys(t,e.$lt)<0:Object.prototype.hasOwnProperty.call(e,"$lt")?t=>this.compareKeys(t,e.$lt)<0:t=>this.compareKeys(t,e.$lte)<=0:()=>!0}betweenBounds(e,t,r){const n=[];return Object.prototype.hasOwnProperty.call(this,"key")?(t=t||this.getLowerBoundMatcher(e),r=r||this.getUpperBoundMatcher(e),t(this.key)&&this.left&&o(n,this.left.betweenBounds(e,t,r)),t(this.key)&&r(this.key)&&o(n,this.data),r(this.key)&&this.right&&o(n,this.right.betweenBounds(e,t,r)),n):[]}deleteIfLeaf(){return!(this.left||this.right||(this.parent?(this.parent.left===this?this.parent.left=null:this.parent.right=null,0):(delete this.key,this.data=[],0)))}deleteIfOnlyOneChild(){let e;return this.left&&!this.right&&(e=this.left),!this.left&&this.right&&(e=this.right),!!e&&(this.parent?(this.parent.left===this?(this.parent.left=e,e.parent=this.parent):(this.parent.right=e,e.parent=this.parent),!0):(this.key=e.key,this.data=e.data,this.left=null,e.left&&(this.left=e.left,e.left.parent=this),this.right=null,e.right&&(this.right=e.right,e.right.parent=this),!0))}delete(e,t){const r=[];let n;if(Object.prototype.hasOwnProperty.call(this,"key"))if(this.compareKeys(e,this.key)<0)this.left&&this.left.delete(e,t);else if(this.compareKeys(e,this.key)>0)this.right&&this.right.delete(e,t);else if(0!==!this.compareKeys(e,this.key))return this.data.length>1&&void 0!==t?(this.data.forEach((e=>{this.checkValueEquality(e,t)||r.push(e)})),void(this.data=r)):void(this.deleteIfLeaf()||this.deleteIfOnlyOneChild()||(Math.random()>=.5?(n=this.left.getMaxKeyDescendant(),this.key=n.key,this.data=n.data,this===n.parent?(this.left=n.left,n.left&&(n.left.parent=n.parent)):(n.parent.right=n.left,n.left&&(n.left.parent=n.parent))):(n=this.right.getMinKeyDescendant(),this.key=n.key,this.data=n.data,this===n.parent?(this.right=n.right,n.right&&(n.right.parent=n.parent)):(n.parent.left=n.right,n.right&&(n.right.parent=n.parent)))))}executeOnEveryNode(e){this.left&&this.left.executeOnEveryNode(e),e(this),this.right&&this.right.executeOnEveryNode(e)}prettyPrint(e,t){t=t||"",console.log(`${t}* ${this.key}`),e&&console.log(`${t}* ${this.data}`),(this.left||this.right)&&(this.left?this.left.prettyPrint(e,`${t} `):console.log(`${t} *`),this.right?this.right.prettyPrint(e,`${t} `):console.log(`${t} *`))}}},639:e=>{const t=e=>{if(0===e)return[];if(1===e)return[0];const r=t(e-1),n=Math.floor(Math.random()*e);return r.splice(n,0,e-1),r};e.exports.getRandomArray=t,e.exports.defaultCompareKeysFunction=(e,t)=>{if(e<t)return-1;if(e>t)return 1;if(e===t)return 0;const r=new Error("Couldn't compare elements");throw r.a=e,r.b=t,r},e.exports.defaultCheckValueEquality=(e,t)=>e===t},924:(e,t,r)=>{"use strict";var n=r(210),o=r(559),i=o(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&i(e,".prototype.")>-1?o(r):r}},559:(e,t,r)=>{"use strict";var n=r(612),o=r(210),i=o("%Function.prototype.apply%"),a=o("%Function.prototype.call%"),s=o("%Reflect.apply%",!0)||n.call(a,i),c=o("%Object.getOwnPropertyDescriptor%",!0),u=o("%Object.defineProperty%",!0),f=o("%Math.max%");if(u)try{u({},"a",{value:1})}catch(e){u=null}e.exports=function(e){var t=s(n,a,arguments);return c&&u&&c(t,"length").configurable&&u(t,"length",{value:1+f(0,e.length-(arguments.length-1))}),t};var l=function(){return s(n,i,arguments)};u?u(e.exports,"apply",{value:l}):e.exports.apply=l},187:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function i(){i.init.call(this)}e.exports=i,e.exports.once=function(e,t){return new Promise((function(r,n){function o(r){e.removeListener(t,i),n(r)}function i(){"function"==typeof e.removeListener&&e.removeListener("error",o),r([].slice.call(arguments))}d(e,t,i,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&d(e,"error",t,{once:!0})}(e,o)}))},i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var a=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function u(e,t,r,n){var o,i,a,u;if(s(r),void 0===(i=e._events)?(i=e._events=Object.create(null),e._eventsCount=0):(void 0!==i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),a=i[t]),void 0===a)a=i[t]=r,++e._eventsCount;else if("function"==typeof a?a=i[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(o=c(e))>0&&a.length>o&&!a.warned){a.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=e,f.type=t,f.count=a.length,u=f,console&&console.warn&&console.warn(u)}return e}function f(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},o=f.bind(n);return o.listener=r,n.wrapFn=o,o}function h(e,t,r){var n=e._events;if(void 0===n)return[];var o=n[t];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(o):y(o,o.length)}function p(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function y(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function d(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function o(i){n.once&&e.removeEventListener(t,o),r(i)}))}}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),i.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},i.prototype.getMaxListeners=function(){return c(this)},i.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var o="error"===e,i=this._events;if(void 0!==i)o=o&&void 0===i.error;else if(!o)return!1;if(o){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var c=i[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else{var u=c.length,f=y(c,u);for(r=0;r<u;++r)n(f[r],this,t)}return!0},i.prototype.addListener=function(e,t){return u(this,e,t,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(e,t){return u(this,e,t,!0)},i.prototype.once=function(e,t){return s(t),this.on(e,l(this,e,t)),this},i.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,l(this,e,t)),this},i.prototype.removeListener=function(e,t){var r,n,o,i,a;if(s(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===t||r[i].listener===t){a=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,o),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var o,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(o=i[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},i.prototype.listeners=function(e){return h(this,e,!0)},i.prototype.rawListeners=function(e){return h(this,e,!1)},i.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},i.prototype.listenerCount=p,i.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},29:(e,t,r)=>{"use strict";var n=r(320),o=Object.prototype.toString,i=Object.prototype.hasOwnProperty,a=function(e,t,r){for(var n=0,o=e.length;n<o;n++)i.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))},s=function(e,t,r){for(var n=0,o=e.length;n<o;n++)null==r?t(e.charAt(n),n,e):t.call(r,e.charAt(n),n,e)},c=function(e,t,r){for(var n in e)i.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))};e.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var i;arguments.length>=3&&(i=r),"[object Array]"===o.call(e)?a(e,t,i):"string"==typeof e?s(e,t,i):c(e,t,i)}},648:e=>{"use strict";var t="Function.prototype.bind called on incompatible ",r=Array.prototype.slice,n=Object.prototype.toString,o="[object Function]";e.exports=function(e){var i=this;if("function"!=typeof i||n.call(i)!==o)throw new TypeError(t+i);for(var a,s=r.call(arguments,1),c=Math.max(0,i.length-s.length),u=[],f=0;f<c;f++)u.push("$"+f);if(a=Function("binder","return function ("+u.join(",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof a){var t=i.apply(this,s.concat(r.call(arguments)));return Object(t)===t?t:this}return i.apply(e,s.concat(r.call(arguments)))})),i.prototype){var l=function(){};l.prototype=i.prototype,a.prototype=new l,l.prototype=null}return a}},612:(e,t,r)=>{"use strict";var n=r(648);e.exports=Function.prototype.bind||n},210:(e,t,r)=>{"use strict";var n,o=SyntaxError,i=Function,a=TypeError,s=function(e){try{return i('"use strict"; return ('+e+").constructor;")()}catch(e){}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch(e){c=null}var u=function(){throw new a},f=c?function(){try{return u}catch(e){try{return c(arguments,"callee").get}catch(e){return u}}}():u,l=r(405)(),h=Object.getPrototypeOf||function(e){return e.__proto__},p={},y="undefined"==typeof Uint8Array?n:h(Uint8Array),d={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":l?h([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":i,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":l?h(h([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&l?h((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&l?h((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":l?h(""[Symbol.iterator]()):n,"%Symbol%":l?Symbol:n,"%SyntaxError%":o,"%ThrowTypeError%":f,"%TypedArray%":y,"%TypeError%":a,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};try{null.error}catch(e){var g=h(h(e));d["%Error.prototype%"]=g}var m=function e(t){var r;if("%AsyncFunction%"===t)r=s("async function () {}");else if("%GeneratorFunction%"===t)r=s("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=s("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var o=e("%AsyncGenerator%");o&&(r=h(o.prototype))}return d[t]=r,r},v={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},b=r(612),w=r(642),A=b.call(Function.call,Array.prototype.concat),O=b.call(Function.apply,Array.prototype.splice),x=b.call(Function.call,String.prototype.replace),_=b.call(Function.call,String.prototype.slice),j=b.call(Function.call,RegExp.prototype.exec),S=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,E=/\\(\\)?/g,k=function(e){var t=_(e,0,1),r=_(e,-1);if("%"===t&&"%"!==r)throw new o("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new o("invalid intrinsic syntax, expected opening `%`");var n=[];return x(e,S,(function(e,t,r,o){n[n.length]=r?x(o,E,"$1"):t||e})),n},I=function(e,t){var r,n=e;if(w(v,n)&&(n="%"+(r=v[n])[0]+"%"),w(d,n)){var i=d[n];if(i===p&&(i=m(n)),void 0===i&&!t)throw new a("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new o("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new a("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new a('"allowMissing" argument must be a boolean');if(null===j(/^%?[^%]*%?$/,e))throw new o("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=k(e),n=r.length>0?r[0]:"",i=I("%"+n+"%",t),s=i.name,u=i.value,f=!1,l=i.alias;l&&(n=l[0],O(r,A([0,1],l)));for(var h=1,p=!0;h<r.length;h+=1){var y=r[h],g=_(y,0,1),m=_(y,-1);if(('"'===g||"'"===g||"`"===g||'"'===m||"'"===m||"`"===m)&&g!==m)throw new o("property names with quotes must have matching quotes");if("constructor"!==y&&p||(f=!0),w(d,s="%"+(n+="."+y)+"%"))u=d[s];else if(null!=u){if(!(y in u)){if(!t)throw new a("base intrinsic for "+e+" exists, but the property is not available.");return}if(c&&h+1>=r.length){var v=c(u,y);u=(p=!!v)&&"get"in v&&!("originalValue"in v.get)?v.get:u[y]}else p=w(u,y),u=u[y];p&&!f&&(d[s]=u)}}return u}},296:(e,t,r)=>{"use strict";var n=r(210)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},405:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(419);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},419:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},410:(e,t,r)=>{"use strict";var n=r(419);e.exports=function(){return n()&&!!Symbol.toStringTag}},642:(e,t,r)=>{"use strict";var n=r(612);e.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},717:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},584:(e,t,r)=>{"use strict";var n=r(410)(),o=r(924)("Object.prototype.toString"),i=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===o(e)},a=function(e){return!!i(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==o(e)&&"[object Function]"===o(e.callee)},s=function(){return i(arguments)}();i.isLegacyArguments=a,e.exports=s?i:a},320:e=>{"use strict";var t,r,n=Function.prototype.toString,o="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof o&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},o((function(){throw 42}),null,t)}catch(e){e!==r&&(o=null)}else o=null;var i=/^\s*class\b/,a=function(e){try{var t=n.call(e);return i.test(t)}catch(e){return!1}},s=function(e){try{return!a(e)&&(n.call(e),!0)}catch(e){return!1}},c=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,f=!(0 in[,]),l=function(){return!1};if("object"==typeof document){var h=document.all;c.call(h)===c.call(document.all)&&(l=function(e){if((f||!e)&&(void 0===e||"object"==typeof e))try{var t=c.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=o?function(e){if(l(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{o(e,null,t)}catch(e){if(e!==r)return!1}return!a(e)&&s(e)}:function(e){if(l(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(u)return s(e);if(a(e))return!1;var t=c.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&s(e)}},662:(e,t,r)=>{"use strict";var n,o=Object.prototype.toString,i=Function.prototype.toString,a=/^\s*(?:function)?\*/,s=r(410)(),c=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(a.test(i.call(e)))return!0;if(!s)return"[object GeneratorFunction]"===o.call(e);if(!c)return!1;if(void 0===n){var t=function(){if(!s)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&c(t)}return c(e)===n}},692:(e,t,r)=>{"use strict";var n=r(29),o=r(83),i=r(924),a=i("Object.prototype.toString"),s=r(410)(),c=r(296),u="undefined"==typeof globalThis?r.g:globalThis,f=o(),l=i("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},h=i("String.prototype.slice"),p={},y=Object.getPrototypeOf;s&&c&&y&&n(f,(function(e){var t=new u[e];if(Symbol.toStringTag in t){var r=y(t),n=c(r,Symbol.toStringTag);if(!n){var o=y(r);n=c(o,Symbol.toStringTag)}p[e]=n.get}})),e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!s||!(Symbol.toStringTag in e)){var t=h(a(e),8,-1);return l(f,t)>-1}return!!c&&function(e){var t=!1;return n(p,(function(r,n){if(!t)try{t=r.call(e)===n}catch(e){}})),t}(e)}},483:(e,t,r)=>{e.exports=function e(t,r,n){function o(a,s){if(!r[a]){if(!t[a]){if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=r[a]={exports:{}};t[a][0].call(u.exports,(function(e){return o(t[a][1][e]||e)}),u,u.exports,e,t,r,n)}return r[a].exports}for(var i=void 0,a=0;a<n.length;a++)o(n[a]);return o}({1:[function(e,t,n){(function(e){"use strict";var r,n,o=e.MutationObserver||e.WebKitMutationObserver;if(o){var i=0,a=new o(f),s=e.document.createTextNode("");a.observe(s,{characterData:!0}),r=function(){s.data=i=++i%2}}else if(e.setImmediate||void 0===e.MessageChannel)r="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){f(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(f,0)};else{var c=new e.MessageChannel;c.port1.onmessage=f,r=function(){c.port2.postMessage(0)}}var u=[];function f(){var e,t;n=!0;for(var r=u.length;r;){for(t=u,u=[],e=-1;++e<r;)t[e]();r=u.length}n=!1}t.exports=function(e){1!==u.push(e)||n||r()}}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(e,t,r){"use strict";var n=e(1);function o(){}var i={},a=["REJECTED"],s=["FULFILLED"],c=["PENDING"];function u(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=c,this.queue=[],this.outcome=void 0,e!==o&&p(this,e)}function f(e,t,r){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function l(e,t,r){n((function(){var n;try{n=t(r)}catch(t){return i.reject(e,t)}n===e?i.reject(e,new TypeError("Cannot resolve promise with itself")):i.resolve(e,n)}))}function h(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function p(e,t){var r=!1;function n(t){r||(r=!0,i.reject(e,t))}function o(t){r||(r=!0,i.resolve(e,t))}var a=y((function(){t(o,n)}));"error"===a.status&&n(a.value)}function y(e,t){var r={};try{r.value=e(t),r.status="success"}catch(e){r.status="error",r.value=e}return r}t.exports=u,u.prototype.catch=function(e){return this.then(null,e)},u.prototype.then=function(e,t){if("function"!=typeof e&&this.state===s||"function"!=typeof t&&this.state===a)return this;var r=new this.constructor(o);return this.state!==c?l(r,this.state===s?e:t,this.outcome):this.queue.push(new f(r,e,t)),r},f.prototype.callFulfilled=function(e){i.resolve(this.promise,e)},f.prototype.otherCallFulfilled=function(e){l(this.promise,this.onFulfilled,e)},f.prototype.callRejected=function(e){i.reject(this.promise,e)},f.prototype.otherCallRejected=function(e){l(this.promise,this.onRejected,e)},i.resolve=function(e,t){var r=y(h,t);if("error"===r.status)return i.reject(e,r.value);var n=r.value;if(n)p(e,n);else{e.state=s,e.outcome=t;for(var o=-1,a=e.queue.length;++o<a;)e.queue[o].callFulfilled(t)}return e},i.reject=function(e,t){e.state=a,e.outcome=t;for(var r=-1,n=e.queue.length;++r<n;)e.queue[r].callRejected(t);return e},u.resolve=function(e){return e instanceof this?e:i.resolve(new this(o),e)},u.reject=function(e){var t=new this(o);return i.reject(t,e)},u.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);for(var a=new Array(r),s=0,c=-1,u=new this(o);++c<r;)f(e[c],c);return u;function f(e,o){t.resolve(e).then((function(e){a[o]=e,++s!==r||n||(n=!0,i.resolve(u,a))}),(function(e){n||(n=!0,i.reject(u,e))}))}},u.race=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r,n=e.length,a=!1;if(!n)return this.resolve([]);for(var s=-1,c=new this(o);++s<n;)r=e[s],t.resolve(r).then((function(e){a||(a=!0,i.resolve(c,e))}),(function(e){a||(a=!0,i.reject(c,e))}));return c}},{1:1}],3:[function(e,t,n){(function(t){"use strict";"function"!=typeof t.Promise&&(t.Promise=e(2))}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(e,t,r){"use strict";var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var o=function(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(e){return}}();function i(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(o){if("TypeError"!==o.name)throw o;for(var r=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),n=0;n<e.length;n+=1)r.append(e[n]);return r.getBlob(t.type)}}"undefined"==typeof Promise&&e(3);var a=Promise;function s(e,t){t&&e.then((function(e){t(null,e)}),(function(e){t(e)}))}function c(e,t,r){"function"==typeof t&&e.then(t),"function"==typeof r&&e.catch(r)}function u(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function f(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var l="local-forage-detect-blob-support",h=void 0,p={},y=Object.prototype.toString,d="readonly",g="readwrite";function m(e){for(var t=e.length,r=new ArrayBuffer(t),n=new Uint8Array(r),o=0;o<t;o++)n[o]=e.charCodeAt(o);return r}function v(e){return"boolean"==typeof h?a.resolve(h):function(e){return new a((function(t){var r=e.transaction(l,g),n=i([""]);r.objectStore(l).put(n,"key"),r.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},r.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),r=navigator.userAgent.match(/Edge\//);t(r||!e||parseInt(e[1],10)>=43)}})).catch((function(){return!1}))}(e).then((function(e){return h=e}))}function b(e){var t=p[e.name],r={};r.promise=new a((function(e,t){r.resolve=e,r.reject=t})),t.deferredOperations.push(r),t.dbReady?t.dbReady=t.dbReady.then((function(){return r.promise})):t.dbReady=r.promise}function w(e){var t=p[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function A(e,t){var r=p[e.name].deferredOperations.pop();if(r)return r.reject(t),r.promise}function O(e,t){return new a((function(r,n){if(p[e.name]=p[e.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},e.db){if(!t)return r(e.db);b(e),e.db.close()}var i=[e.name];t&&i.push(e.version);var a=o.open.apply(o,i);t&&(a.onupgradeneeded=function(t){var r=a.result;try{r.createObjectStore(e.storeName),t.oldVersion<=1&&r.createObjectStore(l)}catch(r){if("ConstraintError"!==r.name)throw r;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),a.onerror=function(e){e.preventDefault(),n(a.error)},a.onsuccess=function(){var t=a.result;t.onversionchange=function(e){e.target.close()},r(t),w(e)}}))}function x(e){return O(e,!1)}function _(e){return O(e,!0)}function j(e,t){if(!e.db)return!0;var r=!e.db.objectStoreNames.contains(e.storeName),n=e.version<e.db.version,o=e.version>e.db.version;if(n&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),o||r){if(r){var i=e.db.version+1;i>e.version&&(e.version=i)}return!0}return!1}function S(e){return i([m(atob(e.data))],{type:e.type})}function E(e){return e&&e.__local_forage_encoded_blob}function k(e){var t=this,r=t._initReady().then((function(){var e=p[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return c(r,e,e),r}function I(e,t,r,n){void 0===n&&(n=1);try{var o=e.db.transaction(e.storeName,t);r(null,o)}catch(o){if(n>0&&(!e.db||"InvalidStateError"===o.name||"NotFoundError"===o.name))return a.resolve().then((function(){if(!e.db||"NotFoundError"===o.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),_(e)})).then((function(){return function(e){b(e);for(var t=p[e.name],r=t.forages,n=0;n<r.length;n++){var o=r[n];o._dbInfo.db&&(o._dbInfo.db.close(),o._dbInfo.db=null)}return e.db=null,x(e).then((function(t){return e.db=t,j(e)?_(e):t})).then((function(n){e.db=t.db=n;for(var o=0;o<r.length;o++)r[o]._dbInfo.db=n})).catch((function(t){throw A(e,t),t}))}(e).then((function(){I(e,t,r,n-1)}))})).catch(r);r(o)}}var P={_driver:"asyncStorage",_initStorage:function(e){var t=this,r={db:null};if(e)for(var n in e)r[n]=e[n];var o=p[r.name];o||(o={forages:[],db:null,dbReady:null,deferredOperations:[]},p[r.name]=o),o.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=k);var i=[];function s(){return a.resolve()}for(var c=0;c<o.forages.length;c++){var u=o.forages[c];u!==t&&i.push(u._initReady().catch(s))}var f=o.forages.slice(0);return a.all(i).then((function(){return r.db=o.db,x(r)})).then((function(e){return r.db=e,j(r,t._defaultConfig.version)?_(r):e})).then((function(e){r.db=o.db=e,t._dbInfo=r;for(var n=0;n<f.length;n++){var i=f[n];i!==t&&(i._dbInfo.db=r.db,i._dbInfo.version=r.version)}}))},_support:function(){try{if(!o||!o.open)return!1;var e="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||t)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(e){return!1}}(),iterate:function(e,t){var r=this,n=new a((function(t,n){r.ready().then((function(){I(r._dbInfo,d,(function(o,i){if(o)return n(o);try{var a=i.objectStore(r._dbInfo.storeName).openCursor(),s=1;a.onsuccess=function(){var r=a.result;if(r){var n=r.value;E(n)&&(n=S(n));var o=e(n,r.key,s++);void 0!==o?t(o):r.continue()}else t()},a.onerror=function(){n(a.error)}}catch(e){n(e)}}))})).catch(n)}));return s(n,t),n},getItem:function(e,t){var r=this;e=u(e);var n=new a((function(t,n){r.ready().then((function(){I(r._dbInfo,d,(function(o,i){if(o)return n(o);try{var a=i.objectStore(r._dbInfo.storeName).get(e);a.onsuccess=function(){var e=a.result;void 0===e&&(e=null),E(e)&&(e=S(e)),t(e)},a.onerror=function(){n(a.error)}}catch(e){n(e)}}))})).catch(n)}));return s(n,t),n},setItem:function(e,t,r){var n=this;e=u(e);var o=new a((function(r,o){var i;n.ready().then((function(){return i=n._dbInfo,"[object Blob]"===y.call(t)?v(i.db).then((function(e){return e?t:(r=t,new a((function(e,t){var n=new FileReader;n.onerror=t,n.onloadend=function(t){var n=btoa(t.target.result||"");e({__local_forage_encoded_blob:!0,data:n,type:r.type})},n.readAsBinaryString(r)})));var r})):t})).then((function(t){I(n._dbInfo,g,(function(i,a){if(i)return o(i);try{var s=a.objectStore(n._dbInfo.storeName);null===t&&(t=void 0);var c=s.put(t,e);a.oncomplete=function(){void 0===t&&(t=null),r(t)},a.onabort=a.onerror=function(){var e=c.error?c.error:c.transaction.error;o(e)}}catch(e){o(e)}}))})).catch(o)}));return s(o,r),o},removeItem:function(e,t){var r=this;e=u(e);var n=new a((function(t,n){r.ready().then((function(){I(r._dbInfo,g,(function(o,i){if(o)return n(o);try{var a=i.objectStore(r._dbInfo.storeName).delete(e);i.oncomplete=function(){t()},i.onerror=function(){n(a.error)},i.onabort=function(){var e=a.error?a.error:a.transaction.error;n(e)}}catch(e){n(e)}}))})).catch(n)}));return s(n,t),n},clear:function(e){var t=this,r=new a((function(e,r){t.ready().then((function(){I(t._dbInfo,g,(function(n,o){if(n)return r(n);try{var i=o.objectStore(t._dbInfo.storeName).clear();o.oncomplete=function(){e()},o.onabort=o.onerror=function(){var e=i.error?i.error:i.transaction.error;r(e)}}catch(e){r(e)}}))})).catch(r)}));return s(r,e),r},length:function(e){var t=this,r=new a((function(e,r){t.ready().then((function(){I(t._dbInfo,d,(function(n,o){if(n)return r(n);try{var i=o.objectStore(t._dbInfo.storeName).count();i.onsuccess=function(){e(i.result)},i.onerror=function(){r(i.error)}}catch(e){r(e)}}))})).catch(r)}));return s(r,e),r},key:function(e,t){var r=this,n=new a((function(t,n){e<0?t(null):r.ready().then((function(){I(r._dbInfo,d,(function(o,i){if(o)return n(o);try{var a=i.objectStore(r._dbInfo.storeName),s=!1,c=a.openKeyCursor();c.onsuccess=function(){var r=c.result;r?0===e||s?t(r.key):(s=!0,r.advance(e)):t(null)},c.onerror=function(){n(c.error)}}catch(e){n(e)}}))})).catch(n)}));return s(n,t),n},keys:function(e){var t=this,r=new a((function(e,r){t.ready().then((function(){I(t._dbInfo,d,(function(n,o){if(n)return r(n);try{var i=o.objectStore(t._dbInfo.storeName).openKeyCursor(),a=[];i.onsuccess=function(){var t=i.result;t?(a.push(t.key),t.continue()):e(a)},i.onerror=function(){r(i.error)}}catch(e){r(e)}}))})).catch(r)}));return s(r,e),r},dropInstance:function(e,t){t=f.apply(this,arguments);var r,n=this.config();if((e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName),e.name){var i=e.name===n.name&&this._dbInfo.db?a.resolve(this._dbInfo.db):x(e).then((function(t){var r=p[e.name],n=r.forages;r.db=t;for(var o=0;o<n.length;o++)n[o]._dbInfo.db=t;return t}));r=e.storeName?i.then((function(t){if(t.objectStoreNames.contains(e.storeName)){var r=t.version+1;b(e);var n=p[e.name],i=n.forages;t.close();for(var s=0;s<i.length;s++){var c=i[s];c._dbInfo.db=null,c._dbInfo.version=r}var u=new a((function(t,n){var i=o.open(e.name,r);i.onerror=function(e){i.result.close(),n(e)},i.onupgradeneeded=function(){i.result.deleteObjectStore(e.storeName)},i.onsuccess=function(){var e=i.result;e.close(),t(e)}}));return u.then((function(e){n.db=e;for(var t=0;t<i.length;t++){var r=i[t];r._dbInfo.db=e,w(r._dbInfo)}})).catch((function(t){throw(A(e,t)||a.resolve()).catch((function(){})),t}))}})):i.then((function(t){b(e);var r=p[e.name],n=r.forages;t.close();for(var i=0;i<n.length;i++)n[i]._dbInfo.db=null;var s=new a((function(t,r){var n=o.deleteDatabase(e.name);n.onerror=function(){var e=n.result;e&&e.close(),r(n.error)},n.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},n.onsuccess=function(){var e=n.result;e&&e.close(),t(e)}}));return s.then((function(e){r.db=e;for(var t=0;t<n.length;t++)w(n[t]._dbInfo)})).catch((function(t){throw(A(e,t)||a.resolve()).catch((function(){})),t}))}))}else r=a.reject("Invalid arguments");return s(r,t),r}};var D="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$="~~local_forage_type~",N=/^~~local_forage_type~([^~]+)~/,T="__lfsc__:",M=T.length,F="arbf",C="blob",R="si08",B="ui08",L="uic8",U="si16",z="si32",q="ur16",K="ui32",V="fl32",W="fl64",G=M+F.length,H=Object.prototype.toString;function J(e){var t,r,n,o,i,a=.75*e.length,s=e.length,c=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var u=new ArrayBuffer(a),f=new Uint8Array(u);for(t=0;t<s;t+=4)r=D.indexOf(e[t]),n=D.indexOf(e[t+1]),o=D.indexOf(e[t+2]),i=D.indexOf(e[t+3]),f[c++]=r<<2|n>>4,f[c++]=(15&n)<<4|o>>2,f[c++]=(3&o)<<6|63&i;return u}function Y(e){var t,r=new Uint8Array(e),n="";for(t=0;t<r.length;t+=3)n+=D[r[t]>>2],n+=D[(3&r[t])<<4|r[t+1]>>4],n+=D[(15&r[t+1])<<2|r[t+2]>>6],n+=D[63&r[t+2]];return r.length%3==2?n=n.substring(0,n.length-1)+"=":r.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}var Q={serialize:function(e,t){var r="";if(e&&(r=H.call(e)),e&&("[object ArrayBuffer]"===r||e.buffer&&"[object ArrayBuffer]"===H.call(e.buffer))){var n,o=T;e instanceof ArrayBuffer?(n=e,o+=F):(n=e.buffer,"[object Int8Array]"===r?o+=R:"[object Uint8Array]"===r?o+=B:"[object Uint8ClampedArray]"===r?o+=L:"[object Int16Array]"===r?o+=U:"[object Uint16Array]"===r?o+=q:"[object Int32Array]"===r?o+=z:"[object Uint32Array]"===r?o+=K:"[object Float32Array]"===r?o+=V:"[object Float64Array]"===r?o+=W:t(new Error("Failed to get type for BinaryArray"))),t(o+Y(n))}else if("[object Blob]"===r){var i=new FileReader;i.onload=function(){var r=$+e.type+"~"+Y(this.result);t(T+C+r)},i.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(r){console.error("Couldn't convert value into a JSON string: ",e),t(null,r)}},deserialize:function(e){if(e.substring(0,M)!==T)return JSON.parse(e);var t,r=e.substring(G),n=e.substring(M,G);if(n===C&&N.test(r)){var o=r.match(N);t=o[1],r=r.substring(o[0].length)}var a=J(r);switch(n){case F:return a;case C:return i([a],{type:t});case R:return new Int8Array(a);case B:return new Uint8Array(a);case L:return new Uint8ClampedArray(a);case U:return new Int16Array(a);case q:return new Uint16Array(a);case z:return new Int32Array(a);case K:return new Uint32Array(a);case V:return new Float32Array(a);case W:return new Float64Array(a);default:throw new Error("Unkown type: "+n)}},stringToBuffer:J,bufferToString:Y};function X(e,t,r,n){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,n)}function Z(e,t,r,n,o,i){e.executeSql(r,n,o,(function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,s){s.rows.length?i(e,a):X(e,t,(function(){e.executeSql(r,n,o,i)}),i)}),i):i(e,a)}),i)}function ee(e,t,r,n){var o=this;e=u(e);var i=new a((function(i,a){o.ready().then((function(){void 0===t&&(t=null);var s=t,c=o._dbInfo;c.serializer.serialize(t,(function(t,u){u?a(u):c.db.transaction((function(r){Z(r,c,"INSERT OR REPLACE INTO "+c.storeName+" (key, value) VALUES (?, ?)",[e,t],(function(){i(s)}),(function(e,t){a(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(n>0)return void i(ee.apply(o,[e,s,r,n-1]));a(t)}}))}))})).catch(a)}));return s(i,r),i}var te={_driver:"webSQLStorage",_initStorage:function(e){var t=this,r={db:null};if(e)for(var n in e)r[n]="string"!=typeof e[n]?e[n].toString():e[n];var o=new a((function(e,n){try{r.db=openDatabase(r.name,String(r.version),r.description,r.size)}catch(e){return n(e)}r.db.transaction((function(o){X(o,r,(function(){t._dbInfo=r,e()}),(function(e,t){n(t)}))}),n)}));return r.serializer=Q,o},_support:"function"==typeof openDatabase,iterate:function(e,t){var r=this,n=new a((function(t,n){r.ready().then((function(){var o=r._dbInfo;o.db.transaction((function(r){Z(r,o,"SELECT * FROM "+o.storeName,[],(function(r,n){for(var i=n.rows,a=i.length,s=0;s<a;s++){var c=i.item(s),u=c.value;if(u&&(u=o.serializer.deserialize(u)),void 0!==(u=e(u,c.key,s+1)))return void t(u)}t()}),(function(e,t){n(t)}))}))})).catch(n)}));return s(n,t),n},getItem:function(e,t){var r=this;e=u(e);var n=new a((function(t,n){r.ready().then((function(){var o=r._dbInfo;o.db.transaction((function(r){Z(r,o,"SELECT * FROM "+o.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,r){var n=r.rows.length?r.rows.item(0).value:null;n&&(n=o.serializer.deserialize(n)),t(n)}),(function(e,t){n(t)}))}))})).catch(n)}));return s(n,t),n},setItem:function(e,t,r){return ee.apply(this,[e,t,r,1])},removeItem:function(e,t){var r=this;e=u(e);var n=new a((function(t,n){r.ready().then((function(){var o=r._dbInfo;o.db.transaction((function(r){Z(r,o,"DELETE FROM "+o.storeName+" WHERE key = ?",[e],(function(){t()}),(function(e,t){n(t)}))}))})).catch(n)}));return s(n,t),n},clear:function(e){var t=this,r=new a((function(e,r){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){Z(t,n,"DELETE FROM "+n.storeName,[],(function(){e()}),(function(e,t){r(t)}))}))})).catch(r)}));return s(r,e),r},length:function(e){var t=this,r=new a((function(e,r){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){Z(t,n,"SELECT COUNT(key) as c FROM "+n.storeName,[],(function(t,r){var n=r.rows.item(0).c;e(n)}),(function(e,t){r(t)}))}))})).catch(r)}));return s(r,e),r},key:function(e,t){var r=this,n=new a((function(t,n){r.ready().then((function(){var o=r._dbInfo;o.db.transaction((function(r){Z(r,o,"SELECT key FROM "+o.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,r){var n=r.rows.length?r.rows.item(0).key:null;t(n)}),(function(e,t){n(t)}))}))})).catch(n)}));return s(n,t),n},keys:function(e){var t=this,r=new a((function(e,r){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){Z(t,n,"SELECT key FROM "+n.storeName,[],(function(t,r){for(var n=[],o=0;o<r.rows.length;o++)n.push(r.rows.item(o).key);e(n)}),(function(e,t){r(t)}))}))})).catch(r)}));return s(r,e),r},dropInstance:function(e,t){t=f.apply(this,arguments);var r=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||r.name,e.storeName=e.storeName||r.storeName);var n,o=this;return s(n=e.name?new a((function(t){var n;n=e.name===r.name?o._dbInfo.db:openDatabase(e.name,"","",0),e.storeName?t({db:n,storeNames:[e.storeName]}):t(function(e){return new a((function(t,r){e.transaction((function(n){n.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(r,n){for(var o=[],i=0;i<n.rows.length;i++)o.push(n.rows.item(i).name);t({db:e,storeNames:o})}),(function(e,t){r(t)}))}),(function(e){r(e)}))}))}(n))})).then((function(e){return new a((function(t,r){e.db.transaction((function(n){function o(e){return new a((function(t,r){n.executeSql("DROP TABLE IF EXISTS "+e,[],(function(){t()}),(function(e,t){r(t)}))}))}for(var i=[],s=0,c=e.storeNames.length;s<c;s++)i.push(o(e.storeNames[s]));a.all(i).then((function(){t()})).catch((function(e){r(e)}))}),(function(e){r(e)}))}))})):a.reject("Invalid arguments"),t),n}};function re(e,t){var r=e.name+"/";return e.storeName!==t.storeName&&(r+=e.storeName+"/"),r}function ne(){return!function(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch(e){return!0}}()||localStorage.length>0}var oe={_driver:"localStorageWrapper",_initStorage:function(e){var t={};if(e)for(var r in e)t[r]=e[r];return t.keyPrefix=re(e,this._defaultConfig),ne()?(this._dbInfo=t,t.serializer=Q,a.resolve()):a.reject()},_support:function(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&!!localStorage.setItem}catch(e){return!1}}(),iterate:function(e,t){var r=this,n=r.ready().then((function(){for(var t=r._dbInfo,n=t.keyPrefix,o=n.length,i=localStorage.length,a=1,s=0;s<i;s++){var c=localStorage.key(s);if(0===c.indexOf(n)){var u=localStorage.getItem(c);if(u&&(u=t.serializer.deserialize(u)),void 0!==(u=e(u,c.substring(o),a++)))return u}}}));return s(n,t),n},getItem:function(e,t){var r=this;e=u(e);var n=r.ready().then((function(){var t=r._dbInfo,n=localStorage.getItem(t.keyPrefix+e);return n&&(n=t.serializer.deserialize(n)),n}));return s(n,t),n},setItem:function(e,t,r){var n=this;e=u(e);var o=n.ready().then((function(){void 0===t&&(t=null);var r=t;return new a((function(o,i){var a=n._dbInfo;a.serializer.serialize(t,(function(t,n){if(n)i(n);else try{localStorage.setItem(a.keyPrefix+e,t),o(r)}catch(e){"QuotaExceededError"!==e.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==e.name||i(e),i(e)}}))}))}));return s(o,r),o},removeItem:function(e,t){var r=this;e=u(e);var n=r.ready().then((function(){var t=r._dbInfo;localStorage.removeItem(t.keyPrefix+e)}));return s(n,t),n},clear:function(e){var t=this,r=t.ready().then((function(){for(var e=t._dbInfo.keyPrefix,r=localStorage.length-1;r>=0;r--){var n=localStorage.key(r);0===n.indexOf(e)&&localStorage.removeItem(n)}}));return s(r,e),r},length:function(e){var t=this.keys().then((function(e){return e.length}));return s(t,e),t},key:function(e,t){var r=this,n=r.ready().then((function(){var t,n=r._dbInfo;try{t=localStorage.key(e)}catch(e){t=null}return t&&(t=t.substring(n.keyPrefix.length)),t}));return s(n,t),n},keys:function(e){var t=this,r=t.ready().then((function(){for(var e=t._dbInfo,r=localStorage.length,n=[],o=0;o<r;o++){var i=localStorage.key(o);0===i.indexOf(e.keyPrefix)&&n.push(i.substring(e.keyPrefix.length))}return n}));return s(r,e),r},dropInstance:function(e,t){if(t=f.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var r=this.config();e.name=e.name||r.name,e.storeName=e.storeName||r.storeName}var n,o=this;return n=e.name?new a((function(t){e.storeName?t(re(e,o._defaultConfig)):t(e.name+"/")})).then((function(e){for(var t=localStorage.length-1;t>=0;t--){var r=localStorage.key(t);0===r.indexOf(e)&&localStorage.removeItem(r)}})):a.reject("Invalid arguments"),s(n,t),n}},ie=function(e,t){for(var r=e.length,n=0;n<r;){if((o=e[n])===(i=t)||"number"==typeof o&&"number"==typeof i&&isNaN(o)&&isNaN(i))return!0;n++}var o,i;return!1},ae=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},se={},ce={},ue={INDEXEDDB:P,WEBSQL:te,LOCALSTORAGE:oe},fe=[ue.INDEXEDDB._driver,ue.WEBSQL._driver,ue.LOCALSTORAGE._driver],le=["dropInstance"],he=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(le),pe={description:"",driver:fe.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function ye(e,t){e[t]=function(){var r=arguments;return e.ready().then((function(){return e[t].apply(e,r)}))}}function de(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var r in t)t.hasOwnProperty(r)&&(ae(t[r])?arguments[0][r]=t[r].slice():arguments[0][r]=t[r])}return arguments[0]}var ge=function(){function e(t){for(var r in function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ue)if(ue.hasOwnProperty(r)){var n=ue[r],o=n._driver;this[r]=o,se[o]||this.defineDriver(n)}this._defaultConfig=de({},pe),this._config=de({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((function(){}))}return e.prototype.config=function(e){if("object"===(void 0===e?"undefined":n(e))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in e){if("storeName"===t&&(e[t]=e[t].replace(/\W/g,"_")),"version"===t&&"number"!=typeof e[t])return new Error("Database version must be a number.");this._config[t]=e[t]}return!("driver"in e)||!e.driver||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config},e.prototype.defineDriver=function(e,t,r){var n=new a((function(t,r){try{var n=e._driver,o=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void r(o);for(var i=he.concat("_initStorage"),c=0,u=i.length;c<u;c++){var f=i[c];if((!ie(le,f)||e[f])&&"function"!=typeof e[f])return void r(o)}!function(){for(var t=function(e){return function(){var t=new Error("Method "+e+" is not implemented by the current driver"),r=a.reject(t);return s(r,arguments[arguments.length-1]),r}},r=0,n=le.length;r<n;r++){var o=le[r];e[o]||(e[o]=t(o))}}();var l=function(r){se[n]&&console.info("Redefining LocalForage driver: "+n),se[n]=e,ce[n]=r,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(l,r):l(!!e._support):l(!0)}catch(e){r(e)}}));return c(n,t,r),n},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,r){var n=se[e]?a.resolve(se[e]):a.reject(new Error("Driver not found."));return c(n,t,r),n},e.prototype.getSerializer=function(e){var t=a.resolve(Q);return c(t,e),t},e.prototype.ready=function(e){var t=this,r=t._driverSet.then((function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready}));return c(r,e,e),r},e.prototype.setDriver=function(e,t,r){var n=this;ae(e)||(e=[e]);var o=this._getSupportedDrivers(e);function i(){n._config.driver=n.driver()}function s(e){return n._extend(e),i(),n._ready=n._initStorage(n._config),n._ready}var u=null!==this._driverSet?this._driverSet.catch((function(){return a.resolve()})):a.resolve();return this._driverSet=u.then((function(){var e=o[0];return n._dbInfo=null,n._ready=null,n.getDriver(e).then((function(e){n._driver=e._driver,i(),n._wrapLibraryMethodsWithReady(),n._initDriver=function(e){return function(){var t=0;return function r(){for(;t<e.length;){var o=e[t];return t++,n._dbInfo=null,n._ready=null,n.getDriver(o).then(s).catch(r)}i();var c=new Error("No available storage method found.");return n._driverSet=a.reject(c),n._driverSet}()}}(o)}))})).catch((function(){i();var e=new Error("No available storage method found.");return n._driverSet=a.reject(e),n._driverSet})),c(this._driverSet,t,r),this._driverSet},e.prototype.supports=function(e){return!!ce[e]},e.prototype._extend=function(e){de(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],r=0,n=e.length;r<n;r++){var o=e[r];this.supports(o)&&t.push(o)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=he.length;e<t;e++)ye(this,he[e])},e.prototype.createInstance=function(t){return new e(t)},e}(),me=new ge;t.exports=me},{3:3}]},{},[4])(4)},155:e=>{var t,r,n=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:i}catch(e){r=i}}();var s,c=[],u=!1,f=-1;function l(){u&&s&&(u=!1,s.length?c=s.concat(c):f=-1,c.length&&h())}function h(){if(!u){var e=a(l);u=!0;for(var t=c.length;t;){for(s=c,c=[];++f<t;)s&&s[f].run();f=-1,t=c.length}s=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===i||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function y(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new p(e,t)),1!==c.length||u||a(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=y,n.addListener=y,n.once=y,n.off=y,n.removeListener=y,n.removeAllListeners=y,n.emit=y,n.prependListener=y,n.prependOnceListener=y,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},384:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},955:(e,t,r)=>{"use strict";var n=r(584),o=r(662),i=r(430),a=r(692);function s(e){return e.call.bind(e)}var c="undefined"!=typeof BigInt,u="undefined"!=typeof Symbol,f=s(Object.prototype.toString),l=s(Number.prototype.valueOf),h=s(String.prototype.valueOf),p=s(Boolean.prototype.valueOf);if(c)var y=s(BigInt.prototype.valueOf);if(u)var d=s(Symbol.prototype.valueOf);function g(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function m(e){return"[object Map]"===f(e)}function v(e){return"[object Set]"===f(e)}function b(e){return"[object WeakMap]"===f(e)}function w(e){return"[object WeakSet]"===f(e)}function A(e){return"[object ArrayBuffer]"===f(e)}function O(e){return"undefined"!=typeof ArrayBuffer&&(A.working?A(e):e instanceof ArrayBuffer)}function x(e){return"[object DataView]"===f(e)}function _(e){return"undefined"!=typeof DataView&&(x.working?x(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=o,t.isTypedArray=a,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):a(e)||_(e)},t.isUint8Array=function(e){return"Uint8Array"===i(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===i(e)},t.isUint16Array=function(e){return"Uint16Array"===i(e)},t.isUint32Array=function(e){return"Uint32Array"===i(e)},t.isInt8Array=function(e){return"Int8Array"===i(e)},t.isInt16Array=function(e){return"Int16Array"===i(e)},t.isInt32Array=function(e){return"Int32Array"===i(e)},t.isFloat32Array=function(e){return"Float32Array"===i(e)},t.isFloat64Array=function(e){return"Float64Array"===i(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===i(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===i(e)},m.working="undefined"!=typeof Map&&m(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(m.working?m(e):e instanceof Map)},v.working="undefined"!=typeof Set&&v(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(v.working?v(e):e instanceof Set)},b.working="undefined"!=typeof WeakMap&&b(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(b.working?b(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),t.isWeakSet=function(e){return w(e)},A.working="undefined"!=typeof ArrayBuffer&&A(new ArrayBuffer),t.isArrayBuffer=O,x.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&x(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=_;var j="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function S(e){return"[object SharedArrayBuffer]"===f(e)}function E(e){return void 0!==j&&(void 0===S.working&&(S.working=S(new j)),S.working?S(e):e instanceof j)}function k(e){return g(e,l)}function I(e){return g(e,h)}function P(e){return g(e,p)}function D(e){return c&&g(e,y)}function $(e){return u&&g(e,d)}t.isSharedArrayBuffer=E,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===f(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===f(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===f(e)},t.isGeneratorObject=function(e){return"[object Generator]"===f(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===f(e)},t.isNumberObject=k,t.isStringObject=I,t.isBooleanObject=P,t.isBigIntObject=D,t.isSymbolObject=$,t.isBoxedPrimitive=function(e){return k(e)||I(e)||P(e)||D(e)||$(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(O(e)||E(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},539:(e,t,r)=>{var n=r(155),o=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},i=/%[sdj%]/g;t.format=function(e){if(!b(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(u(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,o=n.length,a=String(e).replace(i,(function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),s=n[r];r<o;s=n[++r])m(s)||!O(s)?a+=" "+s:a+=" "+u(s);return a},t.deprecate=function(e,r){if(void 0!==n&&!0===n.noDeprecation)return e;if(void 0===n)return function(){return t.deprecate(e,r).apply(this,arguments)};var o=!1;return function(){if(!o){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?console.trace(r):console.error(r),o=!0}return e.apply(this,arguments)}};var a={},s=/^$/;if(n.env.NODE_DEBUG){var c=n.env.NODE_DEBUG;c=c.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),s=new RegExp("^"+c+"$","i")}function u(e,r){var n={seen:[],stylize:l};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(r)?n.showHidden=r:r&&t._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=f),h(n,e,n.depth)}function f(e,t){var r=u.styles[t];return r?"["+u.colors[r][0]+"m"+e+"["+u.colors[r][1]+"m":e}function l(e,t){return e}function h(e,r,n){if(e.customInspect&&r&&j(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var o=r.inspect(n,e);return b(o)||(o=h(e,o,n)),o}var i=function(e,t){if(w(t))return e.stylize("undefined","undefined");if(b(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return v(t)?e.stylize(""+t,"number"):g(t)?e.stylize(""+t,"boolean"):m(t)?e.stylize("null","null"):void 0}(e,r);if(i)return i;var a=Object.keys(r),s=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),_(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return p(r);if(0===a.length){if(j(r)){var c=r.name?": "+r.name:"";return e.stylize("[Function"+c+"]","special")}if(A(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(x(r))return e.stylize(Date.prototype.toString.call(r),"date");if(_(r))return p(r)}var u,f="",l=!1,O=["{","}"];return d(r)&&(l=!0,O=["[","]"]),j(r)&&(f=" [Function"+(r.name?": "+r.name:"")+"]"),A(r)&&(f=" "+RegExp.prototype.toString.call(r)),x(r)&&(f=" "+Date.prototype.toUTCString.call(r)),_(r)&&(f=" "+p(r)),0!==a.length||l&&0!=r.length?n<0?A(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),u=l?function(e,t,r,n,o){for(var i=[],a=0,s=t.length;a<s;++a)I(t,String(a))?i.push(y(e,t,r,n,String(a),!0)):i.push("");return o.forEach((function(o){o.match(/^\d+$/)||i.push(y(e,t,r,n,o,!0))})),i}(e,r,n,s,a):a.map((function(t){return y(e,r,n,s,t,l)})),e.seen.pop(),function(e,t,r){return e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(u,f,O)):O[0]+f+O[1]}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function y(e,t,r,n,o,i){var a,s,c;if((c=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?s=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(s=e.stylize("[Setter]","special")),I(n,o)||(a="["+o+"]"),s||(e.seen.indexOf(c.value)<0?(s=m(r)?h(e,c.value,null):h(e,c.value,r-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),w(a)){if(i&&o.match(/^\d+$/))return s;(a=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function d(e){return Array.isArray(e)}function g(e){return"boolean"==typeof e}function m(e){return null===e}function v(e){return"number"==typeof e}function b(e){return"string"==typeof e}function w(e){return void 0===e}function A(e){return O(e)&&"[object RegExp]"===S(e)}function O(e){return"object"==typeof e&&null!==e}function x(e){return O(e)&&"[object Date]"===S(e)}function _(e){return O(e)&&("[object Error]"===S(e)||e instanceof Error)}function j(e){return"function"==typeof e}function S(e){return Object.prototype.toString.call(e)}function E(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!a[e])if(s.test(e)){var r=n.pid;a[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else a[e]=function(){};return a[e]},t.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(955),t.isArray=d,t.isBoolean=g,t.isNull=m,t.isNullOrUndefined=function(e){return null==e},t.isNumber=v,t.isString=b,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=w,t.isRegExp=A,t.types.isRegExp=A,t.isObject=O,t.isDate=x,t.types.isDate=x,t.isError=_,t.types.isNativeError=_,t.isFunction=j,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(384);var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function I(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;console.log("%s - %s",(r=[E((e=new Date).getHours()),E(e.getMinutes()),E(e.getSeconds())].join(":"),[e.getDate(),k[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=r(717),t._extend=function(e,t){if(!t||!O(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var P="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function D(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(P&&e[P]){var t;if("function"!=typeof(t=e[P]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,P,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push((function(e,n){e?r(e):t(n)}));try{e.apply(this,o)}catch(e){r(e)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),P&&Object.defineProperty(t,P,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,o(e))},t.promisify.custom=P,t.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var o=t.pop();if("function"!=typeof o)throw new TypeError("The last argument must be of type Function");var i=this,a=function(){return o.apply(i,arguments)};e.apply(this,t).then((function(e){n.nextTick(a.bind(null,null,e))}),(function(e){n.nextTick(D.bind(null,e,a))}))}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,o(e)),t}},430:(e,t,r)=>{"use strict";var n=r(29),o=r(83),i=r(924),a=r(296),s=i("Object.prototype.toString"),c=r(410)(),u="undefined"==typeof globalThis?r.g:globalThis,f=o(),l=i("String.prototype.slice"),h={},p=Object.getPrototypeOf;c&&a&&p&&n(f,(function(e){if("function"==typeof u[e]){var t=new u[e];if(Symbol.toStringTag in t){var r=p(t),n=a(r,Symbol.toStringTag);if(!n){var o=p(r);n=a(o,Symbol.toStringTag)}h[e]=n.get}}}));var y=r(692);e.exports=function(e){return!!y(e)&&(c&&Symbol.toStringTag in e?function(e){var t=!1;return n(h,(function(r,n){if(!t)try{var o=r.call(e);o===n&&(t=o)}catch(e){}})),t}(e):l(s(e),8,-1))}},83:(e,t,r)=>{"use strict";var n=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],o="undefined"==typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t<n.length;t++)"function"==typeof o[n[t]]&&(e[e.length]=n[t]);return e}}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}();var n=r(797);window.Nedb=n})();