UNPKG

ipfs-api

Version:

A client library for the IPFS HTTP API

1 lines 1.11 MB
var IpfsApi=function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:n})},r.n=function(t){var e=t&&t.__esModule?function e(){return t.default}:function e(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=241)}([function(t,e,r){"use strict";(function(t){var n=r(243),i=r(119),o=r(120);function s(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}function a(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,e){if(a()<e)throw new RangeError("Invalid typed array length");return c.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=c.prototype:(null===t&&(t=new c(e)),t.length=e),t}function c(t,e,r){if(!(c.TYPED_ARRAY_SUPPORT||this instanceof c))return new c(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return p(this,t)}return f(this,t,e,r)}function f(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?g(t,e,r,n):"string"==typeof e?d(t,e,r):m(t,e)}function l(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function h(t,e,r,n){return l(e),e<=0?u(t,e):void 0!==r?"string"==typeof n?u(t,e).fill(r,n):u(t,e).fill(r):u(t,e)}function p(t,e){if(l(e),t=u(t,e<0?0:0|v(e)),!c.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function d(t,e,r){if("string"==typeof r&&""!==r||(r="utf8"),!c.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|_(e,r),i=(t=u(t,n)).write(e,r);return i!==n&&(t=t.slice(0,i)),t}function y(t,e){var r=e.length<0?0:0|v(e.length);t=u(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function g(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n),c.TYPED_ARRAY_SUPPORT?(t=e).__proto__=c.prototype:t=y(t,e),t}function m(t,e){if(c.isBuffer(e)){var r=0|v(e.length);return 0===(t=u(t,r)).length?t:(e.copy(t,0,0,r),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||et(e.length)?u(t,0):y(t,e);if("Buffer"===e.type&&o(e.data))return y(t,e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function v(t){if(t>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function b(t){return+t!=t&&(t=0),c.alloc(+t)}function _(t,e){if(c.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return J(t).length;default:if(n)return Q(t).length;e=(""+e).toLowerCase(),n=!0}}function E(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return U(this,e,r);case"utf8":case"utf-8":return M(this,e,r);case"ascii":return O(this,e,r);case"latin1":case"binary":return P(this,e,r);case"base64":return N(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function w(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function S(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:k(t,e,r,n,i);if("number"==typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):k(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function k(t,e,r,n,i){var o=1,s=t.length,a=e.length,u;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,a/=2,r/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var f=-1;for(u=r;u<s;u++)if(c(t,u)===c(e,-1===f?0:u-f)){if(-1===f&&(f=u),u-f+1===a)return f*o}else-1!==f&&(u-=u-f),f=-1}else for(r+a>s&&(r=s-a),u=r;u>=0;u--){for(var l=!0,h=0;h<a;h++)if(c(t,u+h)!==c(e,h)){l=!1;break}if(l)return u}return-1}function A(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[r+s]=a}return s}function C(t,e,r,n){return tt(Q(e,t.length-r),t,r,n)}function T(t,e,r,n){return tt(X(e),t,r,n)}function I(t,e,r,n){return T(t,e,r,n)}function B(t,e,r,n){return tt(J(e),t,r,n)}function x(t,e,r,n){return tt(Z(e,t.length-r),t,r,n)}function N(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function M(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o=t[i],s=null,a=o>239?4:o>223?3:o>191?2:1,u,c,f,l;if(i+a<=r)switch(a){case 1:o<128&&(s=o);break;case 2:128==(192&(u=t[i+1]))&&(l=(31&o)<<6|63&u)>127&&(s=l);break;case 3:u=t[i+1],c=t[i+2],128==(192&u)&&128==(192&c)&&(l=(15&o)<<12|(63&u)<<6|63&c)>2047&&(l<55296||l>57343)&&(s=l);break;case 4:u=t[i+1],c=t[i+2],f=t[i+3],128==(192&u)&&128==(192&c)&&128==(192&f)&&(l=(15&o)<<18|(63&u)<<12|(63&c)<<6|63&f)>65535&&l<1114112&&(s=l)}null===s?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),i+=a}return L(n)}e.Buffer=c,e.SlowBuffer=b,e.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:s(),e.kMaxLength=a(),c.poolSize=8192,c._augment=function(t){return t.__proto__=c.prototype,t},c.from=function(t,e,r){return f(null,t,e,r)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(t,e,r){return h(null,t,e,r)},c.allocUnsafe=function(t){return p(null,t)},c.allocUnsafeSlow=function(t){return p(null,t)},c.isBuffer=function t(e){return!(null==e||!e._isBuffer)},c.compare=function t(e,r){if(!c.isBuffer(e)||!c.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(e===r)return 0;for(var n=e.length,i=r.length,o=0,s=Math.min(n,i);o<s;++o)if(e[o]!==r[o]){n=e[o],i=r[o];break}return n<i?-1:i<n?1:0},c.isEncoding=function t(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function t(e,r){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);var n;if(void 0===r)for(r=0,n=0;n<e.length;++n)r+=e[n].length;var i=c.allocUnsafe(r),s=0;for(n=0;n<e.length;++n){var a=e[n];if(!c.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,s),s+=a.length}return i},c.byteLength=_,c.prototype._isBuffer=!0,c.prototype.swap16=function t(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<e;r+=2)w(this,r,r+1);return this},c.prototype.swap32=function t(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<e;r+=4)w(this,r,r+3),w(this,r+1,r+2);return this},c.prototype.swap64=function t(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<e;r+=8)w(this,r,r+7),w(this,r+1,r+6),w(this,r+2,r+5),w(this,r+3,r+4);return this},c.prototype.toString=function t(){var e=0|this.length;return 0===e?"":0===arguments.length?M(this,0,e):E.apply(this,arguments)},c.prototype.equals=function t(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function t(){var r="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(r=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(r+=" ... ")),"<Buffer "+r+">"},c.prototype.compare=function t(e,r,n,i,o){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),r<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var s=o-i,a=n-r,u=Math.min(s,a),f=this.slice(i,o),l=e.slice(r,n),h=0;h<u;++h)if(f[h]!==l[h]){s=f[h],a=l[h];break}return s<a?-1:a<s?1:0},c.prototype.includes=function t(e,r,n){return-1!==this.indexOf(e,r,n)},c.prototype.indexOf=function t(e,r,n){return S(this,e,r,n,!0)},c.prototype.lastIndexOf=function t(e,r,n){return S(this,e,r,n,!1)},c.prototype.write=function t(e,r,n,i){if(void 0===r)i="utf8",n=this.length,r=0;else if(void 0===n&&"string"==typeof r)i=r,n=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(n)?(n|=0,void 0===i&&(i="utf8")):(i=n,n=void 0)}var o=this.length-r;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var s=!1;;)switch(i){case"hex":return A(this,e,r,n);case"utf8":case"utf-8":return C(this,e,r,n);case"ascii":return T(this,e,r,n);case"latin1":case"binary":return I(this,e,r,n);case"base64":return B(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,r,n);default:if(s)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),s=!0}},c.prototype.toJSON=function t(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var R=4096;function L(t){var e=t.length;if(e<=R)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=R));return r}function O(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function P(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function U(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=$(t[o]);return i}function D(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function j(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function K(t,e,r,n,i,o){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function F(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i<o;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function V(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i<o;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function q(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function z(t,e,r,n,o){return o||q(t,e,r,4,3.4028234663852886e38,-3.4028234663852886e38),i.write(t,e,r,n,23,4),r+4}function H(t,e,r,n,o){return o||q(t,e,r,8,1.7976931348623157e308,-1.7976931348623157e308),i.write(t,e,r,n,52,8),r+8}c.prototype.slice=function t(e,r){var n=this.length,i;if(e=~~e,r=void 0===r?n:~~r,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),r<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<e&&(r=e),c.TYPED_ARRAY_SUPPORT)(i=this.subarray(e,r)).__proto__=c.prototype;else{var o=r-e;i=new c(o,void 0);for(var s=0;s<o;++s)i[s]=this[s+e]}return i},c.prototype.readUIntLE=function t(e,r,n){e|=0,r|=0,n||j(e,r,this.length);for(var i=this[e],o=1,s=0;++s<r&&(o*=256);)i+=this[e+s]*o;return i},c.prototype.readUIntBE=function t(e,r,n){e|=0,r|=0,n||j(e,r,this.length);for(var i=this[e+--r],o=1;r>0&&(o*=256);)i+=this[e+--r]*o;return i},c.prototype.readUInt8=function t(e,r){return r||j(e,1,this.length),this[e]},c.prototype.readUInt16LE=function t(e,r){return r||j(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function t(e,r){return r||j(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function t(e,r){return r||j(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function t(e,r){return r||j(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function t(e,r,n){e|=0,r|=0,n||j(e,r,this.length);for(var i=this[e],o=1,s=0;++s<r&&(o*=256);)i+=this[e+s]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*r)),i},c.prototype.readIntBE=function t(e,r,n){e|=0,r|=0,n||j(e,r,this.length);for(var i=r,o=1,s=this[e+--i];i>0&&(o*=256);)s+=this[e+--i]*o;return s>=(o*=128)&&(s-=Math.pow(2,8*r)),s},c.prototype.readInt8=function t(e,r){return r||j(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function t(e,r){r||j(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt16BE=function t(e,r){r||j(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},c.prototype.readInt32LE=function t(e,r){return r||j(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function t(e,r){return r||j(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function t(e,r){return r||j(e,4,this.length),i.read(this,e,!0,23,4)},c.prototype.readFloatBE=function t(e,r){return r||j(e,4,this.length),i.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function t(e,r){return r||j(e,8,this.length),i.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function t(e,r){return r||j(e,8,this.length),i.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function t(e,r,n,i){var o;(e=+e,r|=0,n|=0,i)||K(this,e,r,n,Math.pow(2,8*n)-1,0);var s=1,a=0;for(this[r]=255&e;++a<n&&(s*=256);)this[r+a]=e/s&255;return r+n},c.prototype.writeUIntBE=function t(e,r,n,i){var o;(e=+e,r|=0,n|=0,i)||K(this,e,r,n,Math.pow(2,8*n)-1,0);var s=n-1,a=1;for(this[r+s]=255&e;--s>=0&&(a*=256);)this[r+s]=e/a&255;return r+n},c.prototype.writeUInt8=function t(e,r,n){return e=+e,r|=0,n||K(this,e,r,1,255,0),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[r]=255&e,r+1},c.prototype.writeUInt16LE=function t(e,r,n){return e=+e,r|=0,n||K(this,e,r,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8):F(this,e,r,!0),r+2},c.prototype.writeUInt16BE=function t(e,r,n){return e=+e,r|=0,n||K(this,e,r,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=255&e):F(this,e,r,!1),r+2},c.prototype.writeUInt32LE=function t(e,r,n){return e=+e,r|=0,n||K(this,e,r,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=255&e):V(this,e,r,!0),r+4},c.prototype.writeUInt32BE=function t(e,r,n){return e=+e,r|=0,n||K(this,e,r,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=255&e):V(this,e,r,!1),r+4},c.prototype.writeIntLE=function t(e,r,n,i){if(e=+e,r|=0,!i){var o=Math.pow(2,8*n-1);K(this,e,r,n,o-1,-o)}var s=0,a=1,u=0;for(this[r]=255&e;++s<n&&(a*=256);)e<0&&0===u&&0!==this[r+s-1]&&(u=1),this[r+s]=(e/a>>0)-u&255;return r+n},c.prototype.writeIntBE=function t(e,r,n,i){if(e=+e,r|=0,!i){var o=Math.pow(2,8*n-1);K(this,e,r,n,o-1,-o)}var s=n-1,a=1,u=0;for(this[r+s]=255&e;--s>=0&&(a*=256);)e<0&&0===u&&0!==this[r+s+1]&&(u=1),this[r+s]=(e/a>>0)-u&255;return r+n},c.prototype.writeInt8=function t(e,r,n){return e=+e,r|=0,n||K(this,e,r,1,127,-128),c.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[r]=255&e,r+1},c.prototype.writeInt16LE=function t(e,r,n){return e=+e,r|=0,n||K(this,e,r,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8):F(this,e,r,!0),r+2},c.prototype.writeInt16BE=function t(e,r,n){return e=+e,r|=0,n||K(this,e,r,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[r]=e>>>8,this[r+1]=255&e):F(this,e,r,!1),r+2},c.prototype.writeInt32LE=function t(e,r,n){return e=+e,r|=0,n||K(this,e,r,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[r]=255&e,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24):V(this,e,r,!0),r+4},c.prototype.writeInt32BE=function t(e,r,n){return e=+e,r|=0,n||K(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),c.TYPED_ARRAY_SUPPORT?(this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=255&e):V(this,e,r,!1),r+4},c.prototype.writeFloatLE=function t(e,r,n){return z(this,e,r,!0,n)},c.prototype.writeFloatBE=function t(e,r,n){return z(this,e,r,!1,n)},c.prototype.writeDoubleLE=function t(e,r,n){return H(this,e,r,!0,n)},c.prototype.writeDoubleBE=function t(e,r,n){return H(this,e,r,!1,n)},c.prototype.copy=function t(e,r,n,i){if(n||(n=0),i||0===i||(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i<n&&(i=n),i===n)return 0;if(0===e.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r<i-n&&(i=e.length-r+n);var o=i-n,s;if(this===e&&n<r&&r<i)for(s=o-1;s>=0;--s)e[s+r]=this[s+n];else if(o<1e3||!c.TYPED_ARRAY_SUPPORT)for(s=0;s<o;++s)e[s+r]=this[s+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),r);return o},c.prototype.fill=function t(e,r,n,i){if("string"==typeof e){if("string"==typeof r?(i=r,r=0,n=this.length):"string"==typeof n&&(i=n,n=this.length),1===e.length){var o=e.charCodeAt(0);o<256&&(e=o)}if(void 0!==i&&"string"!=typeof i)throw new TypeError("encoding must be a string");if("string"==typeof i&&!c.isEncoding(i))throw new TypeError("Unknown encoding: "+i)}else"number"==typeof e&&(e&=255);if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;var s;if(r>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(s=r;s<n;++s)this[s]=e;else{var a=c.isBuffer(e)?e:Q(new c(e,i).toString()),u=a.length;for(s=0;s<n-r;++s)this[s+r]=a[s%u]}return this};var G=/[^+\/0-9A-Za-z-_]/g;function Y(t){if((t=W(t).replace(G,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}function W(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function $(t){return t<16?"0"+t.toString(16):t.toString(16)}function Q(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function X(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function Z(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)n=(r=t.charCodeAt(s))>>8,i=r%256,o.push(i),o.push(n);return o}function J(t){return n.toByteArray(Y(t))}function tt(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function et(t){return t!=t}}).call(e,r(7))},function(t,e,r){var n=function(t,e){return function(){var r=Array.prototype.slice.call(arguments),n=r.length-1,i=r&&r.length>0?r[n]:null,o;return("function"==typeof i?i:null)?t.apply(e,r):new Promise(function(n,i){r.push(function(t,e){if(t)return i(t);n(e)}),t.apply(e,r)})}};t.exports=function(t,e){e=e||{};var r=Object.prototype.toString.call(t);if("[object Object]"===r||"[object Array]"===r){var i=e.replace?t:{};for(var o in t)t.hasOwnProperty(o)&&(i[o]=n(t[o]));return i}return n(t,e.context||t)}},function(t,e){t.exports={options:{usePureJavaScript:!1}}},function(t,e,r){var n=r(0),i=n.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=s),o(i,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=i(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},function(t,e){"function"==typeof Object.create?t.exports=function t(e,r){e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function t(e,r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}},function(t,e,r){(function(e,n,i){var o=r(2),s=r(501),a=t.exports=o.util=o.util||{};function u(t){if(8!==t&&16!==t&&24!==t&&32!==t)throw new Error("Only 8, 16, 24, or 32 bits supported: "+t)}function c(t){if(this.data="",this.read=0,"string"==typeof t)this.data=t;else if(a.isArrayBuffer(t)||a.isArrayBufferView(t))if(void 0!==i&&t instanceof i)this.data=t.toString("binary");else{var e=new Uint8Array(t);try{this.data=String.fromCharCode.apply(null,e)}catch(t){for(var r=0;r<e.length;++r)this.putByte(e[r])}}else(t instanceof c||"object"==typeof t&&"string"==typeof t.data&&"number"==typeof t.read)&&(this.data=t.data,this.read=t.read);this._constructedStringLength=0}!function(){if(void 0!==e&&e.nextTick)return a.nextTick=e.nextTick,void(a.setImmediate="function"==typeof n?n:a.nextTick);if("function"==typeof n)return a.setImmediate=function(){return n.apply(void 0,arguments)},void(a.nextTick=function(t){return n(t)});if(a.setImmediate=function(t){setTimeout(t,0)},"undefined"!=typeof window&&"function"==typeof window.postMessage){var t="forge.setImmediate",r=[];function i(e){if(e.source===window&&e.data===t){e.stopPropagation();var n=r.slice();r.length=0,n.forEach(function(t){t()})}}a.setImmediate=function(e){r.push(e),1===r.length&&window.postMessage(t,"*")},window.addEventListener("message",i,!0)}if("undefined"!=typeof MutationObserver){var o=Date.now(),s=!0,u=document.createElement("div"),r=[];new MutationObserver(function(){var t=r.slice();r.length=0,t.forEach(function(t){t()})}).observe(u,{attributes:!0});var c=a.setImmediate;a.setImmediate=function(t){Date.now()-o>15?(o=Date.now(),c(t)):(r.push(t),1===r.length&&u.setAttribute("a",s=!s))}}a.nextTick=a.setImmediate}(),a.isNodejs=void 0!==e&&e.versions&&e.versions.node,a.isArray=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},a.isArrayBuffer=function(t){return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer},a.isArrayBufferView=function(t){return t&&a.isArrayBuffer(t.buffer)&&void 0!==t.byteLength},a.ByteBuffer=c,a.ByteStringBuffer=c;var f=4096;function l(t,e){e=e||{},this.read=e.readOffset||0,this.growSize=e.growSize||1024;var r=a.isArrayBuffer(t),n=a.isArrayBufferView(t);if(r||n)return this.data=r?new DataView(t):new DataView(t.buffer,t.byteOffset,t.byteLength),void(this.write="writeOffset"in e?e.writeOffset:this.data.byteLength);this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!==t&&void 0!==t&&this.putBytes(t),"writeOffset"in e&&(this.write=e.writeOffset)}a.ByteStringBuffer.prototype._optimizeConstructedString=function(t){this._constructedStringLength+=t,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},a.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},a.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},a.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))},a.ByteStringBuffer.prototype.fillWithByte=function(t,e){t=String.fromCharCode(t);for(var r=this.data;e>0;)1&e&&(r+=t),(e>>>=1)>0&&(t+=t);return this.data=r,this._optimizeConstructedString(e),this},a.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this},a.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(a.encodeUtf8(t))},a.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},a.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},a.ByteStringBuffer.prototype.putInt32=function(t){return this.putBytes(String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},a.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255))},a.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))},a.ByteStringBuffer.prototype.putInt32Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>24&255))},a.ByteStringBuffer.prototype.putInt=function(t,e){u(e);var r="";do{e-=8,r+=String.fromCharCode(t>>e&255)}while(e>0);return this.putBytes(r)},a.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<<e-1),this.putInt(t,e)},a.ByteStringBuffer.prototype.putBuffer=function(t){return this.putBytes(t.getBytes())},a.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},a.ByteStringBuffer.prototype.getInt16=function(){var t=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,t},a.ByteStringBuffer.prototype.getInt24=function(){var t=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,t},a.ByteStringBuffer.prototype.getInt32=function(){var t=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,t},a.ByteStringBuffer.prototype.getInt16Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,t},a.ByteStringBuffer.prototype.getInt24Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,t},a.ByteStringBuffer.prototype.getInt32Le=function(){var t=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,t},a.ByteStringBuffer.prototype.getInt=function(t){u(t);var e=0;do{e=(e<<8)+this.data.charCodeAt(this.read++),t-=8}while(t>0);return e},a.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<<t-2;return e>=r&&(e-=r<<1),e},a.ByteStringBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):0===t?e="":(e=0===this.read?this.data:this.data.slice(this.read),this.clear()),e},a.ByteStringBuffer.prototype.bytes=function(t){return void 0===t?this.data.slice(this.read):this.data.slice(this.read,this.read+t)},a.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)},a.ByteStringBuffer.prototype.setAt=function(t,e){return this.data=this.data.substr(0,this.read+t)+String.fromCharCode(e)+this.data.substr(this.read+t+1),this},a.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},a.ByteStringBuffer.prototype.copy=function(){var t=a.createBuffer(this.data);return t.read=this.read,t},a.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},a.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},a.ByteStringBuffer.prototype.truncate=function(t){var e=Math.max(0,this.length()-t);return this.data=this.data.substr(this.read,e),this.read=0,this},a.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e<this.data.length;++e){var r=this.data.charCodeAt(e);r<16&&(t+="0"),t+=r.toString(16)}return t},a.ByteStringBuffer.prototype.toString=function(){return a.decodeUtf8(this.bytes())},a.DataBuffer=l,a.DataBuffer.prototype.length=function(){return this.write-this.read},a.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},a.DataBuffer.prototype.accommodate=function(t,e){if(this.length()>=t)return this;e=Math.max(e||this.growSize,t);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+e);return n.set(r),this.data=new DataView(n.buffer),this},a.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this},a.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r<e;++r)this.data.setUint8(t);return this},a.DataBuffer.prototype.putBytes=function(t,e){if(a.isArrayBufferView(t)){var r,n=(r=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)).byteLength-r.byteOffset,i;return this.accommodate(n),(i=new Uint8Array(this.data.buffer,this.write)).set(r),this.write+=n,this}if(a.isArrayBuffer(t)){var r=new Uint8Array(t),i;return this.accommodate(r.byteLength),(i=new Uint8Array(this.data.buffer)).set(r,this.write),this.write+=r.byteLength,this}if(t instanceof a.DataBuffer||"object"==typeof t&&"number"==typeof t.read&&"number"==typeof t.write&&a.isArrayBufferView(t.data)){var r=new Uint8Array(t.data.byteLength,t.read,t.length()),i;return this.accommodate(r.byteLength),(i=new Uint8Array(t.data.byteLength,this.write)).set(r),this.write+=r.byteLength,this}if(t instanceof a.ByteStringBuffer&&(t=t.data,e="binary"),e=e||"binary","string"==typeof t){var o;if("hex"===e)return this.accommodate(Math.ceil(t.length/2)),o=new Uint8Array(this.data.buffer,this.write),this.write+=a.binary.hex.decode(t,o,this.write),this;if("base64"===e)return this.accommodate(3*Math.ceil(t.length/4)),o=new Uint8Array(this.data.buffer,this.write),this.write+=a.binary.base64.decode(t,o,this.write),this;if("utf8"===e&&(t=a.encodeUtf8(t),e="binary"),"binary"===e||"raw"===e)return this.accommodate(t.length),o=new Uint8Array(this.data.buffer,this.write),this.write+=a.binary.raw.decode(o),this;if("utf16"===e)return this.accommodate(2*t.length),o=new Uint16Array(this.data.buffer,this.write),this.write+=a.text.utf16.encode(o),this;throw new Error("Invalid encoding: "+e)}throw Error("Invalid parameter: "+t)},a.DataBuffer.prototype.putBuffer=function(t){return this.putBytes(t),t.clear(),this},a.DataBuffer.prototype.putString=function(t){return this.putBytes(t,"utf16")},a.DataBuffer.prototype.putInt16=function(t){return this.accommodate(2),this.data.setInt16(this.write,t),this.write+=2,this},a.DataBuffer.prototype.putInt24=function(t){return this.accommodate(3),this.data.setInt16(this.write,t>>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this},a.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this},a.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this},a.DataBuffer.prototype.putInt24Le=function(t){return this.accommodate(3),this.data.setInt8(this.write,t>>16&255),this.data.setInt16(this.write,t>>8&65535,!0),this.write+=3,this},a.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this},a.DataBuffer.prototype.putInt=function(t,e){u(e),this.accommodate(e/8);do{e-=8,this.data.setInt8(this.write++,t>>e&255)}while(e>0);return this},a.DataBuffer.prototype.putSignedInt=function(t,e){return u(e),this.accommodate(e/8),t<0&&(t+=2<<e-1),this.putInt(t,e)},a.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},a.DataBuffer.prototype.getInt16=function(){var t=this.data.getInt16(this.read);return this.read+=2,t},a.DataBuffer.prototype.getInt24=function(){var t=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,t},a.DataBuffer.prototype.getInt32=function(){var t=this.data.getInt32(this.read);return this.read+=4,t},a.DataBuffer.prototype.getInt16Le=function(){var t=this.data.getInt16(this.read,!0);return this.read+=2,t},a.DataBuffer.prototype.getInt24Le=function(){var t=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,t},a.DataBuffer.prototype.getInt32Le=function(){var t=this.data.getInt32(this.read,!0);return this.read+=4,t},a.DataBuffer.prototype.getInt=function(t){u(t);var e=0;do{e=(e<<8)+this.data.getInt8(this.read++),t-=8}while(t>0);return e},a.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<<t-2;return e>=r&&(e-=r<<1),e},a.DataBuffer.prototype.getBytes=function(t){var e;return t?(t=Math.min(this.length(),t),e=this.data.slice(this.read,this.read+t),this.read+=t):0===t?e="":(e=0===this.read?this.data:this.data.slice(this.read),this.clear()),e},a.DataBuffer.prototype.bytes=function(t){return void 0===t?this.data.slice(this.read):this.data.slice(this.read,this.read+t)},a.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)},a.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this},a.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},a.DataBuffer.prototype.copy=function(){return new a.DataBuffer(this)},a.DataBuffer.prototype.compact=function(){if(this.read>0){var t=new Uint8Array(this.data.buffer,this.read),e=new Uint8Array(t.byteLength);e.set(t),this.data=new DataView(e),this.write-=this.read,this.read=0}return this},a.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},a.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this},a.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e<this.data.byteLength;++e){var r=this.data.getUint8(e);r<16&&(t+="0"),t+=r.toString(16)}return t},a.DataBuffer.prototype.toString=function(t){var e=new Uint8Array(this.data,this.read,this.length());if("binary"===(t=t||"utf8")||"raw"===t)return a.binary.raw.encode(e);if("hex"===t)return a.binary.hex.encode(e);if("base64"===t)return a.binary.base64.encode(e);if("utf8"===t)return a.text.utf8.decode(e);if("utf16"===t)return a.text.utf16.decode(e);throw new Error("Invalid encoding: "+t)},a.createBuffer=function(t,e){return e=e||"raw",void 0!==t&&"utf8"===e&&(t=a.encodeUtf8(t)),new a.ByteBuffer(t)},a.fillString=function(t,e){for(var r="";e>0;)1&e&&(r+=t),(e>>>=1)>0&&(t+=t);return r},a.xorBytes=function(t,e,r){for(var n="",i="",o="",s=0,a=0;r>0;--r,++s)i=t.charCodeAt(s)^e.charCodeAt(s),a>=10&&(n+=o,o="",a=0),o+=String.fromCharCode(i),++a;return n+=o},a.hexToBytes=function(t){var e="",r=0;for(!0&t.length&&(r=1,e+=String.fromCharCode(parseInt(t[0],16)));r<t.length;r+=2)e+=String.fromCharCode(parseInt(t.substr(r,2),16));return e},a.bytesToHex=function(t){return a.createBuffer(t).toHex()},a.int32ToBytes=function(t){return String.fromCharCode(t>>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t)};var h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",p=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],d="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";a.encode64=function(t,e){for(var r="",n="",i,o,s,a=0;a<t.length;)i=t.charCodeAt(a++),o=t.charCodeAt(a++),s=t.charCodeAt(a++),r+=h.charAt(i>>2),r+=h.charAt((3&i)<<4|o>>4),isNaN(o)?r+="==":(r+=h.charAt((15&o)<<2|s>>6),r+=isNaN(s)?"=":h.charAt(63&s)),e&&r.length>e&&(n+=r.substr(0,e)+"\r\n",r=r.substr(e));return n+=r},a.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e="",r,n,i,o,s=0;s<t.length;)r=p[t.charCodeAt(s++)-43],n=p[t.charCodeAt(s++)-43],i=p[t.charCodeAt(s++)-43],o=p[t.charCodeAt(s++)-43],e+=String.fromCharCode(r<<2|n>>4),64!==i&&(e+=String.fromCharCode((15&n)<<4|i>>2),64!==o&&(e+=String.fromCharCode((3&i)<<6|o)));return e},a.encodeUtf8=function(t){return unescape(encodeURIComponent(t))},a.decodeUtf8=function(t){return decodeURIComponent(escape(t))},a.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:s.encode,decode:s.decode}},a.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)},a.binary.raw.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(t.length));for(var i=r=r||0,o=0;o<t.length;++o)n[i++]=t.charCodeAt(o);return e?i-r:n},a.binary.hex.encode=a.bytesToHex,a.binary.hex.decode=function(t,e,r){var n=e;n||(n=new Uint8Array(Math.ceil(t.length/2)));var i=0,o=r=r||0;for(1&t.length&&(i=1,n[o++]=parseInt(t[0],16));i<t.length;i+=2)n[o++]=parseInt(t.substr(i,2),16);return e?o-r:n},a.binary.base64.encode=function(t,e){for(var r="",n="",i,o,s,a=0;a<t.byteLength;)i=t[a++],o=t[a++],s=t[a++],r+=h.charAt(i>>2),r+=h.charAt((3&i)<<4|o>>4),isNaN(o)?r+="==":(r+=h.charAt((15&o)<<2|s>>6),r+=isNaN(s)?"=":h.charAt(63&s)),e&&r.length>e&&(n+=r.substr(0,e)+"\r\n",r=r.substr(e));return n+=r},a.binary.base64.decode=function(t,e,r){var n=e,i,o,s,a;n||(n=new Uint8Array(3*Math.ceil(t.length/4))),t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var u=0,c=r=r||0;u<t.length;)i=p[t.charCodeAt(u++)-43],o=p[t.charCodeAt(u++)-43],s=p[t.charCodeAt(u++)-43],a=p[t.charCodeAt(u++)-43],n[c++]=i<<2|o>>4,64!==s&&(n[c++]=(15&o)<<4|s>>2,64!==a&&(n[c++]=(3&s)<<6|a));return e?c-r:n.subarray(0,c)},a.binary.base58.encode=function(t,e){return a.binary.baseN.encode(t,d,e)},a.binary.base58.decode=function(t,e){return a.binary.baseN.decode(t,d,e)},a.text={utf8:{},utf16:{}},a.text.utf8.encode=function(t,e,r){t=a.encodeUtf8(t);var n=e;n||(n=new Uint8Array(t.length));for(var i=r=r||0,o=0;o<t.length;++o)n[i++]=t.charCodeAt(o);return e?i-r:n},a.text.utf8.decode=function(t){return a.decodeUtf8(String.fromCharCode.apply(null,t))},a.text.utf16.encode=function(t,e,r){var n=e;n||(n=new Uint8Array(2*t.length));for(var i=new Uint16Array(n.buffer),o=r=r||0,s=r,a=0;a<t.length;++a)i[s++]=t.charCodeAt(a),o+=2;return e?o-r:n},a.text.utf16.decode=function(t){return String.fromCharCode.apply(null,new Uint16Array(t.buffer))},a.deflate=function(t,e,r){if(e=a.decode64(t.deflate(a.encode64(e)).rval),r){var n=2,i;32&e.charCodeAt(1)&&(n=6),e=e.substring(n,e.length-4)}return e},a.inflate=function(t,e,r){var n=t.inflate(a.encode64(e)).rval;return null===n?null:a.decode64(n)};var y=function(t,e,r){if(!t)throw new Error("WebStorage not available.");var n;if(null===r?n=t.removeItem(e):(r=a.encode64(JSON.stringify(r)),n=t.setItem(e,r)),void 0!==n&&!0!==n.rval){var i=new Error(n.error.message);throw i.id=n.error.id,i.name=n.error.name,i}},g=function(t,e){if(!t)throw new Error("WebStorage not available.");var r=t.getItem(e);if(t.init)if(null===r.rval){if(r.error){var n=new Error(r.error.message);throw n.id=r.error.id,n.name=r.error.name,n}r=null}else r=r.rval;return null!==r&&(r=JSON.parse(a.decode64(r))),r},m=function(t,e,r,n){var i=g(t,e);null===i&&(i={}),i[r]=n,y(t,e,i)},v=function(t,e,r){var n=g(t,e);return null!==n&&(n=r in n?n[r]:null),n},b=function(t,e,r){var n=g(t,e);if(null!==n&&r in n){delete n[r];var i=!0;for(var o in n){i=!1;break}i&&(n=null),y(t,e,n)}},_=function(t,e){y(t,e,null)},E=function(t,e,r){var n=null,i;void 0===r&&(r=["web","flash"]);var o=!1,s=null;for(var a in r){i=r[a];try{if("flash"===i||"both"===i){if(null===e[0])throw new Error("Flash local storage not available.");n=t.apply(this,e),o="flash"===i}"web"!==i&&"both"!==i||(e[0]=localStorage,n=t.apply(this,e),o=!0)}catch(t){s=t}if(o)break}if(!o)throw s;return n};a.setItem=function(t,e,r,n,i){E(m,arguments,i)},a.getItem=function(t,e,r,n){return E(v,arguments,n)},a.removeItem=function(t,e,r,n){E(b,arguments,n)},a.clearItems=function(t,e,r){E(_,arguments,r)},a.parseUrl=function(t){var e=/^(https?):\/\/([^:&^\/]*):?(\d*)(.*)$/g;e.lastIndex=0;var r=e.exec(t),n=null===r?null:{full:t,scheme:r[1],host:r[2],port:r[3],path:r[4]};return n&&(n.fullHost=n.host,n.port?80!==n.port&&"http"===n.scheme?n.fullHost+=":"+n.port:443!==n.port&&"https"===n.scheme&&(n.fullHost+=":"+n.port):"http"===n.scheme?n.port=80:"https"===n.scheme&&(n.port=443),n.full=n.scheme+"://"+n.fullHost),n};var w=null;a.getQueryVariables=function(t){var e=function(t){for(var e={},r=t.split("&"),n=0;n<r.length;n++){var i=r[n].indexOf("="),o,s;i>0?(o=r[n].substring(0,i),s=r[n].substring(i+1)):(o=r[n],s=null),o in e||(e[o]=[]),o in Object.prototype||null===s||e[o].push(unescape(s))}return e},r;return void 0===t?(null===w&&(w="undefined"!=typeof window&&window.location&&window.location.search?e(window.location.search.substring(1)):{}),r=w):r=e(t),r},a.parseFragment=function(t){var e=t,r="",n=t.indexOf("?");n>0&&(e=t.substring(0,n),r=t.substring(n+1));var i=e.split("/"),o;return i.length>0&&""===i[0]&&i.shift(),{pathString:e,queryString:r,path:i,query:""===r?{}:a.getQueryVariables(r)}},a.makeRequest=function(t){var e=a.parseFragment(t),r={path:e.pathString,query:e.queryString,getPath:function(t){return void 0===t?e.path:e.path[t]},getQuery:function(t,r){var n;return void 0===t?n=e.query:(n=e.query[t])&&void 0!==r&&(n=n[r]),n},getQueryLast:function(t,e){var n,i=r.getQuery(t);return n=i?i[i.length-1]:e}};return r},a.makeLink=function(t,e,r){t=jQuery.isArray(t)?t.join("/"):t;var n=jQuery.param(e||{});return r=r||"",t+(n.length>0?"?"+n:"")+(r.length>0?"#"+r:"")},a.setPath=function(t,e,r){if("object"==typeof t&&null!==t)for(var n=0,i=e.length;n<i;){var o=e[n++];if(n==i)t[o]=r;else{var s=o in t;(!s||s&&"object"!=typeof t[o]||s&&null===t[o])&&(t[o]={}),t=t[o]}}},a.getPath=function(t,e,r){for(var n=0,i=e.length,o=!0;o&&n<i&&"object"==typeof t&&null!==t;){var s=e[n++];(o=s in t)&&(t=t[s])}return o?t:r},a.deletePath=function(t,e){if("object"==typeof t&&null!==t)for(var r=0,n=e.length;r<n;){var i=e[r++];if(r==n)delete t[i];else{if(!(i in t)||"object"!=typeof t[i]||null===t[i])break;t=t[i]}}},a.isEmpty=function(t){for(var e in t)if(t.hasOwnProperty(e))return!1;return!0},a.format=function(t){for(var e=/%./g,r,n,i=0,o=[],s=0;r=e.exec(t);){(n=t.substring(s,e.lastIndex-2)).length>0&&o.push(n),s=e.lastIndex;var a=r[0][1];switch(a){case"s":case"o":i<arguments.length?o.push(arguments[1+i++]):o.push("<?>");break;case"%":o.push("%");break;default:o.push("<%"+a+"?>")}}return o.push(t.substring(s)),o.join("")},a.formatNumber=function(t,e,r,n){var i=t,o=isNaN(e=Math.abs(e))?2:e,s=void 0===r?",":r,a=void 0===n?".":n,u=i<0?"-":"",c=parseInt(i=Math.abs(+i||0).toFixed(o),10)+"",f=c.length>3?c.length%3:0;return u+(f?c.substr(0,f)+a:"")+c.substr(f).replace(/(\d{3})(?=\d)/g,"$1"+a)+(o?s+Math.abs(i-c).toFixed(o).slice(2):"")},a.formatSize=function(t){return t=t>=1073741824?a.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?a.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?a.formatNumber(t/1024,0)+" KiB":a.formatNumber(t,0)+" bytes"},a.bytesFromIP=function(t){return-1!==t.indexOf(".")?a.bytesFromIPv4(t):-1!==t.indexOf(":")?a.bytesFromIPv6(t):null},a.bytesFromIPv4=function(t){if(4!==(t=t.split(".")).length)return null;for(var e=a.createBuffer(),r=0;r<t.length;++r){var n=parseInt(t[r],10);if(isNaN(n))return null;e.putByte(n)}return e.getBytes()},a.bytesFromIPv6=function(t){for(var e=0,r=2*(8-(t=t.split(":").filter(function(t){return 0===t.length&&++e,!0})).length+e),n=a.createBuffer(),i=0;i<8;++i)if(t[i]&&0!==t[i].length){var o=a.hexToBytes(t[i]);o.length<2&&n.putByte(0),n.putBytes(o)}else n.fillWithByte(0,r),r=0;return n.getBytes()},a.bytesToIP=function(t){return 4===t.length?a.bytesToIPv4(t):16===t.length?a.bytesToIPv6(t):null},a.bytesToIPv4=function(t){if(4!==t.length)return null;for(var e=[],r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e.join(".")},a.bytesToIPv6=function(t){if(16!==t.length)return null;for(var e=[],r=[],n=0,i=0;i<t.length;i+=2){for(var o=a.bytesToHex(t[i]+t[i+1]);"0"===o[0]&&"0"!==o;)o=o.substr(1);if("0"===o){var s=r[r.length-1],u=e.length;s&&u===s.end+1?(s.end=u,s.end-s.start>r[n].end-r[n].start&&(n=r.length-1)):r.push({start:u,end:u})}e.push(o)}if(r.length>0){var c=r[n];c.end-c.start>0&&(e.splice(c.start,c.end-c.start+1,""),0===c.start&&e.unshift(""),7===c.end&&e.push(""))}return e.join(":")},a.estimateCores=function(t,e){if("function"==typeof t&&(e=t,t={}),t=t||{},"cores"in a&&!t.update)return e(null,a.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return a.cores=navigator.hardwareConcurrency,e(null,a.cores);if("undefined"==typeof Worker)return a.cores=1,e(null,a.cores);if("undefined"==typeof Blob)return a.cores=2,e(null,a.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(t){for(var e=Date.now(),r=e+4;Date.now()<r;);self.postMessage({st:e,et:r})})}.toString(),")()"],{type:"application/javascript"}));function n(t,s,u){if(0===s){var c=Math.floor(t.reduce(function(t,e){return t+e},0)/t.length);return a.cores=Math.max(1,c),URL.revokeObjectURL(r),e(null,a.cores)}i(u,function(e,r){t.push(o(u,r)),n(t,s-1,u)})}function i(t,e){for(var n=[],i=[],o=0;o<t;++o){var s=new Worker(r);s.addEventListener("message",function(r){if(i.push(r.data),i.length===t){for(var o=0;o<t;++o)n[o].terminate();e(null,i)}}),n.push(s)}for(var o=0;o<t;++o)n[o].postMessage(o)}function o(t,e){for(var r=[],n=0;n<t;++n)for(var i=e[n],o=r[n]=[],s=0;s<t;++s)if(n!==s){var a=e[s];(i.st>a.st&&i.st<a.et||a.st>i.st&&a.st<i.et)&&o.push(s)}return r.reduce(function(t,e){return Math.max(t,e.length)},0)}n([],5,16)}}).call(e,r(9),r(47).setImmediate,r(0).Buffer)},function(t,e,r){"use strict";const n=r(171),i=r(172),o=r(33);t.exports=(t=>{const e=n();if("function"==typeof t)return t;if("object"==typeof t)return i(t);if("string"==typeof t){const r=o(t).nodeAddress();return e.host=r.address,e.port=r.port,i(e)}throw new Error("Argument must be a send function or a config object.")})},function(t,e){var r;r=function(){return this}();try{r=r||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){(e=t.exports=r(132)).Stream=e,e.Readable=e,e.Writable=r(85),e.Duplex=r(26),e.Transform=r(135),e.PassThrough=r(262)},function(t,e){var r=t.exports={},n,i;function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}function u(t){if(i===clearTimeout)return clearTimeout(t);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{return i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var c=[],f=!1,l,h=-1;function p(){f&&l&&(f=!1,l.length?c=l.concat(c):h=-1,c.length&&d())}function d(){if(!f){var t=a(p);f=!0;for(var e=c.length;e;){for(l=c,c=[];++h<e;)l&&l[h].run();h=-1,e=c.length}l=null,f=!1,u(t)}}function y(t,e){this.fun=t,this.array=e}function g(){}r.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];c.push(new y(t,e)),1!==c.length||f||a(d)},y.prototype.run=function(){this.fun.apply(null,this.array)},r.title="browser",r.browser=!0,r.env={},r.argv=[],r.version="",r.versions={},r.on=g,r.addListener=g,r.once=g,r.off=g,r.removeListener=g,r.removeAllListeners=g,r.emit=g,r.prependListener=g,r.prependOnceListener=g,r.listeners=function(t){return[]},r.binding=function(t){throw new Error("process.binding is not supported")},r.cwd=function(){return"/"},r.chdir=function(t){throw new Error("process.chdir is not supported")},r.umask=function(){return 0}},function(t,e,r){"use strict";(function(e){const n=r(14),i=r(153),o=r(311),s=r(91),a=r(154),u=r(14),c=r(313);class f{constructor(t,r,s){if(f.isCID(t)){let r=t;return this.version=r.version,this.codec=r.codec,void(this.multihash=e.from(r.multihash))}if("string"==typeof t)if(i.isEncoded(t)){const e=i.decode(t);t=parseInt(e.slice(0,1).toString("hex"),16),r=o.getCodec(e.slice(1)),s=o.rmPrefix(e.slice(1))}else r="dag-pb",s=n.fromB58String(t),t=0;else if(e.isBuffer(t)){const e=t.slice(0,1),n=parseInt(e.toString("hex"),16);if(0===n||1===n){const e=t;t=n,r=o.getCodec(e.slice(1)),s=o.rmPrefix(e.slice(1))}else r="dag-pb",s=t,t=0}this.codec=r,this.version=t,this.multihash=s,f.