@rainte/js 0.0.49 → 0.0.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -17,11 +17,11 @@ const ii = (r, i = "children") => r.reduce((u, s) => {
17
17
  var d;
18
18
  return u((d = l.target) == null ? void 0 : d.error);
19
19
  }, s.readAsDataURL(r);
20
- }).then((i) => i), ys = (r) => {
21
- const i = atob(r.split(",")[1] || r), u = new Uint8Array(i.length);
22
- for (let s = 0; s < i.length; s++)
23
- u[s] = i.charCodeAt(s);
24
- return new Blob([u]);
20
+ }).then((i) => i), ys = (r, i) => {
21
+ const u = atob(r.split(",")[1] || r), s = new Uint8Array(u.length);
22
+ for (let l = 0; l < u.length; l++)
23
+ s[l] = u.charCodeAt(l);
24
+ return new Blob([s], i);
25
25
  }, vs = (r, i) => {
26
26
  const u = document.createElement("a");
27
27
  u.href = URL.createObjectURL(i), u.download = r, u.click(), URL.revokeObjectURL(u.href);
@@ -1,4 +1,4 @@
1
- (function(Re,Ye){typeof exports=="object"&&typeof module<"u"?Ye(exports):typeof define=="function"&&define.amd?define(["exports"],Ye):(Re=typeof globalThis<"u"?globalThis:Re||self,Ye(Re["@rainte/js"]={}))})(this,function(Re){"use strict";var Eu=Object.defineProperty;var ku=(Re,Ye,qt)=>Ye in Re?Eu(Re,Ye,{enumerable:!0,configurable:!0,writable:!0,value:qt}):Re[Ye]=qt;var ro=(Re,Ye,qt)=>ku(Re,typeof Ye!="symbol"?Ye+"":Ye,qt);const Ye=(r,i="children")=>r.reduce((u,s)=>{const{[i]:l,...d}=s;return u.push(d),l&&l.length>0&&u.push(...Ye(l)),u},[]),Ui=Object.freeze(Object.defineProperty({__proto__:null,findByValue:(r,i,u="value")=>r.find(s=>s[u]==(Array.isArray(i)?i[0]:i)),flattenTree:Ye},Symbol.toStringTag,{value:"Module"})),Yi=Object.freeze(Object.defineProperty({__proto__:null,download:(r,i)=>{const u=document.createElement("a");u.href=URL.createObjectURL(i),u.download=r,u.click(),URL.revokeObjectURL(u.href)},toBase64:r=>new Promise((i,u)=>{const s=new FileReader;s.onload=l=>{var d;return i((d=l.target)==null?void 0:d.result)},s.onerror=l=>{var d;return u((d=l.target)==null?void 0:d.error)},s.readAsDataURL(r)}).then(i=>i),toBlob:r=>{const i=atob(r.split(",")[1]||r),u=new Uint8Array(i.length);for(let s=0;s<i.length;s++)u[s]=i.charCodeAt(s);return new Blob([u])}},Symbol.toStringTag,{value:"Module"}));var Hi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Tt(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var cn={exports:{}},zi=cn.exports,oo;function Vi(){return oo||(oo=1,function(r,i){(function(u,s){r.exports=s()})(zi,function(){var u=function(e,t){return(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(n[a]=o[a])})(e,t)},s=function(){return(s=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};function l(e,t,n){for(var o,a=0,c=t.length;a<c;a++)!o&&a in t||((o=o||Array.prototype.slice.call(t,0,a))[a]=t[a]);return e.concat(o||Array.prototype.slice.call(t))}var d=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Hi,h=Object.keys,S=Array.isArray;function P(e,t){return typeof t!="object"||h(t).forEach(function(n){e[n]=t[n]}),e}typeof Promise>"u"||d.Promise||(d.Promise=Promise);var C=Object.getPrototypeOf,$={}.hasOwnProperty;function M(e,t){return $.call(e,t)}function ae(e,t){typeof t=="function"&&(t=t(C(e))),(typeof Reflect>"u"?h:Reflect.ownKeys)(t).forEach(function(n){N(e,n,t[n])})}var ue=Object.defineProperty;function N(e,t,n,o){ue(e,t,P(n&&M(n,"get")&&typeof n.get=="function"?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},o))}function j(e){return{from:function(t){return e.prototype=Object.create(t.prototype),N(e.prototype,"constructor",e),{extend:ae.bind(null,e.prototype)}}}}var E=Object.getOwnPropertyDescriptor,J=[].slice;function re(e,t,n){return J.call(e,t,n)}function G(e,t){return t(e)}function _e(e){if(!e)throw new Error("Assertion Failed")}function fe(e){d.setImmediate?setImmediate(e):setTimeout(e,0)}function te(e,t){if(typeof t=="string"&&M(e,t))return e[t];if(!t)return e;if(typeof t!="string"){for(var n=[],o=0,a=t.length;o<a;++o){var c=te(e,t[o]);n.push(c)}return n}var f=t.indexOf(".");if(f!==-1){var p=e[t.substr(0,f)];return p==null?void 0:te(p,t.substr(f+1))}}function U(e,t,n){if(e&&t!==void 0&&!("isFrozen"in Object&&Object.isFrozen(e)))if(typeof t!="string"&&"length"in t){_e(typeof n!="string"&&"length"in n);for(var o=0,a=t.length;o<a;++o)U(e,t[o],n[o])}else{var c,f,p=t.indexOf(".");p!==-1?(c=t.substr(0,p),(f=t.substr(p+1))===""?n===void 0?S(e)&&!isNaN(parseInt(c))?e.splice(c,1):delete e[c]:e[c]=n:U(p=!(p=e[c])||!M(e,c)?e[c]={}:p,f,n)):n===void 0?S(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function K(e){var t,n={};for(t in e)M(e,t)&&(n[t]=e[t]);return n}var ce=[].concat;function le(e){return ce.apply([],e)}var vt="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(le([8,16,32,64].map(function(e){return["Int","Uint","Float"].map(function(t){return t+e+"Array"})}))).filter(function(e){return d[e]}),ne=new Set(vt.map(function(e){return d[e]})),be=null;function we(e){return be=new WeakMap,e=function t(n){if(!n||typeof n!="object")return n;var o=be.get(n);if(o)return o;if(S(n)){o=[],be.set(n,o);for(var a=0,c=n.length;a<c;++a)o.push(t(n[a]))}else if(ne.has(n.constructor))o=n;else{var f,p=C(n);for(f in o=p===Object.prototype?{}:Object.create(p),be.set(n,o),n)M(n,f)&&(o[f]=t(n[f]))}return o}(e),be=null,e}var Q={}.toString;function H(e){return Q.call(e).slice(8,-1)}var I=typeof Symbol<"u"?Symbol.iterator:"@@iterator",ee=typeof I=="symbol"?function(e){var t;return e!=null&&(t=e[I])&&t.apply(e)}:function(){return null};function L(e,t){return t=e.indexOf(t),0<=t&&e.splice(t,1),0<=t}var ie={};function se(e){var t,n,o,a;if(arguments.length===1){if(S(e))return e.slice();if(this===ie&&typeof e=="string")return[e];if(a=ee(e)){for(n=[];!(o=a.next()).done;)n.push(o.value);return n}if(e==null)return[e];if(typeof(t=e.length)!="number")return[e];for(n=new Array(t);t--;)n[t]=e[t];return n}for(t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];return n}var de=typeof Symbol<"u"?function(e){return e[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},Gt=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Qe=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Gt),Ee={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 Oe(e,t){this.name=e,this.message=t}function Pe(e,t){return e+". Errors: "+Object.keys(t).map(function(n){return t[n].toString()}).filter(function(n,o,a){return a.indexOf(n)===o}).join(`
1
+ (function(Re,Ye){typeof exports=="object"&&typeof module<"u"?Ye(exports):typeof define=="function"&&define.amd?define(["exports"],Ye):(Re=typeof globalThis<"u"?globalThis:Re||self,Ye(Re["@rainte/js"]={}))})(this,function(Re){"use strict";var Eu=Object.defineProperty;var ku=(Re,Ye,qt)=>Ye in Re?Eu(Re,Ye,{enumerable:!0,configurable:!0,writable:!0,value:qt}):Re[Ye]=qt;var ro=(Re,Ye,qt)=>ku(Re,typeof Ye!="symbol"?Ye+"":Ye,qt);const Ye=(r,i="children")=>r.reduce((u,s)=>{const{[i]:l,...d}=s;return u.push(d),l&&l.length>0&&u.push(...Ye(l)),u},[]),Ui=Object.freeze(Object.defineProperty({__proto__:null,findByValue:(r,i,u="value")=>r.find(s=>s[u]==(Array.isArray(i)?i[0]:i)),flattenTree:Ye},Symbol.toStringTag,{value:"Module"})),Yi=Object.freeze(Object.defineProperty({__proto__:null,download:(r,i)=>{const u=document.createElement("a");u.href=URL.createObjectURL(i),u.download=r,u.click(),URL.revokeObjectURL(u.href)},toBase64:r=>new Promise((i,u)=>{const s=new FileReader;s.onload=l=>{var d;return i((d=l.target)==null?void 0:d.result)},s.onerror=l=>{var d;return u((d=l.target)==null?void 0:d.error)},s.readAsDataURL(r)}).then(i=>i),toBlob:(r,i)=>{const u=atob(r.split(",")[1]||r),s=new Uint8Array(u.length);for(let l=0;l<u.length;l++)s[l]=u.charCodeAt(l);return new Blob([s],i)}},Symbol.toStringTag,{value:"Module"}));var Hi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Tt(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var cn={exports:{}},zi=cn.exports,oo;function Vi(){return oo||(oo=1,function(r,i){(function(u,s){r.exports=s()})(zi,function(){var u=function(e,t){return(u=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(n[a]=o[a])})(e,t)},s=function(){return(s=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e}).apply(this,arguments)};function l(e,t,n){for(var o,a=0,c=t.length;a<c;a++)!o&&a in t||((o=o||Array.prototype.slice.call(t,0,a))[a]=t[a]);return e.concat(o||Array.prototype.slice.call(t))}var d=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:Hi,h=Object.keys,S=Array.isArray;function P(e,t){return typeof t!="object"||h(t).forEach(function(n){e[n]=t[n]}),e}typeof Promise>"u"||d.Promise||(d.Promise=Promise);var C=Object.getPrototypeOf,$={}.hasOwnProperty;function M(e,t){return $.call(e,t)}function ae(e,t){typeof t=="function"&&(t=t(C(e))),(typeof Reflect>"u"?h:Reflect.ownKeys)(t).forEach(function(n){N(e,n,t[n])})}var ue=Object.defineProperty;function N(e,t,n,o){ue(e,t,P(n&&M(n,"get")&&typeof n.get=="function"?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},o))}function j(e){return{from:function(t){return e.prototype=Object.create(t.prototype),N(e.prototype,"constructor",e),{extend:ae.bind(null,e.prototype)}}}}var E=Object.getOwnPropertyDescriptor,J=[].slice;function re(e,t,n){return J.call(e,t,n)}function G(e,t){return t(e)}function _e(e){if(!e)throw new Error("Assertion Failed")}function fe(e){d.setImmediate?setImmediate(e):setTimeout(e,0)}function te(e,t){if(typeof t=="string"&&M(e,t))return e[t];if(!t)return e;if(typeof t!="string"){for(var n=[],o=0,a=t.length;o<a;++o){var c=te(e,t[o]);n.push(c)}return n}var f=t.indexOf(".");if(f!==-1){var p=e[t.substr(0,f)];return p==null?void 0:te(p,t.substr(f+1))}}function U(e,t,n){if(e&&t!==void 0&&!("isFrozen"in Object&&Object.isFrozen(e)))if(typeof t!="string"&&"length"in t){_e(typeof n!="string"&&"length"in n);for(var o=0,a=t.length;o<a;++o)U(e,t[o],n[o])}else{var c,f,p=t.indexOf(".");p!==-1?(c=t.substr(0,p),(f=t.substr(p+1))===""?n===void 0?S(e)&&!isNaN(parseInt(c))?e.splice(c,1):delete e[c]:e[c]=n:U(p=!(p=e[c])||!M(e,c)?e[c]={}:p,f,n)):n===void 0?S(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function K(e){var t,n={};for(t in e)M(e,t)&&(n[t]=e[t]);return n}var ce=[].concat;function le(e){return ce.apply([],e)}var vt="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(le([8,16,32,64].map(function(e){return["Int","Uint","Float"].map(function(t){return t+e+"Array"})}))).filter(function(e){return d[e]}),ne=new Set(vt.map(function(e){return d[e]})),be=null;function we(e){return be=new WeakMap,e=function t(n){if(!n||typeof n!="object")return n;var o=be.get(n);if(o)return o;if(S(n)){o=[],be.set(n,o);for(var a=0,c=n.length;a<c;++a)o.push(t(n[a]))}else if(ne.has(n.constructor))o=n;else{var f,p=C(n);for(f in o=p===Object.prototype?{}:Object.create(p),be.set(n,o),n)M(n,f)&&(o[f]=t(n[f]))}return o}(e),be=null,e}var Q={}.toString;function H(e){return Q.call(e).slice(8,-1)}var I=typeof Symbol<"u"?Symbol.iterator:"@@iterator",ee=typeof I=="symbol"?function(e){var t;return e!=null&&(t=e[I])&&t.apply(e)}:function(){return null};function L(e,t){return t=e.indexOf(t),0<=t&&e.splice(t,1),0<=t}var ie={};function se(e){var t,n,o,a;if(arguments.length===1){if(S(e))return e.slice();if(this===ie&&typeof e=="string")return[e];if(a=ee(e)){for(n=[];!(o=a.next()).done;)n.push(o.value);return n}if(e==null)return[e];if(typeof(t=e.length)!="number")return[e];for(n=new Array(t);t--;)n[t]=e[t];return n}for(t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];return n}var de=typeof Symbol<"u"?function(e){return e[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},Gt=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Qe=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Gt),Ee={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 Oe(e,t){this.name=e,this.message=t}function Pe(e,t){return e+". Errors: "+Object.keys(t).map(function(n){return t[n].toString()}).filter(function(n,o,a){return a.indexOf(n)===o}).join(`
2
2
  `)}function je(e,t,n,o){this.failures=t,this.failedKeys=o,this.successCount=n,this.message=Pe(e,t)}function Le(e,t){this.name="BulkError",this.failures=Object.keys(t).map(function(n){return t[n]}),this.failuresByPos=t,this.message=Pe(e,this.failures)}j(Oe).from(Error).extend({toString:function(){return this.name+": "+this.message}}),j(je).from(Oe),j(Le).from(Oe);var We=Qe.reduce(function(e,t){return e[t]=t+"Error",e},{}),ot=Oe,Z=Qe.reduce(function(e,t){var n=t+"Error";function o(a,c){this.name=n,a?typeof a=="string"?(this.message="".concat(a).concat(c?`
3
3
  `+c:""),this.inner=c||null):typeof a=="object"&&(this.message="".concat(a.name," ").concat(a.message),this.inner=a):(this.message=Ee[t]||n,this.inner=null)}return j(o).from(ot),e[t]=o,e},{});Z.Syntax=SyntaxError,Z.Type=TypeError,Z.Range=RangeError;var Ce=Gt.reduce(function(e,t){return e[t+"Error"]=Z[t],e},{}),Fe=Qe.reduce(function(e,t){return["Syntax","Type","Range"].indexOf(t)===-1&&(e[t+"Error"]=Z[t]),e},{});function ye(){}function ze(e){return e}function Pt(e,t){return e==null||e===ze?t:function(n){return t(e(n))}}function Xe(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function Ht(e,t){return e===ye?t:function(){var n=e.apply(this,arguments);n!==void 0&&(arguments[0]=n);var o=this.onsuccess,a=this.onerror;this.onsuccess=null,this.onerror=null;var c=t.apply(this,arguments);return o&&(this.onsuccess=this.onsuccess?Xe(o,this.onsuccess):o),a&&(this.onerror=this.onerror?Xe(a,this.onerror):a),c!==void 0?c:n}}function zt(e,t){return e===ye?t:function(){e.apply(this,arguments);var n=this.onsuccess,o=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?Xe(n,this.onsuccess):n),o&&(this.onerror=this.onerror?Xe(o,this.onerror):o)}}function Vt(e,t){return e===ye?t:function(n){var o=e.apply(this,arguments);P(n,o);var a=this.onsuccess,c=this.onerror;return this.onsuccess=null,this.onerror=null,n=t.apply(this,arguments),a&&(this.onsuccess=this.onsuccess?Xe(a,this.onsuccess):a),c&&(this.onerror=this.onerror?Xe(c,this.onerror):c),o===void 0?n===void 0?void 0:n:P(o,n)}}function Wt(e,t){return e===ye?t:function(){return t.apply(this,arguments)!==!1&&e.apply(this,arguments)}}function Cn(e,t){return e===ye?t:function(){var n=e.apply(this,arguments);if(n&&typeof n.then=="function"){for(var o=this,a=arguments.length,c=new Array(a);a--;)c[a]=arguments[a];return n.then(function(){return t.apply(o,c)})}return t.apply(this,arguments)}}Fe.ModifyError=je,Fe.DexieError=Oe,Fe.BulkError=Le;var tt=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function ci(e){tt=e}var Jt={},li=100,vt=typeof Promise>"u"?[]:function(){var e=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[e,C(e),e];var t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,C(t),e]}(),Gt=vt[0],Qe=vt[1],vt=vt[2],Qe=Qe&&Qe.then,gt=Gt&&Gt.constructor,Sr=!!vt,Xt=function(e,t){Qt.push([e,t]),jn&&(queueMicrotask(tu),jn=!1)},xr=!0,jn=!0,bt=[],Mn=[],Or=ze,at={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:ye,pgp:!1,env:{},finalize:ye},oe=at,Qt=[],wt=0,Nn=[];function W(e){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var t=this._PSD=oe;if(typeof e!="function"){if(e!==Jt)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&kr(this,this._value))}this._state=null,this._value=null,++t.ref,function n(o,a){try{a(function(c){if(o._state===null){if(c===o)throw new TypeError("A promise cannot be resolved with itself.");var f=o._lib&&Dt();c&&typeof c.then=="function"?n(o,function(p,y){c instanceof W?c._then(p,y):c.then(p,y)}):(o._state=!0,o._value=c,di(o)),f&&$t()}},kr.bind(null,o))}catch(c){kr(o,c)}}(this,e)}var Er={get:function(){var e=oe,t=Kn;function n(o,a){var c=this,f=!e.global&&(e!==oe||t!==Kn),p=f&&!ct(),y=new W(function(g,_){Tr(c,new fi(pi(o,e,f,p),pi(a,e,f,p),g,_,e))});return this._consoleTask&&(y._consoleTask=this._consoleTask),y}return n.prototype=Jt,n},set:function(e){N(this,"then",e&&e.prototype===Jt?Er:{get:function(){return e},set:Er.set})}};function fi(e,t,n,o,a){this.onFulfilled=typeof e=="function"?e:null,this.onRejected=typeof t=="function"?t:null,this.resolve=n,this.reject=o,this.psd=a}function kr(e,t){var n,o;Mn.push(t),e._state===null&&(n=e._lib&&Dt(),t=Or(t),e._state=!1,e._value=t,o=e,bt.some(function(a){return a._value===o._value})||bt.push(o),di(e),n&&$t())}function di(e){var t=e._listeners;e._listeners=[];for(var n=0,o=t.length;n<o;++n)Tr(e,t[n]);var a=e._PSD;--a.ref||a.finalize(),wt===0&&(++wt,Xt(function(){--wt==0&&Rr()},[]))}function Tr(e,t){if(e._state!==null){var n=e._state?t.onFulfilled:t.onRejected;if(n===null)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++wt,Xt(eu,[n,e,t])}else e._listeners.push(t)}function eu(e,t,n){try{var o,a=t._value;!t._state&&Mn.length&&(Mn=[]),o=tt&&t._consoleTask?t._consoleTask.run(function(){return e(a)}):e(a),t._state||Mn.indexOf(a)!==-1||function(c){for(var f=bt.length;f;)if(bt[--f]._value===c._value)return bt.splice(f,1)}(t),n.resolve(o)}catch(c){n.reject(c)}finally{--wt==0&&Rr(),--n.psd.ref||n.psd.finalize()}}function tu(){_t(at,function(){Dt()&&$t()})}function Dt(){var e=xr;return jn=xr=!1,e}function $t(){var e,t,n;do for(;0<Qt.length;)for(e=Qt,Qt=[],n=e.length,t=0;t<n;++t){var o=e[t];o[0].apply(null,o[1])}while(0<Qt.length);jn=xr=!0}function Rr(){var e=bt;bt=[],e.forEach(function(o){o._PSD.onunhandled.call(null,o._value,o)});for(var t=Nn.slice(0),n=t.length;n;)t[--n]()}function Fn(e){return new W(Jt,!1,e)}function Te(e,t){var n=oe;return function(){var o=Dt(),a=oe;try{return lt(n,!0),e.apply(this,arguments)}catch(c){t&&t(c)}finally{lt(a,!1),o&&$t()}}}ae(W.prototype,{then:Er,_then:function(e,t){Tr(this,new fi(null,null,e,t,oe))},catch:function(e){if(arguments.length===1)return this.then(null,e);var t=e,n=arguments[1];return typeof t=="function"?this.then(null,function(o){return(o instanceof t?n:Fn)(o)}):this.then(null,function(o){return(o&&o.name===t?n:Fn)(o)})},finally:function(e){return this.then(function(t){return W.resolve(e()).then(function(){return t})},function(t){return W.resolve(e()).then(function(){return Fn(t)})})},timeout:function(e,t){var n=this;return e<1/0?new W(function(o,a){var c=setTimeout(function(){return a(new Z.Timeout(t))},e);n.then(o,a).finally(clearTimeout.bind(null,c))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&N(W.prototype,Symbol.toStringTag,"Dexie.Promise"),at.env=hi(),ae(W,{all:function(){var e=se.apply(null,arguments).map(In);return new W(function(t,n){e.length===0&&t([]);var o=e.length;e.forEach(function(a,c){return W.resolve(a).then(function(f){e[c]=f,--o||t(e)},n)})})},resolve:function(e){return e instanceof W?e:e&&typeof e.then=="function"?new W(function(t,n){e.then(t,n)}):new W(Jt,!0,e)},reject:Fn,race:function(){var e=se.apply(null,arguments).map(In);return new W(function(t,n){e.map(function(o){return W.resolve(o).then(t,n)})})},PSD:{get:function(){return oe},set:function(e){return oe=e}},totalEchoes:{get:function(){return Kn}},newPSD:ut,usePSD:_t,scheduler:{get:function(){return Xt},set:function(e){Xt=e}},rejectionMapper:{get:function(){return Or},set:function(e){Or=e}},follow:function(e,t){return new W(function(n,o){return ut(function(a,c){var f=oe;f.unhandleds=[],f.onunhandled=c,f.finalize=Xe(function(){var p,y=this;p=function(){y.unhandleds.length===0?a():c(y.unhandleds[0])},Nn.push(function g(){p(),Nn.splice(Nn.indexOf(g),1)}),++wt,Xt(function(){--wt==0&&Rr()},[])},f.finalize),e()},t,n,o)})}}),gt&&(gt.allSettled&&N(W,"allSettled",function(){var e=se.apply(null,arguments).map(In);return new W(function(t){e.length===0&&t([]);var n=e.length,o=new Array(n);e.forEach(function(a,c){return W.resolve(a).then(function(f){return o[c]={status:"fulfilled",value:f}},function(f){return o[c]={status:"rejected",reason:f}}).then(function(){return--n||t(o)})})})}),gt.any&&typeof AggregateError<"u"&&N(W,"any",function(){var e=se.apply(null,arguments).map(In);return new W(function(t,n){e.length===0&&n(new AggregateError([]));var o=e.length,a=new Array(o);e.forEach(function(c,f){return W.resolve(c).then(function(p){return t(p)},function(p){a[f]=p,--o||n(new AggregateError(a))})})})}),gt.withResolvers&&(W.withResolvers=gt.withResolvers));var Me={awaits:0,echoes:0,id:0},nu=0,qn=[],Bn=0,Kn=0,ru=0;function ut(e,t,n,o){var a=oe,c=Object.create(a);return c.parent=a,c.ref=0,c.global=!1,c.id=++ru,at.env,c.env=Sr?{Promise:W,PromiseProp:{value:W,configurable:!0,writable:!0},all:W.all,race:W.race,allSettled:W.allSettled,any:W.any,resolve:W.resolve,reject:W.reject}:{},t&&P(c,t),++a.ref,c.finalize=function(){--this.parent.ref||this.parent.finalize()},o=_t(c,e,n,o),c.ref===0&&c.finalize(),o}function Ct(){return Me.id||(Me.id=++nu),++Me.awaits,Me.echoes+=li,Me.id}function ct(){return!!Me.awaits&&(--Me.awaits==0&&(Me.id=0),Me.echoes=Me.awaits*li,!0)}function In(e){return Me.echoes&&e&&e.constructor===gt?(Ct(),e.then(function(t){return ct(),t},function(t){return ct(),De(t)})):e}function ou(){var e=qn[qn.length-1];qn.pop(),lt(e,!1)}function lt(e,t){var n,o=oe;(t?!Me.echoes||Bn++&&e===oe:!Bn||--Bn&&e===oe)||queueMicrotask(t?(function(a){++Kn,Me.echoes&&--Me.echoes!=0||(Me.echoes=Me.awaits=Me.id=0),qn.push(oe),lt(a,!0)}).bind(null,e):ou),e!==oe&&(oe=e,o===at&&(at.env=hi()),Sr&&(n=at.env.Promise,t=e.env,(o.global||e.global)&&(Object.defineProperty(d,"Promise",t.PromiseProp),n.all=t.all,n.race=t.race,n.resolve=t.resolve,n.reject=t.reject,t.allSettled&&(n.allSettled=t.allSettled),t.any&&(n.any=t.any))))}function hi(){var e=d.Promise;return Sr?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(d,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject}:{}}function _t(e,t,n,o,a){var c=oe;try{return lt(e,!0),t(n,o,a)}finally{lt(c,!1)}}function pi(e,t,n,o){return typeof e!="function"?e:function(){var a=oe;n&&Ct(),lt(t,!0);try{return e.apply(this,arguments)}finally{lt(a,!1),o&&queueMicrotask(ct)}}}function Ar(e){Promise===gt&&Me.echoes===0?Bn===0?e():enqueueNativeMicroTask(e):setTimeout(e,0)}(""+Qe).indexOf("[native code]")===-1&&(Ct=ct=ye);var De=W.reject,St="￿",it="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",mi="String expected.",jt=[],Ln="__dbnames",Pr="readonly",Dr="readwrite";function xt(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}var yi={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Un(e){return typeof e!="string"||/\./.test(e)?function(t){return t}:function(t){return t[e]===void 0&&e in t&&delete(t=we(t))[e],t}}function vi(){throw Z.Type()}function Se(e,t){try{var n=gi(e),o=gi(t);if(n!==o)return n==="Array"?1:o==="Array"?-1:n==="binary"?1:o==="binary"?-1:n==="string"?1:o==="string"?-1:n==="Date"?1:o!=="Date"?NaN:-1;switch(n){case"number":case"Date":case"string":return t<e?1:e<t?-1:0;case"binary":return function(a,c){for(var f=a.length,p=c.length,y=f<p?f:p,g=0;g<y;++g)if(a[g]!==c[g])return a[g]<c[g]?-1:1;return f===p?0:f<p?-1:1}(bi(e),bi(t));case"Array":return function(a,c){for(var f=a.length,p=c.length,y=f<p?f:p,g=0;g<y;++g){var _=Se(a[g],c[g]);if(_!==0)return _}return f===p?0:f<p?-1:1}(e,t)}}catch{}return NaN}function gi(e){var t=typeof e;return t!="object"?t:ArrayBuffer.isView(e)?"binary":(e=H(e),e==="ArrayBuffer"?"binary":e)}function bi(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}var wi=(ke.prototype._trans=function(e,t,n){var o=this._tx||oe.trans,a=this.name,c=tt&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(e==="readonly"?"read":"write"," ").concat(this.name));function f(g,_,m){if(!m.schema[a])throw new Z.NotFound("Table "+a+" not part of transaction");return t(m.idbtrans,m)}var p=Dt();try{var y=o&&o.db._novip===this.db._novip?o===oe.trans?o._promise(e,f,n):ut(function(){return o._promise(e,f,n)},{trans:o,transless:oe.transless||oe}):function g(_,m,O,v){if(_.idbdb&&(_._state.openComplete||oe.letThrough||_._vip)){var w=_._createTransaction(m,O,_._dbSchema);try{w.create(),_._state.PR1398_maxLoop=3}catch(x){return x.name===We.InvalidState&&_.isOpen()&&0<--_._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),_.close({disableAutoOpen:!1}),_.open().then(function(){return g(_,m,O,v)})):De(x)}return w._promise(m,function(x,b){return ut(function(){return oe.trans=w,v(x,b,w)})}).then(function(x){if(m==="readwrite")try{w.idbtrans.commit()}catch{}return m==="readonly"?x:w._completion.then(function(){return x})})}if(_._state.openComplete)return De(new Z.DatabaseClosed(_._state.dbOpenError));if(!_._state.isBeingOpened){if(!_._state.autoOpen)return De(new Z.DatabaseClosed);_.open().catch(ye)}return _._state.dbReadyPromise.then(function(){return g(_,m,O,v)})}(this.db,e,[this.name],f);return c&&(y._consoleTask=c,y=y.catch(function(g){return console.trace(g),De(g)})),y}finally{p&&$t()}},ke.prototype.get=function(e,t){var n=this;return e&&e.constructor===Object?this.where(e).first(t):e==null?De(new Z.Type("Invalid argument to Table.get()")):this._trans("readonly",function(o){return n.core.get({trans:o,key:e}).then(function(a){return n.hook.reading.fire(a)})}).then(t)},ke.prototype.where=function(e){if(typeof e=="string")return new this.db.WhereClause(this,e);if(S(e))return new this.db.WhereClause(this,"[".concat(e.join("+"),"]"));var t=h(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(p){if(p.compound&&t.every(function(g){return 0<=p.keyPath.indexOf(g)})){for(var y=0;y<t.length;++y)if(t.indexOf(p.keyPath[y])===-1)return!1;return!0}return!1}).sort(function(p,y){return p.keyPath.length-y.keyPath.length})[0];if(n&&this.db._maxKey!==St){var c=n.keyPath.slice(0,t.length);return this.where(c).equals(c.map(function(y){return e[y]}))}!n&&tt&&console.warn("The query ".concat(JSON.stringify(e)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(t.join("+"),"]"));var o=this.schema.idxByName;function a(p,y){return Se(p,y)===0}var f=t.reduce(function(m,y){var g=m[0],_=m[1],m=o[y],O=e[y];return[g||m,g||!m?xt(_,m&&m.multi?function(v){return v=te(v,y),S(v)&&v.some(function(w){return a(O,w)})}:function(v){return a(O,te(v,y))}):_]},[null,null]),c=f[0],f=f[1];return c?this.where(c.name).equals(e[c.keyPath]).filter(f):n?this.filter(f):this.where(t).equals("")},ke.prototype.filter=function(e){return this.toCollection().and(e)},ke.prototype.count=function(e){return this.toCollection().count(e)},ke.prototype.offset=function(e){return this.toCollection().offset(e)},ke.prototype.limit=function(e){return this.toCollection().limit(e)},ke.prototype.each=function(e){return this.toCollection().each(e)},ke.prototype.toArray=function(e){return this.toCollection().toArray(e)},ke.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},ke.prototype.orderBy=function(e){return new this.db.Collection(new this.db.WhereClause(this,S(e)?"[".concat(e.join("+"),"]"):e))},ke.prototype.reverse=function(){return this.toCollection().reverse()},ke.prototype.mapToClass=function(e){var t,n=this.db,o=this.name;function a(){return t!==null&&t.apply(this,arguments)||this}(this.schema.mappedClass=e).prototype instanceof vi&&(function(y,g){if(typeof g!="function"&&g!==null)throw new TypeError("Class extends value "+String(g)+" is not a constructor or null");function _(){this.constructor=y}u(y,g),y.prototype=g===null?Object.create(g):(_.prototype=g.prototype,new _)}(a,t=e),Object.defineProperty(a.prototype,"db",{get:function(){return n},enumerable:!1,configurable:!0}),a.prototype.table=function(){return o},e=a);for(var c=new Set,f=e.prototype;f;f=C(f))Object.getOwnPropertyNames(f).forEach(function(y){return c.add(y)});function p(y){if(!y)return y;var g,_=Object.create(e.prototype);for(g in y)if(!c.has(g))try{_[g]=y[g]}catch{}return _}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=p,this.hook("reading",p),e},ke.prototype.defineClass=function(){return this.mapToClass(function(e){P(this,e)})},ke.prototype.add=function(e,t){var n=this,o=this.schema.primKey,a=o.auto,c=o.keyPath,f=e;return c&&a&&(f=Un(c)(e)),this._trans("readwrite",function(p){return n.core.mutate({trans:p,type:"add",keys:t!=null?[t]:null,values:[f]})}).then(function(p){return p.numFailures?W.reject(p.failures[0]):p.lastResult}).then(function(p){if(c)try{U(e,c,p)}catch{}return p})},ke.prototype.update=function(e,t){return typeof e!="object"||S(e)?this.where(":id").equals(e).modify(t):(e=te(e,this.schema.primKey.keyPath),e===void 0?De(new Z.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(e).modify(t))},ke.prototype.put=function(e,t){var n=this,o=this.schema.primKey,a=o.auto,c=o.keyPath,f=e;return c&&a&&(f=Un(c)(e)),this._trans("readwrite",function(p){return n.core.mutate({trans:p,type:"put",values:[f],keys:t!=null?[t]:null})}).then(function(p){return p.numFailures?W.reject(p.failures[0]):p.lastResult}).then(function(p){if(c)try{U(e,c,p)}catch{}return p})},ke.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 n.numFailures?W.reject(n.failures[0]):void 0})},ke.prototype.clear=function(){var e=this;return this._trans("readwrite",function(t){return e.core.mutate({trans:t,type:"deleteRange",range:yi})}).then(function(t){return t.numFailures?W.reject(t.failures[0]):void 0})},ke.prototype.bulkGet=function(e){var t=this;return this._trans("readonly",function(n){return t.core.getMany({keys:e,trans:n}).then(function(o){return o.map(function(a){return t.hook.reading.fire(a)})})})},ke.prototype.bulkAdd=function(e,t,n){var o=this,a=Array.isArray(t)?t:void 0,c=(n=n||(a?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",function(f){var g=o.schema.primKey,p=g.auto,g=g.keyPath;if(g&&a)throw new Z.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(a&&a.length!==e.length)throw new Z.InvalidArgument("Arguments objects and keys must have the same length");var y=e.length,g=g&&p?e.map(Un(g)):e;return o.core.mutate({trans:f,type:"add",keys:a,values:g,wantResults:c}).then(function(w){var m=w.numFailures,O=w.results,v=w.lastResult,w=w.failures;if(m===0)return c?O:v;throw new Le("".concat(o.name,".bulkAdd(): ").concat(m," of ").concat(y," operations failed"),w)})})},ke.prototype.bulkPut=function(e,t,n){var o=this,a=Array.isArray(t)?t:void 0,c=(n=n||(a?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",function(f){var g=o.schema.primKey,p=g.auto,g=g.keyPath;if(g&&a)throw new Z.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(a&&a.length!==e.length)throw new Z.InvalidArgument("Arguments objects and keys must have the same length");var y=e.length,g=g&&p?e.map(Un(g)):e;return o.core.mutate({trans:f,type:"put",keys:a,values:g,wantResults:c}).then(function(w){var m=w.numFailures,O=w.results,v=w.lastResult,w=w.failures;if(m===0)return c?O:v;throw new Le("".concat(o.name,".bulkPut(): ").concat(m," of ").concat(y," operations failed"),w)})})},ke.prototype.bulkUpdate=function(e){var t=this,n=this.core,o=e.map(function(f){return f.key}),a=e.map(function(f){return f.changes}),c=[];return this._trans("readwrite",function(f){return n.getMany({trans:f,keys:o,cache:"clone"}).then(function(p){var y=[],g=[];e.forEach(function(m,O){var v=m.key,w=m.changes,x=p[O];if(x){for(var b=0,k=Object.keys(w);b<k.length;b++){var T=k[b],R=w[T];if(T===t.schema.primKey.keyPath){if(Se(R,v)!==0)throw new Z.Constraint("Cannot update primary key in bulkUpdate()")}else U(x,T,R)}c.push(O),y.push(v),g.push(x)}});var _=y.length;return n.mutate({trans:f,type:"put",keys:y,values:g,updates:{keys:o,changeSpecs:a}}).then(function(m){var O=m.numFailures,v=m.failures;if(O===0)return _;for(var w=0,x=Object.keys(v);w<x.length;w++){var b,k=x[w],T=c[Number(k)];T!=null&&(b=v[k],delete v[k],v[T]=b)}throw new Le("".concat(t.name,".bulkUpdate(): ").concat(O," of ").concat(_," operations failed"),v)})})})},ke.prototype.bulkDelete=function(e){var t=this,n=e.length;return this._trans("readwrite",function(o){return t.core.mutate({trans:o,type:"delete",keys:e})}).then(function(f){var a=f.numFailures,c=f.lastResult,f=f.failures;if(a===0)return c;throw new Le("".concat(t.name,".bulkDelete(): ").concat(a," of ").concat(n," operations failed"),f)})},ke);function ke(){}function Zt(e){function t(f,p){if(p){for(var y=arguments.length,g=new Array(y-1);--y;)g[y-1]=arguments[y];return n[f].subscribe.apply(null,g),e}if(typeof f=="string")return n[f]}var n={};t.addEventType=c;for(var o=1,a=arguments.length;o<a;++o)c(arguments[o]);return t;function c(f,p,y){if(typeof f!="object"){var g;p=p||Wt;var _={subscribers:[],fire:y=y||ye,subscribe:function(m){_.subscribers.indexOf(m)===-1&&(_.subscribers.push(m),_.fire=p(_.fire,m))},unsubscribe:function(m){_.subscribers=_.subscribers.filter(function(O){return O!==m}),_.fire=_.subscribers.reduce(p,y)}};return n[f]=t[f]=_}h(g=f).forEach(function(m){var O=g[m];if(S(O))c(m,g[m][0],g[m][1]);else{if(O!=="asap")throw new Z.InvalidArgument("Invalid event config");var v=c(m,ze,function(){for(var w=arguments.length,x=new Array(w);w--;)x[w]=arguments[w];v.subscribers.forEach(function(b){fe(function(){b.apply(null,x)})})})}})}}function en(e,t){return j(t).from({prototype:e}),t}function Mt(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function $r(e,t){e.filter=xt(e.filter,t)}function Cr(e,t,n){var o=e.replayFilter;e.replayFilter=o?function(){return xt(o(),t())}:t,e.justLimit=n&&!o}function Yn(e,t){if(e.isPrimKey)return t.primaryKey;var n=t.getIndexByKeyPath(e.index);if(!n)throw new Z.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function _i(e,t,n){var o=Yn(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:e.dir==="prev",unique:!!e.unique,query:{index:o,range:e.range}})}function Hn(e,t,n,o){var a=e.replayFilter?xt(e.filter,e.replayFilter()):e.filter;if(e.or){var c={},f=function(p,y,g){var _,m;a&&!a(y,g,function(O){return y.stop(O)},function(O){return y.fail(O)})||((m=""+(_=y.primaryKey))=="[object ArrayBuffer]"&&(m=""+new Uint8Array(_)),M(c,m)||(c[m]=!0,t(p,y,g)))};return Promise.all([e.or._iterate(f,n),Si(_i(e,o,n),e.algorithm,f,!e.keysOnly&&e.valueMapper)])}return Si(_i(e,o,n),xt(e.algorithm,a),t,!e.keysOnly&&e.valueMapper)}function Si(e,t,n,o){var a=Te(o?function(c,f,p){return n(o(c),f,p)}:n);return e.then(function(c){if(c)return c.start(function(){var f=function(){return c.continue()};t&&!t(c,function(p){return f=p},function(p){c.stop(p),f=ye},function(p){c.fail(p),f=ye})||a(c.value,c,function(p){return f=p}),f()})})}var tn=(xi.prototype.execute=function(e){var t=this["@@propmod"];if(t.add!==void 0){var n=t.add;if(S(n))return l(l([],S(e)?e:[],!0),n).sort();if(typeof n=="number")return(Number(e)||0)+n;if(typeof n=="bigint")try{return BigInt(e)+n}catch{return BigInt(0)+n}throw new TypeError("Invalid term ".concat(n))}if(t.remove!==void 0){var o=t.remove;if(S(o))return S(e)?e.filter(function(a){return!o.includes(a)}).sort():[];if(typeof o=="number")return Number(e)-o;if(typeof o=="bigint")try{return BigInt(e)-o}catch{return BigInt(0)-o}throw new TypeError("Invalid subtrahend ".concat(o))}return n=(n=t.replacePrefix)===null||n===void 0?void 0:n[0],n&&typeof e=="string"&&e.startsWith(n)?t.replacePrefix[1]+e.substring(n.length):e},xi);function xi(e){this["@@propmod"]=e}var iu=(xe.prototype._read=function(e,t){var n=this._ctx;return n.error?n.table._trans(null,De.bind(null,n.error)):n.table._trans("readonly",e).then(t)},xe.prototype._write=function(e){var t=this._ctx;return t.error?t.table._trans(null,De.bind(null,t.error)):t.table._trans("readwrite",e,"locked")},xe.prototype._addAlgorithm=function(e){var t=this._ctx;t.algorithm=xt(t.algorithm,e)},xe.prototype._iterate=function(e,t){return Hn(this._ctx,e,t,this._ctx.table.core)},xe.prototype.clone=function(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&P(n,e),t._ctx=n,t},xe.prototype.raw=function(){return this._ctx.valueMapper=null,this},xe.prototype.each=function(e){var t=this._ctx;return this._read(function(n){return Hn(t,e,n,t.table.core)})},xe.prototype.count=function(e){var t=this;return this._read(function(n){var o=t._ctx,a=o.table.core;if(Mt(o,!0))return a.count({trans:n,query:{index:Yn(o,a.schema),range:o.range}}).then(function(f){return Math.min(f,o.limit)});var c=0;return Hn(o,function(){return++c,!1},n,a).then(function(){return c})}).then(e)},xe.prototype.sortBy=function(e,t){var n=e.split(".").reverse(),o=n[0],a=n.length-1;function c(y,g){return g?c(y[n[g]],g-1):y[o]}var f=this._ctx.dir==="next"?1:-1;function p(y,g){return Se(c(y,a),c(g,a))*f}return this.toArray(function(y){return y.sort(p)}).then(t)},xe.prototype.toArray=function(e){var t=this;return this._read(function(n){var o=t._ctx;if(o.dir==="next"&&Mt(o,!0)&&0<o.limit){var a=o.valueMapper,c=Yn(o,o.table.core.schema);return o.table.core.query({trans:n,limit:o.limit,values:!0,query:{index:c,range:o.range}}).then(function(p){return p=p.result,a?p.map(a):p})}var f=[];return Hn(o,function(p){return f.push(p)},n,o.table.core).then(function(){return f})},e)},xe.prototype.offset=function(e){var t=this._ctx;return e<=0||(t.offset+=e,Mt(t)?Cr(t,function(){var n=e;return function(o,a){return n===0||(n===1?--n:a(function(){o.advance(n),n=0}),!1)}}):Cr(t,function(){var n=e;return function(){return--n<0}})),this},xe.prototype.limit=function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),Cr(this._ctx,function(){var t=e;return function(n,o,a){return--t<=0&&o(a),0<=t}},!0),this},xe.prototype.until=function(e,t){return $r(this._ctx,function(n,o,a){return!e(n.value)||(o(a),t)}),this},xe.prototype.first=function(e){return this.limit(1).toArray(function(t){return t[0]}).then(e)},xe.prototype.last=function(e){return this.reverse().first(e)},xe.prototype.filter=function(e){var t;return $r(this._ctx,function(n){return e(n.value)}),(t=this._ctx).isMatch=xt(t.isMatch,e),this},xe.prototype.and=function(e){return this.filter(e)},xe.prototype.or=function(e){return new this.db.WhereClause(this._ctx.table,e,this)},xe.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},xe.prototype.desc=function(){return this.reverse()},xe.prototype.eachKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(n,o){e(o.key,o)})},xe.prototype.eachUniqueKey=function(e){return this._ctx.unique="unique",this.eachKey(e)},xe.prototype.eachPrimaryKey=function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each(function(n,o){e(o.primaryKey,o)})},xe.prototype.keys=function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each(function(o,a){n.push(a.key)}).then(function(){return n}).then(e)},xe.prototype.primaryKeys=function(e){var t=this._ctx;if(t.dir==="next"&&Mt(t,!0)&&0<t.limit)return this._read(function(o){var a=Yn(t,t.table.core.schema);return t.table.core.query({trans:o,values:!1,limit:t.limit,query:{index:a,range:t.range}})}).then(function(o){return o.result}).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each(function(o,a){n.push(a.primaryKey)}).then(function(){return n}).then(e)},xe.prototype.uniqueKeys=function(e){return this._ctx.unique="unique",this.keys(e)},xe.prototype.firstKey=function(e){return this.limit(1).keys(function(t){return t[0]}).then(e)},xe.prototype.lastKey=function(e){return this.reverse().firstKey(e)},xe.prototype.distinct=function(){var e=this._ctx,e=e.index&&e.table.schema.idxByName[e.index];if(!e||!e.multi)return this;var t={};return $r(this._ctx,function(a){var o=a.primaryKey.toString(),a=M(t,o);return t[o]=!0,!a}),this},xe.prototype.modify=function(e){var t=this,n=this._ctx;return this._write(function(o){var a,c,f;f=typeof e=="function"?e:(a=h(e),c=a.length,function(b){for(var k=!1,T=0;T<c;++T){var R=a[T],D=e[R],F=te(b,R);D instanceof tn?(U(b,R,D.execute(F)),k=!0):F!==D&&(U(b,R,D),k=!0)}return k});var p=n.table.core,m=p.schema.primaryKey,y=m.outbound,g=m.extractKey,_=200,m=t.db._options.modifyChunkSize;m&&(_=typeof m=="object"?m[p.name]||m["*"]||200:m);function O(b,R){var T=R.failures,R=R.numFailures;w+=b-R;for(var D=0,F=h(T);D<F.length;D++){var z=F[D];v.push(T[z])}}var v=[],w=0,x=[];return t.clone().primaryKeys().then(function(b){function k(R){var D=Math.min(_,b.length-R);return p.getMany({trans:o,keys:b.slice(R,R+D),cache:"immutable"}).then(function(F){for(var z=[],q=[],B=y?[]:null,V=[],Y=0;Y<D;++Y){var X=F[Y],me={value:we(X),primKey:b[R+Y]};f.call(me,me.value,me)!==!1&&(me.value==null?V.push(b[R+Y]):y||Se(g(X),g(me.value))===0?(q.push(me.value),y&&B.push(b[R+Y])):(V.push(b[R+Y]),z.push(me.value)))}return Promise.resolve(0<z.length&&p.mutate({trans:o,type:"add",values:z}).then(function(ve){for(var ge in ve.failures)V.splice(parseInt(ge),1);O(z.length,ve)})).then(function(){return(0<q.length||T&&typeof e=="object")&&p.mutate({trans:o,type:"put",keys:B,values:q,criteria:T,changeSpec:typeof e!="function"&&e,isAdditionalChunk:0<R}).then(function(ve){return O(q.length,ve)})}).then(function(){return(0<V.length||T&&e===jr)&&p.mutate({trans:o,type:"delete",keys:V,criteria:T,isAdditionalChunk:0<R}).then(function(ve){return O(V.length,ve)})}).then(function(){return b.length>R+D&&k(R+_)})})}var T=Mt(n)&&n.limit===1/0&&(typeof e!="function"||e===jr)&&{index:n.index,range:n.range};return k(0).then(function(){if(0<v.length)throw new je("Error modifying one or more objects",v,w,x);return b.length})})})},xe.prototype.delete=function(){var e=this._ctx,t=e.range;return Mt(e)&&(e.isPrimKey||t.type===3)?this._write(function(n){var o=e.table.core.schema.primaryKey,a=t;return e.table.core.count({trans:n,query:{index:o,range:a}}).then(function(c){return e.table.core.mutate({trans:n,type:"deleteRange",range:a}).then(function(f){var p=f.failures;if(f.lastResult,f.results,f=f.numFailures,f)throw new je("Could not delete some values",Object.keys(p).map(function(y){return p[y]}),c-f);return c-f})})}):this.modify(jr)},xe);function xe(){}var jr=function(e,t){return t.value=null};function su(e,t){return e<t?-1:e===t?0:1}function au(e,t){return t<e?-1:e===t?0:1}function Je(e,t,n){return e=e instanceof Ei?new e.Collection(e):e,e._ctx.error=new(n||TypeError)(t),e}function Nt(e){return new e.Collection(e,function(){return Oi("")}).limit(0)}function zn(e,t,n,o){var a,c,f,p,y,g,_,m=n.length;if(!n.every(function(w){return typeof w=="string"}))return Je(e,mi);function O(w){a=w==="next"?function(b){return b.toUpperCase()}:function(b){return b.toLowerCase()},c=w==="next"?function(b){return b.toLowerCase()}:function(b){return b.toUpperCase()},f=w==="next"?su:au;var x=n.map(function(b){return{lower:c(b),upper:a(b)}}).sort(function(b,k){return f(b.lower,k.lower)});p=x.map(function(b){return b.upper}),y=x.map(function(b){return b.lower}),_=(g=w)==="next"?"":o}O("next"),e=new e.Collection(e,function(){return ft(p[0],y[m-1]+o)}),e._ondirectionchange=function(w){O(w)};var v=0;return e._addAlgorithm(function(w,x,b){var k=w.key;if(typeof k!="string")return!1;var T=c(k);if(t(T,y,v))return!0;for(var R=null,D=v;D<m;++D){var F=function(z,q,B,V,Y,X){for(var me=Math.min(z.length,V.length),ve=-1,ge=0;ge<me;++ge){var Ge=q[ge];if(Ge!==V[ge])return Y(z[ge],B[ge])<0?z.substr(0,ge)+B[ge]+B.substr(ge+1):Y(z[ge],V[ge])<0?z.substr(0,ge)+V[ge]+B.substr(ge+1):0<=ve?z.substr(0,ve)+q[ve]+B.substr(ve+1):null;Y(z[ge],Ge)<0&&(ve=ge)}return me<V.length&&X==="next"?z+B.substr(z.length):me<z.length&&X==="prev"?z.substr(0,B.length):ve<0?null:z.substr(0,ve)+V[ve]+B.substr(ve+1)}(k,T,p[D],y[D],f,g);F===null&&R===null?v=D+1:(R===null||0<f(R,F))&&(R=F)}return x(R!==null?function(){w.continue(R+_)}:b),!1}),e}function ft(e,t,n,o){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:o}}function Oi(e){return{type:1,lower:e,upper:e}}var Ei=(Object.defineProperty(Ne.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Ne.prototype.between=function(e,t,n,o){n=n!==!1,o=o===!0;try{return 0<this._cmp(e,t)||this._cmp(e,t)===0&&(n||o)&&(!n||!o)?Nt(this):new this.Collection(this,function(){return ft(e,t,!n,!o)})}catch{return Je(this,it)}},Ne.prototype.equals=function(e){return e==null?Je(this,it):new this.Collection(this,function(){return Oi(e)})},Ne.prototype.above=function(e){return e==null?Je(this,it):new this.Collection(this,function(){return ft(e,void 0,!0)})},Ne.prototype.aboveOrEqual=function(e){return e==null?Je(this,it):new this.Collection(this,function(){return ft(e,void 0,!1)})},Ne.prototype.below=function(e){return e==null?Je(this,it):new this.Collection(this,function(){return ft(void 0,e,!1,!0)})},Ne.prototype.belowOrEqual=function(e){return e==null?Je(this,it):new this.Collection(this,function(){return ft(void 0,e)})},Ne.prototype.startsWith=function(e){return typeof e!="string"?Je(this,mi):this.between(e,e+St,!0,!0)},Ne.prototype.startsWithIgnoreCase=function(e){return e===""?this.startsWith(e):zn(this,function(t,n){return t.indexOf(n[0])===0},[e],St)},Ne.prototype.equalsIgnoreCase=function(e){return zn(this,function(t,n){return t===n[0]},[e],"")},Ne.prototype.anyOfIgnoreCase=function(){var e=se.apply(ie,arguments);return e.length===0?Nt(this):zn(this,function(t,n){return n.indexOf(t)!==-1},e,"")},Ne.prototype.startsWithAnyOfIgnoreCase=function(){var e=se.apply(ie,arguments);return e.length===0?Nt(this):zn(this,function(t,n){return n.some(function(o){return t.indexOf(o)===0})},e,St)},Ne.prototype.anyOf=function(){var e=this,t=se.apply(ie,arguments),n=this._cmp;try{t.sort(n)}catch{return Je(this,it)}if(t.length===0)return Nt(this);var o=new this.Collection(this,function(){return ft(t[0],t[t.length-1])});o._ondirectionchange=function(c){n=c==="next"?e._ascending:e._descending,t.sort(n)};var a=0;return o._addAlgorithm(function(c,f,p){for(var y=c.key;0<n(y,t[a]);)if(++a===t.length)return f(p),!1;return n(y,t[a])===0||(f(function(){c.continue(t[a])}),!1)}),o},Ne.prototype.notEqual=function(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Ne.prototype.noneOf=function(){var e=se.apply(ie,arguments);if(e.length===0)return new this.Collection(this);try{e.sort(this._ascending)}catch{return Je(this,it)}var t=e.reduce(function(n,o){return n?n.concat([[n[n.length-1][1],o]]):[[-1/0,o]]},null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})},Ne.prototype.inAnyRange=function(k,t){var n=this,o=this._cmp,a=this._ascending,c=this._descending,f=this._min,p=this._max;if(k.length===0)return Nt(this);if(!k.every(function(T){return T[0]!==void 0&&T[1]!==void 0&&a(T[0],T[1])<=0}))return Je(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Z.InvalidArgument);var y=!t||t.includeLowers!==!1,g=t&&t.includeUppers===!0,_,m=a;function O(T,R){return m(T[0],R[0])}try{(_=k.reduce(function(T,R){for(var D=0,F=T.length;D<F;++D){var z=T[D];if(o(R[0],z[1])<0&&0<o(R[1],z[0])){z[0]=f(z[0],R[0]),z[1]=p(z[1],R[1]);break}}return D===F&&T.push(R),T},[])).sort(O)}catch{return Je(this,it)}var v=0,w=g?function(T){return 0<a(T,_[v][1])}:function(T){return 0<=a(T,_[v][1])},x=y?function(T){return 0<c(T,_[v][0])}:function(T){return 0<=c(T,_[v][0])},b=w,k=new this.Collection(this,function(){return ft(_[0][0],_[_.length-1][1],!y,!g)});return k._ondirectionchange=function(T){m=T==="next"?(b=w,a):(b=x,c),_.sort(O)},k._addAlgorithm(function(T,R,D){for(var F,z=T.key;b(z);)if(++v===_.length)return R(D),!1;return!w(F=z)&&!x(F)||(n._cmp(z,_[v][1])===0||n._cmp(z,_[v][0])===0||R(function(){m===a?T.continue(_[v][0]):T.continue(_[v][1])}),!1)}),k},Ne.prototype.startsWithAnyOf=function(){var e=se.apply(ie,arguments);return e.every(function(t){return typeof t=="string"})?e.length===0?Nt(this):this.inAnyRange(e.map(function(t){return[t,t+St]})):Je(this,"startsWithAnyOf() only works with strings")},Ne);function Ne(){}function nt(e){return Te(function(t){return nn(t),e(t.target.error),!1})}function nn(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}var rn="storagemutated",Mr="x-storagemutated-1",dt=Zt(null,rn),uu=(rt.prototype._lock=function(){return _e(!oe.global),++this._reculock,this._reculock!==1||oe.global||(oe.lockOwnerFor=this),this},rt.prototype._unlock=function(){if(_e(!oe.global),--this._reculock==0)for(oe.global||(oe.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var e=this._blockedFuncs.shift();try{_t(e[1],e[0])}catch{}}return this},rt.prototype._locked=function(){return this._reculock&&oe.lockOwnerFor!==this},rt.prototype.create=function(e){var t=this;if(!this.mode)return this;var n=this.db.idbdb,o=this.db._state.dbOpenError;if(_e(!this.idbtrans),!e&&!n)switch(o&&o.name){case"DatabaseClosedError":throw new Z.DatabaseClosed(o);case"MissingAPIError":throw new Z.MissingAPI(o.message,o);default:throw new Z.OpenFailed(o)}if(!this.active)throw new Z.TransactionInactive;return _e(this._completion._state===null),(e=this.idbtrans=e||(this.db.core||n).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=Te(function(a){nn(a),t._reject(e.error)}),e.onabort=Te(function(a){nn(a),t.active&&t._reject(new Z.Abort(e.error)),t.active=!1,t.on("abort").fire(a)}),e.oncomplete=Te(function(){t.active=!1,t._resolve(),"mutatedParts"in e&&dt.storagemutated.fire(e.mutatedParts)}),this},rt.prototype._promise=function(e,t,n){var o=this;if(e==="readwrite"&&this.mode!=="readwrite")return De(new Z.ReadOnly("Transaction is readonly"));if(!this.active)return De(new Z.TransactionInactive);if(this._locked())return new W(function(c,f){o._blockedFuncs.push([function(){o._promise(e,t,n).then(c,f)},oe])});if(n)return ut(function(){var c=new W(function(f,p){o._lock();var y=t(f,p,o);y&&y.then&&y.then(f,p)});return c.finally(function(){return o._unlock()}),c._lib=!0,c});var a=new W(function(c,f){var p=t(c,f,o);p&&p.then&&p.then(c,f)});return a._lib=!0,a},rt.prototype._root=function(){return this.parent?this.parent._root():this},rt.prototype.waitFor=function(e){var t,n=this._root(),o=W.resolve(e);n._waitingFor?n._waitingFor=n._waitingFor.then(function(){return o}):(n._waitingFor=o,n._waitingQueue=[],t=n.idbtrans.objectStore(n.storeNames[0]),function c(){for(++n._spinCount;n._waitingQueue.length;)n._waitingQueue.shift()();n._waitingFor&&(t.get(-1/0).onsuccess=c)}());var a=n._waitingFor;return new W(function(c,f){o.then(function(p){return n._waitingQueue.push(Te(c.bind(null,p)))},function(p){return n._waitingQueue.push(Te(f.bind(null,p)))}).finally(function(){n._waitingFor===a&&(n._waitingFor=null)})})},rt.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new Z.Abort))},rt.prototype.table=function(e){var t=this._memoizedTables||(this._memoizedTables={});if(M(t,e))return t[e];var n=this.schema[e];if(!n)throw new Z.NotFound("Table "+e+" not part of transaction");return n=new this.db.Table(e,n,this),n.core=this.db.core.table(e),t[e]=n},rt);function rt(){}function Nr(e,t,n,o,a,c,f){return{name:e,keyPath:t,unique:n,multi:o,auto:a,compound:c,src:(n&&!f?"&":"")+(o?"*":"")+(a?"++":"")+ki(t)}}function ki(e){return typeof e=="string"?e:e?"["+[].join.call(e,"+")+"]":""}function Fr(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:(o=function(a){return[a.name,a]},n.reduce(function(a,c,f){return f=o(c,f),f&&(a[f[0]]=f[1]),a},{}))};var o}var on=function(e){try{return e.only([[]]),on=function(){return[[]]},[[]]}catch{return on=function(){return St},St}};function qr(e){return e==null?function(){}:typeof e=="string"?(t=e).split(".").length===1?function(n){return n[t]}:function(n){return te(n,t)}:function(n){return te(n,e)};var t}function Ti(e){return[].slice.call(e)}var cu=0;function sn(e){return e==null?":id":typeof e=="string"?e:"[".concat(e.join("+"),"]")}function lu(e,t,y){function o(b){if(b.type===3)return null;if(b.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var v=b.lower,w=b.upper,x=b.lowerOpen,b=b.upperOpen;return v===void 0?w===void 0?null:t.upperBound(w,!!b):w===void 0?t.lowerBound(v,!!x):t.bound(v,w,!!x,!!b)}function a(O){var v,w=O.name;return{name:w,schema:O,mutate:function(x){var b=x.trans,k=x.type,T=x.keys,R=x.values,D=x.range;return new Promise(function(F,z){F=Te(F);var q=b.objectStore(w),B=q.keyPath==null,V=k==="put"||k==="add";if(!V&&k!=="delete"&&k!=="deleteRange")throw new Error("Invalid operation type: "+k);var Y,X=(T||R||{length:1}).length;if(T&&R&&T.length!==R.length)throw new Error("Given keys array must have same length as given values array.");if(X===0)return F({numFailures:0,failures:{},results:[],lastResult:void 0});function me(Ue){++Ge,nn(Ue)}var ve=[],ge=[],Ge=0;if(k==="deleteRange"){if(D.type===4)return F({numFailures:Ge,failures:ge,results:[],lastResult:void 0});D.type===3?ve.push(Y=q.clear()):ve.push(Y=q.delete(o(D)))}else{var B=V?B?[R,T]:[R,null]:[T,null],he=B[0],Ke=B[1];if(V)for(var Ie=0;Ie<X;++Ie)ve.push(Y=Ke&&Ke[Ie]!==void 0?q[k](he[Ie],Ke[Ie]):q[k](he[Ie])),Y.onerror=me;else for(Ie=0;Ie<X;++Ie)ve.push(Y=q[k](he[Ie])),Y.onerror=me}function ir(Ue){Ue=Ue.target.result,ve.forEach(function(kt,no){return kt.error!=null&&(ge[no]=kt.error)}),F({numFailures:Ge,failures:ge,results:k==="delete"?T:ve.map(function(kt){return kt.result}),lastResult:Ue})}Y.onerror=function(Ue){me(Ue),ir(Ue)},Y.onsuccess=ir})},getMany:function(x){var b=x.trans,k=x.keys;return new Promise(function(T,R){T=Te(T);for(var D,F=b.objectStore(w),z=k.length,q=new Array(z),B=0,V=0,Y=function(ve){ve=ve.target,q[ve._pos]=ve.result,++V===B&&T(q)},X=nt(R),me=0;me<z;++me)k[me]!=null&&((D=F.get(k[me]))._pos=me,D.onsuccess=Y,D.onerror=X,++B);B===0&&T(q)})},get:function(x){var b=x.trans,k=x.key;return new Promise(function(T,R){T=Te(T);var D=b.objectStore(w).get(k);D.onsuccess=function(F){return T(F.target.result)},D.onerror=nt(R)})},query:(v=g,function(x){return new Promise(function(b,k){b=Te(b);var T,R,D,B=x.trans,F=x.values,z=x.limit,Y=x.query,q=z===1/0?void 0:z,V=Y.index,Y=Y.range,B=B.objectStore(w),V=V.isPrimaryKey?B:B.index(V.name),Y=o(Y);if(z===0)return b({result:[]});v?((q=F?V.getAll(Y,q):V.getAllKeys(Y,q)).onsuccess=function(X){return b({result:X.target.result})},q.onerror=nt(k)):(T=0,R=!F&&"openKeyCursor"in V?V.openKeyCursor(Y):V.openCursor(Y),D=[],R.onsuccess=function(X){var me=R.result;return me?(D.push(F?me.value:me.primaryKey),++T===z?b({result:D}):void me.continue()):b({result:D})},R.onerror=nt(k))})}),openCursor:function(x){var b=x.trans,k=x.values,T=x.query,R=x.reverse,D=x.unique;return new Promise(function(F,z){F=Te(F);var V=T.index,q=T.range,B=b.objectStore(w),B=V.isPrimaryKey?B:B.index(V.name),V=R?D?"prevunique":"prev":D?"nextunique":"next",Y=!k&&"openKeyCursor"in B?B.openKeyCursor(o(q),V):B.openCursor(o(q),V);Y.onerror=nt(z),Y.onsuccess=Te(function(X){var me,ve,ge,Ge,he=Y.result;he?(he.___id=++cu,he.done=!1,me=he.continue.bind(he),ve=(ve=he.continuePrimaryKey)&&ve.bind(he),ge=he.advance.bind(he),Ge=function(){throw new Error("Cursor not stopped")},he.trans=b,he.stop=he.continue=he.continuePrimaryKey=he.advance=function(){throw new Error("Cursor not started")},he.fail=Te(z),he.next=function(){var Ke=this,Ie=1;return this.start(function(){return Ie--?Ke.continue():Ke.stop()}).then(function(){return Ke})},he.start=function(Ke){function Ie(){if(Y.result)try{Ke()}catch(Ue){he.fail(Ue)}else he.done=!0,he.start=function(){throw new Error("Cursor behind last entry")},he.stop()}var ir=new Promise(function(Ue,kt){Ue=Te(Ue),Y.onerror=nt(kt),he.fail=kt,he.stop=function(no){he.stop=he.continue=he.continuePrimaryKey=he.advance=Ge,Ue(no)}});return Y.onsuccess=Te(function(Ue){Y.onsuccess=Ie,Ie()}),he.continue=me,he.continuePrimaryKey=ve,he.advance=ge,Ie(),ir},F(he)):F(null)},z)})},count:function(x){var b=x.query,k=x.trans,T=b.index,R=b.range;return new Promise(function(D,F){var z=k.objectStore(w),q=T.isPrimaryKey?z:z.index(T.name),z=o(R),q=z?q.count(z):q.count();q.onsuccess=Te(function(B){return D(B.target.result)}),q.onerror=nt(F)})}}}var c,f,p,_=(f=y,p=Ti((c=e).objectStoreNames),{schema:{name:c.name,tables:p.map(function(O){return f.objectStore(O)}).map(function(O){var v=O.keyPath,b=O.autoIncrement,w=S(v),x={},b={name:O.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:v==null,compound:w,keyPath:v,autoIncrement:b,unique:!0,extractKey:qr(v)},indexes:Ti(O.indexNames).map(function(k){return O.index(k)}).map(function(D){var T=D.name,R=D.unique,F=D.multiEntry,D=D.keyPath,F={name:T,compound:S(D),keyPath:D,unique:R,multiEntry:F,extractKey:qr(D)};return x[sn(D)]=F}),getIndexByKeyPath:function(k){return x[sn(k)]}};return x[":id"]=b.primaryKey,v!=null&&(x[sn(v)]=b.primaryKey),b})},hasGetAll:0<p.length&&"getAll"in f.objectStore(p[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),y=_.schema,g=_.hasGetAll,_=y.tables.map(a),m={};return _.forEach(function(O){return m[O.name]=O}),{stack:"dbcore",transaction:e.transaction.bind(e),table:function(O){if(!m[O])throw new Error("Table '".concat(O,"' not found"));return m[O]},MIN_KEY:-1/0,MAX_KEY:on(t),schema:y}}function fu(e,t,n,o){var a=n.IDBKeyRange;return n.indexedDB,{dbcore:(o=lu(t,a,o),e.dbcore.reduce(function(c,f){return f=f.create,s(s({},c),f(c))},o))}}function Vn(e,o){var n=o.db,o=fu(e._middlewares,n,e._deps,o);e.core=o.dbcore,e.tables.forEach(function(a){var c=a.name;e.core.schema.tables.some(function(f){return f.name===c})&&(a.core=e.core.table(c),e[c]instanceof e.Table&&(e[c].core=a.core))})}function Wn(e,t,n,o){n.forEach(function(a){var c=o[a];t.forEach(function(f){var p=function y(g,_){return E(g,_)||(g=C(g))&&y(g,_)}(f,a);(!p||"value"in p&&p.value===void 0)&&(f===e.Transaction.prototype||f instanceof e.Transaction?N(f,a,{get:function(){return this.table(a)},set:function(y){ue(this,a,{value:y,writable:!0,configurable:!0,enumerable:!0})}}):f[a]=new e.Table(a,c))})})}function Br(e,t){t.forEach(function(n){for(var o in n)n[o]instanceof e.Table&&delete n[o]})}function du(e,t){return e._cfg.version-t._cfg.version}function hu(e,t,n,o){var a=e._dbSchema;n.objectStoreNames.contains("$meta")&&!a.$meta&&(a.$meta=Fr("$meta",Ai("")[0],[]),e._storeNames.push("$meta"));var c=e._createTransaction("readwrite",e._storeNames,a);c.create(n),c._completion.catch(o);var f=c._reject.bind(c),p=oe.transless||oe;ut(function(){return oe.trans=c,oe.transless=p,t!==0?(Vn(e,n),g=t,((y=c).storeNames.includes("$meta")?y.table("$meta").get("version").then(function(_){return _??g}):W.resolve(g)).then(function(_){return O=_,v=c,w=n,x=[],_=(m=e)._versions,b=m._dbSchema=Gn(0,m.idbdb,w),(_=_.filter(function(k){return k._cfg.version>=O})).length!==0?(_.forEach(function(k){x.push(function(){var T=b,R=k._cfg.dbschema;Xn(m,T,w),Xn(m,R,w),b=m._dbSchema=R;var D=Kr(T,R);D.add.forEach(function(V){Ir(w,V[0],V[1].primKey,V[1].indexes)}),D.change.forEach(function(V){if(V.recreate)throw new Z.Upgrade("Not yet support for changing primary key");var Y=w.objectStore(V.name);V.add.forEach(function(X){return Jn(Y,X)}),V.change.forEach(function(X){Y.deleteIndex(X.name),Jn(Y,X)}),V.del.forEach(function(X){return Y.deleteIndex(X)})});var F=k._cfg.contentUpgrade;if(F&&k._cfg.version>O){Vn(m,w),v._memoizedTables={};var z=K(R);D.del.forEach(function(V){z[V]=T[V]}),Br(m,[m.Transaction.prototype]),Wn(m,[m.Transaction.prototype],h(z),z),v.schema=z;var q,B=de(F);return B&&Ct(),D=W.follow(function(){var V;(q=F(v))&&B&&(V=ct.bind(null,null),q.then(V,V))}),q&&typeof q.then=="function"?W.resolve(q):D.then(function(){return q})}}),x.push(function(T){var R,D,F=k._cfg.dbschema;R=F,D=T,[].slice.call(D.db.objectStoreNames).forEach(function(z){return R[z]==null&&D.db.deleteObjectStore(z)}),Br(m,[m.Transaction.prototype]),Wn(m,[m.Transaction.prototype],m._storeNames,m._dbSchema),v.schema=m._dbSchema}),x.push(function(T){m.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(m.idbdb.version/10)===k._cfg.version?(m.idbdb.deleteObjectStore("$meta"),delete m._dbSchema.$meta,m._storeNames=m._storeNames.filter(function(R){return R!=="$meta"})):T.objectStore("$meta").put(k._cfg.version,"version"))})}),function k(){return x.length?W.resolve(x.shift()(v.idbtrans)).then(k):W.resolve()}().then(function(){Ri(b,w)})):W.resolve();var m,O,v,w,x,b}).catch(f)):(h(a).forEach(function(_){Ir(n,_,a[_].primKey,a[_].indexes)}),Vn(e,n),void W.follow(function(){return e.on.populate.fire(c)}).catch(f));var y,g})}function pu(e,t){Ri(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=Gn(0,e.idbdb,t);Xn(e,e._dbSchema,t);for(var o=0,a=Kr(n,e._dbSchema).change;o<a.length;o++){var c=function(f){if(f.change.length||f.recreate)return console.warn("Unable to patch indexes of table ".concat(f.name," because it has changes on the type of index or primary key.")),{value:void 0};var p=t.objectStore(f.name);f.add.forEach(function(y){tt&&console.debug("Dexie upgrade patch: Creating missing index ".concat(f.name,".").concat(y.src)),Jn(p,y)})}(a[o]);if(typeof c=="object")return c.value}}function Kr(e,t){var n,o={del:[],add:[],change:[]};for(n in e)t[n]||o.del.push(n);for(n in t){var a=e[n],c=t[n];if(a){var f={name:n,def:c,recreate:!1,del:[],add:[],change:[]};if(""+(a.primKey.keyPath||"")!=""+(c.primKey.keyPath||"")||a.primKey.auto!==c.primKey.auto)f.recreate=!0,o.change.push(f);else{var p=a.idxByName,y=c.idxByName,g=void 0;for(g in p)y[g]||f.del.push(g);for(g in y){var _=p[g],m=y[g];_?_.src!==m.src&&f.change.push(m):f.add.push(m)}(0<f.del.length||0<f.add.length||0<f.change.length)&&o.change.push(f)}}else o.add.push([n,c])}return o}function Ir(e,t,n,o){var a=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return o.forEach(function(c){return Jn(a,c)}),a}function Ri(e,t){h(e).forEach(function(n){t.db.objectStoreNames.contains(n)||(tt&&console.debug("Dexie: Creating missing table",n),Ir(t,n,e[n].primKey,e[n].indexes))})}function Jn(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function Gn(e,t,n){var o={};return re(t.objectStoreNames,0).forEach(function(a){for(var c=n.objectStore(a),f=Nr(ki(g=c.keyPath),g||"",!0,!1,!!c.autoIncrement,g&&typeof g!="string",!0),p=[],y=0;y<c.indexNames.length;++y){var _=c.index(c.indexNames[y]),g=_.keyPath,_=Nr(_.name,g,!!_.unique,!!_.multiEntry,!1,g&&typeof g!="string",!1);p.push(_)}o[a]=Fr(a,f,p)}),o}function Xn(e,t,n){for(var o=n.db.objectStoreNames,a=0;a<o.length;++a){var c=o[a],f=n.objectStore(c);e._hasGetAll="getAll"in f;for(var p=0;p<f.indexNames.length;++p){var y=f.indexNames[p],g=f.index(y).keyPath,_=typeof g=="string"?g:"["+re(g).join("+")+"]";!t[c]||(g=t[c].idxByName[_])&&(g.name=y,delete t[c].idxByName[_],t[c].idxByName[y]=g)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&d.WorkerGlobalScope&&d instanceof d.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}function Ai(e){return e.split(",").map(function(t,n){var o=(t=t.trim()).replace(/([&*]|\+\+)/g,""),a=/^\[/.test(o)?o.match(/^\[(.*)\]$/)[1].split("+"):o;return Nr(o,a||null,/\&/.test(t),/\*/.test(t),/\+\+/.test(t),S(a),n===0)})}var mu=(Qn.prototype._parseStoresSpec=function(e,t){h(e).forEach(function(n){if(e[n]!==null){var o=Ai(e[n]),a=o.shift();if(a.unique=!0,a.multi)throw new Z.Schema("Primary key cannot be multi-valued");o.forEach(function(c){if(c.auto)throw new Z.Schema("Only primary key can be marked as autoIncrement (++)");if(!c.keyPath)throw new Z.Schema("Index must have a name and cannot be an empty string")}),t[n]=Fr(n,a,o)}})},Qn.prototype.stores=function(n){var t=this.db;this._cfg.storesSource=this._cfg.storesSource?P(this._cfg.storesSource,n):n;var n=t._versions,o={},a={};return n.forEach(function(c){P(o,c._cfg.storesSource),a=c._cfg.dbschema={},c._parseStoresSpec(o,a)}),t._dbSchema=a,Br(t,[t._allTables,t,t.Transaction.prototype]),Wn(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],h(a),a),t._storeNames=h(a),this},Qn.prototype.upgrade=function(e){return this._cfg.contentUpgrade=Cn(this._cfg.contentUpgrade||ye,e),this},Qn);function Qn(){}function Lr(e,t){var n=e._dbNamesDB;return n||(n=e._dbNamesDB=new st(Ln,{addons:[],indexedDB:e,IDBKeyRange:t})).version(1).stores({dbnames:"name"}),n.table("dbnames")}function Ur(e){return e&&typeof e.databases=="function"}function Yr(e){return ut(function(){return oe.letThrough=!0,e()})}function Hr(e){return!("from"in e)}var Be=function(e,t){if(!this){var n=new Be;return e&&"d"in e&&P(n,e),n}P(this,arguments.length?{d:1,from:e,to:1<arguments.length?t:e}:{d:0})};function an(e,t,n){var o=Se(t,n);if(!isNaN(o)){if(0<o)throw RangeError();if(Hr(e))return P(e,{from:t,to:n,d:1});var a=e.l,o=e.r;if(Se(n,e.from)<0)return a?an(a,t,n):e.l={from:t,to:n,d:1,l:null,r:null},Di(e);if(0<Se(t,e.to))return o?an(o,t,n):e.r={from:t,to:n,d:1,l:null,r:null},Di(e);Se(t,e.from)<0&&(e.from=t,e.l=null,e.d=o?o.d+1:1),0<Se(n,e.to)&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1),n=!e.r,a&&!e.l&&un(e,a),o&&n&&un(e,o)}}function un(e,t){Hr(t)||function n(o,y){var c=y.from,f=y.to,p=y.l,y=y.r;an(o,c,f),p&&n(o,p),y&&n(o,y)}(e,t)}function Pi(e,t){var n=Zn(t),o=n.next();if(o.done)return!1;for(var a=o.value,c=Zn(e),f=c.next(a.from),p=f.value;!o.done&&!f.done;){if(Se(p.from,a.to)<=0&&0<=Se(p.to,a.from))return!0;Se(a.from,p.from)<0?a=(o=n.next(p.from)).value:p=(f=c.next(a.from)).value}return!1}function Zn(e){var t=Hr(e)?null:{s:0,n:e};return{next:function(n){for(var o=0<arguments.length;t;)switch(t.s){case 0:if(t.s=1,o)for(;t.n.l&&Se(n,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,!o||Se(n,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 Di(e){var t,n,o=(((t=e.r)===null||t===void 0?void 0:t.d)||0)-(((n=e.l)===null||n===void 0?void 0:n.d)||0),a=1<o?"r":o<-1?"l":"";a&&(t=a=="r"?"l":"r",n=s({},e),o=e[a],e.from=o.from,e.to=o.to,e[a]=o[a],n[a]=o[t],(e[t]=n).d=$i(n)),e.d=$i(e)}function $i(n){var t=n.r,n=n.l;return(t?n?Math.max(t.d,n.d):t.d:n?n.d:0)+1}function er(e,t){return h(t).forEach(function(n){e[n]?un(e[n],t[n]):e[n]=function o(a){var c,f,p={};for(c in a)M(a,c)&&(f=a[c],p[c]=!f||typeof f!="object"||ne.has(f.constructor)?f:o(f));return p}(t[n])}),e}function zr(e,t){return e.all||t.all||Object.keys(e).some(function(n){return t[n]&&Pi(t[n],e[n])})}ae(Be.prototype,((Qe={add:function(e){return un(this,e),this},addKey:function(e){return an(this,e,e),this},addKeys:function(e){var t=this;return e.forEach(function(n){return an(t,n,n)}),this},hasKey:function(e){var t=Zn(this).next(e).value;return t&&Se(t.from,e)<=0&&0<=Se(t.to,e)}})[I]=function(){return Zn(this)},Qe));var Ot={},Vr={},Wr=!1;function tr(e){er(Vr,e),Wr||(Wr=!0,setTimeout(function(){Wr=!1,Jr(Vr,!(Vr={}))},0))}function Jr(e,t){t===void 0&&(t=!1);var n=new Set;if(e.all)for(var o=0,a=Object.values(Ot);o<a.length;o++)Ci(f=a[o],e,n,t);else for(var c in e){var f,p=/^idb\:\/\/(.*)\/(.*)\//.exec(c);p&&(c=p[1],p=p[2],(f=Ot["idb://".concat(c,"/").concat(p)])&&Ci(f,e,n,t))}n.forEach(function(y){return y()})}function Ci(e,t,n,o){for(var a=[],c=0,f=Object.entries(e.queries.query);c<f.length;c++){for(var p=f[c],y=p[0],g=[],_=0,m=p[1];_<m.length;_++){var O=m[_];zr(t,O.obsSet)?O.subscribers.forEach(function(b){return n.add(b)}):o&&g.push(O)}o&&a.push([y,g])}if(o)for(var v=0,w=a;v<w.length;v++){var x=w[v],y=x[0],g=x[1];e.queries.query[y]=g}}function yu(e){var t=e._state,n=e._deps.indexedDB;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then(function(){return t.dbOpenError?De(t.dbOpenError):e});t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;var o=t.openCanceller,a=Math.round(10*e.verno),c=!1;function f(){if(t.openCanceller!==o)throw new Z.DatabaseClosed("db.open() was cancelled")}function p(){return new W(function(O,v){if(f(),!n)throw new Z.MissingAPI;var w=e.name,x=t.autoSchema||!a?n.open(w):n.open(w,a);if(!x)throw new Z.MissingAPI;x.onerror=nt(v),x.onblocked=Te(e._fireOnBlocked),x.onupgradeneeded=Te(function(b){var k;_=x.transaction,t.autoSchema&&!e._options.allowEmptyDB?(x.onerror=nn,_.abort(),x.result.close(),(k=n.deleteDatabase(w)).onsuccess=k.onerror=Te(function(){v(new Z.NoSuchDatabase("Database ".concat(w," doesnt exist")))})):(_.onerror=nt(v),b=b.oldVersion>Math.pow(2,62)?0:b.oldVersion,m=b<1,e.idbdb=x.result,c&&pu(e,_),hu(e,b/10,_,v))},v),x.onsuccess=Te(function(){_=null;var b,k,T,R,D,F=e.idbdb=x.result,z=re(F.objectStoreNames);if(0<z.length)try{var q=F.transaction((R=z).length===1?R[0]:R,"readonly");if(t.autoSchema)k=F,T=q,(b=e).verno=k.version/10,T=b._dbSchema=Gn(0,k,T),b._storeNames=re(k.objectStoreNames,0),Wn(b,[b._allTables],h(T),T);else if(Xn(e,e._dbSchema,q),((D=Kr(Gn(0,(D=e).idbdb,q),D._dbSchema)).add.length||D.change.some(function(B){return B.add.length||B.change.length}))&&!c)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."),F.close(),a=F.version+1,c=!0,O(p());Vn(e,q)}catch{}jt.push(e),F.onversionchange=Te(function(B){t.vcFired=!0,e.on("versionchange").fire(B)}),F.onclose=Te(function(B){e.on("close").fire(B)}),m&&(D=e._deps,q=w,F=D.indexedDB,D=D.IDBKeyRange,Ur(F)||q===Ln||Lr(F,D).put({name:q}).catch(ye)),O()},v)}).catch(function(O){switch(O==null?void 0:O.name){case"UnknownError":if(0<t.PR1398_maxLoop)return t.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),p();break;case"VersionError":if(0<a)return a=0,p()}return W.reject(O)})}var y,g=t.dbReadyResolve,_=null,m=!1;return W.race([o,(typeof navigator>"u"?W.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(O){function v(){return indexedDB.databases().finally(O)}y=setInterval(v,100),v()}).finally(function(){return clearInterval(y)}):Promise.resolve()).then(p)]).then(function(){return f(),t.onReadyBeingFired=[],W.resolve(Yr(function(){return e.on.ready.fire(e.vip)})).then(function O(){if(0<t.onReadyBeingFired.length){var v=t.onReadyBeingFired.reduce(Cn,ye);return t.onReadyBeingFired=[],W.resolve(Yr(function(){return v(e.vip)})).then(O)}})}).finally(function(){t.openCanceller===o&&(t.onReadyBeingFired=null,t.isBeingOpened=!1)}).catch(function(O){t.dbOpenError=O;try{_&&_.abort()}catch{}return o===t.openCanceller&&e._close(),De(O)}).finally(function(){t.openComplete=!0,g()}).then(function(){var O;return m&&(O={},e.tables.forEach(function(v){v.schema.indexes.forEach(function(w){w.name&&(O["idb://".concat(e.name,"/").concat(v.name,"/").concat(w.name)]=new Be(-1/0,[[[]]]))}),O["idb://".concat(e.name,"/").concat(v.name,"/")]=O["idb://".concat(e.name,"/").concat(v.name,"/:dels")]=new Be(-1/0,[[[]]])}),dt(rn).fire(O),Jr(O,!0)),e})}function Gr(e){function t(c){return e.next(c)}var n=a(t),o=a(function(c){return e.throw(c)});function a(c){return function(y){var p=c(y),y=p.value;return p.done?y:y&&typeof y.then=="function"?y.then(n,o):S(y)?Promise.all(y).then(n,o):n(y)}}return a(t)()}function nr(e,t,n){for(var o=S(e)?e.slice():[e],a=0;a<n;++a)o.push(t);return o}var vu={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return s(s({},e),{table:function(t){var n=e.table(t),o=n.schema,a={},c=[];function f(m,O,v){var w=sn(m),x=a[w]=a[w]||[],b=m==null?0:typeof m=="string"?1:m.length,k=0<O,k=s(s({},v),{name:k?"".concat(w,"(virtual-from:").concat(v.name,")"):v.name,lowLevelIndex:v,isVirtual:k,keyTail:O,keyLength:b,extractKey:qr(m),unique:!k&&v.unique});return x.push(k),k.isPrimaryKey||c.push(k),1<b&&f(b===2?m[0]:m.slice(0,b-1),O+1,v),x.sort(function(T,R){return T.keyTail-R.keyTail}),k}t=f(o.primaryKey.keyPath,0,o.primaryKey),a[":id"]=[t];for(var p=0,y=o.indexes;p<y.length;p++){var g=y[p];f(g.keyPath,0,g)}function _(m){var O,v=m.query.index;return v.isVirtual?s(s({},m),{query:{index:v.lowLevelIndex,range:(O=m.query.range,v=v.keyTail,{type:O.type===1?2:O.type,lower:nr(O.lower,O.lowerOpen?e.MAX_KEY:e.MIN_KEY,v),lowerOpen:!0,upper:nr(O.upper,O.upperOpen?e.MIN_KEY:e.MAX_KEY,v),upperOpen:!0})}}):m}return s(s({},n),{schema:s(s({},o),{primaryKey:t,indexes:c,getIndexByKeyPath:function(m){return(m=a[sn(m)])&&m[0]}}),count:function(m){return n.count(_(m))},query:function(m){return n.query(_(m))},openCursor:function(m){var O=m.query.index,v=O.keyTail,w=O.isVirtual,x=O.keyLength;return w?n.openCursor(_(m)).then(function(k){return k&&b(k)}):n.openCursor(m);function b(k){return Object.create(k,{continue:{value:function(T){T!=null?k.continue(nr(T,m.reverse?e.MAX_KEY:e.MIN_KEY,v)):m.unique?k.continue(k.key.slice(0,x).concat(m.reverse?e.MIN_KEY:e.MAX_KEY,v)):k.continue()}},continuePrimaryKey:{value:function(T,R){k.continuePrimaryKey(nr(T,e.MAX_KEY,v),R)}},primaryKey:{get:function(){return k.primaryKey}},key:{get:function(){var T=k.key;return x===1?T[0]:T.slice(0,x)}},value:{get:function(){return k.value}}})}}})}})}};function Xr(e,t,n,o){return n=n||{},o=o||"",h(e).forEach(function(a){var c,f,p;M(t,a)?(c=e[a],f=t[a],typeof c=="object"&&typeof f=="object"&&c&&f?(p=H(c))!==H(f)?n[o+a]=t[a]:p==="Object"?Xr(c,f,n,o+a+"."):c!==f&&(n[o+a]=t[a]):c!==f&&(n[o+a]=t[a])):n[o+a]=void 0}),h(t).forEach(function(a){M(e,a)||(n[o+a]=t[a])}),n}function Qr(e,t){return t.type==="delete"?t.keys:t.keys||t.values.map(e.extractKey)}var gu={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(e){return s(s({},e),{table:function(t){var n=e.table(t),o=n.schema.primaryKey;return s(s({},n),{mutate:function(a){var c=oe.trans,f=c.table(t).hook,p=f.deleting,y=f.creating,g=f.updating;switch(a.type){case"add":if(y.fire===ye)break;return c._promise("readwrite",function(){return _(a)},!0);case"put":if(y.fire===ye&&g.fire===ye)break;return c._promise("readwrite",function(){return _(a)},!0);case"delete":if(p.fire===ye)break;return c._promise("readwrite",function(){return _(a)},!0);case"deleteRange":if(p.fire===ye)break;return c._promise("readwrite",function(){return function m(O,v,w){return n.query({trans:O,values:!1,query:{index:o,range:v},limit:w}).then(function(x){var b=x.result;return _({type:"delete",keys:b,trans:O}).then(function(k){return 0<k.numFailures?Promise.reject(k.failures[0]):b.length<w?{failures:[],numFailures:0,lastResult:void 0}:m(O,s(s({},v),{lower:b[b.length-1],lowerOpen:!0}),w)})})}(a.trans,a.range,1e4)},!0)}return n.mutate(a);function _(m){var O,v,w,x=oe.trans,b=m.keys||Qr(o,m);if(!b)throw new Error("Keys missing");return(m=m.type==="add"||m.type==="put"?s(s({},m),{keys:b}):s({},m)).type!=="delete"&&(m.values=l([],m.values)),m.keys&&(m.keys=l([],m.keys)),O=n,w=b,((v=m).type==="add"?Promise.resolve([]):O.getMany({trans:v.trans,keys:w,cache:"immutable"})).then(function(k){var T=b.map(function(R,D){var F,z,q,B=k[D],V={onerror:null,onsuccess:null};return m.type==="delete"?p.fire.call(V,R,B,x):m.type==="add"||B===void 0?(F=y.fire.call(V,R,m.values[D],x),R==null&&F!=null&&(m.keys[D]=R=F,o.outbound||U(m.values[D],o.keyPath,R))):(F=Xr(B,m.values[D]),(z=g.fire.call(V,F,R,B,x))&&(q=m.values[D],Object.keys(z).forEach(function(Y){M(q,Y)?q[Y]=z[Y]:U(q,Y,z[Y])}))),V});return n.mutate(m).then(function(R){for(var D=R.failures,F=R.results,z=R.numFailures,R=R.lastResult,q=0;q<b.length;++q){var B=(F||b)[q],V=T[q];B==null?V.onerror&&V.onerror(D[q]):V.onsuccess&&V.onsuccess(m.type==="put"&&k[q]?m.values[q]:B)}return{failures:D,results:F,numFailures:z,lastResult:R}}).catch(function(R){return T.forEach(function(D){return D.onerror&&D.onerror(R)}),Promise.reject(R)})})}}})}})}};function ji(e,t,n){try{if(!t||t.keys.length<e.length)return null;for(var o=[],a=0,c=0;a<t.keys.length&&c<e.length;++a)Se(t.keys[a],e[c])===0&&(o.push(n?we(t.values[a]):t.values[a]),++c);return o.length===e.length?o:null}catch{return null}}var bu={stack:"dbcore",level:-1,create:function(e){return{table:function(t){var n=e.table(t);return s(s({},n),{getMany:function(o){if(!o.cache)return n.getMany(o);var a=ji(o.keys,o.trans._cache,o.cache==="clone");return a?W.resolve(a):n.getMany(o).then(function(c){return o.trans._cache={keys:o.keys,values:o.cache==="clone"?we(c):c},c})},mutate:function(o){return o.type!=="add"&&(o.trans._cache=null),n.mutate(o)}})}}}};function Mi(e,t){return e.trans.mode==="readonly"&&!!e.subscr&&!e.trans.explicit&&e.trans.db._options.cache!=="disabled"&&!t.schema.primaryKey.outbound}function Ni(e,t){switch(e){case"query":return t.values&&!t.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var wu={stack:"dbcore",level:0,name:"Observability",create:function(e){var t=e.schema.name,n=new Be(e.MIN_KEY,e.MAX_KEY);return s(s({},e),{transaction:function(o,a,c){if(oe.subscr&&a!=="readonly")throw new Z.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(oe.querier));return e.transaction(o,a,c)},table:function(o){var a=e.table(o),c=a.schema,f=c.primaryKey,m=c.indexes,p=f.extractKey,y=f.outbound,g=f.autoIncrement&&m.filter(function(v){return v.compound&&v.keyPath.includes(f.keyPath)}),_=s(s({},a),{mutate:function(v){function w(Y){return Y="idb://".concat(t,"/").concat(o,"/").concat(Y),R[Y]||(R[Y]=new Be)}var x,b,k,T=v.trans,R=v.mutatedParts||(v.mutatedParts={}),D=w(""),F=w(":dels"),z=v.type,V=v.type==="deleteRange"?[v.range]:v.type==="delete"?[v.keys]:v.values.length<50?[Qr(f,v).filter(function(Y){return Y}),v.values]:[],q=V[0],B=V[1],V=v.trans._cache;return S(q)?(D.addKeys(q),(V=z==="delete"||q.length===B.length?ji(q,V):null)||F.addKeys(q),(V||B)&&(x=w,b=V,k=B,c.indexes.forEach(function(Y){var X=x(Y.name||"");function me(ge){return ge!=null?Y.extractKey(ge):null}function ve(ge){return Y.multiEntry&&S(ge)?ge.forEach(function(Ge){return X.addKey(Ge)}):X.addKey(ge)}(b||k).forEach(function(ge,Ke){var he=b&&me(b[Ke]),Ke=k&&me(k[Ke]);Se(he,Ke)!==0&&(he!=null&&ve(he),Ke!=null&&ve(Ke))})}))):q?(B={from:(B=q.lower)!==null&&B!==void 0?B:e.MIN_KEY,to:(B=q.upper)!==null&&B!==void 0?B:e.MAX_KEY},F.add(B),D.add(B)):(D.add(n),F.add(n),c.indexes.forEach(function(Y){return w(Y.name).add(n)})),a.mutate(v).then(function(Y){return!q||v.type!=="add"&&v.type!=="put"||(D.addKeys(Y.results),g&&g.forEach(function(X){for(var me=v.values.map(function(he){return X.extractKey(he)}),ve=X.keyPath.findIndex(function(he){return he===f.keyPath}),ge=0,Ge=Y.results.length;ge<Ge;++ge)me[ge][ve]=Y.results[ge];w(X.name).addKeys(me)})),T.mutatedParts=er(T.mutatedParts||{},R),Y})}}),m=function(w){var x=w.query,w=x.index,x=x.range;return[w,new Be((w=x.lower)!==null&&w!==void 0?w:e.MIN_KEY,(x=x.upper)!==null&&x!==void 0?x:e.MAX_KEY)]},O={get:function(v){return[f,new Be(v.key)]},getMany:function(v){return[f,new Be().addKeys(v.keys)]},count:m,query:m,openCursor:m};return h(O).forEach(function(v){_[v]=function(w){var x=oe.subscr,b=!!x,k=Mi(oe,a)&&Ni(v,w)?w.obsSet={}:x;if(b){var T=function(B){return B="idb://".concat(t,"/").concat(o,"/").concat(B),k[B]||(k[B]=new Be)},R=T(""),D=T(":dels"),x=O[v](w),b=x[0],x=x[1];if((v==="query"&&b.isPrimaryKey&&!w.values?D:T(b.name||"")).add(x),!b.isPrimaryKey){if(v!=="count"){var F=v==="query"&&y&&w.values&&a.query(s(s({},w),{values:!1}));return a[v].apply(this,arguments).then(function(B){if(v==="query"){if(y&&w.values)return F.then(function(me){return me=me.result,R.addKeys(me),B});var V=w.values?B.result.map(p):B.result;(w.values?R:D).addKeys(V)}else if(v==="openCursor"){var Y=B,X=w.values;return Y&&Object.create(Y,{key:{get:function(){return D.addKey(Y.primaryKey),Y.key}},primaryKey:{get:function(){var me=Y.primaryKey;return D.addKey(me),me}},value:{get:function(){return X&&R.addKey(Y.primaryKey),Y.value}}})}return B})}D.add(n)}}return a[v].apply(this,arguments)}}),_}})}};function Fi(e,t,n){if(n.numFailures===0)return t;if(t.type==="deleteRange")return null;var o=t.keys?t.keys.length:"values"in t&&t.values?t.values.length:1;return n.numFailures===o?null:(t=s({},t),S(t.keys)&&(t.keys=t.keys.filter(function(a,c){return!(c in n.failures)})),"values"in t&&S(t.values)&&(t.values=t.values.filter(function(a,c){return!(c in n.failures)})),t)}function Zr(e,t){return n=e,((o=t).lower===void 0||(o.lowerOpen?0<Se(n,o.lower):0<=Se(n,o.lower)))&&(e=e,(t=t).upper===void 0||(t.upperOpen?Se(e,t.upper)<0:Se(e,t.upper)<=0));var n,o}function qi(e,t,O,o,a,c){if(!O||O.length===0)return e;var f=t.query.index,p=f.multiEntry,y=t.query.range,g=o.schema.primaryKey.extractKey,_=f.extractKey,m=(f.lowLevelIndex||f).extractKey,O=O.reduce(function(v,w){var x=v,b=[];if(w.type==="add"||w.type==="put")for(var k=new Be,T=w.values.length-1;0<=T;--T){var R,D=w.values[T],F=g(D);k.hasKey(F)||(R=_(D),(p&&S(R)?R.some(function(Y){return Zr(Y,y)}):Zr(R,y))&&(k.addKey(F),b.push(D)))}switch(w.type){case"add":var z=new Be().addKeys(t.values?v.map(function(X){return g(X)}):v),x=v.concat(t.values?b.filter(function(X){return X=g(X),!z.hasKey(X)&&(z.addKey(X),!0)}):b.map(function(X){return g(X)}).filter(function(X){return!z.hasKey(X)&&(z.addKey(X),!0)}));break;case"put":var q=new Be().addKeys(w.values.map(function(X){return g(X)}));x=v.filter(function(X){return!q.hasKey(t.values?g(X):X)}).concat(t.values?b:b.map(function(X){return g(X)}));break;case"delete":var B=new Be().addKeys(w.keys);x=v.filter(function(X){return!B.hasKey(t.values?g(X):X)});break;case"deleteRange":var V=w.range;x=v.filter(function(X){return!Zr(g(X),V)})}return x},e);return O===e?e:(O.sort(function(v,w){return Se(m(v),m(w))||Se(g(v),g(w))}),t.limit&&t.limit<1/0&&(O.length>t.limit?O.length=t.limit:e.length===t.limit&&O.length<t.limit&&(a.dirty=!0)),c?Object.freeze(O):O)}function Bi(e,t){return Se(e.lower,t.lower)===0&&Se(e.upper,t.upper)===0&&!!e.lowerOpen==!!t.lowerOpen&&!!e.upperOpen==!!t.upperOpen}function _u(e,t){return function(n,o,a,c){if(n===void 0)return o!==void 0?-1:0;if(o===void 0)return 1;if((o=Se(n,o))===0){if(a&&c)return 0;if(a)return 1;if(c)return-1}return o}(e.lower,t.lower,e.lowerOpen,t.lowerOpen)<=0&&0<=function(n,o,a,c){if(n===void 0)return o!==void 0?1:0;if(o===void 0)return-1;if((o=Se(n,o))===0){if(a&&c)return 0;if(a)return-1;if(c)return 1}return o}(e.upper,t.upper,e.upperOpen,t.upperOpen)}function Su(e,t,n,o){e.subscribers.add(n),o.addEventListener("abort",function(){var a,c;e.subscribers.delete(n),e.subscribers.size===0&&(a=e,c=t,setTimeout(function(){a.subscribers.size===0&&L(c,a)},3e3))})}var xu={stack:"dbcore",level:0,name:"Cache",create:function(e){var t=e.schema.name;return s(s({},e),{transaction:function(n,o,a){var c,f,p=e.transaction(n,o,a);return o==="readwrite"&&(f=(c=new AbortController).signal,a=function(y){return function(){if(c.abort(),o==="readwrite"){for(var g=new Set,_=0,m=n;_<m.length;_++){var O=m[_],v=Ot["idb://".concat(t,"/").concat(O)];if(v){var w=e.table(O),x=v.optimisticOps.filter(function(X){return X.trans===p});if(p._explicit&&y&&p.mutatedParts)for(var b=0,k=Object.values(v.queries.query);b<k.length;b++)for(var T=0,R=(z=k[b]).slice();T<R.length;T++)zr((q=R[T]).obsSet,p.mutatedParts)&&(L(z,q),q.subscribers.forEach(function(X){return g.add(X)}));else if(0<x.length){v.optimisticOps=v.optimisticOps.filter(function(X){return X.trans!==p});for(var D=0,F=Object.values(v.queries.query);D<F.length;D++)for(var z,q,B,V=0,Y=(z=F[D]).slice();V<Y.length;V++)(q=Y[V]).res!=null&&p.mutatedParts&&(y&&!q.dirty?(B=Object.isFrozen(q.res),B=qi(q.res,q.req,x,w,q,B),q.dirty?(L(z,q),q.subscribers.forEach(function(X){return g.add(X)})):B!==q.res&&(q.res=B,q.promise=W.resolve({result:B}))):(q.dirty&&L(z,q),q.subscribers.forEach(function(X){return g.add(X)})))}}}g.forEach(function(X){return X()})}}},p.addEventListener("abort",a(!1),{signal:f}),p.addEventListener("error",a(!1),{signal:f}),p.addEventListener("complete",a(!0),{signal:f})),p},table:function(n){var o=e.table(n),a=o.schema.primaryKey;return s(s({},o),{mutate:function(c){var f=oe.trans;if(a.outbound||f.db._options.cache==="disabled"||f.explicit||f.idbtrans.mode!=="readwrite")return o.mutate(c);var p=Ot["idb://".concat(t,"/").concat(n)];return p?(f=o.mutate(c),c.type!=="add"&&c.type!=="put"||!(50<=c.values.length||Qr(a,c).some(function(y){return y==null}))?(p.optimisticOps.push(c),c.mutatedParts&&tr(c.mutatedParts),f.then(function(y){0<y.numFailures&&(L(p.optimisticOps,c),(y=Fi(0,c,y))&&p.optimisticOps.push(y),c.mutatedParts&&tr(c.mutatedParts))}),f.catch(function(){L(p.optimisticOps,c),c.mutatedParts&&tr(c.mutatedParts)})):f.then(function(y){var g=Fi(0,s(s({},c),{values:c.values.map(function(_,m){var O;return y.failures[m]?_:(_=(O=a.keyPath)!==null&&O!==void 0&&O.includes(".")?we(_):s({},_),U(_,a.keyPath,y.results[m]),_)})}),y);p.optimisticOps.push(g),queueMicrotask(function(){return c.mutatedParts&&tr(c.mutatedParts)})}),f):o.mutate(c)},query:function(c){if(!Mi(oe,o)||!Ni("query",c))return o.query(c);var f=((g=oe.trans)===null||g===void 0?void 0:g.db._options.cache)==="immutable",m=oe,p=m.requery,y=m.signal,g=function(w,x,b,k){var T=Ot["idb://".concat(w,"/").concat(x)];if(!T)return[];if(!(x=T.queries[b]))return[null,!1,T,null];var R=x[(k.query?k.query.index.name:null)||""];if(!R)return[null,!1,T,null];switch(b){case"query":var D=R.find(function(F){return F.req.limit===k.limit&&F.req.values===k.values&&Bi(F.req.query.range,k.query.range)});return D?[D,!0,T,R]:[R.find(function(F){return("limit"in F.req?F.req.limit:1/0)>=k.limit&&(!k.values||F.req.values)&&_u(F.req.query.range,k.query.range)}),!1,T,R];case"count":return D=R.find(function(F){return Bi(F.req.query.range,k.query.range)}),[D,!!D,T,R]}}(t,n,"query",c),_=g[0],m=g[1],O=g[2],v=g[3];return _&&m?_.obsSet=c.obsSet:(m=o.query(c).then(function(w){var x=w.result;if(_&&(_.res=x),f){for(var b=0,k=x.length;b<k;++b)Object.freeze(x[b]);Object.freeze(x)}else w.result=we(x);return w}).catch(function(w){return v&&_&&L(v,_),Promise.reject(w)}),_={obsSet:c.obsSet,promise:m,subscribers:new Set,type:"query",req:c,dirty:!1},v?v.push(_):(v=[_],(O=O||(Ot["idb://".concat(t,"/").concat(n)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[c.query.index.name||""]=v)),Su(_,v,p,y),_.promise.then(function(w){return{result:qi(w.result,c,O==null?void 0:O.optimisticOps,o,_,f)}})}})}})}};function rr(e,t){return new Proxy(e,{get:function(n,o,a){return o==="db"?t:Reflect.get(n,o,a)}})}var st=($e.prototype.version=function(e){if(isNaN(e)||e<.1)throw new Z.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new Z.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);var t=this._versions,n=t.filter(function(o){return o._cfg.version===e})[0];return n||(n=new this.Version(e),t.push(n),t.sort(du),n.stores({}),this._state.autoSchema=!1,n)},$e.prototype._whenReady=function(e){var t=this;return this.idbdb&&(this._state.openComplete||oe.letThrough||this._vip)?e():new W(function(n,o){if(t._state.openComplete)return o(new Z.DatabaseClosed(t._state.dbOpenError));if(!t._state.isBeingOpened){if(!t._state.autoOpen)return void o(new Z.DatabaseClosed);t.open().catch(ye)}t._state.dbReadyPromise.then(n,o)}).then(e)},$e.prototype.use=function(e){var t=e.stack,n=e.create,o=e.level,a=e.name;return a&&this.unuse({stack:t,name:a}),e=this._middlewares[t]||(this._middlewares[t]=[]),e.push({stack:t,create:n,level:o??10,name:a}),e.sort(function(c,f){return c.level-f.level}),this},$e.prototype.unuse=function(e){var t=e.stack,n=e.name,o=e.create;return t&&this._middlewares[t]&&(this._middlewares[t]=this._middlewares[t].filter(function(a){return o?a.create!==o:!!n&&a.name!==n})),this},$e.prototype.open=function(){var e=this;return _t(at,function(){return yu(e)})},$e.prototype._close=function(){var e=this._state,t=jt.indexOf(this);if(0<=t&&jt.splice(t,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}e.isBeingOpened||(e.dbReadyPromise=new W(function(n){e.dbReadyResolve=n}),e.openCanceller=new W(function(n,o){e.cancelOpen=o}))},$e.prototype.close=function(n){var t=(n===void 0?{disableAutoOpen:!0}:n).disableAutoOpen,n=this._state;t?(n.isBeingOpened&&n.cancelOpen(new Z.DatabaseClosed),this._close(),n.autoOpen=!1,n.dbOpenError=new Z.DatabaseClosed):(this._close(),n.autoOpen=this._options.autoOpen||n.isBeingOpened,n.openComplete=!1,n.dbOpenError=null)},$e.prototype.delete=function(e){var t=this;e===void 0&&(e={disableAutoOpen:!0});var n=0<arguments.length&&typeof arguments[0]!="object",o=this._state;return new W(function(a,c){function f(){t.close(e);var p=t._deps.indexedDB.deleteDatabase(t.name);p.onsuccess=Te(function(){var y,g,_;y=t._deps,g=t.name,_=y.indexedDB,y=y.IDBKeyRange,Ur(_)||g===Ln||Lr(_,y).delete(g).catch(ye),a()}),p.onerror=nt(c),p.onblocked=t._fireOnBlocked}if(n)throw new Z.InvalidArgument("Invalid closeOptions argument to db.delete()");o.isBeingOpened?o.dbReadyPromise.then(f):f()})},$e.prototype.backendDB=function(){return this.idbdb},$e.prototype.isOpen=function(){return this.idbdb!==null},$e.prototype.hasBeenClosed=function(){var e=this._state.dbOpenError;return e&&e.name==="DatabaseClosed"},$e.prototype.hasFailed=function(){return this._state.dbOpenError!==null},$e.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty($e.prototype,"tables",{get:function(){var e=this;return h(this._allTables).map(function(t){return e._allTables[t]})},enumerable:!1,configurable:!0}),$e.prototype.transaction=function(){var e=(function(t,n,o){var a=arguments.length;if(a<2)throw new Z.InvalidArgument("Too few arguments");for(var c=new Array(a-1);--a;)c[a-1]=arguments[a];return o=c.pop(),[t,le(c),o]}).apply(this,arguments);return this._transaction.apply(this,e)},$e.prototype._transaction=function(e,t,n){var o=this,a=oe.trans;a&&a.db===this&&e.indexOf("!")===-1||(a=null);var c,f,p=e.indexOf("?")!==-1;e=e.replace("!","").replace("?","");try{if(f=t.map(function(g){if(g=g instanceof o.Table?g.name:g,typeof g!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return g}),e=="r"||e===Pr)c=Pr;else{if(e!="rw"&&e!=Dr)throw new Z.InvalidArgument("Invalid transaction mode: "+e);c=Dr}if(a){if(a.mode===Pr&&c===Dr){if(!p)throw new Z.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");a=null}a&&f.forEach(function(g){if(a&&a.storeNames.indexOf(g)===-1){if(!p)throw new Z.SubTransaction("Table "+g+" not included in parent transaction.");a=null}}),p&&a&&!a.active&&(a=null)}}catch(g){return a?a._promise(null,function(_,m){m(g)}):De(g)}var y=(function g(_,m,O,v,w){return W.resolve().then(function(){var x=oe.transless||oe,b=_._createTransaction(m,O,_._dbSchema,v);if(b.explicit=!0,x={trans:b,transless:x},v)b.idbtrans=v.idbtrans;else try{b.create(),b.idbtrans._explicit=!0,_._state.PR1398_maxLoop=3}catch(R){return R.name===We.InvalidState&&_.isOpen()&&0<--_._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),_.close({disableAutoOpen:!1}),_.open().then(function(){return g(_,m,O,null,w)})):De(R)}var k,T=de(w);return T&&Ct(),x=W.follow(function(){var R;(k=w.call(b,b))&&(T?(R=ct.bind(null,null),k.then(R,R)):typeof k.next=="function"&&typeof k.throw=="function"&&(k=Gr(k)))},x),(k&&typeof k.then=="function"?W.resolve(k).then(function(R){return b.active?R:De(new Z.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):x.then(function(){return k})).then(function(R){return v&&b._resolve(),b._completion.then(function(){return R})}).catch(function(R){return b._reject(R),De(R)})})}).bind(null,this,c,f,a,n);return a?a._promise(c,y,"lock"):oe.trans?_t(oe.transless,function(){return o._whenReady(y)}):this._whenReady(y)},$e.prototype.table=function(e){if(!M(this._allTables,e))throw new Z.InvalidTable("Table ".concat(e," does not exist"));return this._allTables[e]},$e);function $e(e,t){var n=this;this._middlewares={},this.verno=0;var o=$e.dependencies;this._options=t=s({addons:$e.addons,autoOpen:!0,indexedDB:o.indexedDB,IDBKeyRange:o.IDBKeyRange,cache:"cloned"},t),this._deps={indexedDB:t.indexedDB,IDBKeyRange:t.IDBKeyRange},o=t.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var a,c,f,p,y,g={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:ye,dbReadyPromise:null,cancelOpen:ye,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:t.autoOpen};g.dbReadyPromise=new W(function(m){g.dbReadyResolve=m}),g.openCanceller=new W(function(m,O){g.cancelOpen=O}),this._state=g,this.name=e,this.on=Zt(this,"populate","blocked","versionchange","close",{ready:[Cn,ye]}),this.on.ready.subscribe=G(this.on.ready.subscribe,function(m){return function(O,v){$e.vip(function(){var w,x=n._state;x.openComplete?(x.dbOpenError||W.resolve().then(O),v&&m(O)):x.onReadyBeingFired?(x.onReadyBeingFired.push(O),v&&m(O)):(m(O),w=n,v||m(function b(){w.on.ready.unsubscribe(O),w.on.ready.unsubscribe(b)}))})}}),this.Collection=(a=this,en(iu.prototype,function(k,b){this.db=a;var v=yi,w=null;if(b)try{v=b()}catch(T){w=T}var x=k._ctx,b=x.table,k=b.hook.reading.fire;this._ctx={table:b,index:x.index,isPrimKey:!x.index||b.schema.primKey.keyPath&&x.index===b.schema.primKey.name,range:v,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:w,or:x.or,valueMapper:k!==ze?k:null}})),this.Table=(c=this,en(wi.prototype,function(m,O,v){this.db=c,this._tx=v,this.name=m,this.schema=O,this.hook=c._allTables[m]?c._allTables[m].hook:Zt(null,{creating:[Ht,ye],reading:[Pt,ze],updating:[Vt,ye],deleting:[zt,ye]})})),this.Transaction=(f=this,en(uu.prototype,function(m,O,v,w,x){var b=this;this.db=f,this.mode=m,this.storeNames=O,this.schema=v,this.chromeTransactionDurability=w,this.idbtrans=null,this.on=Zt(this,"complete","error","abort"),this.parent=x||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 W(function(k,T){b._resolve=k,b._reject=T}),this._completion.then(function(){b.active=!1,b.on.complete.fire()},function(k){var T=b.active;return b.active=!1,b.on.error.fire(k),b.parent?b.parent._reject(k):T&&b.idbtrans&&b.idbtrans.abort(),De(k)})})),this.Version=(p=this,en(mu.prototype,function(m){this.db=p,this._cfg={version:m,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(y=this,en(Ei.prototype,function(m,O,v){if(this.db=y,this._ctx={table:m,index:O===":id"?null:O,or:v},this._cmp=this._ascending=Se,this._descending=function(w,x){return Se(x,w)},this._max=function(w,x){return 0<Se(w,x)?w:x},this._min=function(w,x){return Se(w,x)<0?w:x},this._IDBKeyRange=y._deps.IDBKeyRange,!this._IDBKeyRange)throw new Z.MissingAPI})),this.on("versionchange",function(m){0<m.newVersion?console.warn("Another connection wants to upgrade database '".concat(n.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(n.name,"'. Closing db now to resume the delete request.")),n.close({disableAutoOpen:!1})}),this.on("blocked",function(m){!m.newVersion||m.newVersion<m.oldVersion?console.warn("Dexie.delete('".concat(n.name,"') was blocked")):console.warn("Upgrade '".concat(n.name,"' blocked by other connection holding version ").concat(m.oldVersion/10))}),this._maxKey=on(t.IDBKeyRange),this._createTransaction=function(m,O,v,w){return new n.Transaction(m,O,v,n._options.chromeTransactionDurability,w)},this._fireOnBlocked=function(m){n.on("blocked").fire(m),jt.filter(function(O){return O.name===n.name&&O!==n&&!O._state.vcFired}).map(function(O){return O.on("versionchange").fire(m)})},this.use(bu),this.use(xu),this.use(wu),this.use(vu),this.use(gu);var _=new Proxy(this,{get:function(m,O,v){if(O==="_vip")return!0;if(O==="table")return function(x){return rr(n.table(x),_)};var w=Reflect.get(m,O,v);return w instanceof wi?rr(w,_):O==="tables"?w.map(function(x){return rr(x,_)}):O==="_createTransaction"?function(){return rr(w.apply(this,arguments),_)}:w}});this.vip=_,o.forEach(function(m){return m(n)})}var or,Qe=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Ou=(eo.prototype.subscribe=function(e,t,n){return this._subscribe(e&&typeof e!="function"?e:{next:e,error:t,complete:n})},eo.prototype[Qe]=function(){return this},eo);function eo(e){this._subscribe=e}try{or={indexedDB:d.indexedDB||d.mozIndexedDB||d.webkitIndexedDB||d.msIndexedDB,IDBKeyRange:d.IDBKeyRange||d.webkitIDBKeyRange}}catch{or={indexedDB:null,IDBKeyRange:null}}function Ki(e){var t,n=!1,o=new Ou(function(a){var c=de(e),f,p=!1,y={},g={},_={get closed(){return p},unsubscribe:function(){p||(p=!0,f&&f.abort(),m&&dt.storagemutated.unsubscribe(v))}};a.start&&a.start(_);var m=!1,O=function(){return Ar(w)},v=function(x){er(y,x),zr(g,y)&&O()},w=function(){var x,b,k;!p&&or.indexedDB&&(y={},x={},f&&f.abort(),f=new AbortController,k=function(T){var R=Dt();try{c&&Ct();var D=ut(e,T);return D=c?D.finally(ct):D}finally{R&&$t()}}(b={subscr:x,signal:f.signal,requery:O,querier:e,trans:null}),Promise.resolve(k).then(function(T){n=!0,t=T,p||b.signal.aborted||(y={},function(R){for(var D in R)if(M(R,D))return;return 1}(g=x)||m||(dt(rn,v),m=!0),Ar(function(){return!p&&a.next&&a.next(T)}))},function(T){n=!1,["DatabaseClosedError","AbortError"].includes(T==null?void 0:T.name)||p||Ar(function(){p||a.error&&a.error(T)})}))};return setTimeout(O,0),_});return o.hasValue=function(){return n},o.getValue=function(){return t},o}var Et=st;function to(e){var t=ht;try{ht=!0,dt.storagemutated.fire(e),Jr(e,!0)}finally{ht=t}}ae(Et,s(s({},Fe),{delete:function(e){return new Et(e,{addons:[]}).delete()},exists:function(e){return new Et(e,{addons:[]}).open().then(function(t){return t.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(e){try{return t=Et.dependencies,n=t.indexedDB,t=t.IDBKeyRange,(Ur(n)?Promise.resolve(n.databases()).then(function(o){return o.map(function(a){return a.name}).filter(function(a){return a!==Ln})}):Lr(n,t).toCollection().primaryKeys()).then(e)}catch{return De(new Z.MissingAPI)}var t,n},defineClass:function(){return function(e){P(this,e)}},ignoreTransaction:function(e){return oe.trans?_t(oe.transless,e):e()},vip:Yr,async:function(e){return function(){try{var t=Gr(e.apply(this,arguments));return t&&typeof t.then=="function"?t:W.resolve(t)}catch(n){return De(n)}}},spawn:function(e,t,n){try{var o=Gr(e.apply(n,t||[]));return o&&typeof o.then=="function"?o:W.resolve(o)}catch(a){return De(a)}},currentTransaction:{get:function(){return oe.trans||null}},waitFor:function(e,t){return t=W.resolve(typeof e=="function"?Et.ignoreTransaction(e):e).timeout(t||6e4),oe.trans?oe.trans.waitFor(t):t},Promise:W,debug:{get:function(){return tt},set:function(e){ci(e)}},derive:j,extend:P,props:ae,override:G,Events:Zt,on:dt,liveQuery:Ki,extendObservabilitySet:er,getByKeyPath:te,setByKeyPath:U,delByKeyPath:function(e,t){typeof t=="string"?U(e,t,void 0):"length"in t&&[].map.call(t,function(n){U(e,n,void 0)})},shallowClone:K,deepClone:we,getObjectDiff:Xr,cmp:Se,asap:fe,minKey:-1/0,addons:[],connections:jt,errnames:We,dependencies:or,cache:Ot,semVer:"4.0.11",version:"4.0.11".split(".").map(function(e){return parseInt(e)}).reduce(function(e,t,n){return e+t/Math.pow(10,2*n)})})),Et.maxKey=on(Et.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(dt(rn,function(e){ht||(e=new CustomEvent(Mr,{detail:e}),ht=!0,dispatchEvent(e),ht=!1)}),addEventListener(Mr,function(e){e=e.detail,ht||to(e)}));var Ft,ht=!1,Ii=function(){};return typeof BroadcastChannel<"u"&&((Ii=function(){(Ft=new BroadcastChannel(Mr)).onmessage=function(e){return e.data&&to(e.data)}})(),typeof Ft.unref=="function"&&Ft.unref(),dt(rn,function(e){ht||Ft.postMessage(e)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(e){if(!st.disableBfCache&&e.persisted){tt&&console.debug("Dexie: handling persisted pagehide"),Ft!=null&&Ft.close();for(var t=0,n=jt;t<n.length;t++)n[t].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(e){!st.disableBfCache&&e.persisted&&(tt&&console.debug("Dexie: handling persisted pageshow"),Ii(),to({all:new Be(-1/0,[[]])}))})),W.rejectionMapper=function(e,t){return!e||e instanceof Oe||e instanceof TypeError||e instanceof SyntaxError||!e.name||!Ce[e.name]?e:(t=new Ce[e.name](t||e.message,e),"stack"in e&&N(t,"stack",{get:function(){return this.inner.stack}}),t)},ci(tt),s(st,Object.freeze({__proto__:null,Dexie:st,liveQuery:Ki,Entity:vi,cmp:Se,PropModification:tn,replacePrefix:function(e,t){return new tn({replacePrefix:[e,t]})},add:function(e){return new tn({add:e})},remove:function(e){return new tn({remove:e})},default:st,RangeSet:Be,mergeRanges:un,rangesOverlap:Pi}),{default:st}),st})}(cn)),cn.exports}var Wi=Vi();const sr=Tt(Wi),io=Symbol.for("Dexie"),ln=globalThis[io]||(globalThis[io]=sr);if(sr.semVer!==ln.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${sr.semVer} and ${ln.semVer}`);const{liveQuery:Pu,mergeRanges:Du,rangesOverlap:$u,RangeSet:Cu,cmp:ju,Entity:Mu,PropModification:Nu,replacePrefix:Fu,add:qu,remove:Bu}=ln;class so extends ln{constructor(){super("db");ro(this,"rows");this.version(1).stores({rows:"++id, key"})}}const fn=new so,ao=(r,i=!1)=>fn.rows.where({key:r}).first().then(u=>i?u:u==null?void 0:u.value),Ji=Object.freeze(Object.defineProperty({__proto__:null,SubDexie:so,db:fn,get:ao,set:async(r,i)=>await ao(r,!0)?fn.rows.where({key:r}).modify({value:i}):fn.rows.add({key:r,value:i})},Symbol.toStringTag,{value:"Module"}));var dn={exports:{}},Gi=dn.exports,uo;function Xi(){return uo||(uo=1,function(r,i){(function(u,s){r.exports=s()})(Gi,function(){var u=1e3,s=6e4,l=36e5,d="millisecond",h="second",S="minute",P="hour",C="day",$="week",M="month",ae="quarter",ue="year",N="date",j="Invalid Date",E=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,J=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,re={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(Q){var H=["th","st","nd","rd"],I=Q%100;return"["+Q+(H[(I-20)%10]||H[I]||H[0])+"]"}},G=function(Q,H,I){var ee=String(Q);return!ee||ee.length>=H?Q:""+Array(H+1-ee.length).join(I)+Q},_e={s:G,z:function(Q){var H=-Q.utcOffset(),I=Math.abs(H),ee=Math.floor(I/60),L=I%60;return(H<=0?"+":"-")+G(ee,2,"0")+":"+G(L,2,"0")},m:function Q(H,I){if(H.date()<I.date())return-Q(I,H);var ee=12*(I.year()-H.year())+(I.month()-H.month()),L=H.clone().add(ee,M),ie=I-L<0,se=H.clone().add(ee+(ie?-1:1),M);return+(-(ee+(I-L)/(ie?L-se:se-L))||0)},a:function(Q){return Q<0?Math.ceil(Q)||0:Math.floor(Q)},p:function(Q){return{M,y:ue,w:$,d:C,D:N,h:P,m:S,s:h,ms:d,Q:ae}[Q]||String(Q||"").toLowerCase().replace(/s$/,"")},u:function(Q){return Q===void 0}},fe="en",te={};te[fe]=re;var U="$isDayjsObject",K=function(Q){return Q instanceof be||!(!Q||!Q[U])},ce=function Q(H,I,ee){var L;if(!H)return fe;if(typeof H=="string"){var ie=H.toLowerCase();te[ie]&&(L=ie),I&&(te[ie]=I,L=ie);var se=H.split("-");if(!L&&se.length>1)return Q(se[0])}else{var de=H.name;te[de]=H,L=de}return!ee&&L&&(fe=L),L||!ee&&fe},le=function(Q,H){if(K(Q))return Q.clone();var I=typeof H=="object"?H:{};return I.date=Q,I.args=arguments,new be(I)},ne=_e;ne.l=ce,ne.i=K,ne.w=function(Q,H){return le(Q,{locale:H.$L,utc:H.$u,x:H.$x,$offset:H.$offset})};var be=function(){function Q(I){this.$L=ce(I.locale,null,!0),this.parse(I),this.$x=this.$x||I.x||{},this[U]=!0}var H=Q.prototype;return H.parse=function(I){this.$d=function(ee){var L=ee.date,ie=ee.utc;if(L===null)return new Date(NaN);if(ne.u(L))return new Date;if(L instanceof Date)return new Date(L);if(typeof L=="string"&&!/Z$/i.test(L)){var se=L.match(E);if(se){var de=se[2]-1||0,Ee=(se[7]||"0").substring(0,3);return ie?new Date(Date.UTC(se[1],de,se[3]||1,se[4]||0,se[5]||0,se[6]||0,Ee)):new Date(se[1],de,se[3]||1,se[4]||0,se[5]||0,se[6]||0,Ee)}}return new Date(L)}(I),this.init()},H.init=function(){var I=this.$d;this.$y=I.getFullYear(),this.$M=I.getMonth(),this.$D=I.getDate(),this.$W=I.getDay(),this.$H=I.getHours(),this.$m=I.getMinutes(),this.$s=I.getSeconds(),this.$ms=I.getMilliseconds()},H.$utils=function(){return ne},H.isValid=function(){return this.$d.toString()!==j},H.isSame=function(I,ee){var L=le(I);return this.startOf(ee)<=L&&L<=this.endOf(ee)},H.isAfter=function(I,ee){return le(I)<this.startOf(ee)},H.isBefore=function(I,ee){return this.endOf(ee)<le(I)},H.$g=function(I,ee,L){return ne.u(I)?this[ee]:this.set(L,I)},H.unix=function(){return Math.floor(this.valueOf()/1e3)},H.valueOf=function(){return this.$d.getTime()},H.startOf=function(I,ee){var L=this,ie=!!ne.u(ee)||ee,se=ne.p(I),de=function(Z,Ce){var Fe=ne.w(L.$u?Date.UTC(L.$y,Ce,Z):new Date(L.$y,Ce,Z),L);return ie?Fe:Fe.endOf(C)},Ee=function(Z,Ce){return ne.w(L.toDate()[Z].apply(L.toDate("s"),(ie?[0,0,0,0]:[23,59,59,999]).slice(Ce)),L)},Oe=this.$W,Pe=this.$M,je=this.$D,Le="set"+(this.$u?"UTC":"");switch(se){case ue:return ie?de(1,0):de(31,11);case M:return ie?de(1,Pe):de(0,Pe+1);case $:var We=this.$locale().weekStart||0,ot=(Oe<We?Oe+7:Oe)-We;return de(ie?je-ot:je+(6-ot),Pe);case C:case N:return Ee(Le+"Hours",0);case P:return Ee(Le+"Minutes",1);case S:return Ee(Le+"Seconds",2);case h:return Ee(Le+"Milliseconds",3);default:return this.clone()}},H.endOf=function(I){return this.startOf(I,!1)},H.$set=function(I,ee){var L,ie=ne.p(I),se="set"+(this.$u?"UTC":""),de=(L={},L[C]=se+"Date",L[N]=se+"Date",L[M]=se+"Month",L[ue]=se+"FullYear",L[P]=se+"Hours",L[S]=se+"Minutes",L[h]=se+"Seconds",L[d]=se+"Milliseconds",L)[ie],Ee=ie===C?this.$D+(ee-this.$W):ee;if(ie===M||ie===ue){var Oe=this.clone().set(N,1);Oe.$d[de](Ee),Oe.init(),this.$d=Oe.set(N,Math.min(this.$D,Oe.daysInMonth())).$d}else de&&this.$d[de](Ee);return this.init(),this},H.set=function(I,ee){return this.clone().$set(I,ee)},H.get=function(I){return this[ne.p(I)]()},H.add=function(I,ee){var L,ie=this;I=Number(I);var se=ne.p(ee),de=function(Pe){var je=le(ie);return ne.w(je.date(je.date()+Math.round(Pe*I)),ie)};if(se===M)return this.set(M,this.$M+I);if(se===ue)return this.set(ue,this.$y+I);if(se===C)return de(1);if(se===$)return de(7);var Ee=(L={},L[S]=s,L[P]=l,L[h]=u,L)[se]||1,Oe=this.$d.getTime()+I*Ee;return ne.w(Oe,this)},H.subtract=function(I,ee){return this.add(-1*I,ee)},H.format=function(I){var ee=this,L=this.$locale();if(!this.isValid())return L.invalidDate||j;var ie=I||"YYYY-MM-DDTHH:mm:ssZ",se=ne.z(this),de=this.$H,Ee=this.$m,Oe=this.$M,Pe=L.weekdays,je=L.months,Le=L.meridiem,We=function(Ce,Fe,ye,ze){return Ce&&(Ce[Fe]||Ce(ee,ie))||ye[Fe].slice(0,ze)},ot=function(Ce){return ne.s(de%12||12,Ce,"0")},Z=Le||function(Ce,Fe,ye){var ze=Ce<12?"AM":"PM";return ye?ze.toLowerCase():ze};return ie.replace(J,function(Ce,Fe){return Fe||function(ye){switch(ye){case"YY":return String(ee.$y).slice(-2);case"YYYY":return ne.s(ee.$y,4,"0");case"M":return Oe+1;case"MM":return ne.s(Oe+1,2,"0");case"MMM":return We(L.monthsShort,Oe,je,3);case"MMMM":return We(je,Oe);case"D":return ee.$D;case"DD":return ne.s(ee.$D,2,"0");case"d":return String(ee.$W);case"dd":return We(L.weekdaysMin,ee.$W,Pe,2);case"ddd":return We(L.weekdaysShort,ee.$W,Pe,3);case"dddd":return Pe[ee.$W];case"H":return String(de);case"HH":return ne.s(de,2,"0");case"h":return ot(1);case"hh":return ot(2);case"a":return Z(de,Ee,!0);case"A":return Z(de,Ee,!1);case"m":return String(Ee);case"mm":return ne.s(Ee,2,"0");case"s":return String(ee.$s);case"ss":return ne.s(ee.$s,2,"0");case"SSS":return ne.s(ee.$ms,3,"0");case"Z":return se}return null}(Ce)||se.replace(":","")})},H.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},H.diff=function(I,ee,L){var ie,se=this,de=ne.p(ee),Ee=le(I),Oe=(Ee.utcOffset()-this.utcOffset())*s,Pe=this-Ee,je=function(){return ne.m(se,Ee)};switch(de){case ue:ie=je()/12;break;case M:ie=je();break;case ae:ie=je()/3;break;case $:ie=(Pe-Oe)/6048e5;break;case C:ie=(Pe-Oe)/864e5;break;case P:ie=Pe/l;break;case S:ie=Pe/s;break;case h:ie=Pe/u;break;default:ie=Pe}return L?ie:ne.a(ie)},H.daysInMonth=function(){return this.endOf(M).$D},H.$locale=function(){return te[this.$L]},H.locale=function(I,ee){if(!I)return this.$L;var L=this.clone(),ie=ce(I,ee,!0);return ie&&(L.$L=ie),L},H.clone=function(){return ne.w(this.$d,this)},H.toDate=function(){return new Date(this.valueOf())},H.toJSON=function(){return this.isValid()?this.toISOString():null},H.toISOString=function(){return this.$d.toISOString()},H.toString=function(){return this.$d.toUTCString()},Q}(),we=be.prototype;return le.prototype=we,[["$ms",d],["$s",h],["$m",S],["$H",P],["$W",C],["$M",M],["$y",ue],["$D",N]].forEach(function(Q){we[Q[1]]=function(H){return this.$g(H,Q[0],Q[1])}}),le.extend=function(Q,H){return Q.$i||(Q(H,be,le),Q.$i=!0),le},le.locale=ce,le.isDayjs=K,le.unix=function(Q){return le(1e3*Q)},le.en=te[fe],le.Ls=te,le.p={},le})}(dn)),dn.exports}var Qi=Xi();const hn=Tt(Qi);var pn={exports:{}},Zi=pn.exports,co;function es(){return co||(co=1,function(r,i){(function(u,s){r.exports=s()})(Zi,function(){var u={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},s=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,l=/\d/,d=/\d\d/,h=/\d\d?/,S=/\d*[^-_:/,()\s\d]+/,P={},C=function(E){return(E=+E)+(E>68?1900:2e3)},$=function(E){return function(J){this[E]=+J}},M=[/[+-]\d\d:?(\d\d)?|Z/,function(E){(this.zone||(this.zone={})).offset=function(J){if(!J||J==="Z")return 0;var re=J.match(/([+-]|\d\d)/g),G=60*re[1]+(+re[2]||0);return G===0?0:re[0]==="+"?-G:G}(E)}],ae=function(E){var J=P[E];return J&&(J.indexOf?J:J.s.concat(J.f))},ue=function(E,J){var re,G=P.meridiem;if(G){for(var _e=1;_e<=24;_e+=1)if(E.indexOf(G(_e,0,J))>-1){re=_e>12;break}}else re=E===(J?"pm":"PM");return re},N={A:[S,function(E){this.afternoon=ue(E,!1)}],a:[S,function(E){this.afternoon=ue(E,!0)}],Q:[l,function(E){this.month=3*(E-1)+1}],S:[l,function(E){this.milliseconds=100*+E}],SS:[d,function(E){this.milliseconds=10*+E}],SSS:[/\d{3}/,function(E){this.milliseconds=+E}],s:[h,$("seconds")],ss:[h,$("seconds")],m:[h,$("minutes")],mm:[h,$("minutes")],H:[h,$("hours")],h:[h,$("hours")],HH:[h,$("hours")],hh:[h,$("hours")],D:[h,$("day")],DD:[d,$("day")],Do:[S,function(E){var J=P.ordinal,re=E.match(/\d+/);if(this.day=re[0],J)for(var G=1;G<=31;G+=1)J(G).replace(/\[|\]/g,"")===E&&(this.day=G)}],w:[h,$("week")],ww:[d,$("week")],M:[h,$("month")],MM:[d,$("month")],MMM:[S,function(E){var J=ae("months"),re=(ae("monthsShort")||J.map(function(G){return G.slice(0,3)})).indexOf(E)+1;if(re<1)throw new Error;this.month=re%12||re}],MMMM:[S,function(E){var J=ae("months").indexOf(E)+1;if(J<1)throw new Error;this.month=J%12||J}],Y:[/[+-]?\d+/,$("year")],YY:[d,function(E){this.year=C(E)}],YYYY:[/\d{4}/,$("year")],Z:M,ZZ:M};function j(E){var J,re;J=E,re=P&&P.formats;for(var G=(E=J.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(le,ne,be){var we=be&&be.toUpperCase();return ne||re[be]||u[be]||re[we].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(Q,H,I){return H||I.slice(1)})})).match(s),_e=G.length,fe=0;fe<_e;fe+=1){var te=G[fe],U=N[te],K=U&&U[0],ce=U&&U[1];G[fe]=ce?{regex:K,parser:ce}:te.replace(/^\[|\]$/g,"")}return function(le){for(var ne={},be=0,we=0;be<_e;be+=1){var Q=G[be];if(typeof Q=="string")we+=Q.length;else{var H=Q.regex,I=Q.parser,ee=le.slice(we),L=H.exec(ee)[0];I.call(ne,L),le=le.replace(L,"")}}return function(ie){var se=ie.afternoon;if(se!==void 0){var de=ie.hours;se?de<12&&(ie.hours+=12):de===12&&(ie.hours=0),delete ie.afternoon}}(ne),ne}}return function(E,J,re){re.p.customParseFormat=!0,E&&E.parseTwoDigitYear&&(C=E.parseTwoDigitYear);var G=J.prototype,_e=G.parse;G.parse=function(fe){var te=fe.date,U=fe.utc,K=fe.args;this.$u=U;var ce=K[1];if(typeof ce=="string"){var le=K[2]===!0,ne=K[3]===!0,be=le||ne,we=K[2];ne&&(we=K[2]),P=this.$locale(),!le&&we&&(P=re.Ls[we]),this.$d=function(ee,L,ie,se){try{if(["x","X"].indexOf(L)>-1)return new Date((L==="X"?1e3:1)*ee);var de=j(L)(ee),Ee=de.year,Oe=de.month,Pe=de.day,je=de.hours,Le=de.minutes,We=de.seconds,ot=de.milliseconds,Z=de.zone,Ce=de.week,Fe=new Date,ye=Pe||(Ee||Oe?1:Fe.getDate()),ze=Ee||Fe.getFullYear(),Pt=0;Ee&&!Oe||(Pt=Oe>0?Oe-1:Fe.getMonth());var Xe,Ht=je||0,zt=Le||0,Vt=We||0,Wt=ot||0;return Z?new Date(Date.UTC(ze,Pt,ye,Ht,zt,Vt,Wt+60*Z.offset*1e3)):ie?new Date(Date.UTC(ze,Pt,ye,Ht,zt,Vt,Wt)):(Xe=new Date(ze,Pt,ye,Ht,zt,Vt,Wt),Ce&&(Xe=se(Xe).week(Ce).toDate()),Xe)}catch{return new Date("")}}(te,ce,U,re),this.init(),we&&we!==!0&&(this.$L=this.locale(we).$L),be&&te!=this.format(ce)&&(this.$d=new Date("")),P={}}else if(ce instanceof Array)for(var Q=ce.length,H=1;H<=Q;H+=1){K[1]=ce[H-1];var I=re.apply(this,K);if(I.isValid()){this.$d=I.$d,this.$L=I.$L,this.init();break}H===Q&&(this.$d=new Date(""))}else _e.call(this,fe)}}})}(pn)),pn.exports}var ts=es();const ns=Tt(ts);var mn={exports:{}},rs=mn.exports,lo;function os(){return lo||(lo=1,function(r,i){(function(u,s){r.exports=s()})(rs,function(){var u,s,l=1e3,d=6e4,h=36e5,S=864e5,P=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,C=31536e6,$=2628e6,M=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,ae={years:C,months:$,days:S,hours:h,minutes:d,seconds:l,milliseconds:1,weeks:6048e5},ue=function(te){return te instanceof _e},N=function(te,U,K){return new _e(te,K,U.$l)},j=function(te){return s.p(te)+"s"},E=function(te){return te<0},J=function(te){return E(te)?Math.ceil(te):Math.floor(te)},re=function(te){return Math.abs(te)},G=function(te,U){return te?E(te)?{negative:!0,format:""+re(te)+U}:{negative:!1,format:""+te+U}:{negative:!1,format:""}},_e=function(){function te(K,ce,le){var ne=this;if(this.$d={},this.$l=le,K===void 0&&(this.$ms=0,this.parseFromMilliseconds()),ce)return N(K*ae[j(ce)],this);if(typeof K=="number")return this.$ms=K,this.parseFromMilliseconds(),this;if(typeof K=="object")return Object.keys(K).forEach(function(Q){ne.$d[j(Q)]=K[Q]}),this.calMilliseconds(),this;if(typeof K=="string"){var be=K.match(M);if(be){var we=be.slice(2).map(function(Q){return Q!=null?Number(Q):0});return this.$d.years=we[0],this.$d.months=we[1],this.$d.weeks=we[2],this.$d.days=we[3],this.$d.hours=we[4],this.$d.minutes=we[5],this.$d.seconds=we[6],this.calMilliseconds(),this}}return this}var U=te.prototype;return U.calMilliseconds=function(){var K=this;this.$ms=Object.keys(this.$d).reduce(function(ce,le){return ce+(K.$d[le]||0)*ae[le]},0)},U.parseFromMilliseconds=function(){var K=this.$ms;this.$d.years=J(K/C),K%=C,this.$d.months=J(K/$),K%=$,this.$d.days=J(K/S),K%=S,this.$d.hours=J(K/h),K%=h,this.$d.minutes=J(K/d),K%=d,this.$d.seconds=J(K/l),K%=l,this.$d.milliseconds=K},U.toISOString=function(){var K=G(this.$d.years,"Y"),ce=G(this.$d.months,"M"),le=+this.$d.days||0;this.$d.weeks&&(le+=7*this.$d.weeks);var ne=G(le,"D"),be=G(this.$d.hours,"H"),we=G(this.$d.minutes,"M"),Q=this.$d.seconds||0;this.$d.milliseconds&&(Q+=this.$d.milliseconds/1e3,Q=Math.round(1e3*Q)/1e3);var H=G(Q,"S"),I=K.negative||ce.negative||ne.negative||be.negative||we.negative||H.negative,ee=be.format||we.format||H.format?"T":"",L=(I?"-":"")+"P"+K.format+ce.format+ne.format+ee+be.format+we.format+H.format;return L==="P"||L==="-P"?"P0D":L},U.toJSON=function(){return this.toISOString()},U.format=function(K){var ce=K||"YYYY-MM-DDTHH:mm:ss",le={Y:this.$d.years,YY:s.s(this.$d.years,2,"0"),YYYY:s.s(this.$d.years,4,"0"),M:this.$d.months,MM:s.s(this.$d.months,2,"0"),D:this.$d.days,DD:s.s(this.$d.days,2,"0"),H:this.$d.hours,HH:s.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:s.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:s.s(this.$d.seconds,2,"0"),SSS:s.s(this.$d.milliseconds,3,"0")};return ce.replace(P,function(ne,be){return be||String(le[ne])})},U.as=function(K){return this.$ms/ae[j(K)]},U.get=function(K){var ce=this.$ms,le=j(K);return le==="milliseconds"?ce%=1e3:ce=le==="weeks"?J(ce/ae[le]):this.$d[le],ce||0},U.add=function(K,ce,le){var ne;return ne=ce?K*ae[j(ce)]:ue(K)?K.$ms:N(K,this).$ms,N(this.$ms+ne*(le?-1:1),this)},U.subtract=function(K,ce){return this.add(K,ce,!0)},U.locale=function(K){var ce=this.clone();return ce.$l=K,ce},U.clone=function(){return N(this.$ms,this)},U.humanize=function(K){return u().add(this.$ms,"ms").locale(this.$l).fromNow(!K)},U.valueOf=function(){return this.asMilliseconds()},U.milliseconds=function(){return this.get("milliseconds")},U.asMilliseconds=function(){return this.as("milliseconds")},U.seconds=function(){return this.get("seconds")},U.asSeconds=function(){return this.as("seconds")},U.minutes=function(){return this.get("minutes")},U.asMinutes=function(){return this.as("minutes")},U.hours=function(){return this.get("hours")},U.asHours=function(){return this.as("hours")},U.days=function(){return this.get("days")},U.asDays=function(){return this.as("days")},U.weeks=function(){return this.get("weeks")},U.asWeeks=function(){return this.as("weeks")},U.months=function(){return this.get("months")},U.asMonths=function(){return this.as("months")},U.years=function(){return this.get("years")},U.asYears=function(){return this.as("years")},te}(),fe=function(te,U,K){return te.add(U.years()*K,"y").add(U.months()*K,"M").add(U.days()*K,"d").add(U.hours()*K,"h").add(U.minutes()*K,"m").add(U.seconds()*K,"s").add(U.milliseconds()*K,"ms")};return function(te,U,K){u=K,s=K().$utils(),K.duration=function(ne,be){var we=K.locale();return N(ne,{$l:we},be)},K.isDuration=ue;var ce=U.prototype.add,le=U.prototype.subtract;U.prototype.add=function(ne,be){return ue(ne)?fe(this,ne,1):ce.bind(this)(ne,be)},U.prototype.subtract=function(ne,be){return ue(ne)?fe(this,ne,-1):le.bind(this)(ne,be)}}})}(mn)),mn.exports}var is=os();const ss=Tt(is);var yn={exports:{}},as=yn.exports,fo;function us(){return fo||(fo=1,function(r,i){(function(u,s){r.exports=s()})(as,function(){var u="minute",s=/[+-]\d\d(?::?\d\d)?/g,l=/([+-]|\d\d)/g;return function(d,h,S){var P=h.prototype;S.utc=function(j){var E={date:j,utc:!0,args:arguments};return new h(E)},P.utc=function(j){var E=S(this.toDate(),{locale:this.$L,utc:!0});return j?E.add(this.utcOffset(),u):E},P.local=function(){return S(this.toDate(),{locale:this.$L,utc:!1})};var C=P.parse;P.parse=function(j){j.utc&&(this.$u=!0),this.$utils().u(j.$offset)||(this.$offset=j.$offset),C.call(this,j)};var $=P.init;P.init=function(){if(this.$u){var j=this.$d;this.$y=j.getUTCFullYear(),this.$M=j.getUTCMonth(),this.$D=j.getUTCDate(),this.$W=j.getUTCDay(),this.$H=j.getUTCHours(),this.$m=j.getUTCMinutes(),this.$s=j.getUTCSeconds(),this.$ms=j.getUTCMilliseconds()}else $.call(this)};var M=P.utcOffset;P.utcOffset=function(j,E){var J=this.$utils().u;if(J(j))return this.$u?0:J(this.$offset)?M.call(this):this.$offset;if(typeof j=="string"&&(j=function(fe){fe===void 0&&(fe="");var te=fe.match(s);if(!te)return null;var U=(""+te[0]).match(l)||["-",0,0],K=U[0],ce=60*+U[1]+ +U[2];return ce===0?0:K==="+"?ce:-ce}(j),j===null))return this;var re=Math.abs(j)<=16?60*j:j,G=this;if(E)return G.$offset=re,G.$u=j===0,G;if(j!==0){var _e=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(G=this.local().add(re+_e,u)).$offset=re,G.$x.$localOffset=_e}else G=this.utc();return G};var ae=P.format;P.format=function(j){var E=j||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return ae.call(this,E)},P.valueOf=function(){var j=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*j},P.isUTC=function(){return!!this.$u},P.toISOString=function(){return this.toDate().toISOString()},P.toString=function(){return this.toDate().toUTCString()};var ue=P.toDate;P.toDate=function(j){return j==="s"&&this.$offset?S(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():ue.call(this)};var N=P.diff;P.diff=function(j,E,J){if(j&&this.$u===j.$u)return N.call(this,j,E,J);var re=this.local(),G=S(j).local();return N.call(re,G,E,J)}}})}(yn)),yn.exports}var cs=us();const ls=Tt(cs);hn.extend(ns),hn.extend(ss),hn.extend(ls);const fs=Object.freeze(Object.defineProperty({__proto__:null,FORMAT:{DATETIME:"YYYY-MM-DD HH:mm:ss",DATE:"YYYY-MM-DD",TIME:"HH:mm:ss",YEAR:"YYYY",MONTH:"YYYY-MM",HOUR:"YYYY-MM-DD HH",MINUTE:"YYYY-MM-DD HH:mm"},dayjs:hn},Symbol.toStringTag,{value:"Module"}));var vn={},gn={},ar,ho;function po(){if(ho)return ar;ho=1,ar=r;function r(u,s){if(s!=="$")for(var l=i(s),d=0;d<l.length;d++)s=l[d].toString().replace(/\\"/g,'"'),!(typeof u[s]>"u"&&d!==l.length-1)&&(u=u[s]);return u}function i(u){for(var s=/(?:\.(\w+))|(?:\[(\d+)\])|(?:\["((?:[^\\"]|\\.)*)"\])/g,l=[],d;d=s.exec(u);)l.push(d[1]||d[2]||d[3]);return l}return ar}var Bt={},mo;function ds(){if(mo)return Bt;mo=1;var r=po(),i=go();return Bt.getRegexFlags=function(s){var l="";return s.ignoreCase&&(l+="i"),s.global&&(l+="g"),s.multiline&&(l+="m"),l},Bt.stringifyFunction=function(s,l){if(typeof l=="function")return l(s);var d=s.toString(),h=d.match(/^[^{]*{|^[^=]*=>/),S=h?h[0]:"<function> ",P=d[d.length-1]==="}"?"}":"";return S.replace(/\r\n|\n/g," ").replace(/\s+/g," ")+" /* ... */ "+P},Bt.restore=function(s,l){var d=s[0],h=s.slice(1);switch(d){case"$":return r(l,s);case"r":var S=h.indexOf(","),P=h.slice(0,S),C=h.slice(S+1);return RegExp(C,P);case"d":return new Date(+h);case"f":var $=function(){throw new Error("can't run jsan parsed function")};return $.toString=function(){return h},$;case"u":return;case"e":var M=new Error(h);return M.stack="Stack is unavailable for jsan parsed errors",M;case"s":return Symbol(h);case"g":return Symbol.for(h);case"m":return new Map(i.parse(h));case"l":return new Set(i.parse(h));case"n":return NaN;case"i":return 1/0;case"y":return-1/0;default:return console.warn("unknown type",s),s}},Bt}var yo;function hs(){if(yo)return gn;yo=1,po();var r=ds(),i=typeof WeakMap<"u"?WeakMap:function(){var u=[],s=[];return{set:function(l,d){u.push(l),s.push(d)},get:function(l){for(var d=0;d<u.length;d++)if(u[d]===l)return s[d]}}};return gn.decycle=function u(s,l,d,h){h=h||new i;var S=!Object.prototype.hasOwnProperty.call(l,"circular"),P=l.refs!==!1;return function C($,M,ae){var ue,N,j,E=typeof d=="function"?d(ae||"",$):$;if(l.date&&E instanceof Date)return{$jsan:"d"+E.getTime()};if(l.regex&&E instanceof RegExp)return{$jsan:"r"+r.getRegexFlags(E)+","+E.source};if(l.function&&typeof E=="function")return{$jsan:"f"+r.stringifyFunction(E,l.function)};if(l.nan&&typeof E=="number"&&isNaN(E))return{$jsan:"n"};if(l.infinity){if(Number.POSITIVE_INFINITY===E)return{$jsan:"i"};if(Number.NEGATIVE_INFINITY===E)return{$jsan:"y"}}if(l.undefined&&E===void 0)return{$jsan:"u"};if(l.error&&E instanceof Error)return{$jsan:"e"+E.message};if(l.symbol&&typeof E=="symbol"){var J=Symbol.keyFor(E);return J!==void 0?{$jsan:"g"+J}:{$jsan:"s"+E.toString().slice(7,-1)}}if(l.map&&typeof Map=="function"&&E instanceof Map&&typeof Array.from=="function")return{$jsan:"m"+JSON.stringify(u(Array.from(E),l,d,h))};if(l.set&&typeof Set=="function"&&E instanceof Set&&typeof Array.from=="function")return{$jsan:"l"+JSON.stringify(u(Array.from(E),l,d,h))};if(E&&typeof E.toJSON=="function")try{E=E.toJSON(ae)}catch{var re=ae||"$";return"toJSON failed for '"+(h.get(E)||re)+"'"}if(typeof E=="object"&&E!==null&&!(E instanceof Boolean)&&!(E instanceof Date)&&!(E instanceof Number)&&!(E instanceof RegExp)&&!(E instanceof String)&&typeof E!="symbol"&&!(E instanceof Error)){if(typeof E=="object"){var G=h.get(E);if(G){if(S&&P)return{$jsan:G};var _e=M.split(".").slice(0,-1).join(".");if(_e.indexOf(G)===0)return S?{$jsan:G}:typeof l.circular=="function"?l.circular(E,M,G):l.circular;if(P)return{$jsan:G}}h.set(E,M)}if(Object.prototype.toString.apply(E)==="[object Array]")for(j=[],ue=0;ue<E.length;ue+=1)j[ue]=C(E[ue],M+"["+ue+"]",ue);else{j={};for(N in E)if(Object.prototype.hasOwnProperty.call(E,N)){var fe=/^\w+$/.test(N)?"."+N:"["+JSON.stringify(N)+"]";j[N]=N==="$jsan"?[C(E[N],M+fe)]:C(E[N],M+fe,N)}}return j}return E}(s,"$")},gn.retrocycle=function(s){return function l(d){var h,S,P;if(d&&typeof d=="object")if(Object.prototype.toString.apply(d)==="[object Array]")for(h=0;h<d.length;h+=1)S=d[h],S&&typeof S=="object"&&(S.$jsan?d[h]=r.restore(S.$jsan,s):l(S));else for(P in d){if(typeof d[P]=="string"&&P==="$jsan")return r.restore(d.$jsan,s);P==="$jsan"&&(d[P]=d[P][0]),typeof d[P]=="object"&&(S=d[P],S&&typeof S=="object"&&(S.$jsan?d[P]=r.restore(S.$jsan,s):l(S)))}return d}(s)},gn}var vo;function go(){if(vo)return vn;vo=1;var r=hs();return vn.stringify=function(u,s,l,d){if(arguments.length<4)try{return arguments.length===1?JSON.stringify(u):JSON.stringify.apply(JSON,arguments)}catch{}var h=d||!1;typeof h=="boolean"&&(h={date:h,function:h,regex:h,undefined:h,error:h,symbol:h,map:h,set:h,nan:h,infinity:h});var S=r.decycle(u,h,s);return arguments.length===1?JSON.stringify(S):JSON.stringify(S,Array.isArray(s)?s:null,l)},vn.parse=function(u,s){var l=/"\$jsan"/.test(u),d;return arguments.length===1?d=JSON.parse(u):d=JSON.parse(u,s),l&&(d=r.retrocycle(d)),d},vn}var ur,bo;function ps(){return bo||(bo=1,ur=go()),ur}var ms=ps();const wo=Tt(ms),cr=(r=null,i,u,s=!0)=>wo.stringify(r,i,u,s),_o=(r,i)=>wo.parse(r,i),ys=Object.freeze(Object.defineProperty({__proto__:null,parse:_o,stringify:cr},Symbol.toStringTag,{value:"Module"})),vs=Object.freeze(Object.defineProperty({__proto__:null,SHA256:async(r,i=!0)=>{const u=i?cr(r):r,l=new TextEncoder().encode(u),d=await crypto.subtle.digest("SHA-256",l);return Array.from(new Uint8Array(d)).map(S=>S.toString(16).padStart(2,"0")).join("")},id:()=>{const r=Date.now(),i=Math.floor(Math.random()*1e6),u=`${r}${i}`;return parseInt(u).toString(32)},random:()=>{const r=new Uint32Array(1);return crypto.getRandomValues(r),r[0]}},Symbol.toStringTag,{value:"Module"}));function So(r,i){return function(){return r.apply(i,arguments)}}const{toString:gs}=Object.prototype,{getPrototypeOf:lr}=Object,bn=(r=>i=>{const u=gs.call(i);return r[u]||(r[u]=u.slice(8,-1).toLowerCase())})(Object.create(null)),Ze=r=>(r=r.toLowerCase(),i=>bn(i)===r),wn=r=>i=>typeof i===r,{isArray:Rt}=Array,Kt=wn("undefined");function bs(r){return r!==null&&!Kt(r)&&r.constructor!==null&&!Kt(r.constructor)&&Ve(r.constructor.isBuffer)&&r.constructor.isBuffer(r)}const xo=Ze("ArrayBuffer");function ws(r){let i;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?i=ArrayBuffer.isView(r):i=r&&r.buffer&&xo(r.buffer),i}const _s=wn("string"),Ve=wn("function"),Oo=wn("number"),_n=r=>r!==null&&typeof r=="object",Ss=r=>r===!0||r===!1,Sn=r=>{if(bn(r)!=="object")return!1;const i=lr(r);return(i===null||i===Object.prototype||Object.getPrototypeOf(i)===null)&&!(Symbol.toStringTag in r)&&!(Symbol.iterator in r)},xs=Ze("Date"),Os=Ze("File"),Es=Ze("Blob"),ks=Ze("FileList"),Ts=r=>_n(r)&&Ve(r.pipe),Rs=r=>{let i;return r&&(typeof FormData=="function"&&r instanceof FormData||Ve(r.append)&&((i=bn(r))==="formdata"||i==="object"&&Ve(r.toString)&&r.toString()==="[object FormData]"))},As=Ze("URLSearchParams"),[Ps,Ds,$s,Cs]=["ReadableStream","Request","Response","Headers"].map(Ze),js=r=>r.trim?r.trim():r.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function It(r,i,{allOwnKeys:u=!1}={}){if(r===null||typeof r>"u")return;let s,l;if(typeof r!="object"&&(r=[r]),Rt(r))for(s=0,l=r.length;s<l;s++)i.call(null,r[s],s,r);else{const d=u?Object.getOwnPropertyNames(r):Object.keys(r),h=d.length;let S;for(s=0;s<h;s++)S=d[s],i.call(null,r[S],S,r)}}function Eo(r,i){i=i.toLowerCase();const u=Object.keys(r);let s=u.length,l;for(;s-- >0;)if(l=u[s],i===l.toLowerCase())return l;return null}const pt=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,ko=r=>!Kt(r)&&r!==pt;function fr(){const{caseless:r}=ko(this)&&this||{},i={},u=(s,l)=>{const d=r&&Eo(i,l)||l;Sn(i[d])&&Sn(s)?i[d]=fr(i[d],s):Sn(s)?i[d]=fr({},s):Rt(s)?i[d]=s.slice():i[d]=s};for(let s=0,l=arguments.length;s<l;s++)arguments[s]&&It(arguments[s],u);return i}const Ms=(r,i,u,{allOwnKeys:s}={})=>(It(i,(l,d)=>{u&&Ve(l)?r[d]=So(l,u):r[d]=l},{allOwnKeys:s}),r),Ns=r=>(r.charCodeAt(0)===65279&&(r=r.slice(1)),r),Fs=(r,i,u,s)=>{r.prototype=Object.create(i.prototype,s),r.prototype.constructor=r,Object.defineProperty(r,"super",{value:i.prototype}),u&&Object.assign(r.prototype,u)},qs=(r,i,u,s)=>{let l,d,h;const S={};if(i=i||{},r==null)return i;do{for(l=Object.getOwnPropertyNames(r),d=l.length;d-- >0;)h=l[d],(!s||s(h,r,i))&&!S[h]&&(i[h]=r[h],S[h]=!0);r=u!==!1&&lr(r)}while(r&&(!u||u(r,i))&&r!==Object.prototype);return i},Bs=(r,i,u)=>{r=String(r),(u===void 0||u>r.length)&&(u=r.length),u-=i.length;const s=r.indexOf(i,u);return s!==-1&&s===u},Ks=r=>{if(!r)return null;if(Rt(r))return r;let i=r.length;if(!Oo(i))return null;const u=new Array(i);for(;i-- >0;)u[i]=r[i];return u},Is=(r=>i=>r&&i instanceof r)(typeof Uint8Array<"u"&&lr(Uint8Array)),Ls=(r,i)=>{const s=(r&&r[Symbol.iterator]).call(r);let l;for(;(l=s.next())&&!l.done;){const d=l.value;i.call(r,d[0],d[1])}},Us=(r,i)=>{let u;const s=[];for(;(u=r.exec(i))!==null;)s.push(u);return s},Ys=Ze("HTMLFormElement"),Hs=r=>r.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(u,s,l){return s.toUpperCase()+l}),To=(({hasOwnProperty:r})=>(i,u)=>r.call(i,u))(Object.prototype),zs=Ze("RegExp"),Ro=(r,i)=>{const u=Object.getOwnPropertyDescriptors(r),s={};It(u,(l,d)=>{let h;(h=i(l,d,r))!==!1&&(s[d]=h||l)}),Object.defineProperties(r,s)},Vs=r=>{Ro(r,(i,u)=>{if(Ve(r)&&["arguments","caller","callee"].indexOf(u)!==-1)return!1;const s=r[u];if(Ve(s)){if(i.enumerable=!1,"writable"in i){i.writable=!1;return}i.set||(i.set=()=>{throw Error("Can not rewrite read-only method '"+u+"'")})}})},Ws=(r,i)=>{const u={},s=l=>{l.forEach(d=>{u[d]=!0})};return Rt(r)?s(r):s(String(r).split(i)),u},Js=()=>{},Gs=(r,i)=>r!=null&&Number.isFinite(r=+r)?r:i;function Xs(r){return!!(r&&Ve(r.append)&&r[Symbol.toStringTag]==="FormData"&&r[Symbol.iterator])}const Qs=r=>{const i=new Array(10),u=(s,l)=>{if(_n(s)){if(i.indexOf(s)>=0)return;if(!("toJSON"in s)){i[l]=s;const d=Rt(s)?[]:{};return It(s,(h,S)=>{const P=u(h,l+1);!Kt(P)&&(d[S]=P)}),i[l]=void 0,d}}return s};return u(r,0)},Zs=Ze("AsyncFunction"),ea=r=>r&&(_n(r)||Ve(r))&&Ve(r.then)&&Ve(r.catch),Ao=((r,i)=>r?setImmediate:i?((u,s)=>(pt.addEventListener("message",({source:l,data:d})=>{l===pt&&d===u&&s.length&&s.shift()()},!1),l=>{s.push(l),pt.postMessage(u,"*")}))(`axios@${Math.random()}`,[]):u=>setTimeout(u))(typeof setImmediate=="function",Ve(pt.postMessage)),ta=typeof queueMicrotask<"u"?queueMicrotask.bind(pt):typeof process<"u"&&process.nextTick||Ao,A={isArray:Rt,isArrayBuffer:xo,isBuffer:bs,isFormData:Rs,isArrayBufferView:ws,isString:_s,isNumber:Oo,isBoolean:Ss,isObject:_n,isPlainObject:Sn,isReadableStream:Ps,isRequest:Ds,isResponse:$s,isHeaders:Cs,isUndefined:Kt,isDate:xs,isFile:Os,isBlob:Es,isRegExp:zs,isFunction:Ve,isStream:Ts,isURLSearchParams:As,isTypedArray:Is,isFileList:ks,forEach:It,merge:fr,extend:Ms,trim:js,stripBOM:Ns,inherits:Fs,toFlatObject:qs,kindOf:bn,kindOfTest:Ze,endsWith:Bs,toArray:Ks,forEachEntry:Ls,matchAll:Us,isHTMLForm:Ys,hasOwnProperty:To,hasOwnProp:To,reduceDescriptors:Ro,freezeMethods:Vs,toObjectSet:Ws,toCamelCase:Hs,noop:Js,toFiniteNumber:Gs,findKey:Eo,global:pt,isContextDefined:ko,isSpecCompliantForm:Xs,toJSONObject:Qs,isAsyncFn:Zs,isThenable:ea,setImmediate:Ao,asap:ta};function pe(r,i,u,s,l){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=r,this.name="AxiosError",i&&(this.code=i),u&&(this.config=u),s&&(this.request=s),l&&(this.response=l,this.status=l.status?l.status:null)}A.inherits(pe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:A.toJSONObject(this.config),code:this.code,status:this.status}}});const Po=pe.prototype,Do={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(r=>{Do[r]={value:r}}),Object.defineProperties(pe,Do),Object.defineProperty(Po,"isAxiosError",{value:!0}),pe.from=(r,i,u,s,l,d)=>{const h=Object.create(Po);return A.toFlatObject(r,h,function(P){return P!==Error.prototype},S=>S!=="isAxiosError"),pe.call(h,r.message,i,u,s,l),h.cause=r,h.name=r.name,d&&Object.assign(h,d),h};const na=null;function dr(r){return A.isPlainObject(r)||A.isArray(r)}function $o(r){return A.endsWith(r,"[]")?r.slice(0,-2):r}function Co(r,i,u){return r?r.concat(i).map(function(l,d){return l=$o(l),!u&&d?"["+l+"]":l}).join(u?".":""):i}function ra(r){return A.isArray(r)&&!r.some(dr)}const oa=A.toFlatObject(A,{},null,function(i){return/^is[A-Z]/.test(i)});function xn(r,i,u){if(!A.isObject(r))throw new TypeError("target must be an object");i=i||new FormData,u=A.toFlatObject(u,{metaTokens:!0,dots:!1,indexes:!1},!1,function(j,E){return!A.isUndefined(E[j])});const s=u.metaTokens,l=u.visitor||$,d=u.dots,h=u.indexes,P=(u.Blob||typeof Blob<"u"&&Blob)&&A.isSpecCompliantForm(i);if(!A.isFunction(l))throw new TypeError("visitor must be a function");function C(N){if(N===null)return"";if(A.isDate(N))return N.toISOString();if(!P&&A.isBlob(N))throw new pe("Blob is not supported. Use a Buffer instead.");return A.isArrayBuffer(N)||A.isTypedArray(N)?P&&typeof Blob=="function"?new Blob([N]):Buffer.from(N):N}function $(N,j,E){let J=N;if(N&&!E&&typeof N=="object"){if(A.endsWith(j,"{}"))j=s?j:j.slice(0,-2),N=JSON.stringify(N);else if(A.isArray(N)&&ra(N)||(A.isFileList(N)||A.endsWith(j,"[]"))&&(J=A.toArray(N)))return j=$o(j),J.forEach(function(G,_e){!(A.isUndefined(G)||G===null)&&i.append(h===!0?Co([j],_e,d):h===null?j:j+"[]",C(G))}),!1}return dr(N)?!0:(i.append(Co(E,j,d),C(N)),!1)}const M=[],ae=Object.assign(oa,{defaultVisitor:$,convertValue:C,isVisitable:dr});function ue(N,j){if(!A.isUndefined(N)){if(M.indexOf(N)!==-1)throw Error("Circular reference detected in "+j.join("."));M.push(N),A.forEach(N,function(J,re){(!(A.isUndefined(J)||J===null)&&l.call(i,J,A.isString(re)?re.trim():re,j,ae))===!0&&ue(J,j?j.concat(re):[re])}),M.pop()}}if(!A.isObject(r))throw new TypeError("data must be an object");return ue(r),i}function jo(r){const i={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(r).replace(/[!'()~]|%20|%00/g,function(s){return i[s]})}function hr(r,i){this._pairs=[],r&&xn(r,this,i)}const Mo=hr.prototype;Mo.append=function(i,u){this._pairs.push([i,u])},Mo.toString=function(i){const u=i?function(s){return i.call(this,s,jo)}:jo;return this._pairs.map(function(l){return u(l[0])+"="+u(l[1])},"").join("&")};function ia(r){return encodeURIComponent(r).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function No(r,i,u){if(!i)return r;const s=u&&u.encode||ia;A.isFunction(u)&&(u={serialize:u});const l=u&&u.serialize;let d;if(l?d=l(i,u):d=A.isURLSearchParams(i)?i.toString():new hr(i,u).toString(s),d){const h=r.indexOf("#");h!==-1&&(r=r.slice(0,h)),r+=(r.indexOf("?")===-1?"?":"&")+d}return r}class Fo{constructor(){this.handlers=[]}use(i,u,s){return this.handlers.push({fulfilled:i,rejected:u,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1}eject(i){this.handlers[i]&&(this.handlers[i]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(i){A.forEach(this.handlers,function(s){s!==null&&i(s)})}}const qo={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},sa={isBrowser:!0,classes:{URLSearchParams:typeof URLSearchParams<"u"?URLSearchParams:hr,FormData:typeof FormData<"u"?FormData:null,Blob:typeof Blob<"u"?Blob:null},protocols:["http","https","file","blob","url","data"]},pr=typeof window<"u"&&typeof document<"u",mr=typeof navigator=="object"&&navigator||void 0,aa=pr&&(!mr||["ReactNative","NativeScript","NS"].indexOf(mr.product)<0),ua=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",ca=pr&&window.location.href||"http://localhost",qe={...Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:pr,hasStandardBrowserEnv:aa,hasStandardBrowserWebWorkerEnv:ua,navigator:mr,origin:ca},Symbol.toStringTag,{value:"Module"})),...sa};function la(r,i){return xn(r,new qe.classes.URLSearchParams,Object.assign({visitor:function(u,s,l,d){return qe.isNode&&A.isBuffer(u)?(this.append(s,u.toString("base64")),!1):d.defaultVisitor.apply(this,arguments)}},i))}function fa(r){return A.matchAll(/\w+|\[(\w*)]/g,r).map(i=>i[0]==="[]"?"":i[1]||i[0])}function da(r){const i={},u=Object.keys(r);let s;const l=u.length;let d;for(s=0;s<l;s++)d=u[s],i[d]=r[d];return i}function Bo(r){function i(u,s,l,d){let h=u[d++];if(h==="__proto__")return!0;const S=Number.isFinite(+h),P=d>=u.length;return h=!h&&A.isArray(l)?l.length:h,P?(A.hasOwnProp(l,h)?l[h]=[l[h],s]:l[h]=s,!S):((!l[h]||!A.isObject(l[h]))&&(l[h]=[]),i(u,s,l[h],d)&&A.isArray(l[h])&&(l[h]=da(l[h])),!S)}if(A.isFormData(r)&&A.isFunction(r.entries)){const u={};return A.forEachEntry(r,(s,l)=>{i(fa(s),l,u,0)}),u}return null}function ha(r,i,u){if(A.isString(r))try{return(i||JSON.parse)(r),A.trim(r)}catch(s){if(s.name!=="SyntaxError")throw s}return(u||JSON.stringify)(r)}const Lt={transitional:qo,adapter:["xhr","http","fetch"],transformRequest:[function(i,u){const s=u.getContentType()||"",l=s.indexOf("application/json")>-1,d=A.isObject(i);if(d&&A.isHTMLForm(i)&&(i=new FormData(i)),A.isFormData(i))return l?JSON.stringify(Bo(i)):i;if(A.isArrayBuffer(i)||A.isBuffer(i)||A.isStream(i)||A.isFile(i)||A.isBlob(i)||A.isReadableStream(i))return i;if(A.isArrayBufferView(i))return i.buffer;if(A.isURLSearchParams(i))return u.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),i.toString();let S;if(d){if(s.indexOf("application/x-www-form-urlencoded")>-1)return la(i,this.formSerializer).toString();if((S=A.isFileList(i))||s.indexOf("multipart/form-data")>-1){const P=this.env&&this.env.FormData;return xn(S?{"files[]":i}:i,P&&new P,this.formSerializer)}}return d||l?(u.setContentType("application/json",!1),ha(i)):i}],transformResponse:[function(i){const u=this.transitional||Lt.transitional,s=u&&u.forcedJSONParsing,l=this.responseType==="json";if(A.isResponse(i)||A.isReadableStream(i))return i;if(i&&A.isString(i)&&(s&&!this.responseType||l)){const h=!(u&&u.silentJSONParsing)&&l;try{return JSON.parse(i)}catch(S){if(h)throw S.name==="SyntaxError"?pe.from(S,pe.ERR_BAD_RESPONSE,this,null,this.response):S}}return i}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:qe.classes.FormData,Blob:qe.classes.Blob},validateStatus:function(i){return i>=200&&i<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};A.forEach(["delete","get","head","post","put","patch"],r=>{Lt.headers[r]={}});const pa=A.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ma=r=>{const i={};let u,s,l;return r&&r.split(`
4
4
  `).forEach(function(h){l=h.indexOf(":"),u=h.substring(0,l).trim().toLowerCase(),s=h.substring(l+1).trim(),!(!u||i[u]&&pa[u])&&(u==="set-cookie"?i[u]?i[u].push(s):i[u]=[s]:i[u]=i[u]?i[u]+", "+s:s)}),i},Ko=Symbol("internals");function Ut(r){return r&&String(r).trim().toLowerCase()}function On(r){return r===!1||r==null?r:A.isArray(r)?r.map(On):String(r)}function ya(r){const i=Object.create(null),u=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=u.exec(r);)i[s[1]]=s[2];return i}const va=r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());function yr(r,i,u,s,l){if(A.isFunction(s))return s.call(this,i,u);if(l&&(i=u),!!A.isString(i)){if(A.isString(s))return i.indexOf(s)!==-1;if(A.isRegExp(s))return s.test(i)}}function ga(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(i,u,s)=>u.toUpperCase()+s)}function ba(r,i){const u=A.toCamelCase(" "+i);["get","set","has"].forEach(s=>{Object.defineProperty(r,s+u,{value:function(l,d,h){return this[s].call(this,i,l,d,h)},configurable:!0})})}let He=class{constructor(i){i&&this.set(i)}set(i,u,s){const l=this;function d(S,P,C){const $=Ut(P);if(!$)throw new Error("header name must be a non-empty string");const M=A.findKey(l,$);(!M||l[M]===void 0||C===!0||C===void 0&&l[M]!==!1)&&(l[M||P]=On(S))}const h=(S,P)=>A.forEach(S,(C,$)=>d(C,$,P));if(A.isPlainObject(i)||i instanceof this.constructor)h(i,u);else if(A.isString(i)&&(i=i.trim())&&!va(i))h(ma(i),u);else if(A.isHeaders(i))for(const[S,P]of i.entries())d(P,S,s);else i!=null&&d(u,i,s);return this}get(i,u){if(i=Ut(i),i){const s=A.findKey(this,i);if(s){const l=this[s];if(!u)return l;if(u===!0)return ya(l);if(A.isFunction(u))return u.call(this,l,s);if(A.isRegExp(u))return u.exec(l);throw new TypeError("parser must be boolean|regexp|function")}}}has(i,u){if(i=Ut(i),i){const s=A.findKey(this,i);return!!(s&&this[s]!==void 0&&(!u||yr(this,this[s],s,u)))}return!1}delete(i,u){const s=this;let l=!1;function d(h){if(h=Ut(h),h){const S=A.findKey(s,h);S&&(!u||yr(s,s[S],S,u))&&(delete s[S],l=!0)}}return A.isArray(i)?i.forEach(d):d(i),l}clear(i){const u=Object.keys(this);let s=u.length,l=!1;for(;s--;){const d=u[s];(!i||yr(this,this[d],d,i,!0))&&(delete this[d],l=!0)}return l}normalize(i){const u=this,s={};return A.forEach(this,(l,d)=>{const h=A.findKey(s,d);if(h){u[h]=On(l),delete u[d];return}const S=i?ga(d):String(d).trim();S!==d&&delete u[d],u[S]=On(l),s[S]=!0}),this}concat(...i){return this.constructor.concat(this,...i)}toJSON(i){const u=Object.create(null);return A.forEach(this,(s,l)=>{s!=null&&s!==!1&&(u[l]=i&&A.isArray(s)?s.join(", "):s)}),u}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([i,u])=>i+": "+u).join(`
@@ -1,3 +1,3 @@
1
1
  export declare const toBase64: (blob: Blob) => Promise<string>;
2
- export declare const toBlob: (base64: string) => Blob;
2
+ export declare const toBlob: (base64: string, options?: BlobPropertyBag) => Blob;
3
3
  export declare const download: (filename: string, obj: Blob | MediaSource) => void;
package/package.json CHANGED
@@ -1,47 +1,47 @@
1
- {
2
- "name": "@rainte/js",
3
- "version": "0.0.49",
4
- "type": "module",
5
- "publishConfig": {
6
- "access": "public"
7
- },
8
- "files": [
9
- "dist",
10
- "index.d.ts"
11
- ],
12
- "main": "./dist/index.umd.cjs",
13
- "module": "./dist/index.js",
14
- "types": "./dist/types/lib/index.d.ts",
15
- "exports": {
16
- ".": {
17
- "types": "./dist/types/lib/index.d.ts",
18
- "import": "./dist/index.js",
19
- "require": "./dist/index.umd.cjs"
20
- },
21
- "./global": {
22
- "types": "./index.d.ts"
23
- }
24
- },
25
- "scripts": {
26
- "dev": "vite",
27
- "build": "vite build && tsc",
28
- "preview": "vite preview",
29
- "overhaul": "pnpm up -L --registry=https://registry.npmjs.org",
30
- "commit": "git add -A && git commit -m commit && git push || git push",
31
- "release": "npm publish --registry=https://registry.npmjs.org",
32
- "prepublishOnly": "npm run build && npm run commit && npm version patch",
33
- "postpublish": "git push"
34
- },
35
- "dependencies": {
36
- "axios": "^1.8.4",
37
- "dayjs": "^1.11.13",
38
- "dexie": "^4.0.11",
39
- "jsan": "^3.1.14"
40
- },
41
- "devDependencies": {
42
- "@types/jsan": "^3.1.5",
43
- "@types/node": "^22.13.14",
44
- "typescript": "^5.8.2",
45
- "vite": "^6.2.3"
46
- }
47
- }
1
+ {
2
+ "name": "@rainte/js",
3
+ "version": "0.0.50",
4
+ "type": "module",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "files": [
9
+ "dist",
10
+ "index.d.ts"
11
+ ],
12
+ "main": "./dist/index.umd.cjs",
13
+ "module": "./dist/index.js",
14
+ "types": "./dist/types/lib/index.d.ts",
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/types/lib/index.d.ts",
18
+ "import": "./dist/index.js",
19
+ "require": "./dist/index.umd.cjs"
20
+ },
21
+ "./global": {
22
+ "types": "./index.d.ts"
23
+ }
24
+ },
25
+ "scripts": {
26
+ "dev": "vite",
27
+ "build": "vite build && tsc",
28
+ "preview": "vite preview",
29
+ "overhaul": "pnpm up -L --registry=https://registry.npmjs.org",
30
+ "commit": "git add -A && git commit -m commit && git push || git push",
31
+ "release": "npm publish --registry=https://registry.npmjs.org",
32
+ "prepublishOnly": "npm run build && npm run commit && npm version patch",
33
+ "postpublish": "git push"
34
+ },
35
+ "dependencies": {
36
+ "axios": "^1.8.4",
37
+ "dayjs": "^1.11.13",
38
+ "dexie": "^4.0.11",
39
+ "jsan": "^3.1.14"
40
+ },
41
+ "devDependencies": {
42
+ "@types/jsan": "^3.1.5",
43
+ "@types/node": "^22.13.14",
44
+ "typescript": "^5.8.2",
45
+ "vite": "^6.2.3"
46
+ }
47
+ }