forked from pouchdb/pouchdb
/
pouchdb.memory.min.js
13 lines (13 loc) · 178 KB
/
pouchdb.memory.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
// PouchDB in-memory plugin 6.2.0
// Based on MemDOWN: https://github.com/rvagg/memdown
//
// (c) 2012-2017 Dale Harvey and the PouchDB team
// PouchDB may be freely distributed under the Apache license, version 2.0.
// For all details and documentation:
// http://pouchdb.com
!function e(t,n,r){function i(s,a){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var f=new Error("Cannot find module '"+s+"'");throw f.code="MODULE_NOT_FOUND",f}var c=n[s]={exports:{}};t[s][0].call(c.exports,function(e){var n=t[s][1][e];return i(n||e)},c,c.exports,e,t,n,r)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<r.length;s++)i(r[s]);return i}({1:[function(e,t,n){"use strict";function r(e){return function(){var t=arguments.length;if(t){for(var n=[],r=-1;++r<t;)n[r]=arguments[r];return e.call(this,n)}return e.call(this,[])}}t.exports=r},{}],2:[function(e,t,n){"use strict";function r(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===e[t-2]?2:"="===e[t-1]?1:0}function i(e){return 3*e.length/4-r(e)}function o(e){var t,n,i,o,s,a,u=e.length;s=r(e),a=new l(3*u/4-s),i=s>0?u-4:u;var f=0;for(t=0,n=0;t<i;t+=4,n+=3)o=c[e.charCodeAt(t)]<<18|c[e.charCodeAt(t+1)]<<12|c[e.charCodeAt(t+2)]<<6|c[e.charCodeAt(t+3)],a[f++]=o>>16&255,a[f++]=o>>8&255,a[f++]=255&o;return 2===s?(o=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4,a[f++]=255&o):1===s&&(o=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2,a[f++]=o>>8&255,a[f++]=255&o),a}function s(e){return f[e>>18&63]+f[e>>12&63]+f[e>>6&63]+f[63&e]}function a(e,t,n){for(var r,i=[],o=t;o<n;o+=3)r=(e[o]<<16)+(e[o+1]<<8)+e[o+2],i.push(s(r));return i.join("")}function u(e){for(var t,n=e.length,r=n%3,i="",o=[],s=0,u=n-r;s<u;s+=16383)o.push(a(e,s,s+16383>u?u:s+16383));return 1===r?(t=e[n-1],i+=f[t>>2],i+=f[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=f[t>>10],i+=f[t>>4&63],i+=f[t<<2&63],i+="="),o.push(i),o.join("")}n.byteLength=i,n.toByteArray=o,n.fromByteArray=u;for(var f=[],c=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d=0,p=h.length;d<p;++d)f[d]=h[d],c[h.charCodeAt(d)]=d;c["-".charCodeAt(0)]=62,c["_".charCodeAt(0)]=63},{}],3:[function(e,t,n){},{}],4:[function(e,t,n){(function(n){function r(e,t,r){t>>>=0;var i=e.byteLength-t;if(i<0)throw new RangeError("'offset' is out of bounds");if(void 0===r)r=i;else if((r>>>=0)>i)throw new RangeError("'length' is out of bounds");return a?n.from(e.slice(t,t+r)):new n(new Uint8Array(e.slice(t,t+r)))}function i(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!n.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');return a?n.from(e,t):new n(e,t)}function o(e,t,o){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return s(e)?r(e,t,o):"string"==typeof e?i(e,t):a?n.from(e):new n(e)}var s=e(27),a="function"==typeof n.alloc&&"function"==typeof n.allocUnsafe&&"function"==typeof n.from;t.exports=o}).call(this,e(6).Buffer)},{27:27,6:6}],5:[function(e,t,n){(function(t){"use strict";var r=e(6),i=r.Buffer,o=r.SlowBuffer,s=r.kMaxLength||2147483647;n.alloc=function(e,t,n){if("function"==typeof i.alloc)return i.alloc(e,t,n);if("number"==typeof n)throw new TypeError("encoding must not be number");if("number"!=typeof e)throw new TypeError("size must be a number");if(e>s)throw new RangeError("size is too large");var r=n,o=t;void 0===o&&(r=void 0,o=0);var a=new i(e);if("string"==typeof o)for(var u=new i(o,r),f=u.length,c=-1;++c<e;)a[c]=u[c%f];else a.fill(o);return a},n.allocUnsafe=function(e){if("function"==typeof i.allocUnsafe)return i.allocUnsafe(e);if("number"!=typeof e)throw new TypeError("size must be a number");if(e>s)throw new RangeError("size is too large");return new i(e)},n.from=function(e,n,r){if("function"==typeof i.from&&(!t.Uint8Array||Uint8Array.from!==i.from))return i.from(e,n,r);if("number"==typeof e)throw new TypeError('"value" argument must not be a number');if("string"==typeof e)return new i(e,n);if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer){var o=n;if(1===arguments.length)return new i(e);void 0===o&&(o=0);var s=r;if(void 0===s&&(s=e.byteLength-o),o>=e.byteLength)throw new RangeError("'offset' is out of bounds");if(s>e.byteLength-o)throw new RangeError("'length' is out of bounds");return new i(e.slice(o,o+s))}if(i.isBuffer(e)){var a=new i(e.length);return e.copy(a,0,0,e.length),a}if(e){if(Array.isArray(e)||"undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return new i(e);if("Buffer"===e.type&&Array.isArray(e.data))return new i(e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")},n.allocUnsafeSlow=function(e){if("function"==typeof i.allocUnsafeSlow)return i.allocUnsafeSlow(e);if("number"!=typeof e)throw new TypeError("size must be a number");if(e>=s)throw new RangeError("size is too large");return new o(e)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{6:6}],6:[function(e,t,n){"use strict";function r(e){if(e>G)throw new RangeError("Invalid typed array length");var t=new Uint8Array(e);return t.__proto__=i.prototype,t}function i(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return u(e)}return o(e,t,n)}function o(e,t,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return e instanceof ArrayBuffer?l(e,t,n):"string"==typeof e?f(e,t):h(e)}function s(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function a(e,t,n){return s(e),e<=0?r(e):void 0!==t?"string"==typeof n?r(e).fill(t,n):r(e).fill(t):r(e)}function u(e){return s(e),r(e<0?0:0|d(e))}function f(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!i.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');var n=0|g(e,t),o=r(n),s=o.write(e,t);return s!==n&&(o=o.slice(0,s)),o}function c(e){for(var t=e.length<0?0:0|d(e.length),n=r(t),i=0;i<t;i+=1)n[i]=255&e[i];return n}function l(e,t,n){if(t<0||e.byteLength<t)throw new RangeError("'offset' is out of bounds");if(e.byteLength<t+(n||0))throw new RangeError("'length' is out of bounds");var r;return r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n),r.__proto__=i.prototype,r}function h(e){if(i.isBuffer(e)){var t=0|d(e.length),n=r(t);return 0===n.length?n:(e.copy(n,0,0,t),n)}if(e){if(J(e)||"length"in e)return"number"!=typeof e.length||V(e.length)?r(0):c(e);if("Buffer"===e.type&&Array.isArray(e.data))return c(e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function d(e){if(e>=G)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+G.toString(16)+" bytes");return 0|e}function p(e){return+e!=e&&(e=0),i.alloc(+e)}function g(e,t){if(i.isBuffer(e))return e.length;if(J(e)||e instanceof ArrayBuffer)return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return P(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return z(e).length;default:if(r)return P(e).length;t=(""+t).toLowerCase(),r=!0}}function v(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,t>>>=0,n<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return R(this,t,n);case"utf8":case"utf-8":return A(this,t,n);case"ascii":return O(this,t,n);case"latin1":case"binary":return L(this,t,n);case"base64":return B(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function y(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function _(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,V(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=i.from(t,r)),i.isBuffer(t))return 0===t.length?-1:m(e,t,n,r,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):m(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function m(e,t,n,r,i){function o(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}var s=1,a=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,n/=2}var f;if(i){var c=-1;for(f=n;f<a;f++)if(o(e,f)===o(t,c===-1?0:f-c)){if(c===-1&&(c=f),f-c+1===u)return c*s}else c!==-1&&(f-=f-c),c=-1}else for(n+u>a&&(n=a-u),f=n;f>=0;f--){for(var l=!0,h=0;h<u;h++)if(o(e,f+h)!==o(t,h)){l=!1;break}if(l)return f}return-1}function b(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;++s){var a=parseInt(t.substr(2*s,2),16);if(V(a))return s;e[n+s]=a}return s}function w(e,t,n,r){return K(P(t,e.length-n),e,n,r)}function E(e,t,n,r){return K(F(t),e,n,r)}function k(e,t,n,r){return E(e,t,n,r)}function S(e,t,n,r){return K(z(t),e,n,r)}function x(e,t,n,r){return K(W(t,e.length-n),e,n,r)}function B(e,t,n){return 0===t&&n===e.length?H.fromByteArray(e):H.fromByteArray(e.slice(t,n))}function A(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o=e[i],s=null,a=o>239?4:o>223?3:o>191?2:1;if(i+a<=n){var u,f,c,l;switch(a){case 1:o<128&&(s=o);break;case 2:u=e[i+1],128==(192&u)&&(l=(31&o)<<6|63&u)>127&&(s=l);break;case 3:u=e[i+1],f=e[i+2],128==(192&u)&&128==(192&f)&&(l=(15&o)<<12|(63&u)<<6|63&f)>2047&&(l<55296||l>57343)&&(s=l);break;case 4:u=e[i+1],f=e[i+2],c=e[i+3],128==(192&u)&&128==(192&f)&&128==(192&c)&&(l=(15&o)<<18|(63&u)<<12|(63&f)<<6|63&c)>65535&&l<1114112&&(s=l)}}null===s?(s=65533,a=1):s>65535&&(s-=65536,r.push(s>>>10&1023|55296),s=56320|1023&s),r.push(s),i+=a}return j(r)}function j(e){var t=e.length;if(t<=$)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=$));return n}function O(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function L(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function R(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=t;o<n;++o)i+=U(e[o]);return i}function C(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function T(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,n,r,o,s){if(!i.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<s)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function N(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function I(e,t,n,r,i){return t=+t,n>>>=0,i||N(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),Y.write(e,t,n,r,23,4),n+4}function D(e,t,n,r,i){return t=+t,n>>>=0,i||N(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),Y.write(e,t,n,r,52,8),n+8}function q(e){if(e=e.trim().replace(X,""),e.length<2)return"";for(;e.length%4!=0;)e+="=";return e}function U(e){return e<16?"0"+e.toString(16):e.toString(16)}function P(e,t){t=t||1/0;for(var n,r=e.length,i=null,o=[],s=0;s<r;++s){if((n=e.charCodeAt(s))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function F(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}function W(e,t){for(var n,r,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)n=e.charCodeAt(s),r=n>>8,i=n%256,o.push(i),o.push(r);return o}function z(e){return H.toByteArray(q(e))}function K(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function J(e){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(e)}function V(e){return e!==e}var H=e(2),Y=e(24);n.Buffer=i,n.SlowBuffer=p,n.INSPECT_MAX_BYTES=50;var G=2147483647;n.kMaxLength=G,i.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.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."),"undefined"!=typeof Symbol&&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(e,t,n){return o(e,t,n)},i.prototype.__proto__=Uint8Array.prototype,i.__proto__=Uint8Array,i.alloc=function(e,t,n){return a(e,t,n)},i.allocUnsafe=function(e){return u(e)},i.allocUnsafeSlow=function(e){return u(e)},i.isBuffer=function(e){return null!=e&&e._isBuffer===!0},i.compare=function(e,t){if(!i.isBuffer(e)||!i.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,o=0,s=Math.min(n,r);o<s;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},i.isEncoding=function(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!0;default:return!1}},i.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return i.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=i.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var s=e[n];if(!i.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,o),o+=s.length}return r},i.byteLength=g,i.prototype._isBuffer=!0,i.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)y(this,t,t+1);return this},i.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},i.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},i.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?A(this,0,e):v.apply(this,arguments)},i.prototype.equals=function(e){if(!i.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===i.compare(this,e)},i.prototype.inspect=function(){var e="",t=n.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},i.prototype.compare=function(e,t,n,r,o){if(!i.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,o>>>=0,this===e)return 0;for(var s=o-r,a=n-t,u=Math.min(s,a),f=this.slice(r,o),c=e.slice(t,n),l=0;l<u;++l)if(f[l]!==c[l]){s=f[l],a=c[l];break}return s<a?-1:a<s?1:0},i.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},i.prototype.indexOf=function(e,t,n){return _(this,e,t,n,!0)},i.prototype.lastIndexOf=function(e,t,n){return _(this,e,t,n,!1)},i.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return E(this,e,t,n);case"latin1":case"binary":return k(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var $=4096;i.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);var r=this.subarray(e,t);return r.__proto__=i.prototype,r},i.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||T(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},i.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||T(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},i.prototype.readUInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),this[e]},i.prototype.readUInt16LE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUInt16BE=function(e,t){return e>>>=0,t||T(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},i.prototype.readUInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||T(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return i*=128,r>=i&&(r-=Math.pow(2,8*t)),r},i.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||T(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},i.prototype.readInt8=function(e,t){return e>>>=0,t||T(e,1,this.length),128&this[e]?(255-this[e]+1)*-1:this[e]},i.prototype.readInt16LE=function(e,t){e>>>=0,t||T(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt16BE=function(e,t){e>>>=0,t||T(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},i.prototype.readInt32LE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,t){return e>>>=0,t||T(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readFloatLE=function(e,t){return e>>>=0,t||T(e,4,this.length),Y.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,t){return e>>>=0,t||T(e,4,this.length),Y.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,t){return e>>>=0,t||T(e,8,this.length),Y.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,t){return e>>>=0,t||T(e,8,this.length),Y.read(this,e,!1,52,8)},i.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){M(this,e,t,n,Math.pow(2,8*n)-1,0)}var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},i.prototype.writeUIntBE=function(e,t,n,r){if(e=+e,t>>>=0,n>>>=0,!r){M(this,e,t,n,Math.pow(2,8*n)-1,0)}var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},i.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,1,255,0),this[t]=255&e,t+1},i.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},i.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},i.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<n&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+n},i.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+n},i.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},i.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},i.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},i.prototype.writeFloatLE=function(e,t,n){return I(this,e,t,!0,n)},i.prototype.writeFloatBE=function(e,t,n){return I(this,e,t,!1,n)},i.prototype.writeDoubleLE=function(e,t,n){return D(this,e,t,!0,n)},i.prototype.writeDoubleBE=function(e,t,n){return D(this,e,t,!1,n)},i.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,o=r-n;if(this===e&&n<t&&t<r)for(i=o-1;i>=0;--i)e[i+t]=this[i+n];else if(o<1e3)for(i=0;i<o;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},i.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(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)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var s;if("number"==typeof e)for(s=t;s<n;++s)this[s]=e;else{var a=i.isBuffer(e)?e:new i(e,r),u=a.length;for(s=0;s<n-t;++s)this[s+t]=a[s%u]}return this};var X=/[^+\/0-9A-Za-z-_]/g},{2:2,24:24}],7:[function(e,t,n){(function(e){function t(e){return Array.isArray?Array.isArray(e):"[object Array]"===v(e)}function r(e){return"boolean"==typeof e}function i(e){return null===e}function o(e){return null==e}function s(e){return"number"==typeof e}function a(e){return"string"==typeof e}function u(e){return"symbol"==typeof e}function f(e){return void 0===e}function c(e){return"[object RegExp]"===v(e)}function l(e){return"object"==typeof e&&null!==e}function h(e){return"[object Date]"===v(e)}function d(e){return"[object Error]"===v(e)||e instanceof Error}function p(e){return"function"==typeof e}function g(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function v(e){return Object.prototype.toString.call(e)}n.isArray=t,n.isBoolean=r,n.isNull=i,n.isNullOrUndefined=o,n.isNumber=s,n.isString=a,n.isSymbol=u,n.isUndefined=f,n.isRegExp=c,n.isObject=l,n.isDate=h,n.isError=d,n.isFunction=p,n.isPrimitive=g,n.isBuffer=e.isBuffer}).call(this,{isBuffer:e(28)})},{28:28}],8:[function(e,t,n){function r(e){o.call(this,e),this._options=e,this._iterator=null,this._operations=[]}var i=e(104),o=e(13).AbstractIterator;i.inherits(r,o),r.prototype.setDb=function(e){var t=this._iterator=e.iterator(this._options);this._operations.forEach(function(e){t[e.method].apply(t,e.args)})},r.prototype._operation=function(e,t){if(this._iterator)return this._iterator[e].apply(this._iterator,t);this._operations.push({method:e,args:t})},"next end".split(" ").forEach(function(e){r.prototype["_"+e]=function(){this._operation(e,arguments)}}),t.exports=r},{104:104,13:13}],9:[function(e,t,n){(function(n,r){function i(e){s.call(this,"string"==typeof e?e:""),this._db=void 0,this._operations=[],this._iterators=[]}var o=e(104),s=e(13).AbstractLevelDOWN,a=e(8);o.inherits(i,s),i.prototype.setDb=function(e){this._db=e,this._operations.forEach(function(t){e[t.method].apply(e,t.args)}),this._iterators.forEach(function(t){t.setDb(e)})},i.prototype._open=function(e,t){return r.nextTick(t)},i.prototype._operation=function(e,t){if(this._db)return this._db[e].apply(this._db,t);this._operations.push({method:e,args:t})},"put get del batch approximateSize".split(" ").forEach(function(e){i.prototype["_"+e]=function(){this._operation(e,arguments)}}),i.prototype._isBuffer=function(e){return n.isBuffer(e)},i.prototype._iterator=function(e){if(this._db)return this._db.iterator.apply(this._db,arguments);var t=new a(e);return this._iterators.push(t),t},t.exports=i,t.exports.DeferredIterator=a}).call(this,{isBuffer:e(28)},e(63))},{104:104,13:13,28:28,63:63,8:8}],10:[function(e,t,n){(function(e){function n(e){this._db=e,this._operations=[],this._written=!1}n.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")},n.prototype.put=function(e,t){this._checkWritten();var n=this._db._checkKey(e,"key",this._db._isBuffer);if(n)throw n;return this._db._isBuffer(e)||(e=String(e)),this._db._isBuffer(t)||(t=String(t)),"function"==typeof this._put?this._put(e,t):this._operations.push({type:"put",key:e,value:t}),this},n.prototype.del=function(e){this._checkWritten();var t=this._db._checkKey(e,"key",this._db._isBuffer);if(t)throw t;return this._db._isBuffer(e)||(e=String(e)),"function"==typeof this._del?this._del(e):this._operations.push({type:"del",key:e}),this},n.prototype.clear=function(){return this._checkWritten(),this._operations=[],"function"==typeof this._clear&&this._clear(),this},n.prototype.write=function(t,n){if(this._checkWritten(),"function"==typeof t&&(n=t),"function"!=typeof n)throw new Error("write() requires a callback argument");return"object"!=typeof t&&(t={}),this._written=!0,"function"==typeof this._write?this._write(n):"function"==typeof this._db._batch?this._db._batch(this._operations,t,n):void e.nextTick(n)},t.exports=n}).call(this,e(63))},{63:63}],11:[function(e,t,n){(function(e){function n(e){this.db=e,this._ended=!1,this._nexting=!1}n.prototype.next=function(t){var n=this;if("function"!=typeof t)throw new Error("next() requires a callback argument");return n._ended?t(new Error("cannot call next() after end()")):n._nexting?t(new Error("cannot call next() before previous next() has completed")):(n._nexting=!0,"function"==typeof n._next?n._next(function(){n._nexting=!1,t.apply(null,arguments)}):void e.nextTick(function(){n._nexting=!1,t()}))},n.prototype.end=function(t){if("function"!=typeof t)throw new Error("end() requires a callback argument");return this._ended?t(new Error("end() already called on iterator")):(this._ended=!0,"function"==typeof this._end?this._end(t):void e.nextTick(t))},t.exports=n}).call(this,e(63))},{63:63}],12:[function(e,t,n){(function(n,r){function i(e){if(!arguments.length||void 0===e)throw new Error("constructor requires at least a location argument");if("string"!=typeof e)throw new Error("constructor requires a location string argument");this.location=e,this.status="new"}var o=e(15),s=e(11),a=e(10);i.prototype.open=function(e,t){var n=this,i=this.status;if("function"==typeof e&&(t=e),"function"!=typeof t)throw new Error("open() requires a callback argument");"object"!=typeof e&&(e={}),e.createIfMissing=0!=e.createIfMissing,e.errorIfExists=!!e.errorIfExists,"function"==typeof this._open?(this.status="opening",this._open(e,function(e){if(e)return n.status=i,t(e);n.status="open",t()})):(this.status="open",r.nextTick(t))},i.prototype.close=function(e){var t=this,n=this.status;if("function"!=typeof e)throw new Error("close() requires a callback argument");"function"==typeof this._close?(this.status="closing",this._close(function(r){if(r)return t.status=n,e(r);t.status="closed",e()})):(this.status="closed",r.nextTick(e))},i.prototype.get=function(e,t,n){var i;if("function"==typeof t&&(n=t),"function"!=typeof n)throw new Error("get() requires a callback argument");return(i=this._checkKey(e,"key",this._isBuffer))?n(i):(this._isBuffer(e)||(e=String(e)),"object"!=typeof t&&(t={}),t.asBuffer=0!=t.asBuffer,"function"==typeof this._get?this._get(e,t,n):void r.nextTick(function(){n(new Error("NotFound"))}))},i.prototype.put=function(e,t,n,i){var o;if("function"==typeof n&&(i=n),"function"!=typeof i)throw new Error("put() requires a callback argument");return(o=this._checkKey(e,"key",this._isBuffer))?i(o):(this._isBuffer(e)||(e=String(e)),null==t||this._isBuffer(t)||r.browser||(t=String(t)),"object"!=typeof n&&(n={}),"function"==typeof this._put?this._put(e,t,n,i):void r.nextTick(i))},i.prototype.del=function(e,t,n){var i;if("function"==typeof t&&(n=t),"function"!=typeof n)throw new Error("del() requires a callback argument");return(i=this._checkKey(e,"key",this._isBuffer))?n(i):(this._isBuffer(e)||(e=String(e)),"object"!=typeof t&&(t={}),"function"==typeof this._del?this._del(e,t,n):void r.nextTick(n))},i.prototype.batch=function(e,t,n){if(!arguments.length)return this._chainedBatch();if("function"==typeof t&&(n=t),"function"==typeof e&&(n=e),"function"!=typeof n)throw new Error("batch(array) requires a callback argument");if(!Array.isArray(e))return n(new Error("batch(array) requires an array argument"));t&&"object"==typeof t||(t={});for(var i,o,s=0,a=e.length;s<a;s++)if("object"==typeof(i=e[s])){if(o=this._checkKey(i.type,"type",this._isBuffer))return n(o);if(o=this._checkKey(i.key,"key",this._isBuffer))return n(o)}if("function"==typeof this._batch)return this._batch(e,t,n);r.nextTick(n)},i.prototype.approximateSize=function(e,t,n){if(null==e||null==t||"function"==typeof e||"function"==typeof t)throw new Error("approximateSize() requires valid `start`, `end` and `callback` arguments");if("function"!=typeof n)throw new Error("approximateSize() requires a callback argument");if(this._isBuffer(e)||(e=String(e)),this._isBuffer(t)||(t=String(t)),"function"==typeof this._approximateSize)return this._approximateSize(e,t,n);r.nextTick(function(){n(null,0)})},i.prototype._setupIteratorOptions=function(e){var t=this;return e=o(e),["start","end","gt","gte","lt","lte"].forEach(function(n){e[n]&&t._isBuffer(e[n])&&0===e[n].length&&delete e[n]}),e.reverse=!!e.reverse,e.keys=0!=e.keys,e.values=0!=e.values,e.limit="limit"in e?e.limit:-1,e.keyAsBuffer=0!=e.keyAsBuffer,e.valueAsBuffer=0!=e.valueAsBuffer,e},i.prototype.iterator=function(e){return"object"!=typeof e&&(e={}),e=this._setupIteratorOptions(e),
"function"==typeof this._iterator?this._iterator(e):new s(this)},i.prototype._chainedBatch=function(){return new a(this)},i.prototype._isBuffer=function(e){return n.isBuffer(e)},i.prototype._checkKey=function(e,t){if(null===e||void 0===e)return new Error(t+" cannot be `null` or `undefined`");if(this._isBuffer(e)){if(0===e.length)return new Error(t+" cannot be an empty Buffer")}else if(""===String(e))return new Error(t+" cannot be an empty String")},t.exports=i}).call(this,{isBuffer:e(28)},e(63))},{10:10,11:11,15:15,28:28,63:63}],13:[function(e,t,n){n.AbstractLevelDOWN=e(12),n.AbstractIterator=e(11),n.AbstractChainedBatch=e(10),n.isLevelDOWN=e(14)},{10:10,11:11,12:12,14:14}],14:[function(e,t,n){function r(e){return!(!e||"object"!=typeof e)&&Object.keys(i.prototype).filter(function(e){return"_"!=e[0]&&"approximateSize"!=e}).every(function(t){return"function"==typeof e[t]})}var i=e(12);t.exports=r},{12:12}],15:[function(e,t,n){function r(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var r in n)i.call(n,r)&&(e[r]=n[r])}return e}t.exports=r;var i=Object.prototype.hasOwnProperty},{}],16:[function(e,t,n){"use strict";function r(e){if(this._capacity=s(e),this._length=0,this._front=0,a(e)){for(var t=e.length,n=0;n<t;++n)this[n]=e[n];this._length=t}}function i(e,t,n,r,i){for(var o=0;o<i;++o)n[o+r]=e[o+t],e[o+t]=void 0}function o(e){return e>>>=0,e-=1,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,(e|=e>>16)+1}function s(e){if("number"!=typeof e){if(!a(e))return 16;e=e.length}return o(Math.min(Math.max(16,e),1073741824))}r.prototype.toArray=function(){for(var e=this._length,t=new Array(e),n=this._front,r=this._capacity,i=0;i<e;++i)t[i]=this[n+i&r-1];return t},r.prototype.push=function(e){var t=arguments.length,n=this._length;if(t>1){var r=this._capacity;if(n+t>r){for(var i=0;i<t;++i){this._checkCapacity(n+1);var o=this._front+n&this._capacity-1;this[o]=arguments[i],n++,this._length=n}return n}for(var o=this._front,i=0;i<t;++i)this[o+n&r-1]=arguments[i],o++;return this._length=n+t,n+t}if(0===t)return n;this._checkCapacity(n+1);var i=this._front+n&this._capacity-1;return this[i]=e,this._length=n+1,n+1},r.prototype.pop=function(){var e=this._length;if(0!==e){var t=this._front+e-1&this._capacity-1,n=this[t];return this[t]=void 0,this._length=e-1,n}},r.prototype.shift=function(){var e=this._length;if(0!==e){var t=this._front,n=this[t];return this[t]=void 0,this._front=t+1&this._capacity-1,this._length=e-1,n}},r.prototype.unshift=function(e){var t=this._length,n=arguments.length;if(n>1){var r=this._capacity;if(t+n>r){for(var i=n-1;i>=0;i--){this._checkCapacity(t+1);var r=this._capacity,o=(this._front-1&r-1^r)-r;this[o]=arguments[i],t++,this._length=t,this._front=o}return t}for(var s=this._front,i=n-1;i>=0;i--){var o=(s-1&r-1^r)-r;this[o]=arguments[i],s=o}return this._front=s,this._length=t+n,t+n}if(0===n)return t;this._checkCapacity(t+1);var r=this._capacity,i=(this._front-1&r-1^r)-r;return this[i]=e,this._length=t+1,this._front=i,t+1},r.prototype.peekBack=function(){var e=this._length;if(0!==e){return this[this._front+e-1&this._capacity-1]}},r.prototype.peekFront=function(){if(0!==this._length)return this[this._front]},r.prototype.get=function(e){var t=e;if(t===(0|t)){var n=this._length;if(t<0&&(t+=n),!(t<0||t>=n))return this[this._front+t&this._capacity-1]}},r.prototype.isEmpty=function(){return 0===this._length},r.prototype.clear=function(){for(var e=this._length,t=this._front,n=this._capacity,r=0;r<e;++r)this[t+r&n-1]=void 0;this._length=0,this._front=0},r.prototype.toString=function(){return this.toArray().toString()},r.prototype.valueOf=r.prototype.toString,r.prototype.removeFront=r.prototype.shift,r.prototype.removeBack=r.prototype.pop,r.prototype.insertFront=r.prototype.unshift,r.prototype.insertBack=r.prototype.push,r.prototype.enqueue=r.prototype.push,r.prototype.dequeue=r.prototype.shift,r.prototype.toJSON=r.prototype.toArray,Object.defineProperty(r.prototype,"length",{get:function(){return this._length},set:function(){throw new RangeError("")}}),r.prototype._checkCapacity=function(e){this._capacity<e&&this._resizeTo(s(1.5*this._capacity+16))},r.prototype._resizeTo=function(e){var t=this._capacity;this._capacity=e;var n=this._front,r=this._length;if(n+r>t){i(this,0,this,t,n+r&t-1)}};var a=Array.isArray;t.exports=r},{}],17:[function(e,t,n){function r(e,t,n){s(this,{type:e,name:e,cause:"string"!=typeof t?t:n,message:t&&"string"!=typeof t?t.message:t},"ewr")}function i(e,t){Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,arguments.callee),r.call(this,"CustomError",e,t)}function o(e,t,n){var o=function(n,i){r.call(this,t,n,i),"FilesystemError"==t&&(this.code=this.cause.code,this.path=this.cause.path,this.errno=this.cause.errno,this.message=(e.errno[this.cause.errno]?e.errno[this.cause.errno].description:this.cause.message)+(this.cause.path?" ["+this.cause.path+"]":"")),Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,arguments.callee)};return o.prototype=n?new n:new i,o}var s=e(19);i.prototype=new Error,t.exports=function(e){var t=function(t,n){return o(e,t,n)};return{CustomError:i,FilesystemError:t("FilesystemError"),createError:t}}},{19:19}],18:[function(e,t,n){var r=t.exports.all=[{errno:-2,code:"ENOENT",description:"no such file or directory"},{errno:-1,code:"UNKNOWN",description:"unknown error"},{errno:0,code:"OK",description:"success"},{errno:1,code:"EOF",description:"end of file"},{errno:2,code:"EADDRINFO",description:"getaddrinfo error"},{errno:3,code:"EACCES",description:"permission denied"},{errno:4,code:"EAGAIN",description:"resource temporarily unavailable"},{errno:5,code:"EADDRINUSE",description:"address already in use"},{errno:6,code:"EADDRNOTAVAIL",description:"address not available"},{errno:7,code:"EAFNOSUPPORT",description:"address family not supported"},{errno:8,code:"EALREADY",description:"connection already in progress"},{errno:9,code:"EBADF",description:"bad file descriptor"},{errno:10,code:"EBUSY",description:"resource busy or locked"},{errno:11,code:"ECONNABORTED",description:"software caused connection abort"},{errno:12,code:"ECONNREFUSED",description:"connection refused"},{errno:13,code:"ECONNRESET",description:"connection reset by peer"},{errno:14,code:"EDESTADDRREQ",description:"destination address required"},{errno:15,code:"EFAULT",description:"bad address in system call argument"},{errno:16,code:"EHOSTUNREACH",description:"host is unreachable"},{errno:17,code:"EINTR",description:"interrupted system call"},{errno:18,code:"EINVAL",description:"invalid argument"},{errno:19,code:"EISCONN",description:"socket is already connected"},{errno:20,code:"EMFILE",description:"too many open files"},{errno:21,code:"EMSGSIZE",description:"message too long"},{errno:22,code:"ENETDOWN",description:"network is down"},{errno:23,code:"ENETUNREACH",description:"network is unreachable"},{errno:24,code:"ENFILE",description:"file table overflow"},{errno:25,code:"ENOBUFS",description:"no buffer space available"},{errno:26,code:"ENOMEM",description:"not enough memory"},{errno:27,code:"ENOTDIR",description:"not a directory"},{errno:28,code:"EISDIR",description:"illegal operation on a directory"},{errno:29,code:"ENONET",description:"machine is not on the network"},{errno:31,code:"ENOTCONN",description:"socket is not connected"},{errno:32,code:"ENOTSOCK",description:"socket operation on non-socket"},{errno:33,code:"ENOTSUP",description:"operation not supported on socket"},{errno:34,code:"ENOENT",description:"no such file or directory"},{errno:35,code:"ENOSYS",description:"function not implemented"},{errno:36,code:"EPIPE",description:"broken pipe"},{errno:37,code:"EPROTO",description:"protocol error"},{errno:38,code:"EPROTONOSUPPORT",description:"protocol not supported"},{errno:39,code:"EPROTOTYPE",description:"protocol wrong type for socket"},{errno:40,code:"ETIMEDOUT",description:"connection timed out"},{errno:41,code:"ECHARSET",description:"invalid Unicode character"},{errno:42,code:"EAIFAMNOSUPPORT",description:"address family for hostname not supported"},{errno:44,code:"EAISERVICE",description:"servname not supported for ai_socktype"},{errno:45,code:"EAISOCKTYPE",description:"ai_socktype not supported"},{errno:46,code:"ESHUTDOWN",description:"cannot send after transport endpoint shutdown"},{errno:47,code:"EEXIST",description:"file already exists"},{errno:48,code:"ESRCH",description:"no such process"},{errno:49,code:"ENAMETOOLONG",description:"name too long"},{errno:50,code:"EPERM",description:"operation not permitted"},{errno:51,code:"ELOOP",description:"too many symbolic links encountered"},{errno:52,code:"EXDEV",description:"cross-device link not permitted"},{errno:53,code:"ENOTEMPTY",description:"directory not empty"},{errno:54,code:"ENOSPC",description:"no space left on device"},{errno:55,code:"EIO",description:"i/o error"},{errno:56,code:"EROFS",description:"read-only file system"},{errno:57,code:"ENODEV",description:"no such device"},{errno:58,code:"ESPIPE",description:"invalid seek"},{errno:59,code:"ECANCELED",description:"operation canceled"}];t.exports.errno={},t.exports.code={},r.forEach(function(e){t.exports.errno[e.errno]=e,t.exports.code[e.code]=e}),t.exports.custom=e(17)(t.exports),t.exports.create=t.exports.custom.createError},{17:17}],19:[function(e,t,n){!function(e,n,r){void 0!==t&&t.exports?t.exports=r():n.prr=r()}(0,this,function(){var e="function"==typeof Object.defineProperty?function(e,t,n){return Object.defineProperty(e,t,n),e}:function(e,t,n){return e[t]=n.value,e},t=function(e,t){var n="object"==typeof t,r=!n&&"string"==typeof t,i=function(e){return n?!!t[e]:!!r&&t.indexOf(e[0])>-1};return{enumerable:i("enumerable"),configurable:i("configurable"),writable:i("writable"),value:e}};return function(n,r,i,o){var s;if(o=t(i,o),"object"==typeof r){for(s in r)Object.hasOwnProperty.call(r,s)&&(o.value=r[s],e(n,s,o));return n}return e(n,r,o)}})},{}],20:[function(e,t,n){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(e){return"function"==typeof e}function o(e){return"number"==typeof e}function s(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(e){if(!o(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},r.prototype.emit=function(e){var t,n,r,o,u,f;if(this._events||(this._events={}),"error"===e&&(!this._events.error||s(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}if(n=this._events[e],a(n))return!1;if(i(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:o=Array.prototype.slice.call(arguments,1),n.apply(this,o)}else if(s(n))for(o=Array.prototype.slice.call(arguments,1),f=n.slice(),r=f.length,u=0;u<r;u++)f[u].apply(this,o);return!0},r.prototype.addListener=function(e,t){var n;if(!i(t))throw TypeError("listener must be a function");return this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,i(t.listener)?t.listener:t),this._events[e]?s(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,s(this._events[e])&&!this._events[e].warned&&(n=a(this._maxListeners)?r.defaultMaxListeners:this._maxListeners)&&n>0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(e,t){function n(){this.removeListener(e,n),r||(r=!0,t.apply(this,arguments))}if(!i(t))throw TypeError("listener must be a function");var r=!1;return n.listener=t,this.on(e,n),this},r.prototype.removeListener=function(e,t){var n,r,o,a;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],o=n.length,r=-1,n===t||i(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(s(n)){for(a=o;a-- >0;)if(n[a]===t||n[a].listener&&n[a].listener===t){r=a;break}if(r<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},r.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],i(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},r.prototype.listeners=function(e){return this._events&&this._events[e]?i(this._events[e])?[this._events[e]]:this._events[e].slice():[]},r.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(i(t))return 1;if(t)return t.length}return 0},r.listenerCount=function(e,t){return e.listenerCount(t)}},{}],21:[function(e,t,n){"use strict";function r(e,t,n,r,i,o){this._color=e,this.key=t,this.value=n,this.left=r,this.right=i,this._count=o}function i(e){return new r(e._color,e.key,e.value,e.left,e.right,e._count)}function o(e,t){return new r(e,t.key,t.value,t.left,t.right,t._count)}function s(e){e._count=1+(e.left?e.left._count:0)+(e.right?e.right._count:0)}function a(e,t){this._compare=e,this.root=t}function u(e,t){if(t.left){var n=u(e,t.left);if(n)return n}var n=e(t.key,t.value);return n||(t.right?u(e,t.right):void 0)}function f(e,t,n,r){if(t(e,r.key)<=0){if(r.left){var i=f(e,t,n,r.left);if(i)return i}var i=n(r.key,r.value);if(i)return i}if(r.right)return f(e,t,n,r.right)}function c(e,t,n,r,i){var o,s=n(e,i.key),a=n(t,i.key);if(s<=0){if(i.left&&(o=c(e,t,n,r,i.left)))return o;if(a>0&&(o=r(i.key,i.value)))return o}if(a>0&&i.right)return c(e,t,n,r,i.right)}function l(e,t){this.tree=e,this._stack=t}function h(e,t){e.key=t.key,e.value=t.value,e.left=t.left,e.right=t.right,e._color=t._color,e._count=t._count}function d(e){for(var t,n,r,a,u=e.length-1;u>=0;--u){if(t=e[u],0===u)return void(t._color=y);if(n=e[u-1],n.left===t){if(r=n.right,r.right&&r.right._color===v){if(r=n.right=i(r),a=r.right=i(r.right),n.right=r.left,r.left=n,r.right=a,r._color=n._color,t._color=y,n._color=y,a._color=y,s(n),s(r),u>1){var f=e[u-2];f.left===n?f.left=r:f.right=r}return void(e[u-1]=r)}if(r.left&&r.left._color===v){if(r=n.right=i(r),a=r.left=i(r.left),n.right=a.left,r.left=a.right,a.left=n,a.right=r,a._color=n._color,n._color=y,r._color=y,t._color=y,s(n),s(r),s(a),u>1){var f=e[u-2];f.left===n?f.left=a:f.right=a}return void(e[u-1]=a)}if(r._color===y){if(n._color===v)return n._color=y,void(n.right=o(v,r));n.right=o(v,r);continue}if(r=i(r),n.right=r.left,r.left=n,r._color=n._color,n._color=v,s(n),s(r),u>1){var f=e[u-2];f.left===n?f.left=r:f.right=r}e[u-1]=r,e[u]=n,u+1<e.length?e[u+1]=t:e.push(t),u+=2}else{if(r=n.left,r.left&&r.left._color===v){if(r=n.left=i(r),a=r.left=i(r.left),n.left=r.right,r.right=n,r.left=a,r._color=n._color,t._color=y,n._color=y,a._color=y,s(n),s(r),u>1){var f=e[u-2];f.right===n?f.right=r:f.left=r}return void(e[u-1]=r)}if(r.right&&r.right._color===v){if(r=n.left=i(r),a=r.right=i(r.right),n.left=a.right,r.right=a.left,a.right=n,a.left=r,a._color=n._color,n._color=y,r._color=y,t._color=y,s(n),s(r),s(a),u>1){var f=e[u-2];f.right===n?f.right=a:f.left=a}return void(e[u-1]=a)}if(r._color===y){if(n._color===v)return n._color=y,void(n.left=o(v,r));n.left=o(v,r);continue}if(r=i(r),n.left=r.right,r.right=n,r._color=n._color,n._color=v,s(n),s(r),u>1){var f=e[u-2];f.right===n?f.right=r:f.left=r}e[u-1]=r,e[u]=n,u+1<e.length?e[u+1]=t:e.push(t),u+=2}}}function p(e,t){return e<t?-1:e>t?1:0}function g(e){return new a(e||p,null)}t.exports=g;var v=0,y=1,_=a.prototype;Object.defineProperty(_,"keys",{get:function(){var e=[];return this.forEach(function(t,n){e.push(t)}),e}}),Object.defineProperty(_,"values",{get:function(){var e=[];return this.forEach(function(t,n){e.push(n)}),e}}),Object.defineProperty(_,"length",{get:function(){return this.root?this.root._count:0}}),_.insert=function(e,t){for(var n=this._compare,i=this.root,u=[],f=[];i;){var c=n(e,i.key);u.push(i),f.push(c),i=c<=0?i.left:i.right}u.push(new r(v,e,t,null,null,1));for(var l=u.length-2;l>=0;--l){var i=u[l];f[l]<=0?u[l]=new r(i._color,i.key,i.value,u[l+1],i.right,i._count+1):u[l]=new r(i._color,i.key,i.value,i.left,u[l+1],i._count+1)}for(var l=u.length-1;l>1;--l){var h=u[l-1],i=u[l];if(h._color===y||i._color===y)break;var d=u[l-2];if(d.left===h)if(h.left===i){var p=d.right;if(!p||p._color!==v){if(d._color=v,d.left=h.right,h._color=y,h.right=d,u[l-2]=h,u[l-1]=i,s(d),s(h),l>=3){var g=u[l-3];g.left===d?g.left=h:g.right=h}break}h._color=y,d.right=o(y,p),d._color=v,l-=1}else{var p=d.right;if(!p||p._color!==v){if(h.right=i.left,d._color=v,d.left=i.right,i._color=y,i.left=h,i.right=d,u[l-2]=i,u[l-1]=h,s(d),s(h),s(i),l>=3){var g=u[l-3];g.left===d?g.left=i:g.right=i}break}h._color=y,d.right=o(y,p),d._color=v,l-=1}else if(h.right===i){var p=d.left;if(!p||p._color!==v){if(d._color=v,d.right=h.left,h._color=y,h.left=d,u[l-2]=h,u[l-1]=i,s(d),s(h),l>=3){var g=u[l-3];g.right===d?g.right=h:g.left=h}break}h._color=y,d.left=o(y,p),d._color=v,l-=1}else{var p=d.left;if(!p||p._color!==v){if(h.left=i.right,d._color=v,d.right=i.left,i._color=y,i.right=h,i.left=d,u[l-2]=i,u[l-1]=h,s(d),s(h),s(i),l>=3){var g=u[l-3];g.right===d?g.right=i:g.left=i}break}h._color=y,d.left=o(y,p),d._color=v,l-=1}}return u[0]._color=y,new a(n,u[0])},_.forEach=function(e,t,n){if(this.root)switch(arguments.length){case 1:return u(e,this.root);case 2:return f(t,this._compare,e,this.root);case 3:if(this._compare(t,n)>=0)return;return c(t,n,this._compare,e,this.root)}},Object.defineProperty(_,"begin",{get:function(){for(var e=[],t=this.root;t;)e.push(t),t=t.left;return new l(this,e)}}),Object.defineProperty(_,"end",{get:function(){for(var e=[],t=this.root;t;)e.push(t),t=t.right;return new l(this,e)}}),_.at=function(e){if(e<0)return new l(this,[]);for(var t=this.root,n=[];;){if(n.push(t),t.left){if(e<t.left._count){t=t.left;continue}e-=t.left._count}if(!e)return new l(this,n);if(e-=1,!t.right)break;if(e>=t.right._count)break;t=t.right}return new l(this,[])},_.ge=function(e){for(var t=this._compare,n=this.root,r=[],i=0;n;){var o=t(e,n.key);r.push(n),o<=0&&(i=r.length),n=o<=0?n.left:n.right}return r.length=i,new l(this,r)},_.gt=function(e){for(var t=this._compare,n=this.root,r=[],i=0;n;){var o=t(e,n.key);r.push(n),o<0&&(i=r.length),n=o<0?n.left:n.right}return r.length=i,new l(this,r)},_.lt=function(e){for(var t=this._compare,n=this.root,r=[],i=0;n;){var o=t(e,n.key);r.push(n),o>0&&(i=r.length),n=o<=0?n.left:n.right}return r.length=i,new l(this,r)},_.le=function(e){for(var t=this._compare,n=this.root,r=[],i=0;n;){var o=t(e,n.key);r.push(n),o>=0&&(i=r.length),n=o<0?n.left:n.right}return r.length=i,new l(this,r)},_.find=function(e){for(var t=this._compare,n=this.root,r=[];n;){var i=t(e,n.key);if(r.push(n),0===i)return new l(this,r);n=i<=0?n.left:n.right}return new l(this,[])},_.remove=function(e){var t=this.find(e);return t?t.remove():this},_.get=function(e){for(var t=this._compare,n=this.root;n;){var r=t(e,n.key);if(0===r)return n.value;n=r<=0?n.left:n.right}};var m=l.prototype;Object.defineProperty(m,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(m,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),m.clone=function(){return new l(this.tree,this._stack.slice())},m.remove=function(){var e=this._stack;if(0===e.length)return this.tree;var t=new Array(e.length),n=e[e.length-1];t[t.length-1]=new r(n._color,n.key,n.value,n.left,n.right,n._count);for(var i=e.length-2;i>=0;--i){var n=e[i];n.left===e[i+1]?t[i]=new r(n._color,n.key,n.value,t[i+1],n.right,n._count):t[i]=new r(n._color,n.key,n.value,n.left,t[i+1],n._count)}if(n=t[t.length-1],n.left&&n.right){var o=t.length;for(n=n.left;n.right;)t.push(n),n=n.right;var s=t[o-1];t.push(new r(n._color,s.key,s.value,n.left,n.right,n._count)),t[o-1].key=n.key,t[o-1].value=n.value;for(var i=t.length-2;i>=o;--i)n=t[i],t[i]=new r(n._color,n.key,n.value,n.left,t[i+1],n._count);t[o-1].left=t[o]}if(n=t[t.length-1],n._color===v){var u=t[t.length-2];u.left===n?u.left=null:u.right===n&&(u.right=null),t.pop();for(var i=0;i<t.length;++i)t[i]._count--;return new a(this.tree._compare,t[0])}if(n.left||n.right){n.left?h(n,n.left):n.right&&h(n,n.right),n._color=y;for(var i=0;i<t.length-1;++i)t[i]._count--;return new a(this.tree._compare,t[0])}if(1===t.length)return new a(this.tree._compare,null);for(var i=0;i<t.length;++i)t[i]._count--;var f=t[t.length-2];return d(t),f.left===n?f.left=null:f.right=null,new a(this.tree._compare,t[0])},Object.defineProperty(m,"key",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(m,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(m,"index",{get:function(){var e=0,t=this._stack;if(0===t.length){var n=this.tree.root;return n?n._count:0}t[t.length-1].left&&(e=t[t.length-1].left._count);for(var r=t.length-2;r>=0;--r)t[r+1]===t[r].right&&(++e,t[r].left&&(e+=t[r].left._count));return e},enumerable:!0}),m.next=function(){var e=this._stack;if(0!==e.length){var t=e[e.length-1];if(t.right)for(t=t.right;t;)e.push(t),t=t.left;else for(e.pop();e.length>0&&e[e.length-1].right===t;)t=e[e.length-1],e.pop()}},Object.defineProperty(m,"hasNext",{get:function(){var e=this._stack;if(0===e.length)return!1;if(e[e.length-1].right)return!0;for(var t=e.length-1;t>0;--t)if(e[t-1].left===e[t])return!0;return!1}}),m.update=function(e){var t=this._stack;if(0===t.length)throw new Error("Can't update empty node!");var n=new Array(t.length),i=t[t.length-1];n[n.length-1]=new r(i._color,i.key,e,i.left,i.right,i._count);for(var o=t.length-2;o>=0;--o)i=t[o],i.left===t[o+1]?n[o]=new r(i._color,i.key,i.value,n[o+1],i.right,i._count):n[o]=new r(i._color,i.key,i.value,i.left,n[o+1],i._count);return new a(this.tree._compare,n[0])},m.prev=function(){var e=this._stack;if(0!==e.length){var t=e[e.length-1];if(t.left)for(t=t.left;t;)e.push(t),t=t.right;else for(e.pop();e.length>0&&e[e.length-1].left===t;)t=e[e.length-1],e.pop()}},Object.defineProperty(m,"hasPrev",{get:function(){var e=this._stack;if(0===e.length)return!1;if(e[e.length-1].left)return!0;for(var t=e.length-1;t>0;--t)if(e[t-1].right===e[t])return!0;return!1}})},{}],22:[function(e,t,n){!function(){"use strict";t.exports="function"==typeof Symbol&&"symbol"==typeof Symbol()}()},{}],23:[function(e,t,n){!function(){"use strict";t.exports=e(22)&&"symbol"==typeof Symbol.toStringTag}()},{22:22}],24:[function(e,t,n){n.read=function(e,t,n,r,i){var o,s,a=8*i-r-1,u=(1<<a)-1,f=u>>1,c=-7,l=n?i-1:0,h=n?-1:1,d=e[t+l];for(l+=h,o=d&(1<<-c)-1,d>>=-c,c+=a;c>0;o=256*o+e[t+l],l+=h,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=r;c>0;s=256*s+e[t+l],l+=h,c-=8);if(0===o)o=1-f;else{if(o===u)return s?0/0:1/0*(d?-1:1);s+=Math.pow(2,r),o-=f}return(d?-1:1)*s*Math.pow(2,o-r)},n.write=function(e,t,n,r,i,o){var s,a,u,f=8*o-i-1,c=(1<<f)-1,l=c>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||1/0===t?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),t+=s+l>=1?h/u:h*Math.pow(2,1-l),t*u>=2&&(s++,u/=2),s+l>=c?(a=0,s=c):s+l>=1?(a=(t*u-1)*Math.pow(2,i),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;e[n+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,f+=i;f>0;e[n+d]=255&s,d+=p,s/=256,f-=8);e[n+d-p]|=128*g}},{}],25:[function(e,t,n){(function(e){"use strict";function n(){c=!0;for(var e,t,n=l.length;n;){for(t=l,l=[],e=-1;++e<n;)t[e]();n=l.length}c=!1}function r(e){1!==l.push(e)||c||i()}var i,o=e.MutationObserver||e.WebKitMutationObserver;if(o){var s=0,a=new o(n),u=e.document.createTextNode("");a.observe(u,{characterData:!0}),i=function(){u.data=s=++s%2}}else if(e.setImmediate||void 0===e.MessageChannel)i="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){n(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(n,0)};else{var f=new e.MessageChannel;f.port1.onmessage=n,i=function(){f.port2.postMessage(0)}}var c,l=[];t.exports=r}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],26:[function(e,t,n){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},{}],27:[function(e,t,n){!function(){"use strict";var n,r,i,o=e(30),s="function"==typeof ArrayBuffer;if(s){if(e(23))try{i=Object.getOwnPropertyDescriptor(ArrayBuffer.prototype,"byteLength").get,i="number"==typeof i.call(new ArrayBuffer(4))&&i}catch(e){i=null}i||(n=e(100),r="[object ArrayBuffer]")}t.exports=function(e){if(!s||!o(e))return!1;if(!i)return n(e)===r;try{return"number"==typeof i.call(e)}catch(e){}return!1}}()},{100:100,23:23,30:30}],28:[function(e,t,n){function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function i(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&r(e.slice(0,0))}t.exports=function(e){return null!=e&&(r(e)||i(e)||!!e._isBuffer)}},{}],29:[function(e,t,n){!function(){"use strict";var n=Function.prototype.toString,r=e(100),i=e(23),o=e(31),s=function(e){try{return n.call(e),!0}catch(e){}return!1};t.exports=function(e){if(o(e))return!1;if(i)return s(e);var t=r(e);return"[object Function]"===t||"[object GeneratorFunction]"===t||"[object AsyncFunction]"===t}}()},{100:100,23:23,31:31}],30:[function(e,t,n){!function(){"use strict";var n=e(29),r=e(31);t.exports=function(e){return!r(e)&&!n(e)}}()},{29:29,31:31}],31:[function(e,t,n){"use strict";t.exports=function(e){return null==e||"function"!=typeof e&&"object"!=typeof e}},{}],32:[function(e,t,n){var r={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},{}],33:[function(e,t,n){function r(e){this.opts=e||{},this.encodings=i}var i=e(34);t.exports=r,r.prototype._encoding=function(e){return"string"==typeof e&&(e=i[e]),e||(e=i.id),e},r.prototype._keyEncoding=function(e,t){return this._encoding(t&&t.keyEncoding||e&&e.keyEncoding||this.opts.keyEncoding)},r.prototype._valueEncoding=function(e,t){return this._encoding(t&&(t.valueEncoding||t.encoding)||e&&(e.valueEncoding||e.encoding)||this.opts.valueEncoding||this.opts.encoding)},r.prototype.encodeKey=function(e,t,n){return this._keyEncoding(t,n).encode(e)},r.prototype.encodeValue=function(e,t,n){return this._valueEncoding(t,n).encode(e)},r.prototype.decodeKey=function(e,t){return this._keyEncoding(t).decode(e)},r.prototype.decodeValue=function(e,t){return this._valueEncoding(t).decode(e)},r.prototype.encodeBatch=function(e,t){var n=this;return e.map(function(e){var r={type:e.type,key:n.encodeKey(e.key,t,e)};return n.keyAsBuffer(t,e)&&(r.keyEncoding="binary"),e.prefix&&(r.prefix=e.prefix),"value"in e&&(r.value=n.encodeValue(e.value,t,e),n.valueAsBuffer(t,e)&&(r.valueEncoding="binary")),r})};var o=["lt","gt","lte","gte","start","end"];r.prototype.encodeLtgt=function(e){var t=this,n={};return Object.keys(e).forEach(function(r){n[r]=o.indexOf(r)>-1?t.encodeKey(e[r],e):e[r]}),n},r.prototype.createStreamDecoder=function(e){var t=this;return e.keys&&e.values?function(n,r){return{key:t.decodeKey(n,e),value:t.decodeValue(r,e)}}:e.keys?function(n){return t.decodeKey(n,e)}:e.values?function(n,r){return t.decodeValue(r,e)}:function(){}},r.prototype.keyAsBuffer=function(e){return this._keyEncoding(e).buffer},r.prototype.valueAsBuffer=function(e){return this._valueEncoding(e).buffer}},{34:34}],34:[function(e,t,n){(function(e){function t(e){return e}function r(t){return void 0===t||null===t||e.isBuffer(t)}n.utf8=n["utf-8"]={encode:function(e){return r(e)?e:String(e)},decode:function(e){return"string"==typeof e?e:String(e)},buffer:!1,type:"utf8"},n.json={encode:JSON.stringify,decode:JSON.parse,buffer:!1,type:"json"},n.binary={encode:function(t){return r(t)?t:new e(t)},decode:t,buffer:!0,type:"binary"},n.none={encode:function(e){return e},decode:function(e){return e},buffer:!1,type:"id"},n.id=n.none,["hex","ascii","base64","ucs2","ucs-2","utf16le","utf-16le"].forEach(function(t){n[t]={encode:function(n){return r(n)?n:new e(n,t)},decode:function(e){return e.toString(t)},buffer:!0,type:t}})}).call(this,e(6).Buffer)},{6:6}],35:[function(e,t,n){var r=e(18).create,i=r("LevelUPError"),o=r("NotFoundError",i);o.prototype.notFound=!0,o.prototype.status=404,t.exports={LevelUPError:i,InitializationError:r("InitializationError",i),OpenError:r("OpenError",i),ReadError:r("ReadError",i),WriteError:r("WriteError",i),NotFoundError:o,EncodingError:r("EncodingError",i)}},{18:18}],36:[function(e,t,n){function r(e,t){if(!(this instanceof r))return new r(e,t);o.call(this,s(t,{objectMode:!0})),this._iterator=e,this._destroyed=!1,this._decoder=null,t&&t.decoder&&(this._decoder=t.decoder),this.on("end",this._cleanup.bind(this))}var i=e(26),o=e(71).Readable,s=e(37),a=e(35).EncodingError;t.exports=r,i(r,o),r.prototype._read=function(){var e=this;this._destroyed||this._iterator.next(function(t,n,r){if(!e._destroyed){if(t)return e.emit("error",t);if(void 0===n&&void 0===r)e.push(null);else{if(!e._decoder)return e.push({key:n,value:r});try{var r=e._decoder(n,r)}catch(t){return e.emit("error",new a(t)),void e.push(null)}e.push(r)}}})},r.prototype.destroy=r.prototype._cleanup=function(){var e=this;this._destroyed||(this._destroyed=!0,this._iterator.end(function(t){if(t)return e.emit("error",t);e.emit("close")}))}},{26:26,35:35,37:37,71:71}],37:[function(e,t,n){arguments[4][15][0].apply(n,arguments)},{15:15}],38:[function(e,t,n){function r(e,t){this._levelup=e,this._codec=t,this.batch=e.db.batch(),this.ops=[],this.length=0}var i=e(40),o=e(35).WriteError,s=i.getOptions,a=i.dispatchError;r.prototype.put=function(e,t,n){n=s(n);var r=this._codec.encodeKey(e,n),i=this._codec.encodeValue(t,n);try{this.batch.put(r,i)}catch(e){throw new o(e)}return this.ops.push({type:"put",key:r,value:i}),this.length++,this},r.prototype.del=function(e,t){t=s(t);var n=this._codec.encodeKey(e,t);try{this.batch.del(n)}catch(e){throw new o(e)}return this.ops.push({type:"del",key:n}),this.length++,this},r.prototype.clear=function(){try{this.batch.clear()}catch(e){throw new o(e)}return this.ops=[],this.length=0,this},r.prototype.write=function(e){var t=this._levelup,n=this.ops;try{this.batch.write(function(r){if(r)return a(t,new o(r),e);t.emit("batch",n),e&&e()})}catch(e){throw new o(e)}},t.exports=r},{35:35,40:40}],39:[function(e,t,n){(function(n){function r(e,t){return"function"==typeof e?e:t}function i(e,t,r){if(!(this instanceof i))return new i(e,t,r);var o;if(f.call(this),this.setMaxListeners(1/0),"function"==typeof e?(t="object"==typeof t?t:{},t.db=e,e=null):"object"==typeof e&&"function"==typeof e.db&&(t=e,e=null),"function"==typeof t&&(r=t,t={}),(!t||"function"!=typeof t.db)&&"string"!=typeof e){if(o=new E("Must provide a location for the database"),r)return n.nextTick(function(){r(o)});throw o}t=B(t),this.options=h(A,t),this._codec=new x(this.options),this._status="new",
d(this,"location",e,"e"),this.open(r)}function o(e,t,n){if(!e._isOpening()&&!e.isOpen())return O(e,new _("Database is not open"),n),!0}function s(e,t,n){O(e,new y(t),n)}function a(e,t,n){O(e,new _(t),n)}function u(e){return function(t,n){j()[e](t,n||function(){})}}var f=e(20).EventEmitter,c=e(104).inherits,l=e(104).deprecate,h=e(43),d=e(64),p=e(9),g=e(36),v=e(35),y=v.WriteError,_=v.ReadError,m=v.NotFoundError,b=v.OpenError,w=v.EncodingError,E=v.InitializationError,k=e(40),S=e(38),x=e(41),B=k.getOptions,A=k.defaultOptions,j=k.getLevelDOWN,O=k.dispatchError;k.isDefined;c(i,f),i.prototype.open=function(e){var t,r,i=this;return this.isOpen()?(e&&n.nextTick(function(){e(null,i)}),this):this._isOpening()?e&&this.once("open",function(){e(null,i)}):(this.emit("opening"),this._status="opening",this.db=new p(this.location),t=this.options.db||j(),r=t(this.location),void r.open(this.options,function(t){if(t)return O(i,new b(t),e);i.db.setDb(r),i.db=r,i._status="open",e&&e(null,i),i.emit("open"),i.emit("ready")}))},i.prototype.close=function(e){var t=this;if(this.isOpen())this._status="closing",this.db.close(function(){t._status="closed",t.emit("closed"),e&&e.apply(null,arguments)}),this.emit("closing"),this.db=new p(this.location);else{if("closed"==this._status&&e)return n.nextTick(e);"closing"==this._status&&e?this.once("closed",e):this._isOpening()&&this.once("open",function(){t.close(e)})}},i.prototype.isOpen=function(){return"open"==this._status},i.prototype._isOpening=function(){return"opening"==this._status},i.prototype.isClosed=function(){return/^clos/.test(this._status)},i.prototype.get=function(e,t,n){var i,s=this;if(n=r(t,n),!o(this,t,n)){if(null===e||void 0===e||"function"!=typeof n)return a(this,"get() requires key and callback arguments",n);t=k.getOptions(t),i=this._codec.encodeKey(e,t),t.asBuffer=this._codec.valueAsBuffer(t),this.db.get(i,t,function(r,i){if(r)return r=/notfound/i.test(r)||r.notFound?new m("Key not found in database ["+e+"]",r):new _(r),O(s,r,n);if(n){try{i=s._codec.decodeValue(i,t)}catch(e){return n(new w(e))}n(null,i)}})}},i.prototype.put=function(e,t,n,i){var a,u,f=this;if(i=r(n,i),null===e||void 0===e)return s(this,"put() requires a key argument",i);o(this,n,i)||(n=B(n),a=this._codec.encodeKey(e,n),u=this._codec.encodeValue(t,n),this.db.put(a,u,n,function(n){if(n)return O(f,new y(n),i);f.emit("put",e,t),i&&i()}))},i.prototype.del=function(e,t,n){var i,a=this;if(n=r(t,n),null===e||void 0===e)return s(this,"del() requires a key argument",n);o(this,t,n)||(t=B(t),i=this._codec.encodeKey(e,t),this.db.del(i,t,function(t){if(t)return O(a,new y(t),n);a.emit("del",e),n&&n()}))},i.prototype.batch=function(e,t,n){var i,a=this;return arguments.length?(n=r(t,n),Array.isArray(e)?void(o(this,t,n)||(t=B(t),i=a._codec.encodeBatch(e,t),i=i.map(function(e){return e.type||void 0===e.key||void 0===e.value||(e.type="put"),e}),this.db.batch(i,t,function(t){if(t)return O(a,new y(t),n);a.emit("batch",e),n&&n()}))):s(this,"batch() requires an array argument",n)):new S(this,this._codec)},i.prototype.approximateSize=l(function(e,t,n,i){var o,s,u=this;if(i=r(n,i),n=B(n),null===e||void 0===e||null===t||void 0===t||"function"!=typeof i)return a(this,"approximateSize() requires start, end and callback arguments",i);o=this._codec.encodeKey(e,n),s=this._codec.encodeKey(t,n),this.db.approximateSize(o,s,function(e,t){if(e)return O(u,new b(e),i);i&&i(null,t)})},"db.approximateSize() is deprecated. Use db.db.approximateSize() instead"),i.prototype.readStream=i.prototype.createReadStream=function(e){return e=h({keys:!0,values:!0},this.options,e),e.keyEncoding=e.keyEncoding,e.valueEncoding=e.valueEncoding,e=this._codec.encodeLtgt(e),e.keyAsBuffer=this._codec.keyAsBuffer(e),e.valueAsBuffer=this._codec.valueAsBuffer(e),"number"!=typeof e.limit&&(e.limit=-1),new g(this.db.iterator(e),h(e,{decoder:this._codec.createStreamDecoder(e)}))},i.prototype.keyStream=i.prototype.createKeyStream=function(e){return this.createReadStream(h(e,{keys:!0,values:!1}))},i.prototype.valueStream=i.prototype.createValueStream=function(e){return this.createReadStream(h(e,{keys:!1,values:!0}))},i.prototype.toString=function(){return"LevelUP"},t.exports=i,t.exports.errors=e(35),t.exports.destroy=l(u("destroy"),"levelup.destroy() is deprecated. Use leveldown.destroy() instead"),t.exports.repair=l(u("repair"),"levelup.repair() is deprecated. Use leveldown.repair() instead")}).call(this,e(63))},{104:104,20:20,35:35,36:36,38:38,40:40,41:41,43:43,63:63,64:64,9:9}],40:[function(e,t,n){function r(e){return"string"==typeof e&&(e={valueEncoding:e}),"object"!=typeof e&&(e={}),e}function i(){if(u)return u;var t,n=e(44).devDependencies.leveldown;try{t=e(3).version}catch(e){throw o(e)}if(!e(3).satisfies(t,n))throw new f("Installed version of LevelDOWN ("+t+") does not match required version ("+n+")");try{return u=e(3)}catch(e){throw o(e)}}function o(e){return new f(c("Failed to require LevelDOWN (%s). Try `npm install leveldown` if it's missing",e.message))}function s(e,t,n){"function"==typeof n?n(t):e.emit("error",t)}function a(e){return void 0!==e}var u,f=(e(43),e(35).LevelUPError),c=e(104).format,l={createIfMissing:!0,errorIfExists:!1,keyEncoding:"utf8",valueEncoding:"utf8",compression:!0};t.exports={defaultOptions:l,getOptions:r,getLevelDOWN:i,dispatchError:s,isDefined:a}},{104:104,3:3,35:35,43:43,44:44}],41:[function(e,t,n){arguments[4][33][0].apply(n,arguments)},{33:33,42:42}],42:[function(e,t,n){(function(e){function t(e){return e}function r(t){return void 0===t||null===t||e.isBuffer(t)}n.utf8=n["utf-8"]={encode:function(e){return r(e)?e:String(e)},decode:t,buffer:!1,type:"utf8"},n.json={encode:JSON.stringify,decode:JSON.parse,buffer:!1,type:"json"},n.binary={encode:function(t){return r(t)?t:new e(t)},decode:t,buffer:!0,type:"binary"},n.id={encode:function(e){return e},decode:function(e){return e},buffer:!1,type:"id"},["hex","ascii","base64","ucs2","ucs-2","utf16le","utf-16le"].forEach(function(t){n[t]={encode:function(n){return r(n)?n:new e(n,t)},decode:function(e){return e.toString(t)},buffer:!0,type:t}})}).call(this,e(6).Buffer)},{6:6}],43:[function(e,t,n){arguments[4][15][0].apply(n,arguments)},{15:15}],44:[function(e,t,n){t.exports={_args:[[{raw:"levelup@1.3.5",scope:null,escapedName:"levelup",name:"levelup",rawSpec:"1.3.5",spec:"1.3.5",type:"version"},"/Users/garren/dev/pouchdb"]],_from:"levelup@1.3.5",_id:"levelup@1.3.5",_inCache:!0,_location:"/levelup",_nodeVersion:"7.4.0",_npmOperationalInternal:{host:"packages-18-east.internal.npmjs.com",tmp:"tmp/levelup-1.3.5.tgz_1488477248468_0.036320413229987025"},_npmUser:{name:"ralphtheninja",email:"ralphtheninja@riseup.net"},_npmVersion:"4.0.5",_phantomChildren:{},_requested:{raw:"levelup@1.3.5",scope:null,escapedName:"levelup",name:"levelup",rawSpec:"1.3.5",spec:"1.3.5",type:"version"},_requiredBy:["/"],_resolved:"https://registry.npmjs.org/levelup/-/levelup-1.3.5.tgz",_shasum:"fa80a972b74011f2537c8b65678bd8b5188e4e66",_shrinkwrap:null,_spec:"levelup@1.3.5",_where:"/Users/garren/dev/pouchdb",browser:{leveldown:!1,"leveldown/package":!1,semver:!1},bugs:{url:"https://github.com/level/levelup/issues"},contributors:[{name:"Rod Vagg",email:"r@va.gg",url:"https://github.com/rvagg"},{name:"John Chesley",email:"john@chesl.es",url:"https://github.com/chesles/"},{name:"Jake Verbaten",email:"raynos2@gmail.com",url:"https://github.com/raynos"},{name:"Dominic Tarr",email:"dominic.tarr@gmail.com",url:"https://github.com/dominictarr"},{name:"Max Ogden",email:"max@maxogden.com",url:"https://github.com/maxogden"},{name:"Lars-Magnus Skog",email:"ralphtheninja@riseup.net",url:"https://github.com/ralphtheninja"},{name:"David Björklund",email:"david.bjorklund@gmail.com",url:"https://github.com/kesla"},{name:"Julian Gruber",email:"julian@juliangruber.com",url:"https://github.com/juliangruber"},{name:"Paolo Fragomeni",email:"paolo@async.ly",url:"https://github.com/0x00a"},{name:"Anton Whalley",email:"anton.whalley@nearform.com",url:"https://github.com/No9"},{name:"Matteo Collina",email:"matteo.collina@gmail.com",url:"https://github.com/mcollina"},{name:"Pedro Teixeira",email:"pedro.teixeira@gmail.com",url:"https://github.com/pgte"},{name:"James Halliday",email:"mail@substack.net",url:"https://github.com/substack"},{name:"Jarrett Cruger",email:"jcrugzz@gmail.com",url:"https://github.com/jcrugzz"}],dependencies:{"deferred-leveldown":"~1.2.1","level-codec":"~6.1.0","level-errors":"~1.0.3","level-iterator-stream":"~1.3.0",prr:"~1.0.1",semver:"~5.1.0",xtend:"~4.0.0"},description:"Fast & simple storage - a Node.js-style LevelDB wrapper",devDependencies:{async:"~1.5.0",bustermove:"~1.0.0",delayed:"~1.0.1",faucet:"~0.0.1",leveldown:"^1.1.0",memdown:"~1.1.0","msgpack-js":"~0.3.0",referee:"~1.2.0",rimraf:"~2.4.3","slow-stream":"0.0.4",tap:"~2.3.1",tape:"~4.2.1"},directories:{},dist:{shasum:"fa80a972b74011f2537c8b65678bd8b5188e4e66",tarball:"https://registry.npmjs.org/levelup/-/levelup-1.3.5.tgz"},gitHead:"ed5a54202085839784f1189f1266e9c379d64081",homepage:"https://github.com/level/levelup",keywords:["leveldb","stream","database","db","store","storage","json"],license:"MIT",main:"lib/levelup.js",maintainers:[{name:"rvagg",email:"rod@vagg.org"},{name:"ralphtheninja",email:"ralphtheninja@riseup.net"},{name:"juliangruber",email:"julian@juliangruber.com"}],name:"levelup",optionalDependencies:{},readme:"ERROR: No README data found!",repository:{type:"git",url:"git+https://github.com/level/levelup.git"},scripts:{test:"tape test/*-test.js | faucet"},version:"1.3.5"}},{}],45:[function(e,t,n){"use strict";function r(){}function i(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=_,this.queue=[],this.outcome=void 0,e!==r&&u(this,e)}function o(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function s(e,t,n){p(function(){var r;try{r=t(n)}catch(t){return g.reject(e,t)}r===e?g.reject(e,new TypeError("Cannot resolve promise with itself")):g.resolve(e,r)})}function a(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function u(e,t){function n(t){o||(o=!0,g.reject(e,t))}function r(t){o||(o=!0,g.resolve(e,t))}function i(){t(r,n)}var o=!1,s=f(i);"error"===s.status&&n(s.value)}function f(e,t){var n={};try{n.value=e(t),n.status="success"}catch(e){n.status="error",n.value=e}return n}function c(e){return e instanceof this?e:g.resolve(new this(r),e)}function l(e){var t=new this(r);return g.reject(t,e)}function h(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,i=!1;if(!n)return this.resolve([]);for(var o=new Array(n),s=0,a=-1,u=new this(r);++a<n;)!function(e,r){function a(e){o[r]=e,++s!==n||i||(i=!0,g.resolve(u,o))}t.resolve(e).then(a,function(e){i||(i=!0,g.reject(u,e))})}(e[a],a);return u}function d(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,i=!1;if(!n)return this.resolve([]);for(var o=-1,s=new this(r);++o<n;)!function(e){t.resolve(e).then(function(e){i||(i=!0,g.resolve(s,e))},function(e){i||(i=!0,g.reject(s,e))})}(e[o]);return s}var p=e(25),g={},v=["REJECTED"],y=["FULFILLED"],_=["PENDING"];t.exports=i,i.prototype.catch=function(e){return this.then(null,e)},i.prototype.then=function(e,t){if("function"!=typeof e&&this.state===y||"function"!=typeof t&&this.state===v)return this;var n=new this.constructor(r);if(this.state!==_){s(n,this.state===y?e:t,this.outcome)}else this.queue.push(new o(n,e,t));return n},o.prototype.callFulfilled=function(e){g.resolve(this.promise,e)},o.prototype.otherCallFulfilled=function(e){s(this.promise,this.onFulfilled,e)},o.prototype.callRejected=function(e){g.reject(this.promise,e)},o.prototype.otherCallRejected=function(e){s(this.promise,this.onRejected,e)},g.resolve=function(e,t){var n=f(a,t);if("error"===n.status)return g.reject(e,n.value);var r=n.value;if(r)u(e,r);else{e.state=y,e.outcome=t;for(var i=-1,o=e.queue.length;++i<o;)e.queue[i].callFulfilled(t)}return e},g.reject=function(e,t){e.state=v,e.outcome=t;for(var n=-1,r=e.queue.length;++n<r;)e.queue[n].callRejected(t);return e},i.resolve=c,i.reject=l,i.all=h,i.race=d},{25:25}],46:[function(e,t,n){function r(e){return null===e}t.exports=r},{}],47:[function(e,t,n){(function(e){function t(e,t){return Object.hasOwnProperty.call(e,t)}function r(e){return void 0!==e&&""!==e}function t(e,t){return Object.hasOwnProperty.call(e,t)}function i(e,t){return Object.hasOwnProperty.call(e,t)&&t}function o(e){return e}n.compare=function(t,n){if(e.isBuffer(t)){for(var r=Math.min(t.length,n.length),i=0;i<r;i++){var o=t[i]-n[i];if(o)return o}return t.length-n.length}return t<n?-1:t>n?1:0};var s=n.lowerBoundKey=function(e){return i(e,"gt")||i(e,"gte")||i(e,"min")||(e.reverse?i(e,"end"):i(e,"start"))||void 0},a=n.lowerBound=function(e){var t=s(e);return t&&e[t]},u=n.lowerBoundInclusive=function(e){return!t(e,"gt")},f=n.upperBoundInclusive=function(e){return!t(e,"lt")},c=n.lowerBoundExclusive=function(e){return!u(e)},l=n.upperBoundExclusive=function(e){return!f(e)},h=n.upperBoundKey=function(e){return i(e,"lt")||i(e,"lte")||i(e,"max")||(e.reverse?i(e,"start"):i(e,"end"))||void 0},d=n.upperBound=function(e){var t=h(e);return t&&e[t]};n.toLtgt=function(e,r,i,s,a){r=r||{},i=i||o;var u=arguments.length>3,f=n.lowerBoundKey(e),c=n.upperBoundKey(e);return f?"gt"===f?r.gt=i(e.gt,!1):r.gte=i(e[f],!1):u&&(r.gte=i(s,!1)),c?"lt"===c?r.lt=i(e.lt,!0):r.lte=i(e[c],!0):u&&(r.lte=i(a,!0)),null!=e.reverse&&(r.reverse=!!e.reverse),t(r,"max")&&delete r.max,t(r,"min")&&delete r.min,t(r,"start")&&delete r.start,t(r,"end")&&delete r.end,r},n.contains=function(e,t,i){i=i||n.compare;var o=a(e);if(r(o)){var s=i(t,o);if(s<0||0===s&&c(e))return!1}var u=d(e);if(r(u)){var s=i(t,u);if(s>0||0===s&&l(e))return!1}return!0},n.filter=function(e,t){return function(r){return n.contains(e,r,t)}}}).call(this,{isBuffer:e(28)})},{28:28}],48:[function(e,t,n){t.exports=e(55)},{55:55}],49:[function(e,t,n){(function(n){function r(e){return h.compare(e,this._end)>0}function i(e){return h.compare(e,this._end)>=0}function o(e){return h.compare(e,this._end)<0}function s(e){return h.compare(e,this._end)<=0}function a(e,t){l.call(this,e),this._limit=t.limit,this._limit===-1&&(this._limit=1/0);var n=e._store[e._location];this.keyAsBuffer=t.keyAsBuffer!==!1,this.valueAsBuffer=t.valueAsBuffer!==!1,this._reverse=t.reverse,this._options=t,this._done=0,this._reverse?(this._incr="prev",this._start=h.upperBound(t),this._end=h.lowerBound(t),void 0===this._start?this._tree=n.end:h.upperBoundInclusive(t)?this._tree=n.le(this._start):this._tree=n.lt(this._start),this._end&&(h.lowerBoundInclusive(t)?this._test=i:this._test=r)):(this._incr="next",this._start=h.lowerBound(t),this._end=h.upperBound(t),void 0===this._start?this._tree=n.begin:h.lowerBoundInclusive(t)?this._tree=n.ge(this._start):this._tree=n.gt(this._start),this._end&&(h.upperBoundInclusive(t)?this._test=s:this._test=o))}function u(e){if(!(this instanceof u))return new u(e);c.call(this,"string"==typeof e?e:""),this._location=this.location?"$"+this.location:"_tree",this._store=this.location?p:this,this._store[this._location]=this._store[this._location]||d(h.compare)}var f=e(26),c=e(53).AbstractLevelDOWN,l=e(53).AbstractIterator,h=e(47),d=e(21),p={},g=e(48);f(a,l),a.prototype._next=function(e){var t,r;return this._done++>=this._limit?g(e):this._tree.valid?(t=this._tree.key,r=this._tree.value,this._test(t)?(this.keyAsBuffer&&(t=new n(t)),this.valueAsBuffer&&(r=new n(r)),this._tree[this._incr](),void g(function(){e(null,t,r)})):g(e)):g(e)},a.prototype._test=function(){return!0},u.clearGlobalStore=function(e){e?Object.keys(p).forEach(function(e){delete p[e]}):p={}},f(u,c),u.prototype._open=function(e,t){var n=this;g(function(){t(null,n)})},u.prototype._put=function(e,t,n,r){void 0!==t&&null!==t||(t="");var i=this._store[this._location].find(e);i.valid?this._store[this._location]=i.update(t):this._store[this._location]=this._store[this._location].insert(e,t),g(r)},u.prototype._get=function(e,t,r){var i=this._store[this._location].get(e);if(void 0===i)return g(function(){r(new Error("NotFound"))});t.asBuffer===!1||this._isBuffer(i)||(i=new n(String(i))),g(function(){r(null,i)})},u.prototype._del=function(e,t,n){this._store[this._location]=this._store[this._location].remove(e),g(n)},u.prototype._batch=function(e,t,n){for(var r,i,o,s=-1,a=e.length,u=this._store[this._location];++s<a;)e[s]&&(r=this._isBuffer(e[s].key)?e[s].key:String(e[s].key),o=u.find(r),"put"===e[s].type?(i=this._isBuffer(e[s].value)?e[s].value:String(e[s].value),u=o.valid?o.update(i):u.insert(r,i)):u=o.remove());this._store[this._location]=u,g(n)},u.prototype._iterator=function(e){return new a(this,e)},u.prototype._isBuffer=function(e){return n.isBuffer(e)},u.destroy=function(e,t){var n="$"+e;n in p&&delete p[n],g(t)},t.exports=u}).call(this,e(6).Buffer)},{21:21,26:26,47:47,48:48,53:53,6:6}],50:[function(e,t,n){arguments[4][10][0].apply(n,arguments)},{10:10,63:63}],51:[function(e,t,n){arguments[4][11][0].apply(n,arguments)},{11:11,63:63}],52:[function(e,t,n){arguments[4][12][0].apply(n,arguments)},{12:12,28:28,50:50,51:51,61:61,63:63}],53:[function(e,t,n){arguments[4][13][0].apply(n,arguments)},{13:13,50:50,51:51,52:52,54:54}],54:[function(e,t,n){arguments[4][14][0].apply(n,arguments)},{14:14,52:52}],55:[function(e,t,n){"use strict";function r(){a&&u&&(a=!1,u.length?h=u.concat(h):l=-1,h.length&&i())}function i(){if(!a){d=!1,a=!0;for(var e=h.length,t=setTimeout(r);e;){for(u=h,h=[];u&&++l<e;)u[l].run();l=-1,e=h.length}u=null,l=-1,a=!1,clearTimeout(t)}}function o(e,t){this.fun=e,this.array=t}function s(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];h.push(new o(e,t)),d||a||(d=!0,f())}for(var a,u,f,c=[e(58),e(57),e(56),e(59),e(60)],l=-1,h=[],d=!1,p=-1,g=c.length;++p<g;)if(c[p]&&c[p].test&&c[p].test()){f=c[p].install(i);break}o.prototype.run=function(){var e=this.fun,t=this.array;switch(t.length){case 0:return e();case 1:return e(t[0]);case 2:return e(t[0],t[1]);case 3:return e(t[0],t[1],t[2]);default:return e.apply(null,t)}},t.exports=s},{56:56,57:57,58:58,59:59,60:60}],56:[function(e,t,n){(function(e){"use strict";n.test=function(){return!e.setImmediate&&void 0!==e.MessageChannel},n.install=function(t){var n=new e.MessageChannel;return n.port1.onmessage=t,function(){n.port2.postMessage(0)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],57:[function(e,t,n){(function(e){"use strict";var t=e.MutationObserver||e.WebKitMutationObserver;n.test=function(){return t},n.install=function(n){var r=0,i=new t(n),o=e.document.createTextNode("");return i.observe(o,{characterData:!0}),function(){o.data=r=++r%2}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],58:[function(e,t,n){(function(e){"use strict";n.test=function(){return void 0!==e&&!e.browser},n.install=function(t){return function(){e.nextTick(t)}}}).call(this,e(63))},{63:63}],59:[function(e,t,n){(function(e){"use strict";n.test=function(){return"document"in e&&"onreadystatechange"in e.document.createElement("script")},n.install=function(t){return function(){var n=e.document.createElement("script");return n.onreadystatechange=function(){t(),n.onreadystatechange=null,n.parentNode.removeChild(n),n=null},e.document.documentElement.appendChild(n),t}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],60:[function(e,t,n){"use strict";n.test=function(){return!0},n.install=function(e){return function(){setTimeout(e,0)}}},{}],61:[function(e,t,n){arguments[4][15][0].apply(n,arguments)},{15:15}],62:[function(e,t,n){(function(e){"use strict";function n(t,n,r,i){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var o,s,a=arguments.length;switch(a){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick(function(){t.call(null,n)});case 3:return e.nextTick(function(){t.call(null,n,r)});case 4:return e.nextTick(function(){t.call(null,n,r,i)});default:for(o=new Array(a-1),s=0;s<o.length;)o[s++]=arguments[s];return e.nextTick(function(){t.apply(null,o)})}}!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports=n:t.exports=e.nextTick}).call(this,e(63))},{63:63}],63:[function(e,t,n){function r(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function o(e){if(l===setTimeout)return setTimeout(e,0);if((l===r||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function s(e){if(h===clearTimeout)return clearTimeout(e);if((h===i||!h)&&clearTimeout)return h=clearTimeout,clearTimeout(e);try{return h(e)}catch(t){try{return h.call(null,e)}catch(t){return h.call(this,e)}}}function a(){v&&p&&(v=!1,p.length?g=p.concat(g):y=-1,g.length&&u())}function u(){if(!v){var e=o(a);v=!0;for(var t=g.length;t;){for(p=g,g=[];++y<t;)p&&p[y].run();y=-1,t=g.length}p=null,v=!1,s(e)}}function f(e,t){this.fun=e,this.array=t}function c(){}var l,h,d=t.exports={};!function(){try{l="function"==typeof setTimeout?setTimeout:r}catch(e){l=r}try{h="function"==typeof clearTimeout?clearTimeout:i}catch(e){h=i}}();var p,g=[],v=!1,y=-1;d.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];g.push(new f(e,t)),1!==g.length||v||o(u)},f.prototype.run=function(){this.fun.apply(null,this.array)},d.title="browser",d.browser=!0,d.env={},d.argv=[],d.version="",d.versions={},d.on=c,d.addListener=c,d.once=c,d.off=c,d.removeListener=c,d.removeAllListeners=c,d.emit=c,d.binding=function(e){throw new Error("process.binding is not supported")},d.cwd=function(){return"/"},d.chdir=function(e){throw new Error("process.chdir is not supported")},d.umask=function(){return 0}},{}],64:[function(e,t,n){arguments[4][19][0].apply(n,arguments)},{19:19}],65:[function(e,t,n){(function(n){function r(e){if(!(this instanceof r))return new r(e);a.call(this,e),u.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",i)}function i(){this.allowHalfOpen||this._writableState.ended||n.nextTick(this.end.bind(this))}t.exports=r;var o=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t},s=e(7);s.inherits=e(26);var a=e(67),u=e(69);s.inherits(r,a),function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)}(o(u.prototype),function(e){r.prototype[e]||(r.prototype[e]=u.prototype[e])})}).call(this,e(63))},{26:26,63:63,67:67,69:69,7:7}],66:[function(e,t,n){function r(e){if(!(this instanceof r))return new r(e);i.call(this,e)}t.exports=r;var i=e(68),o=e(7);o.inherits=e(26),o.inherits(r,i),r.prototype._transform=function(e,t,n){n(null,e)}},{26:26,68:68,7:7}],67:[function(e,t,n){(function(n){function r(t,n){t=t||{};var r=t.highWaterMark;this.highWaterMark=r||0===r?r:16384,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=!1,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.calledRead=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.objectMode=!!t.objectMode,this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(j||(j=e(87).StringDecoder),this.decoder=new j(t.encoding),this.encoding=t.encoding)}function i(e){if(!(this instanceof i))return new i(e);this._readableState=new r(e,this),this.readable=!0,B.call(this)}function o(e,t,n,r,i){var o=f(t,n);if(o)e.emit("error",o);else if(null===n||void 0===n)t.reading=!1,t.ended||c(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!i){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&i){var a=new Error("stream.unshift() after end event");e.emit("error",a)}else!t.decoder||i||r||(n=t.decoder.write(n)),t.length+=t.objectMode?1:n.length,i?t.buffer.unshift(n):(t.reading=!1,t.buffer.push(n)),t.needReadable&&l(e),d(e,t);else i||(t.reading=!1);return s(t)}function s(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}function a(e){if(e>=O)e=O;else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}function u(e,t){return 0===t.length&&t.ended?0:t.objectMode?0===e?0:1:null===e||isNaN(e)?t.flowing&&t.buffer.length?t.buffer[0].length:t.length:e<=0?0:(e>t.highWaterMark&&(t.highWaterMark=a(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function f(e,t){var n=null;return S.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function c(e,t){if(t.decoder&&!t.ended){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.length>0?l(e):b(e)}function l(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,t.sync?n.nextTick(function(){h(e)}):h(e))}function h(e){e.emit("readable")}function d(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(function(){p(e,t)}))}function p(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function g(e){return function(){var t=e._readableState;0===--t.awaitDrain&&v(e)}}function v(e){function t(e,t,i){!1===e.write(n)&&r.awaitDrain++}var n,r=e._readableState;for(r.awaitDrain=0;r.pipesCount&&null!==(n=e.read());)if(1===r.pipesCount?t(r.pipes,0,null):w(r.pipes,t),e.emit("data",n),r.awaitDrain>0)return;if(0===r.pipesCount)return r.flowing=!1,void(x.listenerCount(e,"data")>0&&_(e));r.ranOut=!0}function y(){this._readableState.ranOut&&(this._readableState.ranOut=!1,v(this))}function _(e,t){if(e._readableState.flowing)throw new Error("Cannot switch to old mode now.");var r=t||!1,i=!1;e.readable=!0,e.pipe=B.prototype.pipe,e.on=e.addListener=B.prototype.on,e.on("readable",function(){i=!0;for(var t;!r&&null!==(t=e.read());)e.emit("data",t);null===t&&(i=!1,e._readableState.needReadable=!0)}),e.pause=function(){r=!0,this.emit("pause")},e.resume=function(){r=!1,i?n.nextTick(function(){e.emit("readable")}):this.read(0),this.emit("resume")},e.emit("readable")}function m(e,t){var n,r=t.buffer,i=t.length,o=!!t.decoder,s=!!t.objectMode;if(0===r.length)return null;if(0===i)n=null;else if(s)n=r.shift();else if(!e||e>=i)n=o?r.join(""):S.concat(r,i),r.length=0;else if(e<r[0].length){var a=r[0];n=a.slice(0,e),r[0]=a.slice(e)}else if(e===r[0].length)n=r.shift();else{n=o?"":new S(e);for(var u=0,f=0,c=r.length;f<c&&u<e;f++){var a=r[0],l=Math.min(e-u,a.length);o?n+=a.slice(0,l):a.copy(n,u,0,l),l<a.length?r[0]=a.slice(l):r.shift(),u+=l}}return n}function b(e){var t=e._readableState;if(t.length>0)throw new Error("endReadable called on non-empty stream");!t.endEmitted&&t.calledRead&&(t.ended=!0,n.nextTick(function(){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}))}function w(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)}function E(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}t.exports=i;var k=e(70),S=e(6).Buffer;i.ReadableState=r;var x=e(20).EventEmitter;x.listenerCount||(x.listenerCount=function(e,t){return e.listeners(t).length});var B=e(73),A=e(7);A.inherits=e(26);var j;A.inherits(i,B),i.prototype.push=function(e,t){var n=this._readableState;return"string"!=typeof e||n.objectMode||(t=t||n.defaultEncoding)!==n.encoding&&(e=new S(e,t),t=""),o(this,n,e,t,!1)},i.prototype.unshift=function(e){return o(this,this._readableState,e,"",!0)},i.prototype.setEncoding=function(t){j||(j=e(87).StringDecoder),this._readableState.decoder=new j(t),this._readableState.encoding=t};var O=8388608;i.prototype.read=function(e){var t=this._readableState;t.calledRead=!0;var n,r=e;if(("number"!=typeof e||e>0)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return l(this),null;if(0===(e=u(e,t))&&t.ended)return n=null,t.length>0&&t.decoder&&(n=m(e,t),t.length-=n.length),0===t.length&&b(this),n;var i=t.needReadable;return t.length-e<=t.highWaterMark&&(i=!0),(t.ended||t.reading)&&(i=!1),i&&(t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1),i&&!t.reading&&(e=u(r,t)),n=e>0?m(e,t):null,null===n&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),t.ended&&!t.endEmitted&&0===t.length&&b(this),n},i.prototype._read=function(e){this.emit("error",new Error("not implemented"))},i.prototype.pipe=function(e,t){function r(e){e===c&&o()}function i(){e.end()}function o(){e.removeListener("close",a),e.removeListener("finish",u),e.removeListener("drain",p),e.removeListener("error",s),e.removeListener("unpipe",r),c.removeListener("end",i),c.removeListener("end",o),e._writableState&&!e._writableState.needDrain||p()}function s(t){f(),e.removeListener("error",s),0===x.listenerCount(e,"error")&&e.emit("error",t)}function a(){e.removeListener("finish",u),f()}function u(){e.removeListener("close",a),f()}function f(){c.unpipe(e)}var c=this,l=this._readableState;switch(l.pipesCount){case 0:l.pipes=e;break;case 1:l.pipes=[l.pipes,e];break;default:l.pipes.push(e)}l.pipesCount+=1;var h=(!t||t.end!==!1)&&e!==n.stdout&&e!==n.stderr,d=h?i:o;l.endEmitted?n.nextTick(d):c.once("end",d),e.on("unpipe",r);var p=g(c);return e.on("drain",p),e._events&&e._events.error?k(e._events.error)?e._events.error.unshift(s):e._events.error=[s,e._events.error]:e.on("error",s),e.once("close",a),e.once("finish",u),e.emit("pipe",c),l.flowing||(this.on("readable",y),l.flowing=!0,n.nextTick(function(){v(c)})),e},i.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,this.removeListener("readable",y),t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,this.removeListener("readable",y),t.flowing=!1;for(var i=0;i<r;i++)n[i].emit("unpipe",this);return this}var i=E(t.pipes,e);return i===-1?this:(t.pipes.splice(i,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this),this)},i.prototype.on=function(e,t){var n=B.prototype.on.call(this,e,t);if("data"!==e||this._readableState.flowing||_(this),"readable"===e&&this.readable){var r=this._readableState;r.readableListening||(r.readableListening=!0,r.emittedReadable=!1,r.needReadable=!0,r.reading?r.length&&l(this):this.read(0))}return n},i.prototype.addListener=i.prototype.on,i.prototype.resume=function(){_(this),this.read(0),this.emit("resume")},i.prototype.pause=function(){_(this,!0),this.emit("pause")},i.prototype.wrap=function(e){var t=this._readableState,n=!1,r=this;e.on("end",function(){if(t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&r.push(e)}r.push(null)}),e.on("data",function(i){if(t.decoder&&(i=t.decoder.write(i)),(!t.objectMode||null!==i&&void 0!==i)&&(t.objectMode||i&&i.length)){r.push(i)||(n=!0,e.pause())}});for(var i in e)"function"==typeof e[i]&&void 0===this[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));return w(["error","close","destroy","pause","resume"],function(t){e.on(t,r.emit.bind(r,t))}),r._read=function(t){n&&(n=!1,e.resume())},r},i._fromList=m}).call(this,e(63))},{20:20,26:26,6:6,63:63,7:7,70:70,73:73,87:87}],68:[function(e,t,n){function r(e,t){this.afterTransform=function(e,n){return i(t,e,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null}function i(e,t,n){var r=e._transformState
;r.transforming=!1;var i=r.writecb;if(!i)return e.emit("error",new Error("no writecb in Transform class"));r.writechunk=null,r.writecb=null,null!==n&&void 0!==n&&e.push(n),i&&i(t);var o=e._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&e._read(o.highWaterMark)}function o(e){if(!(this instanceof o))return new o(e);a.call(this,e);var t=(this._transformState=new r(e,this),this);this._readableState.needReadable=!0,this._readableState.sync=!1,this.once("finish",function(){"function"==typeof this._flush?this._flush(function(e){s(t,e)}):s(t)})}function s(e,t){if(t)return e.emit("error",t);var n=e._writableState,r=(e._readableState,e._transformState);if(n.length)throw new Error("calling transform done when ws.length != 0");if(r.transforming)throw new Error("calling transform done when still transforming");return e.push(null)}t.exports=o;var a=e(65),u=e(7);u.inherits=e(26),u.inherits(o,a),o.prototype.push=function(e,t){return this._transformState.needTransform=!1,a.prototype.push.call(this,e,t)},o.prototype._transform=function(e,t,n){throw new Error("not implemented")},o.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},o.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0}},{26:26,65:65,7:7}],69:[function(e,t,n){(function(n){function r(e,t,n){this.chunk=e,this.encoding=t,this.callback=n}function i(e,t){e=e||{};var n=e.highWaterMark;this.highWaterMark=n||0===n?n:16384,this.objectMode=!!e.objectMode,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var r=e.decodeStrings===!1;this.decodeStrings=!r,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){d(t,e)},this.writecb=null,this.writelen=0,this.buffer=[],this.errorEmitted=!1}function o(t){var n=e(65);if(!(this instanceof o||this instanceof n))return new o(t);this._writableState=new i(t,this),this.writable=!0,E.call(this)}function s(e,t,r){var i=new Error("write after end");e.emit("error",i),n.nextTick(function(){r(i)})}function a(e,t,r,i){var o=!0;if(!b.isBuffer(r)&&"string"!=typeof r&&null!==r&&void 0!==r&&!t.objectMode){var s=new TypeError("Invalid non-string/buffer chunk");e.emit("error",s),n.nextTick(function(){i(s)}),o=!1}return o}function u(e,t,n){return e.objectMode||e.decodeStrings===!1||"string"!=typeof t||(t=new b(t,n)),t}function f(e,t,n,i,o){n=u(t,n,i),b.isBuffer(n)&&(i="buffer");var s=t.objectMode?1:n.length;t.length+=s;var a=t.length<t.highWaterMark;return a||(t.needDrain=!0),t.writing?t.buffer.push(new r(n,i,o)):c(e,t,s,n,i,o),a}function c(e,t,n,r,i,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,e._write(r,i,t.onwrite),t.sync=!1}function l(e,t,r,i,o){r?n.nextTick(function(){o(i)}):o(i),e._writableState.errorEmitted=!0,e.emit("error",i)}function h(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function d(e,t){var r=e._writableState,i=r.sync,o=r.writecb;if(h(r),t)l(e,r,i,t,o);else{var s=y(e,r);s||r.bufferProcessing||!r.buffer.length||v(e,r),i?n.nextTick(function(){p(e,r,s,o)}):p(e,r,s,o)}}function p(e,t,n,r){n||g(e,t),r(),n&&_(e,t)}function g(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function v(e,t){t.bufferProcessing=!0;for(var n=0;n<t.buffer.length;n++){var r=t.buffer[n],i=r.chunk,o=r.encoding,s=r.callback;if(c(e,t,t.objectMode?1:i.length,i,o,s),t.writing){n++;break}}t.bufferProcessing=!1,n<t.buffer.length?t.buffer=t.buffer.slice(n):t.buffer.length=0}function y(e,t){return t.ending&&0===t.length&&!t.finished&&!t.writing}function _(e,t){var n=y(e,t);return n&&(t.finished=!0,e.emit("finish")),n}function m(e,t,r){t.ending=!0,_(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r)),t.ended=!0}t.exports=o;var b=e(6).Buffer;o.WritableState=i;var w=e(7);w.inherits=e(26);var E=e(73);w.inherits(o,E),o.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe. Not readable."))},o.prototype.write=function(e,t,n){var r=this._writableState,i=!1;return"function"==typeof t&&(n=t,t=null),b.isBuffer(e)?t="buffer":t||(t=r.defaultEncoding),"function"!=typeof n&&(n=function(){}),r.ended?s(this,r,n):a(this,r,e,n)&&(i=f(this,r,e,t,n)),i},o.prototype._write=function(e,t,n){n(new Error("not implemented"))},o.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),void 0!==e&&null!==e&&this.write(e,t),r.ending||r.finished||m(this,r,n)}}).call(this,e(63))},{26:26,6:6,63:63,65:65,7:7,73:73}],70:[function(e,t,n){t.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},{}],71:[function(e,t,n){var r=e(73);n=t.exports=e(67),n.Stream=r,n.Readable=n,n.Writable=e(69),n.Duplex=e(65),n.Transform=e(68),n.PassThrough=e(66)},{65:65,66:66,67:67,68:68,69:69,73:73}],72:[function(e,t,n){!function(e){if("object"==typeof n)t.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var r;try{r=window}catch(e){r=self}r.SparkMD5=e()}}(function(e){"use strict";function t(e,t){var n=e[0],r=e[1],i=e[2],o=e[3];n+=(r&i|~r&o)+t[0]-680876936|0,n=(n<<7|n>>>25)+r|0,o+=(n&r|~n&i)+t[1]-389564586|0,o=(o<<12|o>>>20)+n|0,i+=(o&n|~o&r)+t[2]+606105819|0,i=(i<<17|i>>>15)+o|0,r+=(i&o|~i&n)+t[3]-1044525330|0,r=(r<<22|r>>>10)+i|0,n+=(r&i|~r&o)+t[4]-176418897|0,n=(n<<7|n>>>25)+r|0,o+=(n&r|~n&i)+t[5]+1200080426|0,o=(o<<12|o>>>20)+n|0,i+=(o&n|~o&r)+t[6]-1473231341|0,i=(i<<17|i>>>15)+o|0,r+=(i&o|~i&n)+t[7]-45705983|0,r=(r<<22|r>>>10)+i|0,n+=(r&i|~r&o)+t[8]+1770035416|0,n=(n<<7|n>>>25)+r|0,o+=(n&r|~n&i)+t[9]-1958414417|0,o=(o<<12|o>>>20)+n|0,i+=(o&n|~o&r)+t[10]-42063|0,i=(i<<17|i>>>15)+o|0,r+=(i&o|~i&n)+t[11]-1990404162|0,r=(r<<22|r>>>10)+i|0,n+=(r&i|~r&o)+t[12]+1804603682|0,n=(n<<7|n>>>25)+r|0,o+=(n&r|~n&i)+t[13]-40341101|0,o=(o<<12|o>>>20)+n|0,i+=(o&n|~o&r)+t[14]-1502002290|0,i=(i<<17|i>>>15)+o|0,r+=(i&o|~i&n)+t[15]+1236535329|0,r=(r<<22|r>>>10)+i|0,n+=(r&o|i&~o)+t[1]-165796510|0,n=(n<<5|n>>>27)+r|0,o+=(n&i|r&~i)+t[6]-1069501632|0,o=(o<<9|o>>>23)+n|0,i+=(o&r|n&~r)+t[11]+643717713|0,i=(i<<14|i>>>18)+o|0,r+=(i&n|o&~n)+t[0]-373897302|0,r=(r<<20|r>>>12)+i|0,n+=(r&o|i&~o)+t[5]-701558691|0,n=(n<<5|n>>>27)+r|0,o+=(n&i|r&~i)+t[10]+38016083|0,o=(o<<9|o>>>23)+n|0,i+=(o&r|n&~r)+t[15]-660478335|0,i=(i<<14|i>>>18)+o|0,r+=(i&n|o&~n)+t[4]-405537848|0,r=(r<<20|r>>>12)+i|0,n+=(r&o|i&~o)+t[9]+568446438|0,n=(n<<5|n>>>27)+r|0,o+=(n&i|r&~i)+t[14]-1019803690|0,o=(o<<9|o>>>23)+n|0,i+=(o&r|n&~r)+t[3]-187363961|0,i=(i<<14|i>>>18)+o|0,r+=(i&n|o&~n)+t[8]+1163531501|0,r=(r<<20|r>>>12)+i|0,n+=(r&o|i&~o)+t[13]-1444681467|0,n=(n<<5|n>>>27)+r|0,o+=(n&i|r&~i)+t[2]-51403784|0,o=(o<<9|o>>>23)+n|0,i+=(o&r|n&~r)+t[7]+1735328473|0,i=(i<<14|i>>>18)+o|0,r+=(i&n|o&~n)+t[12]-1926607734|0,r=(r<<20|r>>>12)+i|0,n+=(r^i^o)+t[5]-378558|0,n=(n<<4|n>>>28)+r|0,o+=(n^r^i)+t[8]-2022574463|0,o=(o<<11|o>>>21)+n|0,i+=(o^n^r)+t[11]+1839030562|0,i=(i<<16|i>>>16)+o|0,r+=(i^o^n)+t[14]-35309556|0,r=(r<<23|r>>>9)+i|0,n+=(r^i^o)+t[1]-1530992060|0,n=(n<<4|n>>>28)+r|0,o+=(n^r^i)+t[4]+1272893353|0,o=(o<<11|o>>>21)+n|0,i+=(o^n^r)+t[7]-155497632|0,i=(i<<16|i>>>16)+o|0,r+=(i^o^n)+t[10]-1094730640|0,r=(r<<23|r>>>9)+i|0,n+=(r^i^o)+t[13]+681279174|0,n=(n<<4|n>>>28)+r|0,o+=(n^r^i)+t[0]-358537222|0,o=(o<<11|o>>>21)+n|0,i+=(o^n^r)+t[3]-722521979|0,i=(i<<16|i>>>16)+o|0,r+=(i^o^n)+t[6]+76029189|0,r=(r<<23|r>>>9)+i|0,n+=(r^i^o)+t[9]-640364487|0,n=(n<<4|n>>>28)+r|0,o+=(n^r^i)+t[12]-421815835|0,o=(o<<11|o>>>21)+n|0,i+=(o^n^r)+t[15]+530742520|0,i=(i<<16|i>>>16)+o|0,r+=(i^o^n)+t[2]-995338651|0,r=(r<<23|r>>>9)+i|0,n+=(i^(r|~o))+t[0]-198630844|0,n=(n<<6|n>>>26)+r|0,o+=(r^(n|~i))+t[7]+1126891415|0,o=(o<<10|o>>>22)+n|0,i+=(n^(o|~r))+t[14]-1416354905|0,i=(i<<15|i>>>17)+o|0,r+=(o^(i|~n))+t[5]-57434055|0,r=(r<<21|r>>>11)+i|0,n+=(i^(r|~o))+t[12]+1700485571|0,n=(n<<6|n>>>26)+r|0,o+=(r^(n|~i))+t[3]-1894986606|0,o=(o<<10|o>>>22)+n|0,i+=(n^(o|~r))+t[10]-1051523|0,i=(i<<15|i>>>17)+o|0,r+=(o^(i|~n))+t[1]-2054922799|0,r=(r<<21|r>>>11)+i|0,n+=(i^(r|~o))+t[8]+1873313359|0,n=(n<<6|n>>>26)+r|0,o+=(r^(n|~i))+t[15]-30611744|0,o=(o<<10|o>>>22)+n|0,i+=(n^(o|~r))+t[6]-1560198380|0,i=(i<<15|i>>>17)+o|0,r+=(o^(i|~n))+t[13]+1309151649|0,r=(r<<21|r>>>11)+i|0,n+=(i^(r|~o))+t[4]-145523070|0,n=(n<<6|n>>>26)+r|0,o+=(r^(n|~i))+t[11]-1120210379|0,o=(o<<10|o>>>22)+n|0,i+=(n^(o|~r))+t[2]+718787259|0,i=(i<<15|i>>>17)+o|0,r+=(o^(i|~n))+t[9]-343485551|0,r=(r<<21|r>>>11)+i|0,e[0]=n+e[0]|0,e[1]=r+e[1]|0,e[2]=i+e[2]|0,e[3]=o+e[3]|0}function n(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return n}function r(e){var t,n=[];for(t=0;t<64;t+=4)n[t>>2]=e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24);return n}function i(e){var r,i,o,s,a,u,f=e.length,c=[1732584193,-271733879,-1732584194,271733878];for(r=64;r<=f;r+=64)t(c,n(e.substring(r-64,r)));for(e=e.substring(r-64),i=e.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],r=0;r<i;r+=1)o[r>>2]|=e.charCodeAt(r)<<(r%4<<3);if(o[r>>2]|=128<<(r%4<<3),r>55)for(t(c,o),r=0;r<16;r+=1)o[r]=0;return s=8*f,s=s.toString(16).match(/(.*?)(.{0,8})$/),a=parseInt(s[2],16),u=parseInt(s[1],16)||0,o[14]=a,o[15]=u,t(c,o),c}function o(e){var n,i,o,s,a,u,f=e.length,c=[1732584193,-271733879,-1732584194,271733878];for(n=64;n<=f;n+=64)t(c,r(e.subarray(n-64,n)));for(e=n-64<f?e.subarray(n-64):new Uint8Array(0),i=e.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],n=0;n<i;n+=1)o[n>>2]|=e[n]<<(n%4<<3);if(o[n>>2]|=128<<(n%4<<3),n>55)for(t(c,o),n=0;n<16;n+=1)o[n]=0;return s=8*f,s=s.toString(16).match(/(.*?)(.{0,8})$/),a=parseInt(s[2],16),u=parseInt(s[1],16)||0,o[14]=a,o[15]=u,t(c,o),c}function s(e){var t,n="";for(t=0;t<4;t+=1)n+=p[e>>8*t+4&15]+p[e>>8*t&15];return n}function a(e){var t;for(t=0;t<e.length;t+=1)e[t]=s(e[t]);return e.join("")}function u(e){return/[\u0080-\uFFFF]/.test(e)&&(e=unescape(encodeURIComponent(e))),e}function f(e,t){var n,r=e.length,i=new ArrayBuffer(r),o=new Uint8Array(i);for(n=0;n<r;n+=1)o[n]=e.charCodeAt(n);return t?o:i}function c(e){return String.fromCharCode.apply(null,new Uint8Array(e))}function l(e,t,n){var r=new Uint8Array(e.byteLength+t.byteLength);return r.set(new Uint8Array(e)),r.set(new Uint8Array(t),e.byteLength),n?r:r.buffer}function h(e){var t,n=[],r=e.length;for(t=0;t<r-1;t+=2)n.push(parseInt(e.substr(t,2),16));return String.fromCharCode.apply(String,n)}function d(){this.reset()}var p=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];return"5d41402abc4b2a76b9719d911017c592"!==a(i("hello"))&&function(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n},"undefined"==typeof ArrayBuffer||ArrayBuffer.prototype.slice||function(){function t(e,t){return e=0|e||0,e<0?Math.max(e+t,0):Math.min(e,t)}ArrayBuffer.prototype.slice=function(n,r){var i,o,s,a,u=this.byteLength,f=t(n,u),c=u;return r!==e&&(c=t(r,u)),f>c?new ArrayBuffer(0):(i=c-f,o=new ArrayBuffer(i),s=new Uint8Array(o),a=new Uint8Array(this,f,i),s.set(a),o)}}(),d.prototype.append=function(e){return this.appendBinary(u(e)),this},d.prototype.appendBinary=function(e){this._buff+=e,this._length+=e.length;var r,i=this._buff.length;for(r=64;r<=i;r+=64)t(this._hash,n(this._buff.substring(r-64,r)));return this._buff=this._buff.substring(r-64),this},d.prototype.end=function(e){var t,n,r=this._buff,i=r.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<i;t+=1)o[t>>2]|=r.charCodeAt(t)<<(t%4<<3);return this._finish(o,i),n=a(this._hash),e&&(n=h(n)),this.reset(),n},d.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},d.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash}},d.prototype.setState=function(e){return this._buff=e.buff,this._length=e.length,this._hash=e.hash,this},d.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},d.prototype._finish=function(e,n){var r,i,o,s=n;if(e[s>>2]|=128<<(s%4<<3),s>55)for(t(this._hash,e),s=0;s<16;s+=1)e[s]=0;r=8*this._length,r=r.toString(16).match(/(.*?)(.{0,8})$/),i=parseInt(r[2],16),o=parseInt(r[1],16)||0,e[14]=i,e[15]=o,t(this._hash,e)},d.hash=function(e,t){return d.hashBinary(u(e),t)},d.hashBinary=function(e,t){var n=i(e),r=a(n);return t?h(r):r},d.ArrayBuffer=function(){this.reset()},d.ArrayBuffer.prototype.append=function(e){var n,i=l(this._buff.buffer,e,!0),o=i.length;for(this._length+=e.byteLength,n=64;n<=o;n+=64)t(this._hash,r(i.subarray(n-64,n)));return this._buff=n-64<o?new Uint8Array(i.buffer.slice(n-64)):new Uint8Array(0),this},d.ArrayBuffer.prototype.end=function(e){var t,n,r=this._buff,i=r.length,o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<i;t+=1)o[t>>2]|=r[t]<<(t%4<<3);return this._finish(o,i),n=a(this._hash),e&&(n=h(n)),this.reset(),n},d.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},d.ArrayBuffer.prototype.getState=function(){var e=d.prototype.getState.call(this);return e.buff=c(e.buff),e},d.ArrayBuffer.prototype.setState=function(e){return e.buff=f(e.buff,!0),d.prototype.setState.call(this,e)},d.ArrayBuffer.prototype.destroy=d.prototype.destroy,d.ArrayBuffer.prototype._finish=d.prototype._finish,d.ArrayBuffer.hash=function(e,t){var n=o(new Uint8Array(e)),r=a(n);return t?h(r):r},d})},{}],73:[function(e,t,n){function r(){i.call(this)}t.exports=r;var i=e(20).EventEmitter;e(26)(r,i),r.Readable=e(83),r.Writable=e(85),r.Duplex=e(74),r.Transform=e(84),r.PassThrough=e(82),r.Stream=r,r.prototype.pipe=function(e,t){function n(t){e.writable&&!1===e.write(t)&&f.pause&&f.pause()}function r(){f.readable&&f.resume&&f.resume()}function o(){c||(c=!0,e.end())}function s(){c||(c=!0,"function"==typeof e.destroy&&e.destroy())}function a(e){if(u(),0===i.listenerCount(this,"error"))throw e}function u(){f.removeListener("data",n),e.removeListener("drain",r),f.removeListener("end",o),f.removeListener("close",s),f.removeListener("error",a),e.removeListener("error",a),f.removeListener("end",u),f.removeListener("close",u),e.removeListener("close",u)}var f=this;f.on("data",n),e.on("drain",r),e._isStdio||t&&t.end===!1||(f.on("end",o),f.on("close",s));var c=!1;return f.on("error",a),e.on("error",a),f.on("end",u),f.on("close",u),e.on("close",u),e.emit("pipe",f),e}},{20:20,26:26,74:74,82:82,83:83,84:84,85:85}],74:[function(e,t,n){t.exports=e(75)},{75:75}],75:[function(e,t,n){"use strict";function r(e){if(!(this instanceof r))return new r(e);f.call(this,e),c.call(this,e),e&&e.readable===!1&&(this.readable=!1),e&&e.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,e&&e.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",i)}function i(){this.allowHalfOpen||this._writableState.ended||a(o,this)}function o(e){e.end()}var s=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=r;var a=e(62),u=e(7);u.inherits=e(26);var f=e(77),c=e(79);u.inherits(r,f);for(var l=s(c.prototype),h=0;h<l.length;h++){var d=l[h];r.prototype[d]||(r.prototype[d]=c.prototype[d])}},{26:26,62:62,7:7,77:77,79:79}],76:[function(e,t,n){"use strict";function r(e){if(!(this instanceof r))return new r(e);i.call(this,e)}t.exports=r;var i=e(78),o=e(7);o.inherits=e(26),o.inherits(r,i),r.prototype._transform=function(e,t,n){n(null,e)}},{26:26,7:7,78:78}],77:[function(e,t,n){(function(n){"use strict";function r(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?L(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}function i(t,n){j=j||e(75),t=t||{},this.objectMode=!!t.objectMode,n instanceof j&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var r=t.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i,this.highWaterMark=~~this.highWaterMark,this.buffer=new U,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(q||(q=e(86).StringDecoder),this.decoder=new q(t.encoding),this.encoding=t.encoding)}function o(t){if(j=j||e(75),!(this instanceof o))return new o(t);this._readableState=new i(t,this),this.readable=!0,t&&"function"==typeof t.read&&(this._read=t.read),C.call(this)}function s(e,t,n,r,i){var o=c(t,n);if(o)e.emit("error",o);else if(null===n)t.reading=!1,l(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!i){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&i){var u=new Error("stream.unshift() after end event");e.emit("error",u)}else{var f;!t.decoder||i||r||(n=t.decoder.write(n),f=!t.objectMode&&0===n.length),i||(t.reading=!1),f||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,i?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&h(e))),p(e,t)}else i||(t.reading=!1);return a(t)}function a(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}function u(e){return e>=F?e=F:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function f(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=u(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function c(e,t){var n=null;return T.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function l(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,h(e)}}function h(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(D("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?O(d,e):d(e))}function d(e){D("emit readable"),e.emit("readable"),b(e)}function p(e,t){t.readingMore||(t.readingMore=!0,O(g,e,t))}function g(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(D("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function v(e){return function(){var t=e._readableState;D("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&R(e,"data")&&(t.flowing=!0,b(e))}}function y(e){D("readable nexttick read 0"),e.read(0)}function _(e,t){t.resumeScheduled||(t.resumeScheduled=!0,O(m,e,t))}function m(e,t){t.reading||(D("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),b(e),t.flowing&&!t.reading&&e.read(0)}function b(e){var t=e._readableState;for(D("flow",t.flowing);t.flowing&&null!==e.read(););}function w(e,t){if(0===t.length)return null;var n;return t.objectMode?n=t.buffer.shift():!e||e>=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=E(e,t.buffer,t.decoder),n}function E(e,t,n){var r;return e<t.head.data.length?(r=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):r=e===t.head.data.length?t.shift():n?k(e,t):S(e,t),r}function k(e,t){var n=t.head,r=1,i=n.data;for(e-=i.length;n=n.next;){var o=n.data,s=e>o.length?o.length:e;if(s===o.length?i+=o:i+=o.slice(0,e),0===(e-=s)){s===o.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(s));break}++r}return t.length-=r,i}function S(e,t){var n=M.allocUnsafe(e),r=t.head,i=1;for(r.data.copy(n),e-=r.data.length;r=r.next;){var o=r.data,s=e>o.length?o.length:e;if(o.copy(n,n.length-e,0,s),0===(e-=s)){s===o.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(s));break}++i}return t.length-=i,n}function x(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,O(B,t,e))}function B(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function A(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}t.exports=o;var j,O=e(62),L=e(32);o.ReadableState=i;var R=(e(20).EventEmitter,function(e,t){return e.listeners(t).length}),C=e(81),T=e(6).Buffer,M=e(5),N=e(7);N.inherits=e(26);var I=e(3),D=void 0;D=I&&I.debuglog?I.debuglog("stream"):function(){};var q,U=e(80);N.inherits(o,C);var P=["error","close","destroy","pause","resume"];o.prototype.push=function(e,t){var n=this._readableState;return n.objectMode||"string"!=typeof e||(t=t||n.defaultEncoding)!==n.encoding&&(e=M.from(e,t),t=""),s(this,n,e,t,!1)},o.prototype.unshift=function(e){return s(this,this._readableState,e,"",!0)},o.prototype.isPaused=function(){return this._readableState.flowing===!1},o.prototype.setEncoding=function(t){return q||(q=e(86).StringDecoder),this._readableState.decoder=new q(t),this._readableState.encoding=t,this};var F=8388608;o.prototype.read=function(e){D("read",e),e=parseInt(e,10);var t=this._readableState,n=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return D("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?x(this):h(this),null;if(0===(e=f(e,t))&&t.ended)return 0===t.length&&x(this),null;var r=t.needReadable;D("need readable",r),(0===t.length||t.length-e<t.highWaterMark)&&(r=!0,D("length less than watermark",r)),t.ended||t.reading?(r=!1,D("reading or ended",r)):r&&(D("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=f(n,t)));var i;return i=e>0?w(e,t):null,null===i?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&x(this)),null!==i&&this.emit("data",i),i},o.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},o.prototype.pipe=function(e,t){function i(e){D("onunpipe"),e===h&&s()}function o(){D("onend"),e.end()}function s(){D("cleanup"),e.removeListener("close",f),e.removeListener("finish",c),e.removeListener("drain",y),e.removeListener("error",u),e.removeListener("unpipe",i),h.removeListener("end",o),h.removeListener("end",s),h.removeListener("data",a),_=!0,!d.awaitDrain||e._writableState&&!e._writableState.needDrain||y()}function a(t){D("ondata"),m=!1,!1!==e.write(t)||m||((1===d.pipesCount&&d.pipes===e||d.pipesCount>1&&A(d.pipes,e)!==-1)&&!_&&(D("false write response, pause",h._readableState.awaitDrain),h._readableState.awaitDrain++,m=!0),h.pause())}function u(t){D("onerror",t),l(),e.removeListener("error",u),0===R(e,"error")&&e.emit("error",t)}function f(){e.removeListener("finish",c),l()}function c(){D("onfinish"),e.removeListener("close",f),l()}function l(){D("unpipe"),h.unpipe(e)}var h=this,d=this._readableState;switch(d.pipesCount){case 0:d.pipes=e;break;case 1:d.pipes=[d.pipes,e];break;default:d.pipes.push(e)}d.pipesCount+=1,D("pipe count=%d opts=%j",d.pipesCount,t);var p=(!t||t.end!==!1)&&e!==n.stdout&&e!==n.stderr,g=p?o:s;d.endEmitted?O(g):h.once("end",g),e.on("unpipe",i);var y=v(h);e.on("drain",y);var _=!1,m=!1;return h.on("data",a),r(e,"error",u),e.once("close",f),e.once("finish",c),e.emit("pipe",h),d.flowing||(D("pipe resume"),h.resume()),e},o.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i<r;i++)n[i].emit("unpipe",this);return this}var o=A(t.pipes,e);return o===-1?this:(t.pipes.splice(o,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this),this)},o.prototype.on=function(e,t){var n=C.prototype.on.call(this,e,t);if("data"===e)this._readableState.flowing!==!1&&this.resume();else if("readable"===e){var r=this._readableState;r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.emittedReadable=!1,r.reading?r.length&&h(this):O(y,this))}return n},o.prototype.addListener=o.prototype.on,o.prototype.resume=function(){var e=this._readableState;return e.flowing||(D("resume"),e.flowing=!0,_(this,e)),this},o.prototype.pause=function(){return D("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(D("pause"),this._readableState.flowing=!1,this.emit("pause")),this},o.prototype.wrap=function(e){var t=this._readableState,n=!1,r=this;e.on("end",function(){if(D("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&r.push(e)}r.push(null)}),e.on("data",function(i){if(D("wrapped data"),t.decoder&&(i=t.decoder.write(i)),(!t.objectMode||null!==i&&void 0!==i)&&(t.objectMode||i&&i.length)){r.push(i)||(n=!0,e.pause())}});for(var i in e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<P.length;o++)e.on(P[o],r.emit.bind(r,P[o]));return r._read=function(t){D("wrapped _read",t),n&&(n=!1,e.resume())},r},o._fromList=w}).call(this,e(63))},{20:20,26:26,3:3,32:32,5:5,6:6,62:62,63:63,7:7,75:75,80:80,81:81,86:86}],78:[function(e,t,n){"use strict";function r(e){this.afterTransform=function(t,n){return i(e,t,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function i(e,t,n){var r=e._transformState;r.transforming=!1;var i=r.writecb;if(!i)return e.emit("error",new Error("no writecb in Transform class"));r.writechunk=null,r.writecb=null,null!==n&&void 0!==n&&e.push(n),i(t);var o=e._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&e._read(o.highWaterMark)}function o(e){if(!(this instanceof o))return new o(e);a.call(this,e),this._transformState=new r(this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.once("prefinish",function(){"function"==typeof this._flush?this._flush(function(e,n){s(t,e,n)}):s(t)})}function s(e,t,n){if(t)return e.emit("error",t);null!==n&&void 0!==n&&e.push(n);var r=e._writableState,i=e._transformState;if(r.length)throw new Error("Calling transform done when ws.length != 0");if(i.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}t.exports=o;var a=e(75),u=e(7);u.inherits=e(26),u.inherits(o,a),o.prototype.push=function(e,t){return this._transformState.needTransform=!1,a.prototype.push.call(this,e,t)},o.prototype._transform=function(e,t,n){throw new Error("_transform() is not implemented")},o.prototype._write=function(e,t,n){var r=this._transformState;if(r.writecb=n,r.writechunk=e,r.writeencoding=t,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},o.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0}},{26:26,7:7,75:75}],79:[function(e,t,n){(function(n){"use strict";function r(){}function i(e,t,n){this.chunk=e,this.encoding=t,this.callback=n,this.next=null}function o(t,n){k=k||e(75),t=t||{},this.objectMode=!!t.objectMode,n instanceof k&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var r=t.highWaterMark,i=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i,this.highWaterMark=~~this.highWaterMark,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var o=t.decodeStrings===!1;this.decodeStrings=!o,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){p(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new E(this)}function s(t){if(k=k||e(75),!(R.call(s,this)||this instanceof k))return new s(t);this._writableState=new o(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev)),j.call(this)}function a(e,t){var n=new Error("write after end");e.emit("error",n),S(t,n)}function u(e,t,n,r){var i=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),S(r,o),i=!1),i}function f(e,t,n){return e.objectMode||e.decodeStrings===!1||"string"!=typeof t||(t=L.from(t,n)),t}function c(e,t,n,r,o,s){n||(r=f(t,r,o),O.isBuffer(r)&&(o="buffer"));var a=t.objectMode?1:r.length;t.length+=a;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest=new i(r,o,s),c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else l(e,t,!1,a,r,o,s);return u}function l(e,t,n,r,i,o,s){t.writelen=r,t.writecb=s,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function h(e,t,n,r,i){--t.pendingcb,n?S(i,r):i(r),e._writableState.errorEmitted=!0,e.emit("error",r)}function d(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function p(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(d(n),t)h(e,n,r,t,i);else{var o=_(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||y(e,n),r?x(g,e,n,o,i):g(e,n,o,i)}}function g(e,t,n,r){n||v(e,t),t.pendingcb--,r(),b(e,t)}function v(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function y(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),o=t.corkedRequestsFree;o.entry=n;for(var s=0;n;)i[s]=n,n=n.next,s+=1;l(e,t,!0,t.length,i,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new E(t)}else{for(;n;){var a=n.chunk,u=n.encoding,f=n.callback;if(l(e,t,!1,t.objectMode?1:a.length,a,u,f),n=n.next,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequestCount=0,t.bufferedRequest=n,t.bufferProcessing=!1}function _(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function m(e,t){t.prefinished||(t.prefinished=!0,e.emit("prefinish"))}function b(e,t){var n=_(t);return n&&(0===t.pendingcb?(m(e,t),t.finished=!0,e.emit("finish")):m(e,t)),n}function w(e,t,n){t.ending=!0,b(e,t),n&&(t.finished?S(n):e.once("finish",n)),t.ended=!0,e.writable=!1}function E(e){var t=this;this.next=null,this.entry=null,this.finish=function(n){var r=t.entry;for(t.entry=null;r;){var i=r.callback;e.pendingcb--,i(n),r=r.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}}t.exports=s;var k,S=e(62),x=!n.browser&&["v0.10","v0.9."].indexOf(n.version.slice(0,5))>-1?setImmediate:S;s.WritableState=o;var B=e(7);B.inherits=e(26);var A={deprecate:e(101)},j=e(81),O=e(6).Buffer,L=e(5);B.inherits(s,j),o.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(o.prototype,"buffer",{get:A.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(e){}}();var R;"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(R=Function.prototype[Symbol.hasInstance],Object.defineProperty(s,Symbol.hasInstance,{value:function(e){return!!R.call(this,e)||e&&e._writableState instanceof o}})):R=function(e){return e instanceof this},s.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},s.prototype.write=function(e,t,n){var i=this._writableState,o=!1,s=O.isBuffer(e)
;return"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=r),i.ended?a(this,n):(s||u(this,i,e,n))&&(i.pendingcb++,o=c(this,i,s,e,t,n)),o},s.prototype.cork=function(){this._writableState.corked++},s.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||y(this,e))},s.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},s.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},s.prototype._writev=null,s.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!==e&&void 0!==e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||w(this,r,n)}}).call(this,e(63))},{101:101,26:26,5:5,6:6,62:62,63:63,7:7,75:75,81:81}],80:[function(e,t,n){"use strict";function r(){this.head=null,this.tail=null,this.length=0}var i=(e(6).Buffer,e(5));t.exports=r,r.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},r.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},r.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},r.prototype.clear=function(){this.head=this.tail=null,this.length=0},r.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},r.prototype.concat=function(e){if(0===this.length)return i.alloc(0);if(1===this.length)return this.head.data;for(var t=i.allocUnsafe(e>>>0),n=this.head,r=0;n;)n.data.copy(t,r),r+=n.data.length,n=n.next;return t}},{5:5,6:6}],81:[function(e,t,n){t.exports=e(20).EventEmitter},{20:20}],82:[function(e,t,n){t.exports=e(83).PassThrough},{83:83}],83:[function(e,t,n){n=t.exports=e(77),n.Stream=n,n.Readable=n,n.Writable=e(79),n.Duplex=e(75),n.Transform=e(78),n.PassThrough=e(76)},{75:75,76:76,77:77,78:78,79:79}],84:[function(e,t,n){t.exports=e(83).Transform},{83:83}],85:[function(e,t,n){t.exports=e(79)},{79:79}],86:[function(e,t,n){"use strict";function r(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function i(e){var t=r(e);if("string"!=typeof t&&(_.isEncoding===b||!b(e)))throw new Error("Unknown encoding: "+e);return t||e}function o(e){this.encoding=i(e);var t;switch(this.encoding){case"utf16le":this.text=h,this.end=d,t=4;break;case"utf8":this.fillLast=f,t=4;break;case"base64":this.text=p,this.end=g,t=3;break;default:return this.write=v,void(this.end=y)}this.lastNeed=0,this.lastTotal=0,this.lastChar=m.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:-1}function a(e,t,n){var r=t.length-1;if(r<n)return 0;var i=s(t[r]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--r<n?0:(i=s(t[r]))>=0?(i>0&&(e.lastNeed=i-2),i):--r<n?0:(i=s(t[r]),i>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0)}function u(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�".repeat(n);if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�".repeat(n+1);if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�".repeat(n+2)}}function f(e){var t=this.lastTotal-this.lastNeed,n=u(this,e,t);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){var n=a(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�".repeat(this.lastTotal-this.lastNeed):t}function h(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function d(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function p(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function g(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function v(e){return e.toString(this.encoding)}function y(e){return e&&e.length?this.write(e):""}var _=e(6).Buffer,m=e(5),b=_.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};n.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<e.length?t?t+this.text(e,n):this.text(e,n):t||""},o.prototype.end=l,o.prototype.text=c,o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{5:5,6:6}],87:[function(e,t,n){function r(e){if(e&&!u(e))throw new Error("Unknown encoding: "+e)}function i(e){return e.toString(this.encoding)}function o(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function s(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}var a=e(6).Buffer,u=a.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},f=n.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),r(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=o;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=s;break;default:return void(this.write=i)}this.charBuffer=new a(6),this.charReceived=0,this.charLength=0};f.prototype.write=function(e){for(var t="";this.charLength;){var n=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived<this.charLength)return"";e=e.slice(n,e.length),t=this.charBuffer.slice(0,this.charLength).toString(this.encoding);var r=t.charCodeAt(t.length-1);if(!(r>=55296&&r<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var i=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,i),i-=this.charReceived),t+=e.toString(this.encoding,0,i);var i=t.length-1,r=t.charCodeAt(i);if(r>=55296&&r<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),e.copy(this.charBuffer,0,0,o),t.substring(0,i)}return t},f.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(1==t&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=t},f.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,r=this.charBuffer,i=this.encoding;t+=r.slice(0,n).toString(i)}return t}},{6:6}],88:[function(e,t,n){arguments[4][75][0].apply(n,arguments)},{26:26,62:62,7:7,75:75,90:90,92:92}],89:[function(e,t,n){arguments[4][76][0].apply(n,arguments)},{26:26,7:7,76:76,91:91}],90:[function(e,t,n){arguments[4][77][0].apply(n,arguments)},{20:20,26:26,3:3,32:32,5:5,6:6,62:62,63:63,7:7,77:77,88:88,93:93,94:94,97:97}],91:[function(e,t,n){arguments[4][78][0].apply(n,arguments)},{26:26,7:7,78:78,88:88}],92:[function(e,t,n){arguments[4][79][0].apply(n,arguments)},{101:101,26:26,5:5,6:6,62:62,63:63,7:7,79:79,88:88,94:94}],93:[function(e,t,n){arguments[4][80][0].apply(n,arguments)},{5:5,6:6,80:80}],94:[function(e,t,n){arguments[4][81][0].apply(n,arguments)},{20:20,81:81}],95:[function(e,t,n){arguments[4][83][0].apply(n,arguments)},{83:83,88:88,89:89,90:90,91:91,92:92}],96:[function(e,t,n){arguments[4][84][0].apply(n,arguments)},{84:84,95:95}],97:[function(e,t,n){arguments[4][86][0].apply(n,arguments)},{5:5,6:6,86:86}],98:[function(e,t,n){arguments[4][15][0].apply(n,arguments)},{15:15}],99:[function(e,t,n){(function(n){function r(e){s.call(this,e),this._destroyed=!1}function i(e,t,n){n(null,e)}function o(e){return function(t,n,r){return"function"==typeof t&&(r=n,n=t,t={}),"function"!=typeof n&&(n=i),"function"!=typeof r&&(r=null),e(t,n,r)}}var s=e(96),a=e(104).inherits,u=e(98);a(r,s),r.prototype.destroy=function(e){if(!this._destroyed){this._destroyed=!0;var t=this;n.nextTick(function(){e&&t.emit("error",e),t.emit("close")})}},t.exports=o(function(e,t,n){var i=new r(e);return i._transform=t,n&&(i._flush=n),i}),t.exports.ctor=o(function(e,t,n){function i(t){if(!(this instanceof i))return new i(t);this.options=u(e,t),r.call(this,this.options)}return a(i,r),i.prototype._transform=t,n&&(i.prototype._flush=n),i}),t.exports.obj=o(function(e,t,n){var i=new r(u({objectMode:!0,highWaterMark:16},e));return i._transform=t,n&&(i._flush=n),i})}).call(this,e(63))},{104:104,63:63,96:96,98:98}],100:[function(e,t,n){!function(){"use strict";var n=e(46),r=e(105),i=Object.prototype.toString;t.exports=function(e){return n(e)?"[object Null]":r(e)?"[object Undefined]":i.call(e)}}()},{105:105,46:46}],101:[function(e,t,n){(function(e){function n(e,t){function n(){if(!i){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),i=!0}return e.apply(this,arguments)}if(r("noDeprecation"))return e;var i=!1;return n}function r(t){try{if(!e.localStorage)return!1}catch(e){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],102:[function(e,t,n){arguments[4][26][0].apply(n,arguments)},{26:26}],103:[function(e,t,n){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],104:[function(e,t,n){(function(t,r){function i(e,t){var r={seen:[],stylize:s};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),g(t)?r.showHidden=t:t&&n._extend(r,t),w(r.showHidden)&&(r.showHidden=!1),w(r.depth)&&(r.depth=2),w(r.colors)&&(r.colors=!1),w(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=o),u(r,e,r.depth)}function o(e,t){var n=i.styles[t];return n?"["+i.colors[n][0]+"m"+e+"["+i.colors[n][1]+"m":e}function s(e,t){return e}function a(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}function u(e,t,r){if(e.customInspect&&t&&B(t.inspect)&&t.inspect!==n.inspect&&(!t.constructor||t.constructor.prototype!==t)){var i=t.inspect(r,e);return m(i)||(i=u(e,i,r)),i}var o=f(e,t);if(o)return o;var s=Object.keys(t),g=a(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(t)),x(t)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return c(t);if(0===s.length){if(B(t)){var v=t.name?": "+t.name:"";return e.stylize("[Function"+v+"]","special")}if(E(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(S(t))return e.stylize(Date.prototype.toString.call(t),"date");if(x(t))return c(t)}var y="",_=!1,b=["{","}"];if(p(t)&&(_=!0,b=["[","]"]),B(t)){y=" [Function"+(t.name?": "+t.name:"")+"]"}if(E(t)&&(y=" "+RegExp.prototype.toString.call(t)),S(t)&&(y=" "+Date.prototype.toUTCString.call(t)),x(t)&&(y=" "+c(t)),0===s.length&&(!_||0==t.length))return b[0]+y+b[1];if(r<0)return E(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var w;return w=_?l(e,t,r,g,s):s.map(function(n){return h(e,t,r,g,n,_)}),e.seen.pop(),d(w,y,b)}function f(e,t){if(w(t))return e.stylize("undefined","undefined");if(m(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return _(t)?e.stylize(""+t,"number"):g(t)?e.stylize(""+t,"boolean"):v(t)?e.stylize("null","null"):void 0}function c(e){return"["+Error.prototype.toString.call(e)+"]"}function l(e,t,n,r,i){for(var o=[],s=0,a=t.length;s<a;++s)R(t,String(s))?o.push(h(e,t,n,r,String(s),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(h(e,t,n,r,i,!0))}),o}function h(e,t,n,r,i,o){var s,a,f;if(f=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]},f.get?a=f.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):f.set&&(a=e.stylize("[Setter]","special")),R(r,i)||(s="["+i+"]"),a||(e.seen.indexOf(f.value)<0?(a=v(n)?u(e,f.value,null):u(e,f.value,n-1),a.indexOf("\n")>-1&&(a=o?a.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n"))):a=e.stylize("[Circular]","special")),w(s)){if(o&&i.match(/^\d+$/))return a;s=JSON.stringify(""+i),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function d(e,t,n){var r=0;return e.reduce(function(e,t){return r++,t.indexOf("\n")>=0&&r++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function p(e){return Array.isArray(e)}function g(e){return"boolean"==typeof e}function v(e){return null===e}function y(e){return null==e}function _(e){return"number"==typeof e}function m(e){return"string"==typeof e}function b(e){return"symbol"==typeof e}function w(e){return void 0===e}function E(e){return k(e)&&"[object RegExp]"===j(e)}function k(e){return"object"==typeof e&&null!==e}function S(e){return k(e)&&"[object Date]"===j(e)}function x(e){return k(e)&&("[object Error]"===j(e)||e instanceof Error)}function B(e){return"function"==typeof e}function A(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function j(e){return Object.prototype.toString.call(e)}function O(e){return e<10?"0"+e.toString(10):e.toString(10)}function L(){var e=new Date,t=[O(e.getHours()),O(e.getMinutes()),O(e.getSeconds())].join(":");return[e.getDate(),M[e.getMonth()],t].join(" ")}function R(e,t){return Object.prototype.hasOwnProperty.call(e,t)}n.format=function(e){if(!m(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(i(arguments[n]));return t.join(" ")}for(var n=1,r=arguments,o=r.length,s=String(e).replace(/%[sdj%]/g,function(e){if("%%"===e)return"%";if(n>=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}}),a=r[n];n<o;a=r[++n])v(a)||!k(a)?s+=" "+a:s+=" "+i(a);return s},n.deprecate=function(e,i){function o(){if(!s){if(t.throwDeprecation)throw new Error(i);t.traceDeprecation?console.trace(i):console.error(i),s=!0}return e.apply(this,arguments)}if(w(r.process))return function(){return n.deprecate(e,i).apply(this,arguments)};if(t.noDeprecation===!0)return e;var s=!1;return o};var C,T={};n.debuglog=function(e){if(w(C)&&(C=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!T[e])if(new RegExp("\\b"+e+"\\b","i").test(C)){var r=t.pid;T[e]=function(){var t=n.format.apply(n,arguments);console.error("%s %d: %s",e,r,t)}}else T[e]=function(){};return T[e]},n.inspect=i,i.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},i.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=p,n.isBoolean=g,n.isNull=v,n.isNullOrUndefined=y,n.isNumber=_,n.isString=m,n.isSymbol=b,n.isUndefined=w,n.isRegExp=E,n.isObject=k,n.isDate=S,n.isError=x,n.isFunction=B,n.isPrimitive=A,n.isBuffer=e(103);var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];n.log=function(){console.log("%s - %s",L(),n.format.apply(n,arguments))},n.inherits=e(102),n._extend=function(e,t){if(!t||!k(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(this,e(63),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{102:102,103:103,63:63}],105:[function(e,t,n){"use strict";function r(e){return void 0===e}t.exports=r},{}],106:[function(e,t,n){"use strict";function r(e,t,n){var r=n[n.length-1];e===r.element&&(n.pop(),r=n[n.length-1]);var i=r.element,o=r.index;if(Array.isArray(i))i.push(e);else if(o===t.length-2){var s=t.pop();i[s]=e}else t.push(e)}n.stringify=function(e){var t=[];t.push({obj:e});for(var n,r,i,o,s,a,u,f,c,l,h,d="";n=t.pop();)if(r=n.obj,i=n.prefix||"",o=n.val||"",d+=i,o)d+=o;else if("object"!=typeof r)d+=void 0===r?null:JSON.stringify(r);else if(null===r)d+="null";else if(Array.isArray(r)){for(t.push({val:"]"}),s=r.length-1;s>=0;s--)a=0===s?"":",",t.push({obj:r[s],prefix:a});t.push({val:"["})}else{u=[];for(f in r)r.hasOwnProperty(f)&&u.push(f);for(t.push({val:"}"}),s=u.length-1;s>=0;s--)c=u[s],l=r[c],h=s>0?",":"",h+=JSON.stringify(c)+":",t.push({obj:l,prefix:h});t.push({val:"{"})}return d},n.parse=function(e){for(var t,n,i,o,s,a,u,f,c,l=[],h=[],d=0;;)if("}"!==(t=e[d++])&&"]"!==t&&void 0!==t)switch(t){case" ":case"\t":case"\n":case":":case",":break;case"n":d+=3,r(null,l,h);break;case"t":d+=3,r(!0,l,h);break;case"f":d+=4,r(!1,l,h);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"-":for(n="",d--;;){if(i=e[d++],!/[\d\.\-e\+]/.test(i)){d--;break}n+=i}r(parseFloat(n),l,h);break;case'"':for(o="",s=void 0,a=0;;){if('"'===(u=e[d++])&&("\\"!==s||a%2!=1))break;o+=u,s=u,"\\"===s?a++:a=0}r(JSON.parse('"'+o+'"'),l,h);break;case"[":f={element:[],index:l.length},l.push(f.element),h.push(f);break;case"{":c={element:{},index:l.length},l.push(c.element),h.push(c);break;default:throw new Error("unexpectedly reached end of input: "+t)}else{if(1===l.length)return l.pop();r(l.pop(),l,h)}}},{}],107:[function(e,t,n){(function(t){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e.default:e}function r(e){return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer||"undefined"!=typeof Blob&&e instanceof Blob}function i(e){if("function"==typeof e.slice)return e.slice(0);var t=new ArrayBuffer(e.byteLength),n=new Uint8Array(t),r=new Uint8Array(e);return n.set(r),t}function o(e){if(e instanceof ArrayBuffer)return i(e);var t=e.size,n=e.type;return"function"==typeof e.slice?e.slice(0,t,n):e.webkitSlice(0,t,n)}function s(e){var t=Object.getPrototypeOf(e);if(null===t)return!0;var n=t.constructor;return"function"==typeof n&&n instanceof n&&He.call(n)==Ye}function a(e){var t,n,i;if(!e||"object"!=typeof e)return e;if(Array.isArray(e)){for(t=[],n=0,i=e.length;n<i;n++)t[n]=a(e[n]);return t}if(e instanceof Date)return e.toISOString();if(r(e))return o(e);if(!s(e))return e;t={};for(n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var u=a(e[n]);void 0!==u&&(t[n]=u)}return t}function u(e){return"$"+e}function f(e){return e.substring(1)}function c(){this._store={}}function l(e){if(this._store=new c,e&&Array.isArray(e))for(var t=0,n=e.length;t<n;t++)this.add(e[t])}function h(e,t){for(var n={},r=0,i=t.length;r<i;r++){var o=t[r];o in e&&(n[o]=e[o])}return n}function d(){return"undefined"!=typeof chrome&&void 0!==chrome.storage&&void 0!==chrome.storage.local}function p(){return Xe}function g(e){d()?chrome.storage.onChanged.addListener(function(t){null!=t.db_name&&e.emit(t.dbName.newValue)}):p()&&("undefined"!=typeof addEventListener?addEventListener("storage",function(t){e.emit(t.key)}):window.attachEvent("storage",function(t){e.emit(t.key)}))}function v(){Ce.EventEmitter.call(this),this._listeners={},g(this)}function y(e,t,n){Error.call(this,n),this.status=e,this.name=t,this.message=n,this.error=!0}function _(e,t){function n(t){for(var n in e)"function"!=typeof e[n]&&(this[n]=e[n]);void 0!==t&&(this.reason=t)}return n.prototype=y.prototype,new n(t)}function m(e,t,n){try{return!e(t,n)}catch(e){var r="Filter function threw: "+e.toString();return _(ft,r)}}function b(e){var t={},n=e.filter&&"function"==typeof e.filter;return t.query=e.query_params,function(r){r.doc||(r.doc={});var i=n&&m(e.filter,r.doc,t);if("object"==typeof i)return i;if(i)return!1;if(e.include_docs){if(!e.attachments)for(var o in r.doc._attachments)r.doc._attachments.hasOwnProperty(o)&&(r.doc._attachments[o].stub=!0)}else delete r.doc;return!0}}function w(){}function E(e){var t;if(e?"string"!=typeof e?t=_(rt):/^_/.test(e)&&!/^_(design|local)/.test(e)&&(t=_(ot)):t=_(it),t)throw t}function k(e){return 0|Math.random()*e}function S(e,t){t=t||pt.length;var n="",r=-1;if(e){for(;++r<e;)n+=pt[k(t)];return n}for(;++r<36;)switch(r){case 8:case 13:case 18:case 23:n+="-";break;case 19:n+=pt[3&k(16)|8];break;default:n+=pt[k(16)]}return n}function x(e){return"function"==typeof e}function B(e){return x(e.prefix)?e.prefix():e}function A(e){var t={};for(var n in e)t[n]=e[n];return t}function j(e,t,n){function r(e,r,i,o){return t.encode([e,n.encodeKey(r,i,o)])}function i(e,t){return t&&t.options&&(e.keyEncoding=e.keyEncoding||t.options.keyEncoding,e.valueEncoding=e.valueEncoding||t.options.valueEncoding),e}return e.open(function(){}),{apply:function(t,o,s){o=o||{};for(var a=[],u=-1,f=t.length;++u<f;){var c=t[u];i(c,c.prefix),c.prefix=B(c.prefix),a.push({key:r(c.prefix,c.key,o,c),value:"del"!==c.type&&n.encodeValue(c.value,o,c),type:c.type})}e.db.batch(a,o,s)},get:function(t,i,o,s){return o.asBuffer=n.valueAsBuffer(o),e.db.get(r(i,t,o),o,function(e,t){e?s(e):s(null,n.decodeValue(t,o))})},createDecoder:function(e){return function(r,i){return{key:n.decodeKey(t.decode(r)[1],e),value:n.decodeValue(i,e)}}},isClosed:function(){return e.isClosed()},close:function(t){return e.close(t)},iterator:function(i){function o(e){return r(a,e,s,{})}var s=A(i||{}),a=i.prefix||[];return De.toLtgt(i,s,o,t.lowerBound,t.upperBound),s.prefix=null,s.keyAsBuffer=s.valueAsBuffer=!1,"number"!=typeof s.limit&&(s.limit=-1),s.keyAsBuffer=t.buffer,s.valueAsBuffer=n.valueAsBuffer(s),function(e){return{next:function(t){return e.next(t)},end:function(t){e.end(t)}}}(e.db.iterator(s))}}}function O(){Error.call(this)}function L(e,t){if(!(this instanceof L))return new L(e,t);_t.call(this,{objectMode:!0,highWaterMark:e.highWaterMark}),this._waiting=!1,this._options=e,this._makeData=t}function R(e){return yt(j(e,mt,bt),[],L,e.options)}function C(e){return e.reduce(function(e,t){return e[t]=!0,e},{})}function T(e){if(!/^\d+\-./.test(e))return _(ct);var t=e.indexOf("-"),n=e.substring(0,t),r=e.substring(t+1);return{prefix:parseInt(n,10),id:r}}function M(e,t){for(var n=e.start-e.ids.length+1,r=e.ids,i=[r[0],t,[]],o=1,s=r.length;o<s;o++)i=[r[o],{status:"missing"},[i]];return[{pos:n,ids:i}]}function N(e,t){var n,r,i,o={status:"available"};if(e._deleted&&(o.deleted=!0),t)if(e._id||(e._id=S()),r=S(32,16).toLowerCase(),e._rev){if(i=T(e._rev),i.error)return i;e._rev_tree=[{pos:i.prefix,ids:[i.id,{status:"missing"},[[r,o,[]]]]}],n=i.prefix+1}else e._rev_tree=[{pos:1,ids:[r,o,[]]}],n=1;else if(e._revisions&&(e._rev_tree=M(e._revisions,o),n=e._revisions.start,r=e._revisions.ids[0]),!e._rev_tree){if(i=T(e._rev),i.error)return i;n=i.prefix,r=i.id,e._rev_tree=[{pos:n,ids:[r,o,[]]}]}E(e._id),e._rev=n+"-"+r;var s={metadata:{},data:{}};for(var a in e)if(Object.prototype.hasOwnProperty.call(e,a)){var u="_"===a[0];if(u&&!wt[a]){var f=_(ut,a);throw f.message=ut.message+": "+a,f}u&&!Et[a]?s.metadata[a.slice(1)]=e[a]:s.data[a]=e[a]}return s}function I(e){for(var t,n,r,i,o=e.rev_tree.slice();i=o.pop();){var s=i.ids,a=s[2],u=i.pos;if(a.length)for(var f=0,c=a.length;f<c;f++)o.push({pos:u+1,ids:a[f]});else{var l=!!s[1].deleted,h=s[0];t&&!(r!==l?r:n!==u?n<u:t<h)||(t=h,n=u,r=l)}}return n+"-"+t}function D(e,t){for(var n,r=e.slice();n=r.pop();)for(var i=n.pos,o=n.ids,s=o[2],a=t(0===s.length,i,o[0],n.ctx,o[1]),u=0,f=s.length;u<f;u++)r.push({pos:i+1,ids:s[u],ctx:a})}function q(e,t){return e.pos-t.pos}function U(e){var t=[];D(e,function(e,n,r,i,o){e&&t.push({rev:n+"-"+r,pos:n,opts:o})}),t.sort(q).reverse();for(var n=0,r=t.length;n<r;n++)delete t[n].pos;return t}function P(e){for(var t=I(e),n=U(e.rev_tree),r=[],i=0,o=n.length;i<o;i++){var s=n[i];s.rev===t||s.opts.deleted||r.push(s.rev)}return r}function F(e){var t=[];return D(e.rev_tree,function(e,n,r,i,o){"available"!==o.status||e||(t.push(n+"-"+r),o.status="missing")}),t}function W(e){for(var t,n=[],r=e.slice();t=r.pop();){var i=t.pos,o=t.ids,s=o[0],a=o[1],u=o[2],f=0===u.length,c=t.history?t.history.slice():[];c.push({id:s,opts:a}),f&&n.push({pos:i+1-c.length,ids:c});for(var l=0,h=u.length;l<h;l++)r.push({pos:i+1,ids:u[l],history:c})}return n.reverse()}function z(e,t){return e.pos-t.pos}function K(e,t,n){for(var r,i=0,o=e.length;i<o;)r=i+o>>>1,n(e[r],t)<0?i=r+1:o=r;return i}function J(e,t,n){var r=K(e,t,n);e.splice(r,0,t)}function V(e,t){for(var n,r,i=t,o=e.length;i<o;i++){var s=e[i],a=[s.id,s.opts,[]];r?(r[2].push(a),r=a):n=r=a}return n}function H(e,t){return e[0]<t[0]?-1:1}function Y(e,t){for(var n=[{tree1:e,tree2:t}],r=!1;n.length>0;){var i=n.pop(),o=i.tree1,s=i.tree2;(o[1].status||s[1].status)&&(o[1].status="available"===o[1].status||"available"===s[1].status?"available":"missing");for(var a=0;a<s[2].length;a++)if(o[2][0]){for(var u=!1,f=0;f<o[2].length;f++)o[2][f][0]===s[2][a][0]&&(n.push({tree1:o[2][f],tree2:s[2][a]}),u=!0);u||(r="new_branch",J(o[2],s[2][a],H))}else r="new_leaf",o[2][0]=s[2][a]}return{conflicts:r,tree:e}}function G(e,t,n){var r,i=[],o=!1,s=!1;if(!e.length)return{tree:[t],conflicts:"new_leaf"};for(var a=0,u=e.length;a<u;a++){var f=e[a];if(f.pos===t.pos&&f.ids[0]===t.ids[0])r=Y(f.ids,t.ids),i.push({pos:f.pos,ids:r.tree}),o=o||r.conflicts,s=!0;else if(n!==!0){var c=f.pos<t.pos?f:t,l=f.pos<t.pos?t:f,h=l.pos-c.pos,d=[],p=[];for(p.push({ids:c.ids,diff:h,parent:null,parentIdx:null});p.length>0;){var g=p.pop();if(0!==g.diff)for(var v=g.ids[2],y=0,_=v.length;y<_;y++)p.push({ids:v[y],diff:g.diff-1,parent:g.ids,parentIdx:y});else g.ids[0]===l.ids[0]&&d.push(g)}var m=d[0];m?(r=Y(m.ids,l.ids),m.parent[2][m.parentIdx]=r.tree,i.push({pos:c.pos,ids:c.ids}),o=o||r.conflicts,s=!0):i.push(f)}else i.push(f)}return s||i.push(t),i.sort(z),{tree:i,conflicts:o||"internal_node"}}function $(e,t){for(var n,r,i=W(e),o=0,s=i.length;o<s;o++){var a,u=i[o],f=u.ids;if(f.length>t){n||(n={});var c=f.length-t;a={pos:u.pos+c,ids:V(f,c)};for(var l=0;l<c;l++){var h=u.pos+l+"-"+f[l].id;n[h]=!0}}else a={pos:u.pos,ids:V(f,0)};r=r?G(r,a,!0).tree:[a]}return n&&D(r,function(e,t,r){delete n[t+"-"+r]}),{tree:r,revs:n?Object.keys(n):[]}}function X(e,t,n){var r=G(e,t),i=$(r.tree,n);return{tree:i.tree,stemmedRevs:i.revs,conflicts:r.conflicts}}function Z(e,t){for(var n,r=e.slice(),i=t.split("-"),o=parseInt(i[0],10),s=i[1];n=r.pop();){if(n.pos===o&&n.ids[0]===s)return!0;for(var a=n.ids[2],u=0,f=a.length;u<f;u++)r.push({pos:n.pos+1,ids:a[u]})}return!1}function Q(e){return e.ids}function ee(e,t){t||(t=I(e));for(var n,r=t.substring(t.indexOf("-")+1),i=e.rev_tree.map(Q);n=i.pop();){if(n[0]===r)return!!n[1].deleted;i=i.concat(n[2])}}function te(e){return/^_local/.test(e)}function ne(e,t){for(var n,r=t.rev_tree.slice();n=r.pop();){var i=n.pos,o=n.ids,s=o[0],a=o[1],u=o[2],f=0===u.length,c=n.history?n.history.slice():[];if(c.push({id:s,pos:i,opts:a}),f)for(var l=0,h=c.length;l<h;l++){var d=c[l],p=d.pos+"-"+d.id;if(p===e)return i+"-"+s}for(var g=0,v=u.length;g<v;g++)r.push({pos:i+1,ids:u[g],history:c})}throw new Error("Unable to resolve latest revision for id "+t.id+", rev "+e)}function re(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(o){if("TypeError"!==o.name)throw o;for(var n="undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder,r=new n,i=0;i<e.length;i+=1)r.append(e[i]);return r.getBlob(t.type)}}function ie(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),i=0;i<t;i++)r[i]=e.charCodeAt(i);return n}function oe(e,t){return re([ie(e)],{type:t})}function se(e){for(var t="",n=new Uint8Array(e),r=n.byteLength,i=0;i<r;i++)t+=String.fromCharCode(n[i]);return t}function ae(e,t){if("undefined"==typeof FileReader)return t(se((new FileReaderSync).readAsArrayBuffer(e)));var n=new FileReader,r="function"==typeof n.readAsBinaryString;n.onloadend=function(e){var n=e.target.result||"";if(r)return t(n);t(se(n))},r?n.readAsBinaryString(e):n.readAsArrayBuffer(e)}function ue(e,t){if("undefined"==typeof FileReader)return t((new FileReaderSync).readAsArrayBuffer(e));var n=new FileReader;n.onloadend=function(e){var n=e.target.result||new ArrayBuffer(0);t(n)},n.readAsArrayBuffer(e)}function fe(e){return St(e)}function ce(e,t,n){return e.webkitSlice?e.webkitSlice(t,n):e.slice(t,n)}function le(e,t,n,r,i){(n>0||r<t.size)&&(t=ce(t,n,r)),ue(t,function(t){e.append(t),i()})}function he(e,t,n,r,i){(n>0||r<t.length)&&(t=t.substring(n,r)),e.appendBinary(t),i()}function de(e,t){function n(){xt(i)}function r(){var e=c.end(!0),n=fe(e);t(n),c.destroy()}function i(){var t=f*a,i=t+a;f++,f<u?l(c,e,t,i,n):l(c,e,t,i,r)}var o="string"==typeof e,s=o?e.length:e.size,a=Math.min(Bt,s),u=Math.ceil(s/a),f=0,c=o?new ze:new ze.ArrayBuffer,l=o?he:le;i()}function pe(e,t,n,r,i,o,s,a){if(Z(t.rev_tree,n.metadata.rev))return r[i]=n,o();var u=t.winningRev||I(t),f="deleted"in t?t.deleted:ee(t,u),c="deleted"in n.metadata?n.metadata.deleted:ee(n.metadata),l=/^1-/.test(n.metadata.rev);if(f&&!c&&a&&l){var h=n.data;h._rev=u,h._id=n.metadata.id,n=N(h,a)}var d=X(t.rev_tree,n.metadata.rev_tree[0],e);if(a&&(f&&c&&"new_leaf"!==d.conflicts||!f&&"new_leaf"!==d.conflicts||f&&!c&&"new_branch"===d.conflicts)){var p=_(nt);return r[i]=p,o()}var g=n.metadata.rev;n.metadata.rev_tree=d.tree,n.stemmedRevs=d.stemmedRevs||[],t.rev_map&&(n.metadata.rev_map=t.rev_map);var v,y=I(n.metadata),m=ee(n.metadata,y),b=f===m?0:f<m?-1:1;v=g===y?m:ee(n.metadata,g),s(n,y,m,v,!0,b,i,o)}function ge(e){return"missing"===e.metadata.rev_tree[0].ids[1].status}function ve(e,t,n,r,i,o,s,a,u){function f(e,t,n){var r=I(e.metadata),i=ee(e.metadata,r);if("was_delete"in a&&i)return o[t]=_(tt,"deleted"),n();if(l&&ge(e)){var u=_(nt);return o[t]=u,n()}s(e,r,i,i,!1,i?0:1,t,n)}function c(){++d===p&&u&&u()}e=e||1e3;var l=a.new_edits,h=new $e,d=0,p=t.length;t.forEach(function(e,t){if(e._id&&te(e._id)){var r=e._deleted?"_removeLocal":"_putLocal";return void n[r](e,{ctx:i},function(e,n){o[t]=e||n,c()})}var s=e.metadata.id;h.has(s)?(p--,h.get(s).push([e,t])):h.set(s,[[e,t]])}),h.forEach(function(t,n){function i(){++u<t.length?a():c()}function a(){var a=t[u],c=a[0],h=a[1];if(r.has(n))pe(e,r.get(n),c,o,h,i,s,l);else{var d=X([],c.metadata.rev_tree[0],e);c.metadata.rev_tree=d.tree,c.stemmedRevs=d.stemmedRevs||[],f(c,h,i)}}var u=0;a()})}
function ye(e){try{return JSON.parse(e)}catch(t){return Ke.parse(e)}}function _e(e){try{return JSON.stringify(e)}catch(t){return Ke.stringify(e)}}function me(e,t){return re([new Uint8Array(e)],{type:t})}function be(e,t){ae(e,t)}function we(e){return re([""],{type:e})}function Ee(e,t){var n=t.prefix()[0],r=e._cache,i=r.get(n);return i||(i=new $e,r.set(n,i)),i}function ke(){this._batch=[],this._cache=new $e}function Se(e){return"winningRev"in e?e.winningRev:I(e)}function xe(e,t){return"deleted"in e?e.deleted:ee(e,t)}function Be(e,t,n){var r=e.content_type;return new Ve(function(i,o){t.binaryStore.get(e.digest,function(t,s){var a;if(t){if("NotFoundError"!==t.name)return o(t);a=n.binary?oe("",r):""}else a=n.binary?me(s,r):s.toString("base64");delete e.stub,delete e.length,e.data=a,i()})})}function Ae(e,t,n){var r=[];return e.forEach(function(e){if(e.doc&&e.doc._attachments){Object.keys(e.doc._attachments).forEach(function(t){var n=e.doc._attachments[t];"data"in n||r.push(n)})}}),Ve.all(r.map(function(e){return Be(e,t,n)}))}function je(e,t){function n(){m.docStore=v.sublevel(At,{valueEncoding:qt}),m.bySeqStore=v.sublevel(jt,{valueEncoding:"json"}),m.attachmentStore=v.sublevel(Ot,{valueEncoding:"json"}),m.binaryStore=v.sublevel(Lt,{valueEncoding:"binary"}),m.localStore=v.sublevel(Rt,{valueEncoding:"json"}),m.metaStore=v.sublevel(Ct,{valueEncoding:"json"}),"object"==typeof e.migrate?e.migrate.doMigrationTwo(v,m,r):r()}function r(){m.metaStore.get(Mt,function(e,n){void 0===v._updateSeq&&(v._updateSeq=n||0),m.metaStore.get(Nt,function(e,n){v._docCount=e?0:n,m.metaStore.get(It,function(e,n){g=e?S():n,m.metaStore.put(It,g,function(){Ne(function(){t(null,y)})})})})})}function i(e){return v.isClosed()?e(new Error("database is closed")):e(null,v._docCount)}function o(e,t){try{e.apply(null,t)}catch(e){t[t.length-1](e)}}function s(){var e=v._queue.peekFront();"read"===e.type?u(e):f(e)}function u(e){for(var t=[e],n=1,r=v._queue.get(n);void 0!==r&&"read"===r.type;)t.push(r),n++,r=v._queue.get(n);var i=0;t.forEach(function(e){var n=e.args,r=n[n.length-1];n[n.length-1]=Re(function(e){r.apply(null,e),++i===t.length&&Ne(function(){t.forEach(function(){v._queue.shift()}),v._queue.length&&s()})}),o(e.fun,n)})}function f(e){var t=e.args,n=t[t.length-1];t[t.length-1]=Re(function(e){n.apply(null,e),Ne(function(){v._queue.shift(),v._queue.length&&s()})}),o(e.fun,t)}function c(e){return Re(function(t){v._queue.push({fun:e,args:t,type:"write"}),1===v._queue.length&&Ne(s)})}function l(e){return Re(function(t){v._queue.push({fun:e,args:t,type:"read"}),1===v._queue.length&&Ne(s)})}function h(e){return("0000000000000000"+e).slice(-16)}function d(e){return parseInt(e,10)}function p(e,t){x.destroy(e,t)}e=a(e);var g,v,y=this,m={},w=e.revs_limit,E=e.name;void 0===e.createIfMissing&&(e.createIfMissing=!0);var k,x=e.db,B=dt(x);Tt.has(B)?k=Tt.get(B):(k=new $e,Tt.set(B,k)),k.has(E)?(v=k.get(E),n()):k.set(E,R(Ie(E,e,function(r){if(r)return k.delete(E),t(r);v=k.get(E),v._docCount=-1,v._queue=new Fe,"object"==typeof e.migrate?e.migrate.doMigrationOne(E,v,n):n()}))),y._remote=!1,y.type=function(){return"leveldb"},y._id=function(e){e(null,g)},y._info=function(e){var t={doc_count:v._docCount,update_seq:v._updateSeq,backend_adapter:dt(x)};return Ne(function(){e(null,t)})},y._get=l(function(e,t,n){t=a(t),m.docStore.get(e,function(e,r){if(e||!r)return n(_(tt,"missing"));var i;if(t.rev)i=t.latest?ne(t.rev,r):t.rev;else{i=Se(r);if(xe(r,i))return n(_(tt,"deleted"))}var o=r.rev_map[i];m.bySeqStore.get(h(o),function(e,t){if(!t)return n(_(tt));if("_id"in t&&t._id!==r.id)return n(new Error("wrong doc returned"));if(t._id=r.id,"_rev"in t){if(t._rev!==i)return n(new Error("wrong doc returned"))}else t._rev=i;return n(null,{doc:t,metadata:r})})})}),y._getAttachment=function(e,t,n,r,i){var o=n.digest,s=n.content_type;m.binaryStore.get(o,function(e,t){if(e)return"NotFoundError"!==e.name?i(e):i(null,r.binary?we(s):"");r.binary?i(null,me(t,s)):i(null,t.toString("base64"))})},y._bulkDocs=c(function(e,t,n){function r(e,t){k.get(m.attachmentStore,e,function(n){if(n){var r=_(lt,"unknown stub attachment with digest "+e);t(r)}else t()})}function i(e){function t(){if(++r===B.length)return e(n)}var n,r=0;B.forEach(function(e){if(e._id&&te(e._id))return t();k.get(m.docStore,e._id,function(r,i){r?"NotFoundError"!==r.name&&(n=r):g.set(e._id,i),t()})})}function o(e,t){var n=Ve.resolve();e.forEach(function(e,t){n=n.then(function(){return new Ve(function(n,r){y._doCompactionNoLock(t,e,{ctx:k},function(e){if(e)return r(e);n()})})})}),n.then(function(){t()},t)}function s(e){var t=new $e;g.forEach(function(e,n){t.set(n,F(e))}),o(t,e)}function a(){o(b,function(e){if(e&&l(e),y.auto_compaction)return s(l);l()})}function u(e,t,r,i,o,s,a,u){function l(e){E++,w||(e?(w=e,u(w)):E===B.length&&y())}function d(e,t,n,r){return function(i){c(e,Dt+i,t,n,r)}}function v(e,t,n){return function(r){de(r,d(e,t,r,n))}}function y(){var t=e.metadata.rev_map[e.metadata.rev];if(t)return u();t=++x,e.metadata.rev_map[e.metadata.rev]=e.metadata.seq=t;var n=h(t),r=[{key:n,value:e.data,prefix:m.bySeqStore,type:"put"},{key:e.metadata.id,value:e.metadata,prefix:m.docStore,type:"put"}];k.batch(r),p[a]={ok:!0,id:e.metadata.id,rev:e.metadata.rev},g.set(e.metadata.id,e.metadata),u()}S+=s;var w=null,E=0;e.metadata.winningRev=t,e.metadata.deleted=r,e.data._id=e.metadata.id,e.data._rev=e.metadata.rev,i&&(e.data._deleted=!0),e.stemmedRevs.length&&b.set(e.metadata.id,e.stemmedRevs);for(var B=e.data._attachments?Object.keys(e.data._attachments):[],A=0;A<B.length;A++){var j=B[A],O=e.data._attachments[j];if(O.stub){f(e.data._id,e.data._rev,O.digest,l)}else{var L;if("string"==typeof O.data){try{L=kt(O.data)}catch(e){return void n(_(at,"Attachment is not a valid base64 string"))}v(e,j,l)(L)}else be(O.data,v(e,j,l))}}B.length||y()}function f(e,t,n,r){function i(){return new Ve(function(e,t){k.get(m.attachmentStore,n,function(n,r){if(n&&"NotFoundError"!==n.name)return t(n);e(r)})})}function o(r){var i=[e,t].join("@"),o={};return r?r.refs&&(o.refs=r.refs,o.refs[i]=!0):(o.refs={},o.refs[i]=!0),new Ve(function(e){k.batch([{type:"put",prefix:m.attachmentStore,key:n,value:o}]),e(!r)})}var s=O[n]||Ve.resolve();O[n]=s.then(function(){return i().then(o).then(function(e){r(null,e)},r)})}function c(e,t,n,r,i){var o=e.data._attachments[n];delete o.data,o.digest=t,o.length=r.length;var s=e.metadata.id,a=e.metadata.rev;o.revpos=parseInt(a,10),f(s,a,t,function(e,n){return e?i(e):0===r.length?i(e):n?(k.batch([{type:"put",prefix:m.binaryStore,key:t,value:We(r,"binary")}]),void i()):i(e)})}function l(e){if(e)return Ne(function(){n(e)});k.batch([{prefix:m.metaStore,type:"put",key:Mt,value:x},{prefix:m.metaStore,type:"put",key:Nt,value:v._docCount+S}]),k.execute(v,function(e){if(e)return n(e);v._docCount+=S,v._updateSeq=x,Ut.notify(E),Ne(function(){n(null,p)})})}var d=t.new_edits,p=new Array(e.docs.length),g=new $e,b=new $e,k=new ke,S=0,x=v._updateSeq,B=e.docs,A=B.map(function(e){if(e._id&&te(e._id))return e;var t=N(e,d);return t.metadata&&!t.metadata.rev_map&&(t.metadata.rev_map={}),t}),j=A.filter(function(e){return e.error});if(j.length)return n(j[0]);var O={};if(!A.length)return n(null,[]);!function(e){var t=[];if(B.forEach(function(e){e&&e._attachments&&Object.keys(e._attachments).forEach(function(n){var r=e._attachments[n];r.stub&&t.push(r.digest)})}),!t.length)return e();var n,i=0;t.forEach(function(o){r(o,function(r){r&&!n&&(n=r),++i===t.length&&e(n)})})}(function(e){if(e)return n(e);i(function(e){if(e)return n(e);ve(w,A,y,g,k,p,u,t,a)})})}),y._allDocs=l(function(e,t){e=a(e),i(function(n,r){if(n)return t(n);var i={},o=e.skip||0;if(e.startkey&&(i.gte=e.startkey),e.endkey&&(i.lte=e.endkey),e.key&&(i.gte=i.lte=e.key),e.descending){i.reverse=!0;var s=i.lte;i.lte=i.gte,i.gte=s}var a;if("number"==typeof e.limit&&(a=e.limit),0===a||"start"in i&&"end"in i&&i.start>i.end)return t(null,{total_rows:r,offset:e.skip,rows:[]});var u=[],f=m.docStore.readStream(i),c=Pe.obj(function(t,n,r){function i(t){var n={id:s.id,key:s.id,value:{rev:c}};if(e.include_docs){if(n.doc=t,n.doc._rev=n.value.rev,e.conflicts){var i=P(s);i.length&&(n.doc._conflicts=i)}for(var o in n.doc._attachments)n.doc._attachments.hasOwnProperty(o)&&(n.doc._attachments[o].stub=!0)}if(e.inclusive_end===!1&&s.id===e.endkey)return r();if(l){if("ok"!==e.deleted)return r();n.value.deleted=!0,n.doc=null}u.push(n),r()}var s=t.value,c=Se(s),l=xe(s,c);if(l){if("ok"!==e.deleted)return void r()}else{if(o-- >0)return void r();if("number"==typeof a&&a--<=0)return f.unpipe(),f.destroy(),void r()}if(e.include_docs){var d=s.rev_map[c];m.bySeqStore.get(h(d),function(e,t){i(t)})}else i()},function(n){Ve.resolve().then(function(){if(e.include_docs&&e.attachments)return Ae(u,m,e)}).then(function(){t(null,{total_rows:r,offset:e.skip,rows:u})},t),n()}).on("unpipe",function(){c.end()});f.on("error",t),f.pipe(c)})}),y._changes=function(e){function t(){e.done=!0,c&&e.limit&&e.limit<o.length&&(o.length=e.limit),_.unpipe(w),_.destroy(),e.continuous||e.cancelled||(e.include_docs&&e.attachments?Ae(o,m,e).then(function(){e.complete(null,{results:o,last_seq:s})}):e.complete(null,{results:o,last_seq:s}))}if(e=a(e),e.continuous){var n=E+":"+S();return Ut.addListener(E,n,y,e),Ut.notify(E),{cancel:function(){Ut.removeListener(E,n)}}}var r,i=e.descending,o=[],s=e.since||0,u=0,f={reverse:i};"limit"in e&&e.limit>0&&(r=e.limit),f.reverse||(f.start=h(e.since||0));var c,l=e.doc_ids&&new Ge(e.doc_ids),p=b(e),g=new $e;c="return_docs"in e?e.return_docs:!("returnDocs"in e)||e.returnDocs;var _=m.bySeqStore.readStream(f),w=Pe.obj(function(n,a,f){function y(t){function n(n){var r=e.processChange(n,t,e);r.seq=t.seq;var i=p(r);if("object"==typeof i)return e.complete(i);i&&(u++,e.attachments&&e.include_docs?Ae([r],m,e).then(function(){e.onChange(r)}):e.onChange(r),c&&o.push(r)),f()}var r=Se(t);if(t.seq!==_)return f();if(s=_,r===b._rev)return n(b);var i=t.rev_map[r];m.bySeqStore.get(h(i),function(e,t){n(t)})}if(r&&u>=r)return t(),f();if(e.cancelled||e.done)return f();var _=d(n.key),b=n.value;if(_===e.since&&!i)return f();if(l&&!l.has(b._id))return f();var w;if(w=g.get(b._id))return y(w);m.docStore.get(b._id,function(t,n){if(e.cancelled||e.done||v.isClosed()||te(n.id))return f();g.set(b._id,n),y(n)})},function(t){if(e.cancelled)return t();c&&e.limit&&e.limit<o.length&&(o.length=e.limit),t()}).on("unpipe",function(){w.end(),t()});return _.pipe(w),{cancel:function(){e.cancelled=!0,t()}}},y._close=function(e){if(v.isClosed())return e(_(st));v.close(function(t){t?e(t):(k.delete(E),e())})},y._getRevisionTree=function(e,t){m.docStore.get(e,function(e,n){e?t(_(tt)):t(null,n.rev_tree)})},y._doCompaction=c(function(e,t,n,r){y._doCompactionNoLock(e,t,n,r)}),y._doCompactionNoLock=function(e,t,n,r){if("function"==typeof n&&(r=n,n={}),!t.length)return r();var i=n.ctx||new ke;i.get(m.docStore,e,function(o,s){function a(e){if(e&&(d=e),++g===t.length){if(d)return r(d);f()}}function u(e){return e?r(e):(i.batch(l),n.ctx?r():void i.execute(v,r))}function f(){function n(e){e&&(o=e),++s===r.length&&u(o)}var r=Object.keys(p);if(!r.length)return u();var o,s=0,a=new $e;t.forEach(function(t){a.set(e+"@"+t,!0)}),r.forEach(function(e){i.get(m.attachmentStore,e,function(t,r){if(t)return"NotFoundError"===t.name?n():n(t);var i=Object.keys(r.refs||{}).filter(function(e){return!a.has(e)}),o={};i.forEach(function(e){o[e]=!0}),i.length?l.push({key:e,type:"put",value:{refs:o},prefix:m.attachmentStore}):l=l.concat([{key:e,type:"del",prefix:m.attachmentStore},{key:e,type:"del",prefix:m.binaryStore}]),n()})})}if(o)return r(o);var c=t.map(function(e){var t=s.rev_map[e];return delete s.rev_map[e],t});D(s.rev_tree,function(e,n,r,i,o){var s=n+"-"+r;t.indexOf(s)!==-1&&(o.status="missing")});var l=[];l.push({key:s.id,value:s,type:"put",prefix:m.docStore});var d,p={},g=0;c.forEach(function(e){l.push({key:h(e),type:"del",prefix:m.bySeqStore}),i.get(m.bySeqStore,h(e),function(e,t){if(e)return"NotFoundError"===e.name?a():a(e);Object.keys(t._attachments||{}).forEach(function(e){var n=t._attachments[e].digest;p[n]=!0}),a()})})})},y._getLocal=function(e,t){m.localStore.get(e,function(e,n){e?t(_(tt)):t(null,n)})},y._putLocal=function(e,t,n){"function"==typeof t&&(n=t,t={}),t.ctx?y._putLocalNoLock(e,t,n):y._putLocalWithLock(e,t,n)},y._putLocalWithLock=c(function(e,t,n){y._putLocalNoLock(e,t,n)}),y._putLocalNoLock=function(e,t,n){delete e._revisions;var r=e._rev,i=e._id,o=t.ctx||new ke;o.get(m.localStore,i,function(s,a){if(s&&r)return n(_(nt));if(a&&a._rev!==r)return n(_(nt));e._rev=r?"0-"+(parseInt(r.split("-")[1],10)+1):"0-1";var u=[{type:"put",prefix:m.localStore,key:i,value:e}];o.batch(u);var f={ok:!0,id:e._id,rev:e._rev};if(t.ctx)return n(null,f);o.execute(v,function(e){if(e)return n(e);n(null,f)})})},y._removeLocal=function(e,t,n){"function"==typeof t&&(n=t,t={}),t.ctx?y._removeLocalNoLock(e,t,n):y._removeLocalWithLock(e,t,n)},y._removeLocalWithLock=c(function(e,t,n){y._removeLocalNoLock(e,t,n)}),y._removeLocalNoLock=function(e,t,n){var r=t.ctx||new ke;r.get(m.localStore,e._id,function(i,o){if(i)return n("NotFoundError"!==i.name?i:_(tt));if(o._rev!==e._rev)return n(_(nt));r.batch([{prefix:m.localStore,type:"del",key:e._id}]);var s={ok:!0,id:e._id,rev:"0-0"};if(t.ctx)return n(null,s);r.execute(v,function(e){if(e)return n(e);n(null,s)})})},y._destroy=function(e,t){var n,r=dt(x);if(!Tt.has(r))return p(E,t);n=Tt.get(r),n.has(E)?(Ut.removeAllListeners(E),n.get(E).close(function(){n.delete(E),p(E,t)})):p(E,t)}}function Oe(e,t){var n=Qe({db:Je},e);je.call(this,n,t)}var Le=n(e(45)),Re=n(e(1)),Ce=e(20),Te=n(Ce),Me=n(e(26)),Ne=n(e(25)),Ie=n(e(39)),De=n(e(47)),qe=n(e(33)),Ue=n(e(71)),Pe=e(99),Fe=n(e(16)),We=n(e(4)),ze=n(e(72)),Ke=n(e(106)),Je=n(e(49)),Ve="function"==typeof Promise?Promise:Le,He=Function.prototype.toString,Ye=He.call(Object);c.prototype.get=function(e){var t=u(e);return this._store[t]},c.prototype.set=function(e,t){var n=u(e);return this._store[n]=t,!0},c.prototype.has=function(e){return u(e)in this._store},c.prototype.delete=function(e){var t=u(e),n=t in this._store;return delete this._store[t],n},c.prototype.forEach=function(e){for(var t=Object.keys(this._store),n=0,r=t.length;n<r;n++){var i=t[n],o=this._store[i];i=f(i),e(o,i)}},Object.defineProperty(c.prototype,"size",{get:function(){return Object.keys(this._store).length}}),l.prototype.add=function(e){return this._store.set(e,!0)},l.prototype.has=function(e){return this._store.has(e)},l.prototype.forEach=function(e){this._store.forEach(function(t,n){e(n)})},Object.defineProperty(l.prototype,"size",{get:function(){return this._store.size}});var Ge,$e;!function(){if("undefined"==typeof Symbol||"undefined"==typeof Map||"undefined"==typeof Set)return!1;var e=Object.getOwnPropertyDescriptor(Map,Symbol.species);return e&&"get"in e&&Map[Symbol.species]===Map}()?(Ge=l,$e=c):(Ge=Set,$e=Map);var Xe;if(d())Xe=!1;else try{localStorage.setItem("_pouch_check_localstorage",1),Xe=!!localStorage.getItem("_pouch_check_localstorage")}catch(e){Xe=!1}Me(v,Ce.EventEmitter),v.prototype.addListener=function(e,t,n,r){function i(){function e(){s=!1}if(o._listeners[t]){if(s)return void(s="waiting");s=!0;var a=h(r,["style","include_docs","attachments","conflicts","filter","doc_ids","view","since","query_params","binary"]);n.changes(a).on("change",function(e){e.seq>r.since&&!r.cancelled&&(r.since=e.seq,r.onChange(e))}).on("complete",function(){"waiting"===s&&Ne(i),s=!1}).on("error",e)}}if(!this._listeners[t]){var o=this,s=!1;this._listeners[t]=i,this.on(e,i)}},v.prototype.removeListener=function(e,t){t in this._listeners&&(Ce.EventEmitter.prototype.removeListener.call(this,e,this._listeners[t]),delete this._listeners[t])},v.prototype.notifyLocalWindows=function(e){d()?chrome.storage.local.set({dbName:e}):p()&&(localStorage[e]="a"===localStorage[e]?"b":"a")},v.prototype.notify=function(e){this.emit(e),this.notifyLocalWindows(e)};var Ze;Ze="function"==typeof Object.assign?Object.assign:function(e){for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t};var Qe=Ze;Me(y,Error),y.prototype.toString=function(){return JSON.stringify({status:this.status,name:this.name,message:this.message,reason:this.reason})};var et,tt=(new y(401,"unauthorized","Name or password is incorrect."),new y(400,"bad_request","Missing JSON list of 'docs'"),new y(404,"not_found","missing")),nt=new y(409,"conflict","Document update conflict"),rt=new y(400,"bad_request","_id field must contain a string"),it=new y(412,"missing_id","_id is required for puts"),ot=new y(400,"bad_request","Only reserved document ids may start with underscore."),st=new y(412,"precondition_failed","Database not open"),at=(new y(500,"unknown_error","Database encountered an unknown error"),new y(500,"badarg","Some query argument is invalid")),ut=(new y(400,"invalid_request","Request was invalid"),new y(400,"query_parse_error","Some query parameter is invalid"),new y(500,"doc_validation","Bad special document member")),ft=new y(400,"bad_request","Something wrong with the request"),ct=(new y(400,"bad_request","Document must be a JSON object"),new y(404,"not_found","Database not found"),new y(500,"indexed_db_went_bad","unknown"),new y(500,"web_sql_went_bad","unknown"),new y(500,"levelDB_went_went_bad","unknown"),new y(403,"forbidden","Forbidden by design doc validate_doc_update function"),new y(400,"bad_request","Invalid rev format")),lt=(new y(412,"file_exists","The database could not be created, the file already exists."),new y(412,"missing_stub","A pre-existing attachment stub wasn't found")),ht=(new y(413,"invalid_url","Provided URL is invalid"),w.name);et=ht?function(e){return e.name}:function(e){return e.toString().match(/^\s*function\s*(\S*)\s*\(/)[1]};var dt=et,pt="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");Me(O,Error),O.prototype.name="NotFoundError";var gt=Te.EventEmitter,vt=new O,yt=function(e,t,n,r){function i(e){var t,n={};if(r)for(t in r)void 0!==r[t]&&(n[t]=r[t]);if(e)for(t in e)void 0!==e[t]&&(n[t]=e[t]);return n}var o=new gt;return o.sublevels={},o.options=r,o.version="6.5.4",o.methods={},t=t||[],o.put=function(n,r,s,a){"function"==typeof s&&(a=s,s={}),e.apply([{key:n,value:r,prefix:t.slice(),type:"put"}],i(s),function(e){if(e)return a(e);o.emit("put",n,r),a(null)})},o.prefix=function(){return t.slice()},o.batch=function(n,r,s){"function"==typeof r&&(s=r,r={}),n=n.map(function(e){return{key:e.key,value:e.value,prefix:e.prefix||t,keyEncoding:e.keyEncoding,valueEncoding:e.valueEncoding,type:e.type}}),e.apply(n,i(r),function(e){if(e)return s(e);o.emit("batch",n),s(null)})},o.get=function(n,r,o){"function"==typeof r&&(o=r,r={}),e.get(n,t,i(r),function(e,t){e?o(vt):o(null,t)})},o.sublevel=function(r,s){return o.sublevels[r]=o.sublevels[r]||yt(e,t.concat(r),n,i(s))},o.readStream=o.createReadStream=function(r){r=i(r),r.prefix=t;var o,s=e.iterator(r);return o=n(r,e.createDecoder(r)),o.setIterator(s),o},o.close=function(t){e.close(t)},o.isOpen=e.isOpen,o.isClosed=e.isClosed,o},_t=Ue.Readable;Me(L,_t),L.prototype.setIterator=function(e){return this._iterator=e,this._destroyed?e.end(function(){}):this._waiting?(this._waiting=!1,this._read()):this},L.prototype._read=function(){var e=this;if(!e._destroyed)return e._iterator?void e._iterator.next(function(t,n,r){if(t||void 0===n&&void 0===r)return t||e._destroyed||e.push(null),e._cleanup(t);r=e._makeData(n,r),e._destroyed||e.push(r)}):this._waiting=!0},L.prototype._cleanup=function(e){if(!this._destroyed){this._destroyed=!0;var t=this;e&&t.emit("error",e),t._iterator?t._iterator.end(function(){t._iterator=null,t.emit("close")}):t.emit("close")}},L.prototype.destroy=function(){this._cleanup()};var mt={encode:function(e){return"ÿ"+e[0]+"ÿ"+e[1]},decode:function(e){var t=e.toString(),n=t.indexOf("ÿ",1);return[t.substring(1,n),t.substring(n+1)]},lowerBound:"\0",upperBound:"ÿ"},bt=new qe,wt=C(["_id","_rev","_attachments","_deleted","_revisions","_revs_info","_conflicts","_deleted_conflicts","_local_seq","_rev_tree","_replication_id","_replication_state","_replication_state_time","_replication_state_reason","_replication_stats","_removed"]),Et=C(["_attachments","_replication_id","_replication_state","_replication_state_time","_replication_state_reason","_replication_stats"]),kt=function(e){return atob(e)},St=function(e){return btoa(e)},xt=t.setImmediate||t.setTimeout,Bt=32768;ke.prototype.get=function(e,t,n){var r=Ee(this,e),i=r.get(t);return i?Ne(function(){n(null,i)}):null===i?Ne(function(){n({name:"NotFoundError"})}):void e.get(t,function(e,i){if(e)return"NotFoundError"===e.name&&r.set(t,null),n(e);r.set(t,i),n(null,i)})},ke.prototype.batch=function(e){for(var t=0,n=e.length;t<n;t++){var r=e[t],i=Ee(this,r.prefix);"put"===r.type?i.set(r.key,r.value):i.set(r.key,null)}this._batch=this._batch.concat(e)},ke.prototype.execute=function(e,t){for(var n=new Ge,r=[],i=this._batch.length-1;i>=0;i--){var o=this._batch[i],s=o.prefix.prefix()[0]+"ÿ"+o.key;n.has(s)||(n.add(s),r.push(o))}e.batch(r,t)};var At="document-store",jt="by-sequence",Ot="attach-store",Lt="attach-binary-store",Rt="local-store",Ct="meta-store",Tt=new $e,Mt="_local_last_update_seq",Nt="_local_doc_count",It="_local_uuid",Dt="md5-",qt={encode:_e,decode:ye,buffer:!1,type:"cheap-json"},Ut=new v;Oe.valid=function(){return!0},Oe.use_prefix=!1;var Pt=function(e){e.adapter("memory",Oe,!0)};"undefined"==typeof PouchDB?function(e){if("undefined"!==console&&e in console){var t=Array.prototype.slice.call(arguments,1);console[e].apply(console,t)}}("error",'memory adapter plugin error: Cannot find global "PouchDB" object! Did you remember to include pouchdb.js?'):PouchDB.plugin(Pt)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{1:1,106:106,16:16,20:20,25:25,26:26,33:33,39:39,4:4,45:45,47:47,49:49,71:71,72:72,99:99}]},{},[107]);