UNPKG

localbase

Version:

A Firebase-Style Database ... Offline!

1 lines 74.4 kB
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Localbase=t()}}((function(){return function t(e,n,r){function o(u,a){if(!n[u]){if(!e[u]){var c="function"==typeof require&&require;if(!a&&c)return c(u,!0);if(i)return i(u,!0);var f=new Error("Cannot find module '"+u+"'");throw f.code="MODULE_NOT_FOUND",f}var s=n[u]={exports:{}};e[u][0].call(s.exports,(function(t){return o(e[u][1][t]||t)}),s,s.exports,t,e,n,r)}return n[u].exports}for(var i="function"==typeof require&&require,u=0;u<r.length;u++)o(r[u]);return o}({1:[function(t,e,n){"use strict";n.byteLength=function(t){var e=f(t),n=e[0],r=e[1];return 3*(n+r)/4-r},n.toByteArray=function(t){var e,n,r=f(t),u=r[0],a=r[1],c=new i(function(t,e,n){return 3*(e+n)/4-n}(0,u,a)),s=0,l=a>0?u-4:u;for(n=0;n<l;n+=4)e=o[t.charCodeAt(n)]<<18|o[t.charCodeAt(n+1)]<<12|o[t.charCodeAt(n+2)]<<6|o[t.charCodeAt(n+3)],c[s++]=e>>16&255,c[s++]=e>>8&255,c[s++]=255&e;return 2===a&&(e=o[t.charCodeAt(n)]<<2|o[t.charCodeAt(n+1)]>>4,c[s++]=255&e),1===a&&(e=o[t.charCodeAt(n)]<<10|o[t.charCodeAt(n+1)]<<4|o[t.charCodeAt(n+2)]>>2,c[s++]=e>>8&255,c[s++]=255&e),c},n.fromByteArray=function(t){for(var e,n=t.length,o=n%3,i=[],u=0,a=n-o;u<a;u+=16383)i.push(s(t,u,u+16383>a?a:u+16383));return 1===o?(e=t[n-1],i.push(r[e>>2]+r[e<<4&63]+"==")):2===o&&(e=(t[n-2]<<8)+t[n-1],i.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),i.join("")};for(var r=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=u.length;a<c;++a)r[a]=u[a],o[u.charCodeAt(a)]=a;function f(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function s(t,e,n){for(var o,i,u=[],a=e;a<n;a+=3)o=(t[a]<<16&16711680)+(t[a+1]<<8&65280)+(255&t[a+2]),u.push(r[(i=o)>>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return u.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},{}],2:[function(t,e,n){(function(e){(function(){"use strict";var e=t(1),r=t(3);n.Buffer=i,n.SlowBuffer=function(t){return+t!=t&&(t=0),i.alloc(+t)},n.INSPECT_MAX_BYTES=50;function o(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=i.prototype,e}function i(t,e,n){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return c(t)}return u(t,e,n)}function u(t,e,n){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!i.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var n=0|l(t,e),r=o(n),u=r.write(t,e);return u!==n&&(r=r.slice(0,u)),r}(t,e);if(ArrayBuffer.isView(t))return f(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(P(t,ArrayBuffer)||t&&P(t.buffer,ArrayBuffer))return function(t,e,n){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(n||0))throw new RangeError('"length" is outside of buffer bounds');var r;return(r=void 0===e&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,e):new Uint8Array(t,e,n)).__proto__=i.prototype,r}(t,e,n);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=t.valueOf&&t.valueOf();if(null!=r&&r!==t)return i.from(r,e,n);var u=function(t){if(i.isBuffer(t)){var e=0|s(t.length),n=o(e);return 0===n.length||t.copy(n,0,0,e),n}return void 0!==t.length?"number"!=typeof t.length||U(t.length)?o(0):f(t):"Buffer"===t.type&&Array.isArray(t.data)?f(t.data):void 0}(t);if(u)return u;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return i.from(t[Symbol.toPrimitive]("string"),e,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function a(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function c(t){return a(t),o(t<0?0:0|s(t))}function f(t){for(var e=t.length<0?0:0|s(t.length),n=o(e),r=0;r<e;r+=1)n[r]=255&t[r];return n}function s(t){if(t>=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function l(t,e){if(i.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||P(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var n=t.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var o=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return R(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return M(t).length;default:if(o)return r?-1:R(t).length;e=(""+e).toLowerCase(),o=!0}}function d(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function h(t,e,n,r,o){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),U(n=+n)&&(n=o?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(o)return-1;n=t.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof e&&(e=i.from(e,r)),i.isBuffer(e))return 0===e.length?-1:y(t,e,n,r,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):y(t,[e],n,r,o);throw new TypeError("val must be string, number or Buffer")}function y(t,e,n,r,o){var i,u=1,a=t.length,c=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;u=2,a/=2,c/=2,n/=2}function f(t,e){return 1===u?t[e]:t.readUInt16BE(e*u)}if(o){var s=-1;for(i=n;i<a;i++)if(f(t,i)===f(e,-1===s?0:i-s)){if(-1===s&&(s=i),i-s+1===c)return s*u}else-1!==s&&(i-=i-s),s=-1}else for(n+c>a&&(n=a-c),i=n;i>=0;i--){for(var l=!0,d=0;d<c;d++)if(f(t,i+d)!==f(e,d)){l=!1;break}if(l)return i}return-1}function p(t,e,n,r){n=Number(n)||0;var o=t.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=e.length;r>i/2&&(r=i/2);for(var u=0;u<r;++u){var a=parseInt(e.substr(2*u,2),16);if(U(a))return u;t[n+u]=a}return u}function v(t,e,n,r){return T(R(e,t.length-n),t,n,r)}function g(t,e,n,r){return T(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function m(t,e,n,r){return g(t,e,n,r)}function b(t,e,n,r){return T(M(e),t,n,r)}function w(t,e,n,r){return T(function(t,e){for(var n,r,o,i=[],u=0;u<t.length&&!((e-=2)<0);++u)r=(n=t.charCodeAt(u))>>8,o=n%256,i.push(o),i.push(r);return i}(e,t.length-n),t,n,r)}function _(t,n,r){return 0===n&&r===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(n,r))}function S(t,e,n){n=Math.min(t.length,n);for(var r=[],o=e;o<n;){var i,u,a,c,f=t[o],s=null,l=f>239?4:f>223?3:f>191?2:1;if(o+l<=n)switch(l){case 1:f<128&&(s=f);break;case 2:128==(192&(i=t[o+1]))&&(c=(31&f)<<6|63&i)>127&&(s=c);break;case 3:i=t[o+1],u=t[o+2],128==(192&i)&&128==(192&u)&&(c=(15&f)<<12|(63&i)<<6|63&u)>2047&&(c<55296||c>57343)&&(s=c);break;case 4:i=t[o+1],u=t[o+2],a=t[o+3],128==(192&i)&&128==(192&u)&&128==(192&a)&&(c=(15&f)<<18|(63&i)<<12|(63&u)<<6|63&a)>65535&&c<1114112&&(s=c)}null===s?(s=65533,l=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),o+=l}return function(t){var e=t.length;if(e<=E)return String.fromCharCode.apply(String,t);for(var n="",r=0;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=E));return n}(r)}n.kMaxLength=2147483647,i.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(e){return!1}}(),i.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(i.prototype,"parent",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.buffer}}),Object.defineProperty(i.prototype,"offset",{enumerable:!0,get:function(){if(i.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&i[Symbol.species]===i&&Object.defineProperty(i,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),i.poolSize=8192,i.from=function(t,e,n){return u(t,e,n)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(t,e,n){return function(t,e,n){return a(t),t<=0?o(t):void 0!==e?"string"==typeof n?o(t).fill(e,n):o(t).fill(e):o(t)}(t,e,n)},i.allocUnsafe=function(t){return c(t)},i.allocUnsafeSlow=function(t){return c(t)},i.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==i.prototype},i.compare=function(t,e){if(P(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),P(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(t)||!i.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var n=t.length,r=e.length,o=0,u=Math.min(n,r);o<u;++o)if(t[o]!==e[o]){n=t[o],r=e[o];break}return n<r?-1:r<n?1:0},i.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return i.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=i.allocUnsafe(e),o=0;for(n=0;n<t.length;++n){var u=t[n];if(P(u,Uint8Array)&&(u=i.from(u)),!i.isBuffer(u))throw new TypeError('"list" argument must be an Array of Buffers');u.copy(r,o),o+=u.length}return r},i.byteLength=l,i.prototype._isBuffer=!0,i.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)d(this,e,e+1);return this},i.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)d(this,e,e+3),d(this,e+1,e+2);return this},i.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)d(this,e,e+7),d(this,e+1,e+6),d(this,e+2,e+5),d(this,e+3,e+4);return this},i.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?S(this,0,t):function(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return B(this,e,n);case"utf8":case"utf-8":return S(this,e,n);case"ascii":return I(this,e,n);case"latin1":case"binary":return N(this,e,n);case"base64":return _(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}.apply(this,arguments)},i.prototype.toLocaleString=i.prototype.toString,i.prototype.equals=function(t){if(!i.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===i.compare(this,t)},i.prototype.inspect=function(){var t="",e=n.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},i.prototype.compare=function(t,e,n,r,o){if(P(t,Uint8Array)&&(t=i.from(t,t.offset,t.byteLength)),!i.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),e<0||n>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&e>=n)return 0;if(r>=o)return-1;if(e>=n)return 1;if(this===t)return 0;for(var u=(o>>>=0)-(r>>>=0),a=(n>>>=0)-(e>>>=0),c=Math.min(u,a),f=this.slice(r,o),s=t.slice(e,n),l=0;l<c;++l)if(f[l]!==s[l]){u=f[l],a=s[l];break}return u<a?-1:a<u?1:0},i.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},i.prototype.indexOf=function(t,e,n){return h(this,t,e,n,!0)},i.prototype.lastIndexOf=function(t,e,n){return h(this,t,e,n,!1)},i.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-e;if((void 0===n||n>o)&&(n=o),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return p(this,t,e,n);case"utf8":case"utf-8":return v(this,t,e,n);case"ascii":return g(this,t,e,n);case"latin1":case"binary":return m(this,t,e,n);case"base64":return b(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,t,e,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var E=4096;function I(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;o<n;++o)r+=String.fromCharCode(127&t[o]);return r}function N(t,e,n){var r="";n=Math.min(t.length,n);for(var o=e;o<n;++o)r+=String.fromCharCode(t[o]);return r}function B(t,e,n){var r,o=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>o)&&(n=o);for(var i="",u=e;u<n;++u)i+=(r=t[u])<16?"0"+r.toString(16):r.toString(16);return i}function C(t,e,n){for(var r=t.slice(e,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function A(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function D(t,e,n,r,o,u){if(!i.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<u)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function j(t,e,n,r,o,i){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function O(t,e,n,o,i){return e=+e,n>>>=0,i||j(t,0,n,4),r.write(t,e,n,o,23,4),n+4}function x(t,e,n,o,i){return e=+e,n>>>=0,i||j(t,0,n,8),r.write(t,e,n,o,52,8),n+8}i.prototype.slice=function(t,e){var n=this.length;(t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t);var r=this.subarray(t,e);return r.__proto__=i.prototype,r},i.prototype.readUIntLE=function(t,e,n){t>>>=0,e>>>=0,n||A(t,e,this.length);for(var r=this[t],o=1,i=0;++i<e&&(o*=256);)r+=this[t+i]*o;return r},i.prototype.readUIntBE=function(t,e,n){t>>>=0,e>>>=0,n||A(t,e,this.length);for(var r=this[t+--e],o=1;e>0&&(o*=256);)r+=this[t+--e]*o;return r},i.prototype.readUInt8=function(t,e){return t>>>=0,e||A(t,1,this.length),this[t]},i.prototype.readUInt16LE=function(t,e){return t>>>=0,e||A(t,2,this.length),this[t]|this[t+1]<<8},i.prototype.readUInt16BE=function(t,e){return t>>>=0,e||A(t,2,this.length),this[t]<<8|this[t+1]},i.prototype.readUInt32LE=function(t,e){return t>>>=0,e||A(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},i.prototype.readUInt32BE=function(t,e){return t>>>=0,e||A(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},i.prototype.readIntLE=function(t,e,n){t>>>=0,e>>>=0,n||A(t,e,this.length);for(var r=this[t],o=1,i=0;++i<e&&(o*=256);)r+=this[t+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*e)),r},i.prototype.readIntBE=function(t,e,n){t>>>=0,e>>>=0,n||A(t,e,this.length);for(var r=e,o=1,i=this[t+--r];r>0&&(o*=256);)i+=this[t+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},i.prototype.readInt8=function(t,e){return t>>>=0,e||A(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},i.prototype.readInt16LE=function(t,e){t>>>=0,e||A(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt16BE=function(t,e){t>>>=0,e||A(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt32LE=function(t,e){return t>>>=0,e||A(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},i.prototype.readInt32BE=function(t,e){return t>>>=0,e||A(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},i.prototype.readFloatLE=function(t,e){return t>>>=0,e||A(t,4,this.length),r.read(this,t,!0,23,4)},i.prototype.readFloatBE=function(t,e){return t>>>=0,e||A(t,4,this.length),r.read(this,t,!1,23,4)},i.prototype.readDoubleLE=function(t,e){return t>>>=0,e||A(t,8,this.length),r.read(this,t,!0,52,8)},i.prototype.readDoubleBE=function(t,e){return t>>>=0,e||A(t,8,this.length),r.read(this,t,!1,52,8)},i.prototype.writeUIntLE=function(t,e,n,r){t=+t,e>>>=0,n>>>=0,r||D(this,t,e,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[e]=255&t;++i<n&&(o*=256);)this[e+i]=t/o&255;return e+n},i.prototype.writeUIntBE=function(t,e,n,r){t=+t,e>>>=0,n>>>=0,r||D(this,t,e,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+n},i.prototype.writeUInt8=function(t,e,n){return t=+t,e>>>=0,n||D(this,t,e,1,255,0),this[e]=255&t,e+1},i.prototype.writeUInt16LE=function(t,e,n){return t=+t,e>>>=0,n||D(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeUInt16BE=function(t,e,n){return t=+t,e>>>=0,n||D(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeUInt32LE=function(t,e,n){return t=+t,e>>>=0,n||D(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},i.prototype.writeUInt32BE=function(t,e,n){return t=+t,e>>>=0,n||D(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e>>>=0,!r){var o=Math.pow(2,8*n-1);D(this,t,e,n,o-1,-o)}var i=0,u=1,a=0;for(this[e]=255&t;++i<n&&(u*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/u>>0)-a&255;return e+n},i.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e>>>=0,!r){var o=Math.pow(2,8*n-1);D(this,t,e,n,o-1,-o)}var i=n-1,u=1,a=0;for(this[e+i]=255&t;--i>=0&&(u*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/u>>0)-a&255;return e+n},i.prototype.writeInt8=function(t,e,n){return t=+t,e>>>=0,n||D(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},i.prototype.writeInt16LE=function(t,e,n){return t=+t,e>>>=0,n||D(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},i.prototype.writeInt16BE=function(t,e,n){return t=+t,e>>>=0,n||D(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},i.prototype.writeInt32LE=function(t,e,n){return t=+t,e>>>=0,n||D(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},i.prototype.writeInt32BE=function(t,e,n){return t=+t,e>>>=0,n||D(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},i.prototype.writeFloatLE=function(t,e,n){return O(this,t,e,!0,n)},i.prototype.writeFloatBE=function(t,e,n){return O(this,t,e,!1,n)},i.prototype.writeDoubleLE=function(t,e,n){return x(this,t,e,!0,n)},i.prototype.writeDoubleBE=function(t,e,n){return x(this,t,e,!1,n)},i.prototype.copy=function(t,e,n,r){if(!i.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var o=r-n;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,n,r);else if(this===t&&n<e&&e<r)for(var u=o-1;u>=0;--u)t[u+e]=this[u+n];else Uint8Array.prototype.set.call(t,this.subarray(n,r),e);return o},i.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!i.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===t.length){var o=t.charCodeAt(0);("utf8"===r&&o<128||"latin1"===r)&&(t=o)}}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var u;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(u=e;u<n;++u)this[u]=t;else{var a=i.isBuffer(t)?t:i.from(t,r),c=a.length;if(0===c)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(u=0;u<n-e;++u)this[u+e]=a[u%c]}return this};var k=/[^+/0-9A-Za-z-_]/g;function R(t,e){var n;e=e||1/0;for(var r=t.length,o=null,i=[],u=0;u<r;++u){if((n=t.charCodeAt(u))>55295&&n<57344){if(!o){if(n>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(u+1===r){(e-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(e-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((e-=1)<0)break;i.push(n)}else if(n<2048){if((e-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function M(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(k,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function T(t,e,n,r){for(var o=0;o<r&&!(o+n>=e.length||o>=t.length);++o)e[o+n]=t[o];return o}function P(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function U(t){return t!=t}}).call(this)}).call(this,t(2).Buffer)},{1:1,2:2,3:3}],3:[function(t,e,n){n.read=function(t,e,n,r,o){var i,u,a=8*o-r-1,c=(1<<a)-1,f=c>>1,s=-7,l=n?o-1:0,d=n?-1:1,h=t[e+l];for(l+=d,i=h&(1<<-s)-1,h>>=-s,s+=a;s>0;i=256*i+t[e+l],l+=d,s-=8);for(u=i&(1<<-s)-1,i>>=-s,s+=r;s>0;u=256*u+t[e+l],l+=d,s-=8);if(0===i)i=1-f;else{if(i===c)return u?NaN:1/0*(h?-1:1);u+=Math.pow(2,r),i-=f}return(h?-1:1)*u*Math.pow(2,i-r)},n.write=function(t,e,n,r,o,i){var u,a,c,f=8*i-o-1,s=(1<<f)-1,l=s>>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,h=r?0:i-1,y=r?1:-1,p=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,u=s):(u=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-u))<1&&(u--,c*=2),(e+=u+l>=1?d/c:d*Math.pow(2,1-l))*c>=2&&(u++,c/=2),u+l>=s?(a=0,u=s):u+l>=1?(a=(e*c-1)*Math.pow(2,o),u+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,o),u=0));o>=8;t[n+h]=255&a,h+=y,a/=256,o-=8);for(u=u<<o|a,f+=o;f>0;t[n+h]=255&u,h+=y,u/=256,f-=8);t[n+h-y]|=128*p}},{}],4:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r,o=(r=t(19))&&r.__esModule?r:{default:r};n.default=o.default,e.exports=n.default},{19:19}],5:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t){return o.default.call(this),r.default.error.call(this,t),"Error: ".concat(t)};var r=i(t(21)),o=i(t(6));function i(t){return t&&t.__esModule?t:{default:t}}e.exports=n.default},{21:21,6:6}],6:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(){this.collectionName=null,this.orderByProperty=null,this.orderByDirection=null,this.limitBy=null,this.docSelectionCriteria=null,this.userErrors=[]},e.exports=n.default},{}],7:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(){var t;return this.collectionName||this.docSelectionCriteria?this.collectionName&&!this.docSelectionCriteria?t="collection":this.collectionName&&this.docSelectionCriteria&&(t="doc"):t="db",t},e.exports=n.default},{}],8:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(){for(var t=0;t<this.userErrors.length;t++)r.default.error.call(this,this.userErrors[t]);o.default.call(this)};var r=i(t(21)),o=i(t(6));function i(t){return t&&t.__esModule?t:{default:t}}e.exports=n.default},{21:21,6:6}],9:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t,e){return o.default.call(this),r.default.log.call(this,t,e),{success:!0,message:t,data:e}};var r=i(t(21)),o=i(t(6));function i(t){return t&&t.__esModule?t:{default:t}}e.exports=n.default},{21:21,6:6}],10:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t,e){var n,a=this;if(t?"object"==(n=t,("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(n))&&t instanceof Array==0||this.userErrors.push("Data passed to .add() must be an object. Not an array, string, number or boolean."):this.userErrors.push('No data specified in add() method. You must use an object, e.g { id: 1, name: "Bill", age: 47 }'),!this.userErrors.length){var c=this.collectionName;return new Promise((function(n,u){var f;return f=e||r.default.generate(),a.lf[c].setItem(f,t).then((function(){n(o.default.call(a,'Document added to "'.concat(c,'" collection.'),{key:f,data:t}))})).catch((function(t){u(i.default.call(a,"Could not add Document to ".concat(c," collection.")))}))}))}u.default.call(this)};var r=a(t(24)),o=a(t(9)),i=a(t(5)),u=a(t(8));function a(t){return t&&t.__esModule?t:{default:t}}e.exports=n.default},{24:24,5:5,8:8,9:9}],11:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(){var t=this;return new Promise((function(e,n){if(t.deleteDatabase=function(){var n=t.dbName;indexedDB.deleteDatabase(n),e(u.default.call(t,'Database "'.concat(n,'" deleted.'),{database:n}))},t.deleteCollection=function(){var r=t.dbName,o=t.collectionName;t.addToDeleteCollectionQueue=function(e){t.deleteCollectionQueue.queue.push(e),t.runDeleteCollectionQueue()},t.runDeleteCollectionQueue=function(){0==t.deleteCollectionQueue.running&&(t.deleteCollectionQueue.running=!0,t.deleteNextCollectionFromQueue())},t.deleteNextCollectionFromQueue=function(){if(t.deleteCollectionQueue.queue.length){var o=t.deleteCollectionQueue.queue[0];t.deleteCollectionQueue.queue.shift(),t.lf[o].dropInstance({name:r,storeName:o}).then((function(){t.deleteNextCollectionFromQueue(),e(u.default.call(t,'Collection "'.concat(o,'" deleted.'),{collection:o}))})).catch((function(e){n(e.call(t,'Collection "'.concat(o,'" could not be deleted.')))}))}else t.deleteCollectionQueue.running=!1},t.addToDeleteCollectionQueue(o)},t.deleteDocument=function(){var i,c=t.collectionName,f=t.docSelectionCriteria;return t.deleteDocumentByCriteria=function(){var i=[];t.lf[c].iterate((function(t,e){(0,r.default)(t,f)&&i.push(e)})).then((function(){i.length||n(a.default.call(t,'No Documents found in "'.concat(c,'" Collection with criteria ').concat(JSON.stringify(f),". No documents deleted."))),i.length>1&&o.default.warn.call(t,"Multiple documents (".concat(i.length,") with ").concat(JSON.stringify(f)," found."))})).then((function(){i.forEach((function(r,o){t.lf[c].removeItem(r).then((function(){o===i.length-1&&e(u.default.call(t,"".concat(i.length," Document").concat(i.length>1?"s":""," with ").concat(JSON.stringify(f)," deleted."),{keys:i}))})).catch((function(e){n(a.default.call(t,"Could not delete ".concat(i.length," Documents in ").concat(c," Collection.")))}))}))}))},t.deleteDocumentByKey=function(){t.lf[c].getItem(f).then((function(r){r?t.lf[c].removeItem(f).then((function(){e(u.default.call(t,"Document with key ".concat(JSON.stringify(f)," deleted."),{key:f}))})).catch((function(t){n(a.default.call(this,'No Document found in "'.concat(c,'" Collection with key ').concat(JSON.stringify(f),". No document was deleted.")))})):n(a.default.call(t,'No Document found in "'.concat(c,'" Collection with key ').concat(JSON.stringify(f),". No document was deleted.")))}))},"object"==(i=f,("function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(i))?t.deleteDocumentByCriteria():t.deleteDocumentByKey()},t.userErrors.length)c.default.call(t);else{var f=i.default.call(t);if("db"==f)return t.deleteDatabase();if("collection"==f)return t.deleteCollection();if("doc"==f)return t.deleteDocument()}}))};var r=f(t(20)),o=f(t(21)),i=f(t(7)),u=f(t(9)),a=f(t(5)),c=f(t(8));function f(t){return t&&t.__esModule?t:{default:t}}e.exports=n.default},{20:20,21:21,5:5,7:7,8:8,9:9}],12:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{keys:!1};if(this.getCollection=function(){var n=t.collectionName,u=t.orderByProperty,a=t.orderByDirection,c=e.filter,f=t.limitBy,s=[];return t.lf[n].iterate((function(t,n){var o;o=e.keys?{key:n,data:t}:t,c?(0,r.default)(t,c)&&s.push(o):s.push(o)})).then((function(){var r='Got "'.concat(n,'" collection');return u&&(r+=', ordered by "'.concat(u,'"'),e.keys?s.sort((function(t,e){return t.hasOwnProperty(u)&&e.hasOwnProperty(u)?t.data[u].toString().localeCompare(e.data[u].toString()):0})):s.sort((function(t,e){return t.hasOwnProperty(u)&&e.hasOwnProperty(u)?t[u].toString().localeCompare(e[u].toString()):0}))),"desc"==a&&(r+=" (descending)",s.reverse()),f&&(r+=", limited to ".concat(f),s=s.splice(0,f)),r+=":",o.default.log.call(t,r,s),i.default.call(t),s}))},this.getDocument=function(){var e=t.collectionName,n=t.docSelectionCriteria,u=[],a={};return t.getDocumentByCriteria=function(){return t.lf[e].iterate((function(t,e){(0,r.default)(t,n)&&u.push(t)})).then((function(){if(u.length)return a=u[0],o.default.log.call(t,"Got Document with ".concat(JSON.stringify(n),":"),a),i.default.call(t),a;o.default.error.call(t,'Could not find Document in "'.concat(e,'" collection with criteria: ').concat(JSON.stringify(n)))}))},t.getDocumentByKey=function(){return t.lf[e].getItem(n).then((function(r){return(a=r)?o.default.log.call(t,"Got Document with key ".concat(JSON.stringify(n),":"),a):o.default.error.call(t,'Could not find Document in "'.concat(e,'" collection with Key: ').concat(JSON.stringify(n))),i.default.call(t),a})).catch((function(r){o.default.error.call(t,'Could not find Document in "'.concat(e,'" collection with Key: ').concat(JSON.stringify(n))),i.default.call(t)}))},"object"==f(n)?t.getDocumentByCriteria():t.getDocumentByKey()},"object"!=f(e)||e instanceof Array!=0?this.userErrors.push('Data passed to .get() must be an object. Not an array, string, number or boolean. The object must contain a "keys" property set to true or false, e.g. { keys: true }'):e.hasOwnProperty("keys")?"boolean"!=typeof e.keys&&this.userErrors.push('Property "keys" passed into get() method must be assigned a boolean value (true or false). Not a string or integer.'):this.userErrors.push('Object passed to get() method must contain a "keys" property set to boolean true or false, e.g. { keys: true }'),this.userErrors.length)return a.default.call(this),null;var n=u.default.call(this);return"collection"==n?this.getCollection():"doc"==n?this.getDocument():void 0};var r=c(t(20)),o=c(t(21)),i=c(t(6)),u=c(t(7)),a=c(t(8));function c(t){return t&&t.__esModule?t:{default:t}}function f(t){return(f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}e.exports=n.default},{20:20,21:21,6:6,7:7,8:8}],13:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{keys:!1},f=this.collectionName,l=this.docSelectionCriteria,d=c.default.call(this);return new Promise((function(c,h){if(e.setCollection=function(){e.lf[f].clear().then((function(){if(n.keys){console.log("keys provided");var r=0;t.forEach((function(t){t.hasOwnProperty("_key")||r++})),r?h(u.default.call(e,"Documents provided to .set() in an array must each have a _key property set to a string.")):(t.forEach((function(t){var n=t._key;delete t._key,e.add(t,n)})),c(i.default.call(e,'Collection "'.concat(f,'" set with ').concat(t.length," Documents."),t)))}else t.forEach((function(t){e.add(t)})),c(i.default.call(e,'Collection "'.concat(f,'" set with ').concat(t.length," Documents."),t))})).catch((function(n){h(u.default.call(e,"Could not set ".concat(f," Collection with data ").concat(JSON.stringify(t),".")))}))},e.setDocument=function(){return e.setDocumentByCriteria=function(){var n=[];e.lf[f].iterate((function(e,r){(0,o.default)(e,l)&&n.push({key:r,newDocument:t})})).then((function(){n.length||h(u.default.call(e,"No Documents found in ".concat(f," Collection with criteria ").concat(JSON.stringify(l),"."))),n.length>1&&r.default.warn.call(e,"Multiple documents (".concat(n.length,") with ").concat(JSON.stringify(l)," found for setting."))})).then((function(){n.forEach((function(r,o){e.lf[f].setItem(r.key,r.newDocument).then((function(r){o===n.length-1&&c(i.default.call(e,"".concat(n.length," Document").concat(n.length>1?"s":"",' in "').concat(f,'" collection with ').concat(JSON.stringify(l)," was set."),t))})).catch((function(t){h(u.default.call(e,"Could not set ".concat(n.length," Documents in ").concat(f," Collection.")))}))}))}))},e.setDocumentByKey=function(){e.lf[f].setItem(l,t).then((function(n){c(i.default.call(e,'Document in "'.concat(f,'" collection with key ').concat(JSON.stringify(l)," was set."),t))})).catch((function(t){h(u.default.call(e,'Document in "'.concat(f,'" collection with key ').concat(JSON.stringify(l)," could not be set.")))}))},"object"==s(l)?e.setDocumentByCriteria():e.setDocumentByKey()},t?"doc"===d?"object"==s(t)&&t instanceof Array==0||e.userErrors.push("Data passed to .set() must be an object. Not an array, string, number or boolean."):"collection"===d&&("object"==s(t)&&t instanceof Array==1||e.userErrors.push("Data passed to .set() must be an array of objects. Not an object, string, number or boolean.")):e.userErrors.push('No new Document object provided to set() method. Use an object e.g. { id: 1, name: "Bill", age: 47 }'),e.userErrors.length)a.default.call(e);else{if("collection"==d)return e.setCollection();if("doc"==d)return e.setDocument()}}))};var r=f(t(21)),o=f(t(20)),i=f(t(9)),u=f(t(5)),a=f(t(8)),c=f(t(7));function f(t){return t&&t.__esModule?t:{default:t}}function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}e.exports=n.default},{20:20,21:21,5:5,7:7,8:8,9:9}],14:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t){var e=this,n=this.collectionName,f=this.docSelectionCriteria;return new Promise((function(l,d){e.updateDocumentByCriteria=function(){var c=[];e.lf[n].iterate((function(e,n){if((0,o.default)(e,f)){var r=(0,i.default)(e,t);c.push({key:n,newDocument:r})}})).then((function(){c.length||d(a.default.call(e,"No Documents found in ".concat(n," Collection with criteria ").concat(JSON.stringify(f),"."))),c.length>1&&r.default.warn.call(e,"Multiple documents (".concat(c.length,") with ").concat(JSON.stringify(f)," found for updating."))})).then((function(){c.forEach((function(r,o){e.lf[n].setItem(r.key,r.newDocument).then((function(r){o===c.length-1&&l(u.default.call(e,"".concat(c.length," Document").concat(c.length>1?"s":"",' in "').concat(n,'" collection with ').concat(JSON.stringify(f)," updated."),t))})).catch((function(t){d(a.default.call(e,"Could not update ".concat(c.length," Documents in ").concat(n," Collection.")))}))}))}))},e.updateDocumentByKey=function(){var r={};e.lf[n].getItem(f).then((function(o){r=(0,i.default)(o,t),e.lf[n].setItem(f,r),l(u.default.call(e,'Document in "'.concat(n,'" collection with key ').concat(JSON.stringify(f)," updated."),r))})).catch((function(t){d(a.default.call(e,'No Document found in "'.concat(n,'" collection with key ').concat(JSON.stringify(f))))}))},t?"object"==s(t)&&t instanceof Array==0||e.userErrors.push("Data passed to .update() must be an object. Not an array, string, number or boolean."):e.userErrors.push('No update object provided to update() method. Use an object e.g. { name: "William" }'),e.userErrors.length?c.default.call(e):"object"==s(f)?e.updateDocumentByCriteria():e.updateDocumentByKey()}))};var r=f(t(21)),o=f(t(20)),i=f(t(22)),u=f(t(9)),a=f(t(5)),c=f(t(8));function f(t){return t&&t.__esModule?t:{default:t}}function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}e.exports=n.default},{20:20,21:21,22:22,5:5,8:8,9:9}],15:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t){return t?Number.isInteger(t)?this.limitBy=t:this.userErrors.push("Limit parameter in limit() method must be an integer (e.g. 3) and not a float, boolean, string or object."):this.userErrors.push("No integer specified in limit() method."),this},e.exports=n.default},{}],16:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t,e){return t?"string"!=typeof t?this.userErrors.push("First parameter in orderBy() method must be a string (a field name) e.g. 'name'"):this.orderByProperty=t:this.userErrors.push("No field name specified in orderBy() method. Use a string e.g. 'name'"),e&&("asc"!==e&&"desc"!==e?this.userErrors.push("Second parameter in orderBy() method must be a string set to 'asc' or 'desc'."):this.orderByDirection=e),this},e.exports=n.default},{}],17:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t){if(t){if("string"!=typeof t)return this.userErrors.push("Collection name in collection() method must be a string and not an object, number or boolean."),this;this.collectionName=t;var e=this.dbName;return t in this.lf||(this.lf[t]=o.default.createInstance({driver:o.default.INDEXEDDB,name:e,storeName:t})),this}return this.userErrors.push("No collection name specified in collection() method."),this};var r,o=(r=t(23))&&r.__esModule?r:{default:r};e.exports=n.default},{23:23}],18:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t){return t?"string"!=typeof t&&"object"!==r(t)?this.userErrors.push("Document criteria specified in doc() method must not be a number or boolean. Use a string (with a key) or an object (with criteria) e.g. { id: 1 }"):this.docSelectionCriteria=t:this.userErrors.push("No document criteria specified in doc() method. Use a string (with a key) or an object (with criteria) e.g. { id: 1 }"),this},e.exports=n.default},{}],19:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o,i,u,a=v(t(17)),c=v(t(18)),f=v(t(16)),s=v(t(15)),l=v(t(12)),d=v(t(10)),h=v(t(14)),y=v(t(13)),p=v(t(11));function v(t){return t&&t.__esModule?t:{default:t}}function g(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,m(r.key),r)}}function m(t){var e=function(t,e){if("object"!=r(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,e);if("object"!=r(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==r(e)?e:e+""}n.default=(o=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.dbName=e,this.lf={},this.collectionName=null,this.orderByProperty=null,this.orderByDirection=null,this.limitBy=null,this.docSelectionCriteria=null,this.deleteCollectionQueue={queue:[],running:!1},this.config={debug:!0},this.userErrors=[],this.collection=a.default.bind(this),this.doc=c.default.bind(this),this.orderBy=f.default.bind(this),this.limit=s.default.bind(this),this.get=l.default.bind(this),this.add=d.default.bind(this),this.update=h.default.bind(this),this.set=y.default.bind(this),this.delete=p.default.bind(this)},i&&g(o.prototype,i),u&&g(o,u),Object.defineProperty(o,"prototype",{writable:!1}),o),e.exports=n.default},{10:10,11:11,12:12,13:13,14:14,15:15,16:16,17:17,18:18}],20:[function(t,e,n){"use strict";function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}Object.defineProperty(n,"__esModule",{value:!0}),n.default=function t(e,n){return Object.keys(n).every((function(o){return"object"==r(n[o])?t(e[o],n[o]):n[o]===e[o]}))},e.exports=n.default},{}],21:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;n.default={baseStyle:"\n padding: 2px 5px;\n background-color: #124F5C;\n border-radius: 4px;\n color: white; \n ",colors:{log:"#124F5C",error:"#ed2939",warn:"#f39c12"},log:function(t,e){},error:function(t,e){},warn:function(t,e){}},e.exports=n.default},{}],22:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.default=function(t){for(var e=1;e<arguments.length;e++)for(var n in arguments[e]){var r=arguments[e][n];t[n]=r}return t},e.exports=n.default},{}],23:[function(t,e,n){(function(r){(function(){!function(t){"object"==typeof n&&void 0!==e?e.exports=t():("undefined"!=typeof window?window:void 0!==r?r:"undefined"!=typeof self?self:this).localforage=t()}((function(){return function e(n,r,o){function i(a,c){if(!r[a]){if(!n[a]){var f="function"==typeof t&&t;if(!c&&f)return f(a,!0);if(u)return u(a,!0);var s=new Error("Cannot find module '"+a+"'");throw s.code="MODULE_NOT_FOUND",s}var l=r[a]={exports:{}};n[a][0].call(l.exports,(function(t){return i(n[a][1][t]||t)}),l,l.exports,e,n,r,o)}return r[a].exports}for(var u="function"==typeof t&&t,a=0;a<o.length;a++)i(o[a]);return i}({1:[function(t,e,n){(function(t){"use strict";var n,r,o=t.MutationObserver||t.WebKitMutationObserver;if(o){var i=0,u=new o(s),a=t.document.createTextNode("");u.observe(a,{characterData:!0}),n=function(){a.data=i=++i%2}}else if(t.setImmediate||void 0===t.MessageChannel)n="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){s(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(s,0)};else{var c=new t.MessageChannel;c.port1.onmessage=s,n=function(){c.port2.postMessage(0)}}var f=[];function s(){var t,e;r=!0;for(var n=f.length;n;){for(e=f,f=[],t=-1;++t<n;)e[t]();n=f.length}r=!1}e.exports=function(t){1!==f.push(t)||r||n()}}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],2:[function(t,e,n){"use strict";var r=t(1);function o(){}var i={},u=["REJECTED"],a=["FULFILLED"],c=["PENDING"];function f(t){if("function"!=typeof t)throw new TypeError("resolver must be a function");this.state=c,this.queue=[],this.outcome=void 0,t!==o&&h(this,t)}function s(t,e,n){this.promise=t,"function"==typeof e&&(this.onFulfilled=e,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function l(t,e,n){r((function(){var r;try{r=e(n)}catch(o){return i.reject(t,o)}r===t?i.reject(t,new TypeError("Cannot resolve promise with itself")):i.resolve(t,r)}))}function d(t){var e=t&&t.then;if(t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof e)return function(){e.apply(t,arguments)}}function h(t,e){var n=!1;function r(e){n||(n=!0,i.reject(t,e))}function o(e){n||(n=!0,i.resolve(t,e))}var u=y((function(){e(o,r)}));"error"===u.status&&r(u.value)}function y(t,e){var n={};try{n.value=t(e),n.status="success"}catch(r){n.status="error",n.value=r}return n}e.exports=f,f.prototype.catch=function(t){return this.then(null,t)},f.prototype.then=function(t,e){if("function"!=typeof t&&this.state===a||"function"!=typeof e&&this.state===u)return this;var n=new this.constructor(o);return this.state!==c?l(n,this.state===a?t:e,this.outcome):this.queue.push(new s(n,t,e)),n},s.prototype.callFulfilled=function(t){i.resolve(this.promise,t)},s.prototype.otherCallFulfilled=function(t){l(this.promise,this.onFulfilled,t)},s.prototype.callRejected=function(t){i.reject(this.promise,t)},s.prototype.otherCallRejected=function(t){l(this.promise,this.onRejected,t)},i.resolve=function(t,e){var n=y(d,e);if("error"===n.status)return i.reject(t,n.value);var r=n.value;if(r)h(t,r);else{t.state=a,t.outcome=e;for(var o=-1,u=t.queue.length;++o<u;)t.queue[o].callFulfilled(e)}return t},i.reject=function(t,e){t.state=u,t.outcome=e;for(var n=-1,r=t.queue.length;++n<r;)t.queue[n].callRejected(e);return t},f.resolve=function(t){return t instanceof this?t:i.resolve(new this(o),t)},f.reject=function(t){var e=new this(o);return i.reject(e,t)},f.all=function(t){var e=this;if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var n=t.length,r=!1;if(!n)return this.resolve([]);for(var u=new Array(n),a=0,c=-1,f=new this(o);++c<n;)s(t[c],c);return f;function s(t,o){e.resolve(t).then((function(t){u[o]=t,++a!==n||r||(r=!0,i.resolve(f,u))}),(function(t){r||(r=!0,i.reject(f,t))}))}},f.race=function(t){if("[object Array]"!==Object.prototype.toString.call(t))return this.reject(new TypeError("must be an array"));var e=t.length,n=!1;if(!e)return this.resolve([]);for(var r,u=-1,a=new this(o);++u<e;)r=t[u],this.resolve(r).then((function(t){n||(n=!0,i.resolve(a,t))}),(function(t){n||(n=!0,i.reject(a,t))}));return a}},{1:1}],3:[function(t,e,n){(function(e){"use strict";"function"!=typeof e.Promise&&(e.Promise=t(2))}).call(this,void 0!==r?r:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{2:2}],4:[function(t,e,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o=function(){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(t){return}}();function i(t,e){t=t||[],e=e||{};try{return new Blob(t,e)}catch(o){if("TypeError"!==o.name)throw o;for(var n=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),r=0;r<t.length;r+=1)n.append(t[r]);return n.getBlob(e.type)}}"undefined"==typeof Promise&&t(3);var u=Promise;function a(t,e){e&&t.then((function(t){e(null,t)}),(function(t){e(t)}))}function c(t,e,n){"function"==typeof e&&t.then(e),"function"==typeof n&&t.catch(n)}function f(t){return"string"!=typeof t&&(console.warn(t+" used as a key, but it is not a string."),t=String(t)),t}function s(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var l=void 0,d={},h=Object.prototype.toString;function y(t){var e=d[t.name],n={};n.promise=new u((function(t,e){n.resolve=t,n.reject=e})),e.deferredOperations.push(n),e.dbReady?e.dbReady=e.dbReady.then((function(){return n.promise})):e.dbReady=n.promise}function p(t){var e=d[t.name].deferredOperations.pop();if(e)return e.resolve(),e.promise}function v(t,e){var n=d[t.name].deferredOperations.pop();if(n)return n.reject(e),n.promise}function g(t,e){return new u((function(n,r){if(d[t.name]=d[t.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},t.db){if(!e)return n(t.db);y(t),t.db.close()}var i=[t.name];e&&i.push(t.version);var u=o.open.apply(o,i);e&&(u.onupgradeneeded=function(e){var n=u.result;try{n.createObjectStore(t.storeName),e.oldVersion<=1&&n.createObjectStore("local-forage-detect-blob-support")}catch(r){if("ConstraintError"!==r.name)throw r;console.warn('The database "'+t.name+'" has been upgraded from version '+e.oldVersion+" to version "+e.newVersion+', but the storage "'+t.storeName+'" already exists.')}}),u.onerror=function(t){t.preventDefault(),r(u.error)},u.onsuccess=function(){var e=u.result;e.onversionchange=function(t){t.target.close()},n(e),p(t)}}))}function m(t){return g(t,!1)}function b(t){return g(t,!0)}function w(t,e){if(!t.db)return!0;var n=!t.db.objectStoreNames.contains(t.storeName),r=t.version<t.db.version,o=t.version>t.db.version;if(r&&(t.version!==e&&console.warn('The database "'+t.name+"\" can't be downgraded from version "+t.db.vers