/*! localForage -- Offline Storage, Improved Version 1.5.0 https://localforage.github.io/localForage (c) 2013-2017 Mozilla, Apache License 2.0 */(function(R){if(typeof exports=="object"&&typeof module!="undefined")module.exports=R();else if(typeof define=="function"&&define.amd)define([],R);else{var A;A=typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:this,A.localforage=R()}})(function(){return function R(A,B,b){function D(S,L){if(!B[S]){if(!A[S]){var h=typeof require=="function"&&require;if(!L&&h)return h(S,!0);if(x)return x(S,!0);var O=new Error("Cannot find module '"+S+"'");throw O.code="MODULE_NOT_FOUND",O}var F=B[S]={exports:{}};A[S][0].call(F.exports,function(z){var C=A[S][1][z];return D(C||z)},F,F.exports,R,A,B,b)}return B[S].exports}for(var x=typeof require=="function"&&require,N=0;N=43)}}).catch(function(){return!1})}function C(e){return typeof re=="boolean"?v.resolve(re):z(e).then(function(t){return re=t})}function E(e){var t=Q[e.name],r={};r.promise=new v(function(n){r.resolve=n}),t.deferredOperations.push(r),t.dbReady?t.dbReady=t.dbReady.then(function(){return r.promise}):t.dbReady=r.promise}function w(e){var t=Q[e.name],r=t.deferredOperations.pop();r&&r.resolve()}function P(e,t){return new v(function(r,n){if(e.db){if(!t)return r(e.db);E(e),e.db.close()}var o=[e.name];t&&o.push(e.version);var i=te.open.apply(te,o);t&&(i.onupgradeneeded=function(a){var u=i.result;try{u.createObjectStore(e.storeName),a.oldVersion<=1&&u.createObjectStore(ne)}catch(c){if(c.name!=="ConstraintError")throw c;console.warn('The database "'+e.name+'" has been upgraded from version '+a.oldVersion+" to version "+a.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),i.onerror=function(a){a.preventDefault(),n(i.error)},i.onsuccess=function(){r(i.result),w(e)}})}function G(e){return P(e,!1)}function J(e){return P(e,!0)}function s(e,t){if(!e.db)return!0;var r=!e.db.objectStoreNames.contains(e.storeName),n=e.versione.db.version;if(n&&(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),o||r){if(r){var i=e.db.version+1;i>e.version&&(e.version=i)}return!0}return!1}function p(e){return new v(function(t,r){var n=new FileReader;n.onerror=r,n.onloadend=function(o){var i=btoa(o.target.result||"");t({__local_forage_encoded_blob:!0,data:i,type:e.type})},n.readAsBinaryString(e)})}function y(e){var t=F(atob(e.data));return L([t],{type:e.type})}function m(e){return e&&e.__local_forage_encoded_blob}function _(e){var t=this,r=t._initReady().then(function(){var n=Q[t._dbInfo.name];if(n&&n.dbReady)return n.dbReady});return O(r,e,e),r}function k(e){function t(){return v.resolve()}var r=this,n={db:null};if(e)for(var o in e)n[o]=e[o];Q||(Q={});var i=Q[n.name];i||(i={forages:[],db:null,dbReady:null,deferredOperations:[]},Q[n.name]=i),i.forages.push(r),r._initReady||(r._initReady=r.ready,r.ready=_);for(var a=[],u=0;u>4,l[c++]=(15&n)<<4|o>>2,l[c++]=(3&o)<<6|63&i;return f}function $(e){var t,r=new Uint8Array(e),n="";for(t=0;t>2],n+=U[(3&r[t])<<4|r[t+1]>>4],n+=U[(15&r[t+1])<<2|r[t+2]>>6],n+=U[63&r[t+2]];return r.length%3==2?n=n.substring(0,n.length-1)+"=":r.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}function Ne(e,t){var r="";if(e&&(r=Ie.call(e)),e&&(r==="[object ArrayBuffer]"||e.buffer&&Ie.call(e.buffer)==="[object ArrayBuffer]")){var n,o=K;e instanceof ArrayBuffer?(n=e,o+=ie):(n=e.buffer,r==="[object Int8Array]"?o+=he:r==="[object Uint8Array]"?o+=ye:r==="[object Uint8ClampedArray]"?o+=pe:r==="[object Int16Array]"?o+=ge:r==="[object Uint16Array]"?o+=me:r==="[object Int32Array]"?o+=be:r==="[object Uint32Array]"?o+=we:r==="[object Float32Array]"?o+=_e:r==="[object Float64Array]"?o+=Se:t(new Error("Failed to get type for BinaryArray"))),t(o+$(n))}else if(r==="[object Blob]"){var i=new FileReader;i.onload=function(){var a=Ye+e.type+"~"+$(this.result);t(K+ue+a)},i.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(a){console.error("Couldn't convert value into a JSON string: ",e),t(null,a)}}function Oe(e){if(e.substring(0,oe)!==K)return JSON.parse(e);var t,r=e.substring(Ee),n=e.substring(oe,Ee);if(n===ue&&ve.test(r)){var o=r.match(ve);t=o[1],r=r.substring(o[0].length)}var i=se(r);switch(n){case ie:return i;case ue:return L([i],{type:t});case he:return new Int8Array(i);case ye:return new Uint8Array(i);case pe:return new Uint8ClampedArray(i);case ge:return new Int16Array(i);case me:return new Uint16Array(i);case be:return new Int32Array(i);case we:return new Uint32Array(i);case _e:return new Float32Array(i);case Se:return new Float64Array(i);default:throw new Error("Unkown type: "+n)}}function ke(e){var t=this,r={db:null};if(e)for(var n in e)r[n]=typeof e[n]!="string"?e[n].toString():e[n];var o=new v(function(i,a){try{r.db=openDatabase(r.name,String(r.version),r.description,r.size)}catch(u){return a(u)}r.db.transaction(function(u){u.executeSql("CREATE TABLE IF NOT EXISTS "+r.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],function(){t._dbInfo=r,i()},function(c,f){a(f)})})});return r.serializer=ae,o}function Be(e,t){var r=this;typeof e!="string"&&(console.warn(e+" used as a key, but it is not a string."),e=String(e));var n=new v(function(o,i){r.ready().then(function(){var a=r._dbInfo;a.db.transaction(function(u){u.executeSql("SELECT * FROM "+a.storeName+" WHERE key = ? LIMIT 1",[e],function(c,f){var l=f.rows.length?f.rows.item(0).value:null;l&&(l=a.serializer.deserialize(l)),o(l)},function(c,f){i(f)})})}).catch(i)});return h(n,t),n}function Re(e,t){var r=this,n=new v(function(o,i){r.ready().then(function(){var a=r._dbInfo;a.db.transaction(function(u){u.executeSql("SELECT * FROM "+a.storeName,[],function(c,f){for(var l=f.rows,d=l.length,g=0;g0)return void a(le.apply(o,[e,c,r,n-1]));u(g)}})})}).catch(u)});return h(i,r),i}function xe(e,t,r){return le.apply(this,[e,t,r,1])}function Ce(e,t){var r=this;typeof e!="string"&&(console.warn(e+" used as a key, but it is not a string."),e=String(e));var n=new v(function(o,i){r.ready().then(function(){var a=r._dbInfo;a.db.transaction(function(u){u.executeSql("DELETE FROM "+a.storeName+" WHERE key = ?",[e],function(){o()},function(c,f){i(f)})})}).catch(i)});return h(n,t),n}function je(e){var t=this,r=new v(function(n,o){t.ready().then(function(){var i=t._dbInfo;i.db.transaction(function(a){a.executeSql("DELETE FROM "+i.storeName,[],function(){n()},function(u,c){o(c)})})}).catch(o)});return h(r,e),r}function Le(e){var t=this,r=new v(function(n,o){t.ready().then(function(){var i=t._dbInfo;i.db.transaction(function(a){a.executeSql("SELECT COUNT(key) as c FROM "+i.storeName,[],function(u,c){var f=c.rows.item(0).c;n(f)},function(u,c){o(c)})})}).catch(o)});return h(r,e),r}function Te(e,t){var r=this,n=new v(function(o,i){r.ready().then(function(){var a=r._dbInfo;a.db.transaction(function(u){u.executeSql("SELECT key FROM "+a.storeName+" WHERE id = ? LIMIT 1",[e+1],function(c,f){var l=f.rows.length?f.rows.item(0).key:null;o(l)},function(c,f){i(f)})})}).catch(i)});return h(n,t),n}function Fe(e){var t=this,r=new v(function(n,o){t.ready().then(function(){var i=t._dbInfo;i.db.transaction(function(a){a.executeSql("SELECT key FROM "+i.storeName,[],function(u,c){for(var f=[],l=0;l=0;o--){var i=localStorage.key(o);i.indexOf(n)===0&&localStorage.removeItem(i)}});return h(r,e),r}function Pe(e,t){var r=this;typeof e!="string"&&(console.warn(e+" used as a key, but it is not a string."),e=String(e));var n=r.ready().then(function(){var o=r._dbInfo,i=localStorage.getItem(o.keyPrefix+e);return i&&(i=o.serializer.deserialize(i)),i});return h(n,t),n}function qe(e,t){var r=this,n=r.ready().then(function(){for(var o=r._dbInfo,i=o.keyPrefix,a=i.length,u=localStorage.length,c=1,f=0;f