1import{a as e,t}from"./rolldown-runtime-Czos8NxU.js";var n=t(((t,n)=>{(function(e){if(typeof t==`object`&&n!==void 0)n.exports=e();else if(typeof define==`function`&&define.amd)define([],e);else{var r=typeof window<`u`?window:typeof globalThis<`u`?globalThis:typeof self<`u`?self:this;r.localforage=e()}})(function(){return(function t(n,r,i){function a(s,c){if(!r[s]){if(!n[s]){var l=typeof e==`function`&&e;if(!c&&l)return l(s,!0);if(o)return o(s,!0);var u=Error(`Cannot find module '`+s+`'`);throw u.code=`MODULE_NOT_FOUND`,u}var d=r[s]={exports:{}};n[s][0].call(d.exports,function(e){var t=n[s][1][e];return a(t||e)},d,d.exports,t,n,r,i)}return r[s].exports}for(var o=typeof e==`function`&&e,s=0;s<i.length;s++)a(i[s]);return a})({1:[function(e,t,n){(function(e){var n=e.MutationObserver||e.WebKitMutationObserver,r;if(n){var i=0,a=new n(u),o=e.document.createTextNode(``);a.observe(o,{characterData:!0}),r=function(){o.data=i=++i%2}}else if(!e.setImmediate&&e.MessageChannel!==void 0){var s=new e.MessageChannel;s.port1.onmessage=u,r=function(){s.port2.postMessage(0)}}else r=`document`in e&&`onreadystatechange`in e.document.createElement(`script`)?function(){var t=e.document.createElement(`script`);t.onreadystatechange=function(){u(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(u,0)};var c,l=[];function u(){c=!0;for(var e,t,n=l.length;n;){for(t=l,l=[],e=-1;++e<n;)t[e]();n=l.length}c=!1}t.exports=d;function d(e){l.push(e)===1&&!c&&r()}}).call(this,typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:{})},{}],2:[function(e,t,n){var r=e(1);function i(){}var a={},o=[`REJECTED`],s=[`FULFILLED`],c=[`PENDING`];t.exports=l;function l(e){if(typeof e!=`function`)throw TypeError(`resolver must be a function`);this.state=c,this.queue=[],this.outcome=void 0,e!==i&&p(this,e)}l.prototype.catch=function(e){return this.then(null,e)},l.prototype.then=function(e,t){if(typeof e!=`function`&&this.state===s||typeof t!=`function`&&this.state===o)return this;var n=new this.constructor(i);return this.state===c?this.queue.push(new u(n,e,t)):d(n,this.state===s?e:t,this.outcome),n};function u(e,t,n){this.promise=e,typeof t==`function`&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),typeof n==`function`&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}u.prototype.callFulfilled=function(e){a.resolve(this.promise,e)},u.prototype.otherCallFulfilled=function(e){d(this.promise,this.onFulfilled,e)},u.prototype.callRejected=function(e){a.reject(this.promise,e)},u.prototype.otherCallRejected=function(e){d(this.promise,this.onRejected,e)};function d(e,t,n){r(function(){var r;try{r=t(n)}catch(t){return a.reject(e,t)}r===e?a.reject(e,TypeError(`Cannot resolve promise with itself`)):a.resolve(e,r)})}a.resolve=function(e,t){var n=m(f,t);if(n.status===`error`)return a.reject(e,n.value);var r=n.value;if(r)p(e,r);else{e.state=s,e.outcome=t;for(var i=-1,o=e.queue.length;++i<o;)e.queue[i].callFulfilled(t)}return e},a.reject=function(e,t){e.state=o,e.outcome=t;for(var n=-1,r=e.queue.length;++n<r;)e.queue[n].callRejected(t);return e};function f(e){var t=e&&e.then;if(e&&(typeof e==`object`||typeof e==`function`)&&typeof t==`function`)return function(){t.apply(e,arguments)}}function p(e,t){var n=!1;function r(t){n||(n=!0,a.reject(e,t))}function i(t){n||(n=!0,a.resolve(e,t))}function o(){t(i,r)}var s=m(o);s.status===`error`&&r(s.value)}function m(e,t){var n={};try{n.value=e(t),n.status=`success`}catch(e){n.status=`error`,n.value=e}return n}l.resolve=h;function h(e){return e instanceof this?e:a.resolve(new this(i),e)}l.reject=g;function g(e){var t=new this(i);return a.reject(t,e)}l.all=_;function _(e){var t=this;if(Object.prototype.toString.call(e)!==`[object Array]`)return this.reject(TypeError(`must be an array`));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var o=Array(n),s=0,c=-1,l=new this(i);++c<n;)u(e[c],c);return l;function u(e,i){t.resolve(e).then(c,function(e){r||(r=!0,a.reject(l,e))});function c(e){o[i]=e,++s===n&&!r&&(r=!0,a.resolve(l,o))}}}l.race=v;function v(e){var t=this;if(Object.prototype.toString.call(e)!==`[object Array]`)return this.reject(TypeError(`must be an array`));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var o=-1,s=new this(i);++o<n;)c(e[o]);return s;function c(e){t.resolve(e).then(function(e){r||(r=!0,a.resolve(s,e))},function(e){r||(r=!0,a.reject(s,e))})}}},{1:1}],3:[function(e,t,n){(function(t){typeof t.Promise!=`function`&&(t.Promise=e(2))}).call(this,typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:{})},{2:2}],4:[function(e,t,n){var r=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e};function i(e,t){if(!(e instanceof t))throw TypeError(`Cannot call a class as a function`)}function a(){try{if(typeof indexedDB<`u`)return indexedDB;if(typeof webkitIndexedDB<`u`)return webkitIndexedDB;if(typeof mozIndexedDB<`u`)return mozIndexedDB;if(typeof OIndexedDB<`u`)return OIndexedDB;if(typeof msIndexedDB<`u`)return msIndexedDB}catch{return}}var o=a();function s(){try{if(!o||!o.open)return!1;var e=typeof openDatabase<`u`&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t=typeof fetch==`function`&&fetch.toString().indexOf(`[native code`)!==-1;return(!e||t)&&typeof indexedDB<`u`&&typeof IDBKeyRange<`u`}catch{return!1}}function c(e,t){e||=[],t||={};try{return new Blob(e,t)}catch(i){if(i.name!==`TypeError`)throw i;for(var n=new(typeof BlobBuilder<`u`?BlobBuilder:typeof MSBlobBuilder<`u`?MSBlobBuilder:typeof MozBlobBuilder<`u`?MozBlobBuilder:WebKitBlobBuilder),r=0;r<e.length;r+=1)n.append(e[r]);return n.getBlob(t.type)}}typeof Promise>`u`&&e(3);var l=Promise;function u(e,t){t&&e.then(function(e){t(null,e)},function(e){t(e)})}function d(e,t,n){typeof t==`function`&&e.then(t),typeof n==`function`&&e.catch(n)}function f(e){return typeof e!=`string`&&(console.warn(e+` used as a key, but it is not a string.`),e=String(e)),e}function p(){if(arguments.length&&typeof arguments[arguments.length-1]==`function`)return arguments[arguments.length-1]}var m=`local-forage-detect-blob-support`,h=void 0,g={},_=Object.prototype.toString,v=`readonly`,y=`readwrite`;function ee(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),i=0;i<t;i++)r[i]=e.charCodeAt(i);return n}function te(e){return new l(function(t){var n=e.transaction(m,y),r=c([``]);n.objectStore(m).put(r,`key`),n.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},n.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/);t(navigator.userAgent.match(/Edge\//)||!e||parseInt(e[1],10)>=43)}}).catch(function(){return!1})}function ne(e){return typeof h==`boolean`?l.resolve(h):te(e).then(function(e){return h=e,h})}function b(e){var t=g[e.name],n={};n.promise=new l(function(e,t){n.resolve=e,n.reject=t}),t.deferredOperations.push(n),t.dbReady?t.dbReady=t.dbReady.then(function(){return n.promise}):t.dbReady=n.promise}function x(e){var t=g[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function S(e,t){var n=g[e.name].deferredOperations.pop();if(n)return n.reject(t),n.promise}function C(e,t){return new l(function(n,r){if(g[e.name]=g[e.name]||O(),e.db)if(t)b(e),e.db.close();else return n(e.db);var i=[e.name];t&&i.push(e.version);var a=o.open.apply(o,i);t&&(a.onupgradeneeded=function(t){var n=a.result;try{n.createObjectStore(e.storeName),t.oldVersion<=1&&n.createObjectStore(m)}catch(n){if(n.name===`ConstraintError`)console.warn(`The database "`+e.name+`" has been upgraded from version `+t.oldVersion+` to version `+t.newVersion+`, but the storage "`+e.storeName+`" already exists.`);else throw n}}),a.onerror=function(e){e.preventDefault(),r(a.error)},a.onsuccess=function(){var t=a.result;t.onversionchange=function(e){e.target.close()},n(t),x(e)}})}function w(e){return C(e,!1)}function T(e){return C(e,!0)}function E(e,t){if(!e.db)return!0;var n=!e.db.objectStoreNames.contains(e.storeName),r=e.version<e.db.version,i=e.version>e.db.version;if(r&&(e.version!==t&&console.warn(`The database "`+e.name+`" can't be downgraded from version `+e.db.version+` to version `+e.version+`.`),e.version=e.db.version),i||n){if(n){var a=e.db.version+1;a>e.version&&(e.version=a)}return!0}return!1}function re(e){return new l(function(t,n){var r=new FileReader;r.onerror=n,r.onloadend=function(n){t({__local_forage_encoded_blob:!0,data:btoa(n.target.result||``),type:e.type})},r.readAsBinaryString(e)})}function ie(e){return c([ee(atob(e.data))],{type:e.type})}function ae(e){return e&&e.__local_forage_encoded_blob}function oe(e){var t=this,n=t._initReady().then(function(){var e=g[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady});return d(n,e,e),n}function se(e){b(e);for(var t=g[e.name],n=t.forages,r=0;r<n.length;r++){var i=n[r];i._dbInfo.db&&(i._dbInfo.db.close(),i._dbInfo.db=null)}return e.db=null,w(e).then(function(t){return e.db=t,E(e)?T(e):t}).then(function(r){e.db=t.db=r;
1for(var i=0;i<n.length;i++)n[i]._dbInfo.db=r}).catch(function(t){throw S(e,t),t})}function D(e,t,n,r){r===void 0&&(r=1);try{n(null,e.db.transaction(e.storeName,t))}catch(i){if(r>0&&(!e.db||i.name===`InvalidStateError`||i.name===`NotFoundError`))return l.resolve().then(function(){if(!e.db||i.name===`NotFoundError`&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),T(e)}).then(function(){return se(e).then(function(){D(e,t,n,r-1)})}).catch(n);n(i)}}function O(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function ce(e){var t=this,n={db:null};if(e)for(var r in e)n[r]=e[r];var i=g[n.name];i||(i=O(),g[n.name]=i),i.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=oe);var a=[];function o(){return l.resolve()}for(var s=0;s<i.forages.length;s++){var c=i.forages[s];c!==t&&a.push(c._initReady().catch(o))}var u=i.forages.slice(0);return l.all(a).then(function(){return n.db=i.db,w(n)}).then(function(e){return n.db=e,E(n,t._defaultConfig.version)?T(n):e}).then(function(e){n.db=i.db=e,t._dbInfo=n;for(var r=0;r<u.length;r++){var a=u[r];a!==t&&(a._dbInfo.db=n.db,a._dbInfo.version=n.version)}})}function le(e,t){var n=this;e=f(e);var r=new l(function(t,r){n.ready().then(function(){D(n._dbInfo,v,function(i,a){if(i)return r(i);try{var o=a.objectStore(n._dbInfo.storeName).get(e);o.onsuccess=function(){var e=o.result;e===void 0&&(e=null),ae(e)&&(e=ie(e)),t(e)},o.onerror=function(){r(o.error)}}catch(e){r(e)}})}).catch(r)});return u(r,t),r}function ue(e,t){var n=this,r=new l(function(t,r){n.ready().then(function(){D(n._dbInfo,v,function(i,a){if(i)return r(i);try{var o=a.objectStore(n._dbInfo.storeName).openCursor(),s=1;o.onsuccess=function(){var n=o.result;if(n){var r=n.value;ae(r)&&(r=ie(r));var i=e(r,n.key,s++);i===void 0?n.continue():t(i)}else t()},o.onerror=function(){r(o.error)}}catch(e){r(e)}})}).catch(r)});return u(r,t),r}function de(e,t,n){var r=this;e=f(e);var i=new l(function(n,i){var a;r.ready().then(function(){return a=r._dbInfo,_.call(t)===`[object Blob]`?ne(a.db).then(function(e){return e?t:re(t)}
1):t}).then(function(t){D(r._dbInfo,y,function(a,o){if(a)return i(a);try{var s=o.objectStore(r._dbInfo.storeName);t===null&&(t=void 0);var c=s.put(t,e);o.oncomplete=function(){t===void 0&&(t=null),n(t)},o.onabort=o.onerror=function(){i(c.error?c.error:c.transaction.error)}}catch(e){i(e)}})}).catch(i)});return u(i,n),i}function fe(e,t){var n=this;e=f(e);var r=new l(function(t,r){n.ready().then(function(){D(n._dbInfo,y,function(i,a){if(i)return r(i);try{var o=a.objectStore(n._dbInfo.storeName).delete(e);a.oncomplete=function(){t()},a.onerror=function(){r(o.error)},a.onabort=function(){r(o.error?o.error:o.transaction.error)}}catch(e){r(e)}})}).catch(r)});return u(r,t),r}function pe(e){var t=this,n=new l(function(e,n){t.ready().then(function(){D(t._dbInfo,y,function(r,i){if(r)return n(r);try{var a=i.objectStore(t._dbInfo.storeName).clear();i.oncomplete=function(){e()},i.onabort=i.onerror=function(){n(a.error?a.error:a.transaction.error)}}catch(e){n(e)}})}).catch(n)});return u(n,e),n}function me(e){var t=this,n=new l(function(e,n){t.ready().then(function(){D(t._dbInfo,v,function(r,i){if(r)return n(r);try{var a=i.objectStore(t._dbInfo.storeName).count();a.onsuccess=function(){e(a.result)},a.onerror=function(){n(a.error)}}catch(e){n(e)}})}).catch(n)});return u(n,e),n}function he(e,t){var n=this,r=new l(function(t,r){if(e<0){t(null);return}n.ready().then(function(){D(n._dbInfo,v,function(i,a){if(i)return r(i);try{var o=a.objectStore(n._dbInfo.storeName),s=!1,c=o.openKeyCursor();c.onsuccess=function(){var n=c.result;if(!n){t(null);return}e===0||s?t(n.key):(s=!0,n.advance(e))},c.onerror=function(){r(c.error)}}catch(e){r(e)}})}).catch(r)});return u(r,t),r}function ge(e){var t=this,n=new l(function(e,n){t.ready().then(function(){D(t._dbInfo,v,function(r,i){if(r)return n(r);try{var a=i.objectStore(t._dbInfo.storeName).openKeyCursor(),o=[];a.onsuccess=function(){var t=a.result;if(!t){e(o);return}o.push(t.key),t.continue()},a.onerror=function(){n(a.error)}}catch(e){n(e)}})}).catch(n)});return u(n,e),n}function _e(e,t){t=p.apply(this,arguments);var n=this.config();e=typeof e!=`function`&&e||{},e.name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var r=this,i;if(!e.name)i=l.reject(`Invalid arguments`);else{var a=e.name===n.name&&r._dbInfo.db?l.resolve(r._dbInfo.db):w(e).then(function(t){var n=g[e.name],r=n.forages;n.db=t;for(var i=0;i<r.length;i++)r[i]._dbInfo.db=t;return t});i=e.storeName?a.then(function(t){if(t.objectStoreNames.contains(e.storeName)){var n=t.version+1;b(e);var r=g[e.name],i=r.forages;t.close();for(var a=0;a<i.length;a++){var s=i[a];s._dbInfo.db=null,s._dbInfo.version=n}return new l(function(t,r){var i=o.open(e.name,n);i.onerror=function(e){i.result.close(),r(e)},i.onupgradeneeded=function(){i.result.deleteObjectStore(e.storeName)},i.onsuccess=function(){var e=i.result;e.close(),t(e)}}).then(function(e){r.db=e;for(var t=0;t<i.length;t++){var n=i[t];n._dbInfo.db=e,x(n._dbInfo)}}).catch(function(t){throw(S(e,t)||l.resolve()).catch(function(){}),t})}}):a.then(function(t){b(e);var n=g[e.name],r=n.forages;t.close();for(var i=0;i<r.length;i++){var a=r[i];a._dbInfo.db=null}return new l(function(t,n){var r=o.deleteDatabase(e.name);r.onerror=function(){var e=r.result;e&&e.close(),n(r.error)},r.onblocked=function(){console.warn(`dropInstance blocked for database "`+e.name+`" until all open connections are closed`)},r.onsuccess=function(){var e=r.result;e&&e.close(),t(e)}}).then(function(e){n.db=e;for(var t=0;t<r.length;t++){var i=r[t];x(i._dbInfo)}}).catch(function(t){throw(S(e,t)||l.resolve()).catch(function(){}),t})})}return u(i,t),i}var ve={_driver:`asyncStorage`,_initStorage:ce,_support:s(),iterate:ue,getItem:le,setItem:de,removeItem:fe,clear:pe,length:me,key:he,keys:ge,dropInstance:_e};function ye(){return typeof openDatabase==`function`}var k=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,be=`~~local_forage_type~`,A=/^~~local_forage_type~([^~]+)~/,j=`__lfsc__:`,M=j.length,N=`arbf`,P=`blob`,F=`si08`,I=`ui08`,L=`uic8`,R=`si16`,z=`si32`,B=`ur16`,V=`ui32`,H=`fl32`,U=`fl64`,W=M+N.length,G=Object.prototype.toString;function xe(e){var t=e.length*.75,n=e.length,r,i=0,a,o,s,c;e[e.length-1]===`=`&&(t--,e[e.length-2]===`=`&&t--);var l=new ArrayBuffer(t),u=new Uint8Array(l);for(r=0;r<n;r+=4)a=k.indexOf(e[r]),o=k.indexOf(e[r+1]),s=k.indexOf(e[r+2]),c=k.indexOf(e[r+3]),u[i++]=a<<2|o>>4,u[i++]=(o&15)<<4|s>>2,u[i++]=(s&3)<<6|c&63;return l}function K(e){var t=new Uint8Array(e),n=``,r;for(r=0;r<t.length;r+=3)n+=k[t[r]>>2],n+=k[(t[r]&3)<<4|t[r+1]>>4],n+=k[(t[r+1]&15)<<2|t[r+2]>>6],n+=k[t[r+2]&63];return t.length%3==2?n=n.substring(0,n.length-1)+`=`:t.length%3==1&&(n=n.substring(0,n.length-2)+`==`),n}function Se(e,t){var n=``;if(e&&(n=G.call(e)),e&&(n===`[object ArrayBuffer]`||e.buffer&&G.call(e.buffer)===`[object ArrayBuffer]`)){var r,i=j;e instanceof ArrayBuffer?(r=e,i+=N):(r=e.buffer,n===`[object Int8Array]`?i+=F:n===`[object Uint8Array]`?i+=I:n===`[object Uint8ClampedArray]`?i+=L:n===`[object Int16Array]`?i+=R:n===`[object Uint16Array]`?i+=B:n===`[object Int32Array]`?i+=z:n===`[object Uint32Array]`?i+=V:n===`[object Float32Array]`?i+=H:n===`[object Float64Array
1]`?i+=U:t(Error(`Failed to get type for BinaryArray`))),t(i+K(r))}else if(n===`[object Blob]`){var a=new FileReader;a.onload=function(){var n=be+e.type+`~`+K(this.result);t(j+P+n)},a.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(n){console.error(`Couldn't convert value into a JSON string: `,e),t(null,n)}}function Ce(e){if(e.substring(0,M)!==j)return JSON.parse(e);var t=e.substring(W),n=e.substring(M,W),r;if(n===P&&A.test(t)){var i=t.match(A);r=i[1],t=t.substring(i[0].length)}var a=xe(t);switch(n){case N:return a;case P:return c([a],{type:r});case F:return new Int8Array(a);case I:return new Uint8Array(a);case L:return new Uint8ClampedArray(a);case R:return new Int16Array(a);case B:return new Uint16Array(a);case z:return new Int32Array(a);case V:return new Uint32Array(a);case H:return new Float32Array(a);case U:return new Float64Array(a);default:throw Error(`Unkown type: `+n)}}var q={serialize:Se,deserialize:Ce,stringToBuffer:xe,bufferToString:K};function we(e,t,n,r){e.executeSql(`CREATE TABLE IF NOT EXISTS `+t.storeName+` (id INTEGER PRIMARY KEY, key unique, value)`,[],n,r)}function Te(e){var t=this,n={db:null};if(e)for(var r in e)n[r]=typeof e[r]==`string`?e[r]:e[r].toString();var i=new l(function(e,r){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(e){return r(e)}n.db.transaction(function(i){we(i,n,function(){t._dbInfo=n,e()},function(e,t){r(t)})},r)});return n.serializer=q,i}function J(e,t,n,r,i,a){e.executeSql(n,r,i,function(e,o){o.code===o.SYNTAX_ERR?e.executeSql(`SELECT name FROM sqlite_master WHERE type='table' AND name = ?`,[t.storeName],function(e,s){s.rows.length?a(e,o):we(e,t,function(){e.executeSql(n,r,i,a)},a)},a):a(e,o)},a)}function Ee(e,t){var n=this;e=f(e);var r=new l(function(t,r){n.ready().then(function(){var i=n._dbInfo;i.db.transaction(function(n){J(n,i,`SELECT * FROM `+i.storeName+` WHERE key = ? LIMIT 1`,[e],function(e,n){var r=n.rows.length?n.rows.item(0).value:null;r&&=i.serializer.deserialize(r),t(r)},function(e,t){r(t)})})}).catch(r)});return u(r,t),r}function De(e,t){var n=this,r=new l(function(t,r){n.ready().then(function(){var i=n._dbInfo;i.db.transaction(function(n){J(n,i,`SELECT * FROM `+i.storeName,[],function(n,r){for(var a=r.rows,o=a.length,s=0;s<o;s++){var c=a.item(s),l=c.value;if(l&&=i.serializer.deserialize(l),l=e(l,c.key,s+1),l!==void 0){t(l);return}}t()},function(e,t){r(t)})})}).catch(r)});return u(r,t),r}function Oe(e,t,n,r){var i=this;e=f(e);var a=new l(function(a,o){i.ready().then(function(){t===void 0&&(t=null);var s=t,c=i._dbInfo;c.serializer.serialize(t,function(t,l){l?o(l):c.db.transaction(function(n){J(n,c,`INSERT OR REPLACE INTO `+c.storeName+` (key, value) VALUES (?, ?)`,[e,t],function(){a(s)},function(e,t){o(t)})},function(t){if(t.code===t.QUOTA_ERR){if(r>0){a(Oe.apply(i,[e,s,n,r-1]));return}o(t)}})})}).catch(o)});return u(a,n),a}function ke(e,t,n){return Oe.apply(this,[e,t,n,1])}function Ae(e,t){var n=this;e=f(e);var r=new l(function(t,r){n.ready().then(function(){var i=n._dbInfo;i.db.transaction(function(n){J(n,i,`DELETE FROM `+i.storeName+` WHERE key = ?`,[e],function(){t()},function(e,t){r(t)})})}).catch(r)});return u(r,t),r}function je(e){var t=this,n=new l(function(e,n){t.ready().then(function(){var r=t._dbInfo;r.db.transaction(function(t){J(t,r,`DELETE FROM `+r.storeName,[],function(){e()},function(e,t){n(t)})})}).catch(n)});return u(n,e),n}function Me(e){var t=this,n=new l(function(e,n){t.ready().then(function(){var r=t._dbInfo;r.db.transaction(function(t){J(t,r,`SELECT COUNT(key) as c FROM `+r.storeName,[],function(t,n){var r=n.rows.item(0).c;e(r)},function(e,t){n(t)})})}).catch(n)});return u(n,e),n}function Ne(e,t){var n=this,r=new l(function(t,r){n.ready().then(function(){var i=n._dbInfo;i.db.transaction(function(n){J(n,i,`SELECT key FROM `+i.storeName+` WHERE id = ? LIMIT 1`,[e+1],function(e,n){t(n.rows.length?n.rows.item(0).key:null)},function(e,t){r(t)})})}).catch(r)});return u(r,t),r}function Pe(e){var t=this,n=new l(function(e,n){t.ready().then(function(){var r=t._dbInfo;r.db.transaction(function(t){J(t,r,`SELECT key FROM `+r.storeName,[],function(t,n){for(var r=[],i=0;i<n.rows.length;i++)r.push(n.rows.item(i).key);e(r)},function(e,t){n(t)})})}).catch(n)});return u(n,e),n}function Fe(e){return new l(function(t,n){e.transaction(function(r){r.executeSql(`SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'`,[],function(n,r){for(var i=[],a=0;a<r.rows.length;a++)i.push(r.rows.item(a).name);t({db:e,storeNames:i})},function(e,t){n(t)})},function(e){n(e)})})}function Ie(e,t){t=p.apply(this,arguments);var n=this.config();e=typeof e!=`function`&&e||{},e.name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var r=this,i=e.name?new l(function(t){var i=e.name===n.name?r._dbInfo.db:openDatabase(e.name,``,``,0);e.storeName?t({db:i,storeNames:[e.storeName]}):t(Fe(i))}).then(function(e){return new l(function(t,n){e.db.transaction(function(r){function i(e){return new l(function(t,n){r.executeSql(`DROP TABLE IF EXISTS `+e,[],function(){t()},function(e,t){n(t)})})}for(var a=[],o=0,s=e.storeNames.length;o<s;o++)a.push(i(e.storeNames[o]));l.all(a).then(function(){t()}).catch(function(e){n(e)})},function(e){n(e)})})}):l.reject(`Invalid arguments`);return u(i,t),i}var Le={_driver:`webSQLStorage`,_initStorage:Te,_support:ye(),iterate:De,getItem:Ee,setItem:ke,removeItem:Ae,clear:je,length:Me,key:Ne,keys:Pe,dropInstance:Ie};function Re(){try{return typeof localStorage<`u`&&`setItem`in localStorage&&!!localStorage.setItem}catch{return!1}}function ze(e,t){var n=e.name+`/`;return e.storeName!==t.storeName&&(n+=e.storeName+`/`),n}function Be(){var e=`_localforage_support_test`;try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch{return!0}}function Ve(){return!Be()||localStorage.length>0}function He(e){var t=this,n={};if(e)for(var r in e)n[r]=e[r];return n.keyPrefix=ze(e,t._defaultConfig),Ve()?(t._dbInfo=n,n.serializer
1=q,l.resolve()):l.reject()}function Ue(e){var t=this,n=t.ready().then(function(){for(var e=t._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var r=localStorage.key(n);r.indexOf(e)===0&&localStorage.removeItem(r)}});return u(n,e),n}function We(e,t){var n=this;e=f(e);var r=n.ready().then(function(){var t=n._dbInfo,r=localStorage.getItem(t.keyPrefix+e);return r&&=t.serializer.deserialize(r),r});return u(r,t),r}function Ge(e,t){var n=this,r=n.ready().then(function(){for(var t=n._dbInfo,r=t.keyPrefix,i=r.length,a=localStorage.length,o=1,s=0;s<a;s++){var c=localStorage.key(s);if(c.indexOf(r)===0){var l=localStorage.getItem(c);if(l&&=t.serializer.deserialize(l),l=e(l,c.substring(i),o++),l!==void 0)return l}}});return u(r,t),r}function Ke(e,t){var n=this,r=n.ready().then(function(){var t=n._dbInfo,r;try{r=localStorage.key(e)}catch{r=null}return r&&=r.substring(t.keyPrefix.length),r});return u(r,t),r}function qe(e){var t=this,n=t.ready().then(function(){for(var e=t._dbInfo,n=localStorage.length,r=[],i=0;i<n;i++){var a=localStorage.key(i);a.indexOf(e.keyPrefix)===0&&r.push(a.substring(e.keyPrefix.length))}return r});return u(n,e),n}function Je(e){var t=this.keys().then(function(e){return e.length});return u(t,e),t}function Ye(e,t){var n=this;e=f(e);var r=n.ready().then(function(){var t=n._dbInfo;localStorage.removeItem(t.keyPrefix+e)});return u(r,t),r}function Xe(e,t,n){var r=this;e=f(e);var i=r.ready().then(function(){t===void 0&&(t=null);var n=t;return new l(function(i,a){var o=r._dbInfo;o.serializer.serialize(t,function(t,r){if(r)a(r);else try{localStorage.setItem(o.keyPrefix+e,t),i(n)}catch(e){(e.name===`QuotaExceededError`||e.name===`NS_ERROR_DOM_QUOTA_REACHED`)&&a(e),a(e)}})})});return u(i,n),i}function Ze(e,t){if(t=p.apply(this,arguments),e=typeof e!=`function`&&e||{},!e.name){var n=this.config();e.name=e.name||n.name,e.storeName=e.storeName||n.storeName}var r=this,i=e.name?new l(function(t){e.storeName?t(ze(e,r._defaultConfig)):t(e.name+`/`)}).then(function(e){for(var t=localStorage.length-1;t>=0;t--){var n=localStorage.key(t);n.indexOf(e)===0&&localStorage.removeItem(n)}}):l.reject(`Invalid arguments`);return u(i,t),i}var Qe={_driver:`localStorageWrapper`,_initStorage:He,_support:Re(),iterate:Ge,getItem:We,setItem:Xe,removeItem:Ye,clear:Ue,length:Je,key:Ke,keys:qe,dropInstance:Ze},$e=function(e,t){return e===t||typeof e==`number`&&typeof t==`number`&&isNaN(e)&&isNaN(t)},et=function(e,t){for(var n=e.length,r=0;r<n;){if($e(e[r],t))return!0;r++}return!1},tt=Array.isArray||function(e){return Object.prototype.toString.call(e)===`[object Array]`},Y={},nt={},X={INDEXEDDB:ve,WEBSQL:Le,LOCALSTORAGE:Qe},rt=[X.INDEXEDDB._driver,X.WEBSQL._driver,X.LOCALSTORAGE._driver],Z=[`dropInstance`],Q=[`clear`,`getItem`,`iterate`,`key`,`keys`,`length`,`removeItem`,`setItem`].concat(Z),it={description:``,driver:rt.slice(),name:`localforage`,size:4980736,storeName:`keyvaluepairs`,version:1};function at(e,t){e[t]=function(){var n=arguments;return e.ready().then(function(){return e[t].apply(e,n)})}}function $(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var n in t)t.hasOwnProperty(n)&&(tt(t[n])?arguments[0][n]=t[n].slice():arguments[0][n]=t[n])}return arguments[0]}t.exports=new(function(){function e(t){for(var n in i(this,e),X)if(X.hasOwnProperty(n)){var r=X[n],a=r._driver;this[n]=a,Y[a]||this.defineDriver(r)}this._defaultConfig=$({},it),this._config=$({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return e.prototype.config=function(e){if((e===void 0?`undefined`:r(e))===`object`){if(this._ready)return Error(`Can't call config() after localforage has been used.`);for(var t in e){if(t===`storeName`&&(e[t]=e[t].replace(/\W/g,`_`)),t===`version`&&typeof e[t]!=`number`)return Error(`Database version must be a number.`);this._config[t]=e[t]}return`driver`in e&&e.driver?this.setDriver(this._config.driver):!0}else if(typeof e==`string`)return this._config[e];else return this._config},e.prototype.defineDriver=function(e,t,n){var r=new l(function(t,n){try{var r=e._driver,i=Error(`Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver`);if(!e._driver){n(i);return}for(var a=Q.concat(`_initStorage`),o=0,s=a.length;o<s;o++){var c=a[o];if((!et(Z,c)||e[c])&&typeof e[c]!=`function`){n(i);return}}(function(){for(var t=function(e){return function(){var t=Error(`Method `+e+` is not implemented by the current driver`),n=l.reject(t);return u(n,arguments[arguments.length-1]),n}},n=0,r=Z.length;n<r;n++){var i=Z[n];e[i]||(e[i]=t(i))}})();
1var d=function(n){Y[r]&&console.info(`Redefining LocalForage driver: `+r),Y[r]=e,nt[r]=n,t()};`_support`in e?e._support&&typeof e._support==`function`?e._support().then(d,n):d(!!e._support):d(!0)}catch(e){n(e)}});return d(r,t,n),r},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,n){var r=Y[e]?l.resolve(Y[e]):l.reject(Error(`Driver not found.`));return d(r,t,n),r},e.prototype.getSerializer=function(e){var t=l.resolve(q);return d(t,e),t},e.prototype.ready=function(e){var t=this,n=t._driverSet.then(function(){return t._ready===null&&(t._ready=t._initDriver()),t._ready});return d(n,e,e),n},e.prototype.setDriver=function(e,t,n){var r=this;tt(e)||(e=[e]);var i=this._getSupportedDrivers(e);function a(){r._config.driver=r.driver()}function o(e){return r._extend(e),a(),r._ready=r._initStorage(r._config),r._ready}function s(e){return function(){var t=0;function n(){for(;t<e.length;){var i=e[t];return t++,r._dbInfo=null,r._ready=null,r.getDriver(i).then(o).catch(n)}a();var s=Error(`No available storage method found.`);return r._driverSet=l.reject(s),r._driverSet}return n()}}return this._driverSet=(this._driverSet===null?l.resolve():this._driverSet.catch(function(){return l.resolve()})).then(function(){var e=i[0];return r._dbInfo=null,r._ready=null,r.getDriver(e).then(function(e){r._driver=e._driver,a(),r._wrapLibraryMethodsWithReady(),r._initDriver=s(i)})}).catch(function(){a();var e=Error(`No available storage method found.`);return r._driverSet=l.reject(e),r._driverSet}),d(this._driverSet,t,n),this._driverSet},e.prototype.supports=function(e){return!!nt[e]},e.prototype._extend=function(e){$(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n];this.supports(i)&&t.push(i)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=Q.length;e<t;e++)at(this,Q[e])},e.prototype.createInstance=function(t){return new e(t)},e}())},{3:3}]},{},[4])(4)})}));export{n as t}; 2//# sourceMappingURL=localforage-DTdri6MG.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.