!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r=e();for(var n in r)("object"==typeof exports?exports:t)[n]=r[n]}}("undefined"!=typeof self?self:this,function(){return 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,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){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=351)}([function(t,e,r){"use strict";(function(t){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ var n=r(401),i=r(402),o=r(211);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(t,e){if(a()=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|t}function p(t,e){if(u.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 F(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return K(t).length;default:if(n)return F(t).length;e=(""+e).toLowerCase(),n=!0}}function m(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function g(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=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,i);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,i){var o,a=1,s=t.length,u=e.length;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;a=2,s/=2,u/=2,r/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(i){var f=-1;for(o=r;os&&(r=s-u),o=r;o>=0;o--){for(var l=!0,h=0;hi&&(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 a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function E(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function x(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:c>223?3:c>191?2:1;if(i+l<=r)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&c)<<6|63&o)>127&&(f=u);break;case 3:o=t[i+1],a=t[i+2],128==(192&o)&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=t[i+1],a=t[i+2],s=t[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&c)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(f=u)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=l}return function(t){var e=t.length;if(e<=M)return String.fromCharCode.apply(String,t);var r="",n=0;for(;nthis.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 T(this,e,r);case"utf8":case"utf-8":return x(this,e,r);case"ascii":return A(this,e,r);case"latin1":case"binary":return C(this,e,r);case"base64":return E(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),""},u.prototype.compare=function(t,e,r,n,i){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,a=r-e,s=Math.min(o,a),c=this.slice(n,i),f=t.slice(e,r),l=0;li)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return y(this,t,e,r);case"utf8":case"utf-8":return b(this,t,e,r);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return _(this,t,e,r);case"base64":return k(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var M=4096;function A(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function N(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function O(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function R(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function P(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 j(t,e,r,n,o){return o||P(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function L(t,e,r,n,o){return o||P(t,0,r,8),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r,n=this.length;if(t=~~t,e=void 0===e?n:~~e,t<0?(t+=n)<0&&(t=0):t>n&&(t=n),e<0?(e+=n)<0&&(e=0):e>n&&(e=n),e0&&(i*=256);)n+=this[t+--e]*i;return n},u.prototype.readUInt8=function(t,e){return e||B(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||B(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||B(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||B(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||B(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||B(t,e,this.length);for(var n=this[t],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||B(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||B(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||B(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){e||B(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return e||B(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||B(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||B(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||B(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||B(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||B(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||N(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+i]=t/o&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):R(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):R(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);N(this,t,e,r,i-1,-i)}var o=0,a=1,s=0;for(this[e]=255&t;++o>0)-s&255;return e+r},u.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);N(this,t,e,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[e+o]=255&t;--o>=0&&(a*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/a>>0)-s&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):O(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):O(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):R(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||N(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):R(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,r){return j(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return j(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return L(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return L(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--i)t[i+e]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(a+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 K(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(D,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function q(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(this,r(7))},function(t,e,r){ /** PROMISIFY CALLBACK-STYLE FUNCTIONS TO ES6 PROMISES * * EXAMPLE: * const fn = promisify( (callback) => callback(null, "Hello world!") ); * fn((err, str) => console.log(str)); * fn().then((str) => console.log(str)); * //Both functions, will log 'Hello world!' * * Note: The function you pass, may have any arguments you want, but the latest * have to be the callback, which you will call with: next(err, value) * * @param method: Function/Array/Map = The function(s) to promisify * @param options: Map = * "context" (default is function): The context which to apply the called function * "replace" (default is falsy): When passed an array/map, if to replace the original object * * @return: A promise if passed a function, otherwise the object with the promises * * @license: MIT * @version: 1.0.3 * @author: Manuel Di Iorio **/ 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;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){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},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 a(t,e,r){return i(t,e,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=n:(o(n,e),e.Buffer=a),o(i,a),a.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,r)},a.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},a.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},a.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},function(t,e,r){"use strict";function n(t,e){e|=0;for(var r=Math.max(t.length-e,0),n=Array(r),i=0;i15?(i=Date.now(),u(t)):(r.push(t),1===r.length&&a.setAttribute("a",o=!o))}}s.nextTick=s.setImmediate}(),s.isNodejs=void 0!==e&&e.versions&&e.versions.node,s.isArray=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},s.isArrayBuffer=function(t){return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer},s.isArrayBufferView=function(t){return t&&s.isArrayBuffer(t.buffer)&&void 0!==t.byteLength},s.ByteBuffer=c,s.ByteStringBuffer=c;s.ByteStringBuffer.prototype._optimizeConstructedString=function(t){this._constructedStringLength+=t,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},s.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},s.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},s.ByteStringBuffer.prototype.putByte=function(t){return this.putBytes(String.fromCharCode(t))},s.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},s.ByteStringBuffer.prototype.putBytes=function(t){return this.data+=t,this._optimizeConstructedString(t.length),this},s.ByteStringBuffer.prototype.putString=function(t){return this.putBytes(s.encodeUtf8(t))},s.ByteStringBuffer.prototype.putInt16=function(t){return this.putBytes(String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},s.ByteStringBuffer.prototype.putInt24=function(t){return this.putBytes(String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t))},s.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))},s.ByteStringBuffer.prototype.putInt16Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255))},s.ByteStringBuffer.prototype.putInt24Le=function(t){return this.putBytes(String.fromCharCode(255&t)+String.fromCharCode(t>>8&255)+String.fromCharCode(t>>16&255))},s.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))},s.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)},s.ByteStringBuffer.prototype.putSignedInt=function(t,e){return t<0&&(t+=2<0);return e},s.ByteStringBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e},s.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},s.ByteStringBuffer.prototype.bytes=function(t){return void 0===t?this.data.slice(this.read):this.data.slice(this.read,this.read+t)},s.ByteStringBuffer.prototype.at=function(t){return this.data.charCodeAt(this.read+t)},s.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},s.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},s.ByteStringBuffer.prototype.copy=function(){var t=s.createBuffer(this.data);return t.read=this.read,t},s.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},s.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},s.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},s.ByteStringBuffer.prototype.toHex=function(){for(var t="",e=this.read;e=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},s.DataBuffer.prototype.putByte=function(t){return this.accommodate(1),this.data.setUint8(this.write++,t),this},s.DataBuffer.prototype.fillWithByte=function(t,e){this.accommodate(e);for(var r=0;r>8&65535),this.data.setInt8(this.write,t>>16&255),this.write+=3,this},s.DataBuffer.prototype.putInt32=function(t){return this.accommodate(4),this.data.setInt32(this.write,t),this.write+=4,this},s.DataBuffer.prototype.putInt16Le=function(t){return this.accommodate(2),this.data.setInt16(this.write,t,!0),this.write+=2,this},s.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},s.DataBuffer.prototype.putInt32Le=function(t){return this.accommodate(4),this.data.setInt32(this.write,t,!0),this.write+=4,this},s.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},s.DataBuffer.prototype.putSignedInt=function(t,e){return u(e),this.accommodate(e/8),t<0&&(t+=2<0);return e},s.DataBuffer.prototype.getSignedInt=function(t){var e=this.getInt(t),r=2<=r&&(e-=r<<1),e},s.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},s.DataBuffer.prototype.bytes=function(t){return void 0===t?this.data.slice(this.read):this.data.slice(this.read,this.read+t)},s.DataBuffer.prototype.at=function(t){return this.data.getUint8(this.read+t)},s.DataBuffer.prototype.setAt=function(t,e){return this.data.setUint8(t,e),this},s.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},s.DataBuffer.prototype.copy=function(){return new s.DataBuffer(this)},s.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},s.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},s.DataBuffer.prototype.truncate=function(t){return this.write=Math.max(0,this.length()-t),this.read=Math.min(this.read,this.write),this},s.DataBuffer.prototype.toHex=function(){for(var t="",e=this.read;e0;)1&e&&(r+=t),(e>>>=1)>0&&(t+=t);return r},s.xorBytes=function(t,e,r){for(var n="",i="",o="",a=0,s=0;r>0;--r,++a)i=t.charCodeAt(a)^e.charCodeAt(a),s>=10&&(n+=o,o="",s=0),o+=String.fromCharCode(i),++s;return n+=o},s.hexToBytes=function(t){var e="",r=0;for(!0&t.length&&(r=1,e+=String.fromCharCode(parseInt(t[0],16)));r>24&255)+String.fromCharCode(t>>16&255)+String.fromCharCode(t>>8&255)+String.fromCharCode(255&t)};var f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l=[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],h="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";s.encode64=function(t,e){for(var r,n,i,o="",a="",s=0;s>2),o+=f.charAt((3&r)<<4|n>>4),isNaN(n)?o+="==":(o+=f.charAt((15&n)<<2|i>>6),o+=isNaN(i)?"=":f.charAt(63&i)),e&&o.length>e&&(a+=o.substr(0,e)+"\r\n",o=o.substr(e));return a+=o},s.decode64=function(t){t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var e,r,n,i,o="",a=0;a>4),64!==n&&(o+=String.fromCharCode((15&r)<<4|n>>2),64!==i&&(o+=String.fromCharCode((3&n)<<6|i)));return o},s.encodeUtf8=function(t){return unescape(encodeURIComponent(t))},s.decodeUtf8=function(t){return decodeURIComponent(escape(t))},s.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:a.encode,decode:a.decode}},s.binary.raw.encode=function(t){return String.fromCharCode.apply(null,t)},s.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>2),o+=f.charAt((3&r)<<4|n>>4),isNaN(n)?o+="==":(o+=f.charAt((15&n)<<2|i>>6),o+=isNaN(i)?"=":f.charAt(63&i)),e&&o.length>e&&(a+=o.substr(0,e)+"\r\n",o=o.substr(e));return a+=o},s.binary.base64.decode=function(t,e,r){var n,i,o,a,s=e;s||(s=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>4,64!==o&&(s[c++]=(15&i)<<4|o>>2,64!==a&&(s[c++]=(3&o)<<6|a));return e?c-r:s.subarray(0,c)},s.binary.base58.encode=function(t,e){return s.binary.baseN.encode(t,h,e)},s.binary.base58.decode=function(t,e){return s.binary.baseN.decode(t,h,e)},s.text={utf8:{},utf16:{}},s.text.utf8.encode=function(t,e,r){t=s.encodeUtf8(t);var n=e;n||(n=new Uint8Array(t.length));for(var i=r=r||0,o=0;o0?(i=r[n].substring(0,a),o=r[n].substring(a+1)):(i=r[n],o=null),i in e||(e[i]=[]),i in Object.prototype||null===o||e[i].push(unescape(o))}return e};return void 0===t?(null===w&&(w="undefined"!=typeof window&&window.location&&window.location.search?r(window.location.search.substring(1)):{}),e=w):e=r(t),e},s.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("/");return i.length>0&&""===i[0]&&i.shift(),{pathString:e,queryString:r,path:i,query:""===r?{}:s.getQueryVariables(r)}},s.makeRequest=function(t){var e=s.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=r.getQuery(t);return n?n[n.length-1]:e}};return r},s.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:"")},s.setPath=function(t,e,r){if("object"==typeof t&&null!==t)for(var n=0,i=e.length;n0&&o.push(r),a=n.lastIndex;var s=e[0][1];switch(s){case"s":case"o":i");break;case"%":o.push("%");break;default:o.push("<%"+s+"?>")}}return o.push(t.substring(a)),o.join("")},s.formatNumber=function(t,e,r,n){var i=t,o=isNaN(e=Math.abs(e))?2:e,a=void 0===r?",":r,s=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)+s:"")+c.substr(f).replace(/(\d{3})(?=\d)/g,"$1"+s)+(o?a+Math.abs(i-c).toFixed(o).slice(2):"")},s.formatSize=function(t){return t=t>=1073741824?s.formatNumber(t/1073741824,2,".","")+" GiB":t>=1048576?s.formatNumber(t/1048576,2,".","")+" MiB":t>=1024?s.formatNumber(t/1024,0)+" KiB":s.formatNumber(t,0)+" bytes"},s.bytesFromIP=function(t){return-1!==t.indexOf(".")?s.bytesFromIPv4(t):-1!==t.indexOf(":")?s.bytesFromIPv6(t):null},s.bytesFromIPv4=function(t){if(4!==(t=t.split(".")).length)return null;for(var e=s.createBuffer(),r=0;rr[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(":")},s.estimateCores=function(t,e){if("function"==typeof t&&(e=t,t={}),t=t||{},"cores"in s&&!t.update)return e(null,s.cores);if("undefined"!=typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return s.cores=navigator.hardwareConcurrency,e(null,s.cores);if("undefined"==typeof Worker)return s.cores=1,e(null,s.cores);if("undefined"==typeof Blob)return s.cores=2,e(null,s.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",function(t){for(var e=Date.now(),r=e+4;Date.now()s.st&&i.sti.st&&s.st{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,n,i=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!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:o}catch(t){r=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(t){n=a}}();var u,c=[],f=!1,l=-1;function h(){f&&u&&(f=!1,u.length?c=u.concat(c):l=-1,c.length&&d())}function d(){if(!f){var t=s(h);f=!0;for(var e=c.length;e;){for(u=c,c=[];++l1)for(var r=1;r=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return n}function u(t,e,r,n){for(var i=0,o=Math.min(t.length,r),a=e;a=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)a=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=s(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=s(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,a=o%n,s=Math.min(o,o-a)+r,c=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function h(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c>>26,l=67108863&u,h=Math.min(c,e.length-1),d=Math.max(0,c-t.length+1);d<=h;d++){var p=c-d|0;f+=(a=(i=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&a}r.words[c]=0|l,u=0|f}return 0!==u?r.words[c]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(t=t||10,e=0|e||1,16===t||"hex"===t){r="";for(var i=0,o=0,a=0;a>>24-i&16777215)||a!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=f[t],d=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:c[h-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return n(void 0!==a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===e,c=new t(o),f=this.clone();if(u){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),c[s]=a;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,g=0|a[2],v=8191&g,y=g>>>13,b=0|a[3],w=8191&b,_=b>>>13,k=0|a[4],S=8191&k,E=k>>>13,x=0|a[5],M=8191&x,A=x>>>13,C=0|a[6],T=8191&C,I=C>>>13,B=0|a[7],N=8191&B,O=B>>>13,R=0|a[8],P=8191&R,j=R>>>13,L=0|a[9],D=8191&L,U=L>>>13,F=0|s[0],K=8191&F,q=F>>>13,z=0|s[1],V=8191&z,H=z>>>13,G=0|s[2],W=8191&G,Y=G>>>13,Z=0|s[3],$=8191&Z,Q=Z>>>13,X=0|s[4],J=8191&X,tt=X>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],ot=8191&it,at=it>>>13,st=0|s[7],ut=8191&st,ct=st>>>13,ft=0|s[8],lt=8191&ft,ht=ft>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(l,K))|0)+((8191&(i=(i=Math.imul(l,q))+Math.imul(h,K)|0))<<13)|0;c=((o=Math.imul(h,q))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(p,K),i=(i=Math.imul(p,q))+Math.imul(m,K)|0,o=Math.imul(m,q);var vt=(c+(n=n+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,H)|0)+Math.imul(h,V)|0))<<13)|0;c=((o=o+Math.imul(h,H)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,K),i=(i=Math.imul(v,q))+Math.imul(y,K)|0,o=Math.imul(y,q),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,H)|0;var yt=(c+(n=n+Math.imul(l,W)|0)|0)+((8191&(i=(i=i+Math.imul(l,Y)|0)+Math.imul(h,W)|0))<<13)|0;c=((o=o+Math.imul(h,Y)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(w,K),i=(i=Math.imul(w,q))+Math.imul(_,K)|0,o=Math.imul(_,q),n=n+Math.imul(v,V)|0,i=(i=i+Math.imul(v,H)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,H)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,Y)|0;var bt=(c+(n=n+Math.imul(l,$)|0)|0)+((8191&(i=(i=i+Math.imul(l,Q)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,Q)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(S,K),i=(i=Math.imul(S,q))+Math.imul(E,K)|0,o=Math.imul(E,q),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,H)|0)+Math.imul(_,V)|0,o=o+Math.imul(_,H)|0,n=n+Math.imul(v,W)|0,i=(i=i+Math.imul(v,Y)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,Y)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,Q)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,Q)|0;var wt=(c+(n=n+Math.imul(l,J)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(h,J)|0))<<13)|0;c=((o=o+Math.imul(h,tt)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(M,K),i=(i=Math.imul(M,q))+Math.imul(A,K)|0,o=Math.imul(A,q),n=n+Math.imul(S,V)|0,i=(i=i+Math.imul(S,H)|0)+Math.imul(E,V)|0,o=o+Math.imul(E,H)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(v,$)|0,i=(i=i+Math.imul(v,Q)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,Q)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(h,rt)|0))<<13)|0;c=((o=o+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(T,K),i=(i=Math.imul(T,q))+Math.imul(I,K)|0,o=Math.imul(I,q),n=n+Math.imul(M,V)|0,i=(i=i+Math.imul(M,H)|0)+Math.imul(A,V)|0,o=o+Math.imul(A,H)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(E,W)|0,o=o+Math.imul(E,Y)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,Q)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,Q)|0,n=n+Math.imul(v,J)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var kt=(c+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,at)|0)+Math.imul(h,ot)|0))<<13)|0;c=((o=o+Math.imul(h,at)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(N,K),i=(i=Math.imul(N,q))+Math.imul(O,K)|0,o=Math.imul(O,q),n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,H)|0)+Math.imul(I,V)|0,o=o+Math.imul(I,H)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,Q)|0)+Math.imul(E,$)|0,o=o+Math.imul(E,Q)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,tt)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var St=(c+(n=n+Math.imul(l,ut)|0)|0)+((8191&(i=(i=i+Math.imul(l,ct)|0)+Math.imul(h,ut)|0))<<13)|0;c=((o=o+Math.imul(h,ct)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(P,K),i=(i=Math.imul(P,q))+Math.imul(j,K)|0,o=Math.imul(j,q),n=n+Math.imul(N,V)|0,i=(i=i+Math.imul(N,H)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,H)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,Y)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,Q)|0)+Math.imul(A,$)|0,o=o+Math.imul(A,Q)|0,n=n+Math.imul(S,J)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(w,rt)|0,i=(i=i+Math.imul(w,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(v,ot)|0,i=(i=i+Math.imul(v,at)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,at)|0,n=n+Math.imul(p,ut)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ct)|0;var Et=(c+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(h,lt)|0))<<13)|0;c=((o=o+Math.imul(h,ht)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(D,K),i=(i=Math.imul(D,q))+Math.imul(U,K)|0,o=Math.imul(U,q),n=n+Math.imul(P,V)|0,i=(i=i+Math.imul(P,H)|0)+Math.imul(j,V)|0,o=o+Math.imul(j,H)|0,n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,Y)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,Y)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,Q)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,Q)|0,n=n+Math.imul(M,J)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(A,J)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(w,ot)|0,i=(i=i+Math.imul(w,at)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,at)|0,n=n+Math.imul(v,ut)|0,i=(i=i+Math.imul(v,ct)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ct)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,lt)|0,o=o+Math.imul(m,ht)|0;var xt=(c+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,mt)|0)+Math.imul(h,pt)|0))<<13)|0;c=((o=o+Math.imul(h,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(D,V),i=(i=Math.imul(D,H))+Math.imul(U,V)|0,o=Math.imul(U,H),n=n+Math.imul(P,W)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,Y)|0,n=n+Math.imul(N,$)|0,i=(i=i+Math.imul(N,Q)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,Q)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(I,J)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,at)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,at)|0,n=n+Math.imul(w,ut)|0,i=(i=i+Math.imul(w,ct)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ct)|0,n=n+Math.imul(v,lt)|0,i=(i=i+Math.imul(v,ht)|0)+Math.imul(y,lt)|0,o=o+Math.imul(y,ht)|0;var Mt=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;c=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(D,W),i=(i=Math.imul(D,Y))+Math.imul(U,W)|0,o=Math.imul(U,Y),n=n+Math.imul(P,$)|0,i=(i=i+Math.imul(P,Q)|0)+Math.imul(j,$)|0,o=o+Math.imul(j,Q)|0,n=n+Math.imul(N,J)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,at)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,at)|0,n=n+Math.imul(S,ut)|0,i=(i=i+Math.imul(S,ct)|0)+Math.imul(E,ut)|0,o=o+Math.imul(E,ct)|0,n=n+Math.imul(w,lt)|0,i=(i=i+Math.imul(w,ht)|0)+Math.imul(_,lt)|0,o=o+Math.imul(_,ht)|0;var At=(c+(n=n+Math.imul(v,pt)|0)|0)+((8191&(i=(i=i+Math.imul(v,mt)|0)+Math.imul(y,pt)|0))<<13)|0;c=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(D,$),i=(i=Math.imul(D,Q))+Math.imul(U,$)|0,o=Math.imul(U,Q),n=n+Math.imul(P,J)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(N,rt)|0,i=(i=i+Math.imul(N,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,at)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,at)|0,n=n+Math.imul(M,ut)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(A,ut)|0,o=o+Math.imul(A,ct)|0,n=n+Math.imul(S,lt)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,ht)|0;var Ct=(c+(n=n+Math.imul(w,pt)|0)|0)+((8191&(i=(i=i+Math.imul(w,mt)|0)+Math.imul(_,pt)|0))<<13)|0;c=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(D,J),i=(i=Math.imul(D,tt))+Math.imul(U,J)|0,o=Math.imul(U,tt),n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(N,ot)|0,i=(i=i+Math.imul(N,at)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,at)|0,n=n+Math.imul(T,ut)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ct)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(A,lt)|0,o=o+Math.imul(A,ht)|0;var Tt=(c+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,mt)|0)+Math.imul(E,pt)|0))<<13)|0;c=((o=o+Math.imul(E,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,rt),i=(i=Math.imul(D,nt))+Math.imul(U,rt)|0,o=Math.imul(U,nt),n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,at)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,at)|0,n=n+Math.imul(N,ut)|0,i=(i=i+Math.imul(N,ct)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ct)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(I,lt)|0,o=o+Math.imul(I,ht)|0;var It=(c+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(A,pt)|0))<<13)|0;c=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(D,ot),i=(i=Math.imul(D,at))+Math.imul(U,ot)|0,o=Math.imul(U,at),n=n+Math.imul(P,ut)|0,i=(i=i+Math.imul(P,ct)|0)+Math.imul(j,ut)|0,o=o+Math.imul(j,ct)|0,n=n+Math.imul(N,lt)|0,i=(i=i+Math.imul(N,ht)|0)+Math.imul(O,lt)|0,o=o+Math.imul(O,ht)|0;var Bt=(c+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(I,pt)|0))<<13)|0;c=((o=o+Math.imul(I,mt)|0)+(i>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,n=Math.imul(D,ut),i=(i=Math.imul(D,ct))+Math.imul(U,ut)|0,o=Math.imul(U,ct),n=n+Math.imul(P,lt)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,ht)|0;var Nt=(c+(n=n+Math.imul(N,pt)|0)|0)+((8191&(i=(i=i+Math.imul(N,mt)|0)+Math.imul(O,pt)|0))<<13)|0;c=((o=o+Math.imul(O,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(D,lt),i=(i=Math.imul(D,ht))+Math.imul(U,lt)|0,o=Math.imul(U,ht);var Ot=(c+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(j,pt)|0))<<13)|0;c=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var Rt=(c+(n=Math.imul(D,pt))|0)+((8191&(i=(i=Math.imul(D,mt))+Math.imul(U,pt)|0))<<13)|0;return c=((o=Math.imul(U,mt))+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,u[0]=gt,u[1]=vt,u[2]=yt,u[3]=bt,u[4]=wt,u[5]=_t,u[6]=kt,u[7]=St,u[8]=Et,u[9]=xt,u[10]=Mt,u[11]=At,u[12]=Ct,u[13]=Tt,u[14]=It,u[15]=Bt,u[16]=Nt,u[17]=Ot,u[18]=Rt,0!==c&&(u[19]=c,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=h),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?h(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},m.prototype.permute=function(t,e,r,n,i,o){for(var a=0;a>>=1)i++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,e+=i/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,c=0;c=0&&(0!==f||c>=i);c--){var l=0|this.words[c];this.words[c]=f<<26-o|l>>>o,f=l&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c=0;l--){var h=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(h=Math.min(h/a|0,67108863),n._ishlnsubmul(i,h,l);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=h)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:i,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var f=r.clone(),l=e.clone();!e.isZero();){for(var h=0,d=1;0==(e.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(l)),i.iushrn(1),a.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(l)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),a.isub(u)):(r.isub(e),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,f=1;0==(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var l=0,h=1;0==(r.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(r.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(i=0===e.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(t),i},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new k(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var g={k256:null,p224:null,p192:null,p25519:null};function v(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){k.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):r.strip(),r},v.prototype.split=function(t,e){t.iushrn(this.n,0,e)},v.prototype.imulK=function(t){return t.imul(this.k)},i(y,v),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return g[t]=e,e},k.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},k.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},k.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},k.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},k.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},k.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},k.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},k.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},k.prototype.isqr=function(t){return this.imul(t,t.clone())},k.prototype.sqr=function(t){return this.mul(t,t)},k.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,c).cmp(u);)f.redIAdd(u);for(var l=this.pow(f,i),h=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=a;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g=0;n--){for(var c=e.words[n],f=u-1;f>=0;f--){var l=c>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==a?(a<<=1,a|=l,(4===++s||0===n&&0===f)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},k.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},k.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new S(t)},i(S,k),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t,this)}).call(this,r(18)(t))},function(t,e,r){"use strict";t.exports=r(377)},function(t,e){var r=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=r)},function(t,e,r){(e=t.exports=r(225)).Stream=e,e.Readable=e,e.Writable=r(143),e.Duplex=r(47),e.Transform=r(228),e.PassThrough=r(458)},function(t,e,r){"use strict";(function(t,n){r.d(e,"d",function(){return a}),r.d(e,"c",function(){return s}),r.d(e,"b",function(){return u}),r.d(e,"e",function(){return c});var i,o=r(4),a="function"==typeof t&&t,s="object"==typeof n&&"function"==typeof n.nextTick;function u(t){setTimeout(t,0)}function c(t){return function(e){var r=Object(o.a)(arguments,1);t(function(){e.apply(null,r)})}}i=a?t:s?n.nextTick:u,e.a=c(i)}).call(this,r(58).setImmediate,r(9))},function(t,e,r){"use strict";var n=r(396),i=r(397);t.exports={errors:n,formatters:i}},function(t,e,r){"use strict";var n=e;n.version=r(492).version,n.utils=r(493),n.rand=r(245),n.curve=r(107),n.curves=r(498),n.ec=r(506),n.eddsa=r(510)},function(t,e){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){t.exports=r(382)},function(t,e,r){var n=r(133)("wks"),i=r(94),o=r(17).Symbol,a="function"==typeof o;(t.exports=function(t){return n[t]||(n[t]=a&&o[t]||(a?o:i)("Symbol."+t))}).store=n},function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=r,r.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},function(t,e,r){var n=r(140),i=r(399),o=r(213),a=r(408),s=r(409),u=function(t){if(!o.isHexStrict(t))throw new Error("The parameter must be a valid HEX string.");var e="",r=0,n=t.length;for("0x"===t.substring(0,2)&&(r=2);r7?r+=t[n].toUpperCase():r+=t[n];return r},toHex:o.toHex,toBN:o.toBN,bytesToHex:o.bytesToHex,hexToBytes:o.hexToBytes,hexToNumberString:o.hexToNumberString,hexToNumber:o.hexToNumber,toDecimal:o.hexToNumber,numberToHex:o.numberToHex,fromDecimal:o.numberToHex,hexToUtf8:o.hexToUtf8,hexToString:o.hexToUtf8,toUtf8:o.hexToUtf8,utf8ToHex:o.utf8ToHex,stringToHex:o.utf8ToHex,fromUtf8:o.utf8ToHex,hexToAscii:u,toAscii:u,asciiToHex:c,fromAscii:c,unitMap:i.unitMap,toWei:function(t,e){if(e=f(e),!o.isBN(t)&&!n.isString(t))throw new Error("Please pass numbers as strings or BigNumber objects to avoid precision errors.");return o.isBN(t)?i.toWei(t,e):i.toWei(t,e).toString(10)},fromWei:function(t,e){if(e=f(e),!o.isBN(t)&&!n.isString(t))throw new Error("Please pass numbers as strings or BigNumber objects to avoid precision errors.");return o.isBN(t)?i.fromWei(t,e):i.fromWei(t,e).toString(10)},padLeft:o.leftPad,leftPad:o.leftPad,padRight:o.rightPad,rightPad:o.rightPad,toTwosComplement:o.toTwosComplement}},function(t,e,r){t.exports={encode:r(568),decode:r(569),encodingLength:r(570)}},function(t,e,r){var n=r(17),i=r(12),o=r(53),a=r(42),s=r(43),u=function(t,e,r){var c,f,l,h=t&u.F,d=t&u.G,p=t&u.S,m=t&u.P,g=t&u.B,v=t&u.W,y=d?i:i[e]||(i[e]={}),b=y.prototype,w=d?n:p?n[e]:(n[e]||{}).prototype;for(c in d&&(r=e),r)(f=!h&&w&&void 0!==w[c])&&s(y,c)||(l=f?w[c]:r[c],y[c]=d&&"function"!=typeof w[c]?r[c]:g&&f?o(l,n):v&&w[c]==l?function(t){var e=function(e,r,n){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,r)}return new t(e,r,n)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(l):m&&"function"==typeof l?o(Function.call,l):l,m&&((y.virtual||(y.virtual={}))[c]=l,t&u.R&&b&&!b[c]&&a(b,c,l)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},function(t,e,r){var n=r(574);function i(t){var e=function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function o(t){var e=function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},r=t.name||"Function wrapped with `once`";return e.onceError=r+" shouldn't be called more than once",e.called=!1,e}t.exports=n(i),t.exports.strict=n(o),i.proto=i(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return i(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return o(this)},configurable:!0})})},function(t,e,r){"use strict";const n=r(48),i=r(79);t.exports=function(t,e){n(t,i(t=>e(null,t)),t=>{t&&e(t)})}},function(t,e,r){var n=r(5);r(51),r(317),r(318),r(6),n.random&&n.random.getBytes?t.exports=n.random:function(e){var r={},i=new Array(4),o=n.util.createBuffer();function a(){var t=n.prng.create(r);return t.getBytes=function(e,r){return t.generate(e,r)},t.getBytesSync=function(e){return t.generate(e)},t}r.formatKey=function(t){var e=n.util.createBuffer(t);return(t=new Array(4))[0]=e.getInt32(),t[1]=e.getInt32(),t[2]=e.getInt32(),t[3]=e.getInt32(),n.aes._expandKey(t,!1)},r.formatSeed=function(t){var e=n.util.createBuffer(t);return(t=new Array(4))[0]=e.getInt32(),t[1]=e.getInt32(),t[2]=e.getInt32(),t[3]=e.getInt32(),t},r.cipher=function(t,e){return n.aes._updateBlock(t,e,i,!1),o.putInt32(i[0]),o.putInt32(i[1]),o.putInt32(i[2]),o.putInt32(i[3]),o.getBytes()},r.increment=function(t){return++t[3],t},r.md=n.md.sha256;var s=a(),u=null;if("undefined"!=typeof window){var c=window.crypto||window.msCrypto;c&&c.getRandomValues&&(u=function(t){return c.getRandomValues(t)})}if(n.options.usePureJavaScript||!n.util.isNodejs&&!u){if("undefined"==typeof window||window.document,s.collectInt(+new Date,32),"undefined"!=typeof navigator){var f="";for(var l in navigator)try{"string"==typeof navigator[l]&&(f+=navigator[l])}catch(t){}s.collect(f),f=null}e&&(e().mousemove(function(t){s.collectInt(t.clientX,16),s.collectInt(t.clientY,16)}),e().keypress(function(t){s.collectInt(t.charCode,8)}))}if(n.random)for(var l in s)n.random[l]=s[l];else n.random=s;n.random.createInstance=a,t.exports=n.random}("undefined"!=typeof jQuery?jQuery:null)},function(t,e,r){var n=r(222),i=r(22),o=r(441),a=r(223),s=function(t){return n.isNumber(t)&&(t=Math.trunc(t)),new a(i.toTwosComplement(t).replace("0x",""))};t.exports={formatInputInt:s,formatInputBytes:function(t){if(!i.isHexStrict(t))throw new Error('Given parameter is not bytes: "'+t+'"');var e=t.replace(/^0x/i,"");if(e.length%2!=0)throw new Error('Given parameter bytes has an invalid length: "'+t+'"');if(e.length>64)throw new Error('Given parameter bytes is too long: "'+t+'"');var r=Math.floor((e.length+63)/64);return e=i.padRight(e,64*r),new a(e)},formatInputDynamicBytes:function(t){if(!i.isHexStrict(t))throw new Error('Given parameter is not bytes: "'+t+'"');var e=t.replace(/^0x/i,"");if(e.length%2!=0)throw new Error('Given parameter bytes has an invalid length: "'+t+'"');var r=e.length/2,n=Math.floor((e.length+63)/64);return e=i.padRight(e,64*n),new a(s(r).value+e)},formatInputString:function(t){if(!n.isString(t))throw new Error("Given parameter is not a valid string: "+t);var e=i.utf8ToHex(t).replace(/^0x/i,""),r=e.length/2,o=Math.floor((e.length+63)/64);return e=i.padRight(e,64*o),new a(s(r).value+e)},formatInputBool:function(t){return new a("000000000000000000000000000000000000000000000000000000000000000"+(t?"1":"0"))},formatOutputInt:function(t){var e=t.staticPart();if(!e&&!t.rawValue)throw new Error("Couldn't decode "+name+" from ABI: 0x"+t.rawValue);return function(t){return"1"===new o(t.substr(0,1),16).toString(2).substr(0,1)}(e)?new o(e,16).fromTwos(256).toString(10):new o(e,16).toString(10)},formatOutputUInt:function(t,e){var r=t.staticPart();if(!r&&!t.rawValue)throw new Error("Couldn't decode "+e+" from ABI: 0x"+t.rawValue);return new o(r,16).toString(10)},formatOutputBool:function(t,e){var r=t.staticPart();if(!r&&!t.rawValue)throw new Error("Couldn't decode "+e+" from ABI: 0x"+t.rawValue);return"0000000000000000000000000000000000000000000000000000000000000001"===r},formatOutputBytes:function(t,e){var r=e.match(/^bytes([0-9]*)/),n=parseInt(r[1]);if(t.staticPart().slice(0,2*n).length!==2*n)throw new Error("Couldn't decode "+e+" from ABI: 0x"+t.rawValue+" The size doesn't match.");return"0x"+t.staticPart().slice(0,2*n)},formatOutputDynamicBytes:function(t,e){var r=t.dynamicPart().slice(0,64);if(!r)throw new Error("Couldn't decode "+e+" from ABI: 0x"+t.rawValue);var n=2*new o(r,16).toNumber();return"0x"+t.dynamicPart().substr(64,n)},formatOutputString:function(t){var e=t.dynamicPart().slice(0,64);if(!e)throw new Error("ERROR: The returned value is not a convertible string:"+e);var r=2*new o(e,16).toNumber();return r?i.hexToUtf8("0x"+t.dynamicPart().substr(64,r).replace(/^0x/i,"")):""},formatOutputAddress:function(t,e){var r=t.staticPart();if(!r)throw new Error("Couldn't decode "+e+" from ABI: 0x"+t.rawValue);return i.toChecksumAddress("0x"+r.slice(r.length-40,r.length))},toTwosComplement:i.toTwosComplement}},function(t,e,r){"use strict";var n=r(21),i=r(2);function o(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function a(t){return 1===t.length?"0"+t:t}function s(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=i,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),n=0;n>8,a=255&i;o?r.push(o,a):r.push(a)}else for(n=0;n>>0}return a},e.split32=function(t,e){for(var r=new Array(4*t.length),n=0,i=0;n>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,n){return t+e+r+n>>>0},e.sum32_5=function(t,e,r,n,i){return t+e+r+n+i>>>0},e.sum64=function(t,e,r,n){var i=t[e],o=n+t[e+1]>>>0,a=(o>>0,t[e+1]=o},e.sum64_hi=function(t,e,r,n){return(e+n>>>0>>0},e.sum64_lo=function(t,e,r,n){return e+n>>>0},e.sum64_4_hi=function(t,e,r,n,i,o,a,s){var u=0,c=e;return u+=(c=c+n>>>0)>>0)>>0)>>0},e.sum64_4_lo=function(t,e,r,n,i,o,a,s){return e+n+o+s>>>0},e.sum64_5_hi=function(t,e,r,n,i,o,a,s,u,c){var f=0,l=e;return f+=(l=l+n>>>0)>>0)>>0)>>0)>>0},e.sum64_5_lo=function(t,e,r,n,i,o,a,s,u,c){return e+n+o+s+c>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},function(t,e,r){var n=r(31),i=r(189),o=r(126),a=Object.defineProperty;e.f=r(38)?Object.defineProperty:function(t,e,r){if(n(t),e=o(e,!0),n(r),i)try{return a(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[e]=r.value),t}},function(t,e,r){var n=r(37);t.exports=function(t){if(!n(t))throw TypeError(t+" is not an object!");return t}},function(t,e,r){"use strict";(function(e){const n=r(33),i=r(619),o=r(626),a=r(162),s=r(280),u=r(33),c=r(628);class f{constructor(t,r,a){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)),a=o.rmPrefix(e.slice(1))}else r="dag-pb",a=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)),a=o.rmPrefix(e.slice(1))}else r="dag-pb",a=t,t=0}this.codec=r,this.version=t,this.multihash=a,f.validateCID(this)}get buffer(){switch(this.version){case 0:return this.multihash;case 1:return e.concat([e.from("01","hex"),e.from(s[this.codec]),this.multihash]);default:throw new Error("unsupported version")}}get prefix(){return e.concat([e.from(`0${this.version}`,"hex"),s[this.codec],u.prefix(this.multihash)])}toV0(){if("dag-pb"!==this.codec)throw new Error("Cannot convert a non dag-pb CID to CIDv0");return new f(0,this.codec,this.multihash)}toV1(){return new f(1,this.codec,this.multihash)}toBaseEncodedString(t){switch(t=t||"base58btc",this.version){case 0:if("base58btc"!==t)throw new Error("not supported with CIDv0, to support different bases, please migrate the instance do CIDv1, you can do that through cid.toV1()");return n.toB58String(this.multihash);case 1:return i.encode(t,this.buffer).toString();default:throw new Error("Unsupported version")}}toJSON(){return{codec:this.codec,version:this.version,hash:this.multihash}}equals(t){return this.codec===t.codec&&this.version===t.version&&this.multihash.equals(t.multihash)}static isCID(t){return!c.checkCIDComponents(t)}static validateCID(t){let e=c.checkCIDComponents(t);if(e)throw new Error(e)}}f.codecs=a,t.exports=f}).call(this,r(0).Buffer)},function(t,e,r){"use strict";(function(t){const n=r(616),i=r(618);e.names=i.names,e.codes=i.codes,e.defaultLengths=i.defaultLengths;const o=r(23);function a(t){e.decode(t)}e.toHexString=function(e){if(!t.isBuffer(e))throw new Error("must be passed a buffer");return e.toString("hex")},e.fromHexString=function(e){return t.from(e,"hex")},e.toB58String=function(e){if(!t.isBuffer(e))throw new Error("must be passed a buffer");return n.encode(e)},e.fromB58String=function(e){let r=e;return t.isBuffer(e)&&(r=e.toString()),t.from(n.decode(r))},e.decode=function(r){if(!t.isBuffer(r))throw new Error("multihash must be a Buffer");if(r.length<3)throw new Error("multihash too short. must be > 3 bytes.");let n=o.decode(r);if(!e.isValidCode(n))throw new Error(`multihash unknown function code: 0x${n.toString(16)}`);r=r.slice(o.decode.bytes);let a=o.decode(r);if(a<1)throw new Error(`multihash invalid length: 0x${a.toString(16)}`);if((r=r.slice(o.decode.bytes)).length!==a)throw new Error(`multihash length inconsistent: 0x${r.toString("hex")}`);return{code:n,name:i.codes[n],length:a,digest:r}},e.encode=function(r,n,i){if(!r||!n)throw new Error("multihash encode requires at least two args: digest, code");const a=e.coerceCode(n);if(!t.isBuffer(r))throw new Error("digest should be a Buffer");if(null==i&&(i=r.length),i&&r.length!==i)throw new Error("digest length should be equal to specified length.");return t.concat([t.from(o.encode(a)),t.from(o.encode(i)),r])},e.coerceCode=function(t){let r=t;if("string"==typeof t){if(!i.names[t])throw new Error(`Unrecognized hash function named: ${t}`);r=i.names[t]}if("number"!=typeof r)throw new Error(`Hash function code should be a number. Got: ${r}`);if(!i.codes[r]&&!e.isAppCode(r))throw new Error(`Unrecognized function code: ${r}`);return r},e.isAppCode=function(t){return t>0&&t<16},e.isValidCode=function(t){return!!e.isAppCode(t)||!!i.codes[t]},e.validate=a,e.prefix=function(t){return a(t),t.slice(0,2)}}).call(this,r(0).Buffer)},function(t,e,r){var n=r(5);r(6),r(52);var i=t.exports=n.asn1=n.asn1||{};function o(t,e,r){if(r>e){var n=new Error("Too few bytes to parse DER.");throw n.available=t.length(),n.remaining=e,n.requested=r,n}}i.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},i.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},i.create=function(t,e,r,o,a){if(n.util.isArray(o)){for(var s=[],u=0;ur){if(s.strict){var d=new Error("Too few bytes to read ASN.1 value.");throw d.available=e.length(),d.remaining=r,d.requested=h,d}h=r}var p;var m;var g=32==(32&c);if(g)if(p=[],void 0===h)for(;;){if(o(e,r,2),e.bytes(2)===String.fromCharCode(0,0)){e.getBytes(2),r-=2;break}u=e.length(),p.push(t(e,r,n+1,s)),r-=u-e.length()}else for(;h>0;)u=e.length(),p.push(t(e,h,n+1,s)),r-=u-e.length(),h-=u-e.length();void 0===p&&f===i.Class.UNIVERSAL&&l===i.Type.BITSTRING&&(m=e.bytes(h));if(void 0===p&&s.decodeBitStrings&&f===i.Class.UNIVERSAL&&l===i.Type.BITSTRING&&h>1){var v=e.read,y=r,b=0;if(l===i.Type.BITSTRING&&(o(e,r,1),b=e.getByte(),r--),0===b)try{u=e.length();var w={verbose:s.verbose,strict:!0,decodeBitStrings:!0},_=t(e,r,n+1,w),k=u-e.length();r-=k,l==i.Type.BITSTRING&&k++;var S=_.tagClass;k!==h||S!==i.Class.UNIVERSAL&&S!==i.Class.CONTEXT_SPECIFIC||(p=[_])}catch(t){}void 0===p&&(e.read=v,r=y)}if(void 0===p){if(void 0===h){if(s.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");h=r}if(l===i.Type.BMPSTRING)for(p="";h>0;h-=2)o(e,r,2),p+=String.fromCharCode(e.getInt16()),r-=2;else p=e.getBytes(h)}var E=void 0===m?null:{bitStringContents:m};return i.create(f,l,g,p,E)}(t,t.length(),0,e)},i.toDer=function(t){var e=n.util.createBuffer(),r=t.tagClass|t.type,o=n.util.createBuffer(),a=!1;if("bitStringContents"in t&&(a=!0,t.original&&(a=i.equals(t,t.original))),a)o.putBytes(t.bitStringContents);else if(t.composed){t.constructed?r|=32:o.putByte(0);for(var s=0;s1&&(0===t.value.charCodeAt(0)&&0==(128&t.value.charCodeAt(1))||255===t.value.charCodeAt(0)&&128==(128&t.value.charCodeAt(1)))?o.putBytes(t.value.substr(1)):o.putBytes(t.value);if(e.putByte(r),o.length()<=127)e.putByte(127&o.length());else{var u=o.length(),c="";do{c+=String.fromCharCode(255&u),u>>>=8}while(u>0);e.putByte(128|c.length);for(s=c.length-1;s>=0;--s)e.putByte(c.charCodeAt(s))}return e.putBuffer(o),e},i.oidToDer=function(t){var e,r,i,o,a=t.split("."),s=n.util.createBuffer();s.putByte(40*parseInt(a[0],10)+parseInt(a[1],10));for(var u=2;u>>=7,e||(o|=128),r.push(o),e=!1}while(i>0);for(var c=r.length-1;c>=0;--c)s.putByte(r[c])}return s},i.derToOid=function(t){var e;"string"==typeof t&&(t=n.util.createBuffer(t));var r=t.getByte();e=Math.floor(r/40)+"."+r%40;for(var i=0;t.length()>0;)i<<=7,128&(r=t.getByte())?i+=127&r:(e+="."+(i+r),i=0);return e},i.utcTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(t.substr(2,2),10)-1,i=parseInt(t.substr(4,2),10),o=parseInt(t.substr(6,2),10),a=parseInt(t.substr(8,2),10),s=0;if(t.length>11){var u=t.charAt(10),c=10;"+"!==u&&"-"!==u&&(s=parseInt(t.substr(10,2),10),c+=2)}if(e.setUTCFullYear(r,n,i),e.setUTCHours(o,a,s,0),c&&("+"===(u=t.charAt(c))||"-"===u)){var f=60*parseInt(t.substr(c+1,2),10)+parseInt(t.substr(c+4,2),10);f*=6e4,"+"===u?e.setTime(+e-f):e.setTime(+e+f)}return e},i.generalizedTimeToDate=function(t){var e=new Date,r=parseInt(t.substr(0,4),10),n=parseInt(t.substr(4,2),10)-1,i=parseInt(t.substr(6,2),10),o=parseInt(t.substr(8,2),10),a=parseInt(t.substr(10,2),10),s=parseInt(t.substr(12,2),10),u=0,c=0,f=!1;"Z"===t.charAt(t.length-1)&&(f=!0);var l=t.length-5,h=t.charAt(l);"+"!==h&&"-"!==h||(c=60*parseInt(t.substr(l+1,2),10)+parseInt(t.substr(l+4,2),10),c*=6e4,"+"===h&&(c*=-1),f=!0);return"."===t.charAt(14)&&(u=1e3*parseFloat(t.substr(14),10)),f?(e.setUTCFullYear(r,n,i),e.setUTCHours(o,a,s,u),e.setTime(+e+c)):(e.setFullYear(r,n,i),e.setHours(o,a,s,u)),e},i.dateToUtcTime=function(t){if("string"==typeof t)return t;var e="",r=[];r.push((""+t.getUTCFullYear()).substr(2)),r.push(""+(t.getUTCMonth()+1)),r.push(""+t.getUTCDate()),r.push(""+t.getUTCHours()),r.push(""+t.getUTCMinutes()),r.push(""+t.getUTCSeconds());for(var n=0;n=-128&&t<128)return e.putSignedInt(t,8);if(t>=-32768&&t<32768)return e.putSignedInt(t,16);if(t>=-8388608&&t<8388608)return e.putSignedInt(t,24);if(t>=-2147483648&&t<2147483648)return e.putSignedInt(t,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=t,r},i.derToInteger=function(t){"string"==typeof t&&(t=n.util.createBuffer(t));var e=8*t.length();if(e>32)throw new Error("Integer too large; max is 32-bits.");return t.getSignedInt(e)},i.validate=function(t,e,r,o){var a=!1;if(t.tagClass!==e.tagClass&&void 0!==e.tagClass||t.type!==e.type&&void 0!==e.type)o&&(t.tagClass!==e.tagClass&&o.push("["+e.name+'] Expected tag class "'+e.tagClass+'", got "'+t.tagClass+'"'),t.type!==e.type&&o.push("["+e.name+'] Expected type "'+e.type+'", got "'+t.type+'"'));else if(t.constructed===e.constructed||void 0===e.constructed){if(a=!0,e.value&&n.util.isArray(e.value))for(var s=0,u=0;a&&u0&&(o+="\n");for(var a="",u=0;u1?o+="0x"+n.util.bytesToHex(t.value.slice(1)):o+="(none)",t.value.length>0){var h=t.value.charCodeAt(0);1==h?o+=" (1 unused bit shown)":h>1&&(o+=" ("+h+" unused bits shown)")}}else t.type===i.Type.OCTETSTRING?(s.test(t.value)||(o+="("+t.value+") "),o+="0x"+n.util.bytesToHex(t.value)):t.type===i.Type.UTF8?o+=n.util.decodeUtf8(t.value):t.type===i.Type.PRINTABLESTRING||t.type===i.Type.IA5String?o+=t.value:s.test(t.value)?o+="0x"+n.util.bytesToHex(t.value):0===t.value.length?o+="[null]":o+=t.value}return o}},function(t,e,r){var n=r(5);t.exports=n.md=n.md||{},n.md.algorithms=n.md.algorithms||{}},function(t,e,r){t.exports=r(363)},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,r){t.exports=!r(54)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e,r){var n=r(3).Buffer,i=r(101).Transform,o=r(73).StringDecoder;function a(t){i.call(this),this.hashMode="string"==typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(2)(a,i),a.prototype.update=function(t,e,r){"string"==typeof t&&(t=n.from(t,e));var i=this._update(t);return this.hashMode?this:(r&&(i=this._toString(i,r)),i)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(t,e,r){var n;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(t){n=t}finally{r(n)}},a.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(t){e=t}t(e)},a.prototype._finalOrDigest=function(t){var e=this.__final()||n.alloc(0);return t&&(e=this._toString(e,t,!0)),e},a.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var n=this._decoder.write(t);return r&&(n+=this._decoder.end()),n},t.exports=a},function(t,e,r){(function(t,n){var i=/%[sdj%]/g;e.format=function(t){if(!v(t)){for(var e=[],r=0;r=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),u=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(r)?n.showHidden=r:r&&e._extend(n,r),y(n.showHidden)&&(n.showHidden=!1),y(n.depth)&&(n.depth=2),y(n.colors)&&(n.colors=!1),y(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),f(n,t,n.depth)}function u(t,e){var r=s.styles[e];return r?"["+s.colors[r][0]+"m"+t+"["+s.colors[r][1]+"m":t}function c(t,e){return t}function f(t,r,n){if(t.customInspect&&r&&S(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,t);return v(i)||(i=f(t,i,n)),i}var o=function(t,e){if(y(e))return t.stylize("undefined","undefined");if(v(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(g(e))return t.stylize(""+e,"number");if(p(e))return t.stylize(""+e,"boolean");if(m(e))return t.stylize("null","null")}(t,r);if(o)return o;var a=Object.keys(r),s=function(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(r)),k(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return l(r);if(0===a.length){if(S(r)){var u=r.name?": "+r.name:"";return t.stylize("[Function"+u+"]","special")}if(b(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(_(r))return t.stylize(Date.prototype.toString.call(r),"date");if(k(r))return l(r)}var c,w="",E=!1,x=["{","}"];(d(r)&&(E=!0,x=["[","]"]),S(r))&&(w=" [Function"+(r.name?": "+r.name:"")+"]");return b(r)&&(w=" "+RegExp.prototype.toString.call(r)),_(r)&&(w=" "+Date.prototype.toUTCString.call(r)),k(r)&&(w=" "+l(r)),0!==a.length||E&&0!=r.length?n<0?b(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),c=E?function(t,e,r,n,i){for(var o=[],a=0,s=e.length;a=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60)return r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1];return r[0]+e+" "+t.join(", ")+" "+r[1]}(c,w,x)):x[0]+w+x[1]}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function h(t,e,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?s=u.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):u.set&&(s=t.stylize("[Setter]","special")),A(n,i)||(a="["+i+"]"),s||(t.seen.indexOf(u.value)<0?(s=m(r)?f(t,u.value,null):f(t,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(t){return" "+t}).join("\n").substr(2):"\n"+s.split("\n").map(function(t){return" "+t}).join("\n")):s=t.stylize("[Circular]","special")),y(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=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function d(t){return Array.isArray(t)}function p(t){return"boolean"==typeof t}function m(t){return null===t}function g(t){return"number"==typeof t}function v(t){return"string"==typeof t}function y(t){return void 0===t}function b(t){return w(t)&&"[object RegExp]"===E(t)}function w(t){return"object"==typeof t&&null!==t}function _(t){return w(t)&&"[object Date]"===E(t)}function k(t){return w(t)&&("[object Error]"===E(t)||t instanceof Error)}function S(t){return"function"==typeof t}function E(t){return Object.prototype.toString.call(t)}function x(t){return t<10?"0"+t.toString(10):t.toString(10)}e.debuglog=function(t){if(y(o)&&(o=n.env.NODE_DEBUG||""),t=t.toUpperCase(),!a[t])if(new RegExp("\\b"+t+"\\b","i").test(o)){var r=n.pid;a[t]=function(){var n=e.format.apply(e,arguments);console.error("%s %d: %s",t,r,n)}}else a[t]=function(){};return a[t]},e.inspect=s,s.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]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=d,e.isBoolean=p,e.isNull=m,e.isNullOrUndefined=function(t){return null==t},e.isNumber=g,e.isString=v,e.isSymbol=function(t){return"symbol"==typeof t},e.isUndefined=y,e.isRegExp=b,e.isObject=w,e.isDate=_,e.isError=k,e.isFunction=S,e.isPrimitive=function(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||void 0===t},e.isBuffer=r(607);var M=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function A(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.log=function(){console.log("%s - %s",function(){var t=new Date,e=[x(t.getHours()),x(t.getMinutes()),x(t.getSeconds())].join(":");return[t.getDate(),M[t.getMonth()],e].join(" ")}(),e.format.apply(e,arguments))},e.inherits=r(2),e._extend=function(t,e){if(!e||!w(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}}).call(this,r(7),r(9))},function(t,e,r){t.exports=r(850)},function(t,e,r){var n=r(30),i=r(66);t.exports=r(38)?function(t,e,r){return n.f(t,e,i(1,r))}:function(t,e,r){return t[e]=r,t}},function(t,e){var r={}.hasOwnProperty;t.exports=function(t,e){return r.call(t,e)}},function(t,e,r){"use strict";var n=r(394),i=r(430);t.exports={packageInit:function(t,e){if(e=Array.prototype.slice.call(e),!t)throw new Error('You need to instantiate using the "new" keyword.');Object.defineProperty(t,"currentProvider",{get:function(){return t._provider},set:function(e){return t.setProvider(e)},enumerable:!0,configurable:!0}),e[0]&&e[0]._requestManager?t._requestManager=new n.Manager(e[0].currentProvider):(t._requestManager=new n.Manager,t._requestManager.setProvider(e[0],e[1])),t.givenProvider=n.Manager.givenProvider,t.providers=n.Manager.providers,t._provider=t._requestManager.provider,t.setProvider||(t.setProvider=function(e,r){return t._requestManager.setProvider(e,r),t._provider=t._requestManager.provider,!0}),t.BatchRequest=n.BatchManager.bind(null,t._requestManager),t.extend=i(t)},addProviders:function(t){t.givenProvider=n.Manager.givenProvider,t.providers=n.Manager.providers}}},function(t,e,r){"use strict";var n=r(431),i=r(15).errors,o=r(15).formatters,a=r(22),s=r(217),u=r(98).subscriptions,c=function(t){if(!t.call||!t.name)throw new Error('When creating a method you need to provide at least the "name" and "call" property.');this.name=t.name,this.call=t.call,this.params=t.params||0,this.inputFormatter=t.inputFormatter,this.outputFormatter=t.outputFormatter,this.transformPayload=t.transformPayload,this.extraFormatters=t.extraFormatters,this.requestManager=t.requestManager,this.accounts=t.accounts,this.defaultBlock=t.defaultBlock||"latest",this.defaultAccount=t.defaultAccount||null};c.prototype.setRequestManager=function(t,e){this.requestManager=t,e&&(this.accounts=e)},c.prototype.createFunction=function(t,e){var r=this.buildCall();return r.call=this.call,this.setRequestManager(t||this.requestManager,e||this.accounts),r},c.prototype.attachToObject=function(t){var e=this.buildCall();e.call=this.call;var r=this.name.split(".");r.length>1?(t[r[0]]=t[r[0]]||{},t[r[0]][r[1]]=e):t[r[0]]=e},c.prototype.getCall=function(t){return n.isFunction(this.call)?this.call(t):this.call},c.prototype.extractCallback=function(t){if(n.isFunction(t[t.length-1]))return t.pop()},c.prototype.validateArgs=function(t){if(t.length!==this.params)throw i.InvalidNumberOfParams(t.length,this.params,this.name)},c.prototype.formatInput=function(t){var e=this;return this.inputFormatter?this.inputFormatter.map(function(r,n){return r?r.call(e,t[n]):t[n]}):t},c.prototype.formatOutput=function(t){var e=this;return n.isArray(t)?t.map(function(t){return e.outputFormatter&&t?e.outputFormatter(t):t}):this.outputFormatter&&t?this.outputFormatter(t):t},c.prototype.toPayload=function(t){var e=this.getCall(t),r=this.extractCallback(t),n=this.formatInput(t);this.validateArgs(n);var i={method:e,params:n,callback:r};return this.transformPayload&&(i=this.transformPayload(i)),i},c.prototype._confirmTransaction=function(t,e,r){var i=this,f=!1,l=!0,h=0,d=0,p=null,m=n.isObject(r.params[0])&&r.params[0].gas?r.params[0].gas:null,g=n.isObject(r.params[0])&&r.params[0].data&&r.params[0].from&&!r.params[0].to,v=[new c({name:"getTransactionReceipt",call:"eth_getTransactionReceipt",params:1,inputFormatter:[null],outputFormatter:o.outputTransactionReceiptFormatter}),new c({name:"getCode",call:"eth_getCode",params:2,inputFormatter:[o.inputAddressFormatter,o.inputDefaultBlockNumberFormatter]}),new u({name:"subscribe",type:"eth",subscriptions:{newBlockHeaders:{subscriptionName:"newHeads",params:0,outputFormatter:o.outputBlockFormatter}}})],y={};n.each(v,function(t){t.attachToObject(y),t.requestManager=i.requestManager});var b=function(r,n,o,u,c){if(!o)return c||(c={unsubscribe:function(){clearInterval(p)}}),(r?s.resolve(r):y.getTransactionReceipt(e)).catch(function(e){c.unsubscribe(),f=!0,a._fireError({message:"Failed to check for transaction receipt:",data:e},t.eventEmitter,t.reject)}).then(function(e){if(!e||!e.blockHash)throw new Error("Receipt missing or blockHash null");return i.extraFormatters&&i.extraFormatters.receiptFormatter&&(e=i.extraFormatters.receiptFormatter(e)),t.eventEmitter.listeners("confirmation").length>0&&(void 0!==r&&0===d||t.eventEmitter.emit("confirmation",d,e),l=!1,25===++d&&(c.unsubscribe(),t.eventEmitter.removeAllListeners())),e}).then(function(e){if(g&&!f){if(!e.contractAddress)return l&&(c.unsubscribe(),f=!0),void a._fireError(new Error("The transaction receipt didn't contain a contract address."),t.eventEmitter,t.reject);y.getCode(e.contractAddress,function(r,n){n&&(n.length>2?(t.eventEmitter.emit("receipt",e),i.extraFormatters&&i.extraFormatters.contractDeployFormatter?t.resolve(i.extraFormatters.contractDeployFormatter(e)):t.resolve(e),l&&t.eventEmitter.removeAllListeners()):a._fireError(new Error("The contract code couldn't be stored, please check your gas limit."),t.eventEmitter,t.reject),l&&c.unsubscribe(),f=!0)})}return e}).then(function(e){g||f||(e.outOfGas||m&&m===e.gasUsed||!0!==e.status&&"0x1"!==e.status&&void 0!==e.status?(e&&(e=JSON.stringify(e,null,2)),!1===e.status||"0x0"===e.status?a._fireError(new Error("Transaction has been reverted by the EVM:\n"+e),t.eventEmitter,t.reject):a._fireError(new Error("Transaction ran out of gas. Please provide more gas:\n"+e),t.eventEmitter,t.reject)):(t.eventEmitter.emit("receipt",e),t.resolve(e),l&&t.eventEmitter.removeAllListeners()),l&&c.unsubscribe(),f=!0)}).catch(function(){h++,n?h-1>=750&&(c.unsubscribe(),f=!0,a._fireError(new Error("Transaction was not mined within750 seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!"),t.eventEmitter,t.reject)):h-1>=50&&(c.unsubscribe(),f=!0,a._fireError(new Error("Transaction was not mined within 50 blocks, please make sure your transaction was properly sent. Be aware that it might still be mined!"),t.eventEmitter,t.reject))});c.unsubscribe(),f=!0,a._fireError({message:"Failed to subscribe to new newBlockHeaders to confirm the transaction receipts.",data:o},t.eventEmitter,t.reject)},w=function(t){n.isFunction(this.requestManager.provider.on)?y.subscribe("newBlockHeaders",b.bind(null,t,!1)):p=setInterval(b.bind(null,t,!0),1e3)}.bind(this);y.getTransactionReceipt(e).then(function(e){e&&e.blockHash?(t.eventEmitter.listeners("confirmation").length>0&&w(e),b(e,!1)):f||w()}).catch(function(){f||w()})};var f=function(t,e){return n.isNumber(t)?e.wallet[t]:n.isObject(t)&&t.address&&t.privateKey?t:e.wallet[t.toLowerCase()]};c.prototype.buildCall=function(){var t=this,e="eth_sendTransaction"===t.call||"eth_sendRawTransaction"===t.call,r=function(){var r=s(!e),i=t.toPayload(Array.prototype.slice.call(arguments)),o=function(n,o){try{o=t.formatOutput(o)}catch(t){n=t}if(o instanceof Error&&(n=o),n)return n.error&&(n=n.error),a._fireError(n,r.eventEmitter,r.reject,i.callback);i.callback&&i.callback(null,o),e?(r.eventEmitter.emit("transactionHash",o),t._confirmTransaction(r,o,i)):n||r.resolve(o)},u=function(e){var r=n.extend({},i,{method:"eth_sendRawTransaction",params:[e.rawTransaction]});t.requestManager.send(r,o)},l=function(t,e){var i;if(e&&e.accounts&&e.accounts.wallet&&e.accounts.wallet.length)if("eth_sendTransaction"===t.method){var a=t.params[0];if((i=f(n.isObject(a)?a.from:null,e.accounts))&&i.privateKey)return e.accounts.signTransaction(n.omit(a,"from"),i.privateKey).then(u)}else if("eth_sign"===t.method){var s=t.params[1];if((i=f(t.params[0],e.accounts))&&i.privateKey){var c=e.accounts.sign(s,i.privateKey);return t.callback&&t.callback(null,c.signature),void r.resolve(c.signature)}}return e.requestManager.send(t,o)};e&&n.isObject(i.params[0])&&!i.params[0].gasPrice?new c({name:"getGasPrice",call:"eth_gasPrice",params:0}).createFunction(t.requestManager)(function(e,r){r&&(i.params[0].gasPrice=r),l(i,t)}):l(i,t);return r.eventEmitter};return r.method=t,r.request=this.request.bind(this),r},c.prototype.request=function(){var t=this.toPayload(Array.prototype.slice.call(arguments));return t.format=this.formatOutput.bind(this),t},t.exports=c},function(t,e,r){var n=r(28),i=r(223),o=function(t){this._inputFormatter=t.inputFormatter,this._outputFormatter=t.outputFormatter};o.prototype.isType=function(t){throw"This method should be overwritten for type "+t},o.prototype.staticPartLength=function(t){return(this.nestedTypes(t)||["[1]"]).map(function(t){return parseInt(t.slice(1,-1),10)||1}).reduce(function(t,e){return t*e},32)},o.prototype.isDynamicArray=function(t){var e=this.nestedTypes(t);return!!e&&!e[e.length-1].match(/[0-9]{1,}/g)},o.prototype.isStaticArray=function(t){var e=this.nestedTypes(t);return!!e&&!!e[e.length-1].match(/[0-9]{1,}/g)},o.prototype.staticArrayLength=function(t){var e=this.nestedTypes(t);return e?parseInt(e[e.length-1].match(/[0-9]{1,}/g)||1):1},o.prototype.nestedName=function(t){var e=this.nestedTypes(t);return e?t.substr(0,t.length-e[e.length-1].length):t},o.prototype.isDynamicType=function(){return!1},o.prototype.nestedTypes=function(t){return t.match(/(\[[0-9]*\])/g)},o.prototype.encode=function(t,e){var r=this;return this.isDynamicArray(e)?function(){var i=t.length,o=r.nestedName(e),a=[];return a.push(n.formatInputInt(i).encode()),t.forEach(function(t){a.push(r.encode(t,o))}),a}():this.isStaticArray(e)?function(){for(var n=r.staticArrayLength(e),i=r.nestedName(e),o=[],a=0;a0,function(e){t||(t=e),e&&n.forEach(c),a||(n.forEach(c),r(t))})});return e.reduce(f)}},function(t,e,r){"use strict";(function(e){const n=r(629),i=r(33),o=r(32),a=/^https?:\/\/[^/]+\/(ip(f|n)s)\/((\w+).*)/,s=/^\/(ip(f|n)s)\/((\w+).*)/;function u(t){try{return o.isCID(new o(t))}catch(t){return!1}}function c(t,e){const r=l(t);if(!r)return!1;const n=r.match(e);return!!n&&("ipfs"===n[1]&&u(n[4]))}function f(t,e){const r=l(t);if(!r)return!1;const n=r.match(e);return!!n&&"ipns"===n[1]}function l(t){return e.isBuffer(t)?n.encode(t):"string"==typeof t&&t}t.exports={multihash:function(t){const r=l(t);try{const t=new e(n.decode(r));return i.decode(t),!0}catch(t){return!1}},cid:u,ipfsUrl:t=>c(t,a),ipnsUrl:t=>f(t,a),url:t=>c(t,a)||f(t,a),urlPattern:a,ipfsPath:t=>c(t,s),ipnsPath:t=>f(t,s),path:t=>c(t,s)||f(t,s),pathPattern:s,urlOrPath:t=>c(t,a)||f(t,a)||c(t,s)||f(t,s)}}).call(this,r(0).Buffer)},function(t,e,r){"use strict";(function(n){const i=r(33),o=r(112);(e=t.exports=class{constructor(t,e,r){o(r,"A link requires a multihash to point to"),this._name=t,this._size=e,"string"==typeof r?this._multihash=i.fromB58String(r):n.isBuffer(r)&&(this._multihash=r)}toString(){return`DAGLink <${i.toB58String(this.multihash)} - name: "${this.name}", size: ${this.size}>`}toJSON(){return{name:this.name,size:this.size,multihash:i.toB58String(this._multihash)}}get name(){return this._name}set name(t){throw new Error("Can't set property: 'name' is immutable")}get size(){return this._size}set size(t){throw new Error("Can't set property: 'size' is immutable")}get multihash(){return this._multihash}set multihash(t){throw new Error("Can't set property: 'multihash' is immutable")}}).create=r(740),e.util=r(741)}).call(this,r(0).Buffer)},function(t,e,r){var n=r(5);function i(t,e){n.cipher.registerAlgorithm(t,function(){return new n.aes.Algorithm(t,e)})}r(178),r(312),r(6),t.exports=n.aes=n.aes||{},n.aes.startEncrypting=function(t,e,r,n){var i=m({key:t,output:r,decrypt:!1,mode:n});return i.start(e),i},n.aes.createEncryptionCipher=function(t,e){return m({key:t,output:null,decrypt:!1,mode:e})},n.aes.startDecrypting=function(t,e,r,n){var i=m({key:t,output:r,decrypt:!0,mode:n});return i.start(e),i},n.aes.createDecryptionCipher=function(t,e){return m({key:t,output:null,decrypt:!0,mode:e})},n.aes.Algorithm=function(t,e){f||h();var r=this;r.name=t,r.mode=new e({blockSize:16,cipher:{encrypt:function(t,e){return p(r._w,t,e,!1)},decrypt:function(t,e){return p(r._w,t,e,!0)}}}),r._init=!1},n.aes.Algorithm.prototype.initialize=function(t){if(!this._init){var e,r=t.key;if("string"!=typeof r||16!==r.length&&24!==r.length&&32!==r.length){if(n.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){e=r,r=n.util.createBuffer();for(var i=0;i>>=2;for(i=0;i>8^255&l^99,o[m]=l,a[l]=m,d=(h=t[l])<<24^l<<16^l<<8^l^h,p=((r=t[m])^(n=t[r])^(i=t[n]))<<24^(m^i)<<16^(m^n^i)<<8^m^r^i;for(var v=0;v<4;++v)u[v][m]=d,c[v][l]=p,d=d<<24|d>>>8,p=p<<24|p>>>8;0===m?m=g=1:(m=r^t[t[t[r^i]]],g^=t[t[g]])}}function d(t,e){for(var r,n=t.slice(0),i=1,a=n.length,u=l*(a+6+1),f=a;f>>16&255]<<24^o[r>>>8&255]<<16^o[255&r]<<8^o[r>>>24]^s[i]<<24,i++):a>6&&f%a==4&&(r=o[r>>>24]<<24^o[r>>>16&255]<<16^o[r>>>8&255]<<8^o[255&r]),n[f]=n[f-a]^r;if(e){for(var h,d=c[0],p=c[1],m=c[2],g=c[3],v=n.slice(0),y=(f=0,(u=n.length)-l);f>>24]]^p[o[h>>>16&255]]^m[o[h>>>8&255]]^g[o[255&h]];n=v}return n}function p(t,e,r,n){var i,s,f,l,h,d,p,m,g,v,y,b,w=t.length/4-1;n?(i=c[0],s=c[1],f=c[2],l=c[3],h=a):(i=u[0],s=u[1],f=u[2],l=u[3],h=o),d=e[0]^t[0],p=e[n?3:1]^t[1],m=e[2]^t[2],g=e[n?1:3]^t[3];for(var _=3,k=1;k>>24]^s[p>>>16&255]^f[m>>>8&255]^l[255&g]^t[++_],y=i[p>>>24]^s[m>>>16&255]^f[g>>>8&255]^l[255&d]^t[++_],b=i[m>>>24]^s[g>>>16&255]^f[d>>>8&255]^l[255&p]^t[++_],g=i[g>>>24]^s[d>>>16&255]^f[p>>>8&255]^l[255&m]^t[++_],d=v,p=y,m=b;r[0]=h[d>>>24]<<24^h[p>>>16&255]<<16^h[m>>>8&255]<<8^h[255&g]^t[++_],r[n?3:1]=h[p>>>24]<<24^h[m>>>16&255]<<16^h[g>>>8&255]<<8^h[255&d]^t[++_],r[2]=h[m>>>24]<<24^h[g>>>16&255]<<16^h[d>>>8&255]<<8^h[255&p]^t[++_],r[n?1:3]=h[g>>>24]<<24^h[d>>>16&255]<<16^h[p>>>8&255]<<8^h[255&m]^t[++_]}function m(t){var e,r="AES-"+((t=t||{}).mode||"CBC").toUpperCase(),i=(e=t.decrypt?n.cipher.createDecipher(r,t.key):n.cipher.createCipher(r,t.key)).start;return e.start=function(t,r){var o=null;r instanceof n.util.ByteBuffer&&(o=r,r={}),(r=r||{}).output=o,r.iv=t,i.call(e,r)},e}},function(t,e,r){var n=r(5);n.pki=n.pki||{};var i=t.exports=n.pki.oids=n.oids=n.oids||{};function o(t,e){i[t]=e,i[e]=t}function a(t,e){i[t]=e}o("1.2.840.113549.1.1.1","rsaEncryption"),o("1.2.840.113549.1.1.4","md5WithRSAEncryption"),o("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),o("1.2.840.113549.1.1.7","RSAES-OAEP"),o("1.2.840.113549.1.1.8","mgf1"),o("1.2.840.113549.1.1.9","pSpecified"),o("1.2.840.113549.1.1.10","RSASSA-PSS"),o("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),o("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),o("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),o("1.2.840.10040.4.3","dsa-with-sha1"),o("1.3.14.3.2.7","desCBC"),o("1.3.14.3.2.26","sha1"),o("2.16.840.1.101.3.4.2.1","sha256"),o("2.16.840.1.101.3.4.2.2","sha384"),o("2.16.840.1.101.3.4.2.3","sha512"),o("1.2.840.113549.2.5","md5"),o("1.2.840.113549.1.7.1","data"),o("1.2.840.113549.1.7.2","signedData"),o("1.2.840.113549.1.7.3","envelopedData"),o("1.2.840.113549.1.7.4","signedAndEnvelopedData"),o("1.2.840.113549.1.7.5","digestedData"),o("1.2.840.113549.1.7.6","encryptedData"),o("1.2.840.113549.1.9.1","emailAddress"),o("1.2.840.113549.1.9.2","unstructuredName"),o("1.2.840.113549.1.9.3","contentType"),o("1.2.840.113549.1.9.4","messageDigest"),o("1.2.840.113549.1.9.5","signingTime"),o("1.2.840.113549.1.9.6","counterSignature"),o("1.2.840.113549.1.9.7","challengePassword"),o("1.2.840.113549.1.9.8","unstructuredAddress"),o("1.2.840.113549.1.9.14","extensionRequest"),o("1.2.840.113549.1.9.20","friendlyName"),o("1.2.840.113549.1.9.21","localKeyId"),o("1.2.840.113549.1.9.22.1","x509Certificate"),o("1.2.840.113549.1.12.10.1.1","keyBag"),o("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),o("1.2.840.113549.1.12.10.1.3","certBag"),o("1.2.840.113549.1.12.10.1.4","crlBag"),o("1.2.840.113549.1.12.10.1.5","secretBag"),o("1.2.840.113549.1.12.10.1.6","safeContentsBag"),o("1.2.840.113549.1.5.13","pkcs5PBES2"),o("1.2.840.113549.1.5.12","pkcs5PBKDF2"),o("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),o("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),o("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),o("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),o("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),o("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),o("1.2.840.113549.2.7","hmacWithSHA1"),o("1.2.840.113549.2.8","hmacWithSHA224"),o("1.2.840.113549.2.9","hmacWithSHA256"),o("1.2.840.113549.2.10","hmacWithSHA384"),o("1.2.840.113549.2.11","hmacWithSHA512"),o("1.2.840.113549.3.7","des-EDE3-CBC"),o("2.16.840.1.101.3.4.1.2","aes128-CBC"),o("2.16.840.1.101.3.4.1.22","aes192-CBC"),o("2.16.840.1.101.3.4.1.42","aes256-CBC"),o("2.5.4.3","commonName"),o("2.5.4.5","serialName"),o("2.5.4.6","countryName"),o("2.5.4.7","localityName"),o("2.5.4.8","stateOrProvinceName"),o("2.5.4.10","organizationName"),o("2.5.4.11","organizationalUnitName"),o("2.16.840.1.113730.1.1","nsCertType"),a("2.5.29.1","authorityKeyIdentifier"),a("2.5.29.2","keyAttributes"),a("2.5.29.3","certificatePolicies"),a("2.5.29.4","keyUsageRestriction"),a("2.5.29.5","policyMapping"),a("2.5.29.6","subtreesConstraint"),a("2.5.29.7","subjectAltName"),a("2.5.29.8","issuerAltName"),a("2.5.29.9","subjectDirectoryAttributes"),a("2.5.29.10","basicConstraints"),a("2.5.29.11","nameConstraints"),a("2.5.29.12","policyConstraints"),a("2.5.29.13","basicConstraints"),o("2.5.29.14","subjectKeyIdentifier"),o("2.5.29.15","keyUsage"),a("2.5.29.16","privateKeyUsagePeriod"),o("2.5.29.17","subjectAltName"),o("2.5.29.18","issuerAltName"),o("2.5.29.19","basicConstraints"),a("2.5.29.20","cRLNumber"),a("2.5.29.21","cRLReason"),a("2.5.29.22","expirationDate"),a("2.5.29.23","instructionCode"),a("2.5.29.24","invalidityDate"),a("2.5.29.25","cRLDistributionPoints"),a("2.5.29.26","issuingDistributionPoint"),a("2.5.29.27","deltaCRLIndicator"),a("2.5.29.28","issuingDistributionPoint"),a("2.5.29.29","certificateIssuer"),a("2.5.29.30","nameConstraints"),o("2.5.29.31","cRLDistributionPoints"),o("2.5.29.32","certificatePolicies"),a("2.5.29.33","policyMappings"),a("2.5.29.34","policyConstraints"),o("2.5.29.35","authorityKeyIdentifier"),a("2.5.29.36","policyConstraints"),o("2.5.29.37","extKeyUsage"),a("2.5.29.46","freshestCRL"),a("2.5.29.54","inhibitAnyPolicy"),o("1.3.6.1.4.1.11129.2.4.2","timestampList"),o("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),o("1.3.6.1.5.5.7.3.1","serverAuth"),o("1.3.6.1.5.5.7.3.2","clientAuth"),o("1.3.6.1.5.5.7.3.3","codeSigning"),o("1.3.6.1.5.5.7.3.4","emailProtection"),o("1.3.6.1.5.5.7.3.8","timeStamping")},function(t,e,r){var n=r(93);t.exports=function(t,e,r){if(n(t),void 0===e)return t;switch(r){case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,i){return t.call(e,r,n,i)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,r){var n=r(193),i=r(129);t.exports=function(t){return n(i(t))}},function(t,e,r){"use strict";(function(e,n){var i=r(3).Buffer,o=e.crypto||e.msCrypto;o&&o.getRandomValues?t.exports=function(t,r){if(t>65536)throw new Error("requested too many random bytes");var a=new e.Uint8Array(t);t>0&&o.getRandomValues(a);var s=i.from(a.buffer);if("function"==typeof r)return n.nextTick(function(){r(null,s)});return s}:t.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this,r(7),r(9))},function(t,e,r){"use strict";var n=r(2),i=r(142),o=r(144),a=r(145),s=r(39);function u(t){s.call(this,"digest"),this._hash=t}n(u,s),u.prototype._update=function(t){this._hash.update(t)},u.prototype._final=function(){return this._hash.digest()},t.exports=function(t){return"md5"===(t=t.toLowerCase())?new i:"rmd160"===t||"ripemd160"===t?new o:new u(a(t))}},function(t,e,r){(function(t){var n=void 0!==t&&t||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(t,e){this._id=t,this._clearFn=e}e.setTimeout=function(){return new o(i.call(setTimeout,n,arguments),clearTimeout)},e.setInterval=function(){return new o(i.call(setInterval,n,arguments),clearInterval)},e.clearTimeout=e.clearInterval=function(t){t&&t.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},e.enroll=function(t,e){clearTimeout(t._idleTimeoutId),t._idleTimeout=e},e.unenroll=function(t){clearTimeout(t._idleTimeoutId),t._idleTimeout=-1},e._unrefActive=e.active=function(t){clearTimeout(t._idleTimeoutId);var e=t._idleTimeout;e>=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},r(456),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,r(7))},function(t,e,r){var n=r(3).Buffer;function i(t,e){this._block=n.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}i.prototype.update=function(t,e){"string"==typeof t&&(e=e||"utf8",t=n.from(t,e));for(var r=this._block,i=this._blockSize,o=t.length,a=this._len,s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,i=(r-n)/4294967296;this._block.writeUInt32BE(i,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=i},function(t,e,r){"use strict";(function(e){const n=r(152),i=r(78),o=r(563),a=r(153),s=r(23),u=r(265),c=new Error("Sorry, Not Implemented Yet.");function f(t){if(!(this instanceof f))return new f(t);if(null==t&&(t=""),t instanceof e)this.buffer=o.fromBuffer(t);else if("string"==typeof t||t instanceof String)this.buffer=o.fromString(t);else{if(!(t.buffer&&t.protos&&t.protoCodes))throw new Error("addr must be a string, Buffer, or another Multiaddr");this.buffer=o.fromBuffer(t.buffer)}}t.exports=f,f.prototype.toString=function(){return o.bufferToString(this.buffer)},f.prototype.toOptions=function(){const t={},e=this.toString().split("/");return t.family="ip4"===e[1]?"ipv4":"ipv6",t.host=e[2],t.transport=e[3],t.port=e[4],t},f.prototype.inspect=function(){return""},f.prototype.protos=function(){return n(this.protoCodes(),function(t){return i(a(t))})},f.prototype.protoCodes=function(){const t=[],e=this.buffer;let r=0;for(;r{if(t[0]===a.names.ipfs.code)return!0})[0][1],u.decode(t)}catch(e){t=null}return t},f.prototype.equals=function(t){return this.buffer.equals(t.buffer)},f.prototype.nodeAddress=function(){if(!this.isThinWaistAddress())throw new Error('Multiaddr must be "thin waist" address for nodeAddress.');const t=this.protoCodes(),e=this.toString().split("/").slice(1);return{family:41===t[0]?"IPv6":"IPv4",address:e[1],port:e[3]}},f.fromNodeAddress=function(t,e){if(!t)throw new Error("requires node address object");if(!e)throw new Error("requires transport protocol");return f("/"+["IPv6"===t.family?"ip6":"ip4",t.address,e,t.port].join("/"))},f.prototype.isThinWaistAddress=function(t){const e=(t||this).protos();return 2===e.length&&((4===e[0].code||41===e[0].code)&&(6===e[1].code||17===e[1].code))},f.prototype.fromStupidString=function(t){throw c},f.protocols=a,f.isMultiaddr=function(t){return t.constructor&&t.constructor.name?"Multiaddr"===t.constructor.name:Boolean(t.fromStupidString&&t.protos)},f.isName=function(t){return!!f.isMultiaddr(t)&&t.protos().some(t=>t.resolvable)},f.resolve=function(t,e){return f.isMultiaddr(t)&&f.isName(t)?e(new Error("not implemented yet")):e(new Error("not a valid name"))}}).call(this,r(0).Buffer)},function(t,e,r){"use strict";(function(e){const n=r(82),i=r(32);t.exports=function(t){if(e.isBuffer(t)&&(t=n.encode(t)),"string"!=typeof t)throw new Error("unexpected cid type: "+typeof t);return i.validateCID(new i(t.split("/")[0])),t}}).call(this,r(0).Buffer)},function(t,e,r){"use strict";(function(e){const n=r(82),i=r(49);t.exports=function(t){if(e.isBuffer(t)&&(t=n.encode(t)),"string"!=typeof t)throw new Error("unexpected multihash type: "+typeof t);if(!i.multihash(t.split("/")[0]))throw new Error("not valid multihash");return t}}).call(this,r(0).Buffer)},function(t,e,r){var n=r(5);r(6);var i=t.exports=n.pem=n.pem||{};function o(t){for(var e=t.name+": ",r=[],n=function(t,e){return" "+e},i=0;i65&&-1!==a){var s=e[a];","===s?(++a,e=e.substr(0,a)+"\r\n "+e.substr(a)):e=e.substr(0,a)+"\r\n"+s+e.substr(a+1),o=i-a-1,a=-1,++i}else" "!==e[i]&&"\t"!==e[i]&&","!==e[i]||(a=i);return e}function a(t){return t.replace(/^\s+/,"")}i.encode=function(t,e){e=e||{};var r,i="-----BEGIN "+t.type+"-----\r\n";if(t.procType&&(i+=o(r={name:"Proc-Type",values:[String(t.procType.version),t.procType.type]})),t.contentDomain&&(i+=o(r={name:"Content-Domain",values:[t.contentDomain]})),t.dekInfo&&(r={name:"DEK-Info",values:[t.dekInfo.algorithm]},t.dekInfo.parameters&&r.values.push(t.dekInfo.parameters),i+=o(r)),t.headers)for(var a=0;a>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function f(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function l(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function h(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return i>0&&(t.lastNeed=i-1),i;if(--n=0)return i>0&&(t.lastNeed=i-2),i;if(--n=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,r){(function(e){t.exports=function(t,r){for(var n=Math.min(t.length,r.length),i=new e(n),o=0;o=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=n.join32(t,0,t.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=t>>>16&255,n[i++]=t>>>8&255,n[i++]=255&t}else for(n[i++]=255&t,n[i++]=t>>>8&255,n[i++]=t>>>16&255,n[i++]=t>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;or=>{let f,l=!1,h=!1;r=r||{};const d=new u,p=new n({objectMode:!0});p._read=(t=>{}),p._write=((t,e,n)=>{const o=a(n);try{const n=s(t,Object.assign({},r,r.qs)).map(t=>Object.assign({headers:function(t){const e={"Content-Disposition":`file; filename="${t.path?encodeURIComponent(t.path):""}"`};return t.content?t.symlink?e["Content-Type"]="application/symlink":e["Content-Type"]="application/octet-stream":e["Content-Type"]="application/x-directory",e}(t)},t));h=!0,i(n,(t,r)=>d.write(t,e,r),t=>{if(h=!1,t)return o(t);l&&d.end(),o()})}catch(t){o(t)}}),p.once("finish",()=>{l||(l=!0,h||d.end())});const m=r.qs||{};null!=r["cid-version"]?m["cid-version"]=r["cid-version"]:null!=r.cidVersion&&(m["cid-version"]=r.cidVersion),null!=r["raw-leaves"]?m["raw-leaves"]=r["raw-leaves"]:null!=r.rawLeaves&&(m["raw-leaves"]=r.rawLeaves),null!=r.hash?m.hash=r.hash:null!=r.hashAlg&&(m.hash=r.hashAlg);const g={path:e,qs:m,args:r.args,multipart:!0,multipartBoundary:d._boundary,stream:!0,recursive:!0,progress:r.progress};return d.on("error",t=>{p.emit("error",t)}),(f=t(g,(t,e)=>{if(t)return p.emit("error",t);if(!e)return p.push(null);if(!o(e))return p.push(e),void p.push(null);e.on("error",t=>p.emit("error",t)),e.on("data",t=>{t.Bytes&&r.progress&&r.progress(t.Bytes)});const n=new c;n.once("end",()=>p.push(null)),n.on("data",t=>p.push(t)),e.pipe(n)})).on("drain",()=>d.emit("drain")),d.pipe(f),p})},function(t,e){t.exports=!1},function(t,e,r){var n=r(615);t.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},function(t,e,r){"use strict";t.exports=function(t,e){var r,n;function i(o){if(r=o,n)return i.abort();!function i(){for(var o=!0,a=!1;o;)if(a=!1,r(null,function(s,u){if(a=!0,s=s||n){if(o=!1,e)e(!0===s?null:s);else if(s&&!0!==s)throw s}else t&&!1===t(u)||n?(o=!1,r(n||!0,e||function(){})):o||i()}),!a)return void(o=!1)}()}return i.abort=function(t,e){if("function"==typeof t&&(e=t,t=!0),n=t||!0,r)return r(n,e||function(){})},i}},function(t,e){t.exports=function(t){return t&&("string"==typeof t?function(e){return e[t]}:"object"==typeof t&&"function"==typeof t.exec?function(e){var r=t.exec(e);return r&&r[0]}:t)}},function(t,e,r){"use strict";const n=r(169);t.exports=((t,e)=>{const r=n(t,e);return(t,e,n)=>{r(t,e,(t,e)=>{if(t)return n(t);n(null,e[0])})}})},function(t,e,r){"use strict";(function(e){const n=r(1),i=r(111),o=i.DAGNode,a=i.DAGLink,s=r(82),u=r(32),c=r(116)({max:128});t.exports=(t=>n((r,n,i)=>{let f;"function"==typeof n&&(i=n,n={}),n||(n={});try{r=new u(r),f=r.toBaseEncodedString()}catch(t){return i(t)}const l=c.get(f);if(l)return i(null,l);t({path:"object/get",args:f},(t,r)=>{if(t)return i(t);const n=r.Links.map(t=>new a(t.Name,t.Size,e.from(s.decode(t.Hash))));o.create(r.Data,n,(t,e)=>{if(t)return i(t);c.set(f,e),i(null,e)})})}))}).call(this,r(0).Buffer)},function(t,e,r){"use strict";(function(e){const n=r(33),i=r(716);function o(t,e,r,i){if("function"==typeof r&&(i=r,r=void 0),!i)throw new Error("Missing callback");o.digest(t,e,r,(t,o)=>{if(t)return i(t);i(null,n.encode(o,e,r))})}t.exports=o,o.Buffer=e,o.multihash=n,o.digest=function(t,e,r,n){if("function"==typeof r&&(n=r,r=void 0),!n)throw new Error("Missing callback");let i,a=n;r&&(a=((t,e)=>{if(t)return n(t);n(null,e.slice(0,r))}));try{i=o.createHash(e)}catch(t){return a(t)}i(t,a)},o.createHash=function(t){if(t=n.coerceCode(t),!o.functions[t])throw new Error("multihash function "+t+" not yet supported");return o.functions[t]},o.functions={17:i.sha1,18:i.sha2256,19:i.sha2512,20:i.sha3512,21:i.sha3384,22:i.sha3256,23:i.sha3224,24:i.shake128,25:i.shake256,26:i.keccak224,27:i.keccak256,28:i.keccak384,29:i.keccak512,34:i.murmur3128,35:i.murmur332,86:i.dblSha2256},i.addBlake(o.functions)}).call(this,r(0).Buffer)},function(t,e,r){"use strict";(function(e){var n=r(729),i=r(733);t.exports=function(t,r){if(r||(r={}),!t)throw new Error("Pass in a .proto string or a protobuf-schema parsed object");var o="object"!=typeof t||e.isBuffer(t)?n.parse(t):t,a=function(){var t=this;i(o,r.encodings||{}).forEach(function(e){t[e.name]=function(t){if(!t)return null;var e={};return Object.keys(t).forEach(function(r){e[r]=t[r].value}),e}(e.values)||e})};return a.prototype.toString=function(){return n.stringify(o)},a.prototype.toJSON=function(){return o},new a}}).call(this,r(0).Buffer)},function(t,e,r){var n=r(5);r(35),r(6),(t.exports=n.hmac=n.hmac||{}).create=function(){var t=null,e=null,r=null,i=null,o={start:function(o,a){if(null!==o)if("string"==typeof o){if(!((o=o.toLowerCase())in n.md.algorithms))throw new Error('Unknown hash algorithm "'+o+'"');e=n.md.algorithms[o].create()}else e=o;if(null===a)a=t;else{if("string"==typeof a)a=n.util.createBuffer(a);else if(n.util.isArray(a)){var s=a;a=n.util.createBuffer();for(var u=0;ue.blockLength&&(e.start(),e.update(a.bytes()),a=e.digest()),r=n.util.createBuffer(),i=n.util.createBuffer(),c=a.length();for(u=0;u>>0,u>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=u[1],u[1]=u[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,u[0]=u[1]/4294967296>>>0;return e.putBytes(o),s(t,r,e),(e.read>2048||0===e.length())&&e.compact(),i},i.digest=function(){var a=n.util.createBuffer();a.putBytes(e.bytes());var u,c=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;a.putBytes(o.substr(0,i.blockLength-c));for(var f=8*i.fullMessageLength[0],l=0;l>>0,a.putInt32(f>>>0),f=u>>>0;a.putInt32(f);var h={h0:t.h0,h1:t.h1,h2:t.h2,h3:t.h3,h4:t.h4};s(h,r,a);var d=n.util.createBuffer();return d.putInt32(h.h0),d.putInt32(h.h1),d.putInt32(h.h2),d.putInt32(h.h3),d.putInt32(h.h4),d},i};var o=null,a=!1;function s(t,e,r){for(var n,i,o,a,s,u,c,f=r.length();f>=64;){for(i=t.h0,o=t.h1,a=t.h2,s=t.h3,u=t.h4,c=0;c<16;++c)n=r.getInt32(),e[c]=n,n=(i<<5|i>>>27)+(s^o&(a^s))+u+1518500249+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;c<20;++c)n=(n=e[c-3]^e[c-8]^e[c-14]^e[c-16])<<1|n>>>31,e[c]=n,n=(i<<5|i>>>27)+(s^o&(a^s))+u+1518500249+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;c<32;++c)n=(n=e[c-3]^e[c-8]^e[c-14]^e[c-16])<<1|n>>>31,e[c]=n,n=(i<<5|i>>>27)+(o^a^s)+u+1859775393+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;c<40;++c)n=(n=e[c-6]^e[c-16]^e[c-28]^e[c-32])<<2|n>>>30,e[c]=n,n=(i<<5|i>>>27)+(o^a^s)+u+1859775393+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;c<60;++c)n=(n=e[c-6]^e[c-16]^e[c-28]^e[c-32])<<2|n>>>30,e[c]=n,n=(i<<5|i>>>27)+(o&a|s&(o^a))+u+2400959708+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;c<80;++c)n=(n=e[c-6]^e[c-16]^e[c-28]^e[c-32])<<2|n>>>30,e[c]=n,n=(i<<5|i>>>27)+(o^a^s)+u+3395469782+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;t.h0=t.h0+i|0,t.h1=t.h1+o|0,t.h2=t.h2+a|0,t.h3=t.h3+s|0,t.h4=t.h4+u|0,f-=64}}},function(t,e,r){"use strict";const n=e;n.Reporter=r(795).Reporter,n.DecoderBuffer=r(330).DecoderBuffer,n.EncoderBuffer=r(330).EncoderBuffer,n.Node=r(796)},function(t,e,r){"use strict";var n=r(346),i=r.n(n),o=r(41),a=r.n(o),s=r(19),u=r.n(s);function c(t,e,r,n,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void r(t)}s.done?e(c):u.a.resolve(c).then(n,i)}function f(t){return function(){var e=this,r=arguments;return new u.a(function(n,i){var o=t.apply(e,r);function a(t){c(o,n,i,a,s,"next",t)}function s(t){c(o,n,i,a,s,"throw",t)}a(void 0)})}}var l=r(4),h=function(t){return function(){var e=Object(l.a)(arguments),r=e.pop();t.call(this,e,r)}};var d=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)},p=r(14);function m(t){return h(function(e,r){var n;try{n=t.apply(this,e)}catch(t){return r(t)}d(n)&&"function"==typeof n.then?n.then(function(t){g(r,null,t)},function(t){g(r,t.message?t:new Error(t))}):r(null,n)})}function g(t,e,r){try{t(e,r)}catch(t){Object(p.a)(v,t)}}function v(t){throw t}var y="function"==typeof Symbol;function b(t){return y&&"AsyncFunction"===t[Symbol.toStringTag]}var w=function(t){return b(t)?m(t):t};function _(t){return function(e){var r=Object(l.a)(arguments,1),n=h(function(r,n){var i=this;return t(e,function(t,e){w(t).apply(i,r.concat(e))},n)});return r.length?n.apply(this,r):n}}var k=r(123).a.Symbol,S=Object.prototype,E=S.hasOwnProperty,x=S.toString,M=k?k.toStringTag:void 0;var A=function(t){var e=E.call(t,M),r=t[M];try{t[M]=void 0;var n=!0}catch(t){}var i=x.call(t);return n&&(e?t[M]=r:delete t[M]),i},C=Object.prototype.toString;var T=function(t){return C.call(t)},I="[object Null]",B="[object Undefined]",N=k?k.toStringTag:void 0;var O=function(t){return null==t?void 0===t?B:I:N&&N in Object(t)?A(t):T(t)},R="[object AsyncFunction]",P="[object Function]",j="[object GeneratorFunction]",L="[object Proxy]";var D=function(t){if(!d(t))return!1;var e=O(t);return e==P||e==j||e==R||e==L},U=9007199254740991;var F=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=U};var K=function(t){return null!=t&&F(t.length)&&!D(t)},q={};var z=function(){};function V(t){return function(){if(null!==t){var e=t;t=null,e.apply(this,arguments)}}}var H="function"==typeof Symbol&&Symbol.iterator,G=function(t){return H&&t[H]&&t[H]()};var W=function(t,e){for(var r=-1,n=Array(t);++r-1&&t%1==0&&t=0?function(t,e){web3.setProvider(new Web3.providers.WebsocketProvider(t)),i(e)}(e,r):function(t,e){web3.setProvider(new Web3.providers.HttpProvider(t)),i(e)}(e,r))},function(t,i){n.web3=web3,Le(function(t,n){e.warnAboutMetamask&&web3.eth.currentProvider&&web3.eth.currentProvider.isMetaMask&&console.warn("%cNote: Embark has detected you are in the development environment and using Metamask, please make sure Metamask is connected to your local node","font-size: 2em"),n&&(web3.eth.defaultAccount=n[0]),a(t),r(t)})})})},je.execWhenReady=function(t){if(this.done)return t(this.err);this.list||(this.list=[]),this.list.push(t)},je.doFirst=function(t){var e=this;t(function(t){e.done=!0,e.err=t,e.list&&e.list.map(function(t){return t.apply(t,[e.err])})})};var De=function t(e){var r,n,i,o=this;if(this.abi=e.abi,this.address=e.address,this.gas=e.gas,this.code="0x"+e.code,this.web3=e.web3,t.checkWeb3.call(this),t.isNewWeb3(this.web3)){(i=new this.web3.eth.Contract(this.abi,this.address)).options.data=this.code,i.options.from=this.from||this.web3.eth.defaultAccount,i.abi=i.options.abi,i.address=this.address,i.gas=this.gas;var a=Pe()(i);return je.execWhenReady(function(){i.currentProvider||i.setProvider(web3.currentProvider),i.options.from=web3.eth.defaultAccount}),i._jsonInterface.forEach(function(t){if(a.indexOf(t.name)>=0)console.log(t.name+" is a reserved word and cannot be used as a contract method, property or event");else if(t.inputs){var e=t.inputs.length;"function"===t.type&&t.constant?i[t.name]=function(){Oe()(arguments||[]).slice(0,e);"function"==typeof arguments[e]?arguments[e]:"object"===Object(Be.a)(arguments[e])&&(arguments[e],arguments[e+1]);var r=i.methods[t.name],n=r.apply.apply(r,[r].concat(Array.prototype.slice.call(arguments))).call;return n.apply(n,[])}:"function"===t.type?i[t.name]=function(){var r={},n=null,o=Oe()(arguments||[]).slice(0,e);"function"==typeof arguments[e]?n=arguments[e]:"object"===Object(Be.a)(arguments[e])&&(r=arguments[e],n=arguments[e+1]);var a=i.methods[t.name],s=a.apply(a,o).send;return s.apply(s,[r,n])}:"event"===t.type&&(i[t.name]=function(e,r){var n=i.events[t.name];return n.apply(n,[e,r])})}}),i}if(i=this.web3.eth.contract(this.abi),this.eventList=[],this.abi)for(r=0;r=0?(o[t]=function(){var e=new s,r=Array.prototype.slice.call(arguments);return r.push(function(t,r){t?e.error(t):e.cb(r)}),o._originalContractObject[t].apply(o._originalContractObject[t],r),e},!0):"function"==typeof o._originalContractObject[t]&&(o[t]=function(e){var r=Array.prototype.slice.call(arguments),n=o._originalContractObject[t],i=o.abi.find(function(e){return e.name==t}),a=new u.a(function(t,e){r.push(function(r,n){if(a.tx=n,r)return e(r);"string"!=typeof n||i.constant?t(n):function r(){o.web3.eth.getTransactionReceipt(n,function(n,i){return n?e(n):null!==i?t(i):void setTimeout(r,1e3)})}()}),n.apply(n,r)});return a},!0)})};De.checkWeb3=function(){},De.isNewWeb3=function(t){var e=t||new Web3;return"string"==typeof e.version||parseInt(e.version.api.split(".")[0],10)>=1},De.prototype.deploy=function(t,e){var r,n=this,i=e||{};(r=t||[]).push({from:this.web3.eth.accounts[0],data:this.code,gas:i.gas||8e5});var o=this.web3.eth.contract(this.abi);return new u.a(function(t,e){r.push(function(r,i){r?e(r):void 0!==i.address&&t(new De({abi:n.abi,code:n.code,address:i.address}))}),o.new.apply(o,r)})},De.prototype.new=De.prototype.deploy,De.prototype.at=function(t){return new De({abi:this.abi,code:this.code,address:t})},De.prototype.send=function(t,e,r){var n,i;"object"===Object(Be.a)(e)?(n=e,i=t):(n=r||{},i=this.web3.toWei(t,e)),n.to=this.address,n.value=i,this.web3.eth.sendTransaction(n)},je.Contract=De;var Ue=je,Fe={fromAscii:function(t){var e=new Web3;return e.utils?e.utils.fromAscii(t):e.fromAscii(t)},toAscii:function(t){return(new Web3).utils.toAscii(t)},secureSend:function(t,e,r,n,i){return i=i||function(){},new u.a(function(o,a){var s,u=!1;function c(t,e){if(!u&&(t||!n||e.contractAddress)){if(f&&clearInterval(f),u=!0,i(t,e),t)return a(t);o(e)}}if("WebsocketProvider"===t.currentProvider.constructor.name)var f=setInterval(function(){s&&t.eth.getTransactionReceipt(s,function(t,e){(t||e)&&c(t,e)})},100);return e.send(r,function(t,e){if(t)return c(t);s=e}).on("receipt",function(t){n&&!t.contractAddress||c(null,t)}).then(function(e){s&&t.eth.getTransactionReceipt(s,c)}).catch(c)})}},Ke={onReady:function(t){Ue.execWhenReady(t)}};Ke.Blockchain=Ue,Ke.Storage=Ee,Ke.Names=Me,Ke.Messages=Ce,Ke.Utils=Fe,Ke.Contract=function(){throw new Error("EmbarkJS.Contract is deprecated: please use EmbarkJS.Blockchain.Contract instead")},Ke.isNewWeb3=Ue.Contract.isNewWeb3;var qe=Ke,ze=i()({},qe),Ve=ze.Contract.checkWeb3;ze.Contract.checkWeb3=function(){Ve.call(this),this.web3||"undefined"==typeof web3?this.web3||(this.web3=window.web3):this.web3=web3};e.a=ze},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e){var r=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+n).toString(36))}},function(t,e,r){var n=r(30).f,i=r(43),o=r(20)("toStringTag");t.exports=function(t,e,r){t&&!i(t=r?t:t.prototype,o)&&n(t,o,{configurable:!0,value:e})}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,r){"use strict";var n=r(420),i=r(421);function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}e.parse=b,e.resolve=function(t,e){return b(t,!1,!0).resolve(e)},e.resolveObject=function(t,e){return t?b(t,!1,!0).resolveObject(e):e},e.format=function(t){i.isString(t)&&(t=b(t));return t instanceof o?t.format():o.prototype.format.call(t)},e.Url=o;var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),f=["'"].concat(c),l=["%","/","?",";","#"].concat(f),h=["/","?","#"],d=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=r(422);function b(t,e,r){if(t&&i.isObject(t)&&t instanceof o)return t;var n=new o;return n.parse(t,e,r),n}o.prototype.parse=function(t,e,r){if(!i.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),s=-1!==o&&o127?O+="x":O+=N[R];if(!O.match(d)){var j=I.slice(0,A),L=I.slice(A+1),D=N.match(p);D&&(j.push(D[1]),L.unshift(D[2])),L.length&&(b="/"+L.join(".")+b),this.hostname=j.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),T||(this.hostname=n.toASCII(this.hostname));var U=this.port?":"+this.port:"",F=this.hostname||"";this.host=F+U,this.href+=this.host,T&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==b[0]&&(b="/"+b))}if(!m[k])for(A=0,B=f.length;A0)&&r.host.split("@"))&&(r.auth=T.shift(),r.host=r.hostname=T.shift());return r.search=t.search,r.query=t.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!S.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var x=S.slice(-1)[0],M=(r.host||t.host||S.length>1)&&("."===x||".."===x)||""===x,A=0,C=S.length;C>=0;C--)"."===(x=S[C])?S.splice(C,1):".."===x?(S.splice(C,1),A++):A&&(S.splice(C,1),A--);if(!_&&!k)for(;A--;A)S.unshift("..");!_||""===S[0]||S[0]&&"/"===S[0].charAt(0)||S.unshift(""),M&&"/"!==S.join("/").substr(-1)&&S.push("");var T,I=""===S[0]||S[0]&&"/"===S[0].charAt(0);E&&(r.hostname=r.host=I?"":S.length?S.shift():"",(T=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=T.shift(),r.host=r.hostname=T.shift()));return(_=_||r.host&&S.length)&&!I&&S.unshift(""),S.length?r.pathname=S.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var t=this.host,e=s.exec(t);e&&(":"!==(e=e[0])&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},function(t,e,r){"use strict";var n=r(435),i=function(t){this.name=t.name,this.type=t.type,this.subscriptions=t.subscriptions||{},this.requestManager=null};i.prototype.setRequestManager=function(t){this.requestManager=t},i.prototype.attachToObject=function(t){var e=this.buildCall();e.call=this.call;var r=this.name.split(".");r.length>1?(t[r[0]]=t[r[0]]||{},t[r[0]][r[1]]=e):t[r[0]]=e},i.prototype.buildCall=function(){var t=this;return function(){t.subscriptions[arguments[0]]||console.warn("Subscription "+JSON.stringify(arguments[0])+" doesn't exist. Subscribing anyway.");var e=new n({subscription:t.subscriptions[arguments[0]],requestManager:t.requestManager,type:t.type});return e.subscribe.apply(e,arguments)}},t.exports={subscriptions:i,subscription:n}},function(t,e,r){"use strict";var n=r(44),i=r(45),o=r(22),a=function(){var t=this;n.packageInit(this,arguments),[new i({name:"getId",call:"net_version",params:0,outputFormatter:o.hexToNumber}),new i({name:"isListening",call:"net_listening",params:0}),new i({name:"getPeerCount",call:"net_peerCount",params:0,outputFormatter:o.hexToNumber})].forEach(function(e){e.attachToObject(t),e.setRequestManager(t._requestManager)})};n.addProviders(a),t.exports=a},function(t,e,r){"use strict";e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=r(56),e.createHash=e.Hash=r(57),e.createHmac=e.Hmac=r(146);var n=r(466),i=Object.keys(n),o=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);e.getHashes=function(){return o};var a=r(147);e.pbkdf2=a.pbkdf2,e.pbkdf2Sync=a.pbkdf2Sync;var s=r(468);e.Cipher=s.Cipher,e.createCipher=s.createCipher,e.Cipheriv=s.Cipheriv,e.createCipheriv=s.createCipheriv,e.Decipher=s.Decipher,e.createDecipher=s.createDecipher,e.Decipheriv=s.Decipheriv,e.createDecipheriv=s.createDecipheriv,e.getCiphers=s.getCiphers,e.listCiphers=s.listCiphers;var u=r(485);e.DiffieHellmanGroup=u.DiffieHellmanGroup,e.createDiffieHellmanGroup=u.createDiffieHellmanGroup,e.getDiffieHellman=u.getDiffieHellman,e.createDiffieHellman=u.createDiffieHellman,e.DiffieHellman=u.DiffieHellman;var c=r(490);e.createSign=c.createSign,e.Sign=c.Sign,e.createVerify=c.createVerify,e.Verify=c.Verify,e.createECDH=r(527);var f=r(528);e.publicEncrypt=f.publicEncrypt,e.privateEncrypt=f.privateEncrypt,e.publicDecrypt=f.publicDecrypt,e.privateDecrypt=f.privateDecrypt;var l=r(531);e.randomFill=l.randomFill,e.randomFillSync=l.randomFillSync,e.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},function(t,e,r){t.exports=i;var n=r(102).EventEmitter;function i(){n.call(this)}r(2)(i,n),i.Readable=r(13),i.Writable=r(459),i.Duplex=r(229),i.Transform=r(230),i.PassThrough=r(460),i.Stream=i,i.prototype.pipe=function(t,e){var r=this;function i(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),t.on("drain",o),t._isStdio||e&&!1===e.end||(r.on("end",s),r.on("close",u));var a=!1;function s(){a||(a=!0,t.end())}function u(){a||(a=!0,"function"==typeof t.destroy&&t.destroy())}function c(t){if(f(),0===n.listenerCount(this,"error"))throw t}function f(){r.removeListener("data",i),t.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",c),t.removeListener("error",c),r.removeListener("end",f),r.removeListener("close",f),t.removeListener("close",f)}return r.on("error",c),t.on("error",c),r.on("end",f),r.on("close",f),t.on("close",f),t.emit("pipe",r),t}},function(t,e){function r(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function n(t){return"function"==typeof t}function i(t){return"object"==typeof t&&null!==t}function o(t){return void 0===t}t.exports=r,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._maxListeners=void 0,r.defaultMaxListeners=10,r.prototype.setMaxListeners=function(t){if(!function(t){return"number"==typeof t}(t)||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},r.prototype.emit=function(t){var e,r,a,s,u,c;if(this._events||(this._events={}),"error"===t&&(!this._events.error||i(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var f=new Error('Uncaught, unspecified "error" event. ('+e+")");throw f.context=e,f}if(o(r=this._events[t]))return!1;if(n(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),r.apply(this,s)}else if(i(r))for(s=Array.prototype.slice.call(arguments,1),a=(c=r.slice()).length,u=0;u0&&this._events[t].length>a&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},r.prototype.on=r.prototype.addListener,r.prototype.once=function(t,e){if(!n(e))throw TypeError("listener must be a function");var r=!1;function i(){this.removeListener(t,i),r||(r=!0,e.apply(this,arguments))}return i.listener=e,this.on(t,i),this},r.prototype.removeListener=function(t,e){var r,o,a,s;if(!n(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(a=(r=this._events[t]).length,o=-1,r===e||n(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(i(r)){for(s=a;s-- >0;)if(r[s]===e||r[s].listener&&r[s].listener===e){o=s;break}if(o<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(o,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},r.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(n(r=this._events[t]))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},r.prototype.listeners=function(t){return this._events&&this._events[t]?n(this._events[t])?[this._events[t]]:this._events[t].slice():[]},r.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(n(e))return 1;if(e)return e.length}return 0},r.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,r){"use strict";(function(e){!e.version||0===e.version.indexOf("v0.")||0===e.version.indexOf("v1.")&&0!==e.version.indexOf("v1.8.")?t.exports={nextTick:function(t,r,n,i){if("function"!=typeof t)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick(function(){t.call(null,r)});case 3:return e.nextTick(function(){t.call(null,r,n)});case 4:return e.nextTick(function(){t.call(null,r,n,i)});default:for(o=new Array(s-1),a=0;a>>24]^f[p>>>16&255]^l[m>>>8&255]^h[255&g]^e[v++],a=c[p>>>24]^f[m>>>16&255]^l[g>>>8&255]^h[255&d]^e[v++],s=c[m>>>24]^f[g>>>16&255]^l[d>>>8&255]^h[255&p]^e[v++],u=c[g>>>24]^f[d>>>16&255]^l[p>>>8&255]^h[255&m]^e[v++],d=o,p=a,m=s,g=u;return o=(n[d>>>24]<<24|n[p>>>16&255]<<16|n[m>>>8&255]<<8|n[255&g])^e[v++],a=(n[p>>>24]<<24|n[m>>>16&255]<<16|n[g>>>8&255]<<8|n[255&d])^e[v++],s=(n[m>>>24]<<24|n[g>>>16&255]<<16|n[d>>>8&255]<<8|n[255&p])^e[v++],u=(n[g>>>24]<<24|n[d>>>16&255]<<16|n[p>>>8&255]<<8|n[255&m])^e[v++],[o>>>=0,a>>>=0,s>>>=0,u>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],u=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var r=[],n=[],i=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,u=0;u<256;++u){var c=s^s<<1^s<<2^s<<3^s<<4;c=c>>>8^255&c^99,r[a]=c,n[c]=a;var f=t[a],l=t[f],h=t[l],d=257*t[c]^16843008*c;i[0][a]=d<<24|d>>>8,i[1][a]=d<<16|d>>>16,i[2][a]=d<<8|d>>>24,i[3][a]=d,d=16843009*h^65537*l^257*f^16843008*a,o[0][c]=d<<24|d>>>8,o[1][c]=d<<16|d>>>16,o[2][c]=d<<8|d>>>24,o[3][c]=d,0===a?a=s=1:(a=f^t[t[t[h^f]]],s^=t[t[s]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();function c(t){this._key=i(t),this._reset()}c.blockSize=16,c.keySize=32,c.prototype.blockSize=c.blockSize,c.prototype.keySize=c.keySize,c.prototype._reset=function(){for(var t=this._key,e=t.length,r=e+6,n=4*(r+1),i=[],o=0;o>>24,a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a],a^=s[o/e|0]<<24):e>6&&o%e==4&&(a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a]),i[o]=i[o-e]^a}for(var c=[],f=0;f>>24]]^u.INV_SUB_MIX[1][u.SBOX[h>>>16&255]]^u.INV_SUB_MIX[2][u.SBOX[h>>>8&255]]^u.INV_SUB_MIX[3][u.SBOX[255&h]]}this._nRounds=r,this._keySchedule=i,this._invKeySchedule=c},c.prototype.encryptBlockRaw=function(t){return a(t=i(t),this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},c.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),r=n.allocUnsafe(16);return r.writeUInt32BE(e[0],0),r.writeUInt32BE(e[1],4),r.writeUInt32BE(e[2],8),r.writeUInt32BE(e[3],12),r},c.prototype.decryptBlock=function(t){var e=(t=i(t))[1];t[1]=t[3],t[3]=e;var r=a(t,this._invKeySchedule,u.INV_SUB_MIX,u.INV_SBOX,this._nRounds),o=n.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},c.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},t.exports.AES=c},function(t,e,r){var n=r(3).Buffer,i=r(142);t.exports=function(t,e,r,o){if(n.isBuffer(t)||(t=n.from(t,"binary")),e&&(n.isBuffer(e)||(e=n.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=r/8,s=n.alloc(a),u=n.alloc(o||0),c=n.alloc(0);a>0||o>0;){var f=new i;f.update(c),f.update(t),e&&f.update(e),c=f.digest();var l=0;if(a>0){var h=s.length-a;l=Math.min(a,c.length),c.copy(s,h,0,l),a-=l}if(l0){var d=u.length-o,p=Math.min(o,c.length-l);c.copy(u,d,l,l+p),o-=p}}return c.fill(0),{key:s,iv:u}}},function(t,e,r){"use strict";var n=e;n.base=r(494),n.short=r(495),n.mont=r(496),n.edwards=r(497)},function(t,e,r){(function(e){var n=r(513),i=r(524),o=r(525),a=r(104),s=r(147);function u(t){var r;"object"!=typeof t||e.isBuffer(t)||(r=t.passphrase,t=t.key),"string"==typeof t&&(t=new e(t));var u,c,f=o(t,r),l=f.tag,h=f.data;switch(l){case"CERTIFICATE":c=n.certificate.decode(h,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(c||(c=n.PublicKey.decode(h,"der")),u=c.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPublicKey.decode(c.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return c.subjectPrivateKey=c.subjectPublicKey,{type:"ec",data:c};case"1.2.840.10040.4.1":return c.algorithm.params.pub_key=n.DSAparam.decode(c.subjectPublicKey.data,"der"),{type:"dsa",data:c.algorithm.params};default:throw new Error("unknown key id "+u)}throw new Error("unknown key type "+l);case"ENCRYPTED PRIVATE KEY":h=function(t,r){var n=t.algorithm.decrypt.kde.kdeparams.salt,o=parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(),10),u=i[t.algorithm.decrypt.cipher.algo.join(".")],c=t.algorithm.decrypt.cipher.iv,f=t.subjectPrivateKey,l=parseInt(u.split("-")[1],10)/8,h=s.pbkdf2Sync(r,n,o,l),d=a.createDecipheriv(u,h,c),p=[];return p.push(d.update(f)),p.push(d.final()),e.concat(p)}(h=n.EncryptedPrivateKey.decode(h,"der"),r);case"PRIVATE KEY":switch(u=(c=n.PrivateKey.decode(h,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPrivateKey.decode(c.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:c.algorithm.curve,privateKey:n.ECPrivateKey.decode(c.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return c.algorithm.params.priv_key=n.DSAparam.decode(c.subjectPrivateKey,"der"),{type:"dsa",params:c.algorithm.params};default:throw new Error("unknown key id "+u)}throw new Error("unknown key type "+l);case"RSA PUBLIC KEY":return n.RSAPublicKey.decode(h,"der");case"RSA PRIVATE KEY":return n.RSAPrivateKey.decode(h,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:n.DSAPrivateKey.decode(h,"der")};case"EC PRIVATE KEY":return{curve:(h=n.ECPrivateKey.decode(h,"der")).parameters.value,privateKey:h.privateKey};default:throw new Error("unknown key type "+l)}}t.exports=u,u.signature=n.signature}).call(this,r(0).Buffer)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t,e){e|=0;for(var r=Math.max(t.length-e,0),n=Array(r),i=0;i * @license MIT */ function n(t,e){if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);i=0;c--)if(f[c]!==l[c])return!1;for(c=f.length-1;c>=0;c--)if(u=f[c],!y(t[u],e[u],r,n))return!1;return!0}(t,e,r,a))}return r?t===e:t==e}function b(t){return"[object Arguments]"==Object.prototype.toString.call(t)}function w(t,e){if(!t||!e)return!1;if("[object RegExp]"==Object.prototype.toString.call(e))return e.test(t);try{if(t instanceof e)return!0}catch(t){}return!Error.isPrototypeOf(e)&&!0===e.call({},t)}function _(t,e,r,n){var i;if("function"!=typeof e)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(t){var e;try{t()}catch(t){e=t}return e}(e),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&g(i,r,"Missing expected exception"+n);var a="string"==typeof n,s=!t&&o.isError(i),u=!t&&i&&!r;if((s&&a&&w(i,r)||u)&&g(i,r,"Got unwanted exception"+n),t&&i&&r&&!w(i,r)||!t&&i)throw i}l.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=function(t){return p(m(t.actual),128)+" "+t.operator+" "+p(m(t.expected),128)}(this),this.generatedMessage=!0);var e=t.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=d(e),o=n.indexOf("\n"+i);if(o>=0){var a=n.indexOf("\n",o+1);n=n.substring(a+1)}this.stack=n}}},o.inherits(l.AssertionError,Error),l.fail=g,l.ok=v,l.equal=function(t,e,r){t!=e&&g(t,e,r,"==",l.equal)},l.notEqual=function(t,e,r){t==e&&g(t,e,r,"!=",l.notEqual)},l.deepEqual=function(t,e,r){y(t,e,!1)||g(t,e,r,"deepEqual",l.deepEqual)},l.deepStrictEqual=function(t,e,r){y(t,e,!0)||g(t,e,r,"deepStrictEqual",l.deepStrictEqual)},l.notDeepEqual=function(t,e,r){y(t,e,!1)&&g(t,e,r,"notDeepEqual",l.notDeepEqual)},l.notDeepStrictEqual=function t(e,r,n){y(e,r,!0)&&g(e,r,n,"notDeepStrictEqual",t)},l.strictEqual=function(t,e,r){t!==e&&g(t,e,r,"===",l.strictEqual)},l.notStrictEqual=function(t,e,r){t===e&&g(t,e,r,"!==",l.notStrictEqual)},l.throws=function(t,e,r){_(!0,t,e,r)},l.doesNotThrow=function(t,e,r){_(!1,t,e,r)},l.ifError=function(t){if(t)throw t};var k=Object.keys||function(t){var e=[];for(var r in t)a.call(t,r)&&e.push(r);return e}}).call(this,r(7))},function(t,e,r){"use strict";(function(e){const n=r(87),i=r(728),o=r(171).serialize,a=r(115).linkSort,s=r(170),u=r(50);t.exports=function(t,r,c,f){if("function"==typeof t?(f=t,t=void 0):"string"==typeof t&&(t=e.from(t)),"function"==typeof r&&(f=r,r=[]),"function"==typeof c&&(f=c,c=void 0),!e.isBuffer(t))return f(new Error("Passed 'data' is not a buffer or a string!"));c||(c="sha2-256");const l=r.map(t=>u.util.isDagLink(t)?t:u.util.createDagLinkFromB58EncodedHash(t)),h=i(l,a);o({data:t,links:h},(e,r)=>{if(e)return f(e);n(r,c,(e,n)=>{if(e)return f(e);const i=new s(t,h,r,n);f(null,i)})})}}).call(this,r(0).Buffer)},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(t){return t&&t.__esModule?t:{default:t}}(r(275));e.default=n.default,t.exports=e.default},function(t,e,r){"use strict";(function(n){const i=r(50);(e=t.exports).cloneData=function(t){let e;return t.data&&t.data.length>0?(e=n.alloc(t.data.length),t.data.copy(e)):e=n.alloc(0),e},e.cloneLinks=function(t){return t.links.slice()},e.linkSort=function(t,e){const r=n.from(t.name||""),i=n.from(e.name||"");return r.compare(i)},e.toDAGLink=function(t){return new i("",t.size,t.multihash)}}).call(this,r(0).Buffer)},function(t,e,r){"use strict";t.exports=v;var n,i=r(746),o=r(40),a=r(748),s=(n="function"==typeof Symbol?function(t){return Symbol(t)}:function(t){return"_"+t})("max"),u=n("length"),c=n("lengthCalculator"),f=n("allowStale"),l=n("maxAge"),h=n("dispose"),d=n("noDisposeOnSet"),p=n("lruList"),m=n("cache");function g(){return 1}function v(t){if(!(this instanceof v))return new v(t);"number"==typeof t&&(t={max:t}),t||(t={});var e=this[s]=t.max;(!e||"number"!=typeof e||e<=0)&&(this[s]=1/0);var r=t.length||g;"function"!=typeof r&&(r=g),this[c]=r,this[f]=t.stale||!1,this[l]=t.maxAge||0,this[h]=t.dispose,this[d]=t.noDisposeOnSet||!1,this.reset()}function y(t,e,r,n){var i=r.value;w(t,i)&&(k(t,r),t[f]||(i=void 0)),i&&e.call(n,i.value,i.key,t)}function b(t,e,r){var n=t[m].get(e);if(n){var i=n.value;w(t,i)?(k(t,n),t[f]||(i=void 0)):r&&t[p].unshiftNode(n),i&&(i=i.value)}return i}function w(t,e){if(!e||!e.maxAge&&!t[l])return!1;var r=Date.now()-e.now;return e.maxAge?r>e.maxAge:t[l]&&r>t[l]}function _(t){if(t[u]>t[s])for(var e=t[p].tail;t[u]>t[s]&&null!==e;){var r=e.prev;k(t,e),e=r}}function k(t,e){if(e){var r=e.value;t[h]&&t[h](r.key,r.value),t[u]-=r.length,t[m].delete(r.key),t[p].removeNode(e)}}Object.defineProperty(v.prototype,"max",{set:function(t){(!t||"number"!=typeof t||t<=0)&&(t=1/0),this[s]=t,_(this)},get:function(){return this[s]},enumerable:!0}),Object.defineProperty(v.prototype,"allowStale",{set:function(t){this[f]=!!t},get:function(){return this[f]},enumerable:!0}),Object.defineProperty(v.prototype,"maxAge",{set:function(t){(!t||"number"!=typeof t||t<0)&&(t=0),this[l]=t,_(this)},get:function(){return this[l]},enumerable:!0}),Object.defineProperty(v.prototype,"lengthCalculator",{set:function(t){"function"!=typeof t&&(t=g),t!==this[c]&&(this[c]=t,this[u]=0,this[p].forEach(function(t){t.length=this[c](t.value,t.key),this[u]+=t.length},this)),_(this)},get:function(){return this[c]},enumerable:!0}),Object.defineProperty(v.prototype,"length",{get:function(){return this[u]},enumerable:!0}),Object.defineProperty(v.prototype,"itemCount",{get:function(){return this[p].length},enumerable:!0}),v.prototype.rforEach=function(t,e){e=e||this;for(var r=this[p].tail;null!==r;){var n=r.prev;y(this,t,r,e),r=n}},v.prototype.forEach=function(t,e){e=e||this;for(var r=this[p].head;null!==r;){var n=r.next;y(this,t,r,e),r=n}},v.prototype.keys=function(){return this[p].toArray().map(function(t){return t.key},this)},v.prototype.values=function(){return this[p].toArray().map(function(t){return t.value},this)},v.prototype.reset=function(){this[h]&&this[p]&&this[p].length&&this[p].forEach(function(t){this[h](t.key,t.value)},this),this[m]=new i,this[p]=new a,this[u]=0},v.prototype.dump=function(){return this[p].map(function(t){if(!w(this,t))return{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}},this).toArray().filter(function(t){return t})},v.prototype.dumpLru=function(){return this[p]},v.prototype.inspect=function(t,e){var r="LRUCache {",n=!1;this[f]&&(r+="\n allowStale: true",n=!0);var i=this[s];i&&i!==1/0&&(n&&(r+=","),r+="\n max: "+o.inspect(i,e),n=!0);var a=this[l];a&&(n&&(r+=","),r+="\n maxAge: "+o.inspect(a,e),n=!0);var h=this[c];h&&h!==g&&(n&&(r+=","),r+="\n length: "+o.inspect(this[u],e),n=!0);var d=!1;return this[p].forEach(function(t){d?r+=",\n ":(n&&(r+=",\n"),d=!0,r+="\n ");var i=o.inspect(t.key).split("\n").join("\n "),s={value:t.value};t.maxAge!==a&&(s.maxAge=t.maxAge),h!==g&&(s.length=t.length),w(this,t)&&(s.stale=!0),s=o.inspect(s,e).split("\n").join("\n "),r+=i+" => "+s}),(d||n)&&(r+="\n"),r+="}"},v.prototype.set=function(t,e,r){var n=(r=r||this[l])?Date.now():0,i=this[c](e,t);if(this[m].has(t)){if(i>this[s])return k(this,this[m].get(t)),!1;var o=this[m].get(t).value;return this[h]&&(this[d]||this[h](t,o.value)),o.now=n,o.maxAge=r,o.value=e,this[u]+=i-o.length,o.length=i,this.get(t),_(this),!0}var a=new function(t,e,r,n,i){this.key=t,this.value=e,this.length=r,this.now=n,this.maxAge=i||0}(t,e,i,n,r);return a.length>this[s]?(this[h]&&this[h](t,e),!1):(this[u]+=a.length,this[p].unshift(a),this[m].set(t,this[p].head),_(this),!0)},v.prototype.has=function(t){return!!this[m].has(t)&&!w(this,this[m].get(t).value)},v.prototype.get=function(t){return b(this,t,!0)},v.prototype.peek=function(t){return b(this,t,!1)},v.prototype.pop=function(){var t=this[p].tail;return t?(k(this,t),t.value):null},v.prototype.del=function(t){k(this,this[m].get(t))},v.prototype.load=function(t){this.reset();for(var e=Date.now(),r=t.length-1;r>=0;r--){var n=t[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{var o=i-e;o>0&&this.set(n.k,n.v,o)}}},v.prototype.prune=function(){var t=this;this[m].forEach(function(e,r){b(t,r,!1)})}},function(t,e,r){var n=r(5);function i(t,e){n.cipher.registerAlgorithm(t,function(){return new n.des.Algorithm(t,e)})}r(178),r(312),r(6),t.exports=n.des=n.des||{},n.des.startEncrypting=function(t,e,r,n){var i=p({key:t,output:r,decrypt:!1,mode:n||(null===e?"ECB":"CBC")});return i.start(e),i},n.des.createEncryptionCipher=function(t,e){return p({key:t,output:null,decrypt:!1,mode:e})},n.des.startDecrypting=function(t,e,r,n){var i=p({key:t,output:r,decrypt:!0,mode:n||(null===e?"ECB":"CBC")});return i.start(e),i},n.des.createDecryptionCipher=function(t,e){return p({key:t,output:null,decrypt:!0,mode:e})},n.des.Algorithm=function(t,e){var r=this;r.name=t,r.mode=new e({blockSize:8,cipher:{encrypt:function(t,e){return d(r._keys,t,e,!1)},decrypt:function(t,e){return d(r._keys,t,e,!0)}}}),r._init=!1},n.des.Algorithm.prototype.initialize=function(t){if(!this._init){var e=n.util.createBuffer(t.key);if(0===this.name.indexOf("3DES")&&24!==e.length())throw new Error("Invalid Triple-DES key size: "+8*e.length());this._keys=function(t){for(var e,r=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],n=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],i=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],o=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],a=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],s=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],u=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],f=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],l=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],h=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],d=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],p=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],m=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],g=t.length()>8?3:1,v=[],y=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],b=0,w=0;w>>4^k))<<4,_^=e=65535&((k^=e)>>>-16^_),_^=(e=858993459&(_>>>2^(k^=e<<-16)))<<2,_^=e=65535&((k^=e)>>>-16^_),_^=(e=1431655765&(_>>>1^(k^=e<<-16)))<<1,_^=e=16711935&((k^=e)>>>8^_),e=(_^=(e=1431655765&(_>>>1^(k^=e<<8)))<<1)<<8|(k^=e)>>>20&240,_=k<<24|k<<8&16711680|k>>>8&65280|k>>>24&240,k=e;for(var S=0;S>>26,k=k<<2|k>>>26):(_=_<<1|_>>>27,k=k<<1|k>>>27);var E=r[(_&=-15)>>>28]|n[_>>>24&15]|i[_>>>20&15]|o[_>>>16&15]|a[_>>>12&15]|s[_>>>8&15]|u[_>>>4&15],x=c[(k&=-15)>>>28]|f[k>>>24&15]|l[k>>>20&15]|h[k>>>16&15]|d[k>>>12&15]|p[k>>>8&15]|m[k>>>4&15];e=65535&(x>>>16^E),v[b++]=E^e,v[b++]=x^e<<16}}return v}(e),this._init=!0}},i("DES-ECB",n.cipher.modes.ecb),i("DES-CBC",n.cipher.modes.cbc),i("DES-CFB",n.cipher.modes.cfb),i("DES-OFB",n.cipher.modes.ofb),i("DES-CTR",n.cipher.modes.ctr),i("3DES-ECB",n.cipher.modes.ecb),i("3DES-CBC",n.cipher.modes.cbc),i("3DES-CFB",n.cipher.modes.cfb),i("3DES-OFB",n.cipher.modes.ofb),i("3DES-CTR",n.cipher.modes.ctr);var o=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],a=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],s=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],u=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],c=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],f=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],l=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],h=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function d(t,e,r,n){var i,d,p=32===t.length?3:9;i=3===p?n?[30,-2,-2]:[0,32,2]:n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var m=e[0],g=e[1];m^=(d=252645135&(m>>>4^g))<<4,m^=(d=65535&(m>>>16^(g^=d)))<<16,m^=d=858993459&((g^=d)>>>2^m),m^=d=16711935&((g^=d<<2)>>>8^m),m=(m^=(d=1431655765&(m>>>1^(g^=d<<8)))<<1)<<1|m>>>31,g=(g^=d)<<1|g>>>31;for(var v=0;v>>4|g<<28)^t[w+1];d=m,m=g,g=d^(a[_>>>24&63]|u[_>>>16&63]|f[_>>>8&63]|h[63&_]|o[k>>>24&63]|s[k>>>16&63]|c[k>>>8&63]|l[63&k])}d=m,m=g,g=d}g=g>>>1|g<<31,g^=d=1431655765&((m=m>>>1|m<<31)>>>1^g),g^=(d=16711935&(g>>>8^(m^=d<<1)))<<8,g^=(d=858993459&(g>>>2^(m^=d)))<<2,g^=d=65535&((m^=d)>>>16^g),g^=d=252645135&((m^=d<<16)>>>4^g),m^=d<<4,r[0]=m,r[1]=g}function p(t){var e,r="DES-"+((t=t||{}).mode||"CBC").toUpperCase(),i=(e=t.decrypt?n.cipher.createDecipher(r,t.key):n.cipher.createCipher(r,t.key)).start;return e.start=function(t,r){var o=null;r instanceof n.util.ByteBuffer&&(o=r,r={}),(r=r||{}).output=o,r.iv=t,i.call(e,r)},e}},function(t,e,r){var n=r(5);if(r(34),r(119),r(52),r(320),r(321),r(27),r(6),void 0===i)var i=n.jsbn.BigInteger;var o=n.asn1;n.pki=n.pki||{},t.exports=n.pki.rsa=n.rsa=n.rsa||{};var a=n.pki,s=[6,4,2,4,2,4,6,2],u={name:"PrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},c={name:"RSAPrivateKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},f={name:"RSAPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},l=n.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},h=function(t){var e;if(!(t.algorithm in a.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=t.algorithm,r}e=a.oids[t.algorithm];var n=o.oidToDer(e).getBytes(),i=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]),s=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[]);s.value.push(o.create(o.Class.UNIVERSAL,o.Type.OID,!1,n)),s.value.push(o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,""));var u=o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,t.digest().getBytes());return i.value.push(s),i.value.push(u),o.toDer(i).getBytes()},d=function(t,e,r){if(r)return t.modPow(e.e,e.n);if(!e.p||!e.q)return t.modPow(e.d,e.n);var o;e.dP||(e.dP=e.d.mod(e.p.subtract(i.ONE))),e.dQ||(e.dQ=e.d.mod(e.q.subtract(i.ONE))),e.qInv||(e.qInv=e.q.modInverse(e.p));do{o=new i(n.util.bytesToHex(n.random.getBytes(e.n.bitLength()/8)),16)}while(o.compareTo(e.n)>=0||!o.gcd(e.n).equals(i.ONE));for(var a=(t=t.multiply(o.modPow(e.e,e.n)).mod(e.n)).mod(e.p).modPow(e.dP,e.p),s=t.mod(e.q).modPow(e.dQ,e.q);a.compareTo(s)<0;)a=a.add(e.p);var u=a.subtract(s).multiply(e.qInv).mod(e.p).multiply(e.q).add(s);return u=u.multiply(o.modInverse(e.n)).mod(e.n)};function p(t,e,r){var i=n.util.createBuffer(),o=Math.ceil(e.n.bitLength()/8);if(t.length>o-11){var a=new Error("Message is too long for PKCS#1 v1.5 padding.");throw a.length=t.length,a.max=o-11,a}i.putByte(0),i.putByte(r);var s,u=o-3-t.length;if(0===r||1===r){s=0===r?0:255;for(var c=0;c0;){var f=0,l=n.random.getBytes(u);for(c=0;c1;){if(255!==a.getByte()){--a.read;break}++c}else if(2===u)for(c=0;a.length()>1;){if(0===a.getByte()){--a.read;break}++c}if(0!==a.getByte()||c!==o-3-a.length())throw new Error("Encryption block is invalid.");return a.getBytes()}function g(t){var e=t.toString(16);e[0]>="8"&&(e="00"+e);var r=n.util.hexToBytes(e);return r.length>1&&(0===r.charCodeAt(0)&&0==(128&r.charCodeAt(1))||255===r.charCodeAt(0)&&128==(128&r.charCodeAt(1)))?r.substr(1):r}function v(t){return t<=100?27:t<=150?18:t<=200?15:t<=250?12:t<=300?9:t<=350?8:t<=400?7:t<=500?6:t<=600?5:t<=800?4:t<=1250?3:2}function y(t){return"undefined"!=typeof window&&"object"==typeof window.crypto&&"object"==typeof window.crypto.subtle&&"function"==typeof window.crypto.subtle[t]}function b(t){return"undefined"!=typeof window&&"object"==typeof window.msCrypto&&"object"==typeof window.msCrypto.subtle&&"function"==typeof window.msCrypto.subtle[t]}function w(t){for(var e=n.util.hexToBytes(t.toString(16)),r=new Uint8Array(e.length),i=0;i0;)f.putByte(0),--l;return f.putBytes(n.util.hexToBytes(c)),f.getBytes()},a.rsa.decrypt=function(t,e,r,o){var a=Math.ceil(e.n.bitLength()/8);if(t.length!==a){var s=new Error("Encrypted message length is invalid.");throw s.length=t.length,s.expected=a,s}var u=new i(n.util.createBuffer(t).toHex(),16);if(u.compareTo(e.n)>=0)throw new Error("Encrypted message is invalid.");for(var c=d(u,e,r).toString(16),f=n.util.createBuffer(),l=a-Math.ceil(c.length/2);l>0;)f.putByte(0),--l;return f.putBytes(n.util.hexToBytes(c)),!1!==o?m(f.getBytes(),e,r):f.getBytes()},a.rsa.createKeyPairGenerationState=function(t,e,r){"string"==typeof t&&(t=parseInt(t,10)),t=t||2048;var o,a=(r=r||{}).prng||n.random,s={nextBytes:function(t){for(var e=a.getBytesSync(t.length),r=0;r>1,pBits:t-(t>>1),pqState:0,num:null,keys:null}).e.fromInt(o.eInt),o},a.rsa.stepKeyPairGenerationState=function(t,e){"algorithm"in t||(t.algorithm="PRIMEINC");var r=new i(null);r.fromInt(30);for(var n,o=0,u=function(t,e){return t|e},c=+new Date,f=0;null===t.keys&&(e<=0||fl?t.pqState=0:t.num.isProbablePrime(v(t.num.bitLength()))?++t.pqState:t.num.dAddOffset(s[o++%8],0):2===t.pqState?t.pqState=0===t.num.subtract(i.ONE).gcd(t.e).compareTo(i.ONE)?3:0:3===t.pqState&&(t.pqState=0,null===t.p?t.p=t.num:t.q=t.num,null!==t.p&&null!==t.q&&++t.state,t.num=null)}else if(1===t.state)t.p.compareTo(t.q)<0&&(t.num=t.p,t.p=t.q,t.q=t.num),++t.state;else if(2===t.state)t.p1=t.p.subtract(i.ONE),t.q1=t.q.subtract(i.ONE),t.phi=t.p1.multiply(t.q1),++t.state;else if(3===t.state)0===t.phi.gcd(t.e).compareTo(i.ONE)?++t.state:(t.p=null,t.q=null,t.state=0);else if(4===t.state)t.n=t.p.multiply(t.q),t.n.bitLength()===t.bits?++t.state:(t.q=null,t.state=0);else if(5===t.state){var d=t.e.modInverse(t.phi);t.keys={privateKey:a.rsa.setPrivateKey(t.n,t.e,d,t.p,t.q,d.mod(t.p1),d.mod(t.q1),t.q.modInverse(t.p)),publicKey:a.rsa.setPublicKey(t.n,t.e)}}f+=(n=+new Date)-c,c=n}return null!==t.keys},a.rsa.generateKeyPair=function(t,e,r,s){if(1===arguments.length?"object"==typeof t?(r=t,t=void 0):"function"==typeof t&&(s=t,t=void 0):2===arguments.length?"number"==typeof t?"function"==typeof e?(s=e,e=void 0):"number"!=typeof e&&(r=e,e=void 0):(r=t,s=e,t=void 0,e=void 0):3===arguments.length&&("number"==typeof e?"function"==typeof r&&(s=r,r=void 0):(s=r,r=e,e=void 0)),r=r||{},void 0===t&&(t=r.bits||2048),void 0===e&&(e=r.e||65537),!n.options.usePureJavaScript&&s&&t>=256&&t<=16384&&(65537===e||3===e)){if(y("generateKey")&&y("exportKey"))return window.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:w(e),hash:{name:"SHA-256"}},!0,["sign","verify"]).then(function(t){return window.crypto.subtle.exportKey("pkcs8",t.privateKey)}).then(void 0,function(t){s(t)}).then(function(t){if(t){var e=a.privateKeyFromAsn1(o.fromDer(n.util.createBuffer(t)));s(null,{privateKey:e,publicKey:a.setRsaPublicKey(e.n,e.e)})}});if(b("generateKey")&&b("exportKey")){var u=window.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:w(e),hash:{name:"SHA-256"}},!0,["sign","verify"]);return u.oncomplete=function(t){var e=t.target.result,r=window.msCrypto.subtle.exportKey("pkcs8",e.privateKey);r.oncomplete=function(t){var e=t.target.result,r=a.privateKeyFromAsn1(o.fromDer(n.util.createBuffer(e)));s(null,{privateKey:r,publicKey:a.setRsaPublicKey(r.n,r.e)})},r.onerror=function(t){s(t)}},void(u.onerror=function(t){s(t)})}}var c=a.rsa.createKeyPairGenerationState(t,e,r);if(!s)return a.rsa.stepKeyPairGenerationState(c,0),c.keys;!function(t,e,r){"function"==typeof e&&(r=e,e={});var o={algorithm:{name:(e=e||{}).algorithm||"PRIMEINC",options:{workers:e.workers||2,workLoad:e.workLoad||100,workerScript:e.workerScript}}};"prng"in e&&(o.prng=e.prng);function s(){u(t.pBits,function(e,n){return e?r(e):(t.p=n,null!==t.q?c(e,t.q):void u(t.qBits,c))})}function u(t,e){n.prime.generateProbablePrime(t,o,e)}function c(e,n){if(e)return r(e);if(t.q=n,t.p.compareTo(t.q)<0){var o=t.p;t.p=t.q,t.q=o}if(0!==t.p.subtract(i.ONE).gcd(t.e).compareTo(i.ONE))return t.p=null,void s();if(0!==t.q.subtract(i.ONE).gcd(t.e).compareTo(i.ONE))return t.q=null,void u(t.qBits,c);if(t.p1=t.p.subtract(i.ONE),t.q1=t.q.subtract(i.ONE),t.phi=t.p1.multiply(t.q1),0!==t.phi.gcd(t.e).compareTo(i.ONE))return t.p=t.q=null,void s();if(t.n=t.p.multiply(t.q),t.n.bitLength()!==t.bits)return t.q=null,void u(t.qBits,c);var f=t.e.modInverse(t.phi);t.keys={privateKey:a.rsa.setPrivateKey(t.n,t.e,f,t.p,t.q,f.mod(t.p1),f.mod(t.q1),t.q.modInverse(t.p)),publicKey:a.rsa.setPublicKey(t.n,t.e)},r(null,t.keys)}s()}(c,r,s)},a.setRsaPublicKey=a.rsa.setPublicKey=function(t,e){var r={n:t,e:e,encrypt:function(t,e,i){if("string"==typeof e?e=e.toUpperCase():void 0===e&&(e="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===e)e={encode:function(t,e,r){return p(t,e,2).getBytes()}};else if("RSA-OAEP"===e||"RSAES-OAEP"===e)e={encode:function(t,e){return n.pkcs1.encode_rsa_oaep(e,t,i)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(e))e={encode:function(t){return t}};else if("string"==typeof e)throw new Error('Unsupported encryption scheme: "'+e+'".');var o=e.encode(t,r,!0);return a.rsa.encrypt(o,r,!0)},verify:function(t,e,n){"string"==typeof n?n=n.toUpperCase():void 0===n&&(n="RSASSA-PKCS1-V1_5"),"RSASSA-PKCS1-V1_5"===n?n={verify:function(t,e){return e=m(e,r,!0),t===o.fromDer(e).value[1].value}}:"NONE"!==n&&"NULL"!==n&&null!==n||(n={verify:function(t,e){return t===(e=m(e,r,!0))}});var i=a.rsa.decrypt(e,r,!0,!1);return n.verify(t,i,r.n.bitLength())}};return r},a.setRsaPrivateKey=a.rsa.setPrivateKey=function(t,e,r,i,o,s,u,c){var f={n:t,e:e,d:r,p:i,q:o,dP:s,dQ:u,qInv:c,decrypt:function(t,e,r){"string"==typeof e?e=e.toUpperCase():void 0===e&&(e="RSAES-PKCS1-V1_5");var i=a.rsa.decrypt(t,f,!1,!1);if("RSAES-PKCS1-V1_5"===e)e={decode:m};else if("RSA-OAEP"===e||"RSAES-OAEP"===e)e={decode:function(t,e){return n.pkcs1.decode_rsa_oaep(e,t,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(e))throw new Error('Unsupported encryption scheme: "'+e+'".');e={decode:function(t){return t}}}return e.decode(i,f,!1)},sign:function(t,e){var r=!1;"string"==typeof e&&(e=e.toUpperCase()),void 0===e||"RSASSA-PKCS1-V1_5"===e?(e={encode:h},r=1):"NONE"!==e&&"NULL"!==e&&null!==e||(e={encode:function(){return t}},r=1);var n=e.encode(t,f.n.bitLength());return a.rsa.encrypt(n,f,r)}};return f},a.wrapRsaPrivateKey=function(t){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(0).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(a.oids.rsaEncryption).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]),o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,o.toDer(t).getBytes())])},a.privateKeyFromAsn1=function(t){var e,r,s,f,l,h,d,p,m={},g=[];if(o.validate(t,u,m,g)&&(t=o.fromDer(n.util.createBuffer(m.privateKey))),m={},g=[],!o.validate(t,c,m,g)){var v=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw v.errors=g,v}return e=n.util.createBuffer(m.privateKeyModulus).toHex(),r=n.util.createBuffer(m.privateKeyPublicExponent).toHex(),s=n.util.createBuffer(m.privateKeyPrivateExponent).toHex(),f=n.util.createBuffer(m.privateKeyPrime1).toHex(),l=n.util.createBuffer(m.privateKeyPrime2).toHex(),h=n.util.createBuffer(m.privateKeyExponent1).toHex(),d=n.util.createBuffer(m.privateKeyExponent2).toHex(),p=n.util.createBuffer(m.privateKeyCoefficient).toHex(),a.setRsaPrivateKey(new i(e,16),new i(r,16),new i(s,16),new i(f,16),new i(l,16),new i(h,16),new i(d,16),new i(p,16))},a.privateKeyToAsn1=a.privateKeyToRSAPrivateKey=function(t){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,o.integerToDer(0).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,g(t.n)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,g(t.e)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,g(t.d)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,g(t.p)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,g(t.q)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,g(t.dP)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,g(t.dQ)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,g(t.qInv))])},a.publicKeyFromAsn1=function(t){var e={},r=[];if(o.validate(t,l,e,r)){var s,u=o.derToOid(e.publicKeyOid);if(u!==a.oids.rsaEncryption)throw(s=new Error("Cannot read public key. Unknown OID.")).oid=u,s;t=e.rsaPublicKey}if(r=[],!o.validate(t,f,e,r))throw(s=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,s;var c=n.util.createBuffer(e.publicKeyModulus).toHex(),h=n.util.createBuffer(e.publicKeyExponent).toHex();return a.setRsaPublicKey(new i(c,16),new i(h,16))},a.publicKeyToAsn1=a.publicKeyToSubjectPublicKeyInfo=function(t){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(a.oids.rsaEncryption).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]),o.create(o.Class.UNIVERSAL,o.Type.BITSTRING,!1,[a.publicKeyToRSAPublicKey(t)])])},a.publicKeyToRSAPublicKey=function(t){return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,g(t.n)),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,g(t.e))])}},function(t,e,r){var n,i=r(5);t.exports=i.jsbn=i.jsbn||{};function o(t,e,r){this.data=[],null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function a(){return new o(null)}function s(t,e,r,n,i,o){for(var a=16383&e,s=e>>14;--o>=0;){var u=16383&this.data[t],c=this.data[t++]>>14,f=s*u+c*a;i=((u=a*u+((16383&f)<<14)+r.data[n]+i)>>28)+(f>>14)+s*c,r.data[n++]=268435455&u}return i}i.jsbn.BigInteger=o,"undefined"==typeof navigator?(o.prototype.am=s,n=28):"Microsoft Internet Explorer"==navigator.appName?(o.prototype.am=function(t,e,r,n,i,o){for(var a=32767&e,s=e>>15;--o>=0;){var u=32767&this.data[t],c=this.data[t++]>>15,f=s*u+c*a;i=((u=a*u+((32767&f)<<15)+r.data[n]+(1073741823&i))>>>30)+(f>>>15)+s*c+(i>>>30),r.data[n++]=1073741823&u}return i},n=30):"Netscape"!=navigator.appName?(o.prototype.am=function(t,e,r,n,i,o){for(;--o>=0;){var a=e*this.data[t++]+r.data[n]+i;i=Math.floor(a/67108864),r.data[n++]=67108863&a}return i},n=26):(o.prototype.am=s,n=28),o.prototype.DB=n,o.prototype.DM=(1<>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}function g(t){this.m=t}function v(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function S(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function E(){}function x(t){return t}function M(t){this.r2=a(),this.q3=a(),o.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}g.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},g.prototype.revert=function(t){return t},g.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},g.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},g.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},v.prototype.convert=function(t){var e=a();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(o.ZERO)>0&&this.m.subTo(e,e),e},v.prototype.revert=function(t){var e=a();return t.copyTo(e),this.reduce(e),e},v.prototype.reduce=function(t){for(;t.t<=this.mt2;)t.data[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t.data[r]+=this.m.am(0,n,t,e,0,this.m.t);t.data[r]>=t.DV;)t.data[r]-=t.DV,t.data[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},v.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},v.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},o.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t.data[e]=this.data[e];t.t=this.t,t.s=this.s},o.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this.data[0]=t:t<-1?this.data[0]=t+this.DV:this.t=0},o.prototype.fromString=function(t,e){var r;if(16==e)r=4;else if(8==e)r=3;else if(256==e)r=8;else if(2==e)r=1;else if(32==e)r=5;else{if(4!=e)return void this.fromRadix(t,e);r=2}this.t=0,this.s=0;for(var n=t.length,i=!1,a=0;--n>=0;){var s=8==r?255&t[n]:d(t,n);s<0?"-"==t.charAt(n)&&(i=!0):(i=!1,0==a?this.data[this.t++]=s:a+r>this.DB?(this.data[this.t-1]|=(s&(1<>this.DB-a):this.data[this.t-1]|=s<=this.DB&&(a-=this.DB))}8==r&&0!=(128&t[0])&&(this.s=-1,a>0&&(this.data[this.t-1]|=(1<0&&this.data[this.t-1]==t;)--this.t},o.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e.data[r+t]=this.data[r];for(r=t-1;r>=0;--r)e.data[r]=0;e.t=this.t+t,e.s=this.s},o.prototype.drShiftTo=function(t,e){for(var r=t;r=0;--r)e.data[r+a+1]=this.data[r]>>i|s,s=(this.data[r]&o)<=0;--r)e.data[r]=0;e.data[a]=s,e.t=this.t+a+1,e.s=this.s,e.clamp()},o.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)e.t=0;else{var n=t%this.DB,i=this.DB-n,o=(1<>n;for(var a=r+1;a>n;n>0&&(e.data[this.t-r-1]|=(this.s&o)<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n-=t.s}e.s=n<0?-1:0,n<-1?e.data[r++]=this.DV+n:n>0&&(e.data[r++]=n),e.t=r,e.clamp()},o.prototype.multiplyTo=function(t,e){var r=this.abs(),n=t.abs(),i=r.t;for(e.t=i+n.t;--i>=0;)e.data[i]=0;for(i=0;i=0;)t.data[r]=0;for(r=0;r=e.DV&&(t.data[r+e.t]-=e.DV,t.data[r+e.t+1]=1)}t.t>0&&(t.data[t.t-1]+=e.am(r,e.data[r],t,2*r,0,1)),t.s=0,t.clamp()},o.prototype.divRemTo=function(t,e,r){var n=t.abs();if(!(n.t<=0)){var i=this.abs();if(i.t0?(n.lShiftTo(f,s),i.lShiftTo(f,r)):(n.copyTo(s),i.copyTo(r));var l=s.t,h=s.data[l-1];if(0!=h){var d=h*(1<1?s.data[l-2]>>this.F2:0),p=this.FV/d,g=(1<=0&&(r.data[r.t++]=1,r.subTo(w,r)),o.ONE.dlShiftTo(l,w),w.subTo(s,s);s.t=0;){var _=r.data[--y]==h?this.DM:Math.floor(r.data[y]*p+(r.data[y-1]+v)*g);if((r.data[y]+=s.am(0,_,r,b,0,l))<_)for(s.dlShiftTo(b,w),r.subTo(w,r);r.data[y]<--_;)r.subTo(w,r)}null!=e&&(r.drShiftTo(l,e),u!=c&&o.ZERO.subTo(e,e)),r.t=l,r.clamp(),f>0&&r.rShiftTo(f,r),u<0&&o.ZERO.subTo(r,r)}}},o.prototype.invDigit=function(){if(this.t<1)return 0;var t=this.data[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},o.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},o.prototype.exp=function(t,e){if(t>4294967295||t<1)return o.ONE;var r=a(),n=a(),i=e.convert(this),s=m(t)-1;for(i.copyTo(r);--s>=0;)if(e.sqrTo(r,n),(t&1<0)e.mulTo(n,i,r);else{var u=r;r=n,n=u}return e.revert(r)},o.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var r,n=(1<0)for(s>s)>0&&(i=!0,o=h(r));a>=0;)s>(s+=this.DB-e)):(r=this.data[a]>>(s-=e)&n,s<=0&&(s+=this.DB,--a)),r>0&&(i=!0),i&&(o+=h(r));return i?o:"0"},o.prototype.negate=function(){var t=a();return o.ZERO.subTo(this,t),t},o.prototype.abs=function(){return this.s<0?this.negate():this},o.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this.data[r]-t.data[r]))return e;return 0},o.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+m(this.data[this.t-1]^this.s&this.DM)},o.prototype.mod=function(t){var e=a();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(o.ZERO)>0&&t.subTo(e,e),e},o.prototype.modPowInt=function(t,e){var r;return r=t<256||e.isEven()?new g(e):new v(e),this.exp(t,r)},o.ZERO=p(0),o.ONE=p(1),E.prototype.convert=x,E.prototype.revert=x,E.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)},E.prototype.sqrTo=function(t,e){t.squareTo(e)},M.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=a();return t.copyTo(e),this.reduce(e),e},M.prototype.revert=function(t){return t},M.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},M.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},M.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var A=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],C=(1<<26)/A[A.length-1];o.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},o.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),r=Math.pow(t,e),n=p(r),i=a(),o=a(),s="";for(this.divRemTo(n,i,o);i.signum()>0;)s=(r+o.intValue()).toString(t).substr(1)+s,i.divRemTo(n,i,o);return o.intValue().toString(t)+s},o.prototype.fromRadix=function(t,e){this.fromInt(0),null==e&&(e=10);for(var r=this.chunkSize(e),n=Math.pow(e,r),i=!1,a=0,s=0,u=0;u=r&&(this.dMultiply(n),this.dAddOffset(s,0),a=0,s=0))}a>0&&(this.dMultiply(Math.pow(e,a)),this.dAddOffset(s,0)),i&&o.ZERO.subTo(this,this)},o.prototype.fromNumber=function(t,e,r){if("number"==typeof e)if(t<2)this.fromInt(1);else for(this.fromNumber(t,r),this.testBit(t-1)||this.bitwiseTo(o.ONE.shiftLeft(t-1),b,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(o.ONE.shiftLeft(t-1),this);else{var n=new Array,i=7&t;n.length=1+(t>>3),e.nextBytes(n),i>0?n[0]&=(1<>=this.DB;if(t.t>=this.DB;n+=this.s}else{for(n+=this.s;r>=this.DB;n+=t.s}e.s=n<0?-1:0,n>0?e.data[r++]=n:n<-1&&(e.data[r++]=this.DV+n),e.t=r,e.clamp()},o.prototype.dMultiply=function(t){this.data[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},o.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this.data[this.t++]=0;for(this.data[e]+=t;this.data[e]>=this.DV;)this.data[e]-=this.DV,++e>=this.t&&(this.data[this.t++]=0),++this.data[e]}},o.prototype.multiplyLowerTo=function(t,e,r){var n,i=Math.min(this.t+t.t,e);for(r.s=0,r.t=i;i>0;)r.data[--i]=0;for(n=r.t-this.t;i=0;)r.data[n]=0;for(n=Math.max(e-this.t,0);n0)if(0==e)r=this.data[0]%t;else for(var n=this.t-1;n>=0;--n)r=(e*r+this.data[n])%t;return r},o.prototype.millerRabin=function(t){var e=this.subtract(o.ONE),r=e.getLowestSetBit();if(r<=0)return!1;for(var n,i=e.shiftRight(r),a={nextBytes:function(t){for(var e=0;e=0);var u=n.modPow(i,this);if(0!=u.compareTo(o.ONE)&&0!=u.compareTo(e)){for(var c=1;c++>24},o.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},o.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},o.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var r,n=this.DB-t*this.DB%8,i=0;if(t-- >0)for(n>n)!=(this.s&this.DM)>>n&&(e[i++]=r|this.s<=0;)n<8?(r=(this.data[t]&(1<>(n+=this.DB-8)):(r=this.data[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(e[i++]=r);return e},o.prototype.equals=function(t){return 0==this.compareTo(t)},o.prototype.min=function(t){return this.compareTo(t)<0?this:t},o.prototype.max=function(t){return this.compareTo(t)>0?this:t},o.prototype.and=function(t){var e=a();return this.bitwiseTo(t,y,e),e},o.prototype.or=function(t){var e=a();return this.bitwiseTo(t,b,e),e},o.prototype.xor=function(t){var e=a();return this.bitwiseTo(t,w,e),e},o.prototype.andNot=function(t){var e=a();return this.bitwiseTo(t,_,e),e},o.prototype.not=function(){for(var t=a(),e=0;e=this.t?0!=this.s:0!=(this.data[e]&1<1){var l=a();for(n.sqrTo(s[1],l);u<=f;)s[u]=a(),n.mulTo(l,s[u-2],s[u]),u+=2}var h,d,y=t.t-1,b=!0,w=a();for(i=m(t.data[y])-1;y>=0;){for(i>=c?h=t.data[y]>>i-c&f:(h=(t.data[y]&(1<0&&(h|=t.data[y-1]>>this.DB+i-c)),u=r;0==(1&h);)h>>=1,--u;if((i-=u)<0&&(i+=this.DB,--y),b)s[h].copyTo(o),b=!1;else{for(;u>1;)n.sqrTo(o,w),n.sqrTo(w,o),u-=2;u>0?n.sqrTo(o,w):(d=o,o=w,w=d),n.mulTo(w,s[h],o)}for(;y>=0&&0==(t.data[y]&1<=0?(r.subTo(n,r),e&&i.subTo(s,i),a.subTo(u,a)):(n.subTo(r,n),e&&s.subTo(i,s),u.subTo(a,u))}return 0!=n.compareTo(o.ONE)?o.ZERO:u.compareTo(t)>=0?u.subtract(t):u.signum()<0?(u.addTo(t,u),u.signum()<0?u.add(t):u):u},o.prototype.pow=function(t){return this.exp(t,new E)},o.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var n=e;e=r,r=n}var i=e.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)return e;for(i0&&(e.rShiftTo(o,e),r.rShiftTo(o,r));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r},o.prototype.isProbablePrime=function(t){var e,r=this.abs();if(1==r.t&&r.data[0]<=A[A.length-1]){for(e=0;e>>2,e.words[2]=(63&t[22])<<20|t[23]<<12|t[24]<<4|t[25]>>>4,e.words[3]=(255&t[19])<<18|t[20]<<10|t[21]<<2|t[22]>>>6,e.words[4]=(3&t[15])<<24|t[16]<<16|t[17]<<8|t[18],e.words[5]=(15&t[12])<<22|t[13]<<14|t[14]<<6|t[15]>>>2,e.words[6]=(63&t[9])<<20|t[10]<<12|t[11]<<4|t[12]>>>4,e.words[7]=(255&t[6])<<18|t[7]<<10|t[8]<<2|t[9]>>>6,e.words[8]=(3&t[2])<<24|t[3]<<16|t[4]<<8|t[5],e.words[9]=t[0]<<14|t[1]<<6|t[2]>>>2,e.length=10,e.strip()},o.prototype.toBuffer=function(){for(var t=this.words,e=this.length;e<10;++e)t[e]=0;return n.from([t[9]>>>14&255,t[9]>>>6&255,(63&t[9])<<2|t[8]>>>24&3,t[8]>>>16&255,t[8]>>>8&255,255&t[8],t[7]>>>18&255,t[7]>>>10&255,t[7]>>>2&255,(3&t[7])<<6|t[6]>>>20&63,t[6]>>>12&255,t[6]>>>4&255,(15&t[6])<<4|t[5]>>>22&15,t[5]>>>14&255,t[5]>>>6&255,(63&t[5])<<2|t[4]>>>24&3,t[4]>>>16&255,t[4]>>>8&255,255&t[4],t[3]>>>18&255,t[3]>>>10&255,t[3]>>>2&255,(3&t[3])<<6|t[2]>>>20&63,t[2]>>>12&255,t[2]>>>4&255,(15&t[2])<<4|t[1]>>>22&15,t[1]>>>14&255,t[1]>>>6&255,(63&t[1])<<2|t[0]>>>24&3,t[0]>>>16&255,t[0]>>>8&255,255&t[0]])},o.prototype.clone=function(){var t=new o;t.words=new Array(this.length);for(var e=0;e1&&0==(0|this.words[this.length-1]);)this.length--;return this},o.prototype.normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.ucmp=function(t){if(this.length!==t.length)return this.length>t.length?1:-1;for(var e=this.length-1;e>=0;--e)if(this.words[e]!==t.words[e])return this.words[e]>t.words[e]?1:-1;return 0},o.prototype.gtOne=function(){return this.length>1||this.words[0]>1},o.prototype.isOverflow=function(){return this.ucmp(o.n)>=0},o.prototype.isHigh=function(){return 1===this.ucmp(o.nh)},o.prototype.bitLengthGT256=function(){return this.length>10||10===this.length&&this.words[9]>4194303},o.prototype.iuaddn=function(t){this.words[0]+=t;for(var e=0;this.words[e]>67108863&&et.length?(e=this,r=t):(e=t,r=this);for(var n=0,i=0;n>>26}for(;0!==i&&n>>26;if(this.length=e.length,0!==i)this.words[this.length++]=i;else if(e!==this)for(;n0?(e=this,r=t):(e=t,r=this);for(var i=0,o=0;i>26,this.words[i]=67108863&a}for(;0!==o&&i>26,this.words[i]=67108863&a;if(0===o&&i>>26,u=67108863&i,c=Math.max(0,o-t.length+1),f=Math.min(o,e.length-1);c<=f;c++){var l=o-c,h=t.words[l]*e.words[c]+u;s+=h/67108864|0,u=67108863&h}r.words[o]=u,i=s}return 0!==i&&(r.words[r.length++]=i),r.strip()},o.umulTo10x10=Math.imul?i.umulTo10x10:o.umulTo,o.umulnTo=function(t,e,r){if(0===e)return r.words=[0],r.length=1,r;for(var n=0,i=0;n0?(r.words[n]=i,r.length=t.length+1):r.length=t.length,r},o.prototype.umul=function(t){var e=new o;return e.words=new Array(this.length+t.length),10===this.length&&10===t.length?o.umulTo10x10(this,t,e):1===this.length?o.umulnTo(t,this.words[0],e):1===t.length?o.umulnTo(this,t.words[0],e):o.umulTo(this,t,e)},o.prototype.isplit=function(t){t.length=Math.min(this.length,9);for(var e=0;e>>22,r=n}return r>>>=22,this.words[e-10]=r,0===r&&this.length>10?this.length-=10:this.length-=9,this},o.prototype.fireduce=function(){return this.isOverflow()&&this.isub(o.n),this},o.prototype.ureduce=function(){var t=this.clone().isplit(o.tmp).umul(o.nc).iadd(o.tmp);return t.bitLengthGT256()&&(t=t.isplit(o.tmp).umul(o.nc).iadd(o.tmp)).bitLengthGT256()&&(t=t.isplit(o.tmp).umul(o.nc).iadd(o.tmp)),t.fireduce()},o.prototype.ishrn=function(t){for(var e=(1<=0;--n){var o=this.words[n];this.words[n]=i<>>t,i=o&e}return this.length>1&&0===this.words[this.length-1]&&(this.length-=1),this},o.prototype.uinvm=function(){for(var t=this.clone(),e=o.n.clone(),r=o.fromNumber(1),n=o.fromNumber(0),i=o.fromNumber(0),a=o.fromNumber(1);t.isEven()&&e.isEven();){for(var s=1,u=1;0==(t.words[0]&u)&&0==(e.words[0]&u)&&s<26;++s,u<<=1);t.ishrn(s),e.ishrn(s)}for(var c=e.clone(),f=t.clone();!t.isZero();){for(var l=0,h=1;0==(t.words[0]&h)&&l<26;++l,h<<=1);if(l>0)for(t.ishrn(l);l-- >0;)(r.isOdd()||n.isOdd())&&(r.iadd(c),n.isub(f)),r.ishrn(1),n.ishrn(1);for(var d=0,p=1;0==(e.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(e.ishrn(d);d-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(c),a.isub(f)),i.ishrn(1),a.ishrn(1);t.ucmp(e)>=0?(t.isub(e),r.isub(i),n.isub(a)):(e.isub(t),i.isub(r),a.isub(n))}if(1===i.negative){i.negative=0;var m=i.ureduce();return m.negative^=1,m.normSign().iadd(o.n)}return i.ureduce()},o.prototype.imulK=function(){this.words[this.length]=0,this.words[this.length+1]=0,this.length+=2;for(var t=0,e=0;t0?this.isub(o.p):this.strip(),this},o.prototype.redNeg=function(){return this.isZero()?o.fromNumber(0):o.p.sub(this)},o.prototype.redAdd=function(t){return this.clone().redIAdd(t)},o.prototype.redIAdd=function(t){return this.iadd(t),this.ucmp(o.p)>=0&&this.isub(o.p),this},o.prototype.redIAdd7=function(){return this.iuaddn(7),this.ucmp(o.p)>=0&&this.isub(o.p),this},o.prototype.redSub=function(t){return this.clone().redISub(t)},o.prototype.redISub=function(t){return this.isub(t),0!==this.negative&&this.iadd(o.p),this},o.prototype.redMul=function(t){return this.umul(t).redIReduce()},o.prototype.redSqr=function(){return this.umul(this).redIReduce()},o.prototype.redSqrt=function(){if(this.isZero())return this.clone();for(var t=this.redSqr(),e=t.redSqr(),r=e.redSqr().redMul(e),n=r.redMul(t),i=n.redMul(this),o=i,a=0;a<54;++a)o=o.redSqr().redSqr().redSqr().redSqr().redMul(i);for(o=o.redSqr().redSqr().redSqr().redSqr().redMul(n),a=0;a<5;++a)o=o.redSqr().redSqr().redSqr().redSqr().redMul(i);return 0===(o=(o=o.redSqr().redSqr().redSqr().redSqr().redMul(r)).redSqr().redSqr().redSqr().redSqr().redSqr().redSqr().redMul(r)).redSqr().ucmp(this)?o:null},o.prototype.redInvm=function(){for(var t,e=this.clone(),r=o.p.clone(),n=o.fromNumber(1),i=o.fromNumber(0);e.gtOne()&&r.gtOne();){for(var a=0,s=1;0==(e.words[0]&s)&&a<26;++a,s<<=1);if(a>0)for(e.ishrn(a);a-- >0;)n.isOdd()&&n.iadd(o.p),n.ishrn(1);for(var u=0,c=1;0==(r.words[0]&c)&&u<26;++u,c<<=1);if(u>0)for(r.ishrn(u);u-- >0;)i.isOdd()&&i.iadd(o.p),i.ishrn(1);e.ucmp(r)>=0?(e.isub(r),n.isub(i)):(r.isub(e),i.isub(n))}return 0!==(t=1===e.length&&1===e.words[0]?n:i).negative&&t.iadd(o.p),0!==t.negative?(t.negative=0,t.redIReduce().redNeg()):t.redIReduce()},o.prototype.getNAF=function(t){for(var e=[],r=1<>1,o=this.clone();!o.isZero();){for(var a=0,s=1;0==(o.words[0]&s)&&a<26;++a,s<<=1)e.push(0);if(0!==a)o.ishrn(a);else{var u=o.words[0]&n;if(u>=i)e.push(i-u),o.iuaddn(u-i).ishrn(1);else if(e.push(u),o.words[0]-=u,!o.isZero()){for(a=t-1;a>0;--a)e.push(0);o.ishrn(t)}}}return e},o.prototype.inspect=function(){if(this.isZero())return"0";for(var t=this.toBuffer().toString("hex"),e=0;"0"===t[e];++e);return t.slice(e)},o.n=o.fromBuffer(n.from("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","hex")),o.nh=o.n.clone().ishrn(1),o.nc=o.fromBuffer(n.from("000000000000000000000000000000014551231950B75FC4402DA1732FC9BEBF","hex")),o.p=o.fromBuffer(n.from("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","hex")),o.psn=o.p.sub(o.n),o.tmp=new o,o.tmp.words=new Array(10),o.fromNumber(1).words[3]=0,t.exports=o},function(t,e,r){t.exports=r(372)},function(t,e,r){"use strict";var n=r(393).version,i=r(44),o=r(438),a=r(99),s=r(220),u=r(537),c=r(538),f=r(22),l=function(){var t=this;i.packageInit(this,arguments),this.version=n,this.utils=f,this.eth=new o(this),this.shh=new u(this),this.bzz=new c(this);var e=this.setProvider;this.setProvider=function(r,n){return e.apply(t,arguments),this.eth.setProvider(r,n),this.shh.setProvider(r,n),this.bzz.setProvider(r),!0}};l.version=n,l.utils=f,l.modules={Eth:o,Net:a,Personal:s,Shh:u,Bzz:c},i.addProviders(l),t.exports=l},function(t,e,r){"use strict";var n=r(124),i="object"==typeof self&&self&&self.Object===Object&&self,o=n.a||i||Function("return this")();e.a=o},function(t,e,r){"use strict";(function(t){var r="object"==typeof t&&t&&t.Object===Object&&t;e.a=r}).call(this,r(7))},function(t,e,r){var n=r(37),i=r(17).document,o=n(i)&&n(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,e,r){var n=r(37);t.exports=function(t,e){if(!n(t))return t;var r,i;if(e&&"function"==typeof(r=t.toString)&&!n(i=r.call(t)))return i;if("function"==typeof(r=t.valueOf)&&!n(i=r.call(t)))return i;if(!e&&"function"==typeof(r=t.toString)&&!n(i=r.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,e,r){"use strict";var n=r(355)(!0);r(190)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,r=this._i;return r>=e.length?{value:void 0,done:!0}:(t=n(e,r),this._i+=t.length,{value:t,done:!1})})},function(t,e){var r=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:r)(t)}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,r){var n=r(31),i=r(357),o=r(134),a=r(132)("IE_PROTO"),s=function(){},u=function(){var t,e=r(125)("iframe"),n=o.length;for(e.style.display="none",r(194).appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("