forked from xuset/indexeddb-chunk-store
-
Notifications
You must be signed in to change notification settings - Fork 0
/
idbchunkstore.min.js
2 lines (2 loc) · 38.9 KB
/
idbchunkstore.min.js
1
2
(function(t){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=t()}else if(typeof define==="function"&&define.amd){define([],t)}else{var e;if(typeof window!=="undefined"){e=window}else if(typeof global!=="undefined"){e=global}else if(typeof self!=="undefined"){e=self}else{e=this}e.IdbChunkStore=t()}})(function(){var t,e,r;return function t(e,r,n){function i(s,u){if(!r[s]){if(!e[s]){var f=typeof require=="function"&&require;if(!u&&f)return f(s,!0);if(o)return o(s,!0);var a=new Error("Cannot find module '"+s+"'");throw a.code="MODULE_NOT_FOUND",a}var h=r[s]={exports:{}};e[s][0].call(h.exports,function(t){var r=e[s][1][t];return i(r?r:t)},h,h.exports,t,e,r,n)}return r[s].exports}var o=typeof require=="function"&&require;for(var s=0;s<n.length;s++)i(n[s]);return i}({1:[function(t,e,r){"use strict";r.byteLength=h;r.toByteArray=l;r.fromByteArray=v;var n=[];var i=[];var o=typeof Uint8Array!=="undefined"?Uint8Array:Array;var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var u=0,f=s.length;u<f;++u){n[u]=s[u];i[s.charCodeAt(u)]=u}i["-".charCodeAt(0)]=62;i["_".charCodeAt(0)]=63;function a(t){var e=t.length;if(e%4>0){throw new Error("Invalid string. Length must be a multiple of 4")}return t[e-2]==="="?2:t[e-1]==="="?1:0}function h(t){return t.length*3/4-a(t)}function l(t){var e,r,n,s,u,f;var h=t.length;u=a(t);f=new o(h*3/4-u);n=u>0?h-4:h;var l=0;for(e=0,r=0;e<n;e+=4,r+=3){s=i[t.charCodeAt(e)]<<18|i[t.charCodeAt(e+1)]<<12|i[t.charCodeAt(e+2)]<<6|i[t.charCodeAt(e+3)];f[l++]=s>>16&255;f[l++]=s>>8&255;f[l++]=s&255}if(u===2){s=i[t.charCodeAt(e)]<<2|i[t.charCodeAt(e+1)]>>4;f[l++]=s&255}else if(u===1){s=i[t.charCodeAt(e)]<<10|i[t.charCodeAt(e+1)]<<4|i[t.charCodeAt(e+2)]>>2;f[l++]=s>>8&255;f[l++]=s&255}return f}function c(t){return n[t>>18&63]+n[t>>12&63]+n[t>>6&63]+n[t&63]}function p(t,e,r){var n;var i=[];for(var o=e;o<r;o+=3){n=(t[o]<<16)+(t[o+1]<<8)+t[o+2];i.push(c(n))}return i.join("")}function v(t){var e;var r=t.length;var i=r%3;var o="";var s=[];var u=16383;for(var f=0,a=r-i;f<a;f+=u){s.push(p(t,f,f+u>a?a:f+u))}if(i===1){e=t[r-1];o+=n[e>>2];o+=n[e<<4&63];o+="=="}else if(i===2){e=(t[r-2]<<8)+t[r-1];o+=n[e>>10];o+=n[e>>4&63];o+=n[e<<2&63];o+="="}s.push(o);return s.join("")}},{}],2:[function(t,e,r){"use strict";var n=t("base64-js");var i=t("ieee754");r.Buffer=f;r.SlowBuffer=w;r.INSPECT_MAX_BYTES=50;var o=2147483647;r.kMaxLength=o;f.TYPED_ARRAY_SUPPORT=s();if(!f.TYPED_ARRAY_SUPPORT&&typeof console!=="undefined"&&typeof console.error==="function"){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.")}function s(){try{var t=new Uint8Array(1);t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}};return t.foo()===42}catch(t){return false}}function u(t){if(t>o){throw new RangeError("Invalid typed array length")}var e=new Uint8Array(t);e.__proto__=f.prototype;return e}function f(t,e,r){if(typeof t==="number"){if(typeof e==="string"){throw new Error("If encoding is specified then the first argument must be a string")}return c(t)}return a(t,e,r)}if(typeof Symbol!=="undefined"&&Symbol.species&&f[Symbol.species]===f){Object.defineProperty(f,Symbol.species,{value:null,configurable:true,enumerable:false,writable:false})}f.poolSize=8192;function a(t,e,r){if(typeof t==="number"){throw new TypeError('"value" argument must not be a number')}if(t instanceof ArrayBuffer){return d(t,e,r)}if(typeof t==="string"){return p(t,e)}return g(t)}f.from=function(t,e,r){return a(t,e,r)};f.prototype.__proto__=Uint8Array.prototype;f.__proto__=Uint8Array;function h(t){if(typeof t!=="number"){throw new TypeError('"size" argument must be a number')}else if(t<0){throw new RangeError('"size" argument must not be negative')}}function l(t,e,r){h(t);if(t<=0){return u(t)}if(e!==undefined){return typeof r==="string"?u(t).fill(e,r):u(t).fill(e)}return u(t)}f.alloc=function(t,e,r){return l(t,e,r)};function c(t){h(t);return u(t<0?0:y(t)|0)}f.allocUnsafe=function(t){return c(t)};f.allocUnsafeSlow=function(t){return c(t)};function p(t,e){if(typeof e!=="string"||e===""){e="utf8"}if(!f.isEncoding(e)){throw new TypeError('"encoding" must be a valid string encoding')}var r=_(t,e)|0;var n=u(r);var i=n.write(t,e);if(i!==r){n=n.slice(0,i)}return n}function v(t){var e=t.length<0?0:y(t.length)|0;var r=u(e);for(var n=0;n<e;n+=1){r[n]=t[n]&255}return r}function d(t,e,r){if(e<0||t.byteLength<e){throw new RangeError("'offset' is out of bounds")}if(t.byteLength<e+(r||0)){throw new RangeError("'length' is out of bounds")}var n;if(e===undefined&&r===undefined){n=new Uint8Array(t)}else if(r===undefined){n=new Uint8Array(t,e)}else{n=new Uint8Array(t,e,r)}n.__proto__=f.prototype;return n}function g(t){if(f.isBuffer(t)){var e=y(t.length)|0;var r=u(e);if(r.length===0){return r}t.copy(r,0,0,e);return r}if(t){if(Q(t)||"length"in t){if(typeof t.length!=="number"||W(t.length)){return u(0)}return v(t)}if(t.type==="Buffer"&&Array.isArray(t.data)){return v(t.data)}}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function y(t){if(t>=o){throw new RangeError("Attempt to allocate Buffer larger than maximum "+"size: 0x"+o.toString(16)+" bytes")}return t|0}function w(t){if(+t!=t){t=0}return f.alloc(+t)}f.isBuffer=function t(e){return e!=null&&e._isBuffer===true};f.compare=function t(e,r){if(!f.isBuffer(e)||!f.isBuffer(r)){throw new TypeError("Arguments must be Buffers")}if(e===r)return 0;var n=e.length;var i=r.length;for(var o=0,s=Math.min(n,i);o<s;++o){if(e[o]!==r[o]){n=e[o];i=r[o];break}}if(n<i)return-1;if(i<n)return 1;return 0};f.isEncoding=function t(e){switch(String(e).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 true;default:return false}};f.concat=function t(e,r){if(!Array.isArray(e)){throw new TypeError('"list" argument must be an Array of Buffers')}if(e.length===0){return f.alloc(0)}var n;if(r===undefined){r=0;for(n=0;n<e.length;++n){r+=e[n].length}}var i=f.allocUnsafe(r);var o=0;for(n=0;n<e.length;++n){var s=e[n];if(!f.isBuffer(s)){throw new TypeError('"list" argument must be an Array of Buffers')}s.copy(i,o);o+=s.length}return i};function _(t,e){if(f.isBuffer(t)){return t.length}if(Q(t)||t instanceof ArrayBuffer){return t.byteLength}if(typeof t!=="string"){t=""+t}var r=t.length;if(r===0)return 0;var n=false;for(;;){switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case undefined:return H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Z(t).length;default:if(n)return H(t).length;e=(""+e).toLowerCase();n=true}}}f.byteLength=_;function m(t,e,r){var n=false;if(e===undefined||e<0){e=0}if(e>this.length){return""}if(r===undefined||r>this.length){r=this.length}if(r<=0){return""}r>>>=0;e>>>=0;if(r<=e){return""}if(!t)t="utf8";while(true){switch(t){case"hex":return D(this,e,r);case"utf8":case"utf-8":return C(this,e,r);case"ascii":return M(this,e,r);case"latin1":case"binary":return j(this,e,r);case"base64":return I(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase();n=true}}}f.prototype._isBuffer=true;function b(t,e,r){var n=t[e];t[e]=t[r];t[r]=n}f.prototype.swap16=function t(){var e=this.length;if(e%2!==0){throw new RangeError("Buffer size must be a multiple of 16-bits")}for(var r=0;r<e;r+=2){b(this,r,r+1)}return this};f.prototype.swap32=function t(){var e=this.length;if(e%4!==0){throw new RangeError("Buffer size must be a multiple of 32-bits")}for(var r=0;r<e;r+=4){b(this,r,r+3);b(this,r+1,r+2)}return this};f.prototype.swap64=function t(){var e=this.length;if(e%8!==0){throw new RangeError("Buffer size must be a multiple of 64-bits")}for(var r=0;r<e;r+=8){b(this,r,r+7);b(this,r+1,r+6);b(this,r+2,r+5);b(this,r+3,r+4)}return this};f.prototype.toString=function t(){var e=this.length;if(e===0)return"";if(arguments.length===0)return C(this,0,e);return m.apply(this,arguments)};f.prototype.equals=function t(e){if(!f.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(this===e)return true;return f.compare(this,e)===0};f.prototype.inspect=function t(){var e="";var n=r.INSPECT_MAX_BYTES;if(this.length>0){e=this.toString("hex",0,n).match(/.{2}/g).join(" ");if(this.length>n)e+=" ... "}return"<Buffer "+e+">"};f.prototype.compare=function t(e,r,n,i,o){if(!f.isBuffer(e)){throw new TypeError("Argument must be a Buffer")}if(r===undefined){r=0}if(n===undefined){n=e?e.length:0}if(i===undefined){i=0}if(o===undefined){o=this.length}if(r<0||n>e.length||i<0||o>this.length){throw new RangeError("out of range index")}if(i>=o&&r>=n){return 0}if(i>=o){return-1}if(r>=n){return 1}r>>>=0;n>>>=0;i>>>=0;o>>>=0;if(this===e)return 0;var s=o-i;var u=n-r;var a=Math.min(s,u);var h=this.slice(i,o);var l=e.slice(r,n);for(var c=0;c<a;++c){if(h[c]!==l[c]){s=h[c];u=l[c];break}}if(s<u)return-1;if(u<s)return 1;return 0};function E(t,e,r,n,i){if(t.length===0)return-1;if(typeof r==="string"){n=r;r=0}else if(r>2147483647){r=2147483647}else if(r<-2147483648){r=-2147483648}r=+r;if(W(r)){r=i?0:t.length-1}if(r<0)r=t.length+r;if(r>=t.length){if(i)return-1;else r=t.length-1}else if(r<0){if(i)r=0;else return-1}if(typeof e==="string"){e=f.from(e,n)}if(f.isBuffer(e)){if(e.length===0){return-1}return A(t,e,r,n,i)}else if(typeof e==="number"){e=e&255;if(typeof Uint8Array.prototype.indexOf==="function"){if(i){return Uint8Array.prototype.indexOf.call(t,e,r)}else{return Uint8Array.prototype.lastIndexOf.call(t,e,r)}}return A(t,[e],r,n,i)}throw new TypeError("val must be string, number or Buffer")}function A(t,e,r,n,i){var o=1;var s=t.length;var u=e.length;if(n!==undefined){n=String(n).toLowerCase();if(n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le"){if(t.length<2||e.length<2){return-1}o=2;s/=2;u/=2;r/=2}}function f(t,e){if(o===1){return t[e]}else{return t.readUInt16BE(e*o)}}var a;if(i){var h=-1;for(a=r;a<s;a++){if(f(t,a)===f(e,h===-1?0:a-h)){if(h===-1)h=a;if(a-h+1===u)return h*o}else{if(h!==-1)a-=a-h;h=-1}}}else{if(r+u>s)r=s-u;for(a=r;a>=0;a--){var l=true;for(var c=0;c<u;c++){if(f(t,a+c)!==f(e,c)){l=false;break}}if(l)return a}}return-1}f.prototype.includes=function t(e,r,n){return this.indexOf(e,r,n)!==-1};f.prototype.indexOf=function t(e,r,n){return E(this,e,r,n,true)};f.prototype.lastIndexOf=function t(e,r,n){return E(this,e,r,n,false)};function k(t,e,r,n){r=Number(r)||0;var i=t.length-r;if(!n){n=i}else{n=Number(n);if(n>i){n=i}}var o=e.length;if(o%2!==0)throw new TypeError("Invalid hex string");if(n>o/2){n=o/2}for(var s=0;s<n;++s){var u=parseInt(e.substr(s*2,2),16);if(W(u))return s;t[r+s]=u}return s}function B(t,e,r,n){return K(H(e,t.length-r),t,r,n)}function L(t,e,r,n){return K(V(e),t,r,n)}function T(t,e,r,n){return L(t,e,r,n)}function S(t,e,r,n){return K(Z(e),t,r,n)}function x(t,e,r,n){return K(J(e,t.length-r),t,r,n)}f.prototype.write=function t(e,r,n,i){if(r===undefined){i="utf8";n=this.length;r=0}else if(n===undefined&&typeof r==="string"){i=r;n=this.length;r=0}else if(isFinite(r)){r=r>>>0;if(isFinite(n)){n=n>>>0;if(i===undefined)i="utf8"}else{i=n;n=undefined}}else{throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")}var o=this.length-r;if(n===undefined||n>o)n=o;if(e.length>0&&(n<0||r<0)||r>this.length){throw new RangeError("Attempt to write outside buffer bounds")}if(!i)i="utf8";var s=false;for(;;){switch(i){case"hex":return k(this,e,r,n);case"utf8":case"utf-8":return B(this,e,r,n);case"ascii":return L(this,e,r,n);case"latin1":case"binary":return T(this,e,r,n);case"base64":return S(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,r,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase();s=true}}};f.prototype.toJSON=function t(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function I(t,e,r){if(e===0&&r===t.length){return n.fromByteArray(t)}else{return n.fromByteArray(t.slice(e,r))}}function C(t,e,r){r=Math.min(t.length,r);var n=[];var i=e;while(i<r){var o=t[i];var s=null;var u=o>239?4:o>223?3:o>191?2:1;if(i+u<=r){var f,a,h,l;switch(u){case 1:if(o<128){s=o}break;case 2:f=t[i+1];if((f&192)===128){l=(o&31)<<6|f&63;if(l>127){s=l}}break;case 3:f=t[i+1];a=t[i+2];if((f&192)===128&&(a&192)===128){l=(o&15)<<12|(f&63)<<6|a&63;if(l>2047&&(l<55296||l>57343)){s=l}}break;case 4:f=t[i+1];a=t[i+2];h=t[i+3];if((f&192)===128&&(a&192)===128&&(h&192)===128){l=(o&15)<<18|(f&63)<<12|(a&63)<<6|h&63;if(l>65535&&l<1114112){s=l}}}}if(s===null){s=65533;u=1}else if(s>65535){s-=65536;n.push(s>>>10&1023|55296);s=56320|s&1023}n.push(s);i+=u}return U(n)}var P=4096;function U(t){var e=t.length;if(e<=P){return String.fromCharCode.apply(String,t)}var r="";var n=0;while(n<e){r+=String.fromCharCode.apply(String,t.slice(n,n+=P))}return r}function M(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i){n+=String.fromCharCode(t[i]&127)}return n}function j(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i){n+=String.fromCharCode(t[i])}return n}function D(t,e,r){var n=t.length;if(!e||e<0)e=0;if(!r||r<0||r>n)r=n;var i="";for(var o=e;o<r;++o){i+=X(t[o])}return i}function R(t,e,r){var n=t.slice(e,r);var i="";for(var o=0;o<n.length;o+=2){i+=String.fromCharCode(n[o]+n[o+1]*256)}return i}f.prototype.slice=function t(e,r){var n=this.length;e=~~e;r=r===undefined?n:~~r;if(e<0){e+=n;if(e<0)e=0}else if(e>n){e=n}if(r<0){r+=n;if(r<0)r=0}else if(r>n){r=n}if(r<e)r=e;var i=this.subarray(e,r);i.__proto__=f.prototype;return i};function O(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}f.prototype.readUIntLE=function t(e,r,n){e=e>>>0;r=r>>>0;if(!n)O(e,r,this.length);var i=this[e];var o=1;var s=0;while(++s<r&&(o*=256)){i+=this[e+s]*o}return i};f.prototype.readUIntBE=function t(e,r,n){e=e>>>0;r=r>>>0;if(!n){O(e,r,this.length)}var i=this[e+--r];var o=1;while(r>0&&(o*=256)){i+=this[e+--r]*o}return i};f.prototype.readUInt8=function t(e,r){e=e>>>0;if(!r)O(e,1,this.length);return this[e]};f.prototype.readUInt16LE=function t(e,r){e=e>>>0;if(!r)O(e,2,this.length);return this[e]|this[e+1]<<8};f.prototype.readUInt16BE=function t(e,r){e=e>>>0;if(!r)O(e,2,this.length);return this[e]<<8|this[e+1]};f.prototype.readUInt32LE=function t(e,r){e=e>>>0;if(!r)O(e,4,this.length);return(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};f.prototype.readUInt32BE=function t(e,r){e=e>>>0;if(!r)O(e,4,this.length);return this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};f.prototype.readIntLE=function t(e,r,n){e=e>>>0;r=r>>>0;if(!n)O(e,r,this.length);var i=this[e];var o=1;var s=0;while(++s<r&&(o*=256)){i+=this[e+s]*o}o*=128;if(i>=o)i-=Math.pow(2,8*r);return i};f.prototype.readIntBE=function t(e,r,n){e=e>>>0;r=r>>>0;if(!n)O(e,r,this.length);var i=r;var o=1;var s=this[e+--i];while(i>0&&(o*=256)){s+=this[e+--i]*o}o*=128;if(s>=o)s-=Math.pow(2,8*r);return s};f.prototype.readInt8=function t(e,r){e=e>>>0;if(!r)O(e,1,this.length);if(!(this[e]&128))return this[e];return(255-this[e]+1)*-1};f.prototype.readInt16LE=function t(e,r){e=e>>>0;if(!r)O(e,2,this.length);var n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};f.prototype.readInt16BE=function t(e,r){e=e>>>0;if(!r)O(e,2,this.length);var n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};f.prototype.readInt32LE=function t(e,r){e=e>>>0;if(!r)O(e,4,this.length);return this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};f.prototype.readInt32BE=function t(e,r){e=e>>>0;if(!r)O(e,4,this.length);return this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};f.prototype.readFloatLE=function t(e,r){e=e>>>0;if(!r)O(e,4,this.length);return i.read(this,e,true,23,4)};f.prototype.readFloatBE=function t(e,r){e=e>>>0;if(!r)O(e,4,this.length);return i.read(this,e,false,23,4)};f.prototype.readDoubleLE=function t(e,r){e=e>>>0;if(!r)O(e,8,this.length);return i.read(this,e,true,52,8)};f.prototype.readDoubleBE=function t(e,r){e=e>>>0;if(!r)O(e,8,this.length);return i.read(this,e,false,52,8)};function N(t,e,r,n,i,o){if(!f.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}f.prototype.writeUIntLE=function t(e,r,n,i){e=+e;r=r>>>0;n=n>>>0;if(!i){var o=Math.pow(2,8*n)-1;N(this,e,r,n,o,0)}var s=1;var u=0;this[r]=e&255;while(++u<n&&(s*=256)){this[r+u]=e/s&255}return r+n};f.prototype.writeUIntBE=function t(e,r,n,i){e=+e;r=r>>>0;n=n>>>0;if(!i){var o=Math.pow(2,8*n)-1;N(this,e,r,n,o,0)}var s=n-1;var u=1;this[r+s]=e&255;while(--s>=0&&(u*=256)){this[r+s]=e/u&255}return r+n};f.prototype.writeUInt8=function t(e,r,n){e=+e;r=r>>>0;if(!n)N(this,e,r,1,255,0);this[r]=e&255;return r+1};f.prototype.writeUInt16LE=function t(e,r,n){e=+e;r=r>>>0;if(!n)N(this,e,r,2,65535,0);this[r]=e&255;this[r+1]=e>>>8;return r+2};f.prototype.writeUInt16BE=function t(e,r,n){e=+e;r=r>>>0;if(!n)N(this,e,r,2,65535,0);this[r]=e>>>8;this[r+1]=e&255;return r+2};f.prototype.writeUInt32LE=function t(e,r,n){e=+e;r=r>>>0;if(!n)N(this,e,r,4,4294967295,0);this[r+3]=e>>>24;this[r+2]=e>>>16;this[r+1]=e>>>8;this[r]=e&255;return r+4};f.prototype.writeUInt32BE=function t(e,r,n){e=+e;r=r>>>0;if(!n)N(this,e,r,4,4294967295,0);this[r]=e>>>24;this[r+1]=e>>>16;this[r+2]=e>>>8;this[r+3]=e&255;return r+4};f.prototype.writeIntLE=function t(e,r,n,i){e=+e;r=r>>>0;if(!i){var o=Math.pow(2,8*n-1);N(this,e,r,n,o-1,-o)}var s=0;var u=1;var f=0;this[r]=e&255;while(++s<n&&(u*=256)){if(e<0&&f===0&&this[r+s-1]!==0){f=1}this[r+s]=(e/u>>0)-f&255}return r+n};f.prototype.writeIntBE=function t(e,r,n,i){e=+e;r=r>>>0;if(!i){var o=Math.pow(2,8*n-1);N(this,e,r,n,o-1,-o)}var s=n-1;var u=1;var f=0;this[r+s]=e&255;while(--s>=0&&(u*=256)){if(e<0&&f===0&&this[r+s+1]!==0){f=1}this[r+s]=(e/u>>0)-f&255}return r+n};f.prototype.writeInt8=function t(e,r,n){e=+e;r=r>>>0;if(!n)N(this,e,r,1,127,-128);if(e<0)e=255+e+1;this[r]=e&255;return r+1};f.prototype.writeInt16LE=function t(e,r,n){e=+e;r=r>>>0;if(!n)N(this,e,r,2,32767,-32768);this[r]=e&255;this[r+1]=e>>>8;return r+2};f.prototype.writeInt16BE=function t(e,r,n){e=+e;r=r>>>0;if(!n)N(this,e,r,2,32767,-32768);this[r]=e>>>8;this[r+1]=e&255;return r+2};f.prototype.writeInt32LE=function t(e,r,n){e=+e;r=r>>>0;if(!n)N(this,e,r,4,2147483647,-2147483648);this[r]=e&255;this[r+1]=e>>>8;this[r+2]=e>>>16;this[r+3]=e>>>24;return r+4};f.prototype.writeInt32BE=function t(e,r,n){e=+e;r=r>>>0;if(!n)N(this,e,r,4,2147483647,-2147483648);if(e<0)e=4294967295+e+1;this[r]=e>>>24;this[r+1]=e>>>16;this[r+2]=e>>>8;this[r+3]=e&255;return r+4};function z(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(t,e,r,n,o){e=+e;r=r>>>0;if(!o){z(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38)}i.write(t,e,r,n,23,4);return r+4}f.prototype.writeFloatLE=function t(e,r,n){return F(this,e,r,true,n)};f.prototype.writeFloatBE=function t(e,r,n){return F(this,e,r,false,n)};function q(t,e,r,n,o){e=+e;r=r>>>0;if(!o){z(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308)}i.write(t,e,r,n,52,8);return r+8}f.prototype.writeDoubleLE=function t(e,r,n){return q(this,e,r,true,n)};f.prototype.writeDoubleBE=function t(e,r,n){return q(this,e,r,false,n)};f.prototype.copy=function t(e,r,n,i){if(!n)n=0;if(!i&&i!==0)i=this.length;if(r>=e.length)r=e.length;if(!r)r=0;if(i>0&&i<n)i=n;if(i===n)return 0;if(e.length===0||this.length===0)return 0;if(r<0){throw new RangeError("targetStart out of bounds")}if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");if(i>this.length)i=this.length;if(e.length-r<i-n){i=e.length-r+n}var o=i-n;var s;if(this===e&&n<r&&r<i){for(s=o-1;s>=0;--s){e[s+r]=this[s+n]}}else if(o<1e3){for(s=0;s<o;++s){e[s+r]=this[s+n]}}else{Uint8Array.prototype.set.call(e,this.subarray(n,n+o),r)}return o};f.prototype.fill=function t(e,r,n,i){if(typeof e==="string"){if(typeof r==="string"){i=r;r=0;n=this.length}else if(typeof n==="string"){i=n;n=this.length}if(e.length===1){var o=e.charCodeAt(0);if(o<256){e=o}}if(i!==undefined&&typeof i!=="string"){throw new TypeError("encoding must be a string")}if(typeof i==="string"&&!f.isEncoding(i)){throw new TypeError("Unknown encoding: "+i)}}else if(typeof e==="number"){e=e&255}if(r<0||this.length<r||this.length<n){throw new RangeError("Out of range index")}if(n<=r){return this}r=r>>>0;n=n===undefined?this.length:n>>>0;if(!e)e=0;var s;if(typeof e==="number"){for(s=r;s<n;++s){this[s]=e}}else{var u=f.isBuffer(e)?e:new f(e,i);var a=u.length;for(s=0;s<n-r;++s){this[s+r]=u[s%a]}}return this};var Y=/[^+\/0-9A-Za-z-_]/g;function G(t){t=t.trim().replace(Y,"");if(t.length<2)return"";while(t.length%4!==0){t=t+"="}return t}function X(t){if(t<16)return"0"+t.toString(16);return t.toString(16)}function H(t,e){e=e||Infinity;var r;var n=t.length;var i=null;var o=[];for(var s=0;s<n;++s){r=t.charCodeAt(s);if(r>55295&&r<57344){if(!i){if(r>56319){if((e-=3)>-1)o.push(239,191,189);continue}else if(s+1===n){if((e-=3)>-1)o.push(239,191,189);continue}i=r;continue}if(r<56320){if((e-=3)>-1)o.push(239,191,189);i=r;continue}r=(i-55296<<10|r-56320)+65536}else if(i){if((e-=3)>-1)o.push(239,191,189)}i=null;if(r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else{throw new Error("Invalid code point")}}return o}function V(t){var e=[];for(var r=0;r<t.length;++r){e.push(t.charCodeAt(r)&255)}return e}function J(t,e){var r,n,i;var o=[];for(var s=0;s<t.length;++s){if((e-=2)<0)break;r=t.charCodeAt(s);n=r>>8;i=r%256;o.push(i);o.push(n)}return o}function Z(t){return n.toByteArray(G(t))}function K(t,e,r,n){for(var i=0;i<n;++i){if(i+r>=e.length||i>=t.length)break;e[i+r]=t[i]}return i}function Q(t){return typeof ArrayBuffer.isView==="function"&&ArrayBuffer.isView(t)}function W(t){return t!==t}},{"base64-js":1,ieee754:5}],3:[function(t,e,r){function n(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}e.exports=n;n.EventEmitter=n;n.prototype._events=undefined;n.prototype._maxListeners=undefined;n.defaultMaxListeners=10;n.prototype.setMaxListeners=function(t){if(!o(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");this._maxListeners=t;return this};n.prototype.emit=function(t){var e,r,n,o,f,a;if(!this._events)this._events={};if(t==="error"){if(!this._events.error||s(this._events.error)&&!this._events.error.length){e=arguments[1];if(e instanceof Error){throw e}else{var h=new Error('Uncaught, unspecified "error" event. ('+e+")");h.context=e;throw h}}}r=this._events[t];if(u(r))return false;if(i(r)){switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:o=Array.prototype.slice.call(arguments,1);r.apply(this,o)}}else if(s(r)){o=Array.prototype.slice.call(arguments,1);a=r.slice();n=a.length;for(f=0;f<n;f++)a[f].apply(this,o)}return true};n.prototype.addListener=function(t,e){var r;if(!i(e))throw TypeError("listener must be a function");if(!this._events)this._events={};if(this._events.newListener)this.emit("newListener",t,i(e.listener)?e.listener:e);if(!this._events[t])this._events[t]=e;else if(s(this._events[t]))this._events[t].push(e);else this._events[t]=[this._events[t],e];if(s(this._events[t])&&!this._events[t].warned){if(!u(this._maxListeners)){r=this._maxListeners}else{r=n.defaultMaxListeners}if(r&&r>0&&this._events[t].length>r){this._events[t].warned=true;console.error("(node) warning: possible EventEmitter memory "+"leak detected. %d listeners added. "+"Use emitter.setMaxListeners() to increase limit.",this._events[t].length);if(typeof console.trace==="function"){console.trace()}}}return this};n.prototype.on=n.prototype.addListener;n.prototype.once=function(t,e){if(!i(e))throw TypeError("listener must be a function");var r=false;function n(){this.removeListener(t,n);if(!r){r=true;e.apply(this,arguments)}}n.listener=e;this.on(t,n);return this};n.prototype.removeListener=function(t,e){var r,n,o,u;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;r=this._events[t];o=r.length;n=-1;if(r===e||i(r.listener)&&r.listener===e){delete this._events[t];if(this._events.removeListener)this.emit("removeListener",t,e)}else if(s(r)){for(u=o;u-- >0;){if(r[u]===e||r[u].listener&&r[u].listener===e){n=u;break}}if(n<0)return this;if(r.length===1){r.length=0;delete this._events[t]}else{r.splice(n,1)}if(this._events.removeListener)this.emit("removeListener",t,e)}return this};n.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener){if(arguments.length===0)this._events={};else if(this._events[t])delete this._events[t];return this}if(arguments.length===0){for(e in this._events){if(e==="removeListener")continue;this.removeAllListeners(e)}this.removeAllListeners("removeListener");this._events={};return this}r=this._events[t];if(i(r)){this.removeListener(t,r)}else if(r){while(r.length)this.removeListener(t,r[r.length-1])}delete this._events[t];return this};n.prototype.listeners=function(t){var e;if(!this._events||!this._events[t])e=[];else if(i(this._events[t]))e=[this._events[t]];else e=this._events[t].slice();return e};n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;else if(e)return e.length}return 0};n.listenerCount=function(t,e){return t.listenerCount(e)};function i(t){return typeof t==="function"}function o(t){return typeof t==="number"}function s(t){return typeof t==="object"&&t!==null}function u(t){return t===void 0}},{}],4:[function(t,e,r){e.exports=f;var n=t("events").EventEmitter;var i=t("inherits");var o=t("promisize");var s=typeof window==="undefined"?self:window;var u=s.indexedDB||s.mozIndexedDB||s.webkitIndexedDB||s.msIndexedDB;f.INDEXEDDB_SUPPORT=u!=null;f.BROADCAST_SUPPORT=s.BroadcastChannel!=null;i(f,n);function f(t,e,r){var i=this;if(typeof t!=="string")throw new Error("A name must be supplied of type string");if(!u)throw new Error("IndexedDB not supported");if(typeof e==="function")return new f(t,null,e);if(!(i instanceof f))return new f(t,e,r);if(!e)e={};n.call(i);i._db=null;i._closed=false;i._channel=null;i._waiters=[];var o=e.channel||s.BroadcastChannel;if(o){i._channel=new o(t);i._channel.onmessage=y}var a=u.open(t);a.onerror=l;a.onsuccess=p;a.onupgradeneeded=v;i.on("newListener",g);function l(t){h(t);i._close(t.target.error);if(r)r(t.target.error)}function c(t){h(t);i._close(t.target.error)}function p(t){if(i._closed){t.target.result.close()}else{i._db=t.target.result;i._db.onclose=d;i._db.onerror=c;for(var e in i._waiters)i._waiters[e]._init(null);i._waiters=null;if(r)r(null);i.emit("open")}}function v(t){var e=t.target.result;e.createObjectStore("kv",{autoIncrement:true})}function d(){i._close()}function g(t){if(t!=="add"&&t!=="set"&&t!=="remove")return;if(!i._channel)return i.emit("error",new Error("No BroadcastChannel support"))}function y(t){if(t.data.method==="add")i.emit("add",t.data);else if(t.data.method==="set")i.emit("set",t.data);else if(t.data.method==="remove")i.emit("remove",t.data)}}f.prototype.get=function(t,e){return this.transaction("readonly").get(t,e)};f.prototype.set=function(t,e,r){return this.transaction("readwrite").set(t,e,r)};f.prototype.json=function(t,e){return this.transaction("readonly").json(t,e)};f.prototype.keys=function(t,e){return this.transaction("readonly").keys(t,e)};f.prototype.values=function(t,e){return this.transaction("readonly").values(t,e)};f.prototype.remove=function(t,e){return this.transaction("readwrite").remove(t,e)};f.prototype.clear=function(t){return this.transaction("readwrite").clear(t)};f.prototype.count=function(t,e){return this.transaction("readonly").count(t,e)};f.prototype.add=function(t,e,r){return this.transaction("readwrite").add(t,e,r)};f.prototype.iterator=function(t,e){return this.transaction("readonly").iterator(t,e)};f.prototype.transaction=function(t){if(this._closed)throw new Error("Database is closed");var e=new a(this,t);if(this._db)e._init(null);else this._waiters.push(e);return e};f.prototype.close=function(){this._close()};f.prototype._close=function(t){if(this._closed)return;this._closed=true;if(this._db)this._db.close();if(this._channel)this._channel.close();this._db=null;this._channel=null;if(t)this.emit("error",t);this.emit("close");for(var e in this._waiters)this._waiters[e]._init(t||new Error("Database is closed"));this._waiters=null;this.removeAllListeners()};function a(t,e){this._kvStore=t;this._mode=e||"readwrite";this._objectStore=null;this._waiters=null;this.finished=false;this.onfinish=null;if(this._mode!=="readonly"&&this._mode!=="readwrite"){throw new Error('mode must be either "readonly" or "readwrite"')}}a.prototype._init=function(t){var e=this;if(e.finished)return;if(t)return e._close(t);var r=e._kvStore._db.transaction("kv",e._mode);r.oncomplete=i;r.onerror=o;e._objectStore=r.objectStore("kv");for(var n in e._waiters)e._waiters[n](null,e._objectStore);e._waiters=null;function i(){e._close(null)}function o(t){h(t);e._close(t.target.error)}};a.prototype._getObjectStore=function(t){if(this.finished)throw new Error("Transaction is finished");if(this._objectStore)return t(null,this._objectStore);this._waiters=this._waiters||[];this._waiters.push(t)};a.prototype.set=function(t,e,r){var n=this;if(t==null||e==null)throw new Error("A key and value must be given");r=o(r);n._getObjectStore(function(i,o){if(i)return r(i);try{var s=o.put(e,t)}catch(t){return r(t)}s.onerror=h.bind(this,r);s.onsuccess=function(){if(n._kvStore._channel){n._kvStore._channel.postMessage({method:"set",key:t,value:e})}r(null)}});return r.promise};a.prototype.add=function(t,e,r){var n=this;if(e==null&&t!=null)return n.add(undefined,t,r);if(typeof e==="function"||e==null&&r==null)return n.add(undefined,t,e);if(e==null)throw new Error("A value must be provided as an argument");r=o(r);n._getObjectStore(function(i,o){if(i)return r(i);try{var s=t==null?o.add(e):o.add(e,t)}catch(t){return r(t)}s.onerror=h.bind(this,r);s.onsuccess=function(){if(n._kvStore._channel){n._kvStore._channel.postMessage({method:"add",key:t,value:e})}r(null)}});return r.promise};a.prototype.get=function(t,e){var r=this;if(t==null)throw new Error("A key must be given as an argument");e=o(e);r._getObjectStore(function(r,n){if(r)return e(r);try{var i=n.get(t)}catch(t){return e(t)}i.onerror=h.bind(this,e);i.onsuccess=function(t){e(null,t.target.result)}});return e.promise};a.prototype.json=function(t,e){var r=this;if(typeof t==="function")return r.json(null,t);e=o(e);var n={};r.iterator(t,function(t,r){if(t)return e(t);if(r){n[r.key]=r.value;r.continue()}else{e(null,n)}});return e.promise};a.prototype.keys=function(t,e){var r=this;if(typeof t==="function")return r.keys(null,t);e=o(e);var n=[];r.iterator(t,function(t,r){if(t)return e(t);if(r){n.push(r.key);r.continue()}else{e(null,n)}});return e.promise};a.prototype.values=function(t,e){var r=this;if(typeof t==="function")return r.values(null,t);e=o(e);var n=[];r.iterator(t,function(t,r){if(t)return e(t);if(r){n.push(r.value);r.continue()}else{e(null,n)}});return e.promise};a.prototype.remove=function(t,e){var r=this;if(t==null)throw new Error("A key must be given as an argument");e=o(e);r._getObjectStore(function(n,i){if(n)return e(n);try{var o=i.delete(t)}catch(t){return e(t)}o.onerror=h.bind(this,e);o.onsuccess=function(){if(r._kvStore._channel){r._kvStore._channel.postMessage({method:"remove",key:t})}e(null)}});return e.promise};a.prototype.clear=function(t){var e=this;t=o(t);e._getObjectStore(function(e,r){if(e)return t(e);try{
var n=r.clear()}catch(e){return t(e)}n.onerror=h.bind(this,t);n.onsuccess=function(){t(null)}});return t.promise};a.prototype.count=function(t,e){var r=this;if(typeof t==="function")return r.count(null,t);e=o(e);r._getObjectStore(function(r,n){if(r)return e(r);try{var i=t==null?n.count():n.count(t)}catch(t){return e(t)}i.onerror=h.bind(this,e);i.onsuccess=function(t){e(null,t.target.result)}});return e.promise};a.prototype.iterator=function(t,e){var r=this;if(typeof t==="function")return r.iterator(null,t);if(typeof e!=="function")throw new Error("A function must be given");r._getObjectStore(function(r,n){if(r)return e(r);try{var i=t==null?n.openCursor():n.openCursor(t)}catch(t){return e(t)}i.onerror=h.bind(this,e);i.onsuccess=function(t){var r=t.target.result;e(null,r)}})};a.prototype.abort=function(){if(this.finished)throw new Error("Transaction is finished");if(this._objectStore)this._objectStore.transaction.abort();this._close(new Error("Transaction aborted"))};a.prototype._close=function(t){if(this.finished)return;this.finished=true;this._kvStore=null;this._objectStore=null;for(var e in this._waiters)this._waiters[e](t||new Error("Transaction is finished"));if(this.onfinish)this.onfinish(t);this.onfinish=null;this._waiters=null};function h(t,e){if(e==null)return h(null,t);e.preventDefault();e.stopPropagation();if(t)t(e.target.error)}},{events:3,inherits:6,promisize:8}],5:[function(t,e,r){r.read=function(t,e,r,n,i){var o,s;var u=i*8-n-1;var f=(1<<u)-1;var a=f>>1;var h=-7;var l=r?i-1:0;var c=r?-1:1;var p=t[e+l];l+=c;o=p&(1<<-h)-1;p>>=-h;h+=u;for(;h>0;o=o*256+t[e+l],l+=c,h-=8){}s=o&(1<<-h)-1;o>>=-h;h+=n;for(;h>0;s=s*256+t[e+l],l+=c,h-=8){}if(o===0){o=1-a}else if(o===f){return s?NaN:(p?-1:1)*Infinity}else{s=s+Math.pow(2,n);o=o-a}return(p?-1:1)*s*Math.pow(2,o-n)};r.write=function(t,e,r,n,i,o){var s,u,f;var a=o*8-i-1;var h=(1<<a)-1;var l=h>>1;var c=i===23?Math.pow(2,-24)-Math.pow(2,-77):0;var p=n?0:o-1;var v=n?1:-1;var d=e<0||e===0&&1/e<0?1:0;e=Math.abs(e);if(isNaN(e)||e===Infinity){u=isNaN(e)?1:0;s=h}else{s=Math.floor(Math.log(e)/Math.LN2);if(e*(f=Math.pow(2,-s))<1){s--;f*=2}if(s+l>=1){e+=c/f}else{e+=c*Math.pow(2,1-l)}if(e*f>=2){s++;f/=2}if(s+l>=h){u=0;s=h}else if(s+l>=1){u=(e*f-1)*Math.pow(2,i);s=s+l}else{u=e*Math.pow(2,l-1)*Math.pow(2,i);s=0}}for(;i>=8;t[r+p]=u&255,p+=v,u/=256,i-=8){}s=s<<i|u;a+=i;for(;a>0;t[r+p]=s&255,p+=v,s/=256,a-=8){}t[r+p-v]|=d*128}},{}],6:[function(t,e,r){if(typeof Object.create==="function"){e.exports=function t(e,r){e.super_=r;e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}}else{e.exports=function t(e,r){e.super_=r;var n=function(){};n.prototype=r.prototype;e.prototype=new n;e.prototype.constructor=e}}},{}],7:[function(t,e,r){var n=e.exports={};var i;var o;function s(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function"){i=setTimeout}else{i=s}}catch(t){i=s}try{if(typeof clearTimeout==="function"){o=clearTimeout}else{o=u}}catch(t){o=u}})();function f(t){if(i===setTimeout){return setTimeout(t,0)}if((i===s||!i)&&setTimeout){i=setTimeout;return setTimeout(t,0)}try{return i(t,0)}catch(e){try{return i.call(null,t,0)}catch(e){return i.call(this,t,0)}}}function a(t){if(o===clearTimeout){return clearTimeout(t)}if((o===u||!o)&&clearTimeout){o=clearTimeout;return clearTimeout(t)}try{return o(t)}catch(e){try{return o.call(null,t)}catch(e){return o.call(this,t)}}}var h=[];var l=false;var c;var p=-1;function v(){if(!l||!c){return}l=false;if(c.length){h=c.concat(h)}else{p=-1}if(h.length){d()}}function d(){if(l){return}var t=f(v);l=true;var e=h.length;while(e){c=h;h=[];while(++p<e){if(c){c[p].run()}}p=-1;e=h.length}c=null;l=false;a(t)}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1){for(var r=1;r<arguments.length;r++){e[r-1]=arguments[r]}}h.push(new g(t,e));if(h.length===1&&!l){f(d)}};function g(t,e){this.fun=t;this.array=e}g.prototype.run=function(){this.fun.apply(null,this.array)};n.title="browser";n.browser=true;n.env={};n.argv=[];n.version="";n.versions={};function y(){}n.on=y;n.addListener=y;n.once=y;n.off=y;n.removeListener=y;n.removeAllListeners=y;n.emit=y;n.binding=function(t){throw new Error("process.binding is not supported")};n.cwd=function(){return"/"};n.chdir=function(t){throw new Error("process.chdir is not supported")};n.umask=function(){return 0}},{}],8:[function(t,e,r){e.exports=n;function n(t){var e;var r;var n;if(t!=null&&typeof t!=="function")throw new Error("cb must be a function");if(t==null&&typeof Promise!=="undefined"){e=new Promise(function(t,e){r=t;n=e})}function i(i,o){if(e){if(i)n(i);else r(o)}else{if(t)t(i,o);else if(i)throw i}}i.promise=e;return i}},{}],"/":[function(t,e,r){(function(r,n){e.exports=o;var i=t("idb-kv-store");function o(t,e,r){var n=this;if(typeof t!=="number")throw new Error("chunkLength must be a number");if(typeof e==="function")return o(t,null,e);if(!(n instanceof o))return new o(t,e,r);if(!e)e={};n.chunkLength=t;n.length=Number(e.length)||Infinity;n.closed=false;n._groupPutDelay=e.groupPutDelay||10;n._groupPutCallbacks=[];n._groupPutData={};n._groupPutTimeout=null;n._lastGroupPut=0;if(n.length!==Infinity){this.lastChunkLength=this.length%this.chunkLength||this.chunkLength;n.lastChunkIndex=Math.ceil(n.length/n.chunkLength)-1}var s=e.name||""+Math.round(9e16*Math.random());if(e.torrent&&e.torrent.infoHash)s=e.torrent.infoHash;n._store=new i(s,r);n._store.on("close",u);n._store.on("error",f);function u(){n._close(new Error("IndexedDB database unexpectedly closed"))}function f(t){n._close(t)}}o.prototype.put=function(t,e,r){var i=this;if(i.closed)throw new Error("Store is closed");if(typeof t!=="number")throw new Error("index must be a number");if(!n.isBuffer(e))e=n.from(e);var o=t===i.lastChunkIndex;var u=o&&e.length!==i.lastChunkLength||!o&&e.length!==i.chunkLength;if(u)return s(r,new Error("Invalid buffer length"));i._groupPutData[t]=e;if(r)i._groupPutCallbacks.push(r);if(i._lastGroupPut+i._groupPutDelay<Date.now()){i._groupPut()}else if(i._groupPutTimeout==null){i._groupPutTimeout=setTimeout(i._groupPut.bind(i),i._groupPutDelay)}};o.prototype._groupPut=function(){var t=this;if(t.closed)return;var e=t._groupPutCallbacks;var r=t._groupPutData;t._groupPutCallbacks=[];t._groupPutData={};t._lastGroupPut=Date.now();if(t._groupPutTimeout!=null)clearTimeout(t._groupPutTimeout);t._groupPutTimeout=null;var n=t._store.transaction("readwrite");for(var i in r)n.set(Number(i),r[i],u);n.onfinish=function(t){for(var r in e){e[r](t)}}};o.prototype.get=function(t,e,r){var i=this;if(typeof e==="function")return i.get(t,null,e);if(typeof r!=="function")throw new Error("cb must be a function");if(i.closed)throw new Error("Store is closed");if(typeof t!=="number")throw new Error("index must be a number");if(!e)e={};i._store.get(t,function(t,i){if(t)return r(t);if(typeof i==="undefined"){var o=new Error("Chunk does not exist");o.name="MissingChunkError";return r(o)}var s="offset"in e?e.offset:0;var u="length"in e?e.length:i.length-s;r(null,n.from(i).slice(s,s+u))})};o.prototype.close=function(t){this._close();s(t,null)};o.prototype._close=function(t){if(this.closed)return;this.closed=true;this._store.close();this._store=null;this._groupPutData=null;clearTimeout(this._groupPutTimeout);t=t||new Error("Store is closed");for(var e in this._groupPutCallbacks)this._groupPutCallbacks[e](t);this._groupPutCallbacks=null};o.prototype.destroy=function(t){var e=this;if(e.closed)throw new Error("Store is closed");e._store.clear(u);e.close(t)};function s(){if(arguments[0]!=null){r.nextTick.apply(this,arguments)}}function u(){}}).call(this,t("_process"),t("buffer").Buffer)},{_process:7,buffer:2,"idb-kv-store":4}]},{},[])("/")});