UNPKG

libnemo

Version:

Nano cryptocurrency wallet library.

1 lines 352 kB
var vf=Object.create;var Ii=Object.defineProperty;var af=Object.getOwnPropertyDescriptor;var cf=Object.getOwnPropertyNames;var lf=Object.getPrototypeOf,ff=Object.prototype.hasOwnProperty;var d=(n,e)=>()=>(n&&(e=n(n=0)),e);var A=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),df=(n,e)=>{for(var t in e)Ii(n,t,{get:e[t],enumerable:!0})},yf=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of cf(e))!ff.call(n,i)&&i!==t&&Ii(n,i,{get:()=>e[i],enumerable:!(r=af(e,i))||r.enumerable});return n};var Gs=(n,e,t)=>(t=n!=null?vf(lf(n)):{},yf(e||!n||!n.__esModule?Ii(t,"default",{value:n,enumerable:!0}):t,n));var Ge,un,Ft,re,N,We,b,Me,Xe,_t,$,sn,Z=d(()=>{a();Ge={AbortError:"A request was aborted, for example through a call to IDBTransaction.abort.",ConstraintError:"A mutation operation in the transaction failed because a constraint was not satisfied. For example, an object such as an object store or index already exists and a request attempted to create a new one.",DataCloneError:"The data being stored could not be cloned by the internal structured cloning algorithm.",DataError:"Data provided to an operation does not meet requirements.",InvalidAccessError:"An invalid operation was performed on an object. For example transaction creation attempt was made, but an empty scope was provided.",InvalidStateError:"An operation was called on an object on which it is not allowed or at a time when it is not allowed. Also occurs if a request is made on a source object that has been deleted or removed. Use TransactionInactiveError or ReadOnlyError when possible, as they are more specific variations of InvalidStateError.",NotFoundError:"The operation failed because the requested database object could not be found. For example, an object store did not exist but was being opened.",ReadOnlyError:'The mutating operation was attempted in a "readonly" transaction.',TransactionInactiveError:"A request was placed against a transaction which is currently not active, or which is finished.",SyntaxError:"The keypath argument contains an invalid key path",VersionError:"An attempt was made to open a database using a lower version than the existing version."},un=(n,e)=>{Object.defineProperty(n,"code",{value:e,writable:!1,enumerable:!0,configurable:!1})},Ft=class extends DOMException{constructor(e=Ge.AbortError){super(e,"AbortError")}},re=class extends DOMException{constructor(e=Ge.ConstraintError){super(e,"ConstraintError")}},N=class extends DOMException{constructor(e=Ge.DataError){super(e,"DataError"),un(this,0)}},We=class extends DOMException{constructor(e=Ge.InvalidAccessError){super(e,"InvalidAccessError")}},b=class extends DOMException{constructor(e=Ge.InvalidStateError){super(e,"InvalidStateError"),un(this,11)}},Me=class extends DOMException{constructor(e=Ge.NotFoundError){super(e,"NotFoundError")}},Xe=class extends DOMException{constructor(e=Ge.ReadOnlyError){super(e,"ReadOnlyError")}},_t=class extends DOMException{constructor(e=Ge.VersionError){super(e,"SyntaxError"),un(this,12)}},$=class extends DOMException{constructor(e=Ge.TransactionInactiveError){super(e,"TransactionInactiveError"),un(this,0)}},sn=class extends DOMException{constructor(e=Ge.VersionError){super(e,"VersionError")}}});function Xt(n){return typeof SharedArrayBuffer<"u"&&n instanceof SharedArrayBuffer}var Bi=d(()=>{a()});var Vs,C,Je=d(()=>{a();Z();Bi();Vs=(n,e)=>{if(typeof n=="number"){if(isNaN(n))throw new N;return n}else if(Object.prototype.toString.call(n)==="[object Date]"){let t=n.valueOf();if(isNaN(t))throw new N;return new Date(t)}else{if(typeof n=="string")return n;if((n instanceof ArrayBuffer||Xt(n)||typeof ArrayBuffer<"u"&&ArrayBuffer.isView&&ArrayBuffer.isView(n))&&!("detached"in n?n.detached:n.byteLength===0)){let t,r=0,i=0;return n instanceof ArrayBuffer||Xt(n)?(t=n,i=n.byteLength):(t=n.buffer,r=n.byteOffset,i=n.byteLength),t.slice(r,r+i)}else if(Array.isArray(n)){if(e===void 0)e=new Set;else if(e.has(n))throw new N;e.add(n);let t=[];for(let r=0;r<n.length;r++){if(!Object.hasOwn(n,r))throw new N;let o=n[r],s=Vs(o,e);t.push(s)}return t}else throw new N}},C=Vs});var js,qs,T,Jt=d(()=>{a();Z();Je();js=n=>{if(typeof n=="number")return"Number";if(Object.prototype.toString.call(n)==="[object Date]")return"Date";if(Array.isArray(n))return"Array";if(typeof n=="string")return"String";if(n instanceof ArrayBuffer)return"Binary";throw new N},qs=(n,e)=>{if(e===void 0)throw new TypeError;n=C(n),e=C(e);let t=js(n),r=js(e);if(t!==r)return t==="Array"||t==="Binary"&&(r==="String"||r==="Date"||r==="Number")||t==="String"&&(r==="Date"||r==="Number")||t==="Date"&&r==="Number"?1:-1;if(t==="Binary"&&(n=new Uint8Array(n),e=new Uint8Array(e)),t==="Array"||t==="Binary"){let i=Math.min(n.length,e.length);for(let o=0;o<i;o++){let s=qs(n[o],e[o]);if(s!==0)return s}return n.length>e.length?1:n.length<e.length?-1:0}if(t==="Date"){if(n.getTime()===e.getTime())return 0}else if(n===e)return 0;return n>e?1:-1},T=qs});var Di,D,Ze=d(()=>{a();Jt();Z();Je();Di=class n{static only(e){if(arguments.length===0)throw new TypeError;return e=C(e),new n(e,e,!1,!1)}static lowerBound(e,t=!1){if(arguments.length===0)throw new TypeError;return e=C(e),new n(e,void 0,t,!0)}static upperBound(e,t=!1){if(arguments.length===0)throw new TypeError;return e=C(e),new n(void 0,e,!0,t)}static bound(e,t,r=!1,i=!1){if(arguments.length<2)throw new TypeError;let o=T(e,t);if(o===1||o===0&&(r||i))throw new N;return e=C(e),t=C(t),new n(e,t,r,i)}constructor(e,t,r,i){this.lower=e,this.upper=t,this.lowerOpen=r,this.upperOpen=i}includes(e){if(arguments.length===0)throw new TypeError;if(e=C(e),this.lower!==void 0){let t=T(this.lower,e);if(t===1||t===0&&this.lowerOpen)return!1}if(this.upper!==void 0){let t=T(this.upper,e);if(t===-1||t===0&&this.upperOpen)return!1}return!0}get[Symbol.toStringTag](){return"IDBKeyRange"}},D=Di});var $s,ht,Ir=d(()=>{a();Je();$s=(n,e)=>{if(Array.isArray(n)){let i=[];for(let o of n){o!=null&&typeof o!="string"&&o.toString&&(o=o.toString());let s=$s(o,e).key;i.push(C(s))}return{type:"found",key:i}}if(n==="")return{type:"found",key:e};let t=n,r=e;for(;t!==null;){let i,o=t.indexOf(".");if(o>=0?(i=t.slice(0,o),t=t.slice(o+1)):(i=t,t=null),!(i==="length"&&(typeof r=="string"||Array.isArray(r))||(i==="size"||i==="type")&&typeof Blob<"u"&&r instanceof Blob||(i==="name"||i==="lastModified")&&typeof File<"u"&&r instanceof File)&&(typeof r!="object"||r===null||!Object.hasOwn(r,i)))return{type:"notFound"};r=r[i]}return{type:"found",key:r}},ht=$s});var Br,vn,Si,pt,Dr=d(()=>{a();Ze();an();Jt();Z();Ir();Je();Br=n=>n.source instanceof se?n.source:n.source.objectStore,vn=(n,e,t)=>{let r=n!==void 0?n.lower:void 0,i=n!==void 0?n.upper:void 0;for(let o of e)o!==void 0&&(r===void 0||T(r,o)===1)&&(r=o);for(let o of t)o!==void 0&&(i===void 0||T(i,o)===-1)&&(i=o);if(r!==void 0&&i!==void 0)return D.bound(r,i);if(r!==void 0)return D.lowerBound(r);if(i!==void 0)return D.upperBound(i)},Si=class{_gotValue=!1;_position=void 0;_objectStorePosition=void 0;_keyOnly=!1;_key=void 0;_primaryKey=void 0;constructor(e,t,r="next",i,o=!1){this._range=t,this._source=e,this._direction=r,this._request=i,this._keyOnly=o}get source(){return this._source}set source(e){}get request(){return this._request}set request(e){}get direction(){return this._direction}set direction(e){}get key(){return this._key}set key(e){}get primaryKey(){return this._primaryKey}set primaryKey(e){}_iterate(e,t){let r=this.source instanceof se,i=this.source instanceof se?this.source._rawObjectStore.records:this.source._rawIndex.records,o;if(this.direction==="next"){let u=vn(this._range,[e,this._position],[]);for(let v of i.values(u)){let c=e!==void 0?T(v.key,e):void 0,l=this._position!==void 0?T(v.key,this._position):void 0;if(!(e!==void 0&&c===-1)){if(t!==void 0){if(c===-1)continue;let y=T(v.value,t);if(c===0&&y===-1)continue}if(!(this._position!==void 0&&r&&l!==1)&&!(this._position!==void 0&&!r&&(l===-1||l===0&&T(v.value,this._objectStorePosition)!==1))&&!(this._range!==void 0&&!this._range.includes(v.key))){o=v;break}}}}else if(this.direction==="nextunique"){let u=vn(this._range,[e,this._position],[]);for(let v of i.values(u))if(!(e!==void 0&&T(v.key,e)===-1)&&!(this._position!==void 0&&T(v.key,this._position)!==1)&&!(this._range!==void 0&&!this._range.includes(v.key))){o=v;break}}else if(this.direction==="prev"){let u=vn(this._range,[],[e,this._position]);for(let v of i.values(u,"prev")){let c=e!==void 0?T(v.key,e):void 0,l=this._position!==void 0?T(v.key,this._position):void 0;if(!(e!==void 0&&c===1)){if(t!==void 0){if(c===1)continue;let y=T(v.value,t);if(c===0&&y===1)continue}if(!(this._position!==void 0&&r&&l!==-1)&&!(this._position!==void 0&&!r&&(l===1||l===0&&T(v.value,this._objectStorePosition)!==-1))&&!(this._range!==void 0&&!this._range.includes(v.key))){o=v;break}}}}else if(this.direction==="prevunique"){let u,v=vn(this._range,[],[e,this._position]);for(let c of i.values(v,"prev"))if(!(e!==void 0&&T(c.key,e)===1)&&!(this._position!==void 0&&T(c.key,this._position)!==-1)&&!(this._range!==void 0&&!this._range.includes(c.key))){u=c;break}u&&(o=i.get(u.key))}let s;if(!o)this._key=void 0,r||(this._objectStorePosition=void 0),!this._keyOnly&&this.toString()==="[object IDBCursorWithValue]"&&(this.value=void 0),s=null;else{if(this._position=o.key,r||(this._objectStorePosition=o.value),this._key=o.key,r)this._primaryKey=structuredClone(o.key),!this._keyOnly&&this.toString()==="[object IDBCursorWithValue]"&&(this.value=structuredClone(o.value));else if(this._primaryKey=structuredClone(o.value),!this._keyOnly&&this.toString()==="[object IDBCursorWithValue]"){if(this.source instanceof se)throw new Error("This should never happen");let u=this.source.objectStore._rawObjectStore.getValue(o.value);this.value=structuredClone(u)}this._gotValue=!0,s=this}return s}update(e){if(e===void 0)throw new TypeError;let t=Br(this),r=Object.hasOwn(this.source,"_rawIndex")?this.primaryKey:this._position,i=t.transaction;if(i._state!=="active")throw new $;if(i.mode==="readonly")throw new Xe;if(t._rawObjectStore.deleted)throw new b;if(!(this.source instanceof se)&&this.source._rawIndex.deleted)throw new b;if(!this._gotValue||!Object.hasOwn(this,"value"))throw new b;let o=structuredClone(e);if(t.keyPath!==null){let u;try{u=ht(t.keyPath,o).key}catch{}if(T(u,r)!==0)throw new N}let s={key:r,value:o};return i._execRequestAsync({operation:t._rawObjectStore.storeRecord.bind(t._rawObjectStore,s,!1,i._rollbackLog),source:this})}advance(e){if(!Number.isInteger(e)||e<=0)throw new TypeError;let t=Br(this),r=t.transaction;if(r._state!=="active")throw new $;if(t._rawObjectStore.deleted)throw new b;if(!(this.source instanceof se)&&this.source._rawIndex.deleted)throw new b;if(!this._gotValue)throw new b;this._request&&(this._request.readyState="pending"),r._execRequestAsync({operation:()=>{let i;for(let o=0;o<e&&(i=this._iterate(),!!i);o++);return i},request:this._request,source:this.source}),this._gotValue=!1}continue(e){let t=Br(this),r=t.transaction;if(r._state!=="active")throw new $;if(t._rawObjectStore.deleted)throw new b;if(!(this.source instanceof se)&&this.source._rawIndex.deleted)throw new b;if(!this._gotValue)throw new b;if(e!==void 0){e=C(e);let i=T(e,this._position);if(i<=0&&(this.direction==="next"||this.direction==="nextunique")||i>=0&&(this.direction==="prev"||this.direction==="prevunique"))throw new N}this._request&&(this._request.readyState="pending"),r._execRequestAsync({operation:this._iterate.bind(this,e),request:this._request,source:this.source}),this._gotValue=!1}continuePrimaryKey(e,t){let r=Br(this),i=r.transaction;if(i._state!=="active")throw new $;if(r._rawObjectStore.deleted)throw new b;if(!(this.source instanceof se)&&this.source._rawIndex.deleted)throw new b;if(this.source instanceof se||this.direction!=="next"&&this.direction!=="prev")throw new We;if(!this._gotValue)throw new b;if(e===void 0||t===void 0)throw new N;e=C(e);let o=T(e,this._position);if(o===-1&&this.direction==="next"||o===1&&this.direction==="prev")throw new N;let s=T(t,this._objectStorePosition);if(o===0&&(s<=0&&this.direction==="next"||s>=0&&this.direction==="prev"))throw new N;this._request&&(this._request.readyState="pending"),i._execRequestAsync({operation:this._iterate.bind(this,e,t),request:this._request,source:this.source}),this._gotValue=!1}delete(){let e=Br(this),t=Object.hasOwn(this.source,"_rawIndex")?this.primaryKey:this._position,r=e.transaction;if(r._state!=="active")throw new $;if(r.mode==="readonly")throw new Xe;if(e._rawObjectStore.deleted)throw new b;if(!(this.source instanceof se)&&this.source._rawIndex.deleted)throw new b;if(!this._gotValue||!Object.hasOwn(this,"value"))throw new b;return r._execRequestAsync({operation:e._rawObjectStore.deleteRecord.bind(e._rawObjectStore,t,r._rollbackLog),source:this})}get[Symbol.toStringTag](){return"IDBCursor"}},pt=Si});var Ci,Zt,cn=d(()=>{a();Dr();Ci=class extends pt{value=void 0;constructor(e,t,r,i){super(e,t,r,i)}get[Symbol.toStringTag](){return"IDBCursorWithValue"}},Zt=Ci});var Ks,Fi,_i,er,ln=d(()=>{a();Z();Ks=(n,e)=>n.immediatePropagationStopped||n.eventPhase===n.CAPTURING_PHASE&&e.capture===!1||n.eventPhase===n.BUBBLING_PHASE&&e.capture===!0,Fi=(n,e)=>{n.currentTarget=e;for(let o of e.listeners.slice())n.type!==o.type||Ks(n,o)||o.callback.call(n.currentTarget,n);let r={abort:"onabort",blocked:"onblocked",close:"onclose",complete:"oncomplete",error:"onerror",success:"onsuccess",upgradeneeded:"onupgradeneeded",versionchange:"onversionchange"}[n.type];if(r===void 0)throw new Error(`Unknown event type: "${n.type}"`);let i=n.currentTarget[r];if(i){let o={callback:i,capture:!1,type:n.type};Ks(n,o)||o.callback.call(n.currentTarget,n)}},_i=class{listeners=[];addEventListener(e,t,r=!1){this.listeners.push({callback:t,capture:r,type:e})}removeEventListener(e,t,r=!1){let i=this.listeners.findIndex(o=>o.type===e&&o.callback===t&&o.capture===r);this.listeners.splice(i,1)}dispatchEvent(e){if(e.dispatched||!e.initialized)throw new b("The object is in an invalid state.");e.isTrusted=!1,e.dispatched=!0,e.target=this,e.eventPhase=e.CAPTURING_PHASE;for(let t of e.eventPath)e.propagationStopped||Fi(e,t);if(e.eventPhase=e.AT_TARGET,e.propagationStopped||Fi(e,e.target),e.bubbles){e.eventPath.reverse(),e.eventPhase=e.BUBBLING_PHASE;for(let t of e.eventPath)e.propagationStopped||Fi(e,t)}return e.dispatched=!1,e.eventPhase=e.NONE,e.currentTarget=null,!e.canceled}},er=_i});var Ti,ge,tr=d(()=>{a();Z();ln();Ti=class extends er{_result=null;_error=null;source=null;transaction=null;readyState="pending";onsuccess=null;onerror=null;get error(){if(this.readyState==="pending")throw new b;return this._error}set error(e){this._error=e}get result(){if(this.readyState==="pending")throw new b;return this._result}set result(e){this._result=e}get[Symbol.toStringTag](){return"IDBRequest"}},ge=Ti});var Pi,K,Sr=d(()=>{a();Pi=class{constructor(...e){this._values=e;for(let t=0;t<e.length;t++)this[t]=e[t]}contains(e){return this._values.includes(e)}item(e){return e<0||e>=this._values.length?null:this._values[e]}get length(){return this._values.length}[Symbol.iterator](){return this._values[Symbol.iterator]()}_push(...e){for(let t=0;t<e.length;t++)this[this._values.length+t]=e[t];this._values.push(...e)}_sort(...e){this._values.sort(...e);for(let t=0;t<this._values.length;t++)this[t]=this._values[t];return this}},K=Pi});var hf,xt,Ri=d(()=>{a();Ze();Z();Je();hf=(n,e=!1)=>{if(n instanceof D)return n;if(n==null){if(e)throw new N;return new D(void 0,void 0,!1,!1)}let t=C(n);return D.only(t)},xt=hf});function fn(n){return Array.isArray(n)?n.map(zs):zs(n)}var zs,Ui=d(()=>{a();zs=n=>typeof n=="object"&&n?n+"":n});var pf,Hs,Ys=d(()=>{a();Ze();Bi();pf=n=>n instanceof D||n===null||n===void 0||typeof n=="number"||Object.prototype.toString.call(n)==="[object Date]"||typeof n=="string"||n instanceof ArrayBuffer||Xt(n)||typeof ArrayBuffer<"u"&&ArrayBuffer.isView&&ArrayBuffer.isView(n)||Array.isArray(n),Hs=pf});var xf,et,Cr=d(()=>{a();xf=(n,e)=>{let r=e==="unsigned long"?4294967295:9007199254740991;if(isNaN(n)||n<0||n>r)throw new TypeError;if(n>=0)return Math.floor(n)},et=xf});var mf,rr,Ni=d(()=>{a();Ys();Cr();mf=(n,e,t)=>{let r,i;if(Hs(n))r=n,t>1&&e!==void 0&&(e=et(e,"unsigned long"));else{let o=n;o.query!==void 0&&(r=o.query),o.count!==void 0&&(e=et(o.count,"unsigned long")),o.direction!==void 0&&(i=o.direction)}return{query:r,count:e,direction:i}},rr=mf});var mt,Oi,Fr,ki=d(()=>{a();Dr();cn();Ze();tr();Z();Sr();Je();Ri();Ui();Ni();Cr();mt=n=>{if(n._rawIndex.deleted||n.objectStore._rawObjectStore.deleted)throw new b;if(n.objectStore.transaction._state!=="active")throw new $},Oi=class{constructor(e,t){this._rawIndex=t,this._name=t.name,this.objectStore=e,this.keyPath=fn(t.keyPath),this.multiEntry=t.multiEntry,this.unique=t.unique}get name(){return this._name}set name(e){let t=this.objectStore.transaction;if(!t.db._runningVersionchangeTransaction)throw t._state==="active"?new b:new $;if(t._state!=="active")throw new $;if(this._rawIndex.deleted||this.objectStore._rawObjectStore.deleted)throw new b;if(e=String(e),e===this._name)return;if(this.objectStore.indexNames.contains(e))throw new re;let r=this._name,i=[...this.objectStore.indexNames];this._name=e,this._rawIndex.name=e,this.objectStore._indexesCache.delete(r),this.objectStore._indexesCache.set(e,this),this.objectStore._rawObjectStore.rawIndexes.delete(r),this.objectStore._rawObjectStore.rawIndexes.set(e,this._rawIndex),this.objectStore.indexNames=new K(...Array.from(this.objectStore._rawObjectStore.rawIndexes.keys()).filter(o=>{let s=this.objectStore._rawObjectStore.rawIndexes.get(o);return s&&!s.deleted}).sort()),t._rollbackLog.push(()=>{this._name=r,this._rawIndex.name=r,this.objectStore._indexesCache.delete(e),this.objectStore._indexesCache.set(r,this),this.objectStore._rawObjectStore.rawIndexes.delete(e),this.objectStore._rawObjectStore.rawIndexes.set(r,this._rawIndex),this.objectStore.indexNames=new K(...i)})}openCursor(e,t){mt(this),e===null&&(e=void 0),e!==void 0&&!(e instanceof D)&&(e=D.only(C(e)));let r=new ge;r.source=this,r.transaction=this.objectStore.transaction;let i=new Zt(this,e,t,r);return this.objectStore.transaction._execRequestAsync({operation:i._iterate.bind(i),request:r,source:this})}openKeyCursor(e,t){mt(this),e===null&&(e=void 0),e!==void 0&&!(e instanceof D)&&(e=D.only(C(e)));let r=new ge;r.source=this,r.transaction=this.objectStore.transaction;let i=new pt(this,e,t,r,!0);return this.objectStore.transaction._execRequestAsync({operation:i._iterate.bind(i),request:r,source:this})}get(e){return mt(this),e instanceof D||(e=C(e)),this.objectStore.transaction._execRequestAsync({operation:this._rawIndex.getValue.bind(this._rawIndex,e),source:this})}getAll(e,t){let r=rr(e,t,arguments.length);mt(this);let i=xt(r.query);return this.objectStore.transaction._execRequestAsync({operation:this._rawIndex.getAllValues.bind(this._rawIndex,i,r.count,r.direction),source:this})}getKey(e){return mt(this),e instanceof D||(e=C(e)),this.objectStore.transaction._execRequestAsync({operation:this._rawIndex.getKey.bind(this._rawIndex,e),source:this})}getAllKeys(e,t){let r=rr(e,t,arguments.length);mt(this);let i=xt(r.query);return this.objectStore.transaction._execRequestAsync({operation:this._rawIndex.getAllKeys.bind(this._rawIndex,i,r.count,r.direction),source:this})}getAllRecords(e){let t,r,i;e!==void 0&&(e.query!==void 0&&(t=e.query),e.count!==void 0&&(r=et(e.count,"unsigned long")),e.direction!==void 0&&(i=e.direction)),mt(this);let o=xt(t);return this.objectStore.transaction._execRequestAsync({operation:this._rawIndex.getAllRecords.bind(this._rawIndex,o,r,i),source:this})}count(e){return mt(this),e===null&&(e=void 0),e!==void 0&&!(e instanceof D)&&(e=D.only(C(e))),this.objectStore.transaction._execRequestAsync({operation:()=>this._rawIndex.count(e),source:this})}get[Symbol.toStringTag](){return"IDBIndex"}},Fr=Oi});var gf,Ws,Xs=d(()=>{a();gf=(n,e)=>{if(Array.isArray(n))throw new Error("The key paths used in this section are always strings and never sequences, since it is not possible to create a object store which has a key generator and also has a key path that is a sequence.");let t=n.split(".");if(t.length===0)throw new Error("Assert: identifiers is not empty");t.pop();for(let r of t){if(typeof e!="object"&&!Array.isArray(e))return!1;if(!Object.hasOwn(e,r))return!0;e=e[r]}return typeof e=="object"||Array.isArray(e)},Ws=gf});var Li,nr,dn=d(()=>{a();Li=class{constructor(e,t,r){this._key=e,this._primaryKey=t,this._value=r}get key(){return this._key}set key(e){}get primaryKey(){return this._primaryKey}set primaryKey(e){}get value(){return this._value}set value(e){}get[Symbol.toStringTag](){return"IDBRecord"}},nr=Li});var Af,wf,ir,Js=d(()=>{a();Ze();Jt();Z();Af=2/3,wf=new D(void 0,void 0,!1,!1),ir=class{_numTombstones=0;_numNodes=0;constructor(e){this._keysAreUnique=!!e}size(){return this._numNodes-this._numTombstones}get(e){return this._getByComparator(this._root,t=>this._compare(e,t))}contains(e){return!!this.get(e)}_compare(e,t){let r=T(e.key,t.key);return r!==0?r:this._keysAreUnique?0:T(e.value,t.value)}_getByComparator(e,t){let r=e;for(;r;){let i=t(r.record);if(i<0)r=r.left;else if(i>0)r=r.right;else return r.record}}put(e,t=!1){if(!this._root){this._root={record:e,left:void 0,right:void 0,parent:void 0,deleted:!1,red:!1},this._numNodes++;return}return this._put(this._root,e,t)}_put(e,t,r){let i=this._compare(t,e.record);if(i<0){if(e.left)return this._put(e.left,t,r);e.left={record:t,left:void 0,right:void 0,parent:e,deleted:!1,red:!0},this._onNewNodeInserted(e.left)}else if(i>0){if(e.right)return this._put(e.right,t,r);e.right={record:t,left:void 0,right:void 0,parent:e,deleted:!1,red:!0},this._onNewNodeInserted(e.right)}else if(e.deleted)e.deleted=!1,e.record=t,this._numTombstones--;else{if(r)throw new re;{let o=e.record;return e.record=t,o}}}delete(e){if(this._root&&(this._delete(this._root,e),this._numTombstones>this._numNodes*Af)){let t=[...this.getAllRecords()];this._root=this._rebuild(t,void 0,!1),this._numNodes=t.length,this._numTombstones=0}}_delete(e,t){if(!e)return;let r=this._compare(t,e.record);r<0?this._delete(e.left,t):r>0?this._delete(e.right,t):e.deleted||(this._numTombstones++,e.deleted=!0)}*getAllRecords(e=!1){yield*this.getRecords(wf,e)}*getRecords(e,t=!1){yield*this._getRecordsForNode(this._root,e,t)}*_getRecordsForNode(e,t,r=!1){e&&(yield*this._findRecords(e,t,r))}*_findRecords(e,t,r=!1){let{lower:i,upper:o,lowerOpen:s,upperOpen:u}=t,{record:{key:v}}=e,c=i===void 0?-1:T(i,v),l=o===void 0?1:T(o,v),y=this._keysAreUnique?c<0:c<=0,x=this._keysAreUnique?l>0:l>=0,p=r?x:y,B=r?y:x,w=r?"right":"left",q=r?"left":"right",ee=s?c<0:c<=0,te=u?l>0:l>=0;p&&e[w]&&(yield*this._findRecords(e[w],t,r)),ee&&te&&!e.deleted&&(yield e.record),B&&e[q]&&(yield*this._findRecords(e[q],t,r))}_onNewNodeInserted(e){this._numNodes++,this._rebalanceTree(e)}_rebalanceTree(e){let t=e.parent;do{if(!t.red)return;let r=t.parent;if(!r){t.red=!1;return}let i=t===r.right,o=i?r.left:r.right;if(!o||!o.red){e===(i?t.left:t.right)&&(this._rotateSubtree(t,i),e=t,t=i?r.right:r.left),this._rotateSubtree(r,!i),t.red=!1,r.red=!0;return}t.red=!1,o.red=!1,r.red=!0,e=r}while(e.parent&&(t=e.parent))}_rotateSubtree(e,t){let r=e.parent,i=t?e.left:e.right,o=t?i.right:i.left;return e[t?"left":"right"]=o,o&&(o.parent=e),i[t?"right":"left"]=e,i.parent=r,e.parent=i,r?r[e===r.right?"right":"left"]=i:this._root=i,i}_rebuild(e,t,r){let{length:i}=e;if(!i)return;let o=i>>>1,s={record:e[o],left:void 0,right:void 0,parent:t,deleted:!1,red:r},u=this._rebuild(e.slice(0,o),s,!r),v=this._rebuild(e.slice(o+1),s,!r);return s.left=u,s.right=v,s}}});var Qi,yn,Mi=d(()=>{a();Ze();Jt();Js();Qi=class{constructor(e){this.keysAreUnique=e,this.records=new ir(this.keysAreUnique)}get(e){let t=e instanceof D?e:D.only(e);return this.records.getRecords(t).next().value}put(e,t=!1){return this.records.put(e,t)}delete(e){let t=e instanceof D?e:D.only(e),r=[...this.records.getRecords(t)];for(let i of r)this.records.delete(i);return r}deleteByValue(e){let t=e instanceof D?e:D.only(e),r=[];for(let i of this.records.getAllRecords())t.includes(i.value)&&(this.records.delete(i),r.push(i));return r}clear(){let e=[...this.records.getAllRecords()];return this.records=new ir(this.keysAreUnique),e}values(e,t="next"){let r=t==="prev"||t==="prevunique",i=e?this.records.getRecords(e,r):this.records.getAllRecords(r);return{[Symbol.iterator]:()=>{let o=()=>i.next();if(t==="next"||t==="prev")return{next:o};if(t==="nextunique"){let v;return{next:()=>{let c=o();for(;!c.done&&v!==void 0&&T(v.key,c.value.key)===0;)c=o();return v=c.value,c}}}let s=o(),u=o();return{next:()=>{for(;!u.done&&T(s.value.key,u.value.key)===0;)s=u,u=o();let v=s;return s=u,u=o(),v}}}}}size(){return this.records.size()}},yn=Qi});var Gi,Zs,eu=d(()=>{a();dn();Z();Ir();Mi();Je();Gi=class{deleted=!1;initialized=!1;constructor(e,t,r,i,o){this.rawObjectStore=e,this.name=t,this.keyPath=r,this.multiEntry=i,this.unique=o,this.records=new yn(o)}getKey(e){let t=this.records.get(e);return t!==void 0?t.value:void 0}getAllKeys(e,t,r){(t===void 0||t===0)&&(t=1/0);let i=[];for(let o of this.records.values(e,r))if(i.push(structuredClone(o.value)),i.length>=t)break;return i}getValue(e){let t=this.records.get(e);return t!==void 0?this.rawObjectStore.getValue(t.value):void 0}getAllValues(e,t,r){(t===void 0||t===0)&&(t=1/0);let i=[];for(let o of this.records.values(e,r))if(i.push(this.rawObjectStore.getValue(o.value)),i.length>=t)break;return i}getAllRecords(e,t,r){(t===void 0||t===0)&&(t=1/0);let i=[];for(let o of this.records.values(e,r))if(i.push(new nr(structuredClone(o.key),structuredClone(this.rawObjectStore.getKey(o.value)),this.rawObjectStore.getValue(o.value))),i.length>=t)break;return i}storeRecord(e){let t;try{t=ht(this.keyPath,e.value).key}catch(r){if(r.name==="DataError")return;throw r}if(!this.multiEntry||!Array.isArray(t))try{C(t)}catch{return}else{let r=[];for(let i of t)if(r.indexOf(i)<0)try{r.push(C(i))}catch{}t=r}if(!this.multiEntry||!Array.isArray(t)){if(this.unique&&this.records.get(t))throw new re}else if(this.unique){for(let r of t)if(this.records.get(r))throw new re}if(!this.multiEntry||!Array.isArray(t))this.records.put({key:t,value:e.key});else for(let r of t)this.records.put({key:r,value:e.key})}initialize(e){if(this.initialized)throw new Error("Index already initialized");e._execRequestAsync({operation:()=>{try{for(let t of this.rawObjectStore.records.values())this.storeRecord(t);this.initialized=!0}catch(t){e._abort(t.name)}},source:null})}count(e){let t=0;for(let r of this.records.values(e))t+=1;return t}},Zs=Gi});var Vi,hn,ji=d(()=>{a();Z();Vi=(n,e)=>{if(n!=null&&typeof n!="string"&&n.toString&&(e==="array"||!Array.isArray(n))&&(n=n.toString()),typeof n=="string"){if(n===""&&e!=="string")return;try{let t=/^(?:[$A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC])(?:[$0-9A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC])*$/;if(n.length>=1&&t.test(n))return}catch(t){throw new _t(t.message)}if(n.indexOf(" ")>=0)throw new _t("The keypath argument contains an invalid key path (no spaces allowed).")}if(Array.isArray(n)&&n.length>0){if(e)throw new _t("The keypath argument contains an invalid key path (nested arrays).");for(let t of n)Vi(t,"array");return}else if(typeof n=="string"&&n.indexOf(".")>=0){n=n.split(".");for(let t of n)Vi(t,"string");return}throw new _t},hn=Vi});var ce,tu,qi,se,an=d(()=>{a();Dr();cn();ki();Ze();tr();Xs();Z();Ir();Sr();eu();ji();Je();Ri();Ui();Ni();Cr();ce=n=>{if(n._rawObjectStore.deleted)throw new b;if(n.transaction._state!=="active")throw new $},tu=(n,e,t)=>{if(ce(n),n.transaction.mode==="readonly")throw new Xe;if(n.keyPath!==null&&t!==void 0)throw new N;let r=structuredClone(e);if(n.keyPath!==null){let i=ht(n.keyPath,r);if(i.type==="found")C(i.key);else if(n._rawObjectStore.keyGenerator){if(!Ws(n.keyPath,r))throw new N}else throw new N}if(n.keyPath===null&&n._rawObjectStore.keyGenerator===null&&t===void 0)throw new N;return t!==void 0&&(t=C(t)),{key:t,value:r}},qi=class{_indexesCache=new Map;constructor(e,t){this._rawObjectStore=t,this._name=t.name,this.keyPath=fn(t.keyPath),this.autoIncrement=t.autoIncrement,this.transaction=e,this.indexNames=new K(...Array.from(t.rawIndexes.keys()).sort())}get name(){return this._name}set name(e){let t=this.transaction;if(!t.db._runningVersionchangeTransaction)throw t._state==="active"?new b:new $;if(ce(this),e=String(e),e===this._name)return;if(this._rawObjectStore.rawDatabase.rawObjectStores.has(e))throw new re;let r=this._name,i=[...t.db.objectStoreNames];this._name=e,this._rawObjectStore.name=e,this.transaction._objectStoresCache.delete(r),this.transaction._objectStoresCache.set(e,this),this._rawObjectStore.rawDatabase.rawObjectStores.delete(r),this._rawObjectStore.rawDatabase.rawObjectStores.set(e,this._rawObjectStore),t.db.objectStoreNames=new K(...Array.from(this._rawObjectStore.rawDatabase.rawObjectStores.keys()).filter(u=>{let v=this._rawObjectStore.rawDatabase.rawObjectStores.get(u);return v&&!v.deleted}).sort());let o=new Set(t._scope),s=[...t.objectStoreNames];this.transaction._scope.delete(r),t._scope.add(e),t.objectStoreNames=new K(...Array.from(t._scope).sort()),t._rollbackLog.push(()=>{this._name=r,this._rawObjectStore.name=r,this.transaction._objectStoresCache.delete(e),this.transaction._objectStoresCache.set(r,this),this._rawObjectStore.rawDatabase.rawObjectStores.delete(e),this._rawObjectStore.rawDatabase.rawObjectStores.set(r,this._rawObjectStore),t.db.objectStoreNames=new K(...i),t._scope=o,t.objectStoreNames=new K(...s)})}put(e,t){if(arguments.length===0)throw new TypeError;let r=tu(this,e,t);return this.transaction._execRequestAsync({operation:this._rawObjectStore.storeRecord.bind(this._rawObjectStore,r,!1,this.transaction._rollbackLog),source:this})}add(e,t){if(arguments.length===0)throw new TypeError;let r=tu(this,e,t);return this.transaction._execRequestAsync({operation:this._rawObjectStore.storeRecord.bind(this._rawObjectStore,r,!0,this.transaction._rollbackLog),source:this})}delete(e){if(arguments.length===0)throw new TypeError;if(ce(this),this.transaction.mode==="readonly")throw new Xe;return e instanceof D||(e=C(e)),this.transaction._execRequestAsync({operation:this._rawObjectStore.deleteRecord.bind(this._rawObjectStore,e,this.transaction._rollbackLog),source:this})}get(e){if(arguments.length===0)throw new TypeError;return ce(this),e instanceof D||(e=C(e)),this.transaction._execRequestAsync({operation:this._rawObjectStore.getValue.bind(this._rawObjectStore,e),source:this})}getAll(e,t){let r=rr(e,t,arguments.length);ce(this);let i=xt(r.query);return this.transaction._execRequestAsync({operation:this._rawObjectStore.getAllValues.bind(this._rawObjectStore,i,r.count,r.direction),source:this})}getKey(e){if(arguments.length===0)throw new TypeError;return ce(this),e instanceof D||(e=C(e)),this.transaction._execRequestAsync({operation:this._rawObjectStore.getKey.bind(this._rawObjectStore,e),source:this})}getAllKeys(e,t){let r=rr(e,t,arguments.length);ce(this);let i=xt(r.query);return this.transaction._execRequestAsync({operation:this._rawObjectStore.getAllKeys.bind(this._rawObjectStore,i,r.count,r.direction),source:this})}getAllRecords(e){let t,r,i;e!==void 0&&(e.query!==void 0&&(t=e.query),e.count!==void 0&&(r=et(e.count,"unsigned long")),e.direction!==void 0&&(i=e.direction)),ce(this);let o=xt(t);return this.transaction._execRequestAsync({operation:this._rawObjectStore.getAllRecords.bind(this._rawObjectStore,o,r,i),source:this})}clear(){if(ce(this),this.transaction.mode==="readonly")throw new Xe;return this.transaction._execRequestAsync({operation:this._rawObjectStore.clear.bind(this._rawObjectStore,this.transaction._rollbackLog),source:this})}openCursor(e,t){ce(this),e===null&&(e=void 0),e!==void 0&&!(e instanceof D)&&(e=D.only(C(e)));let r=new ge;r.source=this,r.transaction=this.transaction;let i=new Zt(this,e,t,r);return this.transaction._execRequestAsync({operation:i._iterate.bind(i),request:r,source:this})}openKeyCursor(e,t){ce(this),e===null&&(e=void 0),e!==void 0&&!(e instanceof D)&&(e=D.only(C(e)));let r=new ge;r.source=this,r.transaction=this.transaction;let i=new pt(this,e,t,r,!0);return this.transaction._execRequestAsync({operation:i._iterate.bind(i),request:r,source:this})}createIndex(e,t,r={}){if(arguments.length<2)throw new TypeError;let i=r.multiEntry!==void 0?r.multiEntry:!1,o=r.unique!==void 0?r.unique:!1;if(this.transaction.mode!=="versionchange")throw new b;if(ce(this),this.indexNames.contains(e))throw new re;if(hn(t),Array.isArray(t)&&i)throw new We;let s=[...this.indexNames];this.transaction._rollbackLog.push(()=>{let v=this._rawObjectStore.rawIndexes.get(e);v&&(v.deleted=!0),this.indexNames=new K(...s),this._rawObjectStore.rawIndexes.delete(e)});let u=new Zs(this._rawObjectStore,e,t,i,o);return this.indexNames._push(e),this.indexNames._sort(),this._rawObjectStore.rawIndexes.set(e,u),u.initialize(this.transaction),new Fr(this,u)}index(e){if(arguments.length===0)throw new TypeError;if(this._rawObjectStore.deleted||this.transaction._state==="finished")throw new b;let t=this._indexesCache.get(e);if(t!==void 0)return t;let r=this._rawObjectStore.rawIndexes.get(e);if(!this.indexNames.contains(e)||r===void 0)throw new Me;let i=new Fr(this,r);return this._indexesCache.set(e,i),i}deleteIndex(e){if(arguments.length===0)throw new TypeError;if(this.transaction.mode!=="versionchange")throw new b;ce(this);let t=this._rawObjectStore.rawIndexes.get(e);if(t===void 0)throw new Me;this.transaction._rollbackLog.push(()=>{t.deleted=!1,this._rawObjectStore.rawIndexes.set(e,t),this.indexNames._push(e),this.indexNames._sort()}),this.indexNames=new K(...Array.from(this.indexNames).filter(r=>r!==e)),t.deleted=!0,this.transaction._execRequestAsync({operation:()=>{let r=this._rawObjectStore.rawIndexes.get(e);t===r&&this._rawObjectStore.rawIndexes.delete(e)},source:this})}count(e){return ce(this),e===null&&(e=void 0),e!==void 0&&!(e instanceof D)&&(e=D.only(C(e))),this.transaction._execRequestAsync({operation:()=>this._rawObjectStore.count(e),source:this})}get[Symbol.toStringTag](){return"IDBObjectStore"}},se=qi});var $i,le,_r=d(()=>{a();$i=class{eventPath=[];NONE=0;CAPTURING_PHASE=1;AT_TARGET=2;BUBBLING_PHASE=3;propagationStopped=!1;immediatePropagationStopped=!1;canceled=!1;initialized=!0;dispatched=!1;target=null;currentTarget=null;eventPhase=0;defaultPrevented=!1;isTrusted=!1;timeStamp=Date.now();constructor(e,t={}){this.type=e,this.bubbles=t.bubbles!==void 0?t.bubbles:!1,this.cancelable=t.cancelable!==void 0?t.cancelable:!1}preventDefault(){this.cancelable&&(this.canceled=!0)}stopPropagation(){this.propagationStopped=!0}stopImmediatePropagation(){this.propagationStopped=!0,this.immediatePropagationStopped=!0}},le=$i});function Ef(){if(typeof navigator<"u"&&/jsdom/.test(navigator.userAgent)){let n=Node.constructor;return new n("return setImmediate")()}else return}var bf,If,fe,Tr=d(()=>{a();bf=typeof scheduler<"u"&&(n=>scheduler.postTask(n,{priority:"user-blocking"})),If=n=>setTimeout(n,0),fe=n=>{(globalThis.setImmediate||Ef()||bf||If)(n)}});var Ki,pn,zi=d(()=>{a();an();tr();Z();Sr();_r();ln();Tr();Ki=class extends er{_state="active";_started=!1;_rollbackLog=[];_objectStoresCache=new Map;error=null;onabort=null;oncomplete=null;onerror=null;_requests=[];constructor(e,t,r,i){super(),this._scope=new Set(e),this.mode=t,this.durability=r,this.db=i,this.objectStoreNames=new K(...Array.from(this._scope).sort())}_abort(e){for(let t of this._rollbackLog.reverse())t();if(e!==null){let t=new DOMException(void 0,e);this.error=t}for(let{request:t}of this._requests)if(t.readyState!=="done"&&(t.readyState="done",t.source)){t.result=void 0,t.error=new Ft;let r=new le("error",{bubbles:!0,cancelable:!0});r.eventPath=[this.db,this],t.dispatchEvent(r)}fe(()=>{let t=new le("abort",{bubbles:!0,cancelable:!1});t.eventPath=[this.db],this.dispatchEvent(t)}),this._state="finished"}abort(){if(this._state==="committing"||this._state==="finished")throw new b;this._state="active",this._abort(null)}objectStore(e){if(this._state!=="active")throw new b;let t=this._objectStoresCache.get(e);if(t!==void 0)return t;let r=this.db._rawDatabase.rawObjectStores.get(e);if(!this._scope.has(e)||r===void 0)throw new Me;let i=new se(this,r);return this._objectStoresCache.set(e,i),i}_execRequestAsync(e){let t=e.source,r=e.operation,i=Object.hasOwn(e,"request")?e.request:null;if(this._state!=="active")throw new $;return i||(t?(i=new ge,i.source=t,i.transaction=t.transaction):i=new ge),this._requests.push({operation:r,request:i}),i}_start(){this._started=!0;let e,t;for(;this._requests.length>0;){let r=this._requests.shift();if(r&&r.request.readyState!=="done"){t=r.request,e=r.operation;break}}if(t&&e){if(!t.source)e();else{let r,i;try{let o=e();t.readyState="done",t.result=o,t.error=void 0,this._state==="inactive"&&(this._state="active"),i=new le("success",{bubbles:!1,cancelable:!1})}catch(o){t.readyState="done",t.result=void 0,t.error=o,this._state==="inactive"&&(this._state="active"),i=new le("error",{bubbles:!0,cancelable:!0}),r=this._abort.bind(this,o.name)}try{i.eventPath=[this.db,this],t.dispatchEvent(i)}catch(o){throw this._state!=="committing"&&this._abort("AbortError"),o}i.canceled||r&&r()}fe(this._start.bind(this));return}if(this._state!=="finished"&&(this._state="finished",!this.error)){let r=new le("complete");this.dispatchEvent(r)}}commit(){if(this._state!=="active")throw new b;this._state="committing"}get[Symbol.toStringTag](){return"IDBTransaction"}},pn=Ki});var ru,Hi,nu,iu=d(()=>{a();Z();ru=9007199254740992,Hi=class{num=0;next(){if(this.num>=ru)throw new re;return this.num+=1,this.num}setIfLarger(e){let t=Math.floor(Math.min(e,ru))-1;t>=this.num&&(this.num=t+1)}},nu=Hi});var Yi,ou,su=d(()=>{a();dn();Z();Ir();iu();Mi();Yi=class{deleted=!1;records=new yn(!0);rawIndexes=new Map;constructor(e,t,r,i){this.rawDatabase=e,this.keyGenerator=i===!0?new nu:null,this.deleted=!1,this.name=t,this.keyPath=r,this.autoIncrement=i}getKey(e){let t=this.records.get(e);return t!==void 0?structuredClone(t.key):void 0}getAllKeys(e,t,r){(t===void 0||t===0)&&(t=1/0);let i=[];for(let o of this.records.values(e,r))if(i.push(structuredClone(o.key)),i.length>=t)break;return i}getValue(e){let t=this.records.get(e);return t!==void 0?structuredClone(t.value):void 0}getAllValues(e,t,r){(t===void 0||t===0)&&(t=1/0);let i=[];for(let o of this.records.values(e,r))if(i.push(structuredClone(o.value)),i.length>=t)break;return i}getAllRecords(e,t,r){(t===void 0||t===0)&&(t=1/0);let i=[];for(let o of this.records.values(e,r))if(i.push(new nr(structuredClone(o.key),structuredClone(o.key),structuredClone(o.value))),i.length>=t)break;return i}storeRecord(e,t,r){if(this.keyPath!==null){let o=ht(this.keyPath,e.value).key;o!==void 0&&(e.key=o)}if(this.keyGenerator!==null&&e.key===void 0){if(r){let o=this.keyGenerator.num;r.push(()=>{this.keyGenerator&&(this.keyGenerator.num=o)})}if(e.key=this.keyGenerator.next(),this.keyPath!==null){if(Array.isArray(this.keyPath))throw new Error("Cannot have an array key path in an object store with a key generator");let o=this.keyPath,s=e.value,u,v=0;for(;v>=0;){if(typeof s!="object")throw new N;v=o.indexOf("."),v>=0&&(u=o.slice(0,v),o=o.slice(v+1),Object.hasOwn(s,u)||(s[u]={}),s=s[u])}u=o,s[u]=e.key}}else this.keyGenerator!==null&&typeof e.key=="number"&&this.keyGenerator.setIfLarger(e.key);let i=this.records.put(e,t);if(r&&r.push(()=>{i?this.storeRecord(i,!1):this.deleteRecord(e.key)}),i)for(let o of this.rawIndexes.values())o.records.deleteByValue(e.key);for(let o of this.rawIndexes.values())o.initialized&&o.storeRecord(e);return e.key}deleteRecord(e,t){let r=this.records.delete(e);if(t)for(let i of r)t.push(()=>{this.storeRecord(i,!0)});for(let i of this.rawIndexes.values())i.records.deleteByValue(e)}clear(e){let t=this.records.clear();if(e)for(let r of t)e.push(()=>{this.storeRecord(r,!0)});for(let r of this.rawIndexes.values())r.records.clear()}count(e){if(e===void 0||e.lower===void 0&&e.upper===void 0)return this.records.size();let t=0;for(let r of this.records.values(e))t+=1;return t}},ou=Yi});var uu,vu,au=d(()=>{a();_r();Tr();uu=(n,e=!1)=>{if(n._closePending=!0,n._rawDatabase.transactions.every(r=>r._state==="finished")){if(n._closed=!0,n._rawDatabase.connections=n._rawDatabase.connections.filter(r=>n!==r),e){let r=new le("close",{bubbles:!1,cancelable:!1});r.eventPath=[],n.dispatchEvent(r)}}else fe(()=>{uu(n,e)})},vu=uu});var cu,Wi,xn,Xi=d(()=>{a();zi();Z();Sr();ln();su();ji();au();cu=n=>{if(!n._runningVersionchangeTransaction)throw new b;let e=n._rawDatabase.transactions.filter(r=>r.mode==="versionchange"),t=e[e.length-1];if(!t||t._state==="finished")throw new b;if(t._state!=="active")throw new $;return t},Wi=class extends er{_closePending=!1;_closed=!1;_runningVersionchangeTran