!function(t){if("object"==typeofn&&"undefined"!=typeofe)e.exports=t();elseif("function"==typeofdefine&&define.amd)define([],t);else{varr;r="undefined"!=typeofwindow?window:"undefined"!=typeofglobal?global:"undefined"!=typeofself?self:this,r.localforage=t()}}(function(){returnfunctione(n,t,r){functiono(a,u){if(!t[a]){if(!n[a]){varc="function"==typeofrequire&&require;if(!u&&c)returnc(a,!0);if(i)returni(a,!0);varf=newError("Cannot find module '"+a+"'");throwf.code="MODULE_NOT_FOUND",f}vars=t[a]={exports:{}};n[a][0].call(s.exports,function(e){vart=n[a][1][e];returno(t?t:e)},s,s.exports,e,n,t,r)}returnt[a].exports}for(vari="function"==typeofrequire&&require,a=0;a<r.length;a++)o(r[a]);returno}({1:[function(e,n,t){(function(e){"use strict";functiont(){s=!0;for(vare,n,t=l.length;t;){for(n=l,l=[],e=-1;++e<t;)n[e]();t=l.length}s=!1}functionr(e){1!==l.push(e)||s||o()}varo,i=e.MutationObserver||e.WebKitMutationObserver;if(i){vara=0,u=newi(t),c=e.document.createTextNode("");u.observe(c,{characterData:!0}),o=function(){c.data=a=++a%2}}elseif(e.setImmediate||"undefined"==typeofe.MessageChannel)o="document"ine&&"onreadystatechange"ine.document.createElement("script")?function(){varn=e.document.createElement("script");n.onreadystatechange=function(){t(),n.onreadystatechange=null,n.parentNode.removeChild(n),n=null},e.document.documentElement.appendChild(n)}:function(){setTimeout(t,0)};else{varf=newe.MessageChannel;f.port1.onmessage=t,o=function(){f.port2.postMessage(0)}}vars,l=[];n.exports=r}).call(this,"undefined"!=typeofglobal?global:"undefined"!=typeofself?self:"undefined"!=typeofwindow?window:{})},{}],2:[function(e,n,t){"use strict";functionr(){}functiono(e){if("function"!=typeofe)thrownewTypeError("resolver must be a function");this.state=m,this.queue=[],this.outcome=void0,e!==r&&c(this,e)}functioni(e,n,t){this.promise=e,"function"==typeofn&&(this.onFulfilled=n,this.callFulfilled=this.otherCallFulfilled),"function"==typeoft&&(this.onRejected=t,this.callRejected=this.otherCallRejected)}functiona(e,n,t){h(function(){varr;try{r=n(t)}catch(n){returny.reject(e,n)}r===e?y.reject(e,newTypeError("Cannot resolve promise with itself")):y.resolve(e,r)})}functionu(e){varn=e&&e.then;if(e&&("object"==typeofe||"function"==typeofe)&&"function"==typeofn)returnfunction(){n.apply(e,arguments)}}functionc(e,n){functiont(n){i||(i=!0,y.reject(e,n))}functionr(n){i||(i=!0,y.resolve(e,n))}functiono(){n(r,t)}vari=!1,a=f(o);"error"===a.status&&t(a.value)}functionf(e,n){vart={};try{t.value=e(n),t.status="success"}catch(e){t.status="error",t.value=e}returnt}functions(e){returneinstanceofthis?e:y.resolve(newthis(r),e)}functionl(e){varn=newthis(r);returny.reject(n,e)}functiond(e){functionn(e,n){functionr(e){a[n]=e,++u!==o||i||(i=!0,y.resolve(f,a))}t.resolve(e).then(r,function(e){i||(i=!0,y.reject(f,e))})}vart=this;if("[object Array]"!==Object.prototype.toString.call(e))returnthis.reject(newTypeError("must be an array"));varo=e.length,i=!1;if(!o)returnthis.resolve([]);for(vara=newArray(o),u=0,c=-1,f=newthis(r);++c<o;)n(e[c],c);returnf}functionv(e){functionn(e){t.resolve(e).then(function(e){i||(i=!0,y.resolve(u,e))},function(e){i||(i=!0,y.reject(u,e))})}vart=this;if("[object Array]"!==Object.prototype.toString.call(e))returnthis.reject(newTypeError("must be an array"));varo=e.length,i=!1;if(!o)returnthis.resolve([]);for(vara=-1,u=newthis(r);++a<o;)n(e[a]);returnu}varh=e(1),y={},p=["REJECTED"],b=["FULFILLED"],m=["PENDING"];n.exports=o,o.prototype.catch=function(e){returnthis.then(null,e)},o.prototype.then=function(e,n){if("function"!=typeofe&&this.state===b||"function"!=typeofn&&this.state===p)returnthis;vart=newthis.constructor(r);if(this.state!==m){varo=this.state===b?e:n;a(t,o,this.outcome)}elsethis.queue.push(newi(t,e,n));returnt},i.prototype.callFulfilled=function(e){y.resolve(this.promise,e)},i.prototype.otherCallFulfilled=function(e){a(this.promise,this.onFulfilled,e)},i.prototype.callRejected=function(e){y.reject(this.promise,e)},i.prototype.otherCallRejected=function(e){a(this.promise,this.onRejected,e)},y.resolve=function(e,n){vart=f(u,n);if("error"===t.status)returny.reject(e,t.value);varr=t.value;if(r)c(e,r);else{e.state=b,e.outcome=n;for(varo=-1,i=e.queue.length;++o<i;)e.queue[o].callFulfilled(n)}returne},y.reject=function(e,n){e.state=p,e.outcome=n;for(vart=-1,r=e.queue.length;++t<r;)e.queue[t].callRejected(n);returne},o.resolve=s,o.reject=l,o.all=d,o.race=v},{1:1}],3:[function(e,n,t){(function(n){"use strict";"function"!=typeofn.Promise&&(n.Promise=e(2))}).call(this,"undefined"!=typeofglobal?global:"undefined"!=typeofself?self:"undefined"!=typeofwindow?window:{})},{2:2}],4:[function(e,n,t){"use strict";functionr(e,n){if(!(einstanceofn))thrownewTypeError("Cannot call a class as a function")}functiono(){try{if("undefined"!=typeofindexedDB)returnindexedDB;if("undefined"!=typeofwebkitIndexedDB)returnwebkitIndexedDB;if("undefined"!=typeofmozIndexedDB)returnmozIndexedDB;if("undefined"!=typeofOIndexedDB)returnOIndexedDB;if("undefined"!=typeofmsIndexedDB)returnmsIndexedDB}catch(e){return}}functioni(){try{if(!_e)return!1;vare="undefined"!=typeofopenDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),n="function"==typeoffetch&&fetch.toString().indexOf("[native code")!==-1;return(!e||n)&&"undefined"!=typeofindexedDB&&"undefined"!=typeofIDBKeyRange}catch(e){return!1}}functiona(e,n){e=e||[],n=n||{};try{returnnewBlob(e,n)}catch(i){if("TypeError"!==i.name)throwi;for(vart="undefined"!=typeofBlobBuilder?BlobBuilder:"undefined"!=typeofMSBlobBuilder?MSBlobBuilder:"undefined"!=typeofMozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder,r=newt,o=0;o<e.length;o+=1)r.append(e[o]);returnr.getBlob(n.type)}}functionu(e,n){n&&e.then(function(e){n(null,e)},function(e){n(e)})}functionc(e,n,t){"function"==typeofn&&e.then(n),"function"==typeoft&&e.catch(t)}functionf(e){return"string"!=typeofe&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}functions(){if(arguments.length&&"function"==typeofarguments[arguments.length-1])returnarguments[arguments.length-1]}functionl(e){for(varn=e.length,t=newArrayBuffer(n),r=newUint8Array(t),o=0;o<n;o++)r[o]=e.charCodeAt(o);returnt}functiond(e){returnnewwe(function(n){vart=e.transaction(Ie,Ae),r=a([""]);t.objectStore(Ie).put(r,"key"),t.onabort=function(e){e.preventDefault(),e.stopPropagation(),n(!1)},t.oncomplete=function(){vare=navigator.userAgent.match(/Chrome\/(\d+)/),t=navigator.userAgent.match(/Edge\//);n(t||!e||parseInt(e[1],10)>=43)}}).catch(function(){return!1})}functionv(e){return"boolean"==typeofSe?we.resolve(Se):d(e).then(function(e){returnSe=e})}functionh(e){varn=Ee[e.name],t={};t.promise=newwe(function(e,n){t.resolve=e,t.reject=n}),n.deferredOperations.push(t),n.dbReady?n.dbReady=n.dbReady.then(function(){returnt.promise}):n.dbReady=t.promise}functiony(e){varn=Ee[e.name],t=n.deferredOperations.pop();if(t)returnt.resolve(),t.promise}functionp(e,n){vart=Ee[e.name],r=t.deferredOperations.pop();if(r)returnr.reject(n),r.promise}functionb(e,n){returnnewwe(function(t,r){if(Ee[e.name]=Ee[e.name]||A(),e.db){if(!n)returnt(e.db);h(e),e.db.close()}varo=[e.name];n&&o.push(e.version);vari=_e.open.apply(_e,o);n&&(i.onupgradeneeded=function(n){vart=i.result;try{t.createObjectStore(e.storeName),n.oldVersion<=1&&t.createObjectStore(Ie)}catch(t){if("ConstraintError"!==t.name)throwt;console.warn('The database "'+e.name+'" has been upgraded from version '+n.oldVersion+" to version "+n.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),i.onerror=function(e){e.preventDefault(),r(i.error)},i.onsuccess=function(){t(i.result),y(e)}})}functionm(e){returnb(e,!1)}functiong(e){returnb(e,!0)}function_(e,n){if(!e.db)return!0;vart=!e.db.objectStoreNames.contains(e.storeName),r=e.version<e.db.version,o=e.version>e.db.version;if(r&&(e.version!==n&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),o||t){if(t){vari=e.db.version+1;i>e.version&&(e.version=i)}return!0}return!1}functionw(e){returnnewwe(function(n,t){varr=newFileReader;r.onerror=t,r.onloadend=function(t){varr=btoa(t.target.result||"");n({__local_forage_encoded_blob:!0,data:r,type:e.type})},r.readAsBinaryString(e)})}functionI(e){varn=l(atob(e.data));returna([n],{type:e.type})}functionS(e){returne&&e.__local_forage_encoded_blob}functionE(e){varn=this,t=n._initReady().then(function(){vare=Ee[n._dbInfo.name];if(e&&e.dbReady)returne.dbReady});returnc(t,e,e),t}functionN(e){h(e);for(varn=Ee[e.name],t=n.forages,r=0;r<t.length;r++){varo=t[r];o._dbInfo.db&&(o._dbInfo.db.close(),o._dbInfo.db=null)}returne.db=null,m(e).then(function(n){returne.db=n,_(e)?g(e):n}).then(function(r){e.db=n.db=r;for(varo=0;o<t.length;o++)t[o]._dbInfo.db=r}).catch(function(n){throwp(e,n),n})}functionj(e,n,t,r){void0===r&&(r=1);try{varo=e.db.transaction(e.storeName,n);t(null,o)}catch(o){if(r>0&&(!e.db||"InvalidStateError"===o.name||"NotFoundError"===o.name))returnwe.resolve().then(function(){if(!e.db||"NotFoundError"===o.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)returne.db&&(e.version=e.db.version+1),g(e)}).then(function(){returnN(e).then(function(){j(e,n,t,r-1)})}).catch(t);t(o)}}functionA(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}functionR(e){functionn(){returnwe.resolve()}vart=this,r={db:null};if(e)for(varoine)r[o]=e[o];vari=Ee[r.name];i||(i=A(),Ee[r.name]=i),i.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=E);for(vara=[],u=0;u<i.forages.length;u++){varc=i.forages[u];c!==t&&a.push(c._initReady().catch(n))}varf=i.forages.slice(0);returnwe.all(a).then(function(){returnr.db=i.db,m(r)}).then(function(e){returnr.db=e,_(r,t._defaultConfig.version)?g(r):e}).then(function(e){r.db=i.db=e,t._dbInfo=r;for(varn=0;n<f.length;n++){varo=f[n];o!==t&&(o._dbInfo.db=r.db,o._dbInfo.version=r.version)}})}functionO(e,n){vart=this;e=f(e);varr=newwe(function(n,r){t.ready().then(function(){j(t._dbInfo,je,function(o,i){if(o)returnr(o);try{vara=i.objectStore(t._dbInfo.storeName),u=a.get(e);u.onsuccess=function(){vare=u.result;void0===e&&(e=null),S(e)&&(e=I(e)),n(e)},u.onerror=function(){r(u.error)}}catch(e){r(e)}})}).catch(r)});returnu(r,n),r}functionx(e,n){vart=this,r=newwe(function(n,r){t.ready().then(function(){j(t._dbInfo,je,function(o,i){if(o)returnr(o);try{vara=i.objectStore(t._dbInfo.storeName),u=a.openCursor(),c=1;u.onsuccess=function(){vart=u.result;if(t){varr=t.value;S(r)&&(r=I(r));varo=e(r,t.key,c++);void0!==o?n(o):t.continue()}elsen()},u.onerror=function(){r(u.error)}}catch(e){r(e)}})}).catch(r)});returnu(r,n),r}functionD(e,n,t){varr=this;e=f(e);varo=newwe(function(t,o){vari;r.ready().then(function(){returni=r._dbInfo,"[object Blob]"===Ne.call(n)?v(i.db).then(function(e){returne?n:w(n)}):n}).then(function(n){j(r._dbInfo,Ae,function(i,a){if(i)returno(i);try{varu=a.objectStore(r._dbInfo.storeName);null===n&&(n=void0);varc=u.put(n,e);a.oncomplete=function(){void0===n&&(n=null),t(n)},a.onabort=a.onerror=function(){vare=c.error?c.error:c.transaction.error;o(e)}}catch(e){o(e)}})}).catch(o)});returnu(o,t),o}functionB(e,n){vart=this;e=f(e);varr=newwe(function(n,r){t.ready().then(function(){j(t._dbInfo,Ae,function(o,i){if(o)returnr(o);try{vara=i.objectStore(t._dbInfo.storeName),u=a.delete(e);i.oncomplete=function(){n()},i.onerror=function(){r(u.error)},i.onabort=function(){vare=u.error?u.error:u.transaction.error;r(e)}}catch(e){r(e)}})}).catch(r)});returnu(r,n),r}functionk(e){varn=this,t=newwe(function(e,t){n.ready().then(function(){j(n._dbInfo,Ae,function(r,o){if(r)returnt(r);try{vari=o.objectStore(n._dbInfo.storeName),a=i.clear();o.oncomplete=function(){e()},o.onabort=o.onerror=function(){vare=a.error?a.error:a.transaction.error;t(e)}}catch(e){t(e)}})}).catch(t)});returnu(t,e),t}functionC(e){varn=this,t=newwe(function(e,t){n.ready().then(function(){j(n._dbInfo,je,function(r,o){if(r)returnt(r);try{vari=o.objectStore(n._dbInfo.storeName),a=i.count();a.onsuccess=function(){e(a.result)},a.onerror=function(){t(a.error)}}catch(e){t(e)}})}).catch(t)});returnu(t,e),t}functionT(e,n){vart=this,r=newwe(function(n,r){returne<0?voidn(null):voidt.ready().then(function(){j(t._dbInfo,je,function(o,i){if(o)returnr(o);try{vara=i.objectStore(t._dbInfo.storeName),u=!1,c=a.openCursor();c.onsuccess=function(){vart=c.result;returnt?void(0===e?n(t.key):u?n(t.key):(u=!0,t.advance(e))):voidn(null)},c.onerror=function(){r(c.error)}}catch(e){r(e)}})}).catch(r)});returnu(r,n),r}functionF(e){varn=this,t=newwe(function(e,t){n.ready().then(function(){j(n._dbInfo,je,function(r,o){if(r)returnt(r);try{vari=o.objectStore(n._dbInfo.storeName),a=i.openCursor(),u=[];a.onsuccess=function(){varn=a.result;returnn?(u.push(n.key),voidn.continue()):voide(u)},a.onerror=function(){t(a.error)}}catch(e){t(e)}})}).catch(t)});returnu(t,e),t}functionL(e,n){n=s.apply(this,arguments);vart=this.config();e="function"!=typeofe&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);varr,o=this;if(e.name){vari=e.name===t.name&&o._dbInfo.db,a=i?we.resolve(o._dbInfo.db):m(e).then(function(n){vart=Ee[e.name],r=t.forages;t.db=n;for(varo=0;o<r.length;o++)r[o]._dbInfo.db=n;returnn});r=e.storeName?a.then(function(n){if(n.objectStoreNames.contains(e.storeName)){vart=n.version+1;h(e);varr=Ee[e.name],o=r.forages;n.close();for(vari=0;i<o.length;i++){vara=o[i];a._dbInfo.db=null,a._dbInfo.version=t}varu=newwe(function(n,r){varo=_e.open(e.name,t);o.onerror=function(e){varn=o.result;n.close(),r(e)},o.onupgradeneeded=function(){varn=o.result;n.deleteObjectStore(e.storeName)},o.onsuccess=function(){vare=o.result;e.close(),n(e)}});returnu.then(function(e){r.db=e;for(varn=0;n<o.length;n++){vart=o[n];t._dbInfo.db=e,y(t._dbInfo)}}).catch(function(n){throw(p(e,n)||we.resolve()).catch(function(){}),n})}}):a.then(function(n){h(e);vart=Ee[e.name],r=t.forages;n.close();for(varo=0;o<r.length;o++){vari=r[o];i._dbInfo.db=null}vara=newwe(function(n,t){varr=_e.deleteDatabase(e.name);r.onerror=r.onblocked=function(e){varn=r.result;n&&n.close(),t(e)},r.onsuccess=function(){vare=r.result;e&&e.close(),n(e)}});returna.then(function(e){t.db=e;for(varn=0;n<r.length;n++){varo=r[n];y(o._dbInfo)}}).catch(function(n){throw(p(e,n)||we.resolve()).catch(function(){}),n})})}elser=we.reject("Invalid arguments");returnu(r,n),r}functionM(){return"function"==typeofopenDatabase}functionz(e){varn,t,r,o,i,a=.75*e.length,u=e.length,c=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);varf=newArrayBuffer(a),s=newUint8Array(f);for(n=0;n<u;n+=4)t=Oe.indexOf(e[n]),r=Oe.indexOf(e[n+1]),o=Oe.indexOf(e[n+2]),i=Oe.indexOf(e[n+3]),s[c++]=t<<2|r>>4,s[c++]=(15&r)<<4|o>>2,s[c++]=(3&o)<<6|63&i;returnf}functionP(e){varn,t=newUint8Array(e),r="";for(n=0;n<t.length;n+=3)r+=Oe[t[n]>>2],r+=Oe[(3&t[n])<<4|t[n+1]>>4],r+=Oe[(15&t[n+1])<<2|t[n+2]>>6],r+=Oe[63&t[n+2]];returnt.length%3===2?r=r.substring(0,r.length-1)+"=":t.length%3===1&&(r=r.substring(0,r.length-2)+"=="),r}functionU(e,n){vart="";if(e&&(t=Ke.call(e)),e&&("[object ArrayBuffer]"===t||e.buffer&&"[object ArrayBuffer]"===Ke.call(e.buffer))){varr,o=Be;einstanceofArrayBuffer?(r=e,o+=Ce):(r=e.buffer,"[object Int8Array]"===t?o+=Fe:"[object Uint8Array]"===t?o+=Le:"[object Uint8ClampedArray]"===t?o+=Me:"[object Int16Array]"===t?o+=ze:"[object Uint16Array]"===t?o+=Ue:"[object Int32Array]"===t?o+=Pe:"[object Uint32Array]"===t?o+=qe:"[object Float32Array]"===t?o+=We:"[object Float64Array]"===t?o+=He:n(newError("Failed to get type for BinaryArray"))),n(o+P(r))}elseif("[object Blob]"===t){vari=newFileReader;i.onload=function(){vart=xe+e.type+"~"+P(this.result);n(Be+Te+t)},i.readAsArrayBuffer(e)}elsetry{n(JSON.stringify(e))}catch(t){console.error("Couldn't convert value into a JSON string: ",e),n(null,t)}}functionq(e){if(e.substring(0,ke)!==Be)returnJSON.parse(e);varn,t=e.substring(Qe),r=e.substring(ke,Qe);if(r===Te&&De.test(t)){varo=t.match(De);n=o[1],t=t.substring(o[0].length)}vari=z(t);switch(r){caseCe:returni;caseTe:returna([i],{type:n});caseFe:returnnewInt8Array(i);caseLe:returnnewUint8Array(i);caseMe:returnnewUint8ClampedArray(i);caseze:returnnewInt16Array(i);caseUe:returnnewUint16Array(i);casePe:returnnewInt32Array(i);caseqe:returnnewUint32Array(i);caseWe:returnnewFloat32Array(i);caseHe:returnnewFloat64Array(i);default:thrownewError("Unkown type: "+r)}}functionW(e,n,t,r){e.executeSql("CREATE TABLE IF NOT EXISTS "+n.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],t,r)}functionH(e){varn=this,t={db:null};if(e)for(varrine)t[r]="string"!=typeofe[r]?e[r].toString():e[r];varo=newwe(function(e,r){try{t.db=openDatabase(t.name,String(t.version),t.description,t.size)}catch(e){returnr(e)}t.db.transaction(function(o){W(o,t,function(){n._dbInfo=t,e()},function(e,n){r(n)})},r)});returnt.serializer=Xe,o}functionQ(e,n,t,r,o,i){e.executeSql(t,r,o,function(e,a){a.code===a.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[n.storeName],function(e,u){u.rows.length?i(e,a):W(e,n,function(){e.executeSql(t,r,o,i)},i)},i):i(e,a)},i)}functionK(e,n){vart=this;e=f(e);varr=newwe(function(n,r){t.ready().then(function(){varo=t._dbInfo;o.db.transaction(function(t){Q(t,o,"SELECT * FROM "+o.storeName+" WHERE key = ? LIMIT 1",[e],function(e,t){varr=t.rows.length?t.rows.item(0).value:null;r&&(r=o.serializer.deserialize(r)),n(r)},function(e,n){r(n)})})}).catch(r)});returnu(r,n),r}functionX(e,n){vart=this,r=newwe(function(n,r){t.ready().then(function(){varo=t._dbInfo;o.db.transaction(function(t){Q(t,o,"SELECT * FROM "+o.storeName,[],function(t,r){for(vari=r.rows,a=i.length,u=0;u<a;u++){varc=i.item(u),f=c.value;if(f&&(f=o.serializer.deserialize(f)),f=e(f,c.key,u+1),void0!==f)returnvoidn(f)}n()},function(e,n){r(n)})})}).catch(r)});returnu(r,n),r}functionG(e,n,t,r){varo=this;e=f(e);vari=newwe(function(i,a){o.ready().then(function(){void0===n&&(n=null);varu=n,c=o._dbInfo;c.serializer.serialize(n,function(n,f){f?a(f):c.db.transaction(function(t){Q(t,c,"INSERT OR REPLACE INTO "+c.storeName+" (key, value) VALUES (?, ?)",[e,n],function(){i(u)},function(e,n){a(n)})},function(n){if(n.code===n.QUOTA_ERR){if(r>0)returnvoidi(G.apply(o,[e,u,t,r-1]));a(n)}})})}).catch(a)});returnu(i,t),i}functionJ(e,n,t){returnG.apply(this,[e,n,t,1])}functionV(e,n){vart=this;e=f(e);varr=newwe(function(n,r){t.ready().then(function(){varo=t._dbInfo;o.db.transaction(function(t){Q(t,o,"DELETE FROM "+o.storeName+" WHERE key = ?",[e],function(){n()},function(e,n){r(n)})})}).catch(r)});returnu(r,n),r}functionY(e){varn=this,t=newwe(function(e,t){n.ready().then(function(){varr=n._dbInfo;r.db.transaction(function(n){Q(n,r,"DELETE FROM "+r.storeName,[],function(){e()},function(e,n){t(n)})})}).catch(t)});returnu(t,e),t}functionZ(e){varn=this,t=newwe(function(e,t){n.ready().then(function(){varr=n._dbInfo;r.db.transaction(function(n){Q(n,r,"SELECT COUNT(key) as c FROM "+r.storeName,[],function(n,t){varr=t.rows.item(0).c;e(r)},function(e,n){t(n)})})}).catch(t)});returnu(t,e),t}function$(e,n){vart=this,r=newwe(function(n,r){t.ready().then(function(){varo=t._dbInfo;o.db.transaction(function(t){Q(t,o,"SELECT key FROM "+o.storeName+" WHERE id = ? LIMIT 1",[e+1],function(e,t){varr=t.rows.length?t.rows.item(0).key:null;n(r)},function(e,n){r(n)})})}).catch(r)});returnu(r,n),r}functionee(e){varn=this,t=newwe(function(e,t){n.ready().then(function(){varr=n._dbInfo;r.db.transaction(function(n){Q(n,r,"SELECT key FROM "+r.storeName,[],function(n,t){for(varr=[],o=0;o<t.rows.length;o++)r.push(t.rows.item(o).key);e(r)},function(e,n){t(n)})})}).catch(t)});returnu(t,e),t}functionne(e){returnnewwe(function(n,t){e.transaction(function(r){r.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(t,r){for(varo=[],i=0;i<r.rows.length;i++)o.push(r.rows.item(i).name);n({db:e,storeNames:o})},function(e,n){t(n)})},function(e){t(e)})})}functionte(e,n){n=s.apply(this,arguments);vart=this.config();e="function"!=typeofe&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);varr,o=this;returnr=e.name?newwe(function(n){varr;r=e.name===t.name?o._dbInfo.db:openDatabase(e.name,"","",0),n(e.storeName?{db:r,storeNames:[e.storeName]}:ne(r))}).then(function(e){returnnewwe(function(n,t){e.db.transaction(function(r){functiono(e){returnnewwe(function(n,t){r.executeSql("DROP TABLE IF EXISTS "+e,[],function(){n()},function(e,n){t(n)})})}for(vari=[],a=0,u=e.storeNames.length;a<u;a++)i.push(o(e.storeNames[a]));we.all(i).then(function(){n()}).catch(function(e){t(e)})},function(e){t(e)})})}):we.reject("Invalid arguments"),u(r,n),r}functionre(){try{return"undefined"!=typeoflocalStorage&&"setItem"inlocalStorage&&!!localStorage.setItem}catch(e){return!1}}functionoe(e,n){vart=e.name+"/";returne.storeName!==n.storeName&&(t+=e.storeName+"/"),t}functionie(){vare="_localforage_support_test";try{returnlocalStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch(e){return!0}}functionae(){return!ie()||localStorage.length>0}functionue(e){varn=this,t={};if(e)for(varrine)t[r]=e[r];returnt.keyPrefix=oe(e,n._defaultConfig),ae()?(n._dbInfo=t,t.serializer=Xe,we.resolve()):we.reject()}functionce(e){varn=this,t=n.ready().then(function(){for(vare=n._dbInfo.keyPrefix,t=localStorage.length-1;t>=0;t--){varr=localStorage.key(t);0===r.indexOf(e)&&localStorage.removeItem(r)}});returnu(t,e),t}functionfe(e,n){vart=this;e=f(e);varr=t.ready().then(function(){varn=t._dbInfo,r=localStorage.getItem(n.keyPrefix+e);returnr&&(r=n.serializer.deserialize(r)),r});returnu(r,n),r}functionse(e,n){vart=this,r=t.ready().then(function(){for(varn=t._dbInfo,r=n.keyPrefix,o=r.length,i=localStorage.length,a=1,u=0;u<i;u++){varc=localStorage.key(u);if(0===c.indexOf(r)){varf=localStorage.getItem(c);if(f&&(f=n.serializer.deserialize(f)),f=e(f,c.substring(o),a++),void0!==f)returnf}}});returnu(r,n),r}functionle(e,n){vart=this,r=t.ready().then(function(){varn,r=t._dbInfo;try{n=localStorage.key(e)}catch(e){n=null}returnn&&(n=n.substring(r.keyPrefix.length)),n});returnu(r,n),r}functionde(e){varn=this,t=n.ready().then(function(){for(vare=n._dbInfo,t=localStorage.length,r=[],o=0;o<t;o++){vari=localStorage.key(o);0===i.indexOf(e.keyPrefix)&&r.push(i.substring(e.keyPrefix.length))}returnr});returnu(t,e),t}functionve(e){varn=this,t=n.keys().then(function(e){returne.length});returnu(t,e),t}functionhe(e,n){vart=this;e=f(e);varr=t.ready().then(function(){varn=t._dbInfo;localStorage.removeItem(n.keyPrefix+e)});returnu(r,n),r}functionye(e,n,t){varr=this;e=f(e);varo=r.ready().then(function(){void0===n&&(n=null);vart=n;returnnewwe(function(o,i){vara=r._dbInfo;a.serializer.serialize(n,function(n,r){if(r)i(r);elsetry{localStorage.setItem(a.keyPrefix+e,n),o(t)}catch(e){"QuotaExceededError"!==e.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==e.name||i(e),i(e)}})})});returnu(o,t),o}functionpe(e,n){if(n=s.apply(this,arguments),e="function"!=typeofe&&e||{},!e.name){vart=this.config();e.name=e.name||t.name,e.storeName=e.storeName||t.storeName}varr,o=this;returnr=e.name?newwe(function(n){n(e.storeName?oe(e,o._defaultConfig):e.name+"/")}).then(function(e){for(varn=localStorage.length-1;n>=0;n--){vart=localStorage.key(n);0===t.indexOf(e)&&localStorage.removeItem(t)}}):we.reject("Invalid arguments"),u(r,n),r}functionbe(e,n){e[n]=function(){vart=arguments;returne.ready().then(function(){returne[n].apply(e,t)})}}functionme(){for(vare=1;e<arguments.length;e++){varn=arguments[e];if(n)for(vartinn)n.hasOwnProperty(t)&&(Ze(n[t])?arguments[0][t]=n[t].slice():arguments[0][t]=n[t])}returnarguments[0]}varge="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(e){returntypeofe}:function(e){returne&&"function"==typeofSymbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeofe},_e=o();"undefined"==typeofPromise&&e(3);varwe=Promise,Ie="local-forage-detect-blob-support",Se=void0,Ee={},Ne=Object.prototype.toString,je="readonly",Ae="readwrite",Re={_driver:"asyncStorage",_initStorage:R,_support:i(),iterate:x,getItem:O,setItem:D,removeItem:B,clear:k,length:C,key:T,keys:F,dropInstance:L},Oe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",xe="~~local_forage_type~",De=/^~~local_forage_type~([^~]+)~/,Be="__lfsc__:",ke=Be.length,Ce="arbf",Te="blob",Fe="si08",Le="ui08",Me="uic8",ze="si16",Pe="si32",Ue="ur16",qe="ui32",We="fl32",He="fl64",Qe=ke+Ce.length,Ke=Object.prototype.toString,Xe={serialize:U,deserialize:q,stringToBuffer:z,bufferToString:P},Ge={_driver:"webSQLStorage",_initStorage:H,_support:M(),iterate:X,getItem:K,setItem:J,removeItem:V,clear:Y,length:Z,key:$,keys:ee,dropInstance:te},Je={_driver:"localStorageWrapper",_initStorage:ue,_support:re(),iterate:se,getItem:fe,setItem:ye,removeItem:he,clear:ce,length:ve,key:le,keys:de,dropInstance:pe},Ve=function(e,n){returne===n||"number"==typeofe&&"number"==typeofn&&isNaN(e)&&isNaN(n)},Ye=function(e,n){for(vart=e.length,r=0;r<t;){if(Ve(e[r],n))return!0;r++}return!1},Ze=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},$e={},en={},nn={INDEXEDDB:Re,WEBSQL:Ge,LOCALSTORAGE:Je},tn=[nn.INDEXEDDB._driver,nn.WEBSQL._driver,nn.LOCALSTORAGE._driver],rn=["dropInstance"],on=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(rn),an={description:"",driver:tn.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1},un=function(){functione(n){r(this,e);for(vartinnn)if(nn.hasOwnProperty(t)){varo=nn[t],i=o._driver;this[t]=i,$e[i]||this.defineDriver(o)}this._defaultConfig=me({},an),this._config=me({},this._defaultConfig,n),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}returne.prototype.config=function(e){if("object"===("undefined"==typeofe?"undefined":ge(e))){if(this._ready)returnnewError("Can't call config() after localforage has been used.");for(varnine){if("storeName"===n&&(e[n]=e[n].replace(/\W/g,"_")),"version"===n&&"number"!=typeofe[n])returnnewError("Database version must be a number.");this._config[n]=e[n]}return!("driver"ine&&e.driver)||this.setDriver(this._config.driver)}return"string"==typeofe?this._config[e]:this._config},e.prototype.defineDriver=function(e,n,t){varr=newwe(function(n,t){try{varr=e._driver,o=newError("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)returnvoidt(o);for(vari=on.concat("_initStorage"),a=0,c=i.length;a<c;a++){varf=i[a],s=!Ye(rn,f);if((s||e[f])&&"function"!=typeofe[f])returnvoidt(o)}varl=function(){for(varn=function(e){returnfunction(){varn=newError("Method "+e+" is not implemented by the current driver"),t=we.reject(n);returnu(t,arguments[arguments.length-1]),t}},t=0,r=rn.length;t<r;t++){varo=rn[t];e[o]||(e[o]=n(o))}};l();vard=function(t){$e[r]&&console.info("Redefining LocalForage driver: "+r),$e[r]=e,en[r]=t,n()};"_support"ine?e._support&&"function"==typeofe._support?e._support().then(d,t):d(!!e._support):d(!0)}catch(e){t(e)}});returnc(r,n,t),r},e.prototype.driver=function(){returnthis._driver||null},e.prototype.getDriver=function(e,n,t){varr=$e[e]?we.resolve($e[e]):we.reject(newError("Driver not found."));returnc(r,n,t),r},e.prototype.getSerializer=function(e){varn=we.resolve(Xe);returnc(n,e),n},e.prototype.ready=function(e){varn=this,t=n._driverSet.then(function(){returnnull===n._ready&&(n._ready=n._initDriver()),n._ready});returnc(t,e,e),t},e.prototype.setDriver=function(e,n,t){functionr(){a._config.driver=a.driver()}functiono(e){returna._extend(e),r(),a._ready=a._initStorage(a._config),a._ready}functioni(e){returnfunction(){functionn(){for(;t<e.length;){vari=e[t];returnt++,a._dbInfo=null,a._ready=null,a.getDriver(i).then(o).catch(n)}r();varu=newError("No available storage method found.");returna._driverSet=we.reject(u),a._driverSet}vart=0;returnn()}}vara=this;Ze(e)||(e=[e]);varu=this._getSupportedDrivers(e),f=null!==this._driverSet?this._driverSet.catch(function(){returnwe.resolve()}):we.resolve();returnthis._driverSet=f.then(function(){vare=u[0];returna._dbInfo=null,a._ready=null,a.getDriver(e).then(function(e){a._driver=e._driver,r(),a._wrapLibraryMethodsWithReady(),a._initDriver=i(u)})}).catch(function(){r();vare=newError("No available storage method found.");returna._driverSet=we.reject(e),a._driverSet}),c(this._driverSet,n,t),this._driverSet},e.prototype.supports=function(e){return!!en[e]},e.prototype._extend=function(e){me(this,e)},e.prototype._getSupportedDrivers=function(e){for(varn=[],t=0,r=e.length;t<r;t++){varo=e[t];this.supports(o)&&n.push(o)}returnn},e.prototype._wrapLibraryMethodsWithReady=function(){for(vare=0,n=on.length;e<n;e++)be(this,on[e])},e.prototype.createInstance=function(n){returnnewe(n)},e}(),cn=newun;n.exports=cn},{3:3}]},{},[4])(4)})}]);