!function(n){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{var t;t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this;t.localforage=n()}}(function(){return function n(t,i,r){function u(f,o){var h,c,s;if(!i[f]){if(!t[f]){if(h="function"==typeof require&&require,!o&&h)return h(f,!0);if(e)return e(f,!0);c=new Error("Cannot find module '"+f+"'");throw c.code="MODULE_NOT_FOUND",c;}s=i[f]={exports:{}};t[f][0].call(s.exports,function(n){var i=t[f][1][n];return u(i||n)},s,s.exports,n,t,i,r)}return i[f].exports}for(var e="function"==typeof require&&require,f=0;f<r.length;f++)u(r[f]);return u}({1:[function(n,t){(function(n){"use strict";function r(){e=!0;for(var n,r,t=i.length;t;){for(r=i,i=[],n=-1;++n<t;)r[n]();t=i.length}e=!1}function c(n){1!==i.push(n)||e||u()}var u,o=n.MutationObserver||n.WebKitMutationObserver,f,e,i;if(o){var s=0,l=new o(r),h=n.document.createTextNode("");l.observe(h,{characterData:!0});u=function(){h.data=s=++s%2}}else n.setImmediate||void 0===n.MessageChannel?u="document"in n&&"onreadystatechange"in n.document.createElement("script")?function(){var t=n.document.createElement("script");t.onreadystatechange=function(){r();t.onreadystatechange=null;t.parentNode.removeChild(t);t=null};n.document.documentElement.appendChild(t)}:function(){setTimeout(r,0)}:(f=new n.MessageChannel,f.port1.onmessage=r,u=function(){f.port2.postMessage(0)});i=[];t.exports=c}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(n,t,i){"use strict";function u(){}function e(n){if("function"!=typeof n)throw new TypeError("resolver must be a function");this.state=a;this.queue=[];this.outcome=void 0;n!==u&&h(this,n)}function f(n,t,i){this.promise=n;"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled);"function"==typeof i&&(this.onRejected=i,this.callRejected=this.otherCallRejected)}function o(n,t,i){k(function(){var u;try{u=t(i)}catch(t){return r.reject(n,t)}u===n?r.reject(n,new TypeError("Cannot resolve promise with itself")):r.resolve(n,u)})}function v(n){var t=n&&n.then;if(n&&"object"==typeof n&&"function"==typeof t)return function(){t.apply(n,arguments)}}function h(n,t){function u(t){i||(i=!0,r.reject(n,t))}function e(t){i||(i=!0,r.resolve(n,t))}function o(){t(e,u)}var i=!1,f=c(o);"error"===f.status&&u(f.value)}function c(n,t){var i={};try{i.value=n(t);i.status="success"}catch(n){i.status="error";i.value=n}return i}function y(n){return n instanceof this?n:r.resolve(new this(u),n)}function p(n){var t=new this(u);return r.reject(t,n)}function w(n){function s(n,u){function f(n){o[u]=n;++c!==t||i||(i=!0,r.resolve(e,o))}h.resolve(n).then(f,function(n){i||(i=!0,r.reject(e,n))})}var h=this,t,i;if("[object Array]"!==Object.prototype.toString.call(n))return this.reject(new TypeError("must be an array"));if(t=n.length,i=!1,!t)return this.resolve([]);for(var o=new Array(t),c=0,f=-1,e=new this(u);++f<t;)s(n[f],f);return e}function b(n){function o(n){s.resolve(n).then(function(n){t||(t=!0,r.resolve(i,n))},function(n){t||(t=!0,r.reject(i,n))})}var s=this,f,t,e,i;if("[object Array]"!==Object.prototype.toString.call(n))return this.reject(new TypeError("must be an array"));if(f=n.length,t=!1,!f)return this.resolve([]);for(e=-1,i=new this(u);++e<f;)o(n[e]);return i}var k=n(1),r={},l=["REJECTED"],s=["FULFILLED"],a=["PENDING"];t.exports=i=e;e.prototype.catch=function(n){return this.then(null,n)};e.prototype.then=function(n,t){if("function"!=typeof n&&this.state===s||"function"!=typeof t&&this.state===l)return this;var i=new this.constructor(u);return this.state!==a?o(i,this.state===s?n:t,this.outcome):this.queue.push(new f(i,n,t)),i};f.prototype.callFulfilled=function(n){r.resolve(this.promise,n)};f.prototype.otherCallFulfilled=function(n){o(this.promise,this.onFulfilled,n)};f.prototype.callRejected=function(n){r.reject(this.promise,n)};f.prototype.otherCallRejected=function(n){o(this.promise,this.onRejected,n)};r.resolve=function(n,t){var i=c(v,t),u,f,e;if("error"===i.status)return r.reject(n,i.value);if(u=i.value,u)h(n,u);else for(n.state=s,n.outcome=t,f=-1,e=n.queue.length;++f<e;)n.queue[f].callFulfilled(t);return n};r.reject=function(n,t){n.state=l;n.outcome=t;for(var i=-1,r=n.queue.length;++i<r;)n.queue[i].callRejected(t);return n};i.resolve=y;i.reject=p;i.all=w;i.race=b},{1:1}],3:[function(n){(function(t){"use strict";"function"!=typeof t.Promise&&(t.Promise=n(2))}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(n,t){"use strict";function ri(n,t){if(!(n instanceof t))throw new TypeError("Cannot call a class as a function");}function ui(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(n){return}}function fi(){try{if(!k)return!1;var n="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!n||t)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(n){return!1}}function y(n,t){n=n||[];t=t||{};try{return new Blob(n,t)}catch(r){if("TypeError"!==r.name)throw r;for(var f="undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder,u=new f,i=0;i<n.length;i+=1)u.append(n[i]);return u.getBlob(t.type)}}function r(n,t){t&&n.then(function(n){t(null,n)},function(n){t(n)})}function s(n,t,i){"function"==typeof t&&n.then(t);"function"==typeof i&&n.catch(i)}function u(n){return"string"!=typeof n&&(console.warn(n+" used as a key, but it is not a string."),n=String(n)),n}function ei(n){for(var i=n.length,r=new ArrayBuffer(i),u=new Uint8Array(r),t=0;t<i;t++)u[t]=n.charCodeAt(t);return r}function oi(n){return new i(function(t){var i=n.transaction(g,a),r=y([""]);i.objectStore(g).put(r,"key");i.onabort=function(n){n.preventDefault();n.stopPropagation();t(!1)};i.oncomplete=function(){var n=navigator.userAgent.match(/Chrome\/(\d+)/),i=navigator.userAgent.match(/Edge\//);t(i||!n||parseInt(n[1],10)>=43)}}).catch(function(){return!1})}function si(n){return"boolean"==typeof d?i.resolve(d):oi(n).then(function(n){return d=n})}function ft(n){var r=f[n.name],t={};t.promise=new i(function(n){t.resolve=n});r.deferredOperations.push(t);r.dbReady=r.dbReady?r.dbReady.then(function(){return t.promise}):t.promise}function hi(n){var i=f[n.name],t=i.deferredOperations.pop();t&&t.resolve()}function ci(n,t){var r=f[n.name],i=r.deferredOperations.pop();i&&i.reject(t)}function p(n,t){return new i(function(i,r){var f,u;if(n.db){if(!t)return i(n.db);ft(n);n.db.close()}f=[n.name];t&&f.push(n.version);u=k.open.apply(k,f);t&&(u.onupgradeneeded=function(t){var i=u.result;try{i.createObjectStore(n.storeName);t.oldVersion<=1&&i.createObjectStore(g)}catch(i){if("ConstraintError"!==i.name)throw i;console.warn('The database "'+n.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+n.storeName+'" already exists.')}});u.onerror=function(n){n.preventDefault();r(u.error)};u.onsuccess=function(){i(u.result);hi(n)}})}function li(n){return p(n,!1)}function ai(n){return p(n,!0)}function vi(n,t){var i;if(!n.db)return!0;var r=!n.db.objectStoreNames.contains(n.storeName),u=n.version<n.db.version,f=n.version>n.db.version;return(u&&(n.version!==t&&console.warn('The database "'+n.name+"\" can't be downgraded from version "+n.db.version+" to version "+n.version+"."),n.version=n.db.version),f||r)?(r&&(i=n.db.version+1,i>n.version&&(n.version=i)),!0):!1}function yi(n){return new i(function(t,i){var r=new FileReader;r.onerror=i;r.onloadend=function(i){var r=btoa(i.target.result||"");t({__local_forage_encoded_blob:!0,data:r,type:n.type})};r.readAsBinaryString(n)})}function et(n){return y([ei(atob(n.data))],{type:n.type})}function ot(n){return n&&n.__local_forage_encoded_blob}function pi(n){var t=this,i=t._initReady().then(function(){var n=f[t._dbInfo.name];if(n&&n.dbReady)return n.dbReady});return s(i,n,n),i}function wi(n){ft(n);for(var r=f[n.name],t=r.forages,i=0;i<t.length;i++)t[i]._dbInfo.db&&(t[i]._dbInfo.db.close(),t[i]._dbInfo.db=null);return p(n,!1).then(function(n){for(var i=0;i<t.length;i++)t[i]._dbInfo.db=n}).catch(function(t){throw ci(n,t),t;})}function e(n,t,i){try{var r=n.db.transaction(n.storeName,t);i(null,r)}catch(r){if(!n.db||"InvalidStateError"===r.name)return wi(n).then(function(){var r=n.db.transaction(n.storeName,t);i(null,r)});i(r)}}function bi(n){function l(){return i.resolve()}var u=this,t={db:null},o,r,s,e,h,c;if(n)for(o in n)t[o]=n[o];for(f||(f={}),r=f[t.name],r||(r={forages:[],db:null,dbReady:null,deferredOperations:[]},f[t.name]=r),r.forages.push(u),u._initReady||(u._initReady=u.ready,u.ready=pi),s=[],e=0;e<r.forages.length;e++)h=r.forages[e],h!==u&&s.push(h._initReady().catch(l));return c=r.forages.slice(0),i.all(s).then(function(){return t.db=r.db,li(t)}).then(function(n){return t.db=n,vi(t,u._defaultConfig.version)?ai(t):n}).then(function(n){var i,f;for(t.db=r.db=n,u._dbInfo=t,i=0;i<c.length;i++)f=c[i],f!==u&&(f._dbInfo.db=t.db,f._dbInfo.version=t.version)})}function ki(n,t){var f=this,o;return n=u(n),o=new i(function(t,i){f.ready().then(function(){e(f._dbInfo,c,function(r,u){if(r)return i(r);try{var o=u.objectStore(f._dbInfo.storeName),e=o.get(n);e.onsuccess=function(){var n=e.result;void 0===n&&(n=null);ot(n)&&(n=et(n));t(n)};e.onerror=function(){i(e.error)}}catch(n){i(n)}})}).catch(i)}),r(o,t),o}function di(n,t){var u=this,f=new i(function(t,i){u.ready().then(function(){e(u._dbInfo,c,function(r,f){if(r)return i(r);try{var o=f.objectStore(u._dbInfo.storeName),e=o.openCursor(),s=1;e.onsuccess=function(){var r=e.result,i,u;r?(i=r.value,ot(i)&&(i=et(i)),u=n(i,r.key,s++),void 0!==u?t(u):r.continue()):t()};e.onerror=function(){i(e.error)}}catch(n){i(n)}})}).catch(i)});return r(f,t),f}function gi(n,t,f){var o=this,s;return n=u(n),s=new i(function(i,r){var u;o.ready().then(function(){return u=o._dbInfo,"[object Blob]"===cu.call(t)?si(u.db).then(function(n){return n?t:yi(t)}):t}).then(function(t){e(o._dbInfo,a,function(u,f){if(u)return r(u);try{var s=f.objectStore(o._dbInfo.storeName),e=s.put(t,n);null===t&&(t=void 0);f.oncomplete=function(){void 0===t&&(t=null);i(t)};f.onabort=f.onerror=function(){var n=e.error?e.error:e.transaction.error;r(n)}}catch(n){r(n)}})}).catch(r)}),r(s,f),s}function nr(n,t){var f=this,o;return n=u(n),o=new i(function(t,i){f.ready().then(function(){e(f._dbInfo,a,function(r,u){if(r)return i(r);try{var o=u.objectStore(f._dbInfo.storeName),e=o.delete(n);u.oncomplete=function(){t()};u.onerror=function(){i(e.error)};u.onabort=function(){var n=e.error?e.error:e.transaction.error;i(n)}}catch(n){i(n)}})}).catch(i)}),r(o,t),o}function tr(n){var t=this,u=new i(function(n,i){t.ready().then(function(){e(t._dbInfo,a,function(r,u){if(r)return i(r);try{var e=u.objectStore(t._dbInfo.storeName),f=e.clear();u.oncomplete=function(){n()};u.onabort=u.onerror=function(){var n=f.error?f.error:f.transaction.error;i(n)}}catch(n){i(n)}})}).catch(i)});return r(u,n),u}function ir(n){var t=this,u=new i(function(n,i){t.ready().then(function(){e(t._dbInfo,c,function(r,u){if(r)return i(r);try{var e=u.objectStore(t._dbInfo.storeName),f=e.count();f.onsuccess=function(){n(f.result)};f.onerror=function(){i(f.error)}}catch(n){i(n)}})}).catch(i)});return r(u,n),u}function rr(n,t){var u=this,f=new i(function(t,i){if(n<0)return void t(null);u.ready().then(function(){e(u._dbInfo,c,function(r,f){if(r)return i(r);try{var s=f.objectStore(u._dbInfo.storeName),o=!1,e=s.openCursor();e.onsuccess=function(){var i=e.result;if(!i)return void t(null);0===n?t(i.key):o?t(i.key):(o=!0,i.advance(n))};e.onerror=function(){i(e.error)}}catch(n){i(n)}})}).catch(i)});return r(f,t),f}function ur(n){var t=this,u=new i(function(n,i){t.ready().then(function(){e(t._dbInfo,c,function(r,u){if(r)return i(r);try{var o=u.objectStore(t._dbInfo.storeName),f=o.openCursor(),e=[];f.onsuccess=function(){var t=f.result;if(!t)return void n(e);e.push(t.key);t.continue()};f.onerror=function(){i(f.error)}}catch(n){i(n)}})}).catch(i)});return r(u,n),u}function fr(){return"function"==typeof openDatabase}function st(n){var t,h,r,u,c,f=.75*n.length,l=n.length,e=0,s,i;for("="===n[n.length-1]&&(f--,"="===n[n.length-2]&&f--),s=new ArrayBuffer(f),i=new Uint8Array(s),t=0;t<l;t+=4)h=o.indexOf(n[t]),r=o.indexOf(n[t+1]),u=o.indexOf(n[t+2]),c=o.indexOf(n[t+3]),i[e++]=h<<2|r>>4,i[e++]=(15&r)<<4|u>>2,i[e++]=(3&u)<<6|63&c;return s}function w(n){for(var r=new Uint8Array(n),t="",i=0;i<r.length;i+=3)t+=o[r[i]>>2],t+=o[(3&r[i])<<4|r[i+1]>>4],t+=o[(15&r[i+1])<<2|r[i+2]>>6],t+=o[63&r[i+2]];return r.length%3==2?t=t.substring(0,t.length-1)+"=":r.length%3==1&&(t=t.substring(0,t.length-2)+"=="),t}function er(n,t){var i="",u,r,f;if(n&&(i=ni.call(n)),n&&("[object ArrayBuffer]"===i||n.buffer&&"[object ArrayBuffer]"===ni.call(n.buffer)))r=v,n instanceof ArrayBuffer?(u=n,r+=tt):(u=n.buffer,"[object Int8Array]"===i?r+=lt:"[object Uint8Array]"===i?r+=at:"[object Uint8ClampedArray]"===i?r+=vt:"[object Int16Array]"===i?r+=yt:"[object Uint16Array]"===i?r+=wt:"[object Int32Array]"===i?r+=pt:"[object Uint32Array]"===i?r+=bt:"[object Float32Array]"===i?r+=kt:"[object Float64Array]"===i?r+=dt:t(new Error("Failed to get type for BinaryArray"))),t(r+w(u));else if("[object Blob]"===i)f=new FileReader,f.onload=function(){var i=au+n.type+"~"+w(this.result);t(v+it+i)},f.readAsArrayBuffer(n);else try{t(JSON.stringify(n))}catch(i){console.error("Couldn't convert value into a JSON string: ",n);t(null,i)}}function or(n){var f,i,r,u,t;if(n.substring(0,nt)!==v)return JSON.parse(n);i=n.substring(gt);r=n.substring(nt,gt);r===it&&ct.test(i)&&(u=i.match(ct),f=u[1],i=i.substring(u[0].length));t=st(i);switch(r){case tt:return t;case it:return y([t],{type:f});case lt:return new Int8Array(t);case at:return new Uint8Array(t);case vt:return new Uint8ClampedArray(t);case yt:return new Int16Array(t);case wt:return new Uint16Array(t);case pt:return new Int32Array(t);case bt:return new Uint32Array(t);case kt:return new Float32Array(t);case dt:return new Float64Array(t);default:throw new Error("Unkown type: "+r);}}function sr(n){var f=this,t={db:null},r,u;if(n)for(r in n)t[r]="string"!=typeof n[r]?n[r].toString():n[r];return u=new i(function(n,i){try{t.db=openDatabase(t.name,String(t.version),t.description,t.size)}catch(n){return i(n)}t.db.transaction(function(r){r.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],function(){f._dbInfo=t;n()},function(n,t){i(t)})})}),t.serializer=rt,u}function hr(n,t){var e=this,f;return n=u(n),f=new i(function(t,i){e.ready().then(function(){var r=e._dbInfo;r.db.transaction(function(u){u.executeSql("SELECT * FROM "+r.storeName+" WHERE key = ? LIMIT 1",[n],function(n,i){var u=i.rows.length?i.rows.item(0).value:null;u&&(u=r.serializer.deserialize(u));t(u)},function(n,t){i(t)})})}).catch(i)}),r(f,t),f}function cr(n,t){var u=this,f=new i(function(t,i){u.ready().then(function(){var r=u._dbInfo;r.db.transaction(function(u){u.executeSql("SELECT * FROM "+r.storeName,[],function(i,u){for(var o,f,s=u.rows,h=s.length,e=0;e<h;e++)if(o=s.item(e),f=o.value,f&&(f=r.serializer.deserialize(f)),void 0!==(f=n(f,o.key,e+1)))return void t(f);t()},function(n,t){i(t)})})}).catch(i)});return r(f,t),f}function ht(n,t,f,e){var o=this,s;return n=u(n),s=new i(function(i,r){o.ready().then(function(){void 0===t&&(t=null);var s=t,u=o._dbInfo;u.serializer.serialize(t,function(t,h){h?r(h):u.db.transaction(function(f){f.executeSql("INSERT OR REPLACE INTO "+u.storeName+" (key, value) VALUES (?, ?)",[n,t],function(){i(s)},function(n,t){r(t)})},function(t){if(t.code===t.QUOTA_ERR){if(e>0)return void i(ht.apply(o,[n,s,f,e-1]));r(t)}})})}).catch(r)}),r(s,f),s}function lr(n,t,i){return ht.apply(this,[n,t,i,1])}function ar(n,t){var e=this,f;return n=u(n),f=new i(function(t,i){e.ready().then(function(){var r=e._dbInfo;r.db.transaction(function(u){u.executeSql("DELETE FROM "+r.storeName+" WHERE key = ?",[n],function(){t()},function(n,t){i(t)})})}).catch(i)}),r(f,t),f}function vr(n){var t=this,u=new i(function(n,i){t.ready().then(function(){var r=t._dbInfo;r.db.transaction(function(t){t.executeSql("DELETE FROM "+r.storeName,[],function(){n()},function(n,t){i(t)})})}).catch(i)});return r(u,n),u}function yr(n){var t=this,u=new i(function(n,i){t.ready().then(function(){var r=t._dbInfo;r.db.transaction(function(t){t.executeSql("SELECT COUNT(key) as c FROM "+r.storeName,[],function(t,i){var r=i.rows.item(0).c;n(r)},function(n,t){i(t)})})}).catch(i)});return r(u,n),u}function pr(n,t){var u=this,f=new i(function(t,i){u.ready().then(function(){var r=u._dbInfo;r.db.transaction(function(u){u.executeSql("SELECT key FROM "+r.storeName+" WHERE id = ? LIMIT 1",[n+1],function(n,i){var r=i.rows.length?i.rows.item(0).key:null;t(r)},function(n,t){i(t)})})}).catch(i)});return r(f,t),f}function wr(n){var t=this,u=new i(function(n,i){t.ready().then(function(){var r=t._dbInfo;r.db.transaction(function(t){t.executeSql("SELECT key FROM "+r.storeName,[],function(t,i){for(var u=[],r=0;r<i.rows.length;r++)u.push(i.rows.item(r).key);n(u)},function(n,t){i(t)})})}).catch(i)});return r(u,n),u}function br(){try{return"undefined"!=typeof localStorage&&"setItem"in localStorage&&"function"==typeof localStorage.setItem}catch(n){return!1}}function kr(){var n="_localforage_support_test";try{return localStorage.setItem(n,!0),localStorage.removeItem(n),!1}catch(n){return!0}}function dr(){return!kr()||localStorage.length>0}function gr(n){var u=this,t={},r;if(n)for(r in n)t[r]=n[r];return t.keyPrefix=t.name+"/",t.storeName!==u._defaultConfig.storeName&&(t.keyPrefix+=t.storeName+"/"),dr()?(u._dbInfo=t,t.serializer=rt,i.resolve()):i.reject()}function nu(n){var t=this,i=t.ready().then(function(){for(var i,r=t._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--)i=localStorage.key(n),0===i.indexOf(r)&&localStorage.removeItem(i)});return r(i,n),i}function tu(n,t){var f=this,i;return n=u(n),i=f.ready().then(function(){var i=f._dbInfo,t=localStorage.getItem(i.keyPrefix+n);return t&&(t=i.serializer.deserialize(t)),t}),r(i,t),i}function iu(n,t){var i=this,u=i.ready().then(function(){for(var r,t,f=i._dbInfo,e=f.keyPrefix,o=e.length,s=localStorage.length,h=1,u=0;u<s;u++)if(r=localStorage.key(u),0===r.indexOf(e)&&(t=localStorage.getItem(r),t&&(t=f.serializer.deserialize(t)),void 0!==(t=n(t,r.substring(o),h++))))return t});return r(u,t),u}function ru(n,t){var i=this,u=i.ready().then(function(){var t,r=i._dbInfo;try{t=localStorage.key(n)}catch(n){t=null}return t&&(t=t.substring(r.keyPrefix.length)),t});return r(u,t),u}function uu(n){var t=this,i=t.ready().then(function(){for(var i,r=t._dbInfo,f=localStorage.length,u=[],n=0;n<f;n++)i=localStorage.key(n),0===i.indexOf(r.keyPrefix)&&u.push(i.substring(r.keyPrefix.length));return u});return r(i,n),i}function fu(n){var i=this,t=i.keys().then(function(n){return n.length});return r(t,n),t}function eu(n,t){var f=this,i;return n=u(n),i=f.ready().then(function(){var t=f._dbInfo;localStorage.removeItem(t.keyPrefix+n)}),r(i,t),i}function ou(n,t,f){var o=this,e;return n=u(n),e=o.ready().then(function(){void 0===t&&(t=null);var r=t;return new i(function(i,u){var f=o._dbInfo;f.serializer.serialize(t,function(t,e){if(e)u(e);else try{localStorage.setItem(f.keyPrefix+n,t);i(r)}catch(n){"QuotaExceededError"!==n.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==n.name||u(n);u(n)}})})}),r(e,f),e}function su(n,t){n[t]=function(){var i=arguments;return n.ready().then(function(){return n[t].apply(n,i)})}}function b(){for(var n,t,i=1;i<arguments.length;i++)if(n=arguments[i],n)for(t in n)n.hasOwnProperty(t)&&(arguments[0][t]=ti(n[t])?n[t].slice():n[t]);return arguments[0]}var hu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},k=ui();"undefined"==typeof Promise&&n(3);var d,f,i=Promise,g="local-forage-detect-blob-support",cu=Object.prototype.toString,c="readonly",a="readwrite",lu={_driver:"asyncStorage",_initStorage:bi,_support:fi(),iterate:di,getItem:ki,setItem:gi,removeItem:nr,clear:tr,length:ir,key:rr,keys:ur},o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",au="~~local_forage_type~",ct=/^~~local_forage_type~([^~]+)~/,v="__lfsc__:",nt=v.length,tt="arbf",it="blob",lt="si08",at="ui08",vt="uic8",yt="si16",pt="si32",wt="ur16",bt="ui32",kt="fl32",dt="fl64",gt=nt+tt.length,ni=Object.prototype.toString,rt={serialize:er,deserialize:or,stringToBuffer:st,bufferToString:w},vu={_driver:"webSQLStorage",_initStorage:sr,_support:fr(),iterate:cr,getItem:hr,setItem:lr,removeItem:ar,clear:vr,length:yr,key:pr,keys:wr},yu={_driver:"localStorageWrapper",_initStorage:gr,_support:br(),iterate:iu,getItem:tu,setItem:ou,removeItem:eu,clear:nu,length:fu,key:ru,keys:uu},ti=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)},l={},ii={},h={INDEXEDDB:lu,WEBSQL:vu,LOCALSTORAGE:yu},pu=[h.INDEXEDDB._driver,h.WEBSQL._driver,h.LOCALSTORAGE._driver],ut=["clear","getItem","iterate","key","keys","length","removeItem","setItem"],wu={description:"",driver:pu.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1},bu=function(){function n(t){var i,r,u;ri(this,n);for(i in h)h.hasOwnProperty(i)&&(r=h[i],u=r._driver,this[i]=u,l[u]||this.defineDriver(r));this._defaultConfig=b({},wu);this._config=b({},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 n.prototype.config=function(n){if("object"===(void 0===n?"undefined":hu(n))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in n){if("storeName"===t&&(n[t]=n[t].replace(/\W/g,"_")),"version"===t&&"number"!=typeof n[t])return new Error("Database version must be a number.");this._config[t]=n[t]}return!("driver"in n&&n.driver)||this.setDriver(this._config.driver)}return"string"==typeof n?this._config[n]:this._config},n.prototype.defineDriver=function(n,t,r){var u=new i(function(t,i){var r,e,u,f;try{if(r=n._driver,e=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver"),!n._driver)return void i(e);for(var s=ut.concat("_initStorage"),o=0,h=s.length;o<h;o++)if(u=s[o],!u||!n[u]||"function"!=typeof n[u])return void i(e);f=function(i){l[r]&&console.info("Redefining LocalForage driver: "+r);l[r]=n;ii[r]=i;t()};"_support"in n?n._support&&"function"==typeof n._support?n._support().then(f,i):f(!!n._support):f(!0)}catch(n){i(n)}});return s(u,t,r),u},n.prototype.driver=function(){return this._driver||null},n.prototype.getDriver=function(n,t,r){var u=l[n]?i.resolve(l[n]):i.reject(new Error("Driver not found."));return s(u,t,r),u},n.prototype.getSerializer=function(n){var t=i.resolve(rt);return s(t,n),t},n.prototype.ready=function(n){var t=this,i=t._driverSet.then(function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready});return s(i,n,n),i},n.prototype.setDriver=function(n,t,r){function f(){u._config.driver=u.driver()}function h(n){return u._extend(n),f(),u._ready=u._initStorage(u._config),u._ready}function c(n){return function(){function r(){for(var e,o;t<n.length;)return e=n[t],t++,u._dbInfo=null,u._ready=null,u.getDriver(e).then(h).catch(r);return f(),o=new Error("No available storage method found."),u._driverSet=i.reject(o),u._driverSet}var t=0;return r()}}var u=this,e,o;return ti(n)||(n=[n]),e=this._getSupportedDrivers(n),o=null!==this._driverSet?this._driverSet.catch(function(){return i.resolve()}):i.resolve(),this._driverSet=o.then(function(){var n=e[0];return u._dbInfo=null,u._ready=null,u.getDriver(n).then(function(n){u._driver=n._driver;f();u._wrapLibraryMethodsWithReady();u._initDriver=c(e)})}).catch(function(){f();var n=new Error("No available storage method found.");return u._driverSet=i.reject(n),u._driverSet}),s(this._driverSet,t,r),this._driverSet},n.prototype.supports=function(n){return!!ii[n]},n.prototype._extend=function(n){b(this,n)},n.prototype._getSupportedDrivers=function(n){for(var i,r=[],t=0,u=n.length;t<u;t++)i=n[t],this.supports(i)&&r.push(i);return r},n.prototype._wrapLibraryMethodsWithReady=function(){for(var n=0,t=ut.length;n<t;n++)su(this,ut[n])},n.prototype.createInstance=function(t){return new n(t)},n}(),ku=new bu;t.exports=ku},{3:3}]},{},[4])(4)}),function(){"use strict";function s(){try{if(o.sessionStorage&&"setItem"in o.sessionStorage)return!0}catch(n){}return!1}function h(n){var e=this,i={},s,h;if(n)for(s in n)i[s]=n[s];return i.keyPrefix=i.name+"/",e._dbInfo=i,h=new u(function(n,i){if(typeof e.getSerializer=="function"){e.getSerializer().then(n,i);return}r===t.DEFINE?require(["localforageSerializer"],n):r===t.EXPORT?n(require("./../utils/serializer")):n(o.localforageSerializer)}),h.then(function(n){return f=n,u.resolve()})}function c(t){var r=this,u=r.ready().then(function(){for(var u=r._dbInfo.keyPrefix,i,t=n.length-1;t>=0;t--)i=n.key(t),i.indexOf(u)===0&&n.removeItem(i)});return i(u,t),u}function l(t,r){var e=this,u;return typeof t!="string"&&(window.console.warn(t+" used as a key, but it is not a string."),t=String(t)),u=e.ready().then(function(){var r=e._dbInfo,i=n.getItem(r.keyPrefix+t);return i&&(i=f.deserialize(i)),i}),i(u,r),u}function a(t,r){var u=this,e=u.ready().then(function(){for(var o=u._dbInfo.keyPrefix,s=o.length,h=n.length,e,i,r=0;r<h;r++)if(e=n.key(r),i=n.getItem(e),i&&(i=f.deserialize(i)),i=t(i,e.substring(s),r+1),i!==void 0)return i});return i(e,r),e}function v(t,r){var u=this,f=u.ready().then(function(){var r=u._dbInfo,i;try{i=n.key(t)}catch(f){i=null}return i&&(i=i.substring(r.keyPrefix.length)),i});return i(f,r),f}function y(t){var r=this,u=r.ready().then(function(){for(var i=r._dbInfo,f=n.length,u=[],t=0;t<f;t++)n.key(t).indexOf(i.keyPrefix)===0&&u.push(n.key(t).substring(i.keyPrefix.length));return u});return i(u,t),u}function p(n){var r=this,t=r.keys().then(function(n){return n.length});return i(t,n),t}function w(t,r){var f=this,u;return typeof t!="string"&&(window.console.warn(t+" used as a key, but it is not a string."),t=String(t)),u=f.ready().then(function(){var i=f._dbInfo;n.removeItem(i.keyPrefix+t)}),i(u,r),u}function b(t,r,e){var s=this,o;return typeof t!="string"&&(window.console.warn(t+" used as a key, but it is not a string."),t=String(t)),o=s.ready().then(function(){r===undefined&&(r=null);var i=r;return new u(function(u,e){f.serialize(r,function(r,f){if(f)e(f);else try{var h=s._dbInfo;n.setItem(h.keyPrefix+t,r);u(i)}catch(o){(o.name==="QuotaExceededError"||o.name==="NS_ERROR_DOM_QUOTA_REACHED")&&e(o);e(o)}})})}),i(o,e),o}function i(n,t){t&&n.then(function(n){t(null,n)},function(n){t(n)})}var u=typeof module!="undefined"&&module.exports?require("promise"):this.Promise,o=this,f=null,n=null,t,r,e;if(s())n=this.sessionStorage;else return;t={DEFINE:1,EXPORT:2,WINDOW:3};r=t.WINDOW;typeof define=="function"&&define.amd?r=t.DEFINE:typeof module!="undefined"&&module.exports&&(r=t.EXPORT);e={_driver:"sessionStorageWrapper",_initStorage:h,_support:function(){return new u(function(n){n(s())})},iterate:a,getItem:l,setItem:b,removeItem:w,clear:c,length:p,key:v,keys:y};r===t.DEFINE?define("sessionStorageWrapper",function(){return e}):r===t.EXPORT?module.exports=e:this.sessionStorageWrapper=e}.call(window)