PageSourceSearch

https://eros3.ai/_nuxt/Bu-_bBZB.js

js eros3.ai collected 2026-10-05 14:38:08 UTC 101,015 bytes, 3 lines download raw bytes

1import{o as e,t}from"./C0FnF6B9.js";import{D as n}from"./AC4tp_na.js";import{g as r,xn as i}from"./B4b-2GOK.js";import{t as a}from"./Cpdid1PA.js";import{t as o}from"./CSi4D4zR.js";import{t as s}from"./wbe_N2wu.js";import{t as c}from"./BtXKA2t9.js";import{t as l}from"./G99TdE24.js";import{t as u}from"./BzAIfSIf.js";var d=()=>o(`supabase_session`,()=>null);function f(){let e=l(),t=c();return{client:e,user:t,session:d(),async signInAnonymously(){if(t.value)return t.value;let{data:n,error:r}=await e.auth.signInAnonymously();if(r)throw r;return n.user}}}var p=e(t(((e,t)=>{((n,r)=>{typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).Dexie=r()})(e,function(){var e=function(t,n){return(e=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(t,n)},t=function(){return(t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function n(e,t,n){if(n||arguments.length===2)for(var r,i=0,a=t.length;i<a;i++)!r&&i in t||((r||=Array.prototype.slice.call(t,0,i))[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}
vendor: 52,292 bytes, lines 1-3
1var r=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:global,i=Object.keys,a=Array.isArray;function o(e,t){return typeof t==`object`&&i(t).forEach(function(n){e[n]=t[n]}),e}typeof Promise>`u`||r.Promise||(r.Promise=Promise);var s=Object.getPrototypeOf,c={}.hasOwnProperty;function l(e,t){return c.call(e,t)}function u(e,t){typeof t==`function`&&(t=t(s(e))),(typeof Reflect>`u`?i:Reflect.ownKeys)(t).forEach(function(n){f(e,n,t[n])})}var d=Object.defineProperty;function f(e,t,n,r){d(e,t,o(n&&l(n,`get`)&&typeof n.get==`function`?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function p(e){return{from:function(t){return e.prototype=Object.create(t.prototype),f(e.prototype,`constructor`,e),{extend:u.bind(null,e.prototype)}}}}var m=Object.getOwnPropertyDescriptor,h=[].slice;function g(e,t,n){return h.call(e,t,n)}function _(e,t){return t(e)}function v(e){if(!e)throw Error(`Assertion Failed`)}function y(e){r.setImmediate?setImmediate(e):setTimeout(e,0)}function b(e,t){if(typeof t==`string`&&l(e,t))return e[t];if(!t)return e;if(typeof t!=`string`){for(var n=[],r=0,i=t.length;r<i;++r){var a=b(e,t[r]);n.push(a)}return n}var o,s=t.indexOf(`.`);return s===-1||(o=e[t.substr(0,s)])==null?void 0:b(o,t.substr(s+1))}function x(e,t,n){if(e&&t!==void 0&&!(`isFrozen`in Object&&Object.isFrozen(e))){if(typeof t!=`string`&&`length`in t){v(typeof n!=`string`&&`length`in n);for(var r=0,i=t.length;r<i;++r)x(e,t[r],n[r])}else{var o=t.indexOf(`.`);if(o!==-1){var s=t.substr(0,o),o=t.substr(o+1);if(o===``)n===void 0?a(e)&&!isNaN(parseInt(s))?e.splice(s,1):delete e[s]:e[s]=n;else{var c=e[s];if(!c||!l(e,s)){if(n===void 0)return;c=e[s]={}}x(c,o,n)}}else n===void 0?a(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}}function S(e){var t,n={};for(t in e)l(e,t)&&(n[t]=e[t]);return n}var C=[].concat;function ee(e){return C.apply([],e)}var w=`BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey`.split(`,`).concat(ee([8,16,32,64].map(function(e){return[`Int`,`Uint`,`Float`].map(function(t){return t+e+`Array`})}))).filter(function(e){return r[e]}),te=new Set(w.map(function(e){return r[e]})),ne=null;function T(e){return ne=new WeakMap,e=function e(t){if(!t||typeof t!=`object`)return t;var n=ne.get(t);if(n)return n;if(a(t)){n=[],ne.set(t,n);for(var r=0,i=t.length;r<i;++r)n.push(e(t[r]))}else if(te.has(t.constructor))n=t;else{var o,c=s(t);for(o in n=c===Object.prototype?{}:Object.create(c),ne.set(t,n),t)l(t,o)&&(n[o]=e(t[o]))}return n}(e),ne=null,e}var re={}.toString;function ie(e){return re.call(e).slice(8,-1)}var E=typeof Symbol<`u`?Symbol.iterator:`@@iterator`,ae=typeof E==`symbol`?function(e){var t;return e!=null&&(t=e[E])&&t.apply(e)}:function(){return null};function D(e,t){t=e.indexOf(t),0<=t&&e.splice(t,1)}var oe={};function O(e){var t,n,r,i;if(arguments.length===1){if(a(e))return e.slice();if(this===oe&&typeof e==`string`)return[e];if(i=ae(e))for(n=[];!(r=i.next()).done;)n.push(r.value);else{if(e==null||typeof(t=e.length)!=`number`)return[e];for(n=Array(t);t--;)n[t]=e[t]}}else for(t=arguments.length,n=Array(t);t--;)n[t]=arguments[t];return n}var se=typeof Symbol<`u`?function(e){return e[Symbol.toStringTag]===`AsyncFunction`}:function(){return!1},w=[`Unknown`,`Constraint`,`Data`,`TransactionInactive`,`ReadOnly`,`Version`,`NotFound`,`InvalidState`,`InvalidAccess`,`Abort`,`Timeout`,`QuotaExceeded`,`Syntax`,`DataClone`],k=[`Modify`,`Bulk`,`OpenFailed`,`VersionChange`,`Schema`,`Upgrade`,`InvalidTable`,`MissingAPI`,`NoSuchDatabase`,`InvalidArgument`,`SubTransaction`,`Unsupported`,`Internal`,`DatabaseClosed`,`PrematureCommit`,`ForeignAwait`].concat(w),ce={VersionChanged:`Database version changed by other database connection`,DatabaseClosed:`Database has been closed`,Abort:`Transaction aborted`,TransactionInactive:`Transaction has already completed or failed`,MissingAPI:`IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb`};function le(e,t){this.name=e,this.message=t}function ue(e,t){return e+`. Errors: `+Object.keys(t).map(function(e){return t[e].toString()}).filter(function(e,t,n){return n.indexOf(e)===t}).join(`
2`)}function de(e,t,n,r){this.failures=t,this.failedKeys=r,this.successCount=n,this.message=ue(e,t)}function A(e,t){this.name=`BulkError`,this.failures=Object.keys(t).map(function(e){return t[e]}),this.failuresByPos=t,this.message=ue(e,this.failures)}p(le).from(Error).extend({toString:function(){return this.name+`: `+this.message}}),p(de).from(le),p(A).from(le);var fe=k.reduce(function(e,t){return e[t]=t+`Error`,e},{}),pe=le,j=k.reduce(function(e,t){var n=t+`Error`;function r(e,r){this.name=n,e?typeof e==`string`?(this.message=`${e}${r?`
3 `+r:``}`,this.inner=r||null):typeof e==`object`&&(this.message=`${e.name} ${e.message}`,this.inner=e):(this.message=ce[t]||n,this.inner=null)}return p(r).from(pe),e[t]=r,e},{}),me=(j.Syntax=SyntaxError,j.Type=TypeError,j.Range=RangeError,w.reduce(function(e,t){return e[t+`Error`]=j[t],e},{}));w=k.reduce(function(e,t){return[`Syntax`,`Type`,`Range`].indexOf(t)===-1&&(e[t+`Error`]=j[t]),e},{});function M(){}function he(e){return e}function ge(e,t){return e==null||e===he?t:function(n){return t(e(n))}}function _e(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function ve(e,t){return e===M?t:function(){var n=e.apply(this,arguments),r=(n!==void 0&&(arguments[0]=n),this.onsuccess),i=this.onerror,a=(this.onsuccess=null,this.onerror=null,t.apply(this,arguments));return r&&(this.onsuccess=this.onsuccess?_e(r,this.onsuccess):r),i&&(this.onerror=this.onerror?_e(i,this.onerror):i),a===void 0?n:a}}function ye(e,t){return e===M?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?_e(n,this.onsuccess):n),r&&(this.onerror=this.onerror?_e(r,this.onerror):r)}}function be(e,t){return e===M?t:function(n){var r=e.apply(this,arguments),n=(o(n,r),this.onsuccess),i=this.onerror,a=(this.onsuccess=null,this.onerror=null,t.apply(this,arguments));return n&&(this.onsuccess=this.onsuccess?_e(n,this.onsuccess):n),i&&(this.onerror=this.onerror?_e(i,this.onerror):i),r===void 0?a===void 0?void 0:a:o(r,a)}}function xe(e,t){return e===M?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function Se(e,t){return e===M?t:function(){var n=e.apply(this,arguments);if(n&&typeof n.then==`function`){for(var r=this,i=arguments.length,a=Array(i);i--;)a[i]=arguments[i];return n.then(function(){return t.apply(r,a)})}return t.apply(this,arguments)}}w.ModifyError=de,w.DexieError=le,w.BulkError=A;var N=typeof location<`u`&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Ce(e){N=e}var we={},Te=100,Ee=typeof Promise>`u`?[]:(k=Promise.resolve(),typeof crypto<`u`&&crypto.subtle?[Ee=crypto.subtle.digest(`SHA-512`,new Uint8Array([0])),s(Ee),k]:[k,s(k),k]),k=Ee[0],De=Ee[1],De=De&&De.then,Oe=k&&k.constructor,ke=!!Ee[2],Ae=function(e,t){Ie.push([e,t]),Me&&=(queueMicrotask(Ge),!1)},je=!0,Me=!0,Ne=[],Pe=[],Fe=he,P={id:`global`,global:!0,ref:0,unhandleds:[],onunhandled:M,pgp:!1,env:{},finalize:M},F=P,Ie=[],Le=0,Re=[];function I(e){if(typeof this!=`object`)throw TypeError(`Promises must be constructed via new`);this._listeners=[],this._lib=!1;var t=this._PSD=F;if(typeof e!=`function`){if(e!==we)throw TypeError(`Not a function`);this._state=arguments[1],this._value=arguments[2],!1===this._state&&Ve(this,this._value)}else this._state=null,this._value=null,++t.ref,function e(t,n){try{n(function(n){if(t._state===null){if(n===t)throw TypeError(`A promise cannot be resolved with itself.`);var r=t._lib&&Ke();n&&typeof n.then==`function`?e(t,function(e,t){n instanceof I?n._then(e,t):n.then(e,t)}):(t._state=!0,t._value=n,He(t)),r&&qe()}},Ve.bind(null,t))}catch(e){Ve(t,e)}}(this,e)}var ze={get:function(){var e=F,t=$e;function n(n,r){var i=this,a=!e.global&&(e!==F||t!==$e),o=a&&!B(),s=new I(function(t,s){Ue(i,new Be(ot(n,e,a,o),ot(r,e,a,o),t,s,e))});return this._consoleTask&&(s._consoleTask=this._consoleTask),s}return n.prototype=we,n},set:function(e){f(this,`then`,e&&e.prototype===we?ze:{get:function(){return e},set:ze.set})}};function Be(e,t,n,r,i){this.onFulfilled=typeof e==`function`?e:null,this.onRejected=typeof t==`function`?t:null,this.resolve=n,this.reject=r,this.psd=i}function Ve(e,t){var n,r;Pe.push(t),e._state===null&&(n=e._lib&&Ke(),t=Fe(t),e._state=!1,e._value=t,r=e,Ne.some(function(e){return e._value===r._value})||Ne.push(r),He(e),n)&&qe()}function He(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)Ue(e,t[n]);var i=e._PSD;--i.ref||i.finalize(),Le===0&&(++Le,Ae(function(){--Le==0&&Je()},[]))}function Ue(e,t){if(e._state===null)e._listeners.push(t);else{var n=e._state?t.onFulfilled:t.onRejected;if(n===null)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++Le,Ae(We,[n,e,t])}}function We(e,t,n){try{var r,i=t._value;!t._state&&Pe.length&&(Pe=[]),r=N&&t._consoleTask?t._consoleTask.run(function(){return e(i)}):e(i),t._state||Pe.indexOf(i)!==-1||(e=>{for(var t=Ne.length;t;)if(Ne[--t]._value===e._value)return Ne.splice(t,1)})(t),n.resolve(r)}catch(e){n.reject(e)}finally{--Le==0&&Je(),--n.psd.ref||n.psd.finalize()}}function Ge(){at(P,function(){Ke()&&qe()})}function Ke(){var e=je;return Me=je=!1,e}function qe(){var e,t,n;do for(;0<Ie.length;)for(e=Ie,Ie=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}while(0<Ie.length);Me=je=!0}function Je(){for(var e=Ne,t=(Ne=[],e.forEach(function(e){e._PSD.onunhandled.call(null,e._value,e)}),Re.slice(0)),n=t.length;n;)t[--n]()}function Ye(e){return new I(we,!1,e)}function L(e,t){var n=F;return function(){var r=Ke(),i=F;try{return V(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{V(i,!1),r&&qe()}}}u(I.prototype,{then:ze,_then:function(e,t){Ue(this,new Be(null,null,e,t,F))},catch:function(e){var t,n;return arguments.length===1?this.then(null,e):(t=e,n=arguments[1],typeof t==`function`?this.then(null,function(e){return(e instanceof t?n:Ye)(e)}):this.then(null,function(e){return(e&&e.name===t?n:Ye)(e)}))},finally:function(e){return this.then(function(t){return I.resolve(e()).then(function(){return t})},function(t){return I.resolve(e()).then(function(){return Ye(t)})})},timeout:function(e,t){var n=this;return e<1/0?new I(function(r,i){var a=setTimeout(function(){return i(new j.Timeout(t))},e);n.then(r,i).finally(clearTimeout.bind(null,a))}):this}}),typeof Symbol<`u`&&Symbol.toStringTag&&f(I.prototype,Symbol.toStringTag,`Dexie.Promise`),P.env=it(),u(I,{all:function(){var e=O.apply(null,arguments).map(nt);return new I(function(t,n){e.length===0&&t([]);var r=e.length;e.forEach(function(i,a){return I.resolve(i).then(function(n){e[a]=n,--r||t(e)},n)})})},resolve:function(e){return e instanceof I?e:e&&typeof e.then==`function`?new I(function(t,n){e.then(t,n)}):new I(we,!0,e)},reject:Ye,race:function(){var e=O.apply(null,arguments).map(nt);return new I(function(t,n){e.map(function(e){return I.resolve(e).then(t,n)})})},PSD:{get:function(){return F},set:function(e){return F=e}},totalEchoes:{get:function(){return $e}},newPSD:z,usePSD:at,scheduler:{get:function(){return Ae},set:function(e){Ae=e}},rejectionMapper:{get:function(){return Fe},set:function(e){Fe=e}},follow:function(e,t){return new I(function(n,r){return z(function(t,n){var r=F;r.unhandleds=[],r.onunhandled=n,r.finalize=_e(function(){var e,r=this;e=function(){r.unhandleds.length===0?t():n(r.unhandleds[0])},Re.push(function t(){e(),Re.splice(Re.indexOf(t),1)}),++Le,Ae(function(){--Le==0&&Je()},[])},r.finalize),e()},t,n,r)})}}),Oe&&(Oe.allSettled&&f(I,`allSettled`,function(){var e=O.apply(null,arguments).map(nt);return new I(function(t){e.length===0&&t([]);var n=e.length,r=Array(n);e.forEach(function(e,i){return I.resolve(e).then(function(e){return r[i]={status:`fulfilled`,value:e}},function(e){return r[i]={status:`rejected`,reason:e}}).then(function(){return--n||t(r)})})})}),Oe.any&&typeof AggregateError<`u`&&f(I,`any`,function(){var e=O.apply(null,arguments).map(nt);return new I(function(t,n){e.length===0&&n(AggregateError([]));var r=e.length,i=Array(r);e.forEach(function(e,a){return I.resolve(e).then(function(e){return t(e)},function(e){i[a]=e,--r||n(AggregateError(i))})})})}),Oe.withResolvers)&&(I.withResolvers=Oe.withResolvers);var R={awaits:0,echoes:0,id:0},Xe=0,Ze=[],Qe=0,$e=0,et=0;function z(e,t,n,r){var i=F,a=Object.create(i),t=(a.parent=i,a.ref=0,a.global=!1,a.id=++et,P.env,a.env=ke?{Promise:I,PromiseProp:{value:I,configurable:!0,writable:!0},all:I.all,race:I.race,allSettled:I.allSettled,any:I.any,resolve:I.resolve,reject:I.reject}:{},t&&o(a,t),++i.ref,a.finalize=function(){--this.parent.ref||this.parent.finalize()},at(a,e,n,r));return a.ref===0&&a.finalize(),t}function tt(){return R.id||=++Xe,++R.awaits,R.echoes+=Te,R.id}function B(){return!!R.awaits&&(--R.awaits==0&&(R.id=0),R.echoes=R.awaits*Te,!0)}function nt(e){return R.echoes&&e&&e.constructor===Oe?(tt(),e.then(function(e){return B(),e},function(e){return B(),H(e)})):e}function rt(){var e=Ze[Ze.length-1];Ze.pop(),V(e,!1)}function V(e,t){var n,i,a=F;(t?!R.echoes||Qe++&&e===F:!Qe||--Qe&&e===F)||queueMicrotask(t?function(e){++$e,R.echoes&&--R.echoes!=0||(R.echoes=R.awaits=R.id=0),Ze.push(F),V(e,!0)}.bind(null,e):rt),e!==F&&(F=e,a===P&&(P.env=it()),ke)&&(n=P.env.Promise,i=e.env,a.global||e.global)&&(Object.defineProperty(r,"Promise",i.PromiseProp),n.all=i.all,n.race=i.race,n.resolve=i.resolve,n.reject=i.reject,i.allSettled&&(n.allSettled=i.allSettled),i.any)&&(n.any=i.any)}function it(){var e=r.Promise;return ke?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(r,`Promise`),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject}:{}}function at(e,t,n,r,i){var a=F;try{return V(e,!0),t(n,r,i)}finally{V(a,!1)}}function ot(e,t,n,r){return typeof e==`function`?function(){var i=F;n&&tt(),V(t,!0);try{return e.apply(this,arguments)}finally{V(i,!1),r&&queueMicrotask(B)}}:e}function st(e){Promise===Oe&&R.echoes===0?Qe===0?e():enqueueNativeMicroTask(e):setTimeout(e,0)}(``+De).indexOf(`[native code]`)===-1&&(tt=B=M);var H=I.reject,ct=`ï¿¿`,U=`Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.`,lt=`String expected.`,ut=`__dbnames`,dt=`readonly`,ft=`readwrite`;function pt(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var mt={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function ht(e){return typeof e!=`string`||/\./.test(e)?function(e){return e}:function(t){return t[e]===void 0&&e in t&&delete(t=T(t))[e],t}}function gt(){throw j.Type(`Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.`)}function W(e,t){try{var n=_t(e),r=_t(t);if(n!==r)return n===`Array`?1:r===`Array`?-1:n===`binary`?1:r===`binary`?-1:n===`string`?1:r===`string`?-1:n===`Date`?1:r===`Date`?-1:NaN;switch(n){case`number`:case`Date`:case`string`:return t<e?1:e<t?-1:0;case`binary`:for(var i=vt(e),a=vt(t),o=i.length,s=a.length,c=o<s?o:s,l=0;l<c;++l)if(i[l]!==a[l])return i[l]<a[l]?-1:1;return o===s?0:o<s?-1:1;case`Array`:for(var u=e,d=t,f=u.length,p=d.length,m=f<p?f:p,h=0;h<m;++h){var g=W(u[h],d[h]);if(g!==0)return g}return f===p?0:f<p?-1:1}}catch{}return NaN}function _t(e){var t=typeof e;return t==`object`&&(ArrayBuffer.isView(e)||(t=ie(e))===`ArrayBuffer`)?`binary`:t}function vt(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}function yt(e,t,n){var r=e.schema.yProps;return r?(t&&0<n.numFailures&&(t=t.filter(function(e,t){return!n.failures[t]})),Promise.all(r.map(function(n){return n=n.updatesTable,t?e.db.table(n).where(`k`).anyOf(t).delete():e.db.table(n).clear()})).then(function(){return n})):n}xt.prototype.execute=function(e){var t=this[`@@propmod`];if(t.add!==void 0){var r=t.add;if(a(r))return n(n([],a(e)?e:[],!0),r,!0).sort();if(typeof r==`number`)return(Number(e)||0)+r;if(typeof r==`bigint`)try{return BigInt(e)+r}catch{return BigInt(0)+r}throw TypeError(`Invalid term ${r}`)}if(t.remove!==void 0){var i=t.remove;if(a(i))return a(e)?e.filter(function(e){return!i.includes(e)}).sort():[];if(typeof i==`number`)return Number(e)-i;if(typeof i==`bigint`)try{return BigInt(e)-i}catch{return BigInt(0)-i}throw TypeError(`Invalid subtrahend ${i}`)}return r=(r=t.replacePrefix)?.[0],r&&typeof e==`string`&&e.startsWith(r)?t.replacePrefix[1]+e.substring(r.length):e};var bt=xt;function xt(e){this[`@@propmod`]=e}function St(e,t){for(var n=i(t),r=n.length,a=!1,o=0;o<r;++o){var s=n[o],c=t[s],l=b(e,s);c instanceof bt?(x(e,s,c.execute(l)),a=!0):l!==c&&(x(e,s,c),a=!0)}return a}G.prototype._trans=function(e,t,n){var r=this._tx||F.trans,i=this.name,a=N&&typeof console<`u`&&console.createTask&&console.createTask(`Dexie: ${e===`readonly`?`read`:`write`} ${this.name}`);function o(e,n,r){if(r.schema[i])return t(r.idbtrans,r);throw new j.NotFound(`Table `+i+` not part of transaction`)}var s=Ke();try{var c=r&&r.db._novip===this.db._novip?r===F.trans?r._promise(e,o,n):z(function(){return r._promise(e,o,n)},{trans:r,transless:F.transless||F}):function e(t,n,r,i){if(t.idbdb&&(t._state.openComplete||F.letThrough||t._vip)){var a=t._createTransaction(n,r,t._dbSchema);try{a.create(),t._state.PR1398_maxLoop=3}catch(a){return a.name===fe.InvalidState&&t.isOpen()&&0<--t._state.PR1398_maxLoop?(console.warn(`Dexie: Need to reopen db`),t.close({disableAutoOpen:!1}),t.open().then(function(){return e(t,n,r,i)})):H(a)}return a._promise(n,function(e,t){return z(function(){return F.trans=a,i(e,t,a)})}).then(function(e){if(n===`readwrite`)try{a.idbtrans.commit()}catch{}return n===`readonly`?e:a._completion.then(function(){return e})})}if(t._state.openComplete)return H(new j.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen)return H(new j.DatabaseClosed);t.open().catch(M)}return t._state.dbReadyPromise.then(function(){return e(t,n,r,i)})}(this.db,e,[this.name],o);return a&&(c._consoleTask=a,c=c.catch(function(e){return console.trace(e),H(e)})),c}finally{s&&qe()}},G.prototype.get=function(e,t){var n=this;return e&&e.constructor===Object?this.where(e).first(t):e==null?H(new j.Type(`Invalid argument to Table.get()`)):this._trans(`readonly`,function(t){return n.core.get({trans:t,key:e}).then(function(e){return n.hook.reading.fire(e)})}).then(t)},G.prototype.where=function(e){if(typeof e==`string`)return new this.db.WhereClause(this,e);if(a(e))return new this.db.WhereClause(this,`[${e.join(`+`)}]`);var t=i(e);if(t.length===1)return this.where(t[0]).equals(e[t[0]]);var n=this.schema.indexes.concat(this.schema.primKey).filter(function(e){if(e.compound&&t.every(function(t){return 0<=e.keyPath.indexOf(t)})){for(var n=0;n<t.length;++n)if(t.indexOf(e.keyPath[n])===-1)return!1;return!0}return!1}).sort(function(e,t){return e.keyPath.length-t.keyPath.length})[0];if(n&&this.db._maxKey!==ct)return s=n.keyPath.slice(0,t.length),this.where(s).equals(s.map(function(t){return e[t]}));!n&&N&&console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit from a compound index [${t.join(`+`)}]`);var r=this.schema.idxByName;function o(e,t){return W(e,t)===0}var s=t.reduce(function(t,n){var i=t[0],t=t[1],s=r[n],c=e[n];return[i||s,i||!s?pt(t,s&&s.multi?function(e){return e=b(e,n),a(e)&&e.some(function(e){return o(c,e)})}:function(e){return o(c,b(e,n))}):t]},[null,null]),c=s[0],s=s[1];return c?this.where(c.name).equals(e[c.keyPath]).filter(s):n?this.filter(s):this.where(t).equals(``)},G.prototype.filter=function(e){return this.toCollection().and(e)},G.prototype.count=function(e){return this.toCollection().count(e)},G.prototype.offset=function(e){return this.toCollection().offset(e)},G.prototype.limit=function(e){return this.toCollection().limit(e)},G.prototype.each=function(e){return this.toCollection().each(e)},G.prototype.toArray=function(e){return this.toCollection().toArray(e)},G.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},G.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,a(e)?`[${e.join(`+`)}]`:e))},G.prototype.reverse=function(){return this.toCollection().reverse()},G.prototype.mapToClass=function(t){for(var n=this.db,r=this.name,i=((this.schema.mappedClass=t).prototype instanceof gt&&(t=(t=>{var i=s,a=t;if(typeof a!=`function`&&a!==null)throw TypeError(`Class extends value `+String(a)+` is not a constructor or null`);function o(){this.constructor=i}function s(){return t!==null&&t.apply(this,arguments)||this}return e(i,a),i.prototype=a===null?Object.create(a):(o.prototype=a.prototype,new o),Object.defineProperty(s.prototype,"db",{get:function(){return n},enumerable:!1,configurable:!0}),s.prototype.table=function(){return r},s})(t)),new Set),a=t.prototype;a;a=s(a))Object.getOwnPropertyNames(a).forEach(function(e){return i.add(e)});function o(e){if(!e)return e;var n,r=Object.create(t.prototype);for(n in e)if(!i.has(n))try{r[n]=e[n]}catch{}return r}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=o,this.hook(`reading`,o),t},G.prototype.defineClass=function(){return this.mapToClass(function(e){o(this,e)})},G.prototype.add=function(e,t){var n=this,r=this.schema.primKey,i=r.auto,a=r.keyPath,o=e;return a&&i&&(o=ht(a)(e)),this._trans(`readwrite`,function(e){return n.core.mutate({trans:e,type:`add`,keys:t==null?null:[t],values:[o]})}).then(function(e){return e.numFailures?I.reject(e.failures[0]):e.lastResult}).then(function(t){if(a)try{x(e,a,t)}catch{}return t})},G.prototype.upsert=function(e,t){var n=this,r=this.schema.primKey.keyPath;return this._trans(`readwrite`,function(i){return n.core.get({trans:i,key:e}).then(function(a){var o=a??{};return St(o,t),r&&x(o,r,e),n.core.mutate({trans:i,type:`put`,values:[o],keys:[e],upsert:!0,updates:{keys:[e],changeSpecs:[t]}}).then(function(e){return e.numFailures?I.reject(e.failures[0]):!!a})})})},G.prototype.update=function(e,t){return typeof e!=`object`||a(e)?this.where(`:id`).equals(e).modify(t):(e=b(e,this.schema.primKey.keyPath))===void 0?H(new j.InvalidArgument(`Given object does not contain its primary key`)):this.where(`:id`).equals(e).modify(t)},G.prototype.put=function(e,t){var n=this,r=this.schema.primKey,i=r.auto,a=r.keyPath,o=e;return a&&i&&(o=ht(a)(e)),this._trans(`readwrite`,function(e){return n.core.mutate({trans:e,type:`put`,values:[o],keys:t==null?null:[t]})}).then(function(e){return e.numFailures?I.reject(e.failures[0]):e.lastResult}).then(function(t){if(a)try{x(e,a,t)}catch{}return t})},G.prototype.delete=function(e){var t=this;return this._trans(`readwrite`,function(n){return t.core.mutate({trans:n,type:`delete`,keys:[e]}).then(function(n){return yt(t,[e],n)}).then(function(e){return e.numFailures?I.reject(e.failures[0]):void 0})})},G.prototype.clear=function(){var e=this;return this._trans(`readwrite`,function(t){return e.core.mutate({trans:t,type:`deleteRange`,range:mt}).then(function(t){return yt(e,null,t)})}).then(function(e){return e.numFailures?I.reject(e.failures[0]):void 0})},G.prototype.bulkGet=function(e){var t=this;return this._trans(`readonly`,function(n){return t.core.getMany({keys:e,trans:n}).then(function(e){return e.map(function(e){return t.hook.reading.fire(e)})})})},G.prototype.bulkAdd=function(e,t,n){var r=this,i=Array.isArray(t)?t:void 0,a=(n||=i?void 0:t)?n.allKeys:void 0;return this._trans(`readwrite`,function(t){var n=r.schema.primKey,o=n.auto,n=n.keyPath;if(n&&i)throw new j.InvalidArgument(`bulkAdd(): keys argument invalid on tables with inbound keys`);if(i&&i.length!==e.length)throw new j.InvalidArgument(`Arguments objects and keys must have the same length`);var s=e.length,o=n&&o?e.map(ht(n)):e;return r.core.mutate({trans:t,type:`add`,keys:i,values:o,wantResults:a}).then(function(e){var t=e.numFailures,n=e.failures;if(t===0)return a?e.results:e.lastResult;throw new A(`${r.name}.bulkAdd(): ${t} of ${s} operations failed`,n)})})},G.prototype.bulkPut=function(e,t,n){var r=this,i=Array.isArray(t)?t:void 0,a=(n||=i?void 0:t)?n.allKeys:void 0;return this._trans(`readwrite`,function(t){var n=r.schema.primKey,o=n.auto,n=n.keyPath;if(n&&i)throw new j.InvalidArgument(`bulkPut(): keys argument invalid on tables with inbound keys`);if(i&&i.length!==e.length)throw new j.InvalidArgument(`Arguments objects and keys must have the same length`);var s=e.length,o=n&&o?e.map(ht(n)):e;return r.core.mutate({trans:t,type:`put`,keys:i,values:o,wantResults:a}).then(function(e){var t=e.numFailures,n=e.failures;if(t===0)return a?e.results:e.lastResult;throw new A(`${r.name}.bulkPut(): ${t} of ${s} operations failed`,n)})})},G.prototype.bulkUpdate=function(e){var t=this,n=this.core,r=e.map(function(e){return e.key}),i=e.map(function(e){return e.changes}),a=[];return this._trans(`readwrite`,function(o){return n.getMany({trans:o,keys:r,cache:`clone`}).then(function(s){var c=[],l=[],u=(e.forEach(function(e,n){var r=e.key,i=e.changes,o=s[n];if(o){for(var u=0,d=Object.keys(i);u<d.length;u++){var f=d[u],p=i[f];if(f===t.schema.primKey.keyPath){if(W(p,r)!==0)throw new j.Constraint(`Cannot update primary key in bulkUpdate()`)}else x(o,f,p)}a.push(n),c.push(r),l.push(o)}}),c.length);return n.mutate({trans:o,type:`put`,keys:c,values:l,updates:{keys:r,changeSpecs:i}}).then(function(e){var n=e.numFailures,r=e.failures;if(n===0)return u;for(var i=0,o=Object.keys(r);i<o.length;i++){var s,c=o[i],l=a[Number(c)];l!=null&&(s=r[c],delete r[c],r[l]=s)}throw new A(`${t.name}.bulkUpdate(): ${n} of ${u} operations failed`,r)})})})},G.prototype.bulkDelete=function(e){var t=this,n=e.length;return this._trans(`readwrite`,function(n){return t.core.mutate({trans:n,type:`delete`,keys:e}).then(function(n){return yt(t,e,n)})}).then(function(e){var r=e.numFailures,i=e.failures;if(r===0)return e.lastResult;throw new A(`${t.name}.bulkDelete(): ${r} of ${n} operations failed`,i)})};var Ct=G;function G(){}function wt(e){function t(t,r){if(r){for(var i=arguments.length,a=Array(i-1);--i;)a[i-1]=arguments[i];return n[t].subscribe.apply(null,a),e}if(typeof t==`string`)return n[t]}var n={};t.addEventType=s;for(var r=1,o=arguments.length;r<o;++r)s(arguments[r]);return t;function s(e,r,o){var c,l;if(typeof e!=`object`)return r||=xe,l={subscribers:[],fire:o||=M,subscribe:function(e){l.subscribers.indexOf(e)===-1&&(l.subscribers.push(e),l.fire=r(l.fire,e))},unsubscribe:function(e){l.subscribers=l.subscribers.filter(function(t){return t!==e}),l.fire=l.subscribers.reduce(r,o)}},n[e]=t[e]=l;i(c=e).forEach(function(e){var t=c[e];if(a(t))s(e,c[e][0],c[e][1]);else{if(t!==`asap`)throw new j.InvalidArgument(`Invalid event config`);var n=s(e,he,function(){for(var e=arguments.length,t=Array(e);e--;)t[e]=arguments[e];n.subscribers.forEach(function(e){y(function(){e.apply(null,t)})})})}})}}function Tt(e,t){return p(t).from({prototype:e}),t}function Et(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function Dt(e,t){e.filter=pt(e.filter,t)}function Ot(e,t,n){var r=e.replayFilter;e.replayFilter=r?function(){return pt(r(),t())}:t,e.justLimit=n&&!r}function kt(e,t){if(e.isPrimKey)return t.primaryKey;var n=t.getIndexByKeyPath(e.index);if(n)return n;throw new j.Schema(`KeyPath `+e.index+` on object store `+t.name+` is not indexed`)}function At(e,t,n){var r=kt(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:e.dir===`prev`,unique:!!e.unique,query:{index:r,range:e.range}})}function jt(e,t,n,r){var i,a,o=e.replayFilter?pt(e.filter,e.replayFilter()):e.filter;return e.or?(i={},a=function(e,n,r){var a,s;o&&!o(n,r,function(e){return n.stop(e)},function(e){return n.fail(e)})||((s=``+(a=n.primaryKey))==`[object ArrayBuffer]`&&(s=``+new Uint8Array(a)),l(i,s))||(i[s]=!0,t(e,n,r))},Promise.all([e.or._iterate(a,n),Mt(At(e,r,n),e.algorithm,a,!e.keysOnly&&e.valueMapper)])):Mt(At(e,r,n),pt(e.algorithm,o),t,!e.keysOnly&&e.valueMapper)}function Mt(e,t,n,r){var i=L(r?function(e,t,i){return n(r(e),t,i)}:n);return e.then(function(e){if(e)return e.start(function(){var n=function(){return e.continue()};t&&!t(e,function(e){return n=e},function(t){e.stop(t),n=M},function(t){e.fail(t),n=M})||i(e.value,e,function(e){return n=e}),n()})})}K.prototype._read=function(e,t){var n=this._ctx;return n.error?n.table._trans(null,H.bind(null,n.error)):n.table._trans(`readonly`,e).then(t)},K.prototype._write=function(e){var t=this._ctx;return t.error?t.table._trans(null,H.bind(null,t.error)):t.table._trans(`readwrite`,e,`locked`)},K.prototype._addAlgorithm=function(e){var t=this._ctx;t.algorithm=pt(t.algorithm,e)},K.prototype._iterate=function(e,t){return jt(this._ctx,e,t,this._ctx.table.core)},K.prototype.clone=function(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&o(n,e),t._ctx=n,t},K.prototype.raw=function(){return this._ctx.valueMapper=null,this},K.prototype.each=function(e){var t=this._ctx;return this._read(function(n){return jt(t,e,n,t.table.core)})},K.prototype.count=function(e){var t=this;return this._read(function(e){var n,r=t._ctx,i=r.table.core;return Et(r,!0)?i.count({trans:e,query:{index:kt(r,i.schema),range:r.range}}).then(function(e){return Math.min(e,r.limit)}):(n=0,jt(r,function(){return++n,!1},e,i).then(function(){return n}))}).then(e)},K.prototype.sortBy=function(e,t){var n=e.split(`.`).reverse(),r=n[0],i=n.length-1;function a(e,t){return t?a(e[n[t]],t-1):e[r]}var o=this._ctx.dir===`next`?1:-1;function s(e,t){return W(a(e,i),a(t,i))*o}return this.toArray(function(e){return e.slice().sort(s)}).then(t)},K.prototype.toArray=function(e){var t=this;return this._read(function(e){var n,r,i,a=t._ctx;return Et(a,!0)&&0<a.limit?(n=a.valueMapper,r=kt(a,a.table.core.schema),a.table.core.query({trans:e,limit:a.limit,values:!0,direction:a.dir===`prev`?`prev`:void 0,query:{index:r,range:a.range}}).then(function(e){return e=e.result,n?e.map(n):e})):(i=[],jt(a,function(e){return i.push(e)},e,a.table.core).then(function(){return i}))},e)},K.prototype.offset=function(e){var t=this._ctx;return e<=0||(t.offset+=e,Et(t)?Ot(t,function(){var t=e;return function(e,n){return t===0||(t===1?--t:n(function(){e.advance(t),t=0}),!1)}}):Ot(t,function(){var t=e;return function(){return--t<0}})),this},K.prototype.limit=function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),Ot(this._ctx,function(){var t=e;return function(e,n,r){return--t<=0&&n(r),0<=t}},!0),this},K.prototype.until=function(e,t){return Dt(this._ctx,function(n,r,i){return!e(n.value)||(r(i),t)}),this},K.prototype.first=function(e){return this.limit(1).toArray(function(e){return e[0]}).then(e)},K.prototype.last=function(e){return this.reverse().first(e)},K.prototype.filter=function(e){var t;return Dt(this._ctx,function(t){return e(t.value)}),(t=this._ctx).isMatch=pt(t.isMatch,e),this},K.prototype.and=function(e){return this.filter(e)},K.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},K.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir===`prev`?`next`:`prev`,this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},K.prototype.desc=function(){return this.reverse()},K.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,n){e(n.key,n)})},K.prototype.eachUniqueKey=function(e){return this._ctx.unique=`unique`,this.eachKey(e)},K.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(t,n){e(n.primaryKey,n)})},K.prototype.keys=function(e){var t=this._ctx,n=(t.keysOnly=!t.isMatch,[]);return this.each(function(e,t){n.push(t.key)}).then(function(){return n}).then(e)},K.prototype.primaryKeys=function(e){var t=this._ctx;if(Et(t,!0)&&0<t.limit)return this._read(function(e){var n=kt(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,direction:t.dir===`prev`?`prev`:void 0,query:{index:n,range:t.range}})}).then(function(e){return e.result}).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each(function(e,t){n.push(t.primaryKey)}).then(function(){return n}).then(e)},K.prototype.uniqueKeys=function(e){return this._ctx.unique=`unique`,this.keys(e)},K.prototype.firstKey=function(e){return this.limit(1).keys(function(e){return e[0]}).then(e)},K.prototype.lastKey=function(e){return this.reverse().firstKey(e)},K.prototype.distinct=function(){var e,t=this._ctx,t=t.index&&t.table.schema.idxByName[t.index];return t&&t.multi&&(e={},Dt(this._ctx,function(t){var t=t.primaryKey.toString(),n=l(e,t);return e[t]=!0,!n})),this},K.prototype.modify=function(e){var t=this,n=this._ctx;return this._write(function(r){function a(e,t){var n=t.failures;p+=e-t.numFailures;for(var r=0,a=i(n);r<a.length;r++){var o=a[r];f.push(n[o])}}var o=typeof e==`function`?e:function(t){return St(t,e)},s=n.table.core,c=s.schema.primaryKey,l=c.outbound,u=c.extractKey,d=200,c=t.db._options.modifyChunkSize,f=(c&&(d=typeof c==`object`?c[s.name]||c[`*`]||200:c),[]),p=0,m=[],h=e===Pt;return t.clone().primaryKeys().then(function(t){function i(f){var p=Math.min(d,t.length-f),m=t.slice(f,f+p);return(h?Promise.resolve([]):s.getMany({trans:r,keys:m,cache:`immutable`})).then(function(g){var _=[],v=[],y=l?[]:null,b=h?m:[];if(!h)for(var x=0;x<p;++x){var S=g[x],C={value:T(S),primKey:t[f+x]};!1!==o.call(C,C.value,C)&&(C.value==null?b.push(t[f+x]):l||W(u(S),u(C.value))===0?(v.push(C.value),l&&y.push(t[f+x])):(b.push(t[f+x]),_.push(C.value)))}return Promise.resolve(0<_.length&&s.mutate({trans:r,type:`add`,values:_}).then(function(e){for(var t in e.failures)b.splice(parseInt(t),1);a(_.length,e)})).then(function(){return(0<v.length||c&&typeof e==`object`)&&s.mutate({trans:r,type:`put`,keys:y,values:v,criteria:c,changeSpec:typeof e!=`function`&&e,isAdditionalChunk:0<f}).then(function(e){return a(v.length,e)})}).then(function(){return(0<b.length||c&&h)&&s.mutate({trans:r,type:`delete`,keys:b,criteria:c,isAdditionalChunk:0<f}).then(function(e){return yt(n.table,b,e)}).then(function(e){return a(b.length,e)})}).then(function(){return t.length>f+p&&i(f+d)})})}var c=Et(n)&&n.limit===1/0&&(typeof e!=`function`||h)&&{index:n.index,range:n.range};return i(0).then(function(){if(0<f.length)throw new de(`Error modifying one or more objects`,f,p,m);return t.length})})})},K.prototype.delete=function(){var e=this._ctx,t=e.range;return!Et(e)||e.table.schema.yProps||!e.isPrimKey&&t.type!==3?this.modify(Pt):this._write(function(n){var r=e.table.core.schema.primaryKey,i=t;return e.table.core.count({trans:n,query:{index:r,range:i}}).then(function(t){return e.table.core.mutate({trans:n,type:`deleteRange`,range:i}).then(function(e){var n=e.failures,e=e.numFailures;if(e)throw new de(`Could not delete some values`,Object.keys(n).map(function(e){return n[e]}),t-e);return t-e})})})};var Nt=K;function K(){}var Pt=function(e,t){return t.value=null};function Ft(e,t){return e<t?-1:e===t?0:1}function It(e,t){return t<e?-1:e===t?0:1}function q(e,t,n){return e=e instanceof Vt?new e.Collection(e):e,e._ctx.error=new(n||TypeError)(t),e}function Lt(e){return new e.Collection(e,function(){return Bt(``)}).limit(0)}function Rt(e,t,n,r){var i,a,o,s,c,l,u,d=n.length;if(!n.every(function(e){return typeof e==`string`}))return q(e,lt);function f(e){i=e===`next`?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()},a=e===`next`?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()},o=e===`next`?Ft:It;var t=n.map(function(e){return{lower:a(e),upper:i(e)}}).sort(function(e,t){return o(e.lower,t.lower)});s=t.map(function(e){return e.upper}),c=t.map(function(e){return e.lower}),u=(l=e)===`next`?``:r}f(`next`);var e=new e.Collection(e,function(){return zt(s[0],c[d-1]+r)}),p=(e._ondirectionchange=function(e){f(e)},0);return e._addAlgorithm(function(e,n,r){var i=e.key;if(typeof i==`string`){var f=a(i);if(t(f,c,p))return!0;for(var m=null,h=p;h<d;++h){var g=((e,t,n,r,i,a)=>{for(var o=Math.min(e.length,r.length),s=-1,c=0;c<o;++c){var l=t[c];if(l!==r[c])return i(e[c],n[c])<0?e.substr(0,c)+n[c]+n.substr(c+1):i(e[c],r[c])<0?e.substr(0,c)+r[c]+n.substr(c+1):0<=s?e.substr(0,s)+t[s]+n.substr(s+1):null;i(e[c],l)<0&&(s=c)}return o<r.length&&a===`next`?e+n.substr(e.length):o<e.length&&a===`prev`?e.substr(0,n.length):s<0?null:e.substr(0,s)+r[s]+n.substr(s+1)})(i,f,s[h],c[h],o,l);g===null&&m===null?p=h+1:(m===null||0<o(m,g))&&(m=g)}n(m===null?r:function(){e.continue(m+u)})}return!1}),e}function zt(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function Bt(e){return{type:1,lower:e,upper:e}}Object.defineProperty(J.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),J.prototype.between=function(e,t,n,r){n=!1!==n,r=!0===r;try{return 0<this._cmp(e,t)||this._cmp(e,t)===0&&(n||r)&&(!n||!r)?Lt(this):new this.Collection(this,function(){return zt(e,t,!n,!r)})}catch{return q(this,U)}},J.prototype.equals=function(e){return e==null?q(this,U):new this.Collection(this,function(){return Bt(e)})},J.prototype.above=function(e){return e==null?q(this,U):new this.Collection(this,function(){return zt(e,void 0,!0)})},J.prototype.aboveOrEqual=function(e){return e==null?q(this,U):new this.Collection(this,function(){return zt(e,void 0,!1)})},J.prototype.below=function(e){return e==null?q(this,U):new this.Collection(this,function(){return zt(void 0,e,!1,!0)})},J.prototype.belowOrEqual=function(e){return e==null?q(this,U):new this.Collection(this,function(){return zt(void 0,e)})},J.prototype.startsWith=function(e){return typeof e==`string`?this.between(e,e+ct,!0,!0):q(this,lt)},J.prototype.startsWithIgnoreCase=function(e){return e===``?this.startsWith(e):Rt(this,function(e,t){return e.indexOf(t[0])===0},[e],ct)},J.prototype.equalsIgnoreCase=function(e){return Rt(this,function(e,t){return e===t[0]},[e],``)},J.prototype.anyOfIgnoreCase=function(){var e=O.apply(oe,arguments);return e.length===0?Lt(this):Rt(this,function(e,t){return t.indexOf(e)!==-1},e,``)},J.prototype.startsWithAnyOfIgnoreCase=function(){var e=O.apply(oe,arguments);return e.length===0?Lt(this):Rt(this,function(e,t){return t.some(function(t){return e.indexOf(t)===0})},e,ct)},J.prototype.anyOf=function(){var e,t,n=this,r=O.apply(oe,arguments),i=this._cmp;try{r.sort(i)}catch{return q(this,U)}return r.length===0?Lt(this):((e=new this.Collection(this,function(){return zt(r[0],r[r.length-1])}))._ondirectionchange=function(e){i=e===`next`?n._ascending:n._descending,r.sort(i)},t=0,e._addAlgorithm(function(e,n,a){for(var o=e.key;0<i(o,r[t]);)if(++t===r.length)return n(a),!1;return i(o,r[t])===0||(n(function(){e.continue(r[t])}),!1)}),e)},J.prototype.notEqual=function(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},J.prototype.noneOf=function(){var e=O.apply(oe,arguments);if(e.length===0)return new this.Collection(this);try{e.sort(this._ascending)}catch{return q(this,U)}var t=e.reduce(function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[-1/0,t]]},null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})},J.prototype.inAnyRange=function(e,t){var n=this,r=this._cmp,i=this._ascending,a=this._descending,o=this._min,s=this._max;if(e.length===0)return Lt(this);if(!e.every(function(e){return e[0]!==void 0&&e[1]!==void 0&&i(e[0],e[1])<=0}))return q(this,`First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower`,j.InvalidArgument);var c=!t||!1!==t.includeLowers,l=t&&!0===t.includeUppers,u,d=i;function f(e,t){return d(e[0],t[0])}try{(u=e.reduce(function(e,t){for(var n=0,i=e.length;n<i;++n){var a=e[n];if(r(t[0],a[1])<0&&0<r(t[1],a[0])){a[0]=o(a[0],t[0]),a[1]=s(a[1],t[1]);break}}return n===i&&e.push(t),e},[])).sort(f)}catch{return q(this,U)}var p=0,m=l?function(e){return 0<i(e,u[p][1])}:function(e){return 0<=i(e,u[p][1])},h=c?function(e){return 0<a(e,u[p][0])}:function(e){return 0<=a(e,u[p][0])},g=m,t=new this.Collection(this,function(){return zt(u[0][0],u[u.length-1][1],!c,!l)});return t._ondirectionchange=function(e){d=e===`next`?(g=m,i):(g=h,a),u.sort(f)},t._addAlgorithm(function(e,t,r){for(var a,o=e.key;g(o);)if(++p===u.length)return t(r),!1;return!m(a=o)&&!h(a)||(n._cmp(o,u[p][1])===0||n._cmp(o,u[p][0])===0||t(function(){d===i?e.continue(u[p][0]):e.continue(u[p][1])}),!1)}),t},J.prototype.startsWithAnyOf=function(){var e=O.apply(oe,arguments);return e.every(function(e){return typeof e==`string`})?e.length===0?Lt(this):this.inAnyRange(e.map(function(e){return[e,e+ct]})):q(this,`startsWithAnyOf() only works with strings`)};var Vt=J;function J(){}function Y(e){return L(function(t){return Ht(t),e(t.target.error),!1})}function Ht(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var Ut=`storagemutated`,Wt=`x-storagemutated-1`,Gt=wt(null,Ut),Kt=(X.prototype._lock=function(){return v(!F.global),++this._reculock,this._reculock!==1||F.global||(F.lockOwnerFor=this),this},X.prototype._unlock=function(){if(v(!F.global),--this._reculock==0)for(F.global||(F.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var e=this._blockedFuncs.shift();try{at(e[1],e[0])}catch{}}return this},X.prototype._locked=function(){return this._reculock&&F.lockOwnerFor!==this},X.prototype.create=function(e){var t=this;if(this.mode){var n=this.db.idbdb,r=this.db._state.dbOpenError;if(v(!this.idbtrans),!e&&!n)switch(r&&r.name){case`DatabaseClosedError`:throw new j.DatabaseClosed(r);case`MissingAPIError`:throw new j.MissingAPI(r.message,r);default:throw new j.OpenFailed(r)}if(!this.active)throw new j.TransactionInactive;v(this._completion._state===null),(e=this.idbtrans=e||(this.db.core||n).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=L(function(n){Ht(n),t._reject(e.error)}),e.onabort=L(function(n){Ht(n),t.active&&t._reject(new j.Abort(e.error)),t.active=!1,t.on(`abort`).fire(n)}),e.oncomplete=L(function(){t.active=!1,t._resolve(),`mutatedParts`in e&&Gt.storagemutated.fire(e.mutatedParts)})}return this},X.prototype._promise=function(e,t,n){var r,i=this;return e===`readwrite`&&this.mode!==`readwrite`?H(new j.ReadOnly(`Transaction is readonly`)):this.active?this._locked()?new I(function(r,a){i._blockedFuncs.push([function(){i._promise(e,t,n).then(r,a)},F])}):n?z(function(){var e=new I(function(e,n){i._lock();var r=t(e,n,i);r&&r.then&&r.then(e,n)});return e.finally(function(){return i._unlock()}),e._lib=!0,e}):((r=new I(function(e,n){var r=t(e,n,i);r&&r.then&&r.then(e,n)}))._lib=!0,r):H(new j.TransactionInactive)},X.prototype._root=function(){return this.parent?this.parent._root():this},X.prototype.waitFor=function(e){var t,n=this._root(),r=I.resolve(e),i=(n._waitingFor?n._waitingFor=n._waitingFor.then(function(){return r}):(n._waitingFor=r,n._waitingQueue=[],t=n.idbtrans.objectStore(n.storeNames[0]),function e(){for(++n._spinCount;n._waitingQueue.length;)n._waitingQueue.shift()();n._waitingFor&&(t.get(-1/0).onsuccess=e)}()),n._waitingFor);return new I(function(e,t){r.then(function(t){return n._waitingQueue.push(L(e.bind(null,t)))},function(e){return n._waitingQueue.push(L(t.bind(null,e)))}).finally(function(){n._waitingFor===i&&(n._waitingFor=null)})})},X.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new j.Abort))},X.prototype.table=function(e){var t=this._memoizedTables||={};if(l(t,e))return t[e];var n=this.schema[e];if(n)return(n=new this.db.Table(e,n,this)).core=this.db.core.table(e),t[e]=n;throw new j.NotFound(`Table `+e+` not part of transaction`)},X);function X(){}function qt(e,t,n,r,i,a,o,s){return{name:e,keyPath:t,unique:n,multi:r,auto:i,compound:a,src:(n&&!o?`&`:``)+(r?`*`:``)+(i?`++`:``)+Jt(t),type:s}}function Jt(e){return typeof e==`string`?e:e?`[`+[].join.call(e,`+`)+`]`:``}function Yt(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:(r=function(e){return[e.name,e]},n.reduce(function(e,t,n){return t=r(t,n),t&&(e[t[0]]=t[1]),e},{}))};var r}var Xt=function(e){try{return e.only([[]]),Xt=function(){return[[]]},[[]]}catch{return Xt=function(){return ct},ct}};function Zt(e){return e==null?function(){}:typeof e==`string`?(t=e).split(`.`).length===1?function(e){return e[t]}:function(e){return b(e,t)}:function(t){return b(t,e)};var t}function Qt(e){return[].slice.call(e)}var $t=0;function en(e){return e==null?`:id`:typeof e==`string`?e:`[${e.join(`+`)}]`}function tn(e,t,n){function r(e){if(e.type===3)return null;if(e.type===4)throw Error(`Cannot convert never type to IDBKeyRange`);var n=e.lower,r=e.upper,i=e.lowerOpen,e=e.upperOpen;return n===void 0?r===void 0?null:t.upperBound(r,!!e):r===void 0?t.lowerBound(n,!!i):t.bound(n,r,!!i,!!e)}function i(e){var t,n,i=e.name;return{name:i,schema:e,mutate:function(e){var t=e.trans,n=e.type,a=e.keys,o=e.values,s=e.range;return new Promise(function(e,c){e=L(e);var l=t.objectStore(i),u=l.keyPath==null,d=n===`put`||n===`add`;if(!d&&n!==`delete`&&n!==`deleteRange`)throw Error(`Invalid operation type: `+n);var f,p=(a||o||{length:1}).length;if(a&&o&&a.length!==o.length)throw Error(`Given keys array must have same length as given values array.`);if(p===0)return e({numFailures:0,failures:{},results:[],lastResult:void 0});function m(e){++_,Ht(e)}var h=[],g=[],_=0;if(n===`deleteRange`){if(s.type===4)return e({numFailures:_,failures:g,results:[],lastResult:void 0});s.type===3?h.push(f=l.clear()):h.push(f=l.delete(r(s)))}else{var u=d?u?[o,a]:[o,null]:[a,null],v=u[0],y=u[1];if(d)for(var b=0;b<p;++b)h.push(f=y&&y[b]!==void 0?l[n](v[b],y[b]):l[n](v[b])),f.onerror=m;else for(b=0;b<p;++b)h.push(f=l[n](v[b])),f.onerror=m}function x(t){t=t.target.result,h.forEach(function(e,t){return e.error!=null&&(g[t]=e.error)}),e({numFailures:_,failures:g,results:n===`delete`?a:h.map(function(e){return e.result}),lastResult:t})}f.onerror=function(e){m(e),x(e)},f.onsuccess=x})},getMany:function(e){var t=e.trans,n=e.keys;return new Promise(function(e,r){e=L(e);for(var a,o=t.objectStore(i),s=n.length,c=Array(s),l=0,u=0,d=function(t){t=t.target,c[t._pos]=t.result,++u===l&&e(c)},f=Y(r),p=0;p<s;++p)n[p]!=null&&((a=o.get(n[p]))._pos=p,a.onsuccess=d,a.onerror=f,++l);l===0&&e(c)})},get:function(e){var t=e.trans,n=e.key;return new Promise(function(e,r){e=L(e);var a=t.objectStore(i).get(n);a.onsuccess=function(t){return e(t.target.result)},a.onerror=Y(r)})},query:(t=c,n=l,function(e){return new Promise(function(a,o){a=L(a);var s,c,l,u,d=e.trans,f=e.values,p=e.limit,m=e.query,h=(h=e.direction)??`next`,g=p===1/0?void 0:p,_=m.index,m=m.range,d=d.objectStore(i),d=_.isPrimaryKey?d:d.index(_.name),_=r(m);if(p===0)return a({result:[]});n?(m={query:_,count:g,direction:h},(s=f?d.getAll(m):d.getAllKeys(m)).onsuccess=function(e){return a({result:e.target.result})},s.onerror=Y(o)):t&&h===`next`?((s=f?d.getAll(_,g):d.getAllKeys(_,g)).onsuccess=function(e){return a({result:e.target.result})},s.onerror=Y(o)):(c=0,l=!f&&`openKeyCursor`in d?d.openKeyCursor(_,h):d.openCursor(_,h),u=[],l.onsuccess=function(){var e=l.result;return!e||(u.push(f?e.value:e.primaryKey),++c===p)?a({result:u}):void e.continue()},l.onerror=Y(o))})}),openCursor:function(e){var t=e.trans,n=e.values,a=e.query,o=e.reverse,s=e.unique;return new Promise(function(e,c){e=L(e);var l=a.index,u=a.range,d=t.objectStore(i),d=l.isPrimaryKey?d:d.index(l.name),l=o?s?`prevunique`:`prev`:s?`nextunique`:`next`,f=!n&&`openKeyCursor`in d?d.openKeyCursor(r(u),l):d.openCursor(r(u),l);f.onerror=Y(c),f.onsuccess=L(function(n){var r,i,a,o,s=f.result;s?(s.___id=++$t,s.done=!1,r=s.continue.bind(s),i=(i=s.continuePrimaryKey)&&i.bind(s),a=s.advance.bind(s),o=function(){throw Error(`Cursor not stopped`)},s.trans=t,s.stop=s.continue=s.continuePrimaryKey=s.advance=function(){throw Error(`Cursor not started`)},s.fail=L(c),s.next=function(){var e=this,t=1;return this.start(function(){return t--?e.continue():e.stop()}).then(function(){return e})},s.start=function(e){function t(){if(f.result)try{e()}catch(e){s.fail(e)}else s.done=!0,s.start=function(){throw Error(`Cursor behind last entry`)},s.stop()}var n=new Promise(function(e,t){e=L(e),f.onerror=Y(t),s.fail=t,s.stop=function(t){s.stop=s.continue=s.continuePrimaryKey=s.advance=o,e(t)}});return f.onsuccess=L(function(e){f.onsuccess=t,t()}),s.continue=r,s.continuePrimaryKey=i,s.advance=a,t(),n},e(s)):e(null)},c)})},count:function(e){var t=e.query,n=e.trans,a=t.index,o=t.range;return new Promise(function(e,t){var s=n.objectStore(i),s=a.isPrimaryKey?s:s.index(a.name),c=r(o),c=c?s.count(c):s.count();c.onsuccess=L(function(t){return e(t.target.result)}),c.onerror=Y(t)})}}}o=n,s=Qt((n=e).objectStoreNames),u=0<s.length?o.objectStore(s[0]):{};var o,n={schema:{name:n.name,tables:s.map(function(e){return o.objectStore(e)}).map(function(e){var t=e.keyPath,n=e.autoIncrement,r=a(t),i={},r={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:t==null,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:Zt(t)},indexes:Qt(e.indexNames).map(function(t){return e.index(t)}).map(function(e){var t=e.name,n=e.unique,r=e.multiEntry,e=e.keyPath,t={name:t,compound:a(e),keyPath:e,unique:n,multiEntry:r,extractKey:Zt(e)};return i[en(e)]=t}),getIndexByKeyPath:function(e){return i[en(e)]}};return i[`:id`]=r.primaryKey,t!=null&&(i[en(t)]=r.primaryKey),r})},hasGetAll:0<s.length&&`getAll`in u&&!(typeof navigator<`u`&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604),hasIdb3Features:`getAllRecords`in u},s=n.schema,c=n.hasGetAll,l=n.hasIdb3Features,u=s.tables.map(i),d={};return u.forEach(function(e){return d[e.name]=e}),{stack:`dbcore`,transaction:e.transaction.bind(e),table:function(e){if(d[e])return d[e];throw Error(`Table '${e}' not found`)},MIN_KEY:-1/0,MAX_KEY:Xt(t),schema:s}}function nn(e,n,r,i){return r=r.IDBKeyRange,n=tn(n,r,i),{dbcore:e.dbcore.reduce(function(e,n){return n=n.create,t(t({},e),n(e))},n)}}function rn(e,t){var n=t.db,n=nn(e._middlewares,n,e._deps,t);e.core=n.dbcore,e.tables.forEach(function(t){var n=t.name;e.core.schema.tables.some(function(e){return e.name===n})&&(t.core=e.core.table(n),e[n]instanceof e.Table)&&(e[n].core=t.core)})}function an(e,t,n,r){n.forEach(function(n){var i=r[n];t.forEach(function(t){var r=function e(t,n){return m(t,n)||(t=s(t))&&e(t,n)}(t,n);(!r||`value`in r&&r.value===void 0)&&(t===e.Transaction.prototype||t instanceof e.Transaction?f(t,n,{get:function(){return this.table(n)},set:function(e){d(this,n,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[n]=new e.Table(n,i))})})}function on(e,t){t.forEach(function(t){for(var n in t)t[n]instanceof e.Table&&delete t[n]})}function sn(e,t){return e._cfg.version-t._cfg.version}function cn(e,t,n,r){var a=e._dbSchema,o=(n.objectStoreNames.contains(`$meta`)&&!a.$meta&&(a.$meta=Yt(`$meta`,gn(``)[0],[]),e._storeNames.push(`$meta`)),e._createTransaction(`readwrite`,e._storeNames,a)),s=(o.create(n),o._completion.catch(r),o._reject.bind(o)),c=F.transless||F;z(function(){if(F.trans=o,F.transless=c,t!==0)return rn(e,n),l=t,((r=o).storeNames.includes(`$meta`)?r.table(`$meta`).get(`version`).then(function(e){return e??l}):I.resolve(l)).then(function(t){var r=e,a=t,s=o,c=n,l=[],t=r._versions,u=r._dbSchema=mn(0,r.idbdb,c);return(t=t.filter(function(e){return e._cfg.version>=a})).length===0?I.resolve():(t.forEach(function(e){l.push(function(){var t,n,o,l=u,d=e._cfg.dbschema,f=(hn(r,l,c),hn(r,d,c),u=r._dbSchema=d,un(l,d)),p=(f.add.forEach(function(e){dn(c,e[0],e[1].primKey,e[1].indexes)}),f.change.forEach(function(e){if(e.recreate)throw new j.Upgrade(`Not yet support for changing primary key`);var t=c.objectStore(e.name);e.add.forEach(function(e){return pn(t,e)}),e.change.forEach(function(e){t.deleteIndex(e.name),pn(t,e)}),e.del.forEach(function(e){return t.deleteIndex(e)})}),e._cfg.contentUpgrade);if(p&&e._cfg.version>a)return rn(r,c),s._memoizedTables={},t=S(d),f.del.forEach(function(e){t[e]=l[e]}),on(r,[r.Transaction.prototype]),an(r,[r.Transaction.prototype],i(t),t),s.schema=t,(n=se(p))&&tt(),d=I.follow(function(){var e;(o=p(s))&&n&&(e=B.bind(null,null),o.then(e,e))}),o&&typeof o.then==`function`?I.resolve(o):d.then(function(){return o}
3)}),l.push(function(t){var n=e._cfg.dbschema,i=t;[].slice.call(i.db.objectStoreNames).forEach(function(e){return n[e]==null&&i.db.deleteObjectStore(e)}),on(r,[r.Transaction.prototype]),an(r,[r.Transaction.prototype],r._storeNames,r._dbSchema),s.schema=r._dbSchema}),l.push(function(t){r.idbdb.objectStoreNames.contains(`$meta`)&&(Math.ceil(r.idbdb.version/10)===e._cfg.version?(r.idbdb.deleteObjectStore(`$meta`),delete r._dbSchema.$meta,r._storeNames=r._storeNames.filter(function(e){return e!==`$meta`})):t.objectStore(`$meta`).put(e._cfg.version,`version`))})}),function e(){return l.length?I.resolve(l.shift()(s.idbtrans)).then(e):I.resolve()}().then(function(){fn(u,c)}))}).catch(s);var r,l;i(a).forEach(function(e){dn(n,e,a[e].primKey,a[e].indexes)}),rn(e,n),I.follow(function(){return e.on.populate.fire(o)}).catch(s)})}function ln(e,t){fn(e._dbSchema,t),t.db.version%10!=0||t.objectStoreNames.contains(`$meta`)||t.db.createObjectStore(`$meta`).add(Math.ceil(t.db.version/10-1),`version`);var n=mn(0,e.idbdb,t);hn(e,e._dbSchema,t);for(var r=0,i=un(n,e._dbSchema).change;r<i.length;r++){var a=(e=>{if(e.change.length||e.recreate)return console.warn(`Unable to patch indexes of table ${e.name} because it has changes on the type of index or primary key.`),{value:void 0};var n=t.objectStore(e.name);e.add.forEach(function(t){N&&console.debug(`Dexie upgrade patch: Creating missing index ${e.name}.${t.src}`),pn(n,t)})})(i[r]);if(typeof a==`object`)return a.value}}function un(e,t){var n,r={del:[],add:[],change:[]};for(n in e)t[n]||r.del.push(n);for(n in t){var i=e[n],a=t[n];if(i){var o={name:n,def:a,recreate:!1,del:[],add:[],change:[]};if(``+(i.primKey.keyPath||``)!=``+(a.primKey.keyPath||``)||i.primKey.auto!==a.primKey.auto)o.recreate=!0,r.change.push(o);else{var s=i.idxByName,c=a.idxByName,l=void 0;for(l in s)c[l]||o.del.push(l);for(l in c){var u=s[l],d=c[l];u?u.src!==d.src&&o.change.push(d):o.add.push(d)}(0<o.del.length||0<o.add.length||0<o.change.length)&&r.change.push(o)}}else r.add.push([n,a])}return r}function dn(e,t,n,r){var i=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});r.forEach(function(e){return pn(i,e)})}function fn(e,t){i(e).forEach(function(n){t.db.objectStoreNames.contains(n)||(N&&console.debug(`Dexie
3: Creating missing table`,n),dn(t,n,e[n].primKey,e[n].indexes))})}function pn(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function mn(e,t,n){var r={};return g(t.objectStoreNames,0).forEach(function(e){for(var t=n.objectStore(e),i=qt(Jt(c=t.keyPath),c||``,!0,!1,!!t.autoIncrement,c&&typeof c!=`string`,!0),a=[],o=0;o<t.indexNames.length;++o){var s=t.index(t.indexNames[o]),c=s.keyPath,s=qt(s.name,c,!!s.unique,!!s.multiEntry,!1,c&&typeof c!=`string`,!1);a.push(s)}r[e]=Yt(e,i,a)}),r}function hn(e,t,n){for(var i=n.db.objectStoreNames,a=0;a<i.length;++a){var o=i[a],s=n.objectStore(o);e._hasGetAll=`getAll`in s;for(var c=0;c<s.indexNames.length;++c){var l,u=s.indexNames[c],d=s.index(u).keyPath,d=typeof d==`string`?d:`[`+g(d).join(`+`)+`]`;t[o]&&(l=t[o].idxByName[d])&&(l.name=u,delete t[o].idxByName[d],t[o].idxByName[u]=l)}}typeof navigator<`u`&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&r.WorkerGlobalScope&&r instanceof r.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}function gn(e){return e.split(`,`).map(function(e,t){var n=e.split(`:`),r=(r=n[1])?.trim(),n=(e=n[0].trim()).replace(/([&*]|\+\+)/g,``),i=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split(`+`):n;return qt(n,i||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),a(i),t===0,r)})}vn.prototype._createTableSchema=Yt,vn.prototype._parseIndexSyntax=gn,vn.prototype._parseStoresSpec=function(e,t){var n=this;i(e).forEach(function(r){if(e[r]!==null){var i=n._parseIndexSyntax(e[r]),a=i.shift();if(!a)throw new j.Schema(`Invalid schema for table `+r+`: `+e[r]);if(a.unique=!0,a.multi)throw new j.Schema(`Primary key cannot be multiEntry*`);i.forEach(function(e){if(e.auto)throw new j.Schema(`Only primary key can be marked as autoIncrement (++)`);if(!e.keyPath)throw new j.Schema(`Index must have a name and cannot be an empty string`)}),a=n._createTableSchema(r,a,i),t[r]=a}})},vn.prototype.stores=function(e){var t=this.db,e=(this._cfg.storesSource=this._cfg.storesSource?o(this._cfg.storesSource,e):e,t._versions),n={},r={};return e.forEach(function(e){o(n,e._cfg.storesSource),r=e._cfg.dbschema={},e._parseStoresSpec(n,r)}),t._dbSchema=r,on(t,[t._allTables,t,t.Transaction.prototype]),an(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],i(r),r),t._storeNames=i(r),this},vn.prototype.upgrade=function(e){return this._cfg.contentUpgrade=Se(this._cfg.contentUpgrade||M,e),this};var _n=vn;function vn(){}var yn=(()=>{var e,t,n;return typeof FinalizationRegistry<`u`&&typeof WeakRef<`u`?(e=new Set,t=new FinalizationRegistry(function(t){e.delete(t)}),{toArray:function(){return Array.from(e).map(function(e){return e.deref()}).filter(function(e){return e!==void 0})},add:function(n){var r=new WeakRef(n._novip);e.add(r),t.register(n._novip,r,r),e.size>n._options.maxConnections&&(r=e.values().next().value,e.delete(r),t.unregister(r))},remove:function(n){if(n)for(var r=e.values(),i=r.next();!i.done;){var a=i.value;if(a.deref()===n._novip)return e.delete(a),void t.unregister(a);i=r.next()}}}):(n=[],{toArray:function(){return n},add:function(e){n.push(e._novip)},remove:function(e){e&&(e=n.indexOf(e._novip))!==-1&&n.splice(e,1)}})})();function bn(e,t){var n=e._dbNamesDB;return n||(n=e._dbNamesDB=new Q(ut,{addons:[],indexedDB:e,IDBKeyRange:t})).version(1).stores({dbnames:`name`}),n.table(`dbnames`)}function xn(e){return e&&typeof e.databases==`function`}function Sn(e){return z(function(){return F.letThrough=!0,e()})}function Cn(e){return!(`from`in e)}var Z=function(e,t){var n;if(!this)return n=new Z,e&&`d`in e&&o(n,e),n;o(this,arguments.length?{d:1,from:e,to:1<arguments.length?t:e}:{d:0})};function wn(e,t,n){var r=W(t,n);if(!isNaN(r)){if(0<r)throw RangeError();if(Cn(e))return o(e,{from:t,to:n,d:1});var r=e.l,i=e.r;if(W(n,e.from)<0)return r?wn(r,t,n):e.l={from:t,to:n,d:1,l:null,r:null},On(e);if(0<W(t,e.to))return i?wn(i,t,n):e.r={from:t,to:n,d:1,l:null,r:null},On(e);W(t,e.from)<0&&(e.from=t,e.l=null,e.d=i?i.d+1:1),0<W(n,e.to)&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1),t=!e.r,r&&!e.l&&Tn(e,r),i&&t&&Tn(e,i)}}function Tn(e,t){Cn(t)||function e(t,n){var r=n.from,i=n.l,a=n.r;wn(t,r,n.to),i&&e(t,i),a&&e(t,a)}(e,t)}function En(e,t){var n=Dn(t),r=n.next();if(!r.done)for(var i=r.value,a=Dn(e),o=a.next(i.from),s=o.value;!r.done&&!o.done;){if(W(s.from,i.to)<=0&&0<=W(s.to,i.from))return!0;W(i.from,s.from)<0?i=(r=n.next(s.from)).value:s=(o=a.next(i.from)).value}return!1}function Dn(e){var t=Cn(e)?null:{s:0,n:e};return{next:function(e){for(var n=0<arguments.length;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&W(e,t.n.from)<0;)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!n||W(e,t.n.to)<=0)return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function On(e){var n,r,i,a=((a=e.r)?.d||0)-((a=e.l)?.d||0),a=1<a?`r`:a<-1?`l`:``;a&&(n=a==`r`?`l`:`r`,r=t({},e),i=e[a],e.from=i.from,e.to=i.to,e[a]=i[a],r[a]=i[n],(e[n]=r).d=kn(r)),e.d=kn(e)}function kn(e){var t=e.r,e=e.l;return(t?e?Math.max(t.d,e.d):t.d:e?e.d:0)+1}function An(e,t){return i(t).forEach(function(n){e[n]?Tn(e[n],t[n]):e[n]=function e(t){var n,r,i={};for(n in t)l(t,n)&&(r=t[n],i[n]=!r||typeof r!=`object`||te.has(r.constructor)?r:e(r));return i}(t[n])}),e}function jn(e,t){return e.all||t.all||Object.keys(e).some(function(n){return t[n]&&En(t[n],e[n])})}u(Z.prototype,((k={add:function(e){return Tn(this,e),this},addKey:function(e){return wn(this,e,e),this},addKeys:function(e){var t=this;return e.forEach(function(e){return wn(t,e,e)}),this},hasKey:function(e){var t=Dn(this).next(e).value;return t&&W(t.from,e)<=0&&0<=W(t.to,e)}})[E]=function(){return Dn(this)},k));var Mn={},Nn={},Pn=!1;
vendor: 32,657 bytes, line 3
3function Fn(e){An(Nn,e),Pn||(Pn=!0,setTimeout(function(){Pn=!1,In(Nn,!(Nn={}))},0))}function In(e,t){t===void 0&&(t=!1);var n=new Set;if(e.all)for(var r=0,i=Object.values(Mn);r<i.length;r++)Ln(s=i[r],e,n,t);else for(var a in e){var o,s,a=/^idb\:\/\/(.*)\/(.*)\//.exec(a);a&&(o=a[1],a=a[2],s=Mn[`idb://${o}/${a}`])&&Ln(s,e,n,t)}n.forEach(function(e){return e()})}function Ln(e,t,n,r){for(var i=[],a=0,o=Object.entries(e.queries.query);a<o.length;a++){for(var s=o[a],c=s[0],l=[],u=0,d=s[1];u<d.length;u++){var f=d[u];jn(t,f.obsSet)?f.subscribers.forEach(function(e){return n.add(e)}):r&&l.push(f)}r&&i.push([c,l])}if(r)for(var p=0,m=i;p<m.length;p++){var h=m[p],c=h[0],l=h[1];e.queries.query[c]=l}}function Rn(e){var t=e._state,n=e._deps.indexedDB;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then(function(){return t.dbOpenError?H(t.dbOpenError):e});t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;var r=t.openCanceller,a=Math.round(10*e.verno),o=!1;function s(){if(t.openCanceller!==r)throw new j.DatabaseClosed(`db.open() was cancelled`)}function c(){return new I(function(r,l){if(s(),!n)throw new j.MissingAPI;var u=e.name,p=t.autoSchema||!a?n.open(u):n.open(u,a);if(!p)throw new j.MissingAPI;p.onerror=Y(l),p.onblocked=L(e._fireOnBlocked),p.onupgradeneeded=L(function(r){var i;d=p.transaction,t.autoSchema&&!e._options.allowEmptyDB?(p.onerror=Ht,d.abort(),p.result.close(),(i=n.deleteDatabase(u)).onsuccess=i.onerror=L(function(){l(new j.NoSuchDatabase(`Database ${u} doesnt exist`))})):(d.onerror=Y(l),i=r.oldVersion>2**62?0:r.oldVersion,f=i<1,e.idbdb=p.result,o&&ln(e,d),cn(e,i/10,d,l))},l),p.onsuccess=L(function(){d=null;var n,s,l,m,h,_,v=e.idbdb=p.result,y=g(v.objectStoreNames);if(0<y.length)try{var b=v.transaction((h=y).length===1?h[0]:h,`readonly`);if(t.autoSchema)_=v,m=b,(l=e).verno=_.version/10,m=l._dbSchema=mn(0,_,m),l._storeNames=g(_.objectStoreNames,0),an(l,[l._allTables],i(m),m);else if(hn(e,e._dbSchema,b),s=b,((s=un(mn(0,(n=e).idbdb,s),n._dbSchema)).add.length||s.change.some(function(e){return e.add.length||e.change.length}))&&!o)return console.warn(`Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this.`),v.close(),a=v.version+1,o=!0,r(c());rn(e,b)}catch{}yn.add(e),v.onversionchange=L(function(n){t.vcFired=!0,e.on(`versionchange`).fire(n)}),v.onclose=L(function(){e.close({disableAutoOpen:!1})}),f&&(y=e._deps,h=u,xn(_=y.indexedDB)||h===ut||bn(_,y.IDBKeyRange).put({name:h}).catch(M)),r()},l)}).catch(function(e){switch(e?.name){case`UnknownError`:if(0<t.PR1398_maxLoop)return t.PR1398_maxLoop--,console.warn(`Dexie: Workaround for Chrome UnknownError on open()`),c();break;case`VersionError`:if(0<a)return a=0,c()}return I.reject(e)})}var l,u=t.dbReadyResolve,d=null,f=!1;return I.race([r,(typeof navigator>`u`?I.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(e){function t(){return indexedDB.databases().finally(e)}l=setInterval(t,100),t()}).finally(function(){return clearInterval(l)}):Promise.resolve()).then(c)]).then(function(){return s(),t.onReadyBeingFired=[],I.resolve(Sn(function(){return e.on.ready.fire(e.vip)})).then(function n(){var r;if(0<t.onReadyBeingFired.length)return r=t.onReadyBeingFired.reduce(Se,M),t.onReadyBeingFired=[],I.resolve(Sn(function(){return r(e.vip)})).then(n)})}).finally(function(){t.openCanceller===r&&(t.onReadyBeingFired=null,t.isBeingOpened=!1)}).catch(function(n){t.dbOpenError=n;try{d&&d.abort()}catch{}return r===t.openCanceller&&e._close(),H(n)}).finally(function(){t.openComplete=!0,u()}).then(function(){var t;return f&&(t={},e.tables.forEach(function(n){n.schema.indexes.forEach(function(r){r.name&&(t[`idb://${e.name}/${n.name}/${r.name}`]=new Z(-1/0,[[[]]]))}),t[`idb://${e.name}/${n.name}/`]=t[`idb://${e.name}/${n.name}/:dels`]=new Z(-1/0,[[[]]])}),Gt(Ut).fire(t),In(t,!0)),e})}function zn(e){function t(t){return e.next(t)}var n=i(t),r=i(function(t){return e.throw(t)});function i(e){return function(t){var t=e(t),i=t.value;return t.done?i:i&&typeof i.then==`function`?i.then(n,r):a(i)?Promise.all(i).then(n,r):n(i)}}return i(t)()}function Bn(e,t,n){for(var r=a(e)?e.slice():[e],i=0;i<n;++i)r.push(t);return r}var Vn={stack:`dbcore`,name:`VirtualIndexMiddleware`,level:1,create:function(e){return t(t({},e),{table:function(n){var r=e.table(n),n=r.schema,i=Object.create(null),a=[];function o(e,n,r){var s=en(e),c=i[s]=i[s]||[],l=e==null?0:typeof e==`string`?1:e.length,u=0<n,s=t(t({},r),{name:u?`${s}(virtual-from:${r.name})`:r.name,lowLevelIndex:r,isVirtual:u,keyTail:n,keyLength:l,extractKey:Zt(e),unique:!u&&r.unique});return c.push(s),s.isPrimaryKey||a.push(s),1<l&&o(l===2?e[0]:e.slice(0,l-1),n+1,r),c.sort(function(e,t){return e.keyTail-t.keyTail}),s}var s=o(n.primaryKey.keyPath,0,n.primaryKey);i[`:id`]=[s];for(var c=0,l=n.indexes;c<l.length;c++){var u=l[c];o(u.keyPath,0,u)}function d(n){var r,i=n.query.index;return i.isVirtual?t(t({},n),{query:{index:i.lowLevelIndex,range:(r=n.query.range,i=i.keyTail,{type:r.type===1?2:r.type,lower:Bn(r.lower,r.lowerOpen?e.MAX_KEY:e.MIN_KEY,i),lowerOpen:!0,upper:Bn(r.upper,r.upperOpen?e.MIN_KEY:e.MAX_KEY,i),upperOpen:!0})}}):n}return t(t({},r),{schema:t(t({},n),{primaryKey:s,indexes:a,getIndexByKeyPath:function(e){return(e=i[en(e)])&&e[0]}}),count:function(e){return r.count(d(e))},query:function(e){return r.query(d(e))},openCursor:function(t){var n=t.query.index,i=n.keyTail,a=n.keyLength;return n.isVirtual?r.openCursor(d(t)).then(function(e){return e&&o(e)}):r.openCursor(t);function o(n){return Object.create(n,{continue:{value:function(r){r==null?t.unique?n.continue(n.key.slice(0,a).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,i)):n.continue():n.continue(Bn(r,t.reverse?e.MAX_KEY:e.MIN_KEY,i))}},continuePrimaryKey:{value:function(t,r){n.continuePrimaryKey(Bn(t,e.MAX_KEY,i),r)}},primaryKey:{get:function(){return n.primaryKey}},key:{get:function(){var e=n.key;return a===1?e[0]:e.slice(0,a)}},value:{get:function(){return n.value}}})}}})}})}};function Hn(e,t,n,r){return n||={},r||=``,i(e).forEach(function(i){var a,o,s;l(t,i)?(a=e[i],o=t[i],typeof a==`object`&&typeof o==`object`&&a&&o?(s=ie(a))===ie(o)?s===`Object`?Hn(a,o,n,r+i+`.`):a!==o&&(n[r+i]=t[i]):n[r+i]=t[i]:a!==o&&(n[r+i]=t[i])):n[r+i]=void 0}),i(t).forEach(function(i){l(e,i)||(n[r+i]=t[i])}),n}function Un(e,t){return t.type===`delete`?t.keys:t.keys||t.values.map(e.extractKey)}var Wn={stack:`dbcore`,name:`HooksMiddleware`,level:2,create:function(e){return t(t({},e),{table:function(r){var i=e.table(r),a=i.schema.primaryKey;return t(t({},i),{mutate:function(e){var o=F.trans,s=o.table(r).hook,c=s.deleting,u=s.creating,d=s.updating;switch(e.type){case`add`:if(u.fire===M)break;return o._promise(`readwrite`,function(){return f(e)},!0);case`put`:if(u.fire===M&&d.fire===M)break;return o._promise(`readwrite`,function(){return f(e)},!0);case`delete`:if(c.fire===M)break;return o._promise(`readwrite`,function(){return f(e)},!0);case`deleteRange`:if(c.fire===M)break;return o._promise(`readwrite`,function(){return function e(n,r,o){return i.query({trans:n,values:!1,query:{index:a,range:r},limit:o}).then(function(i){var a=i.result;return f({type:`delete`,keys:a,trans:n}).then(function(i){return 0<i.numFailures?Promise.reject(i.failures[0]):a.length<o?{failures:[],numFailures:0,lastResult:void 0}:e(n,t(t({},r),{lower:a[a.length-1],lowerOpen:!0}),o)})})}(e.trans,e.range,1e4)},!0)}return i.mutate(e);function f(e){var r,o,s,f=F.trans,p=e.keys||Un(a,e);if(p)return(e=e.type===`add`||e.type===`put`?t(t({},e),{keys:p}):t({},e)).type!==`delete`&&(e.values=n([],e.values,!0)),e.keys&&(e.keys=n([],e.keys,!0)),r=i,s=p,((o=e).type===`add`?Promise.resolve([]):r.getMany({trans:o.trans,keys:s,cache:`immutable`})).then(function(t){var n=p.map(function(n,r){var i,o,s,p=t[r],m={onerror:null,onsuccess:null};return e.type===`delete`?c.fire.call(m,n,p,f):e.type===`add`||p===void 0?(i=u.fire.call(m,n,e.values[r],f),n==null&&i!=null&&(e.keys[r]=n=i,a.outbound||x(e.values[r],a.keyPath,n))):(i=Hn(p,e.values[r]),(o=d.fire.call(m,i,n,p,f))&&(s=e.values[r],Object.keys(o).forEach(function(e){l(s,e)?s[e]=o[e]:x(s,e,o[e])}))),m});return i.mutate(e).then(function(r){for(var i=r.failures,a=r.results,o=r.numFailures,r=r.lastResult,s=0;s<p.length;++s){var c=(a||p)[s],l=n[s];c==null?l.onerror&&l.onerror(i[s]):l.onsuccess&&l.onsuccess(e.type===`put`&&t[s]?e.values[s]:c)}return{failures:i,results:a,numFailures:o,lastResult:r}}).catch(function(e){return n.forEach(function(t){return t.onerror&&t.onerror(e)}),Promise.reject(e)})});throw Error(`Keys missing`)}}})}})}};function Gn(e,t,n){try{if(!t||t.keys.length<e.length)return null;for(var r=[],i=0,a=0;i<t.keys.length&&a<e.length;++i)W(t.keys[i],e[a])===0&&(r.push(n?T(t.values[i]):t.values[i]),++a);return r.length===e.length?r:null}catch{return null}}var Kn={stack:`dbcore`,level:-1,create:function(e){return{table:function(n){var r=e.table(n);return t(t({},r),{getMany:function(e){var t;return e.cache?(t=Gn(e.keys,e.trans._cache,e.cache===`clone`))?I.resolve(t):r.getMany(e).then(function(t){return e.trans._cache={keys:e.keys,values:e.cache===`clone`?T(t):t},t}):r.getMany(e)},mutate:function(e){return e.type!==`add`&&(e.trans._cache=null),r.mutate(e)}})}}}};function qn(e,t){return e.trans.mode===`readonly`&&!!e.subscr&&!e.trans.explicit&&e.trans.db._options.cache!==`disabled`&&!t.schema.primaryKey.outbound}function Jn(e,t){switch(e){case`query`:return t.values&&!t.unique;case`get`:case`getMany`:case`count`:case`openCursor`:return!1}}var Yn={stack:`dbcore`,level:0,name:`Observability`,create:function(e){var n=e.schema.name,r=new Z(e.MIN_KEY,e.MAX_KEY);return t(t({},e),{transaction:function(t,n,r){if(F.subscr&&n!==`readonly`)throw new j.ReadOnly(`Readwrite transaction in liveQuery context. Querier source: ${F.querier}`);return e.transaction(t,n,r)},table:function(o){function s(t){var t=t.query;return[t.index,new Z((t=t.range).lower??e.MIN_KEY,t.upper??e.MAX_KEY)]}var c=e.table(o),l=c.schema,u=l.primaryKey,d=l.indexes,f=u.extractKey,p=u.outbound,m=u.autoIncrement&&d.filter(function(e){return e.compound&&e.keyPath.includes(u.keyPath)}),h=t(t({},c),{mutate:function(t){function i(e){return e=`idb://${n}/${o}/${e}`,h[e]||(h[e]=new Z)}var s,d,f,p=t.trans,h=t.mutatedParts||={},g=i(``),_=i(`:dels`),v=t.type,y=t.type===`deleteRange`?[t.range]:t.type===`delete`?[t.keys]:t.values.length<50?[Un(u,t).filter(function(e){return e}),t.values]:[],b=y[0],y=y[1],x=t.trans._cache;return a(b)?(g.addKeys(b),(v=v===`delete`||b.length===y.length?Gn(b,x):null)||_.addKeys(b),(v||y)&&(s=i,d=v,f=y,l.indexes.forEach(function(e){var t=s(e.name||``);function n(t){return t==null?null:e.extractKey(t)}function r(n){e.multiEntry&&a(n)?n.forEach(function(e){return t.addKey(e)}):t.addKey(n)}(d||f).forEach(function(e,t){var i=d&&n(d[t]),t=f&&n(f[t]);W(i,t)!==0&&(i!=null&&r(i),t!=null)&&r(t)})}))):b?(y={from:(x=b.lower)??e.MIN_KEY,to:(v=b.upper)??e.MAX_KEY},_.add(y),g.add(y)):(g.add(r),_.add(r),l.indexes.forEach(function(e){return i(e.name).add(r)})),c.mutate(t).then(function(e){return!b||t.type!==`add`&&t.type!==`put`||(g.addKeys(e.results),m&&m.forEach(function(n){for(var r=t.values.map(function(e){return n.extractKey(e)}),a=n.keyPath.findIndex(function(e){return e===u.keyPath}),o=0,s=e.results.length;o<s;++o)r[o][a]=e.results[o];i(n.name).addKeys(r)})),p.mutatedParts=An(p.mutatedParts||{},h),e})}}),g={get:function(e){return[u,new Z(e.key)]},getMany:function(e){return[u,new Z().addKeys(e.keys)]},count:s,query:s,openCursor:s};return i(g).forEach(function(e){h[e]=function(i){var a=F.subscr,s=!!a,l=qn(F,c)&&Jn(e,i)?i.obsSet={}:a;if(s){var u,a=function(e){return e=`idb://${n}/${o}/${e}`,l[e]||(l[e]=new Z)},d=a(``),m=a(`:dels`),s=g[e](i),h=s[0],s=s[1];if((e===`query`&&h.isPrimaryKey&&!i.values?m:a(h.name||``)).add(s),!h.isPrimaryKey){if(e!==`count`)return u=e===`query`&&p&&i.values&&c.query(t(t({},i),{values:!1})),c[e].apply(this,arguments).then(function(t){if(e===`query`){if(p&&i.values)return u.then(function(e){return e=e.result,d.addKeys(e),t});var n=i.values?t.result.map(f):t.result;(i.values?d:m).addKeys(n)}else{var r,a;if(e===`openCursor`)return a=i.values,(r=t)&&Object.create(r,{key:{get:function(){return m.addKey(r.primaryKey),r.key}},primaryKey:{get:function(){var e=r.primaryKey;return m.addKey(e),e}},value:{get:function(){return a&&d.addKey(r.primaryKey),r.value}}})}return t});m.add(r)}}return c[e].apply(this,arguments)}}),h}})}};function Xn(e,n,r){var i;return r.numFailures===0?n:n.type===`deleteRange`||(i=n.keys?n.keys.length:`values`in n&&n.values?n.values.length:1,r.numFailures===i)?null:(i=t({},n),a(i.keys)&&(i.keys=i.keys.filter(function(e,t){return!(t in r.failures)})),`values`in i&&a(i.values)&&(i.values=i.values.filter(function(e,t){return!(t in r.failures)})),i)}function Zn(e,t){return n=e,((r=t).lower===void 0||(r.lowerOpen?0<W(n,r.lower):0<=W(n,r.lower)))&&(n=e,(r=t).upper===void 0||(r.upperOpen?W(n,r.upper)<0:W(n,r.upper)<=0));var n,r}function Qn(e,t,n,r,i,o){var s,c,l,u,d,f,p;return!n||n.length===0||(s=t.query.index,c=s.multiEntry,l=t.query.range,u=r.schema.primaryKey.extractKey,d=s.extractKey,f=(s.lowLevelIndex||s).extractKey,(r=n.reduce(function(e,n){var r=e,i=[];if(n.type===`add`||n.type===`put`)for(var o=new Z,s=n.values.length-1;0<=s;--s){var f,p=n.values[s],m=u(p);!o.hasKey(m)&&(f=d(p),c&&a(f)?f.some(function(e){return Zn(e,l)}):Zn(f,l))&&(o.addKey(m),i.push(p))}switch(n.type){case`add`:var h=new Z().addKeys(t.values?e.map(function(e){return u(e)}):e),r=e.concat(t.values?i.filter(function(e){return e=u(e),!h.hasKey(e)&&(h.addKey(e),!0)}):i.map(function(e){return u(e)}).filter(function(e){return!h.hasKey(e)&&(h.addKey(e),!0)}));break;case`put`:var g=new Z().addKeys(n.values.map(function(e){return u(e)}));r=e.filter(function(e){return!g.hasKey(t.values?u(e):e)}).concat(t.values?i:i.map(function(e){return u(e)}));break;case`delete`:var _=new Z().addKeys(n.keys);r=e.filter(function(e){return!_.hasKey(t.values?u(e):e)});break;case`deleteRange`:var v=n.range;r=e.filter(function(e){return!Zn(u(e),v)})}return r},e))===e)?e:(p=function(e,t){return W(f(e),f(t))||W(u(e),u(t))},r.sort(t.direction===`prev`||t.direction===`prevunique`?function(e,t){return p(t,e)}:p),t.limit&&t.limit<1/0&&(r.length>t.limit?r.length=t.limit:e.length===t.limit&&r.length<t.limit&&(i.dirty=!0)),o?Object.freeze(r):r)}function $n(e,t){return W(e.lower,t.lower)===0&&W(e.upper,t.upper)===0&&!!e.lowerOpen==!!t.lowerOpen&&!!e.upperOpen==!!t.upperOpen}function er(e,t){return((e,t,n,r)=>{if(e===void 0)return t===void 0?0:-1;if(t===void 0)return 1;if((e=W(e,t))===0){if(n&&r)return 0;if(n)return 1;if(r)return-1}return e})(e.lower,t.lower,e.lowerOpen,t.lowerOpen)<=0&&0<=((e,t,n,r)=>{if(e===void 0)return t===void 0?0:1;if(t===void 0)return-1;if((e=W(e,t))===0){if(n&&r)return 0;if(n)return-1;if(r)return 1}return e})(e.upper,t.upper,e.upperOpen,t.upperOpen)}function tr(e,t,n,r){e.subscribers.add(n),r.addEventListener(`abort`,function(){var r,i;e.subscribers.delete(n),e.subscribers.size===0&&(r=e,i=t,setTimeout(function(){r.subscribers.size===0&&D(i,r)},3e3))})}var nr={stack:`dbcore`,level:0,name:`Cache`,create:function(e){var n=e.schema.name;return t(t({},e),{transaction:function(t,r,i){var a,o,s=e.transaction(t,r,i);return r===`readwrite`&&(i=(a=new AbortController).signal,s.addEventListener(`abort`,(o=function(i){return function(){if(a.abort(),r===`readwrite`){for(var o=new Set,c=0,l=t;c<l.length;c++){var u=l[c],d=Mn[`idb://${n}/${u}`];if(d){var f=e.table(u),p=d.optimisticOps.filter(function(e){return e.trans===s});if(s._explicit&&i&&s.mutatedParts)for(var m=0,h=Object.values(d.queries.query);m<h.length;m++)for(var g=0,_=(b=h[m]).slice();g<_.length;g++)jn((x=_[g]).obsSet,s.mutatedParts)&&(D(b,x),x.subscribers.forEach(function(e){return o.add(e)}));else if(0<p.length){d.optimisticOps=d.optimisticOps.filter(function(e){return e.trans!==s});for(var v=0,y=Object.values(d.queries.query);v<y.length;v++)for(var b,x,S,C=0,ee=(b=y[v]).slice();C<ee.length;C++)(x=ee[C]).res!=null&&s.mutatedParts&&(i&&!x.dirty?(S=Object.isFrozen(x.res),S=Qn(x.res,x.req,p,f,x,S),x.dirty?(D(b,x),x.subscribers.forEach(function(e){return o.add(e)})):S!==x.res&&(x.res=S,x.promise=I.resolve({result:S}))):(x.dirty&&D(b,x),x.subscribers.forEach(function(e){return o.add(e)})))}}}o.forEach(function(e){return e()})}}})(!1),{signal:i}),s.addEventListener(`error`,o(!1),{signal:i}),s.addEventListener(`complete`,o(!0),{signal:i})),s},table:function(r){var i=e.table(r),a=i.schema.primaryKey;return t(t({},i),{mutate:function(e){var o,s=F.trans;return!a.outbound&&s.db._options.cache!==`disabled`&&!s.explicit&&s.idbtrans.mode===`readwrite`&&(o=Mn[`idb://${n}/${r}`])?(s=i.mutate(e),e.type!==`add`&&e.type!==`put`||!(50<=e.values.length||Un(a,e).some(function(e){return e==null}))?(o.optimisticOps.push(e),e.mutatedParts&&Fn(e.mutatedParts),s.then(function(t){0<t.numFailures&&(D(o.optimisticOps,e),(t=Xn(0,e,t))&&o.optimisticOps.push(t),e.mutatedParts)&&Fn(e.mutatedParts)}),s.catch(function(){D(o.optimisticOps,e),e.mutatedParts&&Fn(e.mutatedParts)})):s.then(function(n){var r=Xn(0,t(t({},e),{values:e.values.map(function(e,r){var i;return n.failures[r]?e:(x(i=(i=a.keyPath)!=null&&i.includes(`.`)?T(e):t({},e),a.keyPath,n.results[r]),i)})}),n);o.optimisticOps.push(r),queueMicrotask(function(){return e.mutatedParts&&Fn(e.mutatedParts)})}),s):i.mutate(e)},query:function(e){var t,a,o,s,c,l,u;return qn(F,i)&&Jn(`query`,e)?(t=(o=F.trans)?.db._options.cache===`immutable`,a=(o=F).requery,o=o.signal,l=((e,t,n,r)=>{var i=Mn[`idb://${e}/${t}`];if(!i)return[];if(!(e=i.queries[n]))return[null,!1,i,null];var a=e[(r.query?r.query.index.name:null)||``];if(!a)return[null,!1,i,null];switch(n){case`query`:var o=(s=r.direction)??`next`,s=a.find(function(e){return e.req.limit===r.limit&&e.req.values===r.values&&(e.req.direction??`next`)===o&&$n(e.req.query.range,r.query.range)});return s?[s,!0,i,a]:[a.find(function(e){return(`limit`in e.req?e.req.limit:1/0)>=r.limit&&(e.req.direction??`next`)===o&&(!r.values||e.req.values)&&er(e.req.query.range,r.query.range)}),!1,i,a];case`count`:return s=a.find(function(e){return $n(e.req.query.range,r.query.range)}),[s,!!s,i,a]}})(n,r,`query`,e),u=l[0],s=l[2],c=l[3],u&&l[1]?u.obsSet=e.obsSet:(l=i.query(e).then(function(e){var n=e.result;if(u&&(u.res=n),t){for(var r=0,i=n.length;r<i;++r)Object.freeze(n[r]);Object.freeze(n)}return e}).catch(function(e){return c&&u&&D(c,u),Promise.reject(e)}),u={obsSet:e.obsSet,promise:l,subscribers:new Set,type:`query`,req:e,dirty:!1},c?c.push(u):(c=[u],(s||=Mn[`idb://${n}/${r}`]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}}).queries.query[e.query.index.name||``]=c)),tr(u,c,a,o),u.promise.then(function(n){return n=Qn(n.result,e,s?.optimisticOps,i,u,t),{result:t?n:T(n)}})):i.query(e)}})}})}};function rr(e,t){return new Proxy(e,{get:function(e,n,r){return n===`db`?t:Reflect.get(e,n,r)}})}$.prototype.version=function(e){if(isNaN(e)||e<.1)throw new j.Type(`Given version is not a positive number`);if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new j.Schema(`Cannot add version when database is open`);this.verno=Math.max(this.verno,e);var t=this._versions,n=t.filter(function(t){return t._cfg.version===e})[0];return n||(n=new this.Version(e),t.push(n),t.sort(sn),n.stores({}),this._state.autoSchema=!1),n},$.prototype._whenReady=function(e){var t=this;return this.idbdb&&(this._state.openComplete||F.letThrough||this._vip)?e():new I(function(e,n){if(t._state.openComplete)return n(new j.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen)return void n(new j.DatabaseClosed);t.open().catch(M)}t._state.dbReadyPromise.then(e,n)}).then(e)},$.prototype.use=function(e){var t=e.stack,n=e.create,r=e.level,e=e.name,i=(e&&this.unuse({stack:t,name:e}),this._middlewares[t]||(this._middlewares[t]=[]));return i.push({stack:t,create:n,level:r??10,name:e}),i.sort(function(e,t){return e.level-t.level}),this},$.prototype.unuse=function(e){var t=e.stack,n=e.name,r=e.create;return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter(function(e){return r?e.create!==r:!!n&&e.name!==n})),this},$.prototype.open=function(){var e=this;return at(P,function(){return Rn(e)})},$.prototype._close=function(){this.on.close.fire(new CustomEvent(`close`));var e=this._state;if(yn.remove(this),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}e.isBeingOpened||(e.dbReadyPromise=new I(function(t){e.dbReadyResolve=t}),e.openCanceller=new I(function(t,n){e.cancelOpen=n}))},$.prototype.close=function(e){var e=(e===void 0?{disableAutoOpen:!0}:e).disableAutoOpen,t=this._state;e?(t.isBeingOpened&&t.cancelOpen(new j.DatabaseClosed),this._close(),t.autoOpen=!1,t.dbOpenError=new j.DatabaseClosed):(this._close(),t.autoOpen=this._options.autoOpen||t.isBeingOpened,t.openComplete=!1,t.dbOpenError=null)},$.prototype.delete=function(e){var t=this,n=(e===void 0&&(e={disableAutoOpen:!0}),0<arguments.length&&typeof arguments[0]!=`object`),r=this._state;return new I(function(i,a){function o(){t.close(e);var n=t._deps.indexedDB.deleteDatabase(t.name);n.onsuccess=L(function(){var e=t._deps,n=t.name,r;xn(r=e.indexedDB)||n===ut||bn(r,e.IDBKeyRange).delete(n).catch(M),i()}),n.onerror=Y(a),n.onblocked=t._fireOnBlocked}if(n)throw new j.InvalidArgument(`Invalid closeOptions argument to db.delete()`);r.isBeingOpened?r.dbReadyPromise.then(o):o()})},$.prototype.backendDB=function(){return this.idbdb},$.prototype.isOpen=function(){return this.idbdb!==null},$.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&e.name===`DatabaseClosed`},$.prototype.hasFailed=function(){return this._state.dbOpenError!==null},$.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty($.prototype,"tables",{get:function(){var e=this;return i(this._allTables).map(function(t){return e._allTables[t]})},enumerable:!1,configurable:!0}),$.prototype.transaction=function(){var e=function(e,t,n){var r=arguments.length;if(r<2)throw new j.InvalidArgument(`Too few arguments`);for(var i=Array(r-1);--r;)i[r-1]=arguments[r];return n=i.pop(),[e,ee(i),n]}.apply(this,arguments);return this._transaction.apply(this,e)},$.prototype._transaction=function(e,t,n){var r,i,a=this,o=F.trans,s=(o&&o.db===this&&e.indexOf(`!`)===-1||(o=null),e.indexOf(`?`)!==-1);e=e.replace(`!`,``).replace(`?`,``);try{if(i=t.map(function(e){if(e=e instanceof a.Table?e.name:e,typeof e!=`string`)throw TypeError(`Invalid table argument to Dexie.transaction(). Only Table or String are allowed`);return e}),e==`r`||e===dt)r=dt;else{if(e!=`rw`&&e!=ft)throw new j.InvalidArgument(`Invalid transaction mode: `+e);r=ft}if(o){if(o.mode===dt&&r===ft){if(!s)throw new j.SubTransaction(`Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY`);o=null}o&&i.forEach(function(e){if(o&&o.storeNames.indexOf(e)===-1){if(!s)throw new j.SubTransaction(`Table `+e+` not included in parent transaction.`);o=null}}),s&&o&&!o.active&&(o=null)}}catch(e){return o?o._promise(null,function(t,n){n(e)}):H(e)}var c=function e(t,n,r,i,a){return I.resolve().then(function(){var o=F.transless||F,s=t._createTransaction(n,r,t._dbSchema,i),o=(s.explicit=!0,{trans:s,transless:o});if(i)s.idbtrans=i.idbtrans;else try{s.create(),s.idbtrans._explicit=!0,t._state.PR1398_maxLoop=3}catch(i){return i.name===fe.InvalidState&&t.isOpen()&&0<--t._state.PR1398_maxLoop?(console.warn(`Dexie: Need to reopen db`),t.close({disableAutoOpen:!1}),t.open().then(function(){return e(t,n,r,null,a)})):H(i)}var c,l=se(a),o=(l&&tt(),I.follow(function(){var e;(c=a.call(s,s))&&(l?(e=B.bind(null,null),c.then(e,e)):typeof c.next==`function`&&typeof c.throw==`function`&&(c=zn(c)))},o));return(c&&typeof c.then==`function`?I.resolve(c).then(function(e){return s.active?e:H(new j.PrematureCommit(`Transaction committed too early. See http://bit.ly/2kdckMn`))}):o.then(function(){return c})).then(function(e){return i&&s._resolve(),s._completion.then(function(){return e})}).catch(function(e){return s._reject(e),H(e)})})}.bind(null,this,r,i,o,n);return o?o._promise(r,c,`lock`):F.trans?at(F.transless,function(){return a._whenReady(c)}):this._whenReady(c)},$.prototype.table=function(e){if(l(this._allTables,e))return this._allTables[e];throw new j.InvalidTable(`Table ${e} does not exist`)};var Q=$;function $(e,n){var r,i,a,o,s,c=this,l=(this._middlewares={},this.verno=0,$.dependencies),l=(this._options=n=t({addons:$.addons,autoOpen:!0,indexedDB:l.indexedDB,IDBKeyRange:l.IDBKeyRange,cache:`cloned`,maxConnections:1e3},n),this._deps={indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange},n.addons),u=(this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this,{dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:M,dbReadyPromise:null,cancelOpen:M,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:n.autoOpen}),d=(u.dbReadyPromise=new I(function(e){u.dbReadyResolve=e}),u.openCanceller=new I(function(e,t){u.cancelOpen=t}),this._state=u,this.name=e,this.on=wt(this,`populate`,`blocked`,`versionchange`,`close`,{ready:[Se,M]}),this.once=function(e,t){var n=function(){var r=[...arguments];c.on(e).unsubscribe(n),t.apply(c,r)};return c.on(e,n)},this.on.ready.subscribe=_(this.on.ready.subscribe,function(e){return function(t,n){$.vip(function(){var r,i=c._state;i.openComplete?(i.dbOpenError||I.resolve().then(t),n&&e(t)):i.onReadyBeingFired?(i.onReadyBeingFired.push(t),n&&e(t)):(e(t),r=c,n||e(function e(){r.on.ready.unsubscribe(t),r.on.ready.unsubscribe(e)}))})}}),this.Collection=(r=this,Tt(Nt.prototype,function(e,t){this.db=r;var n=mt,i=null;if(t)try{n=t()}catch(e){i=e}var t=e._ctx,e=t.table,a=e.hook.reading.fire;this._ctx={table:e,index:t.index,isPrimKey:!t.index||e.schema.primKey.keyPath&&t.index===e.schema.primKey.name,range:n,keysOnly:!1,dir:`next`,unique:``,algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:i,or:t.or,valueMapper:a===he?null:a}})),this.Table=(i=this,Tt(Ct.prototype,function(e,t,n){this.db=i,this._tx=n,this.name=e,this.schema=t,this.hook=i._allTables[e]?i._allTables[e].hook:wt(null,{creating:[ve,M],reading:[ge,he],updating:[be,M],deleting:[ye,M]})})),this.Transaction=(a=this,Tt(Kt.prototype,function(e,t,n,r,i){var o=this;e!==`readonly`&&t.forEach(function(e){e=(e=n[e])?.yProps,e&&(t=t.concat(e.map(function(e){return e.updatesTable})))}),this.db=a,this.mode=e,this.storeNames=t,this.schema=n,this.chromeTransactionDurability=r,this.idbtrans=null,this.on=wt(this,`complete`,`error`,`abort`),this.parent=i||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new I(function(e,t){o._resolve=e,o._reject=t}),this._completion.then(function(){o.active=!1,o.on.complete.fire()},function(e){var t=o.active;return o.active=!1,o.on.error.fire(e),o.parent?o.parent._reject(e):t&&o.idbtrans&&o.idbtrans.abort(),H(e)})})),this.Version=(o=this,Tt(_n.prototype,function(e){this.db=o,this._cfg={version:e,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(s=this,Tt(Vt.prototype,function(e,t,n){if(this.db=s,this._ctx={table:e,index:t===`:id`?null:t,or:n},this._cmp=this._ascending=W,this._descending=function(e,t){return W(t,e)},this._max=function(e,t){return 0<W(e,t)?e:t},this._min=function(e,t){return W(e,t)<0?e:t},this._IDBKeyRange=s._deps.IDBKeyRange,!this._IDBKeyRange)throw new j.MissingAPI})),this.on(`versionchange`,function(e){0<e.newVersion?console.warn(`Another connection wants to upgrade database '${c.name}'. Closing db now to resume the upgrade.`):console.warn(`Another connection wants to delete database '${c.name}'. Closing db now to resume the delete request.`),c.close({disableAutoOpen:!1})}),this.on(`blocked`,function(e){!e.newVersion||e.newVersion<e.oldVersion?console.warn(`Dexie.delete('${c.name}') was blocked`):console.warn(`Upgrade '${c.name}' blocked by other connection holding version ${e.oldVersion/10}`)}),this._maxKey=Xt(n.IDBKeyRange),this._createTransaction=function(e,t,n,r){return new c.Transaction(e,t,n,c._options.chromeTransactionDurability,r)},this._fireOnBlocked=function(e){c.on(`blocked`).fire(e),yn.toArray().filter(function(e){return e.name===c.name&&e!==c&&!e._state.vcFired}).map(function(t){return t.on(`versionchange`).fire(e)})},this.use(Kn),this.use(nr),this.use(Yn),this.use(Vn),this.use(Wn),new Proxy(this,{get:function(e,t,n){var r;return t===`_vip`||(t===`table`?function(e){return rr(c.table(e),d)}:(r=Reflect.get(e,t,n))instanceof Ct?rr(r,d):t===`tables`?r.map(function(e){return rr(e,d)}):t===`_createTransaction`?function(){return rr(r.apply(this,arguments),d)}:r)}}));this.vip=d,l.forEach(function(e){return e(c)})}var ir,De=typeof Symbol<`u`&&`observable`in Symbol?Symbol.observable:`@@observable`,ar=(or.prototype.subscribe=function(e,t,n){return this._subscribe(e&&typeof e!=`function`?e:{next:e,error:t,complete:n})},or.prototype[De]=function(){return this},or);function or(e){this._subscribe=e}try{ir={indexedDB:r.indexedDB||r.mozIndexedDB||r.webkitIndexedDB||r.msIndexedDB,IDBKeyRange:r.IDBKeyRange||r.webkitIDBKeyRange}}catch{ir={indexedDB:null,IDBKeyRange:null}}function sr(e){var t,n=!1,r=new ar(function(r){var i=se(e),a,o=!1,s={},c={},l={get closed(){return o},unsubscribe:function(){o||(o=!0,a&&a.abort(),u&&Gt.storagemutated.unsubscribe(p))}},u=(r.start&&r.start(l),!1),d=function(){return st(m)};function f(){return jn(c,s)}var p=function(e){An(s,e),f()&&d()},m=function(){var l,m,h;!o&&ir.indexedDB&&(s={},l={},a&&a.abort(),a=new AbortController,h=(t=>{var n=Ke();try{i&&tt();var r=z(e,t);return r=i?r.finally(B):r}finally{n&&qe()}})(m={subscr:l,signal:a.signal,requery:d,querier:e,trans:null}),u||=(Gt.storagemutated.subscribe(p),!0),Promise.resolve(h).then(function(e){n=!0,t=e,o||m.signal.aborted||(f()||(c=l,f())?d():(s={},st(function(){return!o&&r.next&&r.next(e)})))},function(e){n=!1,[`DatabaseClosedError`,`AbortError`].includes(e?.name)||o||st(function(){o||r.error&&r.error(e)})}))};return setTimeout(d,0),l});return r.hasValue=function(){return n},r.getValue=function(){return t},r}var cr=Q;function lr(e){var t=dr;try{dr=!0,Gt.storagemutated.fire(e),In(e,!0)}finally{dr=t}}u(cr,t(t({},w),{delete:function(e){return new cr(e,{addons:[]}).delete()},exists:function(e){return new cr(e,{addons:[]}).open().then(function(e){return e.close(),!0}).catch(`NoSuchDatabaseError`,function(){return!1})},getDatabaseNames:function(e){try{return t=cr.dependencies,n=t.indexedDB,t=t.IDBKeyRange,(xn(n)?Promise.resolve(n.databases()).then(function(e){return e.map(function(e){return e.name}).filter(function(e){return e!==ut})}):bn(n,t).toCollection().primaryKeys()).then(e)}catch{return H(new j.MissingAPI)}var t,n},defineClass:function(){return function(e){o(this,e)}},ignoreTransaction:function(e){return F.trans?at(F.transless||P,e):e()},vip:Sn,async:function(e){return function(){try{var t=zn(e.apply(this,arguments));return t&&typeof t.then==`function`?t:I.resolve(t)}catch(e){return H(e)}}},spawn:function(e,t,n){try{var r=zn(e.apply(n,t||[]));return r&&typeof r.then==`function`?r:I.resolve(r)}catch(e){return H(e)}},currentTransaction:{get:function(){return F.trans||null}},waitFor:function(e,t){return e=I.resolve(typeof e==`function`?cr.ignoreTransaction(e):e).timeout(t||6e4),F.trans?F.trans.waitFor(e):e},Promise:I,debug:{get:function(){return N},set:function(e){Ce(e)}},derive:p,extend:o,props:u,override:_,Events:wt,on:Gt,liveQuery:sr,extendObservabilitySet:An,getByKeyPath:b,setByKeyPath:x,delByKeyPath:function(e,t){typeof t==`string`?x(e,t,void 0):`length`in t&&[].map.call(t,function(t){x(e,t,void 0)})},shallowClone:S,deepClone:T,getObjectDiff:Hn,cmp:W,asap:y,minKey:-1/0,addons:[],connections:{get:yn.toArray},errnames:fe,dependencies:ir,cache:Mn,semVer:`4.4.5`,version:`4.4.5`.split(`.`).map(function(e){return parseInt(e)}).reduce(function(e,t,n){return e+t/10**(2*n)})})),cr.maxKey=Xt(cr.dependencies.IDBKeyRange),typeof dispatchEvent<`u`&&typeof addEventListener<`u`&&(Gt(Ut,function(e){dr||=(e=new CustomEvent(Wt,{detail:e}),dr=!0,dispatchEvent(e),!1)}),addEventListener(Wt,function(e){e=e.detail,dr||lr(e)}));var ur,dr=!1,fr=function(){};return typeof BroadcastChannel<`u`&&((fr=function(){(ur=new BroadcastChannel(Wt)).onmessage=function(e){return e.data&&lr(e.data)}})(),typeof ur.unref==`function`&&ur.unref(),Gt(Ut,function(e){dr||ur.postMessage(e)}
3)),typeof addEventListener<`u`&&(addEventListener(`pagehide`,function(e){if(!Q.disableBfCache&&e.persisted){N&&console.debug(`Dexie: handling persisted pagehide`),ur?.close();for(var t=0,n=yn.toArray();t<n.length;t++)n[t].close({disableAutoOpen:!1})}}),addEventListener(`pageshow`,function(e){!Q.disableBfCache&&e.persisted&&(N&&console.debug(`Dexie: handling persisted pageshow`),fr(),lr({all:new Z(-1/0,[[]])}))})),I.rejectionMapper=function(e,t){return!e||e instanceof le||e instanceof TypeError||e instanceof SyntaxError||!e.name||!me[e.name]?e:(t=new me[e.name](t||e.message,e),`stack`in e&&f(t,`stack`,{get:function(){return this.inner.stack}}),t)},Ce(N),t(Q,Object.freeze({__proto__:null,DEFAULT_MAX_CONNECTIONS:1e3,Dexie:Q,Entity:gt,PropModification:bt,RangeSet:Z,add:function(e){return new bt({add:e})},cmp:W,default:Q,liveQuery:sr,mergeRanges:Tn,rangesOverlap:En,remove:function(e){return new bt({remove:e})},replacePrefix:function(e,t){return new bt({replacePrefix:[e,t]})}}),{default:Q}),Q})}))(),1),m=Symbol.for(`Dexie`),h=globalThis[m]||(globalThis[m]=p.default);if(p.default.semVer!==h.semVer)throw Error(`Two different versions of Dexie loaded in the same app: ${p.default.semVer} and ${h.semVer}`);var{liveQuery:g,mergeRanges:_,rangesOverlap:v,RangeSet:y,cmp:b,Entity:x,PropModification:S,replacePrefix:C,add:ee,remove:w,DexieYProvider:te}=h,ne=class extends h{sessions;messages;affinity;profile;quota;chat_list;images;voices;image_urls;constructor(e){super(e),this.version(1).stores({sessions:`companionId`,messages:`id, sessionId, sentAt`,affinity:`companionId`,profile:`key`}),this.version(2).stores({quota:`key`}),this.version(3).stores({}).upgrade(e=>e.table(`messages`).clear()),this.version(4).stores({chat_list:`key`}),this.version(5).stores({images:`ref, lastAccess`}),this.version(6).stores({voices:`key`}),this.version(7).stores({image_urls:`ref, exp`})}},T=null,re=null;function ie(e){return`eros-cache:${e}`}function E(){if(typeof window>`u`||typeof indexedDB>`u`)return null;let e=fe().currentUser.value?.id;if(!e)return null;if(T&&re===e)return T;T&&(T.close(),T=null,re=null);try{return T=new ne(ie(e)),re=e,T}catch{return T=null,re=null,null}}async function ae(e){if(!(typeof indexedDB>`u`)){T&&re===e&&(T.close(),T=null,re=null);try{await h.delete(ie(e))}catch{}}}function D(e){return JSON.parse(JSON.stringify(e))}async function oe(){let e=E();if(e)try{return(await e.profile.get(`me`))?.profile}catch{return}}async function O(e){let t=E();if(t)try{await t.profile.put(D({key:`me`,profile:e,updatedAt:Date.now()}))}catch{}}function se(){let e=o(`eros:profile`,()=>null),t=o(`eros:profile:loaded`,()=>!1),i=r(()=>!!e.value?.onboarding_completed_at);n();async function c(){if(t.value)return e.value;if(!e.value)try{let t=await oe();t&&(e.value=t)}catch{}let n=s();return e.value=await n(`/api/profile/me`),t.value=!0,e.value&&await O(e.value),e.value}async function l(t){return e.value=await a(`/api/profile`,{method:`POST`,body:t}),e.value&&await O(e.value),e.value}async function u(t){return e.value=await a(`/api/profile/complete`,{method:`POST`,body:t}),e.value&&await O(e.value),e.value}async function d(){return e.value=await a(`/api/profile/avatar`,{method:`POST`}),e.value&&await O(e.value),e.value}async function f(){return e.value=await a(`/api/profile/avatar`,{method:`DELETE`}),e.value&&await O(e.value),e.value}function p(){e.value=null,t.value=!1}return{profile:e,loaded:t,fetch:c,upsert:l,complete:u,setAvatarStamp:d,clearAvatarStamp:f,isOnboarded:i,reset:p}}var k=4e3;async function ce(e){let t=E();if(!t||!e.length)return{};try{let n=Math.floor(Date.now()/1e3),r=await t.image_urls.bulkGet(e),i={},a=[];return r.forEach(e=>{e&&(e.exp<=n?a.push(e.ref):i[e.ref]=e)}),a.length&&t.image_urls.bulkDelete(a).catch(()=>{}),i}catch{return{}}}async function le(e){let t=E();if(!(!t||!e.length))try{await t.image_urls.bulkPut(e);let n=Math.floor(Date.now()/1e3);await t.image_urls.where(`exp`).belowOrEqual(n).delete();let r=await t.image_urls.count();if(r>4e3){let e=r-k,n=await t.image_urls.orderBy(`exp`).limit(e).primaryKeys();n.length&&await t.image_urls.bulkDelete(n)}}catch{}}async function ue(e){let t=E();if(!(!t||!e.length))try{await t.image_urls.bulkDelete(e)}catch{}}function de(e){let t=new Map,n=e.now??(()=>Math.floor(Date.now()/1e3)),r=i(0),a=0,o=new Map;function s(e){let r=t.get(e);if(r){if(r.exp!==void 0&&r.exp<=n()){t.delete(e);return}return r}}function c(e){return s(e)}async function l(n){let i=a,c={},l=[];for(let e of n){let t=s(e);t?c[e]=t:l.push(e)}if(l.length){let n={};try{n=await e.read(l)}catch{}let a=!1;for(let[e,r]of Object.entries(n)){if((o.get(e)??0)>i)continue;let n=s(e);if(n){c[e]=n;continue}let l={url:r.url,thumbUrl:r.thumbUrl,exp:r.exp};t.set(e,l),a=!0,c[e]=l}a&&r.value++;for(let e of Object.keys(c))(o.get(e)??0)>i&&delete c[e]}return c}async function u(n){let i=[],a=[],o=new Set([...Object.keys(n.images??{}),...Object.keys(n.thumbs??{})]);for(let e of o){let r=s(e),o=r?.url??n.images?.[e],c=r?.thumbUrl??n.thumbs?.[e];if(o===r?.url&&c===r?.thumbUrl)continue;let l=n.exps?.[e],u=[r?.exp,l].filter(e=>e!==void 0).reduce((e,t)=>
3e===void 0?t:Math.min(e,t),void 0);if(u===void 0)continue;let d={url:o,thumbUrl:c,exp:u};t.set(e,d),i.push(e),o&&a.push({ref:e,url:o,...c?{thumbUrl:c}:{},exp:u})}if(i.length&&r.value++,a.length)try{await e.write(a)}catch{}return i}async function d(n){o.set(n,++a),t.delete(n)&&r.value++;try{await e.drop([n])}catch{}}function f(){t.clear(),o.clear(),r.value++}return{get:c,paint:l,ingest:u,invalidate:d,clear:f,revision:r}}var A=de({read:ce,write:le,drop:ue});function fe(){let e=f();n();let t=r(()=>{let t=e.user.value;return t?t.id==null&&t.sub?{...t,id:t.sub}:t:e.session?.value?.user??null}),i=r(()=>{let t=e.user.value;if(t)return!t.is_anonymous;let n=e.session?.value?.user;return!!(n&&!n.is_anonymous)}),a=o(`eros:auth:checked`,()=>!1),s=r(()=>a.value||i.value);async function c(t,n,r={}){let i=n??`${window.location.origin}/auth/callback`,a=e.user.value;if(r.link&&a&&a.is_anonymous){let{data:n,error:r}=await e.client.auth.linkIdentity({provider:t,options:{redirectTo:i}});if(r)throw r;return n}let{data:o,error:s}=await e.client.auth.signInWithOAuth({provider:t,options:{redirectTo:i}});if(s)throw s;return o}async function l(e,t={}){return c(`google`,e,t)}async function d(e,t={}){return c(`github`,e,t)}async function p(){u().reset(),se().reset();let n=t.value?.id;if(n)try{await ae(n)}catch{}A.clear(),e.client.auth.signOut({scope:`global`}).catch(()=>{});try{await e.client.auth._removeSession?.()}catch{}}return{currentUser:t,isAuthenticated:i,authReady:s,signInWithGoogle:l,signInWithGitHub:d,signOut:p}}export{E as a,D as i,A as n,f as o,se as r,d as s,fe as t};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.