UNPKG

185 kBJavaScriptView Raw
1// PouchDB localStorage plugin 7.0.0
2// Based on localstorage-down: https://github.com/No9/localstorage-down
3//
4// (c) 2012-2018 Dale Harvey and the PouchDB team
5// PouchDB may be freely distributed under the Apache license, version 2.0.
6// For all details and documentation:
7// http://pouchdb.com
8!function o(a,s,u){function f(t,e){if(!s[t]){if(!a[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(c)return c(t,!0);var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}var i=s[t]={exports:{}};a[t][0].call(i.exports,function(e){return f(a[t][1][e]||e)},i,i.exports,o,a,s,u)}return s[t].exports}for(var c="function"==typeof require&&require,e=0;e<u.length;e++)f(u[e]);return f}({1:[function(e,t,n){(function(n){function e(e){this._db=e,this._operations=[],this._written=!1}e.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")},e.prototype.put=function(e,t){this._checkWritten();var n=this._db._checkKeyValue(e,"key",this._db._isBuffer);if(n)throw n;if(n=this._db._checkKeyValue(t,"value",this._db._isBuffer))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},e.prototype.del=function(e){this._checkWritten();var t=this._db._checkKeyValue(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},e.prototype.clear=function(){return this._checkWritten(),this._operations=[],"function"==typeof this._clear&&this._clear(),this},e.prototype.write=function(e,t){if(this._checkWritten(),"function"==typeof e&&(t=e),"function"!=typeof t)throw new Error("write() requires a callback argument");return"object"!=typeof e&&(e={}),this._written=!0,"function"==typeof this._write?this._write(t):"function"==typeof this._db._batch?this._db._batch(this._operations,e,t):void n.nextTick(t)},t.exports=e}).call(this,e(60))},{60:60}],2:[function(e,t,n){(function(n){function e(e){this.db=e,this._ended=!1,this._nexting=!1}e.prototype.next=function(e){var t=this;if("function"!=typeof e)throw new Error("next() requires a callback argument");return t._ended?e(new Error("cannot call next() after end()")):t._nexting?e(new Error("cannot call next() before previous next() has completed")):(t._nexting=!0,"function"==typeof t._next?t._next(function(){t._nexting=!1,e.apply(null,arguments)}):void n.nextTick(function(){t._nexting=!1,e()}))},e.prototype.end=function(e){if("function"!=typeof e)throw new Error("end() requires a callback argument");return this._ended?e(new Error("end() already called on iterator")):(this._ended=!0,"function"==typeof this._end?this._end(e):void n.nextTick(e))},t.exports=e}).call(this,e(60))},{60:60}],3:[function(o,a,e){(function(t,s){var e=o(110),n=o(2),r=o(1);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}i.prototype.open=function(e,t){if("function"==typeof e&&(t=e),"function"!=typeof t)throw new Error("open() requires a callback argument");if("object"!=typeof e&&(e={}),"function"==typeof this._open)return this._open(e,t);s.nextTick(t)},i.prototype.close=function(e){if("function"!=typeof e)throw new Error("close() requires a callback argument");if("function"==typeof this._close)return this._close(e);s.nextTick(e)},i.prototype.get=function(e,t,n){var r;if("function"==typeof t&&(n=t),"function"!=typeof n)throw new Error("get() requires a callback argument");return(r=this._checkKeyValue(e,"key",this._isBuffer))?n(r):(this._isBuffer(e)||(e=String(e)),"object"!=typeof t&&(t={}),"function"==typeof this._get?this._get(e,t,n):void s.nextTick(function(){n(new Error("NotFound"))}))},i.prototype.put=function(e,t,n,r){var i;if("function"==typeof n&&(r=n),"function"!=typeof r)throw new Error("put() requires a callback argument");return(i=this._checkKeyValue(e,"key",this._isBuffer))?r(i):(i=this._checkKeyValue(t,"value",this._isBuffer))?r(i):(this._isBuffer(e)||(e=String(e)),this._isBuffer(t)||s.browser||(t=String(t)),"object"!=typeof n&&(n={}),"function"==typeof this._put?this._put(e,t,n,r):void s.nextTick(r))},i.prototype.del=function(e,t,n){var r;if("function"==typeof t&&(n=t),"function"!=typeof n)throw new Error("del() requires a callback argument");return(r=this._checkKeyValue(e,"key",this._isBuffer))?n(r):(this._isBuffer(e)||(e=String(e)),"object"!=typeof t&&(t={}),"function"==typeof this._del?this._del(e,t,n):void s.nextTick(n))},i.prototype.batch=function(e,t,n){if(!arguments.length)return this._chainedBatch();if("function"==typeof t&&(n=t),"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"));"object"!=typeof t&&(t={});for(var r,i,o=0,a=e.length;o<a;o++)if("object"==typeof(r=e[o])){if(i=this._checkKeyValue(r.type,"type",this._isBuffer))return n(i);if(i=this._checkKeyValue(r.key,"key",this._isBuffer))return n(i);if("put"==r.type&&(i=this._checkKeyValue(r.value,"value",this._isBuffer)))return n(i)}if("function"==typeof this._batch)return this._batch(e,t,n);s.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);s.nextTick(function(){n(null,0)})},i.prototype._setupIteratorOptions=function(t){var n=this;return t=e(t),["start","end","gt","gte","lt","lte"].forEach(function(e){t[e]&&n._isBuffer(t[e])&&0===t[e].length&&delete t[e]}),t.reverse=!!t.reverse,t.reverse&&t.lt&&(t.start=t.lt),t.reverse&&t.lte&&(t.start=t.lte),!t.reverse&&t.gt&&(t.start=t.gt),!t.reverse&&t.gte&&(t.start=t.gte),(t.reverse&&t.lt&&!t.lte||!t.reverse&&t.gt&&!t.gte)&&(t.exclusiveStart=!0),t},i.prototype.iterator=function(e){return"object"!=typeof e&&(e={}),e=this._setupIteratorOptions(e),"function"==typeof this._iterator?this._iterator(e):new n(this)},i.prototype._chainedBatch=function(){return new r(this)},i.prototype._isBuffer=function(e){return t.isBuffer(e)},i.prototype._checkKeyValue=function(e,t){if(null==e)return new Error(t+" cannot be `null` or `undefined`");if(null==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")},a.exports.AbstractLevelDOWN=i,a.exports.AbstractIterator=n,a.exports.AbstractChainedBatch=r}).call(this,{isBuffer:o(25)},o(60))},{1:1,110:110,2:2,25:25,60:60}],4:[function(e,t,n){"use strict";t.exports=function(r){return function(){var e=arguments.length;if(e){for(var t=[],n=-1;++n<e;)t[n]=arguments[n];return r.call(this,t)}return r.call(this,[])}}},{}],5:[function(w,E,e){(function(t){"use strict";function o(e,t){if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0}function a(e){return t.Buffer&&"function"==typeof t.Buffer.isBuffer?t.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}var c=w(8),r=Object.prototype.hasOwnProperty,l=Array.prototype.slice,n="foo"===function(){}.name;function s(e){return Object.prototype.toString.call(e)}function u(e){return!a(e)&&("function"==typeof t.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}var f=E.exports=e,i=/\s*function\s+([^\(\s]*)\s*/;function h(e){if(c.isFunction(e)){if(n)return e.name;var t=e.toString().match(i);return t&&t[1]}}function p(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function d(e){if(n||!c.isFunction(e))return c.inspect(e);var t=h(e);return"[Function"+(t?": "+t:"")+"]"}function y(e,t,n,r,i){throw new f.AssertionError({message:n,actual:e,expected:t,operator:r,stackStartFunction:i})}function e(e,t){e||y(e,!0,t,"==",f.ok)}function g(e,t,n,r){if(e===t)return!0;if(a(e)&&a(t))return 0===o(e,t);if(c.isDate(e)&&c.isDate(t))return e.getTime()===t.getTime();if(c.isRegExp(e)&&c.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(u(e)&&u(t)&&s(e)===s(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===o(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(a(e)!==a(t))return!1;var i=(r=r||{actual:[],expected:[]}).actual.indexOf(e);return-1!==i&&i===r.expected.indexOf(t)||(r.actual.push(e),r.expected.push(t),function(e,t,n,r){if(null==e||null==t)return!1;if(c.isPrimitive(e)||c.isPrimitive(t))return e===t;if(n&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var i=v(e),o=v(t);if(i&&!o||!i&&o)return!1;if(i)return e=l.call(e),t=l.call(t),g(e,t,n);var a,s,u=m(e),f=m(t);if(u.length!==f.length)return!1;for(u.sort(),f.sort(),s=u.length-1;0<=s;s--)if(u[s]!==f[s])return!1;for(s=u.length-1;0<=s;s--)if(a=u[s],!g(e[a],t[a],n,r))return!1;return!0}(e,t,n,r))}return n?e===t:e==t}function v(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function b(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function _(e,t,n,r){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(r=n,n=null),i=function(e){var t;try{e()}catch(e){t=e}return t}(t),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!i&&y(i,n,"Missing expected exception"+r);var o="string"==typeof r,a=!e&&i&&!n;if((!e&&c.isError(i)&&o&&b(i,n)||a)&&y(i,n,"Got unwanted exception"+r),e&&i&&n&&!b(i,n)||!e&&i)throw i}f.AssertionError=function(e){var t;this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=p(d((t=this).actual),128)+" "+t.operator+" "+p(d(t.expected),128),this.generatedMessage=!0);var n=e.stackStartFunction||y;if(Error.captureStackTrace)Error.captureStackTrace(this,n);else{var r=new Error;if(r.stack){var i=r.stack,o=h(n),a=i.indexOf("\n"+o);if(0<=a){var s=i.indexOf("\n",a+1);i=i.substring(s+1)}this.stack=i}}},c.inherits(f.AssertionError,Error),f.fail=y,f.ok=e,f.equal=function(e,t,n){e!=t&&y(e,t,n,"==",f.equal)},f.notEqual=function(e,t,n){e==t&&y(e,t,n,"!=",f.notEqual)},f.deepEqual=function(e,t,n){g(e,t,!1)||y(e,t,n,"deepEqual",f.deepEqual)},f.deepStrictEqual=function(e,t,n){g(e,t,!0)||y(e,t,n,"deepStrictEqual",f.deepStrictEqual)},f.notDeepEqual=function(e,t,n){g(e,t,!1)&&y(e,t,n,"notDeepEqual",f.notDeepEqual)},f.notDeepStrictEqual=function e(t,n,r){g(t,n,!0)&&y(t,n,r,"notDeepStrictEqual",e)},f.strictEqual=function(e,t,n){e!==t&&y(e,t,n,"===",f.strictEqual)},f.notStrictEqual=function(e,t,n){e===t&&y(e,t,n,"!==",f.notStrictEqual)},f.throws=function(e,t,n){_(!0,e,t,n)},f.doesNotThrow=function(e,t,n){_(!1,e,t,n)},f.ifError=function(e){if(e)throw e};var m=Object.keys||function(e){var t=[];for(var n in e)r.call(e,n)&&t.push(n);return t}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{8:8}],6:[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}},{}],7:[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}},{}],8:[function(h,e,O){(function(r,i){var s=/%[sdj%]/g;O.format=function(e){if(!m(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(u(arguments[n]));return t.join(" ")}n=1;for(var r=arguments,i=r.length,o=String(e).replace(s,function(e){if("%%"===e)return"%";if(i<=n)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<i;a=r[++n])b(a)||!c(a)?o+=" "+a:o+=" "+u(a);return o},O.deprecate=function(e,t){if(w(i.process))return function(){return O.deprecate(e,t).apply(this,arguments)};if(!0===r.noDeprecation)return e;var n=!1;return function(){if(!n){if(r.throwDeprecation)throw new Error(t);r.traceDeprecation?console.trace(t):console.error(t),n=!0}return e.apply(this,arguments)}};var e,o={};function u(e,t){var n={seen:[],stylize:f};return 3<=arguments.length&&(n.depth=arguments[2]),4<=arguments.length&&(n.colors=arguments[3]),v(t)?n.showHidden=t:t&&O._extend(n,t),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=a),p(n,e,n.depth)}function a(e,t){var n=u.styles[t];return n?"["+u.colors[n][0]+"m"+e+"["+u.colors[n][1]+"m":e}function f(e,t){return e}function p(t,n,r){if(t.customInspect&&n&&x(n.inspect)&&n.inspect!==O.inspect&&(!n.constructor||n.constructor.prototype!==n)){var e=n.inspect(r,t);return m(e)||(e=p(t,e,r)),e}var i=function(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")}if(_(t))return e.stylize(""+t,"number");if(v(t))return e.stylize(""+t,"boolean");if(b(t))return e.stylize("null","null")}(t,n);if(i)return i;var o,a=Object.keys(n),s=(o={},a.forEach(function(e,t){o[e]=!0}),o);if(t.showHidden&&(a=Object.getOwnPropertyNames(n)),S(n)&&(0<=a.indexOf("message")||0<=a.indexOf("description")))return d(n);if(0===a.length){if(x(n)){var u=n.name?": "+n.name:"";return t.stylize("[Function"+u+"]","special")}if(E(n))return t.stylize(RegExp.prototype.toString.call(n),"regexp");if(k(n))return t.stylize(Date.prototype.toString.call(n),"date");if(S(n))return d(n)}var f,c="",l=!1,h=["{","}"];(g(n)&&(l=!0,h=["[","]"]),x(n))&&(c=" [Function"+(n.name?": "+n.name:"")+"]");return E(n)&&(c=" "+RegExp.prototype.toString.call(n)),k(n)&&(c=" "+Date.prototype.toUTCString.call(n)),S(n)&&(c=" "+d(n)),0!==a.length||l&&0!=n.length?r<0?E(n)?t.stylize(RegExp.prototype.toString.call(n),"regexp"):t.stylize("[Object]","special"):(t.seen.push(n),f=l?function(t,n,r,i,e){for(var o=[],a=0,s=n.length;a<s;++a)B(n,String(a))?o.push(y(t,n,r,i,String(a),!0)):o.push("");return e.forEach(function(e){e.match(/^\d+$/)||o.push(y(t,n,r,i,e,!0))}),o}(t,n,r,s,a):a.map(function(e){return y(t,n,r,s,e,l)}),t.seen.pop(),function(e,t,n){if(60<e.reduce(function(e,t){return 0,0<=t.indexOf("\n")&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0))return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(f,c,h)):h[0]+c+h[1]}function d(e){return"["+Error.prototype.toString.call(e)+"]"}function y(e,t,n,r,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),B(r,i)||(a="["+i+"]"),s||(e.seen.indexOf(u.value)<0?-1<(s=b(n)?p(e,u.value,null):p(e,u.value,n-1)).indexOf("\n")&&(s=o?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),w(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function g(e){return Array.isArray(e)}function v(e){return"boolean"==typeof e}function b(e){return null===e}function _(e){return"number"==typeof e}function m(e){return"string"==typeof e}function w(e){return void 0===e}function E(e){return c(e)&&"[object RegExp]"===t(e)}function c(e){return"object"==typeof e&&null!==e}function k(e){return c(e)&&"[object Date]"===t(e)}function S(e){return c(e)&&("[object Error]"===t(e)||e instanceof Error)}function x(e){return"function"==typeof e}function t(e){return Object.prototype.toString.call(e)}function n(e){return e<10?"0"+e.toString(10):e.toString(10)}O.debuglog=function(t){if(w(e)&&(e=r.env.NODE_DEBUG||""),t=t.toUpperCase(),!o[t])if(new RegExp("\\b"+t+"\\b","i").test(e)){var n=r.pid;o[t]=function(){var e=O.format.apply(O,arguments);console.error("%s %d: %s",t,n,e)}}else o[t]=function(){};return o[t]},(O.inspect=u).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]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},O.isArray=g,O.isBoolean=v,O.isNull=b,O.isNullOrUndefined=function(e){return null==e},O.isNumber=_,O.isString=m,O.isSymbol=function(e){return"symbol"==typeof e},O.isUndefined=w,O.isRegExp=E,O.isObject=c,O.isDate=k,O.isError=S,O.isFunction=x,O.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},O.isBuffer=h(7);var l=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function B(e,t){return Object.prototype.hasOwnProperty.call(e,t)}O.log=function(){var e,t;console.log("%s - %s",(e=new Date,t=[n(e.getHours()),n(e.getMinutes()),n(e.getSeconds())].join(":"),[e.getDate(),l[e.getMonth()],t].join(" ")),O.format.apply(O,arguments))},O.inherits=h(6),O._extend=function(e,t){if(!t||!c(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e}}).call(this,h(60),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{6:6,60:60,7:7}],9:[function(e,t,n){"use strict";n.byteLength=function(e){var t=p(e),n=t[0],r=t[1];return 3*(n+r)/4-r},n.toByteArray=function(e){for(var t,n=p(e),r=n[0],i=n[1],o=new h((f=r,c=i,3*(f+c)/4-c)),a=0,s=0<i?r-4:r,u=0;u<s;u+=4)t=l[e.charCodeAt(u)]<<18|l[e.charCodeAt(u+1)]<<12|l[e.charCodeAt(u+2)]<<6|l[e.charCodeAt(u+3)],o[a++]=t>>16&255,o[a++]=t>>8&255,o[a++]=255&t;var f,c;2===i&&(t=l[e.charCodeAt(u)]<<2|l[e.charCodeAt(u+1)]>>4,o[a++]=255&t);1===i&&(t=l[e.charCodeAt(u)]<<10|l[e.charCodeAt(u+1)]<<4|l[e.charCodeAt(u+2)]>>2,o[a++]=t>>8&255,o[a++]=255&t);return o},n.fromByteArray=function(e){for(var t,n=e.length,r=n%3,i=[],o=0,a=n-r;o<a;o+=16383)i.push(u(e,o,a<o+16383?a:o+16383));1===r?(t=e[n-1],i.push(s[t>>2]+s[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],i.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return i.join("")};for(var s=[],l=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=r.length;i<o;++i)s[i]=r[i],l[r.charCodeAt(i)]=i;function p(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function u(e,t,n){for(var r,i,o=[],a=t;a<n;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),o.push(s[(i=r)>>18&63]+s[i>>12&63]+s[i>>6&63]+s[63&i]);return o.join("")}l["-".charCodeAt(0)]=62,l["_".charCodeAt(0)]=63},{}],10:[function(e,t,n){},{}],11:[function(e,t,n){(function(i){var o=Object.prototype.toString,a="function"==typeof i.alloc&&"function"==typeof i.allocUnsafe&&"function"==typeof i.from;t.exports=function(e,t,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return r=e,"ArrayBuffer"===o.call(r).slice(8,-1)?function(e,t,n){t>>>=0;var r=e.byteLength-t;if(r<0)throw new RangeError("'offset' is out of bounds");if(void 0===n)n=r;else if(r<(n>>>=0))throw new RangeError("'length' is out of bounds");return a?i.from(e.slice(t,t+n)):new i(new Uint8Array(e.slice(t,t+n)))}(e,t,n):"string"==typeof e?function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!i.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');return a?i.from(e,t):new i(e,t)}(e,t):a?i.from(e):new i(e);var r}}).call(this,e(12).Buffer)},{12:12}],12:[function(e,t,n){"use strict";var r=e(9),o=e(22);n.Buffer=l,n.SlowBuffer=function(e){+e!=e&&(e=0);return l.alloc(+e)},n.INSPECT_MAX_BYTES=50;var i=2147483647;function a(e){if(i<e)throw new RangeError("Invalid typed array length");var t=new Uint8Array(e);return t.__proto__=l.prototype,t}function l(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 f(e)}return s(e,t,n)}function s(e,t,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return q(e)||e&&q(e.buffer)?function(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');var r;r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n);return r.__proto__=l.prototype,r}(e,t,n):"string"==typeof e?function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|p(e,t),r=a(n),i=r.write(e,t);i!==n&&(r=r.slice(0,i));return r}(e,t):function(e){if(l.isBuffer(e)){var t=0|h(e.length),n=a(t);return 0===n.length||e.copy(n,0,0,t),n}if(e){if(ArrayBuffer.isView(e)||"length"in e)return"number"!=typeof e.length||N(e.length)?a(0):c(e);if("Buffer"===e.type&&Array.isArray(e.data))return c(e.data)}throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object.")}(e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('"size" argument must not be negative')}function f(e){return u(e),a(e<0?0:0|h(e))}function c(e){for(var t=e.length<0?0:0|h(e.length),n=a(t),r=0;r<t;r+=1)n[r]=255&e[r];return n}function h(e){if(i<=e)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function p(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||q(e))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 M(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return R(e).length;default:if(r)return M(e).length;t=(""+t).toLowerCase(),r=!0}}function d(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):2147483647<n?n=2147483647:n<-2147483648&&(n=-2147483648),N(n=+n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:g(e,t,n,r,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):g(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function g(e,t,n,r,i){var o,a=1,s=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/=a=2,u/=2,n/=2}function f(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=n;o<s;o++)if(f(e,o)===f(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===u)return c*a}else-1!==c&&(o-=o-c),c=-1}else for(s<n+u&&(n=s-u),o=n;0<=o;o--){for(var l=!0,h=0;h<u;h++)if(f(e,o+h)!==f(t,h)){l=!1;break}if(l)return o}return-1}function v(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?i<(r=Number(r))&&(r=i):r=i;var o=t.length;o/2<r&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(N(s))return a;e[n+a]=s}return a}function b(e,t,n,r){return I(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function _(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function m(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o,a,s,u,f=e[i],c=null,l=239<f?4:223<f?3:191<f?2:1;if(i+l<=n)switch(l){case 1:f<128&&(c=f);break;case 2:128==(192&(o=e[i+1]))&&127<(u=(31&f)<<6|63&o)&&(c=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&2047<(u=(15&f)<<12|(63&o)<<6|63&a)&&(u<55296||57343<u)&&(c=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&65535<(u=(15&f)<<18|(63&o)<<12|(63&a)<<6|63&s)&&u<1114112&&(c=u)}null===c?(c=65533,l=1):65535<c&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=l}return function(e){var t=e.length;if(t<=w)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=w));return n}(r)}n.kMaxLength=i,(l.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}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{get:function(){if(this instanceof l)return this.buffer}}),Object.defineProperty(l.prototype,"offset",{get:function(){if(this instanceof l)return this.byteOffset}}),"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),l.poolSize=8192,l.from=function(e,t,n){return s(e,t,n)},l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,l.alloc=function(e,t,n){return i=t,o=n,u(r=e),r<=0?a(r):void 0!==i?"string"==typeof o?a(r).fill(i,o):a(r).fill(i):a(r);var r,i,o},l.allocUnsafe=function(e){return f(e)},l.allocUnsafeSlow=function(e){return f(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer},l.compare=function(e,t){if(!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},l.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}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);var n;if(void 0===t)for(n=t=0;n<e.length;++n)t+=e[n].length;var r=l.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var o=e[n];if(ArrayBuffer.isView(o)&&(o=l.from(o)),!l.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},l.byteLength=p,l.prototype._isBuffer=!0,l.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)d(this,t,t+1);return this},l.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)d(this,t,t+3),d(this,t+1,t+2);return this},l.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)d(this,t,t+7),d(this,t+1,t+6),d(this,t+2,t+5),d(this,t+3,t+4);return this},l.prototype.toLocaleString=l.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?m(this,0,e):function(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))return"";for(e||(e="utf8");;)switch(e){case"hex":return S(this,t,n);case"utf8":case"utf-8":return m(this,t,n);case"ascii":return E(this,t,n);case"latin1":case"binary":return k(this,t,n);case"base64":return _(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}.apply(this,arguments)},l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",t=n.INSPECT_MAX_BYTES;return 0<this.length&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),"<Buffer "+e+">"},l.prototype.compare=function(e,t,n,r,i){if(!l.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===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(i<=r&&n<=t)return 0;if(i<=r)return-1;if(n<=t)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),u=this.slice(r,i),f=e.slice(t,n),c=0;c<s;++c)if(u[c]!==f[c]){o=u[c],a=f[c];break}return o<a?-1:a<o?1:0},l.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},l.prototype.indexOf=function(e,t,n){return y(this,e,t,n,!0)},l.prototype.lastIndexOf=function(e,t,n){return y(this,e,t,n,!1)},l.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||i<n)&&(n=i),0<e.length&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o,a,s,u,f,c,l,h,p,d=!1;;)switch(r){case"hex":return v(this,e,t,n);case"utf8":case"utf-8":return h=t,p=n,I(M(e,(l=this).length-h),l,h,p);case"ascii":return b(this,e,t,n);case"latin1":case"binary":return b(this,e,t,n);case"base64":return u=this,f=t,c=n,I(R(e),u,f,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a=t,s=n,I(function(e,t){for(var n,r,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(e,(o=this).length-a),o,a,s);default:if(d)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),d=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function E(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 k(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 S(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||r<n)&&(n=r);for(var i="",o=t;o<n;++o)i+=C(e[o]);return i}function x(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 B(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(n<e+t)throw new RangeError("Trying to access beyond buffer length")}function O(e,t,n,r,i,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(i<t||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function A(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 T(e,t,n,r,i){return t=+t,n>>>=0,i||A(e,0,n,4),o.write(e,t,n,r,23,4),n+4}function L(e,t,n,r,i){return t=+t,n>>>=0,i||A(e,0,n,8),o.write(e,t,n,r,52,8),n+8}l.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):n<e&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):n<t&&(t=n),t<e&&(t=e);var r=this.subarray(e,t);return r.__proto__=l.prototype,r},l.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||B(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},l.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||B(e,t,this.length);for(var r=this[e+--t],i=1;0<t&&(i*=256);)r+=this[e+--t]*i;return r},l.prototype.readUInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||B(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||B(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&&(r-=Math.pow(2,8*t)),r},l.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||B(e,t,this.length);for(var r=t,i=1,o=this[e+--r];0<r&&(i*=256);)o+=this[e+--r]*i;return(i*=128)<=o&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return e>>>=0,t||B(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||B(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt16BE=function(e,t){e>>>=0,t||B(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||B(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return e>>>=0,t||B(e,4,this.length),o.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||B(e,4,this.length),o.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||B(e,8,this.length),o.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||B(e,8,this.length),o.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t>>>=0,n>>>=0,r)||O(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},l.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t>>>=0,n>>>=0,r)||O(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;0<=--i&&(o*=256);)this[t+i]=e/o&255;return t+n},l.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||O(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},l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||O(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},l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);O(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<n&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var i=Math.pow(2,8*n-1);O(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;0<=--o&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||O(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||O(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},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||O(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},l.prototype.writeFloatLE=function(e,t,n){return T(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return T(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},l.prototype.copy=function(e,t,n,r){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),0<r&&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("Index out of range");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=r-n;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,n,r);else if(this===e&&n<t&&t<r)for(var o=i-1;0<=o;--o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,r),t);return i},l.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),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!l.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){var i=e.charCodeAt(0);("utf8"===r&&i<128||"latin1"===r)&&(e=i)}}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;var o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{var a=l.isBuffer(e)?e:new l(e,r),s=a.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-t;++o)this[o+t]=a[o%s]}return this};var j=/[^+/0-9A-Za-z-_]/g;function C(e){return e<16?"0"+e.toString(16):e.toString(16)}function M(e,t){var n;t=t||1/0;for(var r=e.length,i=null,o=[],a=0;a<r;++a){if(55295<(n=e.charCodeAt(a))&&n<57344){if(!i){if(56319<n){-1<(t-=3)&&o.push(239,191,189);continue}if(a+1===r){-1<(t-=3)&&o.push(239,191,189);continue}i=n;continue}if(n<56320){-1<(t-=3)&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&-1<(t-=3)&&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 R(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(j,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function I(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 q(e){return e instanceof ArrayBuffer||null!=e&&null!=e.constructor&&"ArrayBuffer"===e.constructor.name&&"number"==typeof e.byteLength}function N(e){return e!=e}},{22:22,9:9}],13:[function(e,t,n){(function(e){function t(e){return Object.prototype.toString.call(e)}n.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===t(e)},n.isBoolean=function(e){return"boolean"==typeof e},n.isNull=function(e){return null===e},n.isNullOrUndefined=function(e){return null==e},n.isNumber=function(e){return"number"==typeof e},n.isString=function(e){return"string"==typeof e},n.isSymbol=function(e){return"symbol"==typeof e},n.isUndefined=function(e){return void 0===e},n.isRegExp=function(e){return"[object RegExp]"===t(e)},n.isObject=function(e){return"object"==typeof e&&null!==e},n.isDate=function(e){return"[object Date]"===t(e)},n.isError=function(e){return"[object Error]"===t(e)||e instanceof Error},n.isFunction=function(e){return"function"==typeof e},n.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},n.isBuffer=e.isBuffer}).call(this,{isBuffer:e(25)})},{25:25}],14:[function(e,t,n){var u=e(12).Buffer,r=".PYFGCRLAOEUIDHTNSQJKXBMWVZ_pyfgcrlaoeuidhtnsqjkxbmwvz1234567890".split("").sort().join("");t.exports=function(a,e){if(e=e||{},64!==(a=a||r).length)throw new Error("a base 64 encoding requires 64 chars");var s=new u(128);s.fill();for(var t=0;t<64;t++){var n=a.charCodeAt(t);s[n]=t}return e.encode=function(e){for(var t="",n=e.length,r=0,i=0;i<n;i++){var o=e[i];switch(i%3){case 0:t+=a[o>>2],r=(3&o)<<4;break;case 1:t+=a[r|o>>4],r=(15&o)<<2;break;case 2:t+=a[r|o>>6],t+=a[63&o],r=0}}return n%3&&(t+=a[r]),t},e.decode=function(e){for(var t=e.length,n=0,r=new u(~~(t/4*3)),i=0,o=0;o<t;o++){var a=s[e.charCodeAt(o)];switch(o%4){case 0:i=a<<2;break;case 1:r[n++]=i|a>>4,i=a<<4&255;break;case 2:r[n++]=i|a>>2,i=a<<6&255;break;case 3:r[n++]=i|a}}return r},e},t.exports(r,t.exports)},{12:12}],15:[function(e,t,n){"use strict";function r(e){if(this._capacity=o(e),this._length=0,this._front=0,i(e)){for(var t=e.length,n=0;n<t;++n)this[n]=e[n];this._length=t}}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(1<t){var r=this._capacity;if(r<n+t){for(var i=0;i<t;++i){this._checkCapacity(n+1),this[o=this._front+n&this._capacity-1]=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}return 0===t?n:(this._checkCapacity(n+1),this[i=this._front+n&this._capacity-1]=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(1<n){if((i=this._capacity)<t+n){for(var r=n-1;0<=r;r--){this._checkCapacity(t+1);var i=this._capacity;this[a=(this._front-1&i-1^i)-i]=arguments[r],t++,this._length=t,this._front=a}return t}var o=this._front;for(r=n-1;0<=r;r--){var a;this[a=(o-1&i-1^i)-i]=arguments[r],o=a}return this._front=o,this._length=t+n,t+n}if(0===n)return t;this._checkCapacity(t+1);i=this._capacity;return this[r=(this._front-1&i-1^i)-i]=e,this._length=t+1,this._front=r,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||n<=t))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.valueOf=r.prototype.toString=function(){return this.toArray().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(o(1.5*this._capacity+16))},r.prototype._resizeTo=function(e){var t=this._capacity;this._capacity=e;var n=this._front,r=this._length;t<n+r&&function(e,t,n,r,i){for(var o=0;o<i;++o)n[o+r]=e[o+t],e[o+t]=void 0}(this,0,this,t,n+r&t-1)};var i=Array.isArray;function o(e){if("number"!=typeof e){if(!i(e))return 16;e=e.length}return t=Math.min(Math.max(16,e),1073741824),t>>>=0,t-=1,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,1+(t|=t>>16);var t}t.exports=r},{}],16:[function(e,t,n){var r=e(61);function s(e,t,n){t&&"string"!=typeof t&&(t=t.message||t.name),r(this,{type:e,name:e,cause:"string"!=typeof t?t:n,message:t},"ewr")}function u(e,t){Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),s.call(this,"CustomError",e,t)}u.prototype=new Error,t.exports=function(a){var e=function(e,t){return n=a,r=e,(o=function(e,t){s.call(this,r,e,t),"FilesystemError"==r&&(this.code=this.cause.code,this.path=this.cause.path,this.errno=this.cause.errno,this.message=(n.errno[this.cause.errno]?n.errno[this.cause.errno].description:this.cause.message)+(this.cause.path?" ["+this.cause.path+"]":"")),Error.call(this),Error.captureStackTrace&&Error.captureStackTrace(this,o)}).prototype=(i=t)?new i:new u,o;var n,r,i,o};return{CustomError:u,FilesystemError:e("FilesystemError"),createError:e}}},{61:61}],17:[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(16)(t.exports),t.exports.create=t.exports.custom.createError},{16:16}],18:[function(e,t,n){var u=Object.create||function(e){var t=function(){};return t.prototype=e,new t},a=Object.keys||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return n},o=Function.prototype.bind||function(e){var t=this;return function(){return t.apply(e,arguments)}};function r(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=u(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}((t.exports=r).EventEmitter=r).prototype._events=void 0,r.prototype._maxListeners=void 0;var i,s=10;try{var f={};Object.defineProperty&&Object.defineProperty(f,"x",{value:0}),i=0===f.x}catch(e){i=!1}function c(e){return void 0===e._maxListeners?r.defaultMaxListeners:e._maxListeners}function l(e,t,n,r){var i,o,a;if("function"!=typeof n)throw new TypeError('"listener" argument must be a function');if((o=e._events)?(o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),a=o[t]):(o=e._events=u(null),e._eventsCount=0),a){if("function"==typeof a?a=o[t]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),!a.warned&&(i=c(e))&&0<i&&a.length>i){a.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+a.length+' "'+String(t)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=a.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",s.name,s.message)}}else a=o[t]=n,++e._eventsCount;return e}function h(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var e=new Array(arguments.length),t=0;t<e.length;++t)e[t]=arguments[t];this.listener.apply(this.target,e)}}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=o.call(h,r);return i.listener=n,r.wrapFn=i}function d(e,t,n){var r=e._events;if(!r)return[];var i=r[t];return i?"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):g(i,i.length):[]}function y(e){var t=this._events;if(t){var n=t[e];if("function"==typeof n)return 1;if(n)return n.length}return 0}function g(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}i?Object.defineProperty(r,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||e!=e)throw new TypeError('"defaultMaxListeners" must be a positive number');s=e}}):r.defaultMaxListeners=s,r.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},r.prototype.getMaxListeners=function(){return c(this)},r.prototype.emit=function(e){var t,n,r,i,o,a,s="error"===e;if(a=this._events)s=s&&null==a.error;else if(!s)return!1;if(s){if(1<arguments.length&&(t=arguments[1]),t instanceof Error)throw t;var u=new Error('Unhandled "error" event. ('+t+")");throw u.context=t,u}if(!(n=a[e]))return!1;var f="function"==typeof n;switch(r=arguments.length){case 1:!function(e,t,n){if(t)e.call(n);else for(var r=e.length,i=g(e,r),o=0;o<r;++o)i[o].call(n)}(n,f,this);break;case 2:!function(e,t,n,r){if(t)e.call(n,r);else for(var i=e.length,o=g(e,i),a=0;a<i;++a)o[a].call(n,r)}(n,f,this,arguments[1]);break;case 3:!function(e,t,n,r,i){if(t)e.call(n,r,i);else for(var o=e.length,a=g(e,o),s=0;s<o;++s)a[s].call(n,r,i)}(n,f,this,arguments[1],arguments[2]);break;case 4:!function(e,t,n,r,i,o){if(t)e.call(n,r,i,o);else for(var a=e.length,s=g(e,a),u=0;u<a;++u)s[u].call(n,r,i,o)}(n,f,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(r-1),o=1;o<r;o++)i[o-1]=arguments[o];!function(e,t,n,r){if(t)e.apply(n,r);else for(var i=e.length,o=g(e,i),a=0;a<i;++a)o[a].apply(n,r)}(n,f,this,i)}return!0},r.prototype.on=r.prototype.addListener=function(e,t){return l(this,e,t,!1)},r.prototype.prependListener=function(e,t){return l(this,e,t,!0)},r.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.on(e,p(this,e,t)),this},r.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');return this.prependListener(e,p(this,e,t)),this},r.prototype.removeListener=function(e,t){var n,r,i,o,a;if("function"!=typeof t)throw new TypeError('"listener" argument must be a function');if(!(r=this._events))return this;if(!(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=u(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length-1;0<=o;o--)if(n[o]===t||n[o].listener===t){a=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(var n=t,r=n+1,i=e.length;r<i;n+=1,r+=1)e[n]=e[r];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),r.removeListener&&this.emit("removeListener",e,a||t)}return this},r.prototype.removeAllListeners=function(e){var t,n,r;if(!(n=this._events))return this;if(!n.removeListener)return 0===arguments.length?(this._events=u(null),this._eventsCount=0):n[e]&&(0==--this._eventsCount?this._events=u(null):delete n[e]),this;if(0===arguments.length){var i,o=a(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=u(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(t)for(r=t.length-1;0<=r;r--)this.removeListener(e,t[r]);return this},r.prototype.listeners=function(e){return d(this,e,!0)},r.prototype.rawListeners=function(e){return d(this,e,!1)},r.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):y.call(e,t)},r.prototype.listenerCount=y,r.prototype.eventNames=function(){return 0<this._eventsCount?Reflect.ownKeys(this._events):[]}},{}],19:[function(e,t,n){"object"==typeof n&&(t.exports=function(){try{if("undefined"==typeof localStorage)return!1;if(localStorage.setItem("Storage-Test","1"),"1"!==localStorage.getItem("Storage-Test"))return!1;localStorage.removeItem("Storage-Test")}catch(e){return!1}return!0})},{}],20:[function(e,i,t){(function(t){var n=i.exports={},r=e(57);n.hasLocalStorage=e(19),n.create=function(){var e;return n.hasLocalStorage()?(e=t.localStorage,e={get length(){return t.localStorage.length},getItem:t.localStorage.getItem.bind(t.localStorage),setItem:t.localStorage.setItem.bind(t.localStorage),removeItem:t.localStorage.removeItem.bind(t.localStorage),key:t.localStorage.key.bind(t.localStorage),clear:t.localStorage.clear.bind(t.localStorage),isPersistent:!0}):(e=r).isPersistent=!1,e.getObject=n.getObject.bind(null,e),e.setObject=n.setObject.bind(null,e),e},n.setObject=function(e,t,n){return"object"!=typeof n?e.setItem(t,n):e.setItem(t,JSON.stringify(n))},n.getObject=function(e,t){var n=e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch(e){return n}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{19:19,57:57}],21:[function(e,t,n){var r=e(20);t.exports=r.create()},{20:20}],22:[function(e,t,n){n.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,f=u>>1,c=-7,l=n?i-1:0,h=n?-1:1,p=e[t+l];for(l+=h,o=p&(1<<-c)-1,p>>=-c,c+=s;0<c;o=256*o+e[t+l],l+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;0<c;a=256*a+e[t+l],l+=h,c-=8);if(0===o)o=1-f;else{if(o===u)return a?NaN:1/0*(p?-1:1);a+=Math.pow(2,r),o-=f}return(p?-1:1)*a*Math.pow(2,o-r)},n.write=function(e,t,n,r,i,o){var a,s,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,p=r?0:o-1,d=r?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),2<=(t+=1<=a+l?h/u:h*Math.pow(2,1-l))*u&&(a++,u/=2),c<=a+l?(s=0,a=c):1<=a+l?(s=(t*u-1)*Math.pow(2,i),a+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),a=0));8<=i;e[n+p]=255&s,p+=d,s/=256,i-=8);for(a=a<<i|s,f+=i;0<f;e[n+p]=255&a,p+=d,a/=256,f-=8);e[n+p-d]|=128*y}},{}],23:[function(e,c,t){(function(t){"use strict";var n,r,e=t.MutationObserver||t.WebKitMutationObserver;if(e){var i=0,o=new e(f),a=t.document.createTextNode("");o.observe(a,{characterData:!0}),n=function(){a.data=i=++i%2}}else if(t.setImmediate||void 0===t.MessageChannel)n="document"in t&&"onreadystatechange"in t.document.createElement("script")?function(){var e=t.document.createElement("script");e.onreadystatechange=function(){f(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},t.document.documentElement.appendChild(e)}:function(){setTimeout(f,0)};else{var s=new t.MessageChannel;s.port1.onmessage=f,n=function(){s.port2.postMessage(0)}}var u=[];function f(){var e,t;r=!0;for(var n=u.length;n;){for(t=u,u=[],e=-1;++e<n;)t[e]();n=u.length}r=!1}c.exports=function(e){1!==u.push(e)||r||n()}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],24:[function(e,t,n){arguments[4][6][0].apply(n,arguments)},{6:6}],25:[function(e,t,n){function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}t.exports=function(e){return null!=e&&(r(e)||"function"==typeof(t=e).readFloatLE&&"function"==typeof t.slice&&r(t.slice(0,0))||!!e._isBuffer);var t}},{}],26:[function(e,t,n){var r={}.toString;t.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},{}],27:[function(e,t,n){var r=e(28);function i(e){this.opts=e||{},this.encodings=r}(t.exports=i).prototype._encoding=function(e){return"string"==typeof e&&(e=r[e]),e||(e=r.id),e},i.prototype._keyEncoding=function(e,t){return this._encoding(t&&t.keyEncoding||e&&e.keyEncoding||this.opts.keyEncoding)},i.prototype._valueEncoding=function(e,t){return this._encoding(t&&(t.valueEncoding||t.encoding)||e&&(e.valueEncoding||e.encoding)||this.opts.valueEncoding||this.opts.encoding)},i.prototype.encodeKey=function(e,t,n){return this._keyEncoding(t,n).encode(e)},i.prototype.encodeValue=function(e,t,n){return this._valueEncoding(t,n).encode(e)},i.prototype.decodeKey=function(e,t){return this._keyEncoding(t).decode(e)},i.prototype.decodeValue=function(e,t){return this._valueEncoding(t).decode(e)},i.prototype.encodeBatch=function(e,n){var r=this;return e.map(function(e){var t={type:e.type,key:r.encodeKey(e.key,n,e)};return r.keyAsBuffer(n,e)&&(t.keyEncoding="binary"),e.prefix&&(t.prefix=e.prefix),"value"in e&&(t.value=r.encodeValue(e.value,n,e),r.valueAsBuffer(n,e)&&(t.valueEncoding="binary")),t})};var o=["lt","gt","lte","gte","start","end"];i.prototype.encodeLtgt=function(t){var n=this,r={};return Object.keys(t).forEach(function(e){r[e]=-1<o.indexOf(e)?n.encodeKey(t[e],t):t[e]}),r},i.prototype.createStreamDecoder=function(n){var r=this;return n.keys&&n.values?function(e,t){return{key:r.decodeKey(e,n),value:r.decodeValue(t,n)}}:n.keys?function(e){return r.decodeKey(e,n)}:n.values?function(e,t){return r.decodeValue(t,n)}:function(){}},i.prototype.keyAsBuffer=function(e){return this._keyEncoding(e).buffer},i.prototype.valueAsBuffer=function(e){return this._valueEncoding(e).buffer}},{28:28}],28:[function(e,t,i){(function(n){i.utf8=i["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"},i.json={encode:JSON.stringify,decode:JSON.parse,buffer:!1,type:"json"},i.binary={encode:function(e){return r(e)?e:new n(e)},decode:e,buffer:!0,type:"binary"},i.none={encode:e,decode:e,buffer:!1,type:"id"},i.id=i.none;function e(e){return e}function r(e){return null==e||n.isBuffer(e)}["hex","ascii","base64","ucs2","ucs-2","utf16le","utf-16le"].forEach(function(t){i[t]={encode:function(e){return r(e)?e:new n(e,t)},decode:function(e){return e.toString(t)},buffer:!0,type:t}})}).call(this,e(12).Buffer)},{12:12}],29:[function(e,t,n){var r=e(24),i=e(38).Readable,o=e(39);function a(e,t){if(!(this instanceof a))return new a(e,t);t=t||{},i.call(this,o(t,{objectMode:!0})),this._iterator=e,this._destroyed=!1,this._options=t,this.on("end",this._cleanup.bind(this))}r(t.exports=a,i),a.prototype._read=function(){var r=this,i=this._options;this._destroyed||this._iterator.next(function(e,t,n){if(!r._destroyed)return e?r.emit("error",e):void(void 0===t&&void 0===n?r.push(null):!1!==i.keys&&!1===i.values?r.push(t):!1===i.keys&&!1!==i.values?r.push(n):r.push({key:t,value:n}))})},a.prototype.destroy=a.prototype._cleanup=function(){var t=this;this._destroyed||(this._destroyed=!0,this._iterator.end(function(e){if(e)return t.emit("error",e);t.emit("close")}))}},{24:24,38:38,39:39}],30:[function(e,t,n){"use strict";var r=e(59),i=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};t.exports=l;var o=e(13);o.inherits=e(24);var a=e(32),s=e(34);o.inherits(l,a);for(var u=i(s.prototype),f=0;f<u.length;f++){var c=u[f];l.prototype[c]||(l.prototype[c]=s.prototype[c])}function l(e){if(!(this instanceof l))return new l(e);a.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",h)}function h(){this.allowHalfOpen||this._writableState.ended||r.nextTick(p,this)}function p(e){e.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),l.prototype._destroy=function(e,t){this.push(null),this.end(),r.nextTick(t,e)}},{13:13,24:24,32:32,34:34,59:59}],31:[function(e,t,n){"use strict";t.exports=o;var r=e(33),i=e(13);function o(e){if(!(this instanceof o))return new o(e);r.call(this,e)}i.inherits=e(24),i.inherits(o,r),o.prototype._transform=function(e,t,n){n(null,e)}},{13:13,24:24,33:33}],32:[function(M,R,e){(function(g,e){"use strict";var v=M(59);R.exports=h;var a,b=M(26);h.ReadableState=o;M(18).EventEmitter;var _=function(e,t){return e.listeners(t).length},i=M(37),f=M(70).Buffer,c=e.Uint8Array||function(){};var t=M(13);t.inherits=M(24);var n=M(10),m=void 0;m=n&&n.debuglog?n.debuglog("stream"):function(){};var s,u=M(35),r=M(36);t.inherits(h,i);var l=["error","close","destroy","pause","resume"];function o(e,t){e=e||{};var n=t instanceof(a=a||M(30));this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var r=e.highWaterMark,i=e.readableHighWaterMark,o=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:n&&(i||0===i)?i:o,this.highWaterMark=Math.floor(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.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(s||(s=M(86).StringDecoder),this.decoder=new s(e.encoding),this.encoding=e.encoding)}function h(e){if(a=a||M(30),!(this instanceof h))return new h(e);this._readableState=new o(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),i.call(this)}function p(e,t,n,r,i){var o,a,s,u=e._readableState;null===t?(u.reading=!1,function(e,t){if(t.ended)return;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,E(e)}(e,u)):(i||(o=function(e,t){var n;r=t,f.isBuffer(r)||r instanceof c||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(u,t)),o?e.emit("error",o):u.objectMode||t&&0<t.length?("string"==typeof t||u.objectMode||Object.getPrototypeOf(t)===f.prototype||(a=t,t=f.from(a)),r?u.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):d(e,u,t,!0):u.ended?e.emit("error",new Error("stream.push() after EOF")):(u.reading=!1,u.decoder&&!n?(t=u.decoder.write(t),u.objectMode||0!==t.length?d(e,u,t,!1):S(e,u)):d(e,u,t,!1))):r||(u.reading=!1));return!(s=u).ended&&(s.needReadable||s.length<s.highWaterMark||0===s.length)}function d(e,t,n,r){t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&E(e)),S(e,t)}Object.defineProperty(h.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),h.prototype.destroy=r.destroy,h.prototype._undestroy=r.undestroy,h.prototype._destroy=function(e,t){this.push(null),t(e)},h.prototype.push=function(e,t){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof e&&((t=t||r.defaultEncoding)!==r.encoding&&(e=f.from(e,t),t=""),n=!0),p(this,e,t,!1,n)},h.prototype.unshift=function(e){return p(this,e,null,!0,!1)},h.prototype.isPaused=function(){return!1===this._readableState.flowing},h.prototype.setEncoding=function(e){return s||(s=M(86).StringDecoder),this._readableState.decoder=new s(e),this._readableState.encoding=e,this};var y=8388608;function w(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=(y<=(n=e)?n=y:(n--,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n++),n)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0));var n}function E(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(m("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?v.nextTick(k,e):k(e))}function k(e){m("emit readable"),e.emit("readable"),A(e)}function S(e,t){t.readingMore||(t.readingMore=!0,v.nextTick(x,e,t))}function x(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(m("maybeReadMore read 0"),e.read(0),n!==t.length);)n=t.length;t.readingMore=!1}function B(e){m("readable nexttick read 0"),e.read(0)}function O(e,t){t.reading||(m("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),A(e),t.flowing&&!t.reading&&e.read(0)}function A(e){var t=e._readableState;for(m("flow",t.flowing);t.flowing&&null!==e.read(););}function T(e,t){return 0===t.length?null:(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=function(e,t,n){var r;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?function(e,t){var n=t.head,r=1,i=n.data;e-=i.length;for(;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n).data=o.slice(a);break}++r}return t.length-=r,i}(e,t):function(e,t){var n=f.allocUnsafe(e),r=t.head,i=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(o.copy(n,n.length-e,0,a),0===(e-=a)){a===o.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r).data=o.slice(a);break}++i}return t.length-=i,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function L(e){var t=e._readableState;if(0<t.length)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,v.nextTick(j,t,e))}function j(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function C(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}h.prototype.read=function(e){m("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 m("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?L(this):E(this),null;if(0===(e=w(e,t))&&t.ended)return 0===t.length&&L(this),null;var r,i=t.needReadable;return m("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&m("length less than watermark",i=!0),t.ended||t.reading?m("reading or ended",i=!1):i&&(m("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=w(n,t))),null===(r=0<e?T(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&L(this)),null!==r&&this.emit("data",r),r},h.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},h.prototype.pipe=function(n,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=n;break;case 1:i.pipes=[i.pipes,n];break;default:i.pipes.push(n)}i.pipesCount+=1,m("pipe count=%d opts=%j",i.pipesCount,e);var t=(!e||!1!==e.end)&&n!==g.stdout&&n!==g.stderr?a:y;function o(e,t){m("onunpipe"),e===r&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,m("cleanup"),n.removeListener("close",p),n.removeListener("finish",d),n.removeListener("drain",u),n.removeListener("error",h),n.removeListener("unpipe",o),r.removeListener("end",a),r.removeListener("end",y),r.removeListener("data",l),f=!0,!i.awaitDrain||n._writableState&&!n._writableState.needDrain||u())}function a(){m("onend"),n.end()}i.endEmitted?v.nextTick(t):r.once("end",t),n.on("unpipe",o);var s,u=(s=r,function(){var e=s._readableState;m("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&_(s,"data")&&(e.flowing=!0,A(s))});n.on("drain",u);var f=!1;var c=!1;function l(e){m("ondata"),(c=!1)!==n.write(e)||c||((1===i.pipesCount&&i.pipes===n||1<i.pipesCount&&-1!==C(i.pipes,n))&&!f&&(m("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,c=!0),r.pause())}function h(e){m("onerror",e),y(),n.removeListener("error",h),0===_(n,"error")&&n.emit("error",e)}function p(){n.removeListener("finish",d),y()}function d(){m("onfinish"),n.removeListener("close",p),y()}function y(){m("unpipe"),r.unpipe(n)}return r.on("data",l),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?b(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(n,"error",h),n.once("close",p),n.once("finish",d),n.emit("pipe",r),i.flowing||(m("pipe resume"),r.resume()),n},h.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)r[o].emit("unpipe",this,n);return this}var a=C(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,n)),this},h.prototype.addListener=h.prototype.on=function(e,t){var n=i.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&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&&E(this):v.nextTick(B,this))}return n},h.prototype.resume=function(){var e,t,n=this._readableState;return n.flowing||(m("resume"),n.flowing=!0,e=this,(t=n).resumeScheduled||(t.resumeScheduled=!0,v.nextTick(O,e,t))),this},h.prototype.pause=function(){return m("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(m("pause"),this._readableState.flowing=!1,this.emit("pause")),this},h.prototype.wrap=function(t){var n=this,r=this._readableState,i=!1;for(var e in t.on("end",function(){if(m("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&n.push(e)}n.push(null)}),t.on("data",function(e){(m("wrapped data"),r.decoder&&(e=r.decoder.write(e)),r.objectMode&&null==e)||(r.objectMode||e&&e.length)&&(n.push(e)||(i=!0,t.pause()))}),t)void 0===this[e]&&"function"==typeof t[e]&&(this[e]=function(e){return function(){return t[e].apply(t,arguments)}}(e));for(var o=0;o<l.length;o++)t.on(l[o],this.emit.bind(this,l[o]));return this._read=function(e){m("wrapped _read",e),i&&(i=!1,t.resume())},this},Object.defineProperty(h.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),h._fromList=T}).call(this,M(60),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{10:10,13:13,18:18,24:24,26:26,30:30,35:35,36:36,37:37,59:59,60:60,70:70,86:86}],33:[function(e,t,n){"use strict";t.exports=o;var r=e(30),i=e(13);function o(e){if(!(this instanceof o))return new o(e);r.call(this,e),this._transformState={afterTransform:function(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,(n.writecb=null)!=t&&this.push(t),r(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},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.on("prefinish",a)}function a(){var n=this;"function"==typeof this._flush?this._flush(function(e,t){s(n,e,t)}):s(this,null,null)}function s(e,t,n){if(t)return e.emit("error",t);if(null!=n&&e.push(n),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}i.inherits=e(24),i.inherits(o,r),o.prototype.push=function(e,t){return this._transformState.needTransform=!1,r.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},o.prototype._destroy=function(e,t){var n=this;r.prototype._destroy.call(this,e,function(e){t(e),n.emit("close")})}},{13:13,24:24,30:30}],34:[function(k,S,e){(function(e,t,n){"use strict";var v=k(59);function l(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}S.exports=c;var s,h=!e.browser&&-1<["v0.10","v0.9."].indexOf(e.version.slice(0,5))?n:v.nextTick;c.WritableState=f;var r=k(13);r.inherits=k(24);var i={deprecate:k(101)},o=k(37),b=k(70).Buffer,_=t.Uint8Array||function(){};var a,u=k(36);function m(){}function f(e,t){s=s||k(30),e=e||{};var n=t instanceof s;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var r=e.highWaterMark,i=e.writableHighWaterMark,o=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:n&&(i||0===i)?i:o,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1;var a=(this.destroyed=!1)===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(l=n,l.writing=!1,l.writecb=null,l.length-=l.writelen,l.writelen=0,t)a=e,s=n,u=r,f=t,c=i,--s.pendingcb,u?(v.nextTick(c,f),v.nextTick(E,a,s),a._writableState.errorEmitted=!0,a.emit("error",f)):(c(f),a._writableState.errorEmitted=!0,a.emit("error",f),E(a,s));else{var o=y(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||d(e,n),r?h(p,e,n,o,i):p(e,n,o,i)}var a,s,u,f,c;var l}(t,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 l(this)}function c(e){if(s=s||k(30),!(a.call(c,this)||this instanceof s))return new c(e);this._writableState=new f(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),o.call(this)}function w(e,t,n,r,i,o,a){t.writelen=r,t.writecb=a,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function p(e,t,n,r){var i,o;n||(i=e,0===(o=t).length&&o.needDrain&&(o.needDrain=!1,i.emit("drain"))),t.pendingcb--,r(),E(e,t)}function d(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 a=0,s=!0;n;)(i[a]=n).isBuf||(s=!1),n=n.next,a+=1;i.allBuffers=s,w(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 l(t),t.bufferedRequestCount=0}else{for(;n;){var u=n.chunk,f=n.encoding,c=n.callback;if(w(e,t,!1,t.objectMode?1:u.length,u,f,c),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function y(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function g(t,n){t._final(function(e){n.pendingcb--,e&&t.emit("error",e),n.prefinished=!0,t.emit("prefinish"),E(t,n)})}function E(e,t){var n,r,i=y(t);return i&&(n=e,(r=t).prefinished||r.finalCalled||("function"==typeof n._final?(r.pendingcb++,r.finalCalled=!0,v.nextTick(g,n,r)):(r.prefinished=!0,n.emit("prefinish"))),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),i}r.inherits(c,o),f.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(f.prototype,"buffer",{get:i.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(a=Function.prototype[Symbol.hasInstance],Object.defineProperty(c,Symbol.hasInstance,{value:function(e){return!!a.call(this,e)||this===c&&(e&&e._writableState instanceof f)}})):a=function(e){return e instanceof this},c.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},c.prototype.write=function(e,t,n){var r,i,o,a,s,u,f,c,l,h,p,d=this._writableState,y=!1,g=!d.objectMode&&(r=e,b.isBuffer(r)||r instanceof _);return g&&!b.isBuffer(e)&&(i=e,e=b.from(i)),"function"==typeof t&&(n=t,t=null),g?t="buffer":t||(t=d.defaultEncoding),"function"!=typeof n&&(n=m),d.ended?(l=this,h=n,p=new Error("write after end"),l.emit("error",p),v.nextTick(h,p)):(g||(o=this,a=d,u=n,c=!(f=!0),null===(s=e)?c=new TypeError("May not write null values to stream"):"string"==typeof s||void 0===s||a.objectMode||(c=new TypeError("Invalid non-string/buffer chunk")),c&&(o.emit("error",c),v.nextTick(u,c),f=!1),f))&&(d.pendingcb++,y=function(e,t,n,r,i,o){if(!n){var a=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=b.from(t,n));return t}(t,r,i);r!==a&&(n=!0,i="buffer",r=a)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length<t.highWaterMark;u||(t.needDrain=!0);if(t.writing||t.corked){var f=t.lastBufferedRequest;t.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:o,next:null},f?f.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else w(e,t,!1,s,r,i,o);return u}(this,d,g,e,t,n)),y},c.prototype.cork=function(){this._writableState.corked++},c.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||d(this,e))},c.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(-1<["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),c.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},c.prototype._writev=null,c.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,t=e=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,E(e,t),n&&(t.finished?v.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(c.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),c.prototype.destroy=u.destroy,c.prototype._undestroy=u.undestroy,c.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,k(60),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},k(99).setImmediate)},{101:101,13:13,24:24,30:30,36:36,37:37,59:59,60:60,70:70,99:99}],35:[function(e,t,n){"use strict";var s=e(70).Buffer,r=e(10);t.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};0<this.length?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.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}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.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},e.prototype.concat=function(e){if(0===this.length)return s.alloc(0);if(1===this.length)return this.head.data;for(var t,n,r,i=s.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,n=i,r=a,t.copy(n,r),a+=o.data.length,o=o.next;return i},e}(),r&&r.inspect&&r.inspect.custom&&(t.exports.prototype[r.inspect.custom]=function(){var e=r.inspect({length:this.length});return this.constructor.name+" "+e})},{10:10,70:70}],36:[function(e,t,n){"use strict";var o=e(59);function a(e,t){e.emit("error",t)}t.exports={destroy:function(e,t){var n=this,r=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return r||i?t?t(e):!e||this._writableState&&this._writableState.errorEmitted||o.nextTick(a,this,e):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(o.nextTick(a,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)})),this},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},{59:59}],37:[function(e,t,n){t.exports=e(18).EventEmitter},{18:18}],38:[function(e,t,n){(((n=t.exports=e(32)).Stream=n).Readable=n).Writable=e(34),n.Duplex=e(30),n.Transform=e(33),n.PassThrough=e(31)},{30:30,31:31,32:32,33:33,34:34}],39:[function(e,t,n){t.exports=function(){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};var i=Object.prototype.hasOwnProperty},{}],40:[function(e,t,n){var i=e(49).WriteError,o=e(42);function r(e){this._levelup=e,this.batch=e.db.batch(),this.ops=[],this.length=0}r.prototype.put=function(e,t){try{this.batch.put(e,t)}catch(e){throw new i(e)}return this.ops.push({type:"put",key:e,value:t}),this.length++,this},r.prototype.del=function(e){try{this.batch.del(e)}catch(e){throw new i(e)}return this.ops.push({type:"del",key:e}),this.length++,this},r.prototype.clear=function(){try{this.batch.clear()}catch(e){throw new i(e)}return this.ops=[],this.length=0,this},r.prototype.write=function(t){var e,n=this._levelup,r=this.ops;t||(e=(t=o()).promise);try{this.batch.write(function(e){if(e)return t(new i(e));n.emit("batch",r),t()})}catch(e){throw new i(e)}return e},t.exports=r},{42:42,49:49}],41:[function(_,m,e){(function(i){var o=_(18).EventEmitter,e=_(103).inherits,t=_(50),a=_(48),n=_(29),s=_(40),r=_(49),u=_(5),f=_(42),c=r.WriteError,l=r.ReadError,h=r.NotFoundError,p=r.OpenError,d=r.InitializationError;function y(e,t,n){if(!(this instanceof y))return new y(e,t,n);var r;if(o.call(this),this.setMaxListeners(1/0),"function"==typeof t&&(n=t,t={}),t=t||{},!e||"object"!=typeof e){if(r=new d("First argument must be an abstract-leveldown compliant store"),"function"==typeof n)return i.nextTick(n,r);throw r}u.equal(typeof e.status,"string",".status required, old abstract-leveldown"),this.options=v(t),this._db=e,this.db=new a(e),this.open(n)}function g(e,t){return"function"==typeof e?e:t}function v(e){return"object"==typeof e&&null!==e?e:{}}function b(e,t){if(!e._isOpening()&&!e.isOpen())return i.nextTick(t,new l("Database is not open")),!0}y.prototype.emit=o.prototype.emit,y.prototype.once=o.prototype.once,e(y,o),y.prototype.open=function(t){var e,n=this;return t||(e=(t=f()).promise),this.isOpen()?i.nextTick(t,null,n):this._isOpening()?this.once("open",function(){t(null,n)}):(this.emit("opening"),this.db.open(this.options,function(e){if(e)return t(new p(e));n.db=n._db,t(null,n),n.emit("open"),n.emit("ready")})),e},y.prototype.close=function(e){var t,n=this;return e||(t=(e=f()).promise),this.isOpen()?(this.db.close(function(){n.emit("closed"),e.apply(null,arguments)}),this.emit("closing"),this.db=new a(this._db)):this.isClosed()?i.nextTick(e):"closing"===this.db.status?this.once("closed",e):this._isOpening()&&this.once("open",function(){n.close(e)}),t},y.prototype.isOpen=function(){return"open"===this.db.status},y.prototype._isOpening=function(){return"opening"===this.db.status},y.prototype.isClosed=function(){return/^clos|new/.test(this.db.status)},y.prototype.get=function(n,e,r){if(null==n)throw new l("get() requires a key argument");var t;return(r=g(e,r))||(t=(r=f()).promise),b(this,r)||(e=v(e),this.db.get(n,e,function(e,t){if(e)return e=/notfound/i.test(e)||e.notFound?new h("Key not found in database ["+n+"]",e):new l(e),r(e);r(null,t)})),t},y.prototype.put=function(t,n,e,r){if(null==t)throw new c("put() requires a key argument");var i,o=this;return(r=g(e,r))||(i=(r=f()).promise),b(this,r)||(e=v(e),this.db.put(t,n,e,function(e){if(e)return r(new c(e));o.emit("put",t,n),r()})),i},y.prototype.del=function(t,e,n){if(null==t)throw new c("del() requires a key argument");var r,i=this;return(n=g(e,n))||(r=(n=f()).promise),b(this,n)||(e=v(e),this.db.del(t,e,function(e){if(e)return n(new c(e));i.emit("del",t),n()})),r},y.prototype.batch=function(t,e,n){if(!arguments.length)return new s(this);if(!Array.isArray(t))throw new c("batch() requires an array argument");var r,i=this;return(n=g(e,n))||(r=(n=f()).promise),b(this,n)||(e=v(e),this.db.batch(t,e,function(e){if(e)return n(new c(e));i.emit("batch",t),n()})),r},y.prototype.readStream=y.prototype.createReadStream=function(e){return"number"!=typeof(e=t({keys:!0,values:!0},e)).limit&&(e.limit=-1),new n(this.db.iterator(e),e)},y.prototype.keyStream=y.prototype.createKeyStream=function(e){return this.createReadStream(t(e,{keys:!0,values:!1}))},y.prototype.valueStream=y.prototype.createValueStream=function(e){return this.createReadStream(t(e,{keys:!1,values:!0}))},y.prototype.toString=function(){return"LevelUP"},y.errors=r,m.exports=y.default=y}).call(this,_(60))},{103:103,18:18,29:29,40:40,42:42,48:48,49:49,5:5,50:50,60:60}],42:[function(e,t,n){t.exports=function(){var e,t=new Promise(function(n,r){e=function(e,t){e?r(e):n(t)}});return e.promise=t,e}},{}],43:[function(e,t,n){(function(n){function e(e){this._db=e,this._operations=[],this._written=!1}e.prototype._serializeKey=function(e){return this._db._serializeKey(e)},e.prototype._serializeValue=function(e){return this._db._serializeValue(e)},e.prototype._checkWritten=function(){if(this._written)throw new Error("write() already called on this batch")},e.prototype.put=function(e,t){this._checkWritten();var n=this._db._checkKey(e,"key");if(n)throw n;return e=this._serializeKey(e),t=this._serializeValue(t),this._put(e,t),this},e.prototype._put=function(e,t){this._operations.push({type:"put",key:e,value:t})},e.prototype.del=function(e){this._checkWritten();var t=this._db._checkKey(e,"key");if(t)throw t;return e=this._serializeKey(e),this._del(e),this},e.prototype._del=function(e){this._operations.push({type:"del",key:e})},e.prototype.clear=function(){return this._checkWritten(),this._operations=[],this._clear(),this},e.prototype._clear=function(){},e.prototype.write=function(e,t){if(this._checkWritten(),"function"==typeof e&&(t=e),"function"!=typeof t)throw new Error("write() requires a callback argument");return"object"!=typeof e&&(e={}),this._written=!0,"function"==typeof this._write?this._write(t):"function"==typeof this._db._batch?this._db._batch(this._operations,e,t):void n.nextTick(t)},t.exports=e}).call(this,e(60))},{60:60}],44:[function(e,t,n){(function(n){function e(e){this.db=e,this._ended=!1,this._nexting=!1}e.prototype.next=function(e){var t=this;if("function"!=typeof e)throw new Error("next() requires a callback argument");return t._ended?n.nextTick(e,new Error("cannot call next() after end()")):t._nexting?n.nextTick(e,new Error("cannot call next() before previous next() has completed")):(t._nexting=!0,t._next(function(){t._nexting=!1,e.apply(null,arguments)})),t},e.prototype._next=function(e){n.nextTick(e)},e.prototype.end=function(e){if("function"!=typeof e)throw new Error("end() requires a callback argument");if(this._ended)return n.nextTick(e,new Error("end() already called on iterator"));this._ended=!0,this._end(e)},e.prototype._end=function(e){n.nextTick(e)},t.exports=e}).call(this,e(60))},{60:60}],45:[function(r,i,e){(function(a,s){var u=r(50),t=r(44),e=r(43),f=Object.prototype.hasOwnProperty,c="start end gt gte lt lte".split(" ");function n(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"}n.prototype.open=function(e,t){var n=this,r=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=!1!==e.createIfMissing,e.errorIfExists=!!e.errorIfExists,this.status="opening",this._open(e,function(e){if(e)return n.status=r,t(e);n.status="open",t()})},n.prototype._open=function(e,t){s.nextTick(t)},n.prototype.close=function(t){var n=this,r=this.status;if("function"!=typeof t)throw new Error("close() requires a callback argument");this.status="closing",this._close(function(e){if(e)return n.status=r,t(e);n.status="closed",t()})},n.prototype._close=function(e){s.nextTick(e)},n.prototype.get=function(e,t,n){if("function"==typeof t&&(n=t),"function"!=typeof n)throw new Error("get() requires a callback argument");var r=this._checkKey(e,"key");if(r)return s.nextTick(n,r);e=this._serializeKey(e),"object"!=typeof t&&(t={}),t.asBuffer=!1!==t.asBuffer,this._get(e,t,n)},n.prototype._get=function(e,t,n){s.nextTick(function(){n(new Error("NotFound"))})},n.prototype.put=function(e,t,n,r){if("function"==typeof n&&(r=n),"function"!=typeof r)throw new Error("put() requires a callback argument");var i=this._checkKey(e,"key");if(i)return s.nextTick(r,i);e=this._serializeKey(e),t=this._serializeValue(t),"object"!=typeof n&&(n={}),this._put(e,t,n,r)},n.prototype._put=function(e,t,n,r){s.nextTick(r)},n.prototype.del=function(e,t,n){if("function"==typeof t&&(n=t),"function"!=typeof n)throw new Error("del() requires a callback argument");var r=this._checkKey(e,"key");if(r)return s.nextTick(n,r);e=this._serializeKey(e),"object"!=typeof t&&(t={}),this._del(e,t,n)},n.prototype._del=function(e,t,n){s.nextTick(n)},n.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 s.nextTick(n,new Error("batch(array) requires an array argument"));t&&"object"==typeof t||(t={});for(var r=new Array(e.length),i=0;i<e.length;i++){if("object"!=typeof e[i]||null===e[i])return s.nextTick(n,new Error("batch(array) element must be an object and not `null`"));var o=u(e[i]);if("put"!==o.type&&"del"!==o.type)return s.nextTick(n,new Error("`type` must be 'put' or 'del'"));var a=this._checkKey(o.key,"key");if(a)return s.nextTick(n,a);o.key=this._serializeKey(o.key),"put"===o.type&&(o.value=this._serializeValue(o.value)),r[i]=o}this._batch(r,t,n)},n.prototype._batch=function(e,t,n){s.nextTick(n)},n.prototype._setupIteratorOptions=function(e){return(e=function(e){var t={};for(var n in e)f.call(e,n)&&(o=n,-1!==c.indexOf(o)&&(""===(i=e[n])||null==i||(r=i,a.isBuffer(r)&&0===r.length))||(t[n]=e[n]));var r;var i;var o;return t}(e)).reverse=!!e.reverse,e.keys=!1!==e.keys,e.values=!1!==e.values,e.limit="limit"in e?e.limit:-1,e.keyAsBuffer=!1!==e.keyAsBuffer,e.valueAsBuffer=!1!==e.valueAsBuffer,e},n.prototype.iterator=function(e){return"object"!=typeof e&&(e={}),e=this._setupIteratorOptions(e),this._iterator(e)},n.prototype._iterator=function(e){return new t(this)},n.prototype._chainedBatch=function(){return new e(this)},n.prototype._serializeKey=function(e){return a.isBuffer(e)?e:String(e)},n.prototype._serializeValue=function(e){return null==e?"":a.isBuffer(e)||s.browser?e:String(e)},n.prototype._checkKey=function(e,t){return null==e?new Error(t+" cannot be `null` or `undefined`"):a.isBuffer(e)&&0===e.length?new Error(t+" cannot be an empty Buffer"):""===String(e)?new Error(t+" cannot be an empty String"):void 0},i.exports=n}).call(this,{isBuffer:r(25)},r(60))},{25:25,43:43,44:44,50:50,60:60}],46:[function(e,t,n){n.AbstractLevelDOWN=e(45),n.AbstractIterator=e(44),n.AbstractChainedBatch=e(43)},{43:43,44:44,45:45}],47:[function(e,t,n){var r=e(46).AbstractIterator;function i(e){r.call(this,e),this._options=e,this._iterator=null,this._operations=[]}e(24)(i,r),i.prototype.setDb=function(e){var t=this._iterator=e.iterator(this._options);this._operations.forEach(function(e){t[e.method].apply(t,e.args)})},i.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){i.prototype["_"+e]=function(){this._operation(e,arguments)}}),t.exports=i},{24:24,46:46}],48:[function(e,t,n){var r=e(46).AbstractLevelDOWN,i=e(24),o=e(47),a="put get del batch".split(" ");function s(e){r.call(this,""),this._db=e,this._operations=[],this._iterators=[],u(this)}function u(t){a.forEach(function(e){t["_"+e]=function(){this._operations.push({method:e,args:arguments})}}),"function"==typeof t._db.approximateSize&&(t.approximateSize=function(){this._operations.push({method:"approximateSize",args:arguments})}),t._iterator=function(e){var t=new o(e);return this._iterators.push(t),t}}i(s,r),s.prototype._open=function(e,n){var r=this;this._db.open(e,function(e){if(e)return n(e);var t;r._operations.forEach(function(e){r._db[e.method].apply(r._db,e.args)}),r._operations=[],r._iterators.forEach(function(e){e.setDb(r._db)}),r._iterators=[],t=r,a.concat("iterator").forEach(function(e){t["_"+e]=function(){return this._db[e].apply(this._db,arguments)}}),t._db.approximateSize&&(t.approximateSize=function(){return this._db.approximateSize.apply(this._db,arguments)}),n()})},s.prototype._close=function(t){var n=this;this._db.close(function(e){if(e)return t(e);u(n),t()})},s.prototype._serializeKey=function(e){return e},s.prototype._serializeValue=function(e){return e},t.exports=s,t.exports.DeferredIterator=o},{24:24,46:46,47:47}],49:[function(e,t,n){var r=e(17).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)}},{17:17}],50:[function(e,t,n){arguments[4][39][0].apply(n,arguments)},{39:39}],51:[function(l,y,e){(function(h,e,t){"use strict";var n=l(24),i=l(56),r=l(3).AbstractLevelDOWN,o=l(3).AbstractIterator,a=l(53).LocalStorage,s=l(52),u=l(55),p=t.setImmediate||e.nextTick;function f(e,t){o.call(this,e),this._reverse=!!t.reverse,this._endkey=t.end,this._startkey=t.start,this._gt=t.gt,this._gte=t.gte,this._lt=t.lt,this._lte=t.lte,this._exclusiveStart=t.exclusiveStart,this._keysOnly=!1===t.values,this._limit=t.limit,this._count=0,this.onInitCompleteListeners=[]}function c(e){if(!(this instanceof c))return new c(e);r.call(this,e),this.container=new a(e)}function d(e,t){if(null==e)return new Error(t+" cannot be `null` or `undefined`");if(null==e)return new Error(t+" cannot be `null` or `undefined`");if("key"===t){if(e instanceof Boolean)return new Error(t+" cannot be `null` or `undefined`");if(""===e)return new Error(t+" cannot be empty")}if(0===e.toString().indexOf("[object ArrayBuffer]")&&(0===e.byteLength||void 0===e.byteLength))return new Error(t+" cannot be an empty Buffer");if(h.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")}n(f,o),f.prototype._init=function(e){p(function(){e()})},f.prototype._next=function(o){var a=this;function s(){if(a._pos===a._keys.length||a._pos<0)return o();var n=a._keys[a._pos];return a._endkey&&(a._reverse?n<a._endkey:n>a._endkey)?o():a._limit&&0<a._limit&&a._count++>=a._limit?o():a._lt&&n>=a._lt||a._lte&&n>a._lte||a._gt&&n<=a._gt||a._gte&&n<a._gte?o():(a._pos+=a._reverse?-1:1,a._keysOnly?o(null,n):void a.db.container.getItem(n,function(e,t){if(e)return"NotFound"===e.message?p(function(){a._next(o)}):o(e);o(null,n,t)}))}a.initStarted?a.initCompleted?e.nextTick(s):a.onInitCompleteListeners.push(s):e.nextTick(function(){a.initStarted=!0,a._init(function(e){if(e)return o(e);a.db.container.keys(function(e,t){if(e)return o(e);if(a._keys=t,a._startkey){var n=u.sortedIndexOf(a._keys,a._startkey),r=n>=a._keys.length||n<0?void 0:a._keys[n];a._pos=n,a._reverse?(a._exclusiveStart||r!==a._startkey)&&a._pos--:a._exclusiveStart&&r===a._startkey&&a._pos++}else a._pos=a._reverse?a._keys.length-1:0;s(),a.initCompleted=!0;for(var i=-1;++i<a.onInitCompleteListeners.length;)p(a.onInitCompleteListeners[i])})})})},n(c,r),c.prototype._open=function(e,t){this.container.init(t)},c.prototype._put=function(e,t,n,r){var i=d(e,"key");if(i)return p(function(){r(i)});if(i=d(t,"value"))return p(function(){r(i)});if("object"==typeof t&&!h.isBuffer(t)&&void 0===t.buffer){var o={storetype:"json"};o.data=t,t=JSON.stringify(o)}this.container.setItem(e,t,r)},c.prototype._get=function(e,n,r){var t=d(e,"key");if(t)return p(function(){r(t)});h.isBuffer(e)||(e=String(e)),this.container.getItem(e,function(e,t){if(e)return r(e);(!1===n.asBuffer||h.isBuffer(t)||(t=i(t)),!1===n.asBuffer)&&(-1<t.indexOf('{"storetype":"json","data"')&&(t=JSON.parse(t).data));r(null,t)})},c.prototype._del=function(e,t,n){var r=d(e,"key");if(r)return p(function(){n(r)});h.isBuffer(e)||(e=String(e)),this.container.removeItem(e,n)},c.prototype._batch=function(u,f,c){var l=this;p(function(){var e,t,n,r,i=0;function o(){++i===u.length&&c(r)}if(Array.isArray(u)&&u.length)for(var a=0;a<u.length;a++){var s=u[a];s?(e=d(t=h.isBuffer(s.key)?s.key:String(s.key),"key"))?(r=e,o()):"del"===s.type?l._del(s.key,f,o):"put"===s.type&&((e=d(n=h.isBuffer(s.value)?s.value:String(s.value),"value"))?(r=e,o()):l._put(t,n,f,o)):o()}else c()})},c.prototype._iterator=function(e){return new f(this,e)},c.destroy=function(e,t){s.destroy(e,t)},y.exports=c}).call(this,{isBuffer:l(25)},l(60),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{24:24,25:25,3:3,52:52,53:53,55:55,56:56,60:60}],52:[function(o,u,e){(function(e,t){"use strict";var i=t.setImmediate||e.nextTick,a=o(21);function s(e,t){var n,r;try{n=t()}catch(e){r=e}i(function(){e(r,n)})}function n(e){return e.replace(/!/g,"!!")+"!"}function r(e){this._prefix=n(e)}r.prototype.getKeys=function(e){var o=this;s(e,function(){for(var e=[],t=o._prefix.length,n=-1,r=a.length;++n<r;){var i=a.key(n);i.substring(0,t)===o._prefix&&e.push(i.substring(t))}return e.sort(),e})},r.prototype.put=function(e,t,n){var r=this;s(n,function(){a.setItem(r._prefix+e,t)})},r.prototype.get=function(e,t){var n=this;s(t,function(){return a.getItem(n._prefix+e)})},r.prototype.remove=function(e,t){var n=this;s(t,function(){a.removeItem(n._prefix+e)})},r.destroy=function(e,t){var i=n(e);s(t,function(){for(var e=[],t=-1,n=a.length;++t<n;){var r=a.key(t);r.substring(0,i.length)===i&&e.push(r)}e.forEach(function(e){a.removeItem(e)})})},u.exports=r}).call(this,o(60),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{21:21,60:60}],53:[function(r,e,p){(function(o){"use strict";var i="ArrayBuffer:",a=new RegExp("^"+i),s="Uint8Array:",u=new RegExp("^"+s),f="Buff:",c=new RegExp("^"+f),l=r(55),t=r(52),n=r(54),h=r(14);function e(e){this._store=new t(e),this._queue=new n}e.prototype.sequentialize=function(e,t){this._queue.add(t,e)},e.prototype.init=function(e){var r=this;r.sequentialize(e,function(n){r._store.getKeys(function(e,t){return e?n(e):(r._keys=t,n())})})},e.prototype.keys=function(e){var t=this;t.sequentialize(e,function(n){t._store.getKeys(function(e,t){n(null,t.slice())})})},e.prototype.setItem=function(n,r,e){var i=this;i.sequentialize(e,function(e){o.isBuffer(r)&&(r=f+h.encode(r));var t=l.sortedIndexOf(i._keys,n);i._keys[t]!==n&&i._keys.splice(t,0,n),i._store.put(n,r,e)})},e.prototype.getItem=function(e,t){var r=this;r.sequentialize(t,function(n){r._store.get(e,function(e,t){return e?n(e):null==t?n(new Error("NotFound")):(void 0!==t&&(c.test(t)?t=h.decode(t.substring(f.length)):a.test(t)?(t=t.substring(i.length),t=new ArrayBuffer(atob(t).split("").map(function(e){return e.charCodeAt(0)}))):u.test(t)&&(t=t.substring(s.length),t=new Uint8Array(atob(t).split("").map(function(e){return e.charCodeAt(0)})))),void n(null,t))})})},e.prototype.removeItem=function(n,e){var r=this;r.sequentialize(e,function(t){var e=l.sortedIndexOf(r._keys,n);r._keys[e]===n?(r._keys.splice(e,1),r._store.remove(n,function(e){if(e)return t(e);t()})):t()})},e.prototype.length=function(e){var t=this;t.sequentialize(e,function(e){e(null,t._keys.length)})},p.LocalStorage=e}).call(this,{isBuffer:r(25)})},{14:14,25:25,52:52,54:54,55:55}],54:[function(a,s,e){(function(e,t){"use strict";var r=a(4),n=a(100),i=t.setImmediate||e.nextTick;function o(){this.queue=new n,this.running=!1}o.prototype.add=function(e,t){this.queue.push({fun:e,callback:t}),this.processNext()},o.prototype.processNext=function(){var t=this;if(!t.running&&t.queue.length){t.running=!0;var n=t.queue.shift();i(function(){n.fun(r(function(e){n.callback.apply(null,e),t.running=!1,t.processNext()}))})}},s.exports=o}).call(this,a(60),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{100:100,4:4,60:60}],55:[function(e,t,n){"use strict";n.sortedIndexOf=function(e,t){for(var n,r=0,i=e.length;r<i;)e[n=r+i>>>1]<t?r=n+1:i=n;return r}},{}],56:[function(e,t,n){arguments[4][11][0].apply(n,arguments)},{11:11,12:12}],57:[function(e,t,n){var r,i,o;r=this,o={},(i={}).length=0,i.getItem=function(e){return o[e]||null},i.setItem=function(e,t){void 0===t?i.removeItem(e):(o.hasOwnProperty(e)||i.length++,o[e]=""+t)},i.removeItem=function(e){o.hasOwnProperty(e)&&(delete o[e],i.length--)},i.key=function(e){return Object.keys(o)[e]||null},i.clear=function(){o={},i.length=0},"object"==typeof n?t.exports=i:r.localStorageMemory=i},{}],58:[function(e,t,d){(function(o){function a(e){return void 0!==e&&""!==e}function u(e,t){return Object.hasOwnProperty.call(e,t)}function t(e,t){return Object.hasOwnProperty.call(e,t)&&t}d.compare=function(e,t){if(o.isBuffer(e)){for(var n=Math.min(e.length,t.length),r=0;r<n;r++){var i=e[r]-t[r];if(i)return i}return e.length-t.length}return e<t?-1:t<e?1:0};var r=d.lowerBoundKey=function(e){return t(e,"gt")||t(e,"gte")||t(e,"min")||(e.reverse?t(e,"end"):t(e,"start"))||void 0},s=d.lowerBound=function(e,t){var n=r(e);return n?e[n]:t},n=d.lowerBoundInclusive=function(e){return!u(e,"gt")},i=d.upperBoundInclusive=function(e){return!u(e,"lt")},f=d.lowerBoundExclusive=function(e){return!n(e)},c=d.upperBoundExclusive=function(e){return!i(e)},l=d.upperBoundKey=function(e){return t(e,"lt")||t(e,"lte")||t(e,"max")||(e.reverse?t(e,"start"):t(e,"end"))||void 0},h=d.upperBound=function(e,t){var n=l(e);return n?e[n]:t};function p(e){return e}d.start=function(e,t){return e.reverse?h(e,t):s(e,t)},d.end=function(e,t){return e.reverse?s(e,t):h(e,t)},d.startInclusive=function(e){return e.reverse?i(e):n(e)},d.endInclusive=function(e){return e.reverse?n(e):i(e)},d.toLtgt=function(e,t,n,r,i){t=t||{},n=n||p;var o=3<arguments.length,a=d.lowerBoundKey(e),s=d.upperBoundKey(e);return a?"gt"===a?t.gt=n(e.gt,!1):t.gte=n(e[a],!1):o&&(t.gte=n(r,!1)),s?"lt"===s?t.lt=n(e.lt,!0):t.lte=n(e[s],!0):o&&(t.lte=n(i,!0)),null!=e.reverse&&(t.reverse=!!e.reverse),u(t,"max")&&delete t.max,u(t,"min")&&delete t.min,u(t,"start")&&delete t.start,u(t,"end")&&delete t.end,t},d.contains=function(e,t,n){n=n||d.compare;var r=s(e);if(a(r)&&((i=n(t,r))<0||0===i&&f(e)))return!1;var i,o=h(e);if(a(o)&&(0<(i=n(t,o))||0===i&&c(e)))return!1;return!0},d.filter=function(t,n){return function(e){return d.contains(t,e,n)}}}).call(this,{isBuffer:e(25)})},{25:25}],59:[function(e,t,n){(function(s){"use strict";!s.version||0===s.version.indexOf("v0.")||0===s.version.indexOf("v1.")&&0!==s.version.indexOf("v1.8.")?t.exports={nextTick:function(e,t,n,r){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var i,o,a=arguments.length;switch(a){case 0:case 1:return s.nextTick(e);case 2:return s.nextTick(function(){e.call(null,t)});case 3:return s.nextTick(function(){e.call(null,t,n)});case 4:return s.nextTick(function(){e.call(null,t,n,r)});default:for(i=new Array(a-1),o=0;o<i.length;)i[o++]=arguments[o];return s.nextTick(function(){e.apply(null,i)})}}}:t.exports=s}).call(this,e(60))},{60:60}],60:[function(e,t,n){var r,i,o=t.exports={};function a(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function u(t){if(r===setTimeout)return setTimeout(t,0);if((r===a||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:a}catch(e){r=a}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(e){i=s}}();var f,c=[],l=!1,h=-1;function p(){l&&f&&(l=!1,f.length?c=f.concat(c):h=-1,c.length&&d())}function d(){if(!l){var e=u(p);l=!0;for(var t=c.length;t;){for(f=c,c=[];++h<t;)f&&f[h].run();h=-1,t=c.length}f=null,l=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(e)}}function y(e,t){this.fun=e,this.array=t}function g(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(1<arguments.length)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new y(e,t)),1!==c.length||l||u(d)},y.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=g,o.addListener=g,o.once=g,o.off=g,o.removeListener=g,o.removeAllListeners=g,o.emit=g,o.prependListener=g,o.prependOnceListener=g,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],61:[function(e,t,n){var r,i;r=this,i=function(){var c="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};return function(e,t,n,r){var i,o,a,s,u,f;if(o=n,u=!(s="object"==typeof(a=r))&&"string"==typeof a,r={enumerable:(f=function(e){return s?!!a[e]:!!u&&-1<a.indexOf(e[0])})("enumerable"),configurable:f("configurable"),writable:f("writable"),value:o},"object"==typeof t){for(i in t)Object.hasOwnProperty.call(t,i)&&(r.value=t[i],c(e,i,r));return e}return c(e,t,r)}},void 0!==t&&t.exports?t.exports=i():r.prr=i()},{}],62:[function(s,u,e){(function(e){u.exports=o;var t=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t},n=s(13);n.inherits=s(24);var r=s(64),i=s(66);function o(e){if(!(this instanceof o))return new o(e);r.call(this,e),i.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",a)}function a(){this.allowHalfOpen||this._writableState.ended||e.nextTick(this.end.bind(this))}n.inherits(o,r),function(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)}(t(i.prototype),function(e){o.prototype[e]||(o.prototype[e]=i.prototype[e])})}).call(this,s(60))},{13:13,24:24,60:60,64:64,66:66}],63:[function(e,t,n){t.exports=o;var r=e(65),i=e(13);function o(e){if(!(this instanceof o))return new o(e);r.call(this,e)}i.inherits=e(24),i.inherits(o,r),o.prototype._transform=function(e,t,n){n(null,e)}},{13:13,24:24,65:65}],64:[function(m,w,e){(function(d){w.exports=n;var y=m(67),h=m(12).Buffer;n.ReadableState=t;var g=m(18).EventEmitter;g.listenerCount||(g.listenerCount=function(e,t){return e.listeners(t).length});var r,i=m(72),e=m(13);function t(e,t){var n=(e=e||{}).highWaterMark;this.highWaterMark=n||0===n?n: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=!!e.objectMode,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(r||(r=m(68).StringDecoder),this.decoder=new r(e.encoding),this.encoding=e.encoding)}function n(e){if(!(this instanceof n))return new n(e);this._readableState=new t(e,this),this.readable=!0,i.call(this)}function o(e,t,n,r,i){var o,a,s,u=function(e,t){var n=null;h.isBuffer(t)||"string"==typeof t||null==t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));return n}(t,n);if(u)e.emit("error",u);else if(null==n)t.reading=!1,t.ended||function(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,0<t.length?c(e):p(e)}(e,t);else if(t.objectMode||n&&0<n.length)if(t.ended&&!i){var f=new Error("stream.push() after EOF");e.emit("error",f)}else if(t.endEmitted&&i){f=new Error("stream.unshift() after end event");e.emit("error",f)}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&&c(e),o=e,(a=t).readingMore||(a.readingMore=!0,d.nextTick(function(){!function(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}(o,a)}));else i||(t.reading=!1);return!(s=t).ended&&(s.needReadable||s.length<s.highWaterMark||0===s.length)}e.inherits=m(24),e.inherits(n,i),n.prototype.push=function(e,t){var n=this._readableState;return"string"!=typeof e||n.objectMode||(t=t||n.defaultEncoding)!==n.encoding&&(e=new h(e,t),t=""),o(this,n,e,t,!1)},n.prototype.unshift=function(e){return o(this,this._readableState,e,"",!0)},n.prototype.setEncoding=function(e){r||(r=m(68).StringDecoder),this._readableState.decoder=new r(e),this._readableState.encoding=e};var a=8388608;function s(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=function(e){if(a<=e)e=a;else{e--;for(var t=1;t<32;t<<=1)e|=e>>t;e++}return e}(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function c(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,t.sync?d.nextTick(function(){u(e)}):u(e))}function u(e){e.emit("readable")}function v(e){var r,i=e._readableState;function t(e,t,n){!1===e.write(r)&&i.awaitDrain++}for(i.awaitDrain=0;i.pipesCount&&null!==(r=e.read());)if(1===i.pipesCount?t(i.pipes):_(i.pipes,t),e.emit("data",r),0<i.awaitDrain)return;if(0===i.pipesCount)return i.flowing=!1,void(0<g.listenerCount(e,"data")&&f(e));i.ranOut=!0}function b(){this._readableState.ranOut&&(this._readableState.ranOut=!1,v(this))}function f(t,e){if(t._readableState.flowing)throw new Error("Cannot switch to old mode now.");var n=e||!1,r=!1;t.readable=!0,t.pipe=i.prototype.pipe,t.on=t.addListener=i.prototype.on,t.on("readable",function(){var e;for(r=!0;!n&&null!==(e=t.read());)t.emit("data",e);null===e&&(r=!1,t._readableState.needReadable=!0)}),t.pause=function(){n=!0,this.emit("pause")},t.resume=function(){n=!1,r?d.nextTick(function(){t.emit("readable")}):this.read(0),this.emit("resume")},t.emit("readable")}function l(e,t){var n,r=t.buffer,i=t.length,o=!!t.decoder,a=!!t.objectMode;if(0===r.length)return null;if(0===i)n=null;else if(a)n=r.shift();else if(!e||i<=e)n=o?r.join(""):h.concat(r,i),r.length=0;else{if(e<r[0].length)n=(c=r[0]).slice(0,e),r[0]=c.slice(e);else if(e===r[0].length)n=r.shift();else{n=o?"":new h(e);for(var s=0,u=0,f=r.length;u<f&&s<e;u++){var c=r[0],l=Math.min(e-s,c.length);o?n+=c.slice(0,l):c.copy(n,s,0,l),l<c.length?r[0]=c.slice(l):r.shift(),s+=l}}}return n}function p(e){var t=e._readableState;if(0<t.length)throw new Error("endReadable called on non-empty stream");!t.endEmitted&&t.calledRead&&(t.ended=!0,d.nextTick(function(){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}))}function _(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n],n)}n.prototype.read=function(e){var t=this._readableState;t.calledRead=!0;var n,r=e;if(("number"!=typeof e||0<e)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return c(this),null;if(0===(e=s(e,t))&&t.ended)return n=null,0<t.length&&t.decoder&&(n=l(e,t),t.length-=n.length),0===t.length&&p(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=s(r,t)),null===(n=0<e?l(e,t):null)&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),t.ended&&!t.endEmitted&&0===t.length&&p(this),n},n.prototype._read=function(e){this.emit("error",new Error("not implemented"))},n.prototype.pipe=function(t,e){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=t;break;case 1:r.pipes=[r.pipes,t];break;default:r.pipes.push(t)}r.pipesCount+=1;var i=(!e||!1!==e.end)&&t!==d.stdout&&t!==d.stderr?a:f;function o(e){e===n&&f()}function a(){t.end()}r.endEmitted?d.nextTick(i):n.once("end",i),t.on("unpipe",o);var s,u=(s=n,function(){var e=s._readableState;e.awaitDrain--,0===e.awaitDrain&&v(s)});function f(){t.removeListener("close",l),t.removeListener("finish",h),t.removeListener("drain",u),t.removeListener("error",c),t.removeListener("unpipe",o),n.removeListener("end",a),n.removeListener("end",f),t._writableState&&!t._writableState.needDrain||u()}function c(e){p(),t.removeListener("error",c),0===g.listenerCount(t,"error")&&t.emit("error",e)}function l(){t.removeListener("finish",h),p()}function h(){t.removeListener("close",l),p()}function p(){n.unpipe(t)}return t.on("drain",u),t._events&&t._events.error?y(t._events.error)?t._events.error.unshift(c):t._events.error=[c,t._events.error]:t.on("error",c),t.once("close",l),t.once("finish",h),t.emit("pipe",n),r.flowing||(this.on("readable",b),r.flowing=!0,d.nextTick(function(){v(n)})),t},n.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,this.removeListener("readable",b),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",b),t.flowing=!1;for(var i=0;i<r;i++)n[i].emit("unpipe",this);return this}return-1===(i=function(e,t){for(var n=0,r=e.length;n<r;n++)if(e[n]===t)return n;return-1}(t.pipes,e))||(t.pipes.splice(i,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this)),this},n.prototype.addListener=n.prototype.on=function(e,t){var n=i.prototype.on.call(this,e,t);if("data"!==e||this._readableState.flowing||f(this),"readable"===e&&this.readable){var r=this._readableState;r.readableListening||(r.readableListening=!0,r.emittedReadable=!1,r.needReadable=!0,r.reading?r.length&&c(this):this.read(0))}return n},n.prototype.resume=function(){f(this),this.read(0),this.emit("resume")},n.prototype.pause=function(){f(this,!0),this.emit("pause")},n.prototype.wrap=function(t){var n=this._readableState,r=!1,i=this;for(var e in t.on("end",function(){if(n.decoder&&!n.ended){var e=n.decoder.end();e&&e.length&&i.push(e)}i.push(null)}),t.on("data",function(e){(n.decoder&&(e=n.decoder.write(e)),n.objectMode&&null==e)||(n.objectMode||e&&e.length)&&(i.push(e)||(r=!0,t.pause()))}),t)"function"==typeof t[e]&&void 0===this[e]&&(this[e]=function(e){return function(){return t[e].apply(t,arguments)}}(e));return _(["error","close","destroy","pause","resume"],function(e){t.on(e,i.emit.bind(i,e))}),i._read=function(e){r&&(r=!1,t.resume())},i},n._fromList=l}).call(this,m(60))},{12:12,13:13,18:18,24:24,60:60,67:67,68:68,72:72}],65:[function(e,t,n){t.exports=a;var r=e(62),i=e(13);function o(e,n){this.afterTransform=function(e,t){return function(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)!=n&&e.push(n);i&&i(t);var o=e._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&e._read(o.highWaterMark)}(n,e,t)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null}function a(e){if(!(this instanceof a))return new a(e);r.call(this,e);this._transformState=new o(e,this);var t=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)}i.inherits=e(24),i.inherits(a,r),a.prototype.push=function(e,t){return this._transformState.needTransform=!1,r.prototype.push.call(this,e,t)},a.prototype._transform=function(e,t,n){throw new Error("not implemented")},a.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)}},a.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}},{13:13,24:24,62:62}],66:[function(o,t,e){(function(u){t.exports=i;var c=o(12).Buffer;i.WritableState=r;var e=o(13);e.inherits=o(24);var n=o(72);function l(e,t,n){this.chunk=e,this.encoding=t,this.callback=n}function r(e,t){var n=(e=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;var r=(this.finished=!1)===e.decodeStrings;this.decodeStrings=!r,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(a=n,a.writing=!1,a.writecb=null,a.length-=a.writelen,a.writelen=0,t)!function(e,t,n,r,i){n?u.nextTick(function(){i(r)}):i(r);e._writableState.errorEmitted=!0,e.emit("error",r)}(e,0,r,t,i);else{var o=f(e,n);o||n.bufferProcessing||!n.buffer.length||function(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,a=r.callback,s=t.objectMode?1:i.length;if(h(e,t,s,i,o,a),t.writing){n++;break}}t.bufferProcessing=!1,n<t.buffer.length?t.buffer=t.buffer.slice(n):t.buffer.length=0}(e,n),r?u.nextTick(function(){s(e,n,o,i)}):s(e,n,o,i)}var a}(t,e)},this.writecb=null,this.writelen=0,this.buffer=[],this.errorEmitted=!1}function i(e){var t=o(62);if(!(this instanceof i||this instanceof t))return new i(e);this._writableState=new r(e,this),this.writable=!0,n.call(this)}function h(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 s(e,t,n,r){var i,o;n||(i=e,0===(o=t).length&&o.needDrain&&(o.needDrain=!1,i.emit("drain"))),r(),n&&a(e,t)}function f(e,t){return t.ending&&0===t.length&&!t.finished&&!t.writing}function a(e,t){var n=f(0,t);return n&&(t.finished=!0,e.emit("finish")),n}e.inherits(i,n),i.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe. Not readable."))},i.prototype.write=function(e,t,n){var r,i,o,a=this._writableState,s=!1;return"function"==typeof t&&(n=t,t=null),c.isBuffer(e)?t="buffer":t||(t=a.defaultEncoding),"function"!=typeof n&&(n=function(){}),a.ended?(r=this,i=n,o=new Error("write after end"),r.emit("error",o),u.nextTick(function(){i(o)})):function(e,t,n,r){var i=!0;if(!c.isBuffer(n)&&"string"!=typeof n&&null!=n&&!t.objectMode){var o=new TypeError("Invalid non-string/buffer chunk");e.emit("error",o),u.nextTick(function(){r(o)}),i=!1}return i}(this,a,e,n)&&(s=function(e,t,n,r,i){o=t,a=n,s=r,o.objectMode||!1===o.decodeStrings||"string"!=typeof a||(a=new c(a,s)),n=a,c.isBuffer(n)&&(r="buffer");var o,a,s;var u=t.objectMode?1:n.length;t.length+=u;var f=t.length<t.highWaterMark;f||(t.needDrain=!0);t.writing?t.buffer.push(new l(n,r,i)):h(e,t,u,n,r,i);return f}(this,a,e,t,n)),s},i.prototype._write=function(e,t,n){n(new Error("not implemented"))},i.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,t=e=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.ending||r.finished||function(e,t,n){t.ending=!0,a(e,t),n&&(t.finished?u.nextTick(n):e.once("finish",n));t.ended=!0}(this,r,n)}}).call(this,o(60))},{12:12,13:13,24:24,60:60,62:62,72:72}],67:[function(e,t,n){t.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},{}],68:[function(e,t,n){var r=e(12).Buffer,i=r.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}};var o=n.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!i(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=s;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=u;break;default:return void(this.write=a)}this.charBuffer=new r(6),this.charReceived=0,this.charLength=0};function a(e){return e.toString(this.encoding)}function s(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function u(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}o.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"";if(e=e.slice(n,e.length),!(55296<=(i=(t=this.charBuffer.slice(0,this.charLength).toString(this.encoding)).charCodeAt(t.length-1))&&i<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var r=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,r),r-=this.charReceived);var i;r=(t+=e.toString(this.encoding,0,r)).length-1;if(55296<=(i=t.charCodeAt(r))&&i<=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,r)}return t},o.prototype.detectIncompleteChar=function(e){for(var t=3<=e.length?3:e.length;0<t;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},o.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}},{12:12}],69:[function(e,t,n){var r=e(72);(n=t.exports=e(64)).Stream=r,(n.Readable=n).Writable=e(66),n.Duplex=e(62),n.Transform=e(65),n.PassThrough=e(63)},{62:62,63:63,64:64,65:65,66:66,72:72}],70:[function(e,t,n){var r=e(12),i=r.Buffer;function o(e,t){for(var n in e)t[n]=e[n]}function a(e,t,n){return i(e,t,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=r:(o(r,n),n.Buffer=a),o(i,a),a.from=function(e,t,n){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,n)},a.alloc=function(e,t,n){if("number"!=typeof e)throw new TypeError("Argument must be a number");var r=i(e);return void 0!==t?"string"==typeof n?r.fill(t,n):r.fill(t):r.fill(0),r},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r.SlowBuffer(e)}},{12:12}],71:[function(e,n,r){!function(e){if("object"==typeof r)n.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var t;try{t=window}catch(e){t=self}t.SparkMD5=e()}}(function(c){"use strict";var r=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function f(e,t){var n=e[0],r=e[1],i=e[2],o=e[3];r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+t[0]-680876936|0)<<7|n>>>25)+r|0)&r|~n&i)+t[1]-389564586|0)<<12|o>>>20)+n|0)&n|~o&r)+t[2]+606105819|0)<<17|i>>>15)+o|0)&o|~i&n)+t[3]-1044525330|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+t[4]-176418897|0)<<7|n>>>25)+r|0)&r|~n&i)+t[5]+1200080426|0)<<12|o>>>20)+n|0)&n|~o&r)+t[6]-1473231341|0)<<17|i>>>15)+o|0)&o|~i&n)+t[7]-45705983|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+t[8]+1770035416|0)<<7|n>>>25)+r|0)&r|~n&i)+t[9]-1958414417|0)<<12|o>>>20)+n|0)&n|~o&r)+t[10]-42063|0)<<17|i>>>15)+o|0)&o|~i&n)+t[11]-1990404162|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&i|~r&o)+t[12]+1804603682|0)<<7|n>>>25)+r|0)&r|~n&i)+t[13]-40341101|0)<<12|o>>>20)+n|0)&n|~o&r)+t[14]-1502002290|0)<<17|i>>>15)+o|0)&o|~i&n)+t[15]+1236535329|0)<<22|r>>>10)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+t[1]-165796510|0)<<5|n>>>27)+r|0)&i|r&~i)+t[6]-1069501632|0)<<9|o>>>23)+n|0)&r|n&~r)+t[11]+643717713|0)<<14|i>>>18)+o|0)&n|o&~n)+t[0]-373897302|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+t[5]-701558691|0)<<5|n>>>27)+r|0)&i|r&~i)+t[10]+38016083|0)<<9|o>>>23)+n|0)&r|n&~r)+t[15]-660478335|0)<<14|i>>>18)+o|0)&n|o&~n)+t[4]-405537848|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+t[9]+568446438|0)<<5|n>>>27)+r|0)&i|r&~i)+t[14]-1019803690|0)<<9|o>>>23)+n|0)&r|n&~r)+t[3]-187363961|0)<<14|i>>>18)+o|0)&n|o&~n)+t[8]+1163531501|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r&o|i&~o)+t[13]-1444681467|0)<<5|n>>>27)+r|0)&i|r&~i)+t[2]-51403784|0)<<9|o>>>23)+n|0)&r|n&~r)+t[7]+1735328473|0)<<14|i>>>18)+o|0)&n|o&~n)+t[12]-1926607734|0)<<20|r>>>12)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+t[5]-378558|0)<<4|n>>>28)+r|0)^r^i)+t[8]-2022574463|0)<<11|o>>>21)+n|0)^n^r)+t[11]+1839030562|0)<<16|i>>>16)+o|0)^o^n)+t[14]-35309556|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+t[1]-1530992060|0)<<4|n>>>28)+r|0)^r^i)+t[4]+1272893353|0)<<11|o>>>21)+n|0)^n^r)+t[7]-155497632|0)<<16|i>>>16)+o|0)^o^n)+t[10]-1094730640|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+t[13]+681279174|0)<<4|n>>>28)+r|0)^r^i)+t[0]-358537222|0)<<11|o>>>21)+n|0)^n^r)+t[3]-722521979|0)<<16|i>>>16)+o|0)^o^n)+t[6]+76029189|0)<<23|r>>>9)+i|0,r=((r+=((i=((i+=((o=((o+=((n=((n+=(r^i^o)+t[9]-640364487|0)<<4|n>>>28)+r|0)^r^i)+t[12]-421815835|0)<<11|o>>>21)+n|0)^n^r)+t[15]+530742520|0)<<16|i>>>16)+o|0)^o^n)+t[2]-995338651|0)<<23|r>>>9)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+t[0]-198630844|0)<<6|n>>>26)+r|0)|~i))+t[7]+1126891415|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+t[14]-1416354905|0)<<15|i>>>17)+o|0)|~n))+t[5]-57434055|0)<<21|r>>>11)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+t[12]+1700485571|0)<<6|n>>>26)+r|0)|~i))+t[3]-1894986606|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+t[10]-1051523|0)<<15|i>>>17)+o|0)|~n))+t[1]-2054922799|0)<<21|r>>>11)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+t[8]+1873313359|0)<<6|n>>>26)+r|0)|~i))+t[15]-30611744|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+t[6]-1560198380|0)<<15|i>>>17)+o|0)|~n))+t[13]+1309151649|0)<<21|r>>>11)+i|0,r=((r+=((o=((o+=(r^((n=((n+=(i^(r|~o))+t[4]-145523070|0)<<6|n>>>26)+r|0)|~i))+t[11]-1120210379|0)<<10|o>>>22)+n|0)^((i=((i+=(n^(o|~r))+t[2]+718787259|0)<<15|i>>>17)+o|0)|~n))+t[9]-343485551|0)<<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 l(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 h(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 t,n,r,i,o,a,s=e.length,u=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=s;t+=64)f(u,l(e.substring(t-64,t)));for(n=(e=e.substring(t-64)).length,r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t<n;t+=1)r[t>>2]|=e.charCodeAt(t)<<(t%4<<3);if(r[t>>2]|=128<<(t%4<<3),55<t)for(f(u,r),t=0;t<16;t+=1)r[t]=0;return i=(i=8*s).toString(16).match(/(.*?)(.{0,8})$/),o=parseInt(i[2],16),a=parseInt(i[1],16)||0,r[14]=o,r[15]=a,f(u,r),u}function n(e){var t,n="";for(t=0;t<4;t+=1)n+=r[e>>8*t+4&15]+r[e>>8*t&15];return n}function a(e){var t;for(t=0;t<e.length;t+=1)e[t]=n(e[t]);return e.join("")}function o(e){return/[\u0080-\uFFFF]/.test(e)&&(e=unescape(encodeURIComponent(e))),e}function s(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 u(){this.reset()}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 f(e,t){return(e=0|e||0)<0?Math.max(e+t,0):Math.min(e,t)}ArrayBuffer.prototype.slice=function(e,t){var n,r,i,o,a=this.byteLength,s=f(e,a),u=a;return t!==c&&(u=f(t,a)),u<s?new ArrayBuffer(0):(n=u-s,r=new ArrayBuffer(n),i=new Uint8Array(r),o=new Uint8Array(this,s,n),i.set(o),r)}}(),u.prototype.append=function(e){return this.appendBinary(o(e)),this},u.prototype.appendBinary=function(e){this._buff+=e,this._length+=e.length;var t,n=this._buff.length;for(t=64;t<=n;t+=64)f(this._hash,l(this._buff.substring(t-64,t)));return this._buff=this._buff.substring(t-64),this},u.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=s(n)),this.reset(),n},u.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},u.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash}},u.prototype.setState=function(e){return this._buff=e.buff,this._length=e.length,this._hash=e.hash,this},u.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},u.prototype._finish=function(e,t){var n,r,i,o=t;if(e[o>>2]|=128<<(o%4<<3),55<o)for(f(this._hash,e),o=0;o<16;o+=1)e[o]=0;n=(n=8*this._length).toString(16).match(/(.*?)(.{0,8})$/),r=parseInt(n[2],16),i=parseInt(n[1],16)||0,e[14]=r,e[15]=i,f(this._hash,e)},u.hash=function(e,t){return u.hashBinary(o(e),t)},u.hashBinary=function(e,t){var n=a(i(e));return t?s(n):n},(u.ArrayBuffer=function(){this.reset()}).prototype.append=function(e){var t,n,r,i,o,a=(n=this._buff.buffer,r=e,i=!0,(o=new Uint8Array(n.byteLength+r.byteLength)).set(new Uint8Array(n)),o.set(new Uint8Array(r),n.byteLength),i?o:o.buffer),s=a.length;for(this._length+=e.byteLength,t=64;t<=s;t+=64)f(this._hash,h(a.subarray(t-64,t)));return this._buff=t-64<s?new Uint8Array(a.buffer.slice(t-64)):new Uint8Array(0),this},u.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=s(n)),this.reset(),n},u.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[1732584193,-271733879,-1732584194,271733878],this},u.ArrayBuffer.prototype.getState=function(){var e,t=u.prototype.getState.call(this);return t.buff=(e=t.buff,String.fromCharCode.apply(null,new Uint8Array(e))),t},u.ArrayBuffer.prototype.setState=function(e){return e.buff=function(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}(e.buff,!0),u.prototype.setState.call(this,e)},u.ArrayBuffer.prototype.destroy=u.prototype.destroy,u.ArrayBuffer.prototype._finish=u.prototype._finish,u.ArrayBuffer.hash=function(e,t){var n=a(function(e){var t,n,r,i,o,a,s=e.length,u=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=s;t+=64)f(u,h(e.subarray(t-64,t)));for(n=(e=t-64<s?e.subarray(t-64):new Uint8Array(0)).length,r=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t<n;t+=1)r[t>>2]|=e[t]<<(t%4<<3);if(r[t>>2]|=128<<(t%4<<3),55<t)for(f(u,r),t=0;t<16;t+=1)r[t]=0;return i=(i=8*s).toString(16).match(/(.*?)(.{0,8})$/),o=parseInt(i[2],16),a=parseInt(i[1],16)||0,r[14]=o,r[15]=a,f(u,r),u}(new Uint8Array(e)));return t?s(n):n},u})},{}],72:[function(e,t,n){t.exports=r;var c=e(18).EventEmitter;function r(){c.call(this)}e(24)(r,c),r.Readable=e(83),r.Writable=e(85),r.Duplex=e(73),r.Transform=e(84),r.PassThrough=e(82),(r.Stream=r).prototype.pipe=function(t,e){var n=this;function r(e){t.writable&&!1===t.write(e)&&n.pause&&n.pause()}function i(){n.readable&&n.resume&&n.resume()}n.on("data",r),t.on("drain",i),t._isStdio||e&&!1===e.end||(n.on("end",a),n.on("close",s));var o=!1;function a(){o||(o=!0,t.end())}function s(){o||(o=!0,"function"==typeof t.destroy&&t.destroy())}function u(e){if(f(),0===c.listenerCount(this,"error"))throw e}function f(){n.removeListener("data",r),t.removeListener("drain",i),n.removeListener("end",a),n.removeListener("close",s),n.removeListener("error",u),t.removeListener("error",u),n.removeListener("end",f),n.removeListener("close",f),t.removeListener("close",f)}return n.on("error",u),t.on("error",u),n.on("end",f),n.on("close",f),t.on("close",f),t.emit("pipe",n),t}},{18:18,24:24,73:73,82:82,83:83,84:84,85:85}],73:[function(e,t,n){t.exports=e(74)},{74:74}],74:[function(e,t,n){arguments[4][30][0].apply(n,arguments)},{13:13,24:24,30:30,59:59,76:76,78:78}],75:[function(e,t,n){arguments[4][31][0].apply(n,arguments)},{13:13,24:24,31:31,77:77}],76:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{10:10,13:13,18:18,24:24,26:26,32:32,59:59,60:60,70:70,74:74,79:79,80:80,81:81,86:86}],77:[function(e,t,n){arguments[4][33][0].apply(n,arguments)},{13:13,24:24,33:33,74:74}],78:[function(e,t,n){arguments[4][34][0].apply(n,arguments)},{101:101,13:13,24:24,34:34,59:59,60:60,70:70,74:74,80:80,81:81,99:99}],79:[function(e,t,n){arguments[4][35][0].apply(n,arguments)},{10:10,35:35,70:70}],80:[function(e,t,n){arguments[4][36][0].apply(n,arguments)},{36:36,59:59}],81:[function(e,t,n){arguments[4][37][0].apply(n,arguments)},{18:18,37:37}],82:[function(e,t,n){t.exports=e(83).PassThrough},{83:83}],83:[function(e,t,n){arguments[4][38][0].apply(n,arguments)},{38:38,74:74,75:75,76:76,77:77,78:78}],84:[function(e,t,n){t.exports=e(83).Transform},{83:83}],85:[function(e,t,n){t.exports=e(78)},{78:78}],86:[function(e,t,n){"use strict";var r=e(70).Buffer,i=r.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}};function o(e){var t;switch(this.encoding=function(e){var t=function(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}}(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=f,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=c,this.end=l,t=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(1<e.lastNeed&&1<t.length){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(2<e.lastNeed&&2<t.length&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);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 u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(55296<=r&&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 f(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 c(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 l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}(n.StringDecoder=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=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var n=function(e,t,n){var r=t.length-1;if(r<n)return 0;var i=a(t[r]);if(0<=i)return 0<i&&(e.lastNeed=i-1),i;if(--r<n||-2===i)return 0;if(0<=(i=a(t[r])))return 0<i&&(e.lastNeed=i-2),i;if(--r<n||-2===i)return 0;if(0<=(i=a(t[r])))return 0<i&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(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)},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}},{70:70}],87:[function(e,t,n){arguments[4][30][0].apply(n,arguments)},{13:13,24:24,30:30,59:59,89:89,91:91}],88:[function(e,t,n){arguments[4][31][0].apply(n,arguments)},{13:13,24:24,31:31,90:90}],89:[function(e,t,n){arguments[4][32][0].apply(n,arguments)},{10:10,13:13,18:18,24:24,26:26,32:32,59:59,60:60,70:70,86:86,87:87,92:92,93:93,94:94}],90:[function(e,t,n){arguments[4][33][0].apply(n,arguments)},{13:13,24:24,33:33,87:87}],91:[function(e,t,n){arguments[4][34][0].apply(n,arguments)},{101:101,13:13,24:24,34:34,59:59,60:60,70:70,87:87,93:93,94:94,99:99}],92:[function(e,t,n){arguments[4][35][0].apply(n,arguments)},{10:10,35:35,70:70}],93:[function(e,t,n){arguments[4][36][0].apply(n,arguments)},{36:36,59:59}],94:[function(e,t,n){arguments[4][37][0].apply(n,arguments)},{18:18,37:37}],95:[function(e,t,n){arguments[4][38][0].apply(n,arguments)},{38:38,87:87,88:88,89:89,90:90,91:91}],96:[function(e,t,n){arguments[4][84][0].apply(n,arguments)},{84:84,95:95}],97:[function(e,t,n){arguments[4][39][0].apply(n,arguments)},{39:39}],98:[function(r,u,e){(function(n){var t=r(96),i=r(103).inherits,o=r(97);function a(e){t.call(this,e),this._destroyed=!1}function s(e,t,n){n(null,e)}function e(r){return function(e,t,n){return"function"==typeof e&&(n=t,t=e,e={}),"function"!=typeof t&&(t=s),"function"!=typeof n&&(n=null),r(e,t,n)}}i(a,t),a.prototype.destroy=function(e){if(!this._destroyed){this._destroyed=!0;var t=this;n.nextTick(function(){e&&t.emit("error",e),t.emit("close")})}},u.exports=e(function(e,t,n){var r=new a(e);return r._transform=t,n&&(r._flush=n),r}),u.exports.ctor=e(function(t,e,n){function r(e){if(!(this instanceof r))return new r(e);this.options=o(t,e),a.call(this,this.options)}return i(r,a),r.prototype._transform=e,n&&(r.prototype._flush=n),r}),u.exports.obj=e(function(e,t,n){var r=new a(o({objectMode:!0,highWaterMark:16},e));return r._transform=t,n&&(r._flush=n),r})}).call(this,r(60))},{103:103,60:60,96:96,97:97}],99:[function(u,e,f){(function(e,t){var r=u(60).nextTick,n=Function.prototype.apply,i=Array.prototype.slice,o={},a=0;function s(e,t){this._id=e,this._clearFn=t}f.setTimeout=function(){return new s(n.call(setTimeout,window,arguments),clearTimeout)},f.setInterval=function(){return new s(n.call(setInterval,window,arguments),clearInterval)},f.clearTimeout=f.clearInterval=function(e){e.close()},s.prototype.unref=s.prototype.ref=function(){},s.prototype.close=function(){this._clearFn.call(window,this._id)},f.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},f.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},f._unrefActive=f.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;0<=t&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},f.setImmediate="function"==typeof e?e:function(e){var t=a++,n=!(arguments.length<2)&&i.call(arguments,1);return o[t]=!0,r(function(){o[t]&&(n?e.apply(null,n):e.call(null),f.clearImmediate(t))}),t},f.clearImmediate="function"==typeof t?t:function(e){delete o[e]}}).call(this,u(99).setImmediate,u(99).clearImmediate)},{60:60,99:99}],100:[function(e,t,n){"use strict";function r(){this.length=0}r.prototype.push=function(e){var t={item:e};this.last?this.last=this.last.next=t:this.last=this.first=t,this.length++},r.prototype.shift=function(){var e=this.first;if(e)return this.first=e.next,--this.length||(this.last=void 0),e.item},r.prototype.slice=function(e,t){e=void 0===e?0:e,t=void 0===t?1/0:t;for(var n=[],r=0,i=this.first;i&&!(--t<0);i=i.next)++r>e&&n.push(i.item);return n},t.exports=r},{}],101:[function(e,t,n){(function(n){function r(e){try{if(!n.localStorage)return!1}catch(e){return!1}var t=n.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}t.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],102:[function(e,t,n){arguments[4][7][0].apply(n,arguments)},{7:7}],103:[function(e,t,n){arguments[4][8][0].apply(n,arguments)},{102:102,24:24,60:60,8:8}],104:[function(e,t,n){var r=e(107),i=e(108),o=i;o.v1=r,o.v4=i,t.exports=o},{107:107,108:108}],105:[function(e,t,n){for(var i=[],r=0;r<256;++r)i[r]=(r+256).toString(16).substr(1);t.exports=function(e,t){var n=t||0,r=i;return r[e[n++]]+r[e[n++]]+r[e[n++]]+r[e[n++]]+"-"+r[e[n++]]+r[e[n++]]+"-"+r[e[n++]]+r[e[n++]]+"-"+r[e[n++]]+r[e[n++]]+"-"+r[e[n++]]+r[e[n++]]+r[e[n++]]+r[e[n++]]+r[e[n++]]+r[e[n++]]}},{}],106:[function(e,t,n){var r="undefined"!=typeof crypto&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&msCrypto.getRandomValues.bind(msCrypto);if(r){var i=new Uint8Array(16);t.exports=function(){return r(i),i}}else{var o=new Array(16);t.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),o[t]=e>>>((3&t)<<3)&255;return o}}},{}],107:[function(e,t,n){var d,y,g=e(106),v=e(105),b=0,_=0;t.exports=function(e,t,n){var r=t&&n||0,i=t||[],o=(e=e||{}).node||d,a=void 0!==e.clockseq?e.clockseq:y;if(null==o||null==a){var s=g();null==o&&(o=d=[1|s[0],s[1],s[2],s[3],s[4],s[5]]),null==a&&(a=y=16383&(s[6]<<8|s[7]))}var u=void 0!==e.msecs?e.msecs:(new Date).getTime(),f=void 0!==e.nsecs?e.nsecs:_+1,c=u-b+(f-_)/1e4;if(c<0&&void 0===e.clockseq&&(a=a+1&16383),(c<0||b<u)&&void 0===e.nsecs&&(f=0),1e4<=f)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");b=u,y=a;var l=(1e4*(268435455&(u+=122192928e5))+(_=f))%4294967296;i[r++]=l>>>24&255,i[r++]=l>>>16&255,i[r++]=l>>>8&255,i[r++]=255&l;var h=u/4294967296*1e4&268435455;i[r++]=h>>>8&255,i[r++]=255&h,i[r++]=h>>>24&15|16,i[r++]=h>>>16&255,i[r++]=a>>>8|128,i[r++]=255&a;for(var p=0;p<6;++p)i[r+p]=o[p];return t||v(i)}},{105:105,106:106}],108:[function(e,t,n){var a=e(106),s=e(105);t.exports=function(e,t,n){var r=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var i=(e=e||{}).random||(e.rng||a)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t)for(var o=0;o<16;++o)t[r+o]=i[o];return t||s(i)}},{105:105,106:106}],109:[function(e,t,n){"use strict";function p(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){i[t.pop()]=e}else t.push(e)}n.stringify=function(e){var t=[];t.push({obj:e});for(var n,r,i,o,a,s,u,f,c,l,h="";n=t.pop();)if(r=n.obj,h+=n.prefix||"",i=n.val||"")h+=i;else if("object"!=typeof r)h+=void 0===r?null:JSON.stringify(r);else if(null===r)h+="null";else if(Array.isArray(r)){for(t.push({val:"]"}),o=r.length-1;0<=o;o--)a=0===o?"":",",t.push({obj:r[o],prefix:a});t.push({val:"["})}else{for(u in s=[],r)r.hasOwnProperty(u)&&s.push(u);for(t.push({val:"}"}),o=s.length-1;0<=o;o--)c=r[f=s[o]],l=0<o?",":"",l+=JSON.stringify(f)+":",t.push({obj:c,prefix:l});t.push({val:"{"})}return h},n.parse=function(e){for(var t,n,r,i,o,a,s,u,f,c=[],l=[],h=0;;)if("}"!==(t=e[h++])&&"]"!==t&&void 0!==t)switch(t){case" ":case"\t":case"\n":case":":case",":break;case"n":h+=3,p(null,c,l);break;case"t":h+=3,p(!0,c,l);break;case"f":h+=4,p(!1,c,l);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"-":for(n="",h--;;){if(r=e[h++],!/[\d\.\-e\+]/.test(r)){h--;break}n+=r}p(parseFloat(n),c,l);break;case'"':for(i="",o=void 0,a=0;'"'!==(s=e[h++])||"\\"===o&&a%2==1;)i+=s,"\\"===(o=s)?a++:a=0;p(JSON.parse('"'+i+'"'),c,l);break;case"[":u={element:[],index:c.length},c.push(u.element),l.push(u);break;case"{":f={element:{},index:c.length},c.push(f.element),l.push(f);break;default:throw new Error("unexpectedly reached end of input: "+t)}else{if(1===c.length)return c.pop();p(c.pop(),c,l)}}},{}],110:[function(e,t,n){t.exports=function(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}return e}},{}],111:[function(et,e,t){(function(e){"use strict";function t(e){return e&&"object"==typeof e&&"default"in e?e.default:e}var d=t(et(4)),y=t(et(23)),n=et(18),r=t(n),i=t(et(24)),h=t(et(71)),o=t(et(104)),a=t(et(58)),s=t(et(69)),u=t(et(27)),f=t(et(109)),g=t(et(41)),w=et(98),v=t(et(15)),j=t(et(11)),c=t(et(51));function l(e){if(e instanceof ArrayBuffer)return function(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}(e);var t=e.size,n=e.type;return"function"==typeof e.slice?e.slice(0,t,n):e.webkitSlice(0,t,n)}var E,C,p,b=Function.prototype.toString,_=b.call(Object);function k(e){var t,n,r,i;if(!e||"object"!=typeof e)return e;if(Array.isArray(e)){for(t=[],n=0,r=e.length;n<r;n++)t[n]=k(e[n]);return t}if(e instanceof Date)return e.toISOString();if(i=e,"undefined"!=typeof ArrayBuffer&&i instanceof ArrayBuffer||"undefined"!=typeof Blob&&i instanceof Blob)return l(e);if(!function(e){var t=Object.getPrototypeOf(e);if(null===t)return!0;var n=t.constructor;return"function"==typeof n&&n instanceof n&&b.call(n)==_}(e))return e;for(n in t={},e)if(Object.prototype.hasOwnProperty.call(e,n)){var o=k(e[n]);void 0!==o&&(t[n]=o)}return t}function m(e){return"$"+e}function S(){this._store={}}function x(e){if(this._store=new S,e&&Array.isArray(e))for(var t=0,n=e.length;t<n;t++)this.add(e[t])}S.prototype.get=function(e){var t=m(e);return this._store[t]},S.prototype.set=function(e,t){var n=m(e);return this._store[n]=t,!0},S.prototype.has=function(e){return m(e)in this._store},S.prototype.delete=function(e){var t=m(e),n=t in this._store;return delete this._store[t],n},S.prototype.forEach=function(e){for(var t=Object.keys(this._store),n=0,r=t.length;n<r;n++){var i=t[n];e(this._store[i],i=i.substring(1))}},Object.defineProperty(S.prototype,"size",{get:function(){return Object.keys(this._store).length}}),x.prototype.add=function(e){return this._store.set(e,!0)},x.prototype.has=function(e){return this._store.has(e)},x.prototype.forEach=function(n){this._store.forEach(function(e,t){n(t)})},Object.defineProperty(x.prototype,"size",{get:function(){return this._store.size}}),!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}()?(E=x,C=S):(E=Set,C=Map);try{localStorage.setItem("_pouch_check_localstorage",1),p=!!localStorage.getItem("_pouch_check_localstorage")}catch(e){p=!1}function B(){return p}function O(){var t;n.EventEmitter.call(this),this._listeners={},t=this,B()&&addEventListener("storage",function(e){t.emit(e.key)})}i(O,n.EventEmitter),O.prototype.addListener=function(e,t,n,r){if(!this._listeners[t]){var i=this,o=!1;this._listeners[t]=a,this.on(e,a)}function a(){if(i._listeners[t])if(o)o="waiting";else{o=!0;var e=function(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}(r,["style","include_docs","attachments","conflicts","filter","doc_ids","view","since","query_params","binary","return_docs"]);n.changes(e).on("change",function(e){e.seq>r.since&&!r.cancelled&&(r.since=e.seq,r.onChange(e))}).on("complete",function(){"waiting"===o&&y(a),o=!1}).on("error",function(){o=!1})}}},O.prototype.removeListener=function(e,t){t in this._listeners&&(n.EventEmitter.prototype.removeListener.call(this,e,this._listeners[t]),delete this._listeners[t])},O.prototype.notifyLocalWindows=function(e){B()&&(localStorage[e]="a"===localStorage[e]?"b":"a")},O.prototype.notify=function(e){this.emit(e),this.notifyLocalWindows(e)};var A="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};function T(e,t,n){Error.call(this,n),this.status=e,this.name=t,this.message=n,this.error=!0}i(T,Error),T.prototype.toString=function(){return JSON.stringify({status:this.status,name:this.name,message:this.message,reason:this.reason})};new T(401,"unauthorized","Name or password is incorrect."),new T(400,"bad_request","Missing JSON list of 'docs'");var M=new T(404,"not_found","missing"),R=new T(409,"conflict","Document update conflict"),L=new T(400,"bad_request","_id field must contain a string"),I=new T(412,"missing_id","_id is required for puts"),q=new T(400,"bad_request","Only reserved document ids may start with underscore."),N=new T(412,"precondition_failed","Database not open"),D=(new T(500,"unknown_error","Database encountered an unknown error"),new T(500,"badarg","Some query argument is invalid")),U=(new T(400,"invalid_request","Request was invalid"),new T(400,"query_parse_error","Some query parameter is invalid"),new T(500,"doc_validation","Bad special document member")),P=new T(400,"bad_request","Something wrong with the request"),W=(new T(400,"bad_request","Document must be a JSON object"),new T(404,"not_found","Database not found"),new T(500,"indexed_db_went_bad","unknown"),new T(500,"web_sql_went_bad","unknown"),new T(500,"levelDB_went_went_bad","unknown"),new T(403,"forbidden","Forbidden by design doc validate_doc_update function"),new T(400,"bad_request","Invalid rev format")),F=(new T(412,"file_exists","The database could not be created, the file already exists."),new T(412,"missing_stub","A pre-existing attachment stub wasn't found"));new T(413,"invalid_url","Provided URL is invalid");function z(n,e){function t(e){for(var t in n)"function"!=typeof n[t]&&(this[t]=n[t]);void 0!==e&&(this.reason=e)}return t.prototype=T.prototype,new t(e)}function K(r){var i={},o=r.filter&&"function"==typeof r.filter;return i.query=r.query_params,function(e){e.doc||(e.doc={});var t=o&&function(e,t,n){try{return!e(t,n)}catch(e){var r="Filter function threw: "+e.toString();return z(P,r)}}(r.filter,e.doc,i);if("object"==typeof t)return t;if(t)return!1;if(r.include_docs){if(!r.attachments)for(var n in e.doc._attachments)e.doc._attachments.hasOwnProperty(n)&&(e.doc._attachments[n].stub=!0)}else delete e.doc;return!0}}var V=function(){}.name?function(e){return e.name}:function(e){var t=e.toString().match(/^\s*function\s*(?:(\S+)\s*)?\(/);return t&&t[1]?t[1]:""};var H=function(e){return atob(e)},J=function(e){return btoa(e)};function Y(t,n){t=t||[],n=n||{};try{return new Blob(t,n)}catch(e){if("TypeError"!==e.name)throw e;for(var r=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),i=0;i<t.length;i+=1)r.append(t[i]);return r.getBlob(n.type)}}function G(e,t){return Y([function(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}(e)],{type:t})}function $(e,n){var t=new FileReader,r="function"==typeof t.readAsBinaryString;t.onloadend=function(e){var t=e.target.result||"";if(r)return n(t);n(function(e){for(var t="",n=new Uint8Array(e),r=n.byteLength,i=0;i<r;i++)t+=String.fromCharCode(n[i]);return t}(t))},r?t.readAsBinaryString(e):t.readAsArrayBuffer(e)}var X=e.setImmediate||e.setTimeout,Z=32768;function Q(t,e,n,r,i){var o,a,s,u,f,c;(0<n||r<e.size)&&(a=n,s=r,e=(o=e).webkitSlice?o.webkitSlice(a,s):o.slice(a,s)),u=e,f=function(e){t.append(e),i()},(c=new FileReader).onloadend=function(e){var t=e.target.result||new ArrayBuffer(0);f(t)},c.readAsArrayBuffer(u)}function ee(e,t,n,r,i){(0<n||r<t.length)&&(t=t.substring(n,r)),e.appendBinary(t),i()}function te(n,r){var e="string"==typeof n,t=e?n.length:n.size,i=Math.min(Z,t),o=Math.ceil(t/i),a=0,s=e?new h:new h.ArrayBuffer,u=e?ee:Q;function f(){X(l)}function c(){var e=s.end(!0),t=J(e);r(t),s.destroy()}function l(){var e=a*i,t=e+i;u(s,n,e,t,++a<o?f:c)}l()}function ne(e,t){var n,r=k(e);return t?(delete r._rev_tree,n=JSON.stringify(r),h.hash(n)):o.v4().replace(/-/g,"").toLowerCase()}var re=o.v4;function ie(){Error.call(this)}i(ie,Error),ie.prototype.name="NotFoundError";var oe=r.EventEmitter,ae=new ie,se=function(i,o,r,a){var s=new oe;function u(e){var t,n={};if(a)for(t in a)void 0!==a[t]&&(n[t]=a[t]);if(e)for(t in e)void 0!==e[t]&&(n[t]=e[t]);return n}return s.sublevels={},s.options=a,s.version="6.5.4",s.methods={},o=o||[],s.put=function(t,n,e,r){"function"==typeof e&&(r=e,e={}),i.apply([{key:t,value:n,prefix:o.slice(),type:"put"}],u(e),function(e){if(e)return r(e);s.emit("put",t,n),r(null)})},s.prefix=function(){return o.slice()},s.batch=function(t,e,n){"function"==typeof e&&(n=e,e={}),t=t.map(function(e){return{key:e.key,value:e.value,prefix:e.prefix||o,keyEncoding:e.keyEncoding,valueEncoding:e.valueEncoding,type:e.type}}),i.apply(t,u(e),function(e){if(e)return n(e);s.emit("batch",t),n(null)})},s.get=function(e,t,n){"function"==typeof t&&(n=t,t={}),i.get(e,o,u(t),function(e,t){e?n(ae):n(null,t)})},s.sublevel=function(e,t){return s.sublevels[e]=s.sublevels[e]||se(i,o.concat(e),r,u(t))},s.readStream=s.createReadStream=function(e){var t;(e=u(e)).prefix=o;var n=i.iterator(e);return(t=r(e,i.createDecoder(e))).setIterator(n),t},s.close=function(e){i.close(e)},s.isOpen=i.isOpen,s.isClosed=i.isClosed,s},ue=s.Readable;function fe(e,t){if(!(this instanceof fe))return new fe(e,t);ue.call(this,{objectMode:!0,highWaterMark:e.highWaterMark}),this._waiting=!1,this._options=e,this._makeData=t}i(fe,ue),fe.prototype.setIterator=function(e){return this._iterator=e,this._destroyed?e.end(function(){}):this._waiting?(this._waiting=!1,this._read()):this},fe.prototype._read=function(){var r=this;if(!r._destroyed)return r._iterator?void r._iterator.next(function(e,t,n){if(e||void 0===t&&void 0===n)return e||r._destroyed||r.push(null),r._cleanup(e);n=r._makeData(t,n),r._destroyed||r.push(n)}):this._waiting=!0},fe.prototype._cleanup=function(e){if(!this._destroyed){this._destroyed=!0;var t=this;e&&"iterator has ended"!==e.message&&t.emit("error",e),t._iterator?t._iterator.end(function(){t._iterator=null,t.emit("close")}):t.emit("close")}},fe.prototype.destroy=function(){this._cleanup()};var ce={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:"ÿ"},le=new u;function he(e){return se(function(c,i,l){function h(e,t,n,r){return i.encode([e,l.encodeKey(t,n,r)])}return c.open(function(){}),{apply:function(e,t,n){t=t||{};for(var r,i,o,a=[],s=-1,u=e.length;++s<u;){var f=e[s];(o=(i=f).prefix)&&o.options&&(i.keyEncoding=i.keyEncoding||o.options.keyEncoding,i.valueEncoding=i.valueEncoding||o.options.valueEncoding),f.prefix="function"==typeof(r=f.prefix).prefix?r.prefix():r,a.push({key:h(f.prefix,f.key,t,f),value:"del"!==f.type&&l.encodeValue(f.value,t,f),type:f.type})}c.db.batch(a,t,n)},get:function(e,t,n,r){return n.asBuffer=l.valueAsBuffer(n),c.db.get(h(t,e,n),n,function(e,t){e?r(e):r(null,l.decodeValue(t,n))})},createDecoder:function(n){return function(e,t){return{key:l.decodeKey(i.decode(e)[1],n),value:l.decodeValue(t,n)}}},isClosed:function(){return c.isClosed()},close:function(e){return c.close(e)},iterator:function(e){var t,n=function(e){var t={};for(var n in e)t[n]=e[n];return t}(e||{}),r=e.prefix||[];return a.toLtgt(e,n,function(e){return h(r,e,n,{})},i.lowerBound,i.upperBound),n.prefix=null,n.keyAsBuffer=n.valueAsBuffer=!1,"number"!=typeof n.limit&&(n.limit=-1),n.keyAsBuffer=i.buffer,n.valueAsBuffer=l.valueAsBuffer(n),t=c.db.iterator(n),{next:function(e){return t.next(e)},end:function(e){t.end(e)}}}}}(e,ce,le),[],fe,e.options)}function pe(e){return e.reduce(function(e,t){return e[t]=!0,e},{})}var de=pe(["_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"]),ye=pe(["_attachments","_replication_id","_replication_state","_replication_state_time","_replication_state_reason","_replication_stats"]);function ge(e){if(!/^\d+-./.test(e))return z(W);var t=e.indexOf("-"),n=e.substring(0,t),r=e.substring(t+1);return{prefix:parseInt(n,10),id:r}}function ve(e,t,n){var r,i,o;n||(n={deterministic_revs:!0});var a={status:"available"};if(e._deleted&&(a.deleted=!0),t)if(e._id||(e._id=re()),i=ne(e,n.deterministic_revs),e._rev){if((o=ge(e._rev)).error)return o;e._rev_tree=[{pos:o.prefix,ids:[o.id,{status:"missing"},[[i,a,[]]]]}],r=o.prefix+1}else e._rev_tree=[{pos:1,ids:[i,a,[]]}],r=1;else if(e._revisions&&(e._rev_tree=function(e,t){for(var n=e.start-e.ids.length+1,r=e.ids,i=[r[0],t,[]],o=1,a=r.length;o<a;o++)i=[r[o],{status:"missing"},[i]];return[{pos:n,ids:i}]}(e._revisions,a),r=e._revisions.start,i=e._revisions.ids[0]),!e._rev_tree){if((o=ge(e._rev)).error)return o;r=o.prefix,i=o.id,e._rev_tree=[{pos:r,ids:[i,a,[]]}]}!function(e){var t;if(e?"string"!=typeof e?t=z(L):/^_/.test(e)&&!/^_(design|local)/.test(e)&&(t=z(q)):t=z(I),t)throw t}(e._id),e._rev=r+"-"+i;var s={metadata:{},data:{}};for(var u in e)if(Object.prototype.hasOwnProperty.call(e,u)){var f="_"===u[0];if(f&&!de[u]){var c=z(U,u);throw c.message=U.message+": "+u,c}f&&!ye[u]?s.metadata[u.slice(1)]=e[u]:s.data[u]=e[u]}return s}function be(e){for(var t,n,r,i,o=e.rev_tree.slice();i=o.pop();){var a=i.ids,s=a[2],u=i.pos;if(s.length)for(var f=0,c=s.length;f<c;f++)o.push({pos:u+1,ids:s[f]});else{var l=!!a[1].deleted,h=a[0];t&&!(r!==l?r:n!==u?n<u:t<h)||(t=h,n=u,r=l)}}return n+"-"+t}function _e(e,t){for(var n,r=e.slice();n=r.pop();)for(var i=n.pos,o=n.ids,a=o[2],s=t(0===a.length,i,o[0],n.ctx,o[1]),u=0,f=a.length;u<f;u++)r.push({pos:i+1,ids:a[u],ctx:s})}function me(e,t){return e.pos-t.pos}function we(e){for(var t=be(e),n=function(e){var o=[];_e(e,function(e,t,n,r,i){e&&o.push({rev:t+"-"+n,pos:t,opts:i})}),o.sort(me).reverse();for(var t=0,n=o.length;t<n;t++)delete o[t].pos;return o}(e.rev_tree),r=[],i=0,o=n.length;i<o;i++){var a=n[i];a.rev===t||a.opts.deleted||r.push(a.rev)}return r}function Ee(e,t){return e.pos-t.pos}function ke(e,t){for(var n,r,i=t,o=e.length;i<o;i++){var a=e[i],s=[a.id,a.opts,[]];r?(r[2].push(s),r=s):n=r=s}return n}function Se(e,t){return e[0]<t[0]?-1:1}function xe(e,t){for(var n,r,i,o=[{tree1:e,tree2:t}],a=!1;0<o.length;){var s=o.pop(),u=s.tree1,f=s.tree2;(u[1].status||f[1].status)&&(u[1].status="available"===u[1].status||"available"===f[1].status?"available":"missing");for(var c=0;c<f[2].length;c++)if(u[2][0]){for(var l=!1,h=0;h<u[2].length;h++)u[2][h][0]===f[2][c][0]&&(o.push({tree1:u[2][h],tree2:f[2][c]}),l=!0);l||(a="new_branch",n=u[2],r=f[2][c],void 0,i=function(e,t,n){for(var r,i=0,o=e.length;i<o;)n(e[r=i+o>>>1],t)<0?i=r+1:o=r;return i}(n,r,Se),n.splice(i,0,r))}else a="new_leaf",u[2][0]=f[2][c]}return{conflicts:a,tree:e}}function Be(e,t,n){var r,i=[],o=!1,a=!1;if(!e.length)return{tree:[t],conflicts:"new_leaf"};for(var s=0,u=e.length;s<u;s++){var f=e[s];if(f.pos===t.pos&&f.ids[0]===t.ids[0])r=xe(f.ids,t.ids),i.push({pos:f.pos,ids:r.tree}),o=o||r.conflicts,a=!0;else if(!0!==n){var c=f.pos<t.pos?f:t,l=f.pos<t.pos?t:f,h=l.pos-c.pos,p=[],d=[];for(d.push({ids:c.ids,diff:h,parent:null,parentIdx:null});0<d.length;){var y=d.pop();if(0!==y.diff)for(var g=y.ids[2],v=0,b=g.length;v<b;v++)d.push({ids:g[v],diff:y.diff-1,parent:y.ids,parentIdx:v});else y.ids[0]===l.ids[0]&&p.push(y)}var _=p[0];_?(r=xe(_.ids,l.ids),_.parent[2][_.parentIdx]=r.tree,i.push({pos:c.pos,ids:c.ids}),o=o||r.conflicts,a=!0):i.push(f)}else i.push(f)}return a||i.push(t),i.sort(Ee),{tree:i,conflicts:o||"internal_node"}}function Oe(e,t,n){var r=Be(e,t),i=function(e,t){for(var r,n,i=function(e){for(var t,n=[],r=e.slice();t=r.pop();){var i=t.pos,o=t.ids,a=o[0],s=o[1],u=o[2],f=0===u.length,c=t.history?t.history.slice():[];c.push({id:a,opts:s}),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()}(e),o=0,a=i.length;o<a;o++){var s,u=i[o],f=u.ids;if(f.length>t){r||(r={});var c=f.length-t;s={pos:u.pos+c,ids:ke(f,c)};for(var l=0;l<c;l++){var h=u.pos+l+"-"+f[l].id;r[h]=!0}}else s={pos:u.pos,ids:ke(f,0)};n=n?Be(n,s,!0).tree:[s]}return r&&_e(n,function(e,t,n){delete r[t+"-"+n]}),{tree:n,revs:r?Object.keys(r):[]}}(r.tree,n);return{tree:i.tree,stemmedRevs:i.revs,conflicts:r.conflicts}}function Ae(e){return e.ids}function Te(e,t){t||(t=be(e));for(var n,r=t.substring(t.indexOf("-")+1),i=e.rev_tree.map(Ae);n=i.pop();){if(n[0]===r)return!!n[1].deleted;i=i.concat(n[2])}}function Le(e){return/^_local/.test(e)}function je(e,t,n,r,i,o,a,s){if(function(e,t){for(var n,r=e.slice(),i=t.split("-"),o=parseInt(i[0],10),a=i[1];n=r.pop();){if(n.pos===o&&n.ids[0]===a)return!0;for(var s=n.ids[2],u=0,f=s.length;u<f;u++)r.push({pos:n.pos+1,ids:s[u]})}return!1}(t.rev_tree,n.metadata.rev)&&!s)return r[i]=n,o();var u=t.winningRev||be(t),f="deleted"in t?t.deleted:Te(t,u),c="deleted"in n.metadata?n.metadata.deleted:Te(n.metadata),l=/^1-/.test(n.metadata.rev);if(f&&!c&&s&&l){var h=n.data;h._rev=u,h._id=n.metadata.id,n=ve(h,s)}var p=Oe(t.rev_tree,n.metadata.rev_tree[0],e);if(s&&(f&&c&&"new_leaf"!==p.conflicts||!f&&"new_leaf"!==p.conflicts||f&&!c&&"new_branch"===p.conflicts)){var d=z(R);return r[i]=d,o()}var y=n.metadata.rev;n.metadata.rev_tree=p.tree,n.stemmedRevs=p.stemmedRevs||[],t.rev_map&&(n.metadata.rev_map=t.rev_map);var g=be(n.metadata),v=Te(n.metadata,g),b=f===v?0:f<v?-1:1;a(n,g,v,y===g?v:Te(n.metadata,y),!0,b,i,o)}function Ce(u,e,i,f,o,c,l,h,t){u=u||1e3;var p=h.new_edits,a=new C,n=0,s=e.length;function d(){++n===s&&t&&t()}e.forEach(function(e,n){if(e._id&&Le(e._id)){var t=e._deleted?"_removeLocal":"_putLocal";i[t](e,{ctx:o},function(e,t){c[n]=e||t,d()})}else{var r=e.metadata.id;a.has(r)?(s--,a.get(r).push([e,n])):a.set(r,[[e,n]])}}),a.forEach(function(i,o){var a=0;function s(){++a<i.length?e():d()}function e(){var e=i[a],t=e[0],n=e[1];if(f.has(o))je(u,f.get(o),t,c,n,s,l,p);else{var r=Oe([],t.metadata.rev_tree[0],u);t.metadata.rev_tree=r.tree,t.stemmedRevs=r.stemmedRevs||[],function(e,t,n){var r=be(e.metadata),i=Te(e.metadata,r);if("was_delete"in h&&i)return c[t]=z(M,"deleted"),n();if(p&&"missing"===e.metadata.rev_tree[0].ids[1].status){var o=z(R);return c[t]=o,n()}l(e,r,i,i,!1,i?0:1,t,n)}(t,n,s)}}e()})}function Me(e,t){return Y([new Uint8Array(e)],{type:t})}function Re(e,t){var n=t.prefix()[0],r=e._cache,i=r.get(n);return i||(i=new C,r.set(n,i)),i}function Ie(){this._batch=[],this._cache=new C}Ie.prototype.get=function(e,n,r){var i=Re(this,e),t=i.get(n);return t?y(function(){r(null,t)}):null===t?y(function(){r({name:"NotFoundError"})}):void e.get(n,function(e,t){if(e)return"NotFoundError"===e.name&&i.set(n,null),r(e);i.set(n,t),r(null,t)})},Ie.prototype.batch=function(e){for(var t=0,n=e.length;t<n;t++){var r=e[t],i=Re(this,r.prefix);"put"===r.type?i.set(r.key,r.value):i.set(r.key,null)}this._batch=this._batch.concat(e)},Ie.prototype.execute=function(e,t){for(var n=new E,r=[],i=this._batch.length-1;0<=i;i--){var o=this._batch[i],a=o.prefix.prefix()[0]+"ÿ"+o.key;n.has(a)||(n.add(a),r.push(o))}e.batch(r,t)};var qe="document-store",Ne="by-sequence",De="attach-store",Ue="attach-binary-store",Pe="local-store",We="meta-store",Fe=new C,ze="_local_last_update_seq",Ke="_local_doc_count",Ve="_local_uuid",He="md5-",Je={encode:function(t){try{return JSON.stringify(t)}catch(e){return f.stringify(t)}},decode:function(t){try{return JSON.parse(t)}catch(e){return f.parse(t)}},buffer:!1,type:"cheap-json"},Ye=new O;function Ge(e){return"winningRev"in e?e.winningRev:be(e)}function $e(e,t){return"deleted"in e?e.deleted:Te(e,t)}function Xe(e,n,r){var i=[];return e.forEach(function(n){n.doc&&n.doc._attachments&&Object.keys(n.doc._attachments).forEach(function(e){var t=n.doc._attachments[e];"data"in t||i.push(t)})}),Promise.all(i.map(function(e){return t=n,a=r,s=(o=e).content_type,new Promise(function(r,i){t.binaryStore.get(o.digest,function(e,t){var n;if(e){if("NotFoundError"!==e.name)return i(e);n=a.binary?G("",s):""}else n=a.binary?Me(t,s):t.toString("base64");delete o.stub,delete o.length,o.data=n,r()})});var o,t,a,s}))}function Ze(t,n){t=k(t);var r,b,_=this,T={},h=t.revs_limit,m=t.name;void 0===t.createIfMissing&&(t.createIfMissing=!0);var i,o=t.db,e=V(o);function a(){T.docStore=b.sublevel(qe,{valueEncoding:Je}),T.bySeqStore=b.sublevel(Ne,{valueEncoding:"json"}),T.attachmentStore=b.sublevel(De,{valueEncoding:"json"}),T.binaryStore=b.sublevel(Ue,{valueEncoding:"binary"}),T.localStore=b.sublevel(Pe,{valueEncoding:"json"}),T.metaStore=b.sublevel(We,{valueEncoding:"json"}),"object"==typeof t.migrate?t.migrate.doMigrationTwo(b,T,s):s()}function s(){T.metaStore.get(ze,function(e,t){void 0===b._updateSeq&&(b._updateSeq=t||0),T.metaStore.get(Ke,function(e,t){b._docCount=e?0:t,T.metaStore.get(Ve,function(e,t){r=e?re():t,T.metaStore.put(Ve,r,function(){y(function(){n(null,_)})})})})})}function u(e,t){try{e.apply(null,t)}catch(e){t[t.length-1](e)}}function f(){var e,t,n,r=b._queue.peekFront();"read"===r.type?function(e){var r=[e],t=1,n=b._queue.get(t);for(;void 0!==n&&"read"===n.type;)r.push(n),t++,n=b._queue.get(t);var i=0;r.forEach(function(e){var t=e.args,n=t[t.length-1];t[t.length-1]=d(function(e){n.apply(null,e),++i===r.length&&y(function(){r.forEach(function(){b._queue.shift()}),b._queue.length&&f()})}),u(e.fun,t)})}(r):(t=(e=r).args,n=t[t.length-1],t[t.length-1]=d(function(e){n.apply(null,e),y(function(){b._queue.shift(),b._queue.length&&f()})}),u(e.fun,t))}function c(t){return d(function(e){b._queue.push({fun:t,args:e,type:"write"}),1===b._queue.length&&y(f)})}function l(t){return d(function(e){b._queue.push({fun:t,args:e,type:"read"}),1===b._queue.length&&y(f)})}function L(e){return("0000000000000000"+e).slice(-16)}function p(e,t){"destroy"in o&&o.destroy(e,t)}Fe.has(e)?i=Fe.get(e):(i=new C,Fe.set(e,i)),i.has(m)?(b=i.get(m),a()):i.set(m,he(g(o(m),t,function(e){if(e)return i.delete(m),n(e);(b=i.get(m))._docCount=-1,b._queue=new v,"object"==typeof t.migrate?t.migrate.doMigrationOne(m,b,a):a()}))),_._remote=!1,_.type=function(){return"leveldb"},_._id=function(e){e(null,r)},_._info=function(e){var t={doc_count:b._docCount,update_seq:b._updateSeq,backend_adapter:V(o)};return y(function(){e(null,t)})},_._get=l(function(e,i,o){i=k(i),T.docStore.get(e,function(e,n){if(e||!n)return o(z(M,"missing"));var r;if(i.rev)r=i.latest?function(e,t){for(var n,r=t.rev_tree.slice();n=r.pop();){var i=n.pos,o=n.ids,a=o[0],s=o[1],u=o[2],f=0===u.length,c=n.history?n.history.slice():[];if(c.push({id:a,pos:i,opts:s}),f)for(var l=0,h=c.length;l<h;l++){var p=c[l];if(p.pos+"-"+p.id===e)return i+"-"+a}for(var d=0,y=u.length;d<y;d++)r.push({pos:i+1,ids:u[d],history:c})}throw new Error("Unable to resolve latest revision for id "+t.id+", rev "+e)}(i.rev,n):i.rev;else if(r=Ge(n),$e(n,r))return o(z(M,"deleted"));var t=n.rev_map[r];T.bySeqStore.get(L(t),function(e,t){if(!t)return o(z(M));if("_id"in t&&t._id!==n.id)return o(new Error("wrong doc returned"));if(t._id=n.id,"_rev"in t){if(t._rev!==r)return o(new Error("wrong doc returned"))}else t._rev=r;return o(null,{doc:t,metadata:n})})})}),_._getAttachment=function(e,t,n,r,i){var o=n.digest,a=n.content_type;T.binaryStore.get(o,function(e,t){if(e)return"NotFoundError"!==e.name?i(e):i(null,r.binary?Y([""],{type:a}):"");r.binary?i(null,Me(t,a)):i(null,t.toString("base64"))})},_._bulkDocs=c(function(e,t,w){var n=t.new_edits,E=new Array(e.docs.length),k=new C,S=new C,x=new Ie,B=0,O=b._updateSeq,s=e.docs,r=s.map(function(e){if(e._id&&Le(e._id))return e;var t=ve(e,n,_.__opts);return t.metadata&&!t.metadata.rev_map&&(t.metadata.rev_map={}),t}),i=r.filter(function(e){return e.error});if(i.length)return w(i[0]);function o(e,t){var n=Promise.resolve();e.forEach(function(e,r){n=n.then(function(){return new Promise(function(t,n){_._doCompactionNoLock(r,e,{ctx:x},function(e){if(e)return n(e);t()})})})}),n.then(function(){t()},t)}function a(e){var n=new C;k.forEach(function(e,t){var o;n.set(t,(o=[],_e(e.rev_tree,function(e,t,n,r,i){"available"!==i.status||e||(o.push(t+"-"+n),i.status="missing")}),o))}),o(n,e)}function u(){o(S,function(e){if(e&&l(e),_.auto_compaction)return a(l);l()})}function f(n,e,t,r,i,o,a,s){B+=o;var u=null,f=0;n.metadata.winningRev=e,n.metadata.deleted=t,n.data._id=n.metadata.id,n.data._rev=n.metadata.rev,r&&(n.data._deleted=!0),n.stemmedRevs.length&&S.set(n.metadata.id,n.stemmedRevs);var c,l,h=n.data._attachments?Object.keys(n.data._attachments):[];function p(e){f++,u||(e?s(u=e):f===h.length&&m())}function d(t,n,r,i){return function(e){!function(e,n,t,r,i){var o=e.data._attachments[t];delete o.data,o.digest=n,o.length=r.length;var a=e.metadata.id,s=e.metadata.rev;o.revpos=parseInt(s,10),A(a,s,n,function(e,t){return e?i(e):0===r.length?i(e):t?(x.batch([{type:"put",prefix:T.binaryStore,key:n,value:j(r,"binary")}]),void i()):i(e)})}(t,He+e,n,r,i)}}function y(t,n,r){return function(e){te(e,d(t,n,e,r))}}for(var g=0;g<h.length;g++){var v,b=h[g],_=n.data._attachments[b];if(_.stub)A(n.data._id,n.data._rev,_.digest,p);else if("string"==typeof _.data){try{v=H(_.data)}catch(e){return void w(z(D,"Attachment is not a valid base64 string"))}y(n,b,p)(v)}else c=_.data,l=y(n,b,p),$(c,l)}function m(){var e=n.metadata.rev_map[n.metadata.rev];if(e)return s();e=++O,n.metadata.rev_map[n.metadata.rev]=n.metadata.seq=e;var t=[{key:L(e),value:n.data,prefix:T.bySeqStore,type:"put"},{key:n.metadata.id,value:n.metadata,prefix:T.docStore,type:"put"}];x.batch(t),E[a]={ok:!0,id:n.metadata.id,rev:n.metadata.rev},k.set(n.metadata.id,n.metadata),s()}h.length||m()}var c={};function A(r,i,o,t){function e(t){var e=[r,i].join("@"),n={};return t?t.refs&&(n.refs=t.refs,n.refs[e]=!0):(n.refs={},n.refs[e]=!0),new Promise(function(e){x.batch([{type:"put",prefix:T.attachmentStore,key:o,value:n}]),e(!t)})}var n=c[o]||Promise.resolve();c[o]=n.then(function(){return new Promise(function(n,r){x.get(T.attachmentStore,o,function(e,t){if(e&&"NotFoundError"!==e.name)return r(e);n(t)})}).then(e).then(function(e){t(null,e)},t)})}function l(e){if(e)return y(function(){w(e)});x.batch([{prefix:T.metaStore,type:"put",key:ze,value:O},{prefix:T.metaStore,type:"put",key:Ke,value:b._docCount+B}]),x.execute(b,function(e){if(e)return w(e);b._docCount+=B,b._updateSeq=O,Ye.notify(m),y(function(){w(null,E)})})}if(!r.length)return w(null,[]);!function(t){var i=[];if(s.forEach(function(n){n&&n._attachments&&Object.keys(n._attachments).forEach(function(e){var t=n._attachments[e];t.stub&&i.push(t.digest)})}),!i.length)return t();var o,a=0;i.forEach(function(e){var n,r;n=e,r=function(e){e&&!o&&(o=e),++a===i.length&&t(o)},x.get(T.attachmentStore,n,function(e){if(e){var t=z(F,"unknown stub attachment with digest "+n);r(t)}else r()})})}(function(e){if(e)return w(e);!function(e){var r,t=0;function i(){if(++t===s.length)return e(r)}s.forEach(function(n){if(n._id&&Le(n._id))return i();x.get(T.docStore,n._id,function(e,t){e?"NotFoundError"!==e.name&&(r=e):k.set(n._id,t),i()})})}(function(e){if(e)return w(e);Ce(h,r,_,k,x,E,f,t,u)})})}),_._allDocs=function(e,t){return"keys"in e?(o=this,n=(a=e).keys,s={offset:a.skip},Promise.all(n.map(function(i){var t=A({key:i,deleted:"ok"},a);return["limit","skip","keys"].forEach(function(e){delete t[e]}),new Promise(function(n,r){o._allDocs(t,function(e,t){if(e)return r(e);a.update_seq&&void 0!==t.update_seq&&(s.update_seq=t.update_seq),s.total_rows=t.total_rows,n(t.rows[0]||{key:i,error:"not_found"})})})})).then(function(e){return s.rows=e,s})):l(function(h,a){var e;h=k(h),e=function(e,t){if(e)return a(e);var u,n={},f=h.skip||0;if(h.startkey&&(n.gte=h.startkey),h.endkey&&(n.lte=h.endkey),h.key&&(n.gte=n.lte=h.key),h.descending){n.reverse=!0;var r=n.lte;n.lte=n.gte,n.gte=r}if("number"==typeof h.limit&&(u=h.limit),0===u||"gte"in n&&"lte"in n&&n.gte>n.lte){var i={total_rows:t,offset:h.skip,rows:[]};return h.update_seq&&(i.update_seq=b._updateSeq),a(null,i)}var c=[],l=T.docStore.readStream(n),o=w.obj(function(e,t,i){var o=e.value,a=Ge(o),s=$e(o,a);if(s){if("ok"!==h.deleted)return void i()}else{if(0<f--)return void i();if("number"==typeof u&&u--<=0)return l.unpipe(),l.destroy(),void i()}function n(e){var t={id:o.id,key:o.id,value:{rev:a}};if(h.include_docs){if(t.doc=e,t.doc._rev=t.value.rev,h.conflicts){var n=we(o);n.length&&(t.doc._conflicts=n)}for(var r in t.doc._attachments)t.doc._attachments.hasOwnProperty(r)&&(t.doc._attachments[r].stub=!0)}if(!1===h.inclusive_end&&o.id===h.endkey)return i();if(s){if("ok"!==h.deleted)return i();t.value.deleted=!0,t.doc=null}c.push(t),i()}if(h.include_docs){var r=o.rev_map[a];T.bySeqStore.get(L(r),function(e,t){n(t)})}else n()},function(e){Promise.resolve().then(function(){if(h.include_docs&&h.attachments)return Xe(c,T,h)}).then(function(){var e={total_rows:t,offset:h.skip,rows:c};h.update_seq&&(e.update_seq=b._updateSeq),a(null,e)},a),e()}).on("unpipe",function(){o.end()});l.on("error",a),l.pipe(o)},b.isClosed()?e(new Error("database is closed")):e(null,b._docCount)})(e,t);var o,a,n,s},_._changes=function(u){if((u=k(u)).continuous){var e=m+":"+re();return Ye.addListener(m,e,_,u),Ye.notify(m),{cancel:function(){Ye.removeListener(m,e)}}}var f,c=u.descending,l=[],h=u.since||0,p=0,t={reverse:c};"limit"in u&&0<u.limit&&(f=u.limit),t.reverse||(t.start=L(u.since||0));var d=u.doc_ids&&new E(u.doc_ids),y=K(u),g=new C;function v(){u.done=!0,u.return_docs&&u.limit&&u.limit<l.length&&(l.length=u.limit),n.unpipe(r),n.destroy(),u.continuous||u.cancelled||(u.include_docs&&u.attachments&&u.return_docs?Xe(l,T,u).then(function(){u.complete(null,{results:l,last_seq:h})}):u.complete(null,{results:l,last_seq:h}))}var n=T.bySeqStore.readStream(t),r=w.obj(function(e,t,i){if(f&&f<=p)return v(),i();if(u.cancelled||u.done)return i();var n,r,o=(n=e.key,parseInt(n,10)),a=e.value;if(o===u.since&&!c)return i();if(d&&!d.has(a._id))return i();function s(r){var e=Ge(r);function n(e){var t=u.processChange(e,r,u);t.seq=r.seq;var n=y(t);if("object"==typeof n)return u.complete(n);n&&(p++,u.attachments&&u.include_docs?Xe([t],T,u).then(function(){u.onChange(t)}):u.onChange(t),u.return_docs&&l.push(t)),i()}if(r.seq!==o)return i();if(h=o,e===a._rev)return n(a);var t=r.rev_map[e];T.bySeqStore.get(L(t),function(e,t){n(t)})}if(r=g.get(a._id))return s(r);T.docStore.get(a._id,function(e,t){if(u.cancelled||u.done||b.isClosed()||Le(t.id))return i();g.set(a._id,t),s(t)})},function(e){if(u.cancelled)return e();u.return_docs&&u.limit&&u.limit<l.length&&(l.length=u.limit),e()}).on("unpipe",function(){r.end(),v()});return n.pipe(r),{cancel:function(){u.cancelled=!0,v()}}},_._close=function(t){if(b.isClosed())return t(z(N));b.close(function(e){e?t(e):(i.delete(m),t())})},_._getRevisionTree=function(e,n){T.docStore.get(e,function(e,t){e?n(z(M)):n(null,t.rev_tree)})},_._doCompaction=c(function(e,t,n,r){_._doCompactionNoLock(e,t,n,r)}),_._doCompactionNoLock=function(f,c,l,h){if("function"==typeof l&&(h=l,l={}),!c.length)return h();var p=l.ctx||new Ie;p.get(T.docStore,f,function(e,n){if(e)return h(e);var t=c.map(function(e){var t=n.rev_map[e];return delete n.rev_map[e],t});_e(n.rev_tree,function(e,t,n,r,i){var o=t+"-"+n;-1!==c.indexOf(o)&&(i.status="missing")});var s=[];s.push({key:n.id,value:n,type:"put",prefix:T.docStore});var r,i={},o=0;function a(e){if(e&&(r=e),++o===c.length){if(r)return h(r);!function(){var t=Object.keys(i);if(!t.length)return u();var n,r=0;function o(e){e&&(n=e),++r===t.length&&u(n)}var a=new C;c.forEach(function(e){a.set(f+"@"+e,!0)}),t.forEach(function(i){p.get(T.attachmentStore,i,function(e,t){if(e)return"NotFoundError"===e.name?o():o(e);var n=Object.keys(t.refs||{}).filter(function(e){return!a.has(e)}),r={};n.forEach(function(e){r[e]=!0}),n.length?s.push({key:i,type:"put",value:{refs:r},prefix:T.attachmentStore}):s=s.concat([{key:i,type:"del",prefix:T.attachmentStore},{key:i,type:"del",prefix:T.binaryStore}]),o()})})}()}}function u(e){return e?h(e):(p.batch(s),l.ctx?h():void p.execute(b,h))}t.forEach(function(e){s.push({key:L(e),type:"del",prefix:T.bySeqStore}),p.get(T.bySeqStore,L(e),function(e,n){if(e)return"NotFoundError"===e.name?a():a(e);Object.keys(n._attachments||{}).forEach(function(e){var t=n._attachments[e].digest;i[t]=!0}),a()})})})},_._getLocal=function(e,n){T.localStore.get(e,function(e,t){e?n(z(M)):n(null,t)})},_._putLocal=function(e,t,n){"function"==typeof t&&(n=t,t={}),t.ctx?_._putLocalNoLock(e,t,n):_._putLocalWithLock(e,t,n)},_._putLocalWithLock=c(function(e,t,n){_._putLocalNoLock(e,t,n)}),_._putLocalNoLock=function(i,o,a){delete i._revisions;var s=i._rev,u=i._id,f=o.ctx||new Ie;f.get(T.localStore,u,function(e,t){if(e&&s)return a(z(R));if(t&&t._rev!==s)return a(z(R));i._rev=s?"0-"+(parseInt(s.split("-")[1],10)+1):"0-1";var n=[{type:"put",prefix:T.localStore,key:u,value:i}];f.batch(n);var r={ok:!0,id:i._id,rev:i._rev};if(o.ctx)return a(null,r);f.execute(b,function(e){if(e)return a(e);a(null,r)})})},_._removeLocal=function(e,t,n){"function"==typeof t&&(n=t,t={}),t.ctx?_._removeLocalNoLock(e,t,n):_._removeLocalWithLock(e,t,n)},_._removeLocalWithLock=c(function(e,t,n){_._removeLocalNoLock(e,t,n)}),_._removeLocalNoLock=function(r,i,o){var a=i.ctx||new Ie;a.get(T.localStore,r._id,function(e,t){if(e)return"NotFoundError"!==e.name?o(e):o(z(M));if(t._rev!==r._rev)return o(z(R));a.batch([{prefix:T.localStore,type:"del",key:r._id}]);var n={ok:!0,id:r._id,rev:"0-0"};if(i.ctx)return o(null,n);a.execute(b,function(e){if(e)return o(e);o(null,n)})})},_._destroy=function(e,t){var n,r=V(o);if(!Fe.has(r))return p(m,t);(n=Fe.get(r)).has(m)?(Ye.removeAllListeners(m),n.get(m).close(function(){n.delete(m),p(m,t)})):p(m,t)}}function Qe(e,t){var n=A({db:c},e);Ze.call(this,n,t)}Qe.valid=function(){return"undefined"!=typeof localStorage},Qe.use_prefix=!0,"undefined"==typeof PouchDB?function(e){if("undefined"!=typeof console&&"function"==typeof console[e]){var t=Array.prototype.slice.call(arguments,1);console[e].apply(console,t)}}("error",'localstorage adapter plugin error: Cannot find global "PouchDB" object! Did you remember to include pouchdb.js?'):PouchDB.plugin(function(e){e.adapter("localstorage",Qe,!0)})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{104:104,109:109,11:11,15:15,18:18,23:23,24:24,27:27,4:4,41:41,51:51,58:58,69:69,71:71,98:98}]},{},[111]);
\No newline at end of file