-
Notifications
You must be signed in to change notification settings - Fork 0
/
32.2d67fa9a8bff8e7d8bbe.js
1 lines (1 loc) · 827 KB
/
32.2d67fa9a8bff8e7d8bbe.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[32],{"8OQS":function(e,t){e.exports=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)t.indexOf(r=o[n])>=0||(i[r]=e[r]);return i}},Bnag:function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}},EbDI:function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}},Ijbi:function(e,t,r){var n=r("WkPL");e.exports=function(e){if(Array.isArray(e))return n(e)}},PE4B:function(e,t,r){"use strict";var n=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===i}(e)}(e)},i="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function o(e,t){return!1!==t.clone&&t.isMergeableObject(e)?c(Array.isArray(e)?[]:{},e,t):e}function a(e,t,r){return e.concat(t).map(function(e){return o(e,r)})}function s(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter(function(t){return e.propertyIsEnumerable(t)}):[]}(e))}function u(e,t){try{return t in e}catch(r){return!1}}function c(e,t,r){(r=r||{}).arrayMerge=r.arrayMerge||a,r.isMergeableObject=r.isMergeableObject||n,r.cloneUnlessOtherwiseSpecified=o;var i=Array.isArray(t);return i===Array.isArray(e)?i?r.arrayMerge(e,t,r):function(e,t,r){var n={};return r.isMergeableObject(e)&&s(e).forEach(function(t){n[t]=o(e[t],r)}),s(t).forEach(function(i){(function(e,t){return u(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(n[i]=u(e,i)&&r.isMergeableObject(t[i])?function(e,t){if(!t.customMerge)return c;var r=t.customMerge(e);return"function"==typeof r?r:c}(i,r)(e[i],t[i],r):o(t[i],r))}),n}(e,t,r):o(t,r)}c.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(e,r){return c(e,r,t)},{})},e.exports=c},QILm:function(e,t,r){var n=r("8OQS");e.exports=function(e,t){if(null==e)return{};var r,i,o=n(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)t.indexOf(r=a[i])>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}},RIqP:function(e,t,r){var n=r("Ijbi"),i=r("EbDI"),o=r("ZhPi"),a=r("Bnag");e.exports=function(e){return n(e)||i(e)||o(e)||a()}},XH0y:function(e,t,r){var n,i;!function(o,a){"use strict";void 0===(i="function"==typeof(n=function(){var e=function(){},t="undefined",r=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),n=["trace","debug","info","warn","error"];function i(e,t){var r=e[t];if("function"==typeof r.bind)return r.bind(e);try{return Function.prototype.bind.call(r,e)}catch(n){return function(){return Function.prototype.apply.apply(r,[e,arguments])}}}function o(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function a(n){return"debug"===n&&(n="log"),typeof console!==t&&("trace"===n&&r?o:void 0!==console[n]?i(console,n):void 0!==console.log?i(console,"log"):e)}function s(t,r){for(var i=0;i<n.length;i++){var o=n[i];this[o]=i<t?e:this.methodFactory(o,t,r)}this.log=this.debug}function u(e,r,n){return function(){typeof console!==t&&(s.call(this,r,n),this[e].apply(this,arguments))}}function c(e,t,r){return a(e)||u.apply(this,arguments)}function f(e,r,i){var o,a=this,u="loglevel";function f(){var e;if(typeof window!==t&&u){try{e=window.localStorage[u]}catch(i){}if(typeof e===t)try{var r=window.document.cookie,n=r.indexOf(encodeURIComponent(u)+"=");-1!==n&&(e=/^([^;]+)/.exec(r.slice(n))[1])}catch(i){}return void 0===a.levels[e]&&(e=void 0),e}}"string"==typeof e?u+=":"+e:"symbol"==typeof e&&(u=void 0),a.name=e,a.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},a.methodFactory=i||c,a.getLevel=function(){return o},a.setLevel=function(r,i){if("string"==typeof r&&void 0!==a.levels[r.toUpperCase()]&&(r=a.levels[r.toUpperCase()]),!("number"==typeof r&&r>=0&&r<=a.levels.SILENT))throw"log.setLevel() called with invalid level: "+r;if(o=r,!1!==i&&function(e){var r=(n[e]||"silent").toUpperCase();if(typeof window!==t&&u){try{return void(window.localStorage[u]=r)}catch(i){}try{window.document.cookie=encodeURIComponent(u)+"="+r+";"}catch(i){}}}(r),s.call(a,r,e),typeof console===t&&r<a.levels.SILENT)return"No console available for logging"},a.setDefaultLevel=function(e){f()||a.setLevel(e,!1)},a.enableAll=function(e){a.setLevel(a.levels.TRACE,e)},a.disableAll=function(e){a.setLevel(a.levels.SILENT,e)};var d=f();null==d&&(d=null==r?"WARN":r),a.setLevel(d,!1)}var d=new f,h={};d.getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=h[e];return t||(t=h[e]=new f(e,d.getLevel(),d.methodFactory)),t};var l=typeof window!==t?window.log:void 0;return d.noConflict=function(){return typeof window!==t&&window.log===d&&(window.log=l),d},d.getLoggers=function(){return h},d.default=d,d})?n.call(t,r,t,e):n)||(e.exports=i)}()},aUsF:function(e,t,r){"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(i=n;0!=i--;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(o=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;0!=i--;){var a=o[i];if(!e(t[a],r[a]))return!1}return!0}return t!=t&&r!=r}},b48C:function(e,t){e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}},iWIM:function(e,t,r){var n=r("n3AX");function i(t,r,o){return e.exports=i="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var i=n(e,t);if(i){var o=Object.getOwnPropertyDescriptor(i,t);return o.get?o.get.call(r):o.value}},i(t,r,o||t)}e.exports=i},n3AX:function(e,t,r){var n=r("Nsbk");e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=n(e)););return e}},oShl:function(e,t,r){var n=r("Nsbk"),i=r("SksO"),o=r("xfeJ"),a=r("sXyB");function s(t){var r="function"==typeof Map?new Map:void 0;return e.exports=s=function(e){if(null===e||!o(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,t)}function t(){return a(e,arguments,n(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),i(t,e)},s(t)}e.exports=s},q1ed:function(e,t){e.exports=function(e,t){e||(e=30),t||(t="aA0");var r="";t.split("").forEach(e=>{isNaN(parseInt(e))?/[a-z]/.test(e)?r+="abcdefghijklmnopqrstuvwxyz":/[A-Z]/.test(e)?r+="ABCDEFGHIJKLMNOPQRSTUVWXYZ":r+="~!@#$%^&()_+-={}[];',":r+="0123456789"});for(var n="",i=0;i<e;i++)n+=r.charAt(Math.floor(Math.random()*r.length));return n}},sXyB:function(e,t,r){var n=r("SksO"),i=r("b48C");function o(t,r,a){return e.exports=o=i()?Reflect.construct:function(e,t,r){var i=[null];i.push.apply(i,t);var o=new(Function.bind.apply(e,i));return r&&n(o,r.prototype),o},o.apply(null,arguments)}e.exports=o},vGOQ:function(e,t,r){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,(function(t){return e[t]}).bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=368)}([function(e,t,r){"use strict";r.d(t,"i",function(){return a}),r.d(t,"h",function(){return s}),r.d(t,"a",function(){return u}),r.d(t,"b",function(){return c}),r.d(t,"l",function(){return f}),r.d(t,"j",function(){return d}),r.d(t,"g",function(){return h}),r.d(t,"d",function(){return l}),r.d(t,"e",function(){return p}),r.d(t,"c",function(){return b}),r.d(t,"f",function(){return m}),r.d(t,"k",function(){return g});const n=new(r(5).a)("bytes/5.4.0");function i(e){return!!e.toHexString}function o(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return o(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function a(e){return d(e)&&!(e.length%2)||s(e)}function s(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(null==e.length)return!1;for(let t=0;t<e.length;t++){const r=e[t];if("number"!=typeof r||r<0||r>=256||r%1)return!1}return!0}function u(e,t){if(t||(t={}),"number"==typeof e){n.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),o(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),i(e)&&(e=e.toHexString()),d(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0x0"+r.substring(2):"right"===t.hexPad?r+="0":n.throwArgumentError("hex data is odd-length","value",e));const i=[];for(let e=0;e<r.length;e+=2)i.push(parseInt(r.substring(e,e+2),16));return o(new Uint8Array(i))}return s(e)?o(new Uint8Array(e)):n.throwArgumentError("invalid arrayify value","value",e)}function c(e){const t=e.map(e=>u(e)),r=t.reduce((e,t)=>e+t.length,0),n=new Uint8Array(r);return t.reduce((e,t)=>(n.set(t,e),e+t.length),0),o(n)}function f(e){let t=u(e);if(0===t.length)return t;let r=0;for(;r<t.length&&0===t[r];)r++;return r&&(t=t.slice(r)),t}function d(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/)||t&&e.length!==2+2*t)}function h(e,t){if(t||(t={}),"number"==typeof e){n.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t="0123456789abcdef"[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),i(e))return e.toHexString();if(d(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":n.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(s(e)){let t="0x";for(let r=0;r<e.length;r++){let n=e[r];t+="0123456789abcdef"[(240&n)>>4]+"0123456789abcdef"[15&n]}return t}return n.throwArgumentError("invalid hexlify value","value",e)}function l(e){if("string"!=typeof e)e=h(e);else if(!d(e)||e.length%2)return null;return(e.length-2)/2}function p(e,t,r){return"string"!=typeof e?e=h(e):(!d(e)||e.length%2)&&n.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function b(e){let t="0x";return e.forEach(e=>{t+=h(e).substring(2)}),t}function m(e,t){for("string"!=typeof e?e=h(e):d(e)||n.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&n.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function g(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0};if(a(e)){const r=u(e);65!==r.length&&n.throwArgumentError("invalid signature string; must be 65 bytes","signature",e),t.r=h(r.slice(0,32)),t.s=h(r.slice(32,64)),t.v=r[64],t.v<27&&(0===t.v||1===t.v?t.v+=27:n.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=h(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){const r=function(e,t){(e=u(e)).length>t&&n.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),o(r)}(u(t._vs),32);t._vs=h(r);const i=r[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=i:t.recoveryParam!==i&&n.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),r[0]&=127;const a=h(r);null==t.s?t.s=a:t.s!==a&&n.throwArgumentError("signature v mismatch _vs","signature",e)}null==t.recoveryParam?null==t.v?n.throwArgumentError("signature missing v and recoveryParam","signature",e):t.recoveryParam=0===t.v||1===t.v?t.v:1-t.v%2:null==t.v?t.v=27+t.recoveryParam:t.recoveryParam!==1-t.v%2&&n.throwArgumentError("signature recoveryParam mismatch v","signature",e),null!=t.r&&d(t.r)?t.r=m(t.r,32):n.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&d(t.s)?t.s=m(t.s,32):n.throwArgumentError("signature missing or invalid s","signature",e);const r=u(t.s);r[0]>=128&&n.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);const i=h(r);t._vs&&(d(t._vs)||n.throwArgumentError("signature invalid _vs","signature",e),t._vs=m(t._vs,32)),null==t._vs?t._vs=i:t._vs!==i&&n.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t}},function(e,t,r){(function(e){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var a;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(216).Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function c(e,t,r,n){for(var i=0,o=Math.min(e.length,r),a=t;a<o;a++){var s=e.charCodeAt(a)-48;i*=n,i+=s>=49?s-49+10:s>=17?s-17+10:s}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)this.words[o]|=(a=e[i]|e[i-1]<<8|e[i-2]<<16)<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)this.words[o]|=(a=e[i]|e[i+1]<<8|e[i+2]<<16)<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,a=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,this.words[a+=1]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,this.words[a+=1]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,f=r;f<s;f+=n)u=c(e,f,f+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var d=1;for(u=c(e,f,e.length,t),f=0;f<a;f++)d*=t;this.imuln(d),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&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?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var f=["","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"],d=[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],h=[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 l(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=a/67108864|0;r.words[0]=67108863&a;for(var u=1;u<n;u++){for(var c=s>>>26,f=67108863&s,d=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=d;h++)c+=(a=(i=0|e.words[u-h|0])*(o=0|t.words[h])+f)/67108864|0,f=67108863&a;r.words[u]=0|f,s=0|c}return 0!==s?r.words[u]=0|s:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<i|o)).toString(16);r=0!=(o=s>>>24-i&16777215)||a!==this.length-1?f[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=d[e],l=h[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var b=p.modn(l).toString(e);r=(p=p.idivn(l)).isZero()?b+r:f[c-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=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 e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==a),this.toArrayLike(a,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,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"===t,c=new e(o),f=this.clone();if(u){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),c[s]=a;for(;s<o;s++)c[s]=0}else{for(s=0;s<o-i;s++)c[s]=0;for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),c[o-s-1]=a}return c},o.prototype._countBits=Math.clz32?function(e){return 32-Math.clz32(e)}:function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this._countBits(this.words[this.length-1]);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)this.words[o]=67108863&(t=(0|r.words[o])+(0|n.words[o])+i),i=t>>>26;for(;0!==i&&o<r.length;o++)this.words[o]=67108863&(t=(0|r.words[o])+i),i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a<n.length;a++)o=(t=(0|r.words[a])-(0|n.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<r.length;a++)o=(t=(0|r.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,i,o,a=e.words,s=t.words,u=r.words,c=0,f=0|a[0],d=8191&f,h=f>>>13,l=0|a[1],p=8191&l,b=l>>>13,m=0|a[2],g=8191&m,y=m>>>13,v=0|a[3],w=8191&v,_=v>>>13,S=0|a[4],E=8191&S,k=S>>>13,x=0|a[5],A=8191&x,O=x>>>13,M=0|a[6],j=8191&M,R=M>>>13,P=0|a[7],T=8191&P,I=P>>>13,C=0|a[8],B=8191&C,N=C>>>13,L=0|a[9],D=8191&L,q=L>>>13,U=0|s[0],F=8191&U,H=U>>>13,z=0|s[1],W=8191&z,K=z>>>13,V=0|s[2],J=8191&V,G=V>>>13,X=0|s[3],Y=8191&X,$=X>>>13,Z=0|s[4],Q=8191&Z,ee=Z>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,fe=0|s[8],de=8191&fe,he=fe>>>13,le=0|s[9],pe=8191&le,be=le>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(c+(n=Math.imul(d,F))|0)+((8191&(i=(i=Math.imul(d,H))+Math.imul(h,F)|0))<<13)|0;c=((o=Math.imul(h,H))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,H))+Math.imul(b,F)|0,o=Math.imul(b,H);var ge=(c+(n=n+Math.imul(d,W)|0)|0)+((8191&(i=(i=i+Math.imul(d,K)|0)+Math.imul(h,W)|0))<<13)|0;c=((o=o+Math.imul(h,K)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(g,F),i=(i=Math.imul(g,H))+Math.imul(y,F)|0,o=Math.imul(y,H),n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(b,W)|0,o=o+Math.imul(b,K)|0;var ye=(c+(n=n+Math.imul(d,J)|0)|0)+((8191&(i=(i=i+Math.imul(d,G)|0)+Math.imul(h,J)|0))<<13)|0;c=((o=o+Math.imul(h,G)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(w,F),i=(i=Math.imul(w,H))+Math.imul(_,F)|0,o=Math.imul(_,H),n=n+Math.imul(g,W)|0,i=(i=i+Math.imul(g,K)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,K)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(b,J)|0,o=o+Math.imul(b,G)|0;var ve=(c+(n=n+Math.imul(d,Y)|0)|0)+((8191&(i=(i=i+Math.imul(d,$)|0)+Math.imul(h,Y)|0))<<13)|0;c=((o=o+Math.imul(h,$)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(E,F),i=(i=Math.imul(E,H))+Math.imul(k,F)|0,o=Math.imul(k,H),n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(g,J)|0,i=(i=i+Math.imul(g,G)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,G)|0,n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(b,Y)|0,o=o+Math.imul(b,$)|0;var we=(c+(n=n+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(h,Q)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(A,F),i=(i=Math.imul(A,H))+Math.imul(O,F)|0,o=Math.imul(O,H),n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,K)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,G)|0,n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,$)|0)+Math.imul(y,Y)|0,o=o+Math.imul(y,$)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0;var _e=(c+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(h,re)|0))<<13)|0;c=((o=o+Math.imul(h,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(j,F),i=(i=Math.imul(j,H))+Math.imul(R,F)|0,o=Math.imul(R,H),n=n+Math.imul(A,W)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,K)|0,n=n+Math.imul(E,J)|0,i=(i=i+Math.imul(E,G)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,G)|0,n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,$)|0)+Math.imul(_,Y)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0;var Se=(c+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(T,F),i=(i=Math.imul(T,H))+Math.imul(I,F)|0,o=Math.imul(I,H),n=n+Math.imul(j,W)|0,i=(i=i+Math.imul(j,K)|0)+Math.imul(R,W)|0,o=o+Math.imul(R,K)|0,n=n+Math.imul(A,J)|0,i=(i=i+Math.imul(A,G)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,G)|0,n=n+Math.imul(E,Y)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,$)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,ae)|0;var Ee=(c+(n=n+Math.imul(d,ue)|0)|0)+((8191&(i=(i=i+Math.imul(d,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(B,F),i=(i=Math.imul(B,H))+Math.imul(N,F)|0,o=Math.imul(N,H),n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,K)|0,n=n+Math.imul(j,J)|0,i=(i=i+Math.imul(j,G)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,G)|0,n=n+Math.imul(A,Y)|0,i=(i=i+Math.imul(A,$)|0)+Math.imul(O,Y)|0,o=o+Math.imul(O,$)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,o=o+Math.imul(_,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,ae)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,ae)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(b,ue)|0,o=o+Math.imul(b,ce)|0;var ke=(c+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,he)|0)+Math.imul(h,de)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(D,F),i=(i=Math.imul(D,H))+Math.imul(q,F)|0,o=Math.imul(q,H),n=n+Math.imul(B,W)|0,i=(i=i+Math.imul(B,K)|0)+Math.imul(N,W)|0,o=o+Math.imul(N,K)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(I,J)|0,o=o+Math.imul(I,G)|0,n=n+Math.imul(j,Y)|0,i=(i=i+Math.imul(j,$)|0)+Math.imul(R,Y)|0,o=o+Math.imul(R,$)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(_,oe)|0,o=o+Math.imul(_,ae)|0,n=n+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,ce)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,ce)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(b,de)|0,o=o+Math.imul(b,he)|0;var xe=(c+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,be)|0)+Math.imul(h,pe)|0))<<13)|0;c=((o=o+Math.imul(h,be)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(D,W),i=(i=Math.imul(D,K))+Math.imul(q,W)|0,o=Math.imul(q,K),n=n+Math.imul(B,J)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,G)|0,n=n+Math.imul(T,Y)|0,i=(i=i+Math.imul(T,$)|0)+Math.imul(I,Y)|0,o=o+Math.imul(I,$)|0,n=n+Math.imul(j,Q)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(_,ue)|0,o=o+Math.imul(_,ce)|0,n=n+Math.imul(g,de)|0,i=(i=i+Math.imul(g,he)|0)+Math.imul(y,de)|0,o=o+Math.imul(y,he)|0;var Ae=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,be)|0)+Math.imul(b,pe)|0))<<13)|0;c=((o=o+Math.imul(b,be)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(D,J),i=(i=Math.imul(D,G))+Math.imul(q,J)|0,o=Math.imul(q,G),n=n+Math.imul(B,Y)|0,i=(i=i+Math.imul(B,$)|0)+Math.imul(N,Y)|0,o=o+Math.imul(N,$)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,ee)|0,n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ne)|0,n=n+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,ae)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,ae)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,n=n+Math.imul(w,de)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(_,de)|0,o=o+Math.imul(_,he)|0;var Oe=(c+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,be)|0)+Math.imul(y,pe)|0))<<13)|0;c=((o=o+Math.imul(y,be)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(D,Y),i=(i=Math.imul(D,$))+Math.imul(q,Y)|0,o=Math.imul(q,$),n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(I,re)|0,o=o+Math.imul(I,ne)|0,n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,ae)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,ae)|0,n=n+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,ce)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,ce)|0,n=n+Math.imul(E,de)|0,i=(i=i+Math.imul(E,he)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,he)|0;var Me=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,be)|0)+Math.imul(_,pe)|0))<<13)|0;c=((o=o+Math.imul(_,be)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(D,Q),i=(i=Math.imul(D,ee))+Math.imul(q,Q)|0,o=Math.imul(q,ee),n=n+Math.imul(B,re)|0,i=(i=i+Math.imul(B,ne)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,ae)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,ae)|0,n=n+Math.imul(j,ue)|0,i=(i=i+Math.imul(j,ce)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,ce)|0,n=n+Math.imul(A,de)|0,i=(i=i+Math.imul(A,he)|0)+Math.imul(O,de)|0,o=o+Math.imul(O,he)|0;var je=(c+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,be)|0)+Math.imul(k,pe)|0))<<13)|0;c=((o=o+Math.imul(k,be)|0)+(i>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(D,re),i=(i=Math.imul(D,ne))+Math.imul(q,re)|0,o=Math.imul(q,ne),n=n+Math.imul(B,oe)|0,i=(i=i+Math.imul(B,ae)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,ae)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,ce)|0)+Math.imul(I,ue)|0,o=o+Math.imul(I,ce)|0,n=n+Math.imul(j,de)|0,i=(i=i+Math.imul(j,he)|0)+Math.imul(R,de)|0,o=o+Math.imul(R,he)|0;var Re=(c+(n=n+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,be)|0)+Math.imul(O,pe)|0))<<13)|0;c=((o=o+Math.imul(O,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(D,oe),i=(i=Math.imul(D,ae))+Math.imul(q,oe)|0,o=Math.imul(q,ae),n=n+Math.imul(B,ue)|0,i=(i=i+Math.imul(B,ce)|0)+Math.imul(N,ue)|0,o=o+Math.imul(N,ce)|0,n=n+Math.imul(T,de)|0,i=(i=i+Math.imul(T,he)|0)+Math.imul(I,de)|0,o=o+Math.imul(I,he)|0;var Pe=(c+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,be)|0)+Math.imul(R,pe)|0))<<13)|0;c=((o=o+Math.imul(R,be)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(D,ue),i=(i=Math.imul(D,ce))+Math.imul(q,ue)|0,o=Math.imul(q,ce),n=n+Math.imul(B,de)|0,i=(i=i+Math.imul(B,he)|0)+Math.imul(N,de)|0,o=o+Math.imul(N,he)|0;var Te=(c+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,be)|0)+Math.imul(I,pe)|0))<<13)|0;c=((o=o+Math.imul(I,be)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(D,de),i=(i=Math.imul(D,he))+Math.imul(q,de)|0,o=Math.imul(q,he);var Ie=(c+(n=n+Math.imul(B,pe)|0)|0)+((8191&(i=(i=i+Math.imul(B,be)|0)+Math.imul(N,pe)|0))<<13)|0;c=((o=o+Math.imul(N,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863;var Ce=(c+(n=Math.imul(D,pe))|0)+((8191&(i=(i=Math.imul(D,be))+Math.imul(q,pe)|0))<<13)|0;return c=((o=Math.imul(q,be))+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,u[0]=me,u[1]=ge,u[2]=ye,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Se,u[7]=Ee,u[8]=ke,u[9]=xe,u[10]=Ae,u[11]=Oe,u[12]=Me,u[13]=je,u[14]=Re,u[15]=Pe,u[16]=Te,u[17]=Ie,u[18]=Ce,0!==c&&(u[19]=c,r.length++),r};function b(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(p=l),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?p(this,e,t):r<63?l(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var a=i;i=0;for(var s=67108863&n,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var f=(0|e.words[o-c])*(0|t.words[c]),d=67108863&f;s=67108863&(d=d+s|0),i+=(a=(a=a+(f/67108864|0)|0)+(d>>>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,e,t):b(this,e,t)},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},m.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},m.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a<o;a++)n[a]=t[e[a]],i[a]=r[e[a]]},m.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var a=1;a<i;a<<=1)for(var s=a<<1,u=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),f=0;f<i;f+=s)for(var d=u,h=c,l=0;l<a;l++){var p=r[f+l],b=n[f+l],m=r[f+l+a],g=n[f+l+a],y=d*m-h*g;g=d*g+h*m,r[f+l]=p+(m=y),n[f+l]=b+g,r[f+l+a]=p-m,n[f+l+a]=b-g,l!==s&&(y=u*d-c*h,h=u*h+c*d,d=y)}},m.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},m.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},m.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},m.prototype.convert13b=function(e,t,r,i){for(var o=0,a=0;a<t;a++)r[2*a]=8191&(o+=0|e[a]),r[2*a+1]=8191&(o>>>=13),o>>>=13;for(a=2*t;a<i;++a)r[a]=0;n(0===o),n(0==(-8192&o))},m.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},m.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),a=new Array(n),s=new Array(n),u=new Array(n),c=new Array(n),f=new Array(n),d=new Array(n),h=r.words;h.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(t.words,t.length,c,n),this.transform(a,o,s,u,n,i),this.transform(c,o,f,d,n,i);for(var l=0;l<n;l++){var p=s[l]*f[l]-u[l]*d[l];u[l]=s[l]*d[l]+u[l]*f[l],s[l]=p}return this.conjugate(s,u,n),this.transform(s,u,h,o,n,i),this.conjugate(h,o,n),this.normalize13b(h,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),b(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r%26;t[r]=(e.words[r/26|0]&1<<n)>>>n}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o;this.words[t]=(0|this.words[t])-s<<r|a,a=s>>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,u=r;if(i-=a,i=Math.max(0,i),u){for(var c=0;c<a;c++)u.words[c]=this.words[c];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var f=0;for(c=this.length-1;c>=0&&(0!==f||c>=i);c--){var d=0|this.words[c];this.words[c]=f<<26-o|d>>>o,f=d&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(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;return!(this.length<=r||!(this.words[r]&1<<t))},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;return n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r?this:(0!==t&&r++,this.length=Math.min(r,this.length),0!==t&&(this.words[this.length-1]&=67108863^67108863>>>t<<t),this.strip())},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o;this._expand(e.length+r);var a=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+a;var s=(0|e.words[i])*t;a=((o-=67108863&s)>>26)-(s/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r,n=this.clone(),i=e,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"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var f=n.clone()._ishlnsubmul(i,1,u);0===f.negative&&(n=f,s&&(s.words[u]=1));for(var d=u-1;d>=0;d--){var h=67108864*(0|n.words[i.length+d])+(0|n.words[i.length+d-1]);for(h=Math.min(h/a|0,67108863),n._ishlnsubmul(i,h,d);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,d),n.isZero()||(n.negative^=1);s&&(s.words[d]=h)}return s&&s.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var f=r.clone(),d=t.clone();!t.isZero();){for(var h=0,l=1;0==(t.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(f),a.isub(d)),i.iushrn(1),a.iushrn(1);for(var p=0,b=1;0==(r.words[0]&b)&&p<26;++p,b<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(d)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(u)):(r.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,f=1;0==(t.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var d=0,h=1;0==(r.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(r.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,this.words[a]=s&=67108863}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(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new E(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},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(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){E.call(this,e),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)}y.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},i(v,y),v.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n<r;n++)t.words[n]=e.words[n];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var i=e.words[9];for(t.words[t.length++]=4194303&i,n=10;n<e.length;n++){var o=0|e.words[n];e.words[n-10]=(4194303&o)<<4|i>>>22,i=o}e.words[n-10]=i>>>=22,e.length-=0===i&&e.length>10?10:9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];e.words[r]=67108863&(t+=977*n),t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(w,y),i(_,y),i(S,y),S.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new _;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return g[e]=t,t},E.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,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 d=this.pow(f,i),h=this.pow(e,i.addn(1).iushrn(1)),l=this.pow(e,i),p=a;0!==l.cmp(s);){for(var b=l,m=0;0!==b.cmp(s);m++)b=b.redSqr();n(m<p);var g=this.pow(d,new o(1).iushln(p-m-1));h=h.redMul(g),d=g.redSqr(),l=l.redMul(d),p=m}return h},E.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},E.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],a=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],f=u-1;f>=0;f--){var d=c>>f&1;i!==r[0]&&(i=this.sqr(i)),0!==d||0!==a?(a<<=1,a|=d,(4==++s||0===n&&0===f)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new k(e)},i(k,E),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),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)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),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)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(113)(e))},function(e,t){e.exports=r("lSNA")},function(e,t){e.exports="function"==typeof Object.create?function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},function(e,t,r){"use strict";(function(e){r.d(t,"e",function(){return n}),r.d(t,"p",function(){return i}),r.d(t,"a",function(){return o}),r.d(t,"c",function(){return a}),r.d(t,"d",function(){return s}),r.d(t,"o",function(){return u}),r.d(t,"q",function(){return c}),r.d(t,"t",function(){return f}),r.d(t,"i",function(){return d}),r.d(t,"r",function(){return h}),r.d(t,"s",function(){return l}),r.d(t,"k",function(){return p}),r.d(t,"m",function(){return b}),r.d(t,"j",function(){return m}),r.d(t,"l",function(){return g}),r.d(t,"g",function(){return y}),r.d(t,"f",function(){return v}),r.d(t,"h",function(){return w}),r.d(t,"n",function(){return _}),r.d(t,"b",function(){return S});var n="1.12.1",i="object"==typeof self&&self.self===self&&self||"object"==typeof e&&e.global===e&&e||Function("return this")()||{},o=Array.prototype,a=Object.prototype,s="undefined"!=typeof Symbol?Symbol.prototype:null,u=o.push,c=o.slice,f=a.toString,d=a.hasOwnProperty,h="undefined"!=typeof ArrayBuffer,l="undefined"!=typeof DataView,p=Array.isArray,b=Object.keys,m=Object.create,g=h&&ArrayBuffer.isView,y=isNaN,v=isFinite,w=!{toString:null}.propertyIsEnumerable("toString"),_=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],S=Math.pow(2,53)-1}).call(this,r(10))},function(e,t,r){"use strict";r.d(t,"a",function(){return d});let n=!1,i=!1;const o={debug:1,default:2,info:2,warning:3,error:4,off:5};let a=o.default,s=null;const u=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(r){e.push(t)}}),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var c,f;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(c||(c={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED"}(f||(f={}));class d{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const r=e.toLowerCase();null==o[r]&&this.throwArgumentError("invalid log level name","logLevel",e),a>o[r]||console.log.apply(console,t)}debug(...e){this._log(d.levels.DEBUG,e)}info(...e){this._log(d.levels.INFO,e)}warn(...e){this._log(d.levels.WARNING,e)}makeError(e,t,r){if(i)return this.makeError("censored error",t,{});t||(t=d.errors.UNKNOWN_ERROR),r||(r={});const n=[];Object.keys(r).forEach(e=>{try{n.push(e+"="+JSON.stringify(r[e]))}catch(t){n.push(e+"="+JSON.stringify(r[e].toString()))}}),n.push("code="+t),n.push("version="+this.version);const o=e;n.length&&(e+=" ("+n.join(", ")+")");const a=new Error(e);return a.reason=o,a.code=t,Object.keys(r).forEach(function(e){a[e]=r[e]}),a}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,d.errors.INVALID_ARGUMENT,{argument:t,value:r})}assert(e,t,r,n){e||this.throwError(t,r,n)}assertArgument(e,t,r,n){e||this.throwArgumentError(t,r,n)}checkNormalize(e){null==e&&(e="platform missing String.prototype.normalize"),u&&this.throwError("platform missing String.prototype.normalize",d.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:u})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,d.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,d.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",e<t&&this.throwError("missing argument"+r,d.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+r,d.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",d.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",d.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",d.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return s||(s=new d("logger/5.4.0")),s}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",d.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),n){if(!e)return;this.globalLogger().throwError("error censorship permanent",d.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}i=!!e,n=!!t}static setLogLevel(e){const t=o[e.toLowerCase()];null!=t?a=t:d.globalLogger().warn("invalid log level - "+e)}static from(e){return new d(e)}}d.errors=f,d.levels=c},function(e,t,r){var n=r(11),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),a.prototype=Object.create(i.prototype),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t){e.exports=r("PJYZ")},function(e,t,r){"use strict";r.d(t,"c",function(){return i}),r.d(t,"d",function(){return o}),r.d(t,"b",function(){return a}),r.d(t,"a",function(){return c});const n=new(r(5).a)("properties/5.4.0");function i(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function o(e,t){for(let r=0;r<32;r++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function a(e,t){e&&"object"==typeof e||n.throwArgumentError("invalid object","object",e),Object.keys(e).forEach(r=>{t[r]||n.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)})}const s={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function u(e){return function(e){if(function e(t){if(null==t||s[typeof t])return!0;if(Array.isArray(t)||"object"==typeof t){if(!Object.isFrozen(t))return!1;const r=Object.keys(t);for(let n=0;n<r.length;n++)if(!e(t[r[n]]))return!1;return!0}return n.throwArgumentError("Cannot deepCopy "+typeof t,"object",t)}(e))return e;if(Array.isArray(e))return Object.freeze(e.map(e=>u(e)));if("object"==typeof e){const t={};for(const r in e){const n=e[r];void 0!==n&&i(t,r,u(n))}return t}return n.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}(e)}class c{constructor(e){for(const t in e)this[t]=u(e[t])}}},function(e,t){var r,n,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(r===setTimeout)return setTimeout(e,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(e){r=o}try{n="function"==typeof clearTimeout?clearTimeout:a}catch(e){n=a}}();var u,c=[],f=!1,d=-1;function h(){f&&u&&(f=!1,u.length?c=u.concat(c):d=-1,c.length&&l())}function l(){if(!f){var e=s(h);f=!0;for(var t=c.length;t;){for(u=c,c=[];++d<t;)u&&u[d].run();d=-1,t=c.length}u=null,f=!1,function(e){if(n===clearTimeout)return clearTimeout(e);if((n===a||!n)&&clearTimeout)return n=clearTimeout,clearTimeout(e);try{n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function b(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];c.push(new p(e,t)),1!==c.length||f||s(l)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=b,i.addListener=b,i.once=b,i.off=b,i.removeListener=b,i.removeAllListeners=b,i.emit=b,i.prependListener=b,i.prependOnceListener=b,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"==typeof window&&(r=window)}e.exports=r},function(e,t,r){"use strict";(function(e){var n=r(199),i=r(200),o=r(40);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,r){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return d(this,e)}return c(this,e,t,r)}function c(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");return t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n),u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=h(e,t),e}(e,t,r,n):"string"==typeof t?function(e,t,r){if("string"==typeof r&&""!==r||(r="utf8"),!u.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(t,r),i=(e=s(e,n)).write(t,r);return i!==n&&(e=e.slice(0,i)),e}(e,t,r):function(e,t){if(u.isBuffer(t)){var r=0|l(t.length);return 0===(e=s(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?s(e,0):h(e,t);if("Buffer"===t.type&&o(t.data))return h(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function d(e,t){if(f(t),e=s(e,t<0?0:0|l(t)),!u.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function h(e,t){var r=t.length<0?0:0|l(t.length);e=s(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function l(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function p(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return F(e).length;default:if(n)return U(e).length;t=(""+t).toLowerCase(),n=!0}}function b(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return j(this,t,r);case"utf8":case"utf-8":return A(this,t,r);case"ascii":return O(this,t,r);case"latin1":case"binary":return M(this,t,r);case"base64":return x(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,i){if(0===e.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:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:y(e,t,r,n,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):y(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,r,n,i){var o,a=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var f=-1;for(o=r;o<s;o++)if(c(e,o)===c(t,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===u)return f*a}else-1!==f&&(o-=o-f),f=-1}else for(r+u>s&&(r=s-u),o=r;o>=0;o--){for(var d=!0,h=0;h<u;h++)if(c(e,o+h)!==c(t,h)){d=!1;break}if(d)return o}return-1}function v(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a<n;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[r+a]=s}return a}function w(e,t,r,n){return H(U(t,e.length-r),e,r,n)}function _(e,t,r,n){return H(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function S(e,t,r,n){return _(e,t,r,n)}function E(e,t,r,n){return H(F(t),e,r,n)}function k(e,t,r,n){return H(function(e,t){for(var r,n,i=[],o=0;o<e.length&&!((t-=2)<0);++o)n=(r=e.charCodeAt(o))>>8,i.push(r%256),i.push(n);return i}(t,e.length-r),e,r,n)}function x(e,t,r){return n.fromByteArray(0===t&&r===e.length?e:e.slice(t,r))}function A(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,a,s,u,c=e[i],f=null,d=c>239?4:c>223?3:c>191?2:1;if(i+d<=r)switch(d){case 1:c<128&&(f=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(f=u);break;case 3:a=e[i+2],128==(192&(o=e[i+1]))&&128==(192&a)&&(u=(15&c)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:a=e[i+2],s=e[i+3],128==(192&(o=e[i+1]))&&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,d=1):f>65535&&(n.push((f-=65536)>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=d}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);for(var r="",n=0;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}(n)}function O(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function M(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function j(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=q(e[o]);return i}function R(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function P(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function T(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function I(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function C(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function B(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function N(e,t,r,n,o){return o||B(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function L(e,t,r,n,o){return o||B(e,0,r,8),i.write(e,t,r,n,52,8),r+8}t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=a(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,r){return c(null,e,t,r)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,r){return function(e,t,r,n){return f(t),t<=0?s(e,t):void 0!==r?"string"==typeof n?s(e,t).fill(r,n):s(e,t).fill(r):s(e,t)}(null,e,t,r)},u.allocUnsafe=function(e){return d(null,e)},u.allocUnsafeSlow=function(e){return d(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=u.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var a=e[r];if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i),i+=a.length}return n},u.byteLength=p,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?A(this,0,e):b.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,r,n,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),c=this.slice(n,i),f=e.slice(t,r),d=0;d<s;++d)if(c[d]!==f[d]){o=c[d],a=f[d];break}return o<a?-1:a<o?1:0},u.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return v(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":return _(this,e,t,r);case"latin1":case"binary":return S(this,e,t,r);case"base64":return E(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,e,t,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)}},u.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=u.prototype;else{var i=t-e;r=new u(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+e]}return r},u.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||P(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||P(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUInt8=function(e,t){return t||P(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||P(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||P(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||P(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||P(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||P(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||P(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||P(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||P(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){t||P(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return t||P(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||P(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||P(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||P(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||P(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||P(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t|=0,r|=0,n||T(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUIntBE=function(e,t,r,n){e=+e,t|=0,r|=0,n||T(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||T(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||T(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||T(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||T(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):C(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||T(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);T(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<r&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);T(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||T(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||T(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):I(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||T(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):I(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||T(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):C(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||T(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):C(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,r){return N(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return N(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return L(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return L(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=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),e.length-t<n-r&&(n=e.length-t+r);var i,o=n-r;if(this===e&&r<t&&t<n)for(i=o-1;i>=0;--i)e[i+t]=this[i+r];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+o),t);return o},u.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var a=u.isBuffer(e)?e:U(new u(e,n).toString()),s=a.length;for(o=0;o<r-t;++o)this[o+t]=a[o%s]}return this};var D=/[^+\/0-9A-Za-z-_]/g;function q(e){return e<16?"0"+e.toString(16):e.toString(16)}function U(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],a=0;a<n;++a){if((r=e.charCodeAt(a))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=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((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function F(e){return n.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(D,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function H(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}}).call(this,r(10))},function(e,t){e.exports=r("o0o1")},function(e,t,r){(function(e){function r(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===r(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===r(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===r(e)},t.isError=function(e){return"[object Error]"===r(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,r(11).Buffer)},function(e,t,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise(function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}g(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&g(e,"error",t,{once:!0})}(e,i)})},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function c(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function f(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function d(e,t,r,n){var i,o,a;if(c(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),a=o[t]),void 0===a)a=o[t]=r,++e._eventsCount;else if("function"==typeof a?a=o[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=f(e))>0&&a.length>i&&!a.warned){a.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=e,s.type=t,s.count=a.length,console&&console.warn&&console.warn(s)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=h.bind(n);return i.listener=r,n.wrapFn=i,i}function p(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):m(i,i.length)}function b(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function m(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function g(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(o){n.once&&e.removeEventListener(t,i),r(o)})}}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return u},set:function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");u=e}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return f(this)},s.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var a;if(t.length>0&&(a=t[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)o(u,this,t);else{var c=u.length,f=m(u,c);for(r=0;r<c;++r)o(f[r],this,t)}return!0},s.prototype.on=s.prototype.addListener=function(e,t){return d(this,e,t,!1)},s.prototype.prependListener=function(e,t){return d(this,e,t,!0)},s.prototype.once=function(e,t){return c(t),this.on(e,l(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,l(this,e,t)),this},s.prototype.off=s.prototype.removeListener=function(e,t){var r,n,i,o,a;if(c(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||t)}return this},s.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):b.call(e,t)},s.prototype.listenerCount=b,s.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(e,t){e.exports=r("yXPU")},function(e,t){e.exports=r("Nsbk")},function(e,t,r){"use strict";(function(t){e.exports=void 0===t||!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?{nextTick:function(e,r,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,r)});case 3:return t.nextTick(function(){e.call(null,r,n)});case 4:return t.nextTick(function(){e.call(null,r,n,i)});default:for(o=new Array(s-1),a=0;a<o.length;)o[a++]=arguments[a];return t.nextTick(function(){e.apply(null,o)})}}}:t}).call(this,r(9))},function(e,t,r){"use strict";r.d(t,"a",function(){return a});var n=r(99),i=r.n(n),o=r(0);function a(e){return"0x"+i.a.keccak_256(Object(o.a)(e))}},function(e,t,r){"use strict";var n=r(204).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=f,this.end=d,t=3;break;default:return this.write=h,void(this.end=l)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function a(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"\ufffd";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"\ufffd";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"\ufffd"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("utf16le",0,this.lastTotal-this.lastNeed):t}function f(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function l(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\ufffd":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=a(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=a(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=a(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){var n=t;n.utils=r(28),n.common=r(53),n.sha=r(258),n.ripemd=r(262),n.hmac=r(263),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},function(e,t,r){"use strict";var n=r(213),i=r(214);e.exports={errors:n,formatters:i}},function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=r,r.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},function(e,t,r){"use strict";var n=t,i=r(1),o=r(22),a=r(133);n.assert=o,n.toArray=a.toArray,n.zero2=a.zero2,n.toHex=a.toHex,n.encode=a.encode,n.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<<t+1,o=e.clone(),a=0;a<n.length;a++){var s,u=o.andln(i-1);o.isOdd()?o.isubn(s=u>(i>>1)-1?(i>>1)-u:u):s=0,n[a]=s,o.iushrn(1)}return n},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,u=e.andln(3)+i&3,c=t.andln(3)+o&3;3===u&&(u=-1),3===c&&(c=-1),a=0==(1&u)?0:3!=(n=e.andln(7)+i&7)&&5!==n||2!==c?u:-u,r[0].push(a),s=0==(1&c)?0:3!=(n=t.andln(7)+o&7)&&5!==n||2!==u?c:-c,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new i(e,"hex","le")}},function(e,t){e.exports=r("lwsE")},function(e,t){e.exports=r("W8MJ")},function(e,t,r){"use strict";r.d(t,"a",function(){return d});var n=r(0),i=r(35),o=r(18);r(27);const a=new(r(5).a)("address/5.4.0");function s(e){Object(n.j)(e,20)||a.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let n=0;n<40;n++)r[n]=t[n].charCodeAt(0);const i=Object(n.a)(Object(o.a)(r));for(let n=0;n<40;n+=2)i[n>>1]>>4>=8&&(t[n]=t[n].toUpperCase()),(15&i[n>>1])>=8&&(t[n+1]=t[n+1].toUpperCase());return"0x"+t.join("")}const u={};for(let h=0;h<10;h++)u[String(h)]=String(h);for(let h=0;h<26;h++)u[String.fromCharCode(65+h)]=String(10+h);const c=Math.floor((f=9007199254740991,Math.log10?Math.log10(f):Math.log(f)/Math.LN10));var f;function d(e){let t=null;if("string"!=typeof e&&a.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=s(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&a.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==function(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map(e=>u[e]).join("");for(;t.length>=c;){let e=t.substring(0,c);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}(e)&&a.throwArgumentError("bad icap checksum","address",e),t=Object(i.c)(e.substring(4));t.length<40;)t="0"+t;t=s("0x"+t)}else a.throwArgumentError("invalid address","address",e);return t}},function(e,t,r){"use strict";r.d(t,"b",function(){return u}),r.d(t,"a",function(){return d});var n=r(0),i=r(5);const o=new i.a("rlp/5.4.0");function a(e){const t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function s(e,t,r){let n=0;for(let i=0;i<r;i++)n=256*n+e[t+i];return n}function u(e){return Object(n.g)(function e(t){if(Array.isArray(t)){let r=[];if(t.forEach(function(t){r=r.concat(e(t))}),r.length<=55)return r.unshift(192+r.length),r;const n=a(r.length);return n.unshift(247+n.length),n.concat(r)}Object(n.i)(t)||o.throwArgumentError("RLP object must be BytesLike","object",t);const r=Array.prototype.slice.call(Object(n.a)(t));if(1===r.length&&r[0]<=127)return r;if(r.length<=55)return r.unshift(128+r.length),r;const i=a(r.length);return i.unshift(183+i.length),i.concat(r)}(e))}function c(e,t,r,n){const a=[];for(;r<t+1+n;){const s=f(e,r);a.push(s.result),(r+=s.consumed)>t+1+n&&o.throwError("child data too short",i.a.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:a}}function f(e,t){if(0===e.length&&o.throwError("data too short",i.a.errors.BUFFER_OVERRUN,{}),e[t]>=248){const r=e[t]-247;t+1+r>e.length&&o.throwError("data short segment too short",i.a.errors.BUFFER_OVERRUN,{});const n=s(e,t+1,r);return t+1+r+n>e.length&&o.throwError("data long segment too short",i.a.errors.BUFFER_OVERRUN,{}),c(e,t,t+1+r,r+n)}if(e[t]>=192){const r=e[t]-192;return t+1+r>e.length&&o.throwError("data array too short",i.a.errors.BUFFER_OVERRUN,{}),c(e,t,t+1,r)}if(e[t]>=184){const r=e[t]-183;t+1+r>e.length&&o.throwError("data array too short",i.a.errors.BUFFER_OVERRUN,{});const a=s(e,t+1,r);return t+1+r+a>e.length&&o.throwError("data array too short",i.a.errors.BUFFER_OVERRUN,{}),{consumed:1+r+a,result:Object(n.g)(e.slice(t+1+r,t+1+r+a))}}if(e[t]>=128){const r=e[t]-128;return t+1+r>e.length&&o.throwError("data too short",i.a.errors.BUFFER_OVERRUN,{}),{consumed:1+r,result:Object(n.g)(e.slice(t+1,t+1+r))}}return{consumed:1,result:Object(n.g)(e[t])}}function d(e){const t=Object(n.a)(e),r=f(t,0);return r.consumed!==t.length&&o.throwArgumentError("invalid rlp data","data",e),r.result}},function(e,t,r){"use strict";var n=r(22),i=r(3);function o(e,t){return 55296==(64512&e.charCodeAt(t))&&!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var a=e.charCodeAt(i);a<128?r[n++]=a:a<2048?(r[n++]=a>>6|192,r[n++]=63&a|128):o(e,i)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r},t.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=s(e[r].toString(16));return t},t.htonl=a,t.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=a(i)),r+=u(i.toString(16))}return r},t.zero2=s,t.zero8=u,t.join32=function(e,t,r,i){var o=r-t;n(o%4==0);for(var a=new Array(o/4),s=0,u=t;s<a.length;s++,u+=4)a[s]=("big"===i?e[u]<<24|e[u+1]<<16|e[u+2]<<8|e[u+3]:e[u+3]<<24|e[u+2]<<16|e[u+1]<<8|e[u])>>>0;return a},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>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},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=n+e[t+1]>>>0;e[t]=(i<n?1:0)+r+e[t]>>>0,e[t+1]=i},t.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,a,s){var u=0,c=t;return u+=(c=c+n>>>0)<t?1:0,u+=(c=c+o>>>0)<o?1:0,e+r+i+a+(u+=(c=c+s>>>0)<s?1:0)>>>0},t.sum64_4_lo=function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,a,s,u,c){var f=0,d=t;return f+=(d=d+n>>>0)<t?1:0,f+=(d=d+o>>>0)<o?1:0,f+=(d=d+s>>>0)<s?1:0,e+r+i+a+u+(f+=(d=d+c>>>0)<c?1:0)>>>0},t.sum64_5_lo=function(e,t,r,n,i,o,a,s,u,c){return t+n+o+s+c>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},function(e,t,r){"use strict";r.r(t),r.d(t,"default",function(){return wr}),r.d(t,"VERSION",function(){return i.e}),r.d(t,"restArguments",function(){return o}),r.d(t,"isObject",function(){return a}),r.d(t,"isNull",function(){return s}),r.d(t,"isUndefined",function(){return u}),r.d(t,"isBoolean",function(){return c}),r.d(t,"isElement",function(){return f}),r.d(t,"isString",function(){return h}),r.d(t,"isNumber",function(){return l}),r.d(t,"isDate",function(){return p}),r.d(t,"isRegExp",function(){return b}),r.d(t,"isError",function(){return m}),r.d(t,"isSymbol",function(){return g}),r.d(t,"isArrayBuffer",function(){return y}),r.d(t,"isDataView",function(){return x}),r.d(t,"isArray",function(){return A}),r.d(t,"isFunction",function(){return w}),r.d(t,"isArguments",function(){return j}),r.d(t,"isFinite",function(){return R}),r.d(t,"isNaN",function(){return P}),r.d(t,"isTypedArray",function(){return D}),r.d(t,"isEmpty",function(){return H}),r.d(t,"isMatch",function(){return z}),r.d(t,"isEqual",function(){return J}),r.d(t,"isMap",function(){return re}),r.d(t,"isWeakMap",function(){return ne}),r.d(t,"isSet",function(){return ie}),r.d(t,"isWeakSet",function(){return oe}),r.d(t,"keys",function(){return F}),r.d(t,"allKeys",function(){return G}),r.d(t,"values",function(){return ae}),r.d(t,"pairs",function(){return se}),r.d(t,"invert",function(){return ue}),r.d(t,"functions",function(){return ce}),r.d(t,"methods",function(){return ce}),r.d(t,"extend",function(){return de}),r.d(t,"extendOwn",function(){return he}),r.d(t,"assign",function(){return he}),r.d(t,"defaults",function(){return le}),r.d(t,"create",function(){return be}),r.d(t,"clone",function(){return me}),r.d(t,"tap",function(){return ge}),r.d(t,"get",function(){return _e}),r.d(t,"has",function(){return Se}),r.d(t,"mapObject",function(){return Re}),r.d(t,"identity",function(){return Ee}),r.d(t,"constant",function(){return T}),r.d(t,"noop",function(){return Pe}),r.d(t,"toPath",function(){return ye}),r.d(t,"property",function(){return xe}),r.d(t,"propertyOf",function(){return Te}),r.d(t,"matcher",function(){return ke}),r.d(t,"matches",function(){return ke}),r.d(t,"times",function(){return Ie}),r.d(t,"random",function(){return Ce}),r.d(t,"now",function(){return Be}),r.d(t,"escape",function(){return De}),r.d(t,"unescape",function(){return qe}),r.d(t,"templateSettings",function(){return Ue}),r.d(t,"template",function(){return Ve}),r.d(t,"result",function(){return Je}),r.d(t,"uniqueId",function(){return Xe}),r.d(t,"chain",function(){return Ye}),r.d(t,"iteratee",function(){return Me}),r.d(t,"partial",function(){return Qe}),r.d(t,"bind",function(){return et}),r.d(t,"bindAll",function(){return nt}),r.d(t,"memoize",function(){return it}),r.d(t,"delay",function(){return ot}),r.d(t,"defer",function(){return at}),r.d(t,"throttle",function(){return st}),r.d(t,"debounce",function(){return ut}),r.d(t,"wrap",function(){return ct}),r.d(t,"negate",function(){return ft}),r.d(t,"compose",function(){return dt}),r.d(t,"after",function(){return ht}),r.d(t,"before",function(){return lt}),r.d(t,"once",function(){return pt}),r.d(t,"findKey",function(){return bt}),r.d(t,"findIndex",function(){return gt}),r.d(t,"findLastIndex",function(){return yt}),r.d(t,"sortedIndex",function(){return vt}),r.d(t,"indexOf",function(){return _t}),r.d(t,"lastIndexOf",function(){return St}),r.d(t,"find",function(){return Et}),r.d(t,"detect",function(){return Et}),r.d(t,"findWhere",function(){return kt}),r.d(t,"each",function(){return xt}),r.d(t,"forEach",function(){return xt}),r.d(t,"map",function(){return At}),r.d(t,"collect",function(){return At}),r.d(t,"reduce",function(){return Mt}),r.d(t,"foldl",function(){return Mt}),r.d(t,"inject",function(){return Mt}),r.d(t,"reduceRight",function(){return jt}),r.d(t,"foldr",function(){return jt}),r.d(t,"filter",function(){return Rt}),r.d(t,"select",function(){return Rt}),r.d(t,"reject",function(){return Pt}),r.d(t,"every",function(){return Tt}),r.d(t,"all",function(){return Tt}),r.d(t,"some",function(){return It}),r.d(t,"any",function(){return It}),r.d(t,"contains",function(){return Ct}),r.d(t,"includes",function(){return Ct}),r.d(t,"include",function(){return Ct}),r.d(t,"invoke",function(){return Bt}),r.d(t,"pluck",function(){return Nt}),r.d(t,"where",function(){return Lt}),r.d(t,"max",function(){return Dt}),r.d(t,"min",function(){return qt}),r.d(t,"shuffle",function(){return Ft}),r.d(t,"sample",function(){return Ut}),r.d(t,"sortBy",function(){return Ht}),r.d(t,"groupBy",function(){return Wt}),r.d(t,"indexBy",function(){return Kt}),r.d(t,"countBy",function(){return Vt}),r.d(t,"partition",function(){return Jt}),r.d(t,"toArray",function(){return Xt}),r.d(t,"size",function(){return Yt}),r.d(t,"pick",function(){return Zt}),r.d(t,"omit",function(){return Qt}),r.d(t,"first",function(){return tr}),r.d(t,"head",function(){return tr}),r.d(t,"take",function(){return tr}),r.d(t,"initial",function(){return er}),r.d(t,"last",function(){return nr}),r.d(t,"rest",function(){return rr}),r.d(t,"tail",function(){return rr}),r.d(t,"drop",function(){return rr}),r.d(t,"compact",function(){return ir}),r.d(t,"flatten",function(){return or}),r.d(t,"without",function(){return sr}),r.d(t,"uniq",function(){return ur}),r.d(t,"unique",function(){return ur}),r.d(t,"union",function(){return cr}),r.d(t,"intersection",function(){return fr}),r.d(t,"difference",function(){return ar}),r.d(t,"unzip",function(){return dr}),r.d(t,"transpose",function(){return dr}),r.d(t,"zip",function(){return hr}),r.d(t,"object",function(){return lr}),r.d(t,"range",function(){return pr}),r.d(t,"chunk",function(){return br}),r.d(t,"mixin",function(){return gr});var n={};r.r(n),r.d(n,"VERSION",function(){return i.e}),r.d(n,"restArguments",function(){return o}),r.d(n,"isObject",function(){return a}),r.d(n,"isNull",function(){return s}),r.d(n,"isUndefined",function(){return u}),r.d(n,"isBoolean",function(){return c}),r.d(n,"isElement",function(){return f}),r.d(n,"isString",function(){return h}),r.d(n,"isNumber",function(){return l}),r.d(n,"isDate",function(){return p}),r.d(n,"isRegExp",function(){return b}),r.d(n,"isError",function(){return m}),r.d(n,"isSymbol",function(){return g}),r.d(n,"isArrayBuffer",function(){return y}),r.d(n,"isDataView",function(){return x}),r.d(n,"isArray",function(){return A}),r.d(n,"isFunction",function(){return w}),r.d(n,"isArguments",function(){return j}),r.d(n,"isFinite",function(){return R}),r.d(n,"isNaN",function(){return P}),r.d(n,"isTypedArray",function(){return D}),r.d(n,"isEmpty",function(){return H}),r.d(n,"isMatch",function(){return z}),r.d(n,"isEqual",function(){return J}),r.d(n,"isMap",function(){return re}),r.d(n,"isWeakMap",function(){return ne}),r.d(n,"isSet",function(){return ie}),r.d(n,"isWeakSet",function(){return oe}),r.d(n,"keys",function(){return F}),r.d(n,"allKeys",function(){return G}),r.d(n,"values",function(){return ae}),r.d(n,"pairs",function(){return se}),r.d(n,"invert",function(){return ue}),r.d(n,"functions",function(){return ce}),r.d(n,"methods",function(){return ce}),r.d(n,"extend",function(){return de}),r.d(n,"extendOwn",function(){return he}),r.d(n,"assign",function(){return he}),r.d(n,"defaults",function(){return le}),r.d(n,"create",function(){return be}),r.d(n,"clone",function(){return me}),r.d(n,"tap",function(){return ge}),r.d(n,"get",function(){return _e}),r.d(n,"has",function(){return Se}),r.d(n,"mapObject",function(){return Re}),r.d(n,"identity",function(){return Ee}),r.d(n,"constant",function(){return T}),r.d(n,"noop",function(){return Pe}),r.d(n,"toPath",function(){return ye}),r.d(n,"property",function(){return xe}),r.d(n,"propertyOf",function(){return Te}),r.d(n,"matcher",function(){return ke}),r.d(n,"matches",function(){return ke}),r.d(n,"times",function(){return Ie}),r.d(n,"random",function(){return Ce}),r.d(n,"now",function(){return Be}),r.d(n,"escape",function(){return De}),r.d(n,"unescape",function(){return qe}),r.d(n,"templateSettings",function(){return Ue}),r.d(n,"template",function(){return Ve}),r.d(n,"result",function(){return Je}),r.d(n,"uniqueId",function(){return Xe}),r.d(n,"chain",function(){return Ye}),r.d(n,"iteratee",function(){return Me}),r.d(n,"partial",function(){return Qe}),r.d(n,"bind",function(){return et}),r.d(n,"bindAll",function(){return nt}),r.d(n,"memoize",function(){return it}),r.d(n,"delay",function(){return ot}),r.d(n,"defer",function(){return at}),r.d(n,"throttle",function(){return st}),r.d(n,"debounce",function(){return ut}),r.d(n,"wrap",function(){return ct}),r.d(n,"negate",function(){return ft}),r.d(n,"compose",function(){return dt}),r.d(n,"after",function(){return ht}),r.d(n,"before",function(){return lt}),r.d(n,"once",function(){return pt}),r.d(n,"findKey",function(){return bt}),r.d(n,"findIndex",function(){return gt}),r.d(n,"findLastIndex",function(){return yt}),r.d(n,"sortedIndex",function(){return vt}),r.d(n,"indexOf",function(){return _t}),r.d(n,"lastIndexOf",function(){return St}),r.d(n,"find",function(){return Et}),r.d(n,"detect",function(){return Et}),r.d(n,"findWhere",function(){return kt}),r.d(n,"each",function(){return xt}),r.d(n,"forEach",function(){return xt}),r.d(n,"map",function(){return At}),r.d(n,"collect",function(){return At}),r.d(n,"reduce",function(){return Mt}),r.d(n,"foldl",function(){return Mt}),r.d(n,"inject",function(){return Mt}),r.d(n,"reduceRight",function(){return jt}),r.d(n,"foldr",function(){return jt}),r.d(n,"filter",function(){return Rt}),r.d(n,"select",function(){return Rt}),r.d(n,"reject",function(){return Pt}),r.d(n,"every",function(){return Tt}),r.d(n,"all",function(){return Tt}),r.d(n,"some",function(){return It}),r.d(n,"any",function(){return It}),r.d(n,"contains",function(){return Ct}),r.d(n,"includes",function(){return Ct}),r.d(n,"include",function(){return Ct}),r.d(n,"invoke",function(){return Bt}),r.d(n,"pluck",function(){return Nt}),r.d(n,"where",function(){return Lt}),r.d(n,"max",function(){return Dt}),r.d(n,"min",function(){return qt}),r.d(n,"shuffle",function(){return Ft}),r.d(n,"sample",function(){return Ut}),r.d(n,"sortBy",function(){return Ht}),r.d(n,"groupBy",function(){return Wt}),r.d(n,"indexBy",function(){return Kt}),r.d(n,"countBy",function(){return Vt}),r.d(n,"partition",function(){return Jt}),r.d(n,"toArray",function(){return Xt}),r.d(n,"size",function(){return Yt}),r.d(n,"pick",function(){return Zt}),r.d(n,"omit",function(){return Qt}),r.d(n,"first",function(){return tr}),r.d(n,"head",function(){return tr}),r.d(n,"take",function(){return tr}),r.d(n,"initial",function(){return er}),r.d(n,"last",function(){return nr}),r.d(n,"rest",function(){return rr}),r.d(n,"tail",function(){return rr}),r.d(n,"drop",function(){return rr}),r.d(n,"compact",function(){return ir}),r.d(n,"flatten",function(){return or}),r.d(n,"without",function(){return sr}),r.d(n,"uniq",function(){return ur}),r.d(n,"unique",function(){return ur}),r.d(n,"union",function(){return cr}),r.d(n,"intersection",function(){return fr}),r.d(n,"difference",function(){return ar}),r.d(n,"unzip",function(){return dr}),r.d(n,"transpose",function(){return dr}),r.d(n,"zip",function(){return hr}),r.d(n,"object",function(){return lr}),r.d(n,"range",function(){return pr}),r.d(n,"chunk",function(){return br}),r.d(n,"mixin",function(){return gr}),r.d(n,"default",function(){return yr});var i=r(4);function o(e,t){return t=null==t?e.length-1:+t,function(){for(var r=Math.max(arguments.length-t,0),n=Array(r),i=0;i<r;i++)n[i]=arguments[i+t];switch(t){case 0:return e.call(this,n);case 1:return e.call(this,arguments[0],n);case 2:return e.call(this,arguments[0],arguments[1],n)}var o=Array(t+1);for(i=0;i<t;i++)o[i]=arguments[i];return o[t]=n,e.apply(this,o)}}function a(e){var t=typeof e;return"function"===t||"object"===t&&!!e}function s(e){return null===e}function u(e){return void 0===e}function c(e){return!0===e||!1===e||"[object Boolean]"===i.t.call(e)}function f(e){return!(!e||1!==e.nodeType)}function d(e){var t="[object "+e+"]";return function(e){return i.t.call(e)===t}}var h=d("String"),l=d("Number"),p=d("Date"),b=d("RegExp"),m=d("Error"),g=d("Symbol"),y=d("ArrayBuffer"),v=d("Function");"object"!=typeof Int8Array&&"function"!=typeof(i.p.document&&i.p.document.childNodes)&&(v=function(e){return"function"==typeof e||!1});var w=v,_=d("Object"),S=i.s&&_(new DataView(new ArrayBuffer(8))),E="undefined"!=typeof Map&&_(new Map),k=d("DataView"),x=S?function(e){return null!=e&&w(e.getInt8)&&y(e.buffer)}:k,A=i.k||d("Array");function O(e,t){return null!=e&&i.i.call(e,t)}var M=d("Arguments");!function(){M(arguments)||(M=function(e){return O(e,"callee")})}();var j=M;function R(e){return!g(e)&&Object(i.f)(e)&&!isNaN(parseFloat(e))}function P(e){return l(e)&&Object(i.g)(e)}function T(e){return function(){return e}}function I(e){return function(t){var r=e(t);return"number"==typeof r&&r>=0&&r<=i.b}}function C(e){return function(t){return null==t?void 0:t[e]}}var B=C("byteLength"),N=I(B),L=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/,D=i.r?function(e){return i.l?Object(i.l)(e)&&!x(e):N(e)&&L.test(i.t.call(e))}:T(!1),q=C("length");function U(e,t){t=function(e){for(var t={},r=e.length,n=0;n<r;++n)t[e[n]]=!0;return{contains:function(e){return t[e]},push:function(r){return t[r]=!0,e.push(r)}}}(t);var r=i.n.length,n=e.constructor,o=w(n)&&n.prototype||i.c,a="constructor";for(O(e,a)&&!t.contains(a)&&t.push(a);r--;)(a=i.n[r])in e&&e[a]!==o[a]&&!t.contains(a)&&t.push(a)}function F(e){if(!a(e))return[];if(i.m)return Object(i.m)(e);var t=[];for(var r in e)O(e,r)&&t.push(r);return i.h&&U(e,t),t}function H(e){if(null==e)return!0;var t=q(e);return"number"==typeof t&&(A(e)||h(e)||j(e))?0===t:0===q(F(e))}function z(e,t){var r=F(t),n=r.length;if(null==e)return!n;for(var i=Object(e),o=0;o<n;o++){var a=r[o];if(t[a]!==i[a]||!(a in i))return!1}return!0}function W(e){return e instanceof W?e:this instanceof W?void(this._wrapped=e):new W(e)}function K(e){return new Uint8Array(e.buffer||e,e.byteOffset||0,B(e))}function V(e,t,r,n){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if(e!=e)return t!=t;var o=typeof e;return("function"===o||"object"===o||"object"==typeof t)&&function e(t,r,n,o){t instanceof W&&(t=t._wrapped),r instanceof W&&(r=r._wrapped);var a=i.t.call(t);if(a!==i.t.call(r))return!1;if(S&&"[object Object]"==a&&x(t)){if(!x(r))return!1;a="[object DataView]"}switch(a){case"[object RegExp]":case"[object String]":return""+t==""+r;case"[object Number]":return+t!=+t?+r!=+r:0==+t?1/+t==1/r:+t==+r;case"[object Date]":case"[object Boolean]":return+t==+r;case"[object Symbol]":return i.d.valueOf.call(t)===i.d.valueOf.call(r);case"[object ArrayBuffer]":case"[object DataView]":return e(K(t),K(r),n,o)}var s="[object Array]"===a;if(!s&&D(t)){if(B(t)!==B(r))return!1;if(t.buffer===r.buffer&&t.byteOffset===r.byteOffset)return!0;s=!0}if(!s){if("object"!=typeof t||"object"!=typeof r)return!1;var u=t.constructor,c=r.constructor;if(u!==c&&!(w(u)&&u instanceof u&&w(c)&&c instanceof c)&&"constructor"in t&&"constructor"in r)return!1}o=o||[];for(var f=(n=n||[]).length;f--;)if(n[f]===t)return o[f]===r;if(n.push(t),o.push(r),s){if((f=t.length)!==r.length)return!1;for(;f--;)if(!V(t[f],r[f],n,o))return!1}else{var d,h=F(t);if(f=h.length,F(r).length!==f)return!1;for(;f--;)if(!O(r,d=h[f])||!V(t[d],r[d],n,o))return!1}return n.pop(),o.pop(),!0}(e,t,r,n)}function J(e,t){return V(e,t)}function G(e){if(!a(e))return[];var t=[];for(var r in e)t.push(r);return i.h&&U(e,t),t}function X(e){var t=q(e);return function(r){if(null==r)return!1;var n=G(r);if(q(n))return!1;for(var i=0;i<t;i++)if(!w(r[e[i]]))return!1;return e!==ee||!w(r[Y])}}W.VERSION=i.e,W.prototype.valueOf=W.prototype.toJSON=W.prototype.value=function(){return this._wrapped},W.prototype.toString=function(){return String(this._wrapped)};var Y="forEach",$=["clear","delete"],Z=["get","has","set"],Q=$.concat(Y,Z),ee=$.concat(Z),te=["add"].concat($,Y,"has"),re=E?X(Q):d("Map"),ne=E?X(ee):d("WeakMap"),ie=E?X(te):d("Set"),oe=d("WeakSet");function ae(e){for(var t=F(e),r=t.length,n=Array(r),i=0;i<r;i++)n[i]=e[t[i]];return n}function se(e){for(var t=F(e),r=t.length,n=Array(r),i=0;i<r;i++)n[i]=[t[i],e[t[i]]];return n}function ue(e){for(var t={},r=F(e),n=0,i=r.length;n<i;n++)t[e[r[n]]]=r[n];return t}function ce(e){var t=[];for(var r in e)w(e[r])&&t.push(r);return t.sort()}function fe(e,t){return function(r){var n=arguments.length;if(t&&(r=Object(r)),n<2||null==r)return r;for(var i=1;i<n;i++)for(var o=arguments[i],a=e(o),s=a.length,u=0;u<s;u++){var c=a[u];t&&void 0!==r[c]||(r[c]=o[c])}return r}}var de=fe(G),he=fe(F),le=fe(G,!0);function pe(e){if(!a(e))return{};if(i.j)return Object(i.j)(e);var t=function(){};t.prototype=e;var r=new t;return t.prototype=null,r}function be(e,t){var r=pe(e);return t&&he(r,t),r}function me(e){return a(e)?A(e)?e.slice():de({},e):e}function ge(e,t){return t(e),e}function ye(e){return A(e)?e:[e]}function ve(e){return W.toPath(e)}function we(e,t){for(var r=t.length,n=0;n<r;n++){if(null==e)return;e=e[t[n]]}return r?e:void 0}function _e(e,t,r){var n=we(e,ve(t));return u(n)?r:n}function Se(e,t){for(var r=(t=ve(t)).length,n=0;n<r;n++){var i=t[n];if(!O(e,i))return!1;e=e[i]}return!!r}function Ee(e){return e}function ke(e){return e=he({},e),function(t){return z(t,e)}}function xe(e){return e=ve(e),function(t){return we(t,e)}}function Ae(e,t,r){if(void 0===t)return e;switch(null==r?3:r){case 1:return function(r){return e.call(t,r)};case 3:return function(r,n,i){return e.call(t,r,n,i)};case 4:return function(r,n,i,o){return e.call(t,r,n,i,o)}}return function(){return e.apply(t,arguments)}}function Oe(e,t,r){return null==e?Ee:w(e)?Ae(e,t,r):a(e)&&!A(e)?ke(e):xe(e)}function Me(e,t){return Oe(e,t,1/0)}function je(e,t,r){return W.iteratee!==Me?W.iteratee(e,t):Oe(e,t,r)}function Re(e,t,r){t=je(t,r);for(var n=F(e),i=n.length,o={},a=0;a<i;a++){var s=n[a];o[s]=t(e[s],s,e)}return o}function Pe(){}function Te(e){return null==e?Pe:function(t){return _e(e,t)}}function Ie(e,t,r){var n=Array(Math.max(0,e));t=Ae(t,r,1);for(var i=0;i<e;i++)n[i]=t(i);return n}function Ce(e,t){return null==t&&(t=e,e=0),e+Math.floor(Math.random()*(t-e+1))}W.toPath=ye,W.iteratee=Me;var Be=Date.now||function(){return(new Date).getTime()};function Ne(e){var t=function(t){return e[t]},r="(?:"+F(e).join("|")+")",n=RegExp(r),i=RegExp(r,"g");return function(e){return n.test(e=null==e?"":""+e)?e.replace(i,t):e}}var Le={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},De=Ne(Le),qe=Ne(ue(Le)),Ue=W.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},Fe=/(.)^/,He={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},ze=/\\|'|\r|\n|\u2028|\u2029/g;function We(e){return"\\"+He[e]}var Ke=/^\s*(\w|\$)+\s*$/;function Ve(e,t,r){!t&&r&&(t=r),t=le({},t,W.templateSettings);var n=RegExp([(t.escape||Fe).source,(t.interpolate||Fe).source,(t.evaluate||Fe).source].join("|")+"|$","g"),i=0,o="__p+='";e.replace(n,function(t,r,n,a,s){return o+=e.slice(i,s).replace(ze,We),i=s+t.length,r?o+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":n?o+="'+\n((__t=("+n+"))==null?'':__t)+\n'":a&&(o+="';\n"+a+"\n__p+='"),t}),o+="';\n";var a,s=t.variable;if(s){if(!Ke.test(s))throw new Error(s)}else o="with(obj||{}){\n"+o+"}\n",s="obj";o="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+o+"return __p;\n";try{a=new Function(s,"_",o)}catch(e){throw e.source=o,e}var u=function(e){return a.call(this,e,W)};return u.source="function("+s+"){\n"+o+"}",u}function Je(e,t,r){var n=(t=ve(t)).length;if(!n)return w(r)?r.call(e):r;for(var i=0;i<n;i++){var o=null==e?void 0:e[t[i]];void 0===o&&(o=r,i=n),e=w(o)?o.call(e):o}return e}var Ge=0;function Xe(e){var t=++Ge+"";return e?e+t:t}function Ye(e){var t=W(e);return t._chain=!0,t}function $e(e,t,r,n,i){if(!(n instanceof t))return e.apply(r,i);var o=pe(e.prototype),s=e.apply(o,i);return a(s)?s:o}var Ze=o(function(e,t){var r=Ze.placeholder,n=function(){for(var i=0,o=t.length,a=Array(o),s=0;s<o;s++)a[s]=t[s]===r?arguments[i++]:t[s];for(;i<arguments.length;)a.push(arguments[i++]);return $e(e,n,this,this,a)};return n});Ze.placeholder=W;var Qe=Ze,et=o(function(e,t,r){if(!w(e))throw new TypeError("Bind must be called on a function");var n=o(function(i){return $e(e,n,t,this,r.concat(i))});return n}),tt=I(q);function rt(e,t,r,n){if(n=n||[],t||0===t){if(t<=0)return n.concat(e)}else t=1/0;for(var i=n.length,o=0,a=q(e);o<a;o++){var s=e[o];if(tt(s)&&(A(s)||j(s)))if(t>1)rt(s,t-1,r,n),i=n.length;else for(var u=0,c=s.length;u<c;)n[i++]=s[u++];else r||(n[i++]=s)}return n}var nt=o(function(e,t){var r=(t=rt(t,!1,!1)).length;if(r<1)throw new Error("bindAll must be passed function names");for(;r--;){var n=t[r];e[n]=et(e[n],e)}return e});function it(e,t){var r=function(n){var i=r.cache,o=""+(t?t.apply(this,arguments):n);return O(i,o)||(i[o]=e.apply(this,arguments)),i[o]};return r.cache={},r}var ot=o(function(e,t,r){return setTimeout(function(){return e.apply(null,r)},t)}),at=Qe(ot,W,1);function st(e,t,r){var n,i,o,a,s=0;r||(r={});var u=function(){s=!1===r.leading?0:Be(),n=null,a=e.apply(i,o),n||(i=o=null)},c=function(){var c=Be();s||!1!==r.leading||(s=c);var f=t-(c-s);return i=this,o=arguments,f<=0||f>t?(n&&(clearTimeout(n),n=null),s=c,a=e.apply(i,o),n||(i=o=null)):n||!1===r.trailing||(n=setTimeout(u,f)),a};return c.cancel=function(){clearTimeout(n),s=0,n=i=o=null},c}function ut(e,t,r){var n,i,a,s,u,c=function(){var o=Be()-i;t>o?n=setTimeout(c,t-o):(n=null,r||(s=e.apply(u,a)),n||(a=u=null))},f=o(function(o){return u=this,a=o,i=Be(),n||(n=setTimeout(c,t),r&&(s=e.apply(u,a))),s});return f.cancel=function(){clearTimeout(n),n=a=u=null},f}function ct(e,t){return Qe(t,e)}function ft(e){return function(){return!e.apply(this,arguments)}}function dt(){var e=arguments,t=e.length-1;return function(){for(var r=t,n=e[t].apply(this,arguments);r--;)n=e[r].call(this,n);return n}}function ht(e,t){return function(){if(--e<1)return t.apply(this,arguments)}}function lt(e,t){var r;return function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=null),r}}var pt=Qe(lt,2);function bt(e,t,r){t=je(t,r);for(var n,i=F(e),o=0,a=i.length;o<a;o++)if(t(e[n=i[o]],n,e))return n}function mt(e){return function(t,r,n){r=je(r,n);for(var i=q(t),o=e>0?0:i-1;o>=0&&o<i;o+=e)if(r(t[o],o,t))return o;return-1}}var gt=mt(1),yt=mt(-1);function vt(e,t,r,n){for(var i=(r=je(r,n,1))(t),o=0,a=q(e);o<a;){var s=Math.floor((o+a)/2);r(e[s])<i?o=s+1:a=s}return o}function wt(e,t,r){return function(n,o,a){var s=0,u=q(n);if("number"==typeof a)e>0?s=a>=0?a:Math.max(a+u,s):u=a>=0?Math.min(a+1,u):a+u+1;else if(r&&a&&u)return n[a=r(n,o)]===o?a:-1;if(o!=o)return(a=t(i.q.call(n,s,u),P))>=0?a+s:-1;for(a=e>0?s:u-1;a>=0&&a<u;a+=e)if(n[a]===o)return a;return-1}}var _t=wt(1,gt,vt),St=wt(-1,yt);function Et(e,t,r){var n=(tt(e)?gt:bt)(e,t,r);if(void 0!==n&&-1!==n)return e[n]}function kt(e,t){return Et(e,ke(t))}function xt(e,t,r){var n,i;if(t=Ae(t,r),tt(e))for(n=0,i=e.length;n<i;n++)t(e[n],n,e);else{var o=F(e);for(n=0,i=o.length;n<i;n++)t(e[o[n]],o[n],e)}return e}function At(e,t,r){t=je(t,r);for(var n=!tt(e)&&F(e),i=(n||e).length,o=Array(i),a=0;a<i;a++){var s=n?n[a]:a;o[a]=t(e[s],s,e)}return o}function Ot(e){var t=function(t,r,n,i){var o=!tt(t)&&F(t),a=(o||t).length,s=e>0?0:a-1;for(i||(n=t[o?o[s]:s],s+=e);s>=0&&s<a;s+=e){var u=o?o[s]:s;n=r(n,t[u],u,t)}return n};return function(e,r,n,i){var o=arguments.length>=3;return t(e,Ae(r,i,4),n,o)}}var Mt=Ot(1),jt=Ot(-1);function Rt(e,t,r){var n=[];return t=je(t,r),xt(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function Pt(e,t,r){return Rt(e,ft(je(t)),r)}function Tt(e,t,r){t=je(t,r);for(var n=!tt(e)&&F(e),i=(n||e).length,o=0;o<i;o++){var a=n?n[o]:o;if(!t(e[a],a,e))return!1}return!0}function It(e,t,r){t=je(t,r);for(var n=!tt(e)&&F(e),i=(n||e).length,o=0;o<i;o++){var a=n?n[o]:o;if(t(e[a],a,e))return!0}return!1}function Ct(e,t,r,n){return tt(e)||(e=ae(e)),("number"!=typeof r||n)&&(r=0),_t(e,t,r)>=0}var Bt=o(function(e,t,r){var n,i;return w(t)?i=t:(t=ve(t),n=t.slice(0,-1),t=t[t.length-1]),At(e,function(e){var o=i;if(!o){if(n&&n.length&&(e=we(e,n)),null==e)return;o=e[t]}return null==o?o:o.apply(e,r)})});function Nt(e,t){return At(e,xe(t))}function Lt(e,t){return Rt(e,ke(t))}function Dt(e,t,r){var n,i,o=-1/0,a=-1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var s=0,u=(e=tt(e)?e:ae(e)).length;s<u;s++)null!=(n=e[s])&&n>o&&(o=n);else t=je(t,r),xt(e,function(e,r,n){((i=t(e,r,n))>a||i===-1/0&&o===-1/0)&&(o=e,a=i)});return o}function qt(e,t,r){var n,i,o=1/0,a=1/0;if(null==t||"number"==typeof t&&"object"!=typeof e[0]&&null!=e)for(var s=0,u=(e=tt(e)?e:ae(e)).length;s<u;s++)null!=(n=e[s])&&n<o&&(o=n);else t=je(t,r),xt(e,function(e,r,n){((i=t(e,r,n))<a||i===1/0&&o===1/0)&&(o=e,a=i)});return o}function Ut(e,t,r){if(null==t||r)return tt(e)||(e=ae(e)),e[Ce(e.length-1)];var n=tt(e)?me(e):ae(e),i=q(n);t=Math.max(Math.min(t,i),0);for(var o=i-1,a=0;a<t;a++){var s=Ce(a,o),u=n[a];n[a]=n[s],n[s]=u}return n.slice(0,t)}function Ft(e){return Ut(e,1/0)}function Ht(e,t,r){var n=0;return t=je(t,r),Nt(At(e,function(e,r,i){return{value:e,index:n++,criteria:t(e,r,i)}}).sort(function(e,t){var r=e.criteria,n=t.criteria;if(r!==n){if(r>n||void 0===r)return 1;if(r<n||void 0===n)return-1}return e.index-t.index}),"value")}function zt(e,t){return function(r,n,i){var o=t?[[],[]]:{};return n=je(n,i),xt(r,function(t,i){var a=n(t,i,r);e(o,t,a)}),o}}var Wt=zt(function(e,t,r){O(e,r)?e[r].push(t):e[r]=[t]}),Kt=zt(function(e,t,r){e[r]=t}),Vt=zt(function(e,t,r){O(e,r)?e[r]++:e[r]=1}),Jt=zt(function(e,t,r){e[r?0:1].push(t)},!0),Gt=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;function Xt(e){return e?A(e)?i.q.call(e):h(e)?e.match(Gt):tt(e)?At(e,Ee):ae(e):[]}function Yt(e){return null==e?0:tt(e)?e.length:F(e).length}function $t(e,t,r){return t in r}var Zt=o(function(e,t){var r={},n=t[0];if(null==e)return r;w(n)?(t.length>1&&(n=Ae(n,t[1])),t=G(e)):(n=$t,t=rt(t,!1,!1),e=Object(e));for(var i=0,o=t.length;i<o;i++){var a=t[i],s=e[a];n(s,a,e)&&(r[a]=s)}return r}),Qt=o(function(e,t){var r,n=t[0];return w(n)?(n=ft(n),t.length>1&&(r=t[1])):(t=At(rt(t,!1,!1),String),n=function(e,r){return!Ct(t,r)}),Zt(e,n,r)});function er(e,t,r){return i.q.call(e,0,Math.max(0,e.length-(null==t||r?1:t)))}function tr(e,t,r){return null==e||e.length<1?null==t||r?void 0:[]:null==t||r?e[0]:er(e,e.length-t)}function rr(e,t,r){return i.q.call(e,null==t||r?1:t)}function nr(e,t,r){return null==e||e.length<1?null==t||r?void 0:[]:null==t||r?e[e.length-1]:rr(e,Math.max(0,e.length-t))}function ir(e){return Rt(e,Boolean)}function or(e,t){return rt(e,t,!1)}var ar=o(function(e,t){return t=rt(t,!0,!0),Rt(e,function(e){return!Ct(t,e)})}),sr=o(function(e,t){return ar(e,t)});function ur(e,t,r,n){c(t)||(n=r,r=t,t=!1),null!=r&&(r=je(r,n));for(var i=[],o=[],a=0,s=q(e);a<s;a++){var u=e[a],f=r?r(u,a,e):u;t&&!r?(a&&o===f||i.push(u),o=f):r?Ct(o,f)||(o.push(f),i.push(u)):Ct(i,u)||i.push(u)}return i}var cr=o(function(e){return ur(rt(e,!0,!0))});function fr(e){for(var t=[],r=arguments.length,n=0,i=q(e);n<i;n++){var o=e[n];if(!Ct(t,o)){var a;for(a=1;a<r&&Ct(arguments[a],o);a++);a===r&&t.push(o)}}return t}function dr(e){for(var t=e&&Dt(e,q).length||0,r=Array(t),n=0;n<t;n++)r[n]=Nt(e,n);return r}var hr=o(dr);function lr(e,t){for(var r={},n=0,i=q(e);n<i;n++)t?r[e[n]]=t[n]:r[e[n][0]]=e[n][1];return r}function pr(e,t,r){null==t&&(t=e||0,e=0),r||(r=t<e?-1:1);for(var n=Math.max(Math.ceil((t-e)/r),0),i=Array(n),o=0;o<n;o++,e+=r)i[o]=e;return i}function br(e,t){if(null==t||t<1)return[];for(var r=[],n=0,o=e.length;n<o;)r.push(i.q.call(e,n,n+=t));return r}function mr(e,t){return e._chain?W(t).chain():t}function gr(e){return xt(ce(e),function(t){var r=W[t]=e[t];W.prototype[t]=function(){var e=[this._wrapped];return i.o.apply(e,arguments),mr(this,r.apply(W,e))}}),W}xt(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var t=i.a[e];W.prototype[e]=function(){var r=this._wrapped;return null!=r&&(t.apply(r,arguments),"shift"!==e&&"splice"!==e||0!==r.length||delete r[0]),mr(this,r)}}),xt(["concat","join","slice"],function(e){var t=i.a[e];W.prototype[e]=function(){var e=this._wrapped;return null!=e&&(e=t.apply(e,arguments)),mr(this,e)}});var yr=W,vr=gr(n);vr._=vr;var wr=vr},function(e,t){e.exports=r("7W2i")},function(e,t){e.exports=r("a1gu")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getMessageFromCode=t.serializeError=t.EthereumProviderError=t.EthereumRpcError=t.ethErrors=t.errorCodes=void 0;const n=r(96);Object.defineProperty(t,"EthereumRpcError",{enumerable:!0,get:function(){return n.EthereumRpcError}}),Object.defineProperty(t,"EthereumProviderError",{enumerable:!0,get:function(){return n.EthereumProviderError}});const i=r(179);Object.defineProperty(t,"serializeError",{enumerable:!0,get:function(){return i.serializeError}}),Object.defineProperty(t,"getMessageFromCode",{enumerable:!0,get:function(){return i.getMessageFromCode}});const o=r(355);Object.defineProperty(t,"ethErrors",{enumerable:!0,get:function(){return o.ethErrors}});const a=r(97);Object.defineProperty(t,"errorCodes",{enumerable:!0,get:function(){return a.errorCodes}})},function(e,t,r){var n=r(29),i=r(215),o=r(115),a=r(224),s=r(36),u=r(1),c=function(e,t){var r=[];return t.forEach(function(t){if("object"==typeof t.components){if("tuple"!==t.type.substring(0,5))throw new Error("components found but type is not tuple; report on GitHub");var i="",o=t.type.indexOf("[");o>=0&&(i=t.type.substring(o));var a=c(e,t.components);n.isArray(a)&&e?r.push("tuple("+a.join(",")+")"+i):r.push(e?"("+a+")":"("+a.join(",")+")"+i)}else r.push(t.type)}),r},f=function(e){if(!o.isHexStrict(e))throw new Error("The parameter must be a valid HEX string.");var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r<n;r+=2){var i=parseInt(e.substr(r,2),16);t+=String.fromCharCode(i)}return t},d=function(e){if(!e)return"0x00";for(var t="",r=0;r<e.length;r++){var n=e.charCodeAt(r).toString(16);t+=n.length<2?"0"+n:n}return"0x"+t},h=function(e){if(e=e?e.toLowerCase():"ether",!i.unitMap[e])throw new Error('This unit "'+e+"\" doesn't exist, please use the one of the following units"+JSON.stringify(i.unitMap,null,2));return e};e.exports={_fireError:function(e,t,r,i,o){return!n.isObject(e)||e instanceof Error||!e.data||((n.isObject(e.data)||n.isArray(e.data))&&(e.data=JSON.stringify(e.data,null,2)),e=e.message+"\n"+e.data),n.isString(e)&&(e=new Error(e)),n.isFunction(i)&&i(e,o),n.isFunction(r)&&((t&&n.isFunction(t.listeners)&&t.listeners("error").length||n.isFunction(i))&&t.catch(function(){}),setTimeout(function(){r(e)},1)),t&&n.isFunction(t.emit)&&setTimeout(function(){t.emit("error",e,o),t.removeAllListeners()},1),t},_jsonInterfaceMethodToString:function(e){return n.isObject(e)&&e.name&&-1!==e.name.indexOf("(")?e.name:e.name+"("+c(!1,e.inputs).join(",")+")"},_flattenTypes:c,randomHex:function(e){return"0x"+s(e).toString("hex")},_:n,BN:o.BN,isBN:o.isBN,isBigNumber:o.isBigNumber,isHex:o.isHex,isHexStrict:o.isHexStrict,sha3:o.sha3,sha3Raw:o.sha3Raw,keccak256:o.sha3,soliditySha3:a.soliditySha3,soliditySha3Raw:a.soliditySha3Raw,encodePacked:a.encodePacked,isAddress:o.isAddress,checkAddressChecksum:o.checkAddressChecksum,toChecksumAddress:function(e){if(void 0===e)return"";if(!/^(0x)?[0-9a-f]{40}$/i.test(e))throw new Error('Given address "'+e+'" is not a valid Ethereum address.');e=e.toLowerCase().replace(/^0x/i,"");for(var t=o.sha3(e).replace(/^0x/i,""),r="0x",n=0;n<e.length;n++)parseInt(t[n],16)>7?r+=e[n].toUpperCase():r+=e[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,stripHexPrefix:o.stripHexPrefix,utf8ToHex:o.utf8ToHex,stringToHex:o.utf8ToHex,fromUtf8:o.utf8ToHex,hexToAscii:f,toAscii:f,asciiToHex:d,fromAscii:d,unitMap:i.unitMap,toWei:function(e,t){if(t=h(t),!o.isBN(e)&&!n.isString(e))throw new Error("Please pass numbers as strings or BN objects to avoid precision errors.");return o.isBN(e)?i.toWei(e,t):i.toWei(e,t).toString(10)},fromWei:function(e,t){if(t=h(t),!o.isBN(e)&&!n.isString(e))throw new Error("Please pass numbers as strings or BN objects to avoid precision errors.");return o.isBN(e)?i.fromWei(e,t):i.fromWei(e,t).toString(10)},padLeft:o.leftPad,leftPad:o.leftPad,padRight:o.rightPad,rightPad:o.rightPad,toTwosComplement:o.toTwosComplement,isBloom:o.isBloom,isUserEthereumAddressInBloom:o.isUserEthereumAddressInBloom,isContractAddressInBloom:o.isContractAddressInBloom,isTopic:o.isTopic,isTopicInBloom:o.isTopicInBloom,isInBloom:o.isInBloom,compareBlockNumbers:function(e,t){if(e==t)return 0;if("genesis"!=e&&"earliest"!=e&&0!=e||"genesis"!=t&&"earliest"!=t&&0!=t){if("genesis"==e||"earliest"==e)return-1;if("genesis"==t||"earliest"==t)return 1;if("latest"==e)return"pending"==t?-1:1;if("latest"===t)return"pending"==e?1:-1;if("pending"==e)return 1;if("pending"==t)return-1;{let r=new u(e),n=new u(t);return r.lt(n)?-1:r.eq(n)?0:1}}return 0}}},function(e,t,r){var n=r(6).Buffer,i=r(79).Transform,o=r(19).StringDecoder;function a(e){i.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(3)(a,i),a.prototype.update=function(e,t,r){"string"==typeof e&&(e=n.from(e,t));var i=this._update(e);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(e,t,r){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){n=e}finally{r(n)}},a.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},a.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},a.prototype._toString=function(e,t,r){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return r&&(n+=this._decoder.end()),n},e.exports=a},function(e,t,r){"use strict";r.d(t,"a",function(){return d}),r.d(t,"c",function(){return m}),r.d(t,"b",function(){return g});var n=r(1),i=r.n(n),o=r(0),a=r(5),s=i.a.BN;const u=new a.a("bignumber/5.4.0"),c={};let f=!1;class d{constructor(e,t){u.checkNew(new.target,d),e!==c&&u.throwError("cannot call constructor directly; use BigNumber.from",a.a.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return l(p(this).fromTwos(e))}toTwos(e){return l(p(this).toTwos(e))}abs(){return"-"===this._hex[0]?d.from(this._hex.substring(1)):this}add(e){return l(p(this).add(p(e)))}sub(e){return l(p(this).sub(p(e)))}div(e){return d.from(e).isZero()&&b("division by zero","div"),l(p(this).div(p(e)))}mul(e){return l(p(this).mul(p(e)))}mod(e){const t=p(e);return t.isNeg()&&b("cannot modulo negative values","mod"),l(p(this).umod(t))}pow(e){const t=p(e);return t.isNeg()&&b("cannot raise to negative values","pow"),l(p(this).pow(t))}and(e){const t=p(e);return(this.isNegative()||t.isNeg())&&b("cannot 'and' negative values","and"),l(p(this).and(t))}or(e){const t=p(e);return(this.isNegative()||t.isNeg())&&b("cannot 'or' negative values","or"),l(p(this).or(t))}xor(e){const t=p(e);return(this.isNegative()||t.isNeg())&&b("cannot 'xor' negative values","xor"),l(p(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&b("cannot mask negative values","mask"),l(p(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&b("cannot shift negative values","shl"),l(p(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&b("cannot shift negative values","shr"),l(p(this).shrn(e))}eq(e){return p(this).eq(p(e))}lt(e){return p(this).lt(p(e))}lte(e){return p(this).lte(p(e))}gt(e){return p(this).gt(p(e))}gte(e){return p(this).gte(p(e))}isNegative(){return"-"===this._hex[0]}isZero(){return p(this).isZero()}toNumber(){try{return p(this).toNumber()}catch(e){b("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return u.throwError("this platform does not support BigInt",a.a.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?f||(f=!0,u.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):u.throwError(16===arguments[0]?"BigNumber.toString does not accept any parameters; use bigNumber.toHexString()":"BigNumber.toString does not accept parameters",a.a.errors.UNEXPECTED_ARGUMENT,{})),p(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof d)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new d(c,h(e)):e.match(/^-?[0-9]+$/)?new d(c,h(new s(e))):u.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&b("underflow","BigNumber.from",e),(e>=9007199254740991||e<=-9007199254740991)&&b("overflow","BigNumber.from",e),d.from(String(e));const t=e;if("bigint"==typeof t)return d.from(t.toString());if(Object(o.h)(t))return d.from(Object(o.g)(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"==typeof e)return d.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&(Object(o.j)(e)||"-"===e[0]&&Object(o.j)(e.substring(1))))return d.from(e)}return u.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function h(e){if("string"!=typeof e)return h(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&u.throwArgumentError("invalid hex","value",e),"0x00"===(e=h(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function l(e){return d.from(h(e))}function p(e){const t=d.from(e).toHexString();return new s("-"===t[0]?"-"+t.substring(3):t.substring(2),16)}function b(e,t,r){const n={fault:e,operation:t};return null!=r&&(n.value=r),u.throwError(e,a.a.errors.NUMERIC_FAULT,n)}function m(e){return new s(e,36).toString(16)}function g(e){return new s(e,16).toString(36)}},function(e,t,r){"use strict";(function(t,n){var i=r(6).Buffer,o=t.crypto||t.msCrypto;e.exports=o&&o.getRandomValues?function(e,t){if(e>4294967295)throw new RangeError("requested too many random bytes");var r=i.allocUnsafe(e);if(e>0)if(e>65536)for(var a=0;a<e;a+=65536)o.getRandomValues(r.slice(a,a+65536));else o.getRandomValues(r);return"function"==typeof t?n.nextTick(function(){t(null,r)}):r}:function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this,r(10),r(9))},function(e,t,r){"use strict";var n=r(17),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=d;var o=Object.create(r(13));o.inherits=r(3);var a=r(136),s=r(82);o.inherits(d,a);for(var u=i(s.prototype),c=0;c<u.length;c++){var f=u[c];d.prototype[f]||(d.prototype[f]=s.prototype[f])}function d(e){if(!(this instanceof d))return new d(e);a.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",h)}function h(){this.allowHalfOpen||this._writableState.ended||n.nextTick(l,this)}function l(e){e.end()}Object.defineProperty(d.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(d.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),d.prototype._destroy=function(e,t){this.push(null),this.end(),n.nextTick(t,e)}},function(e,t,r){"use strict";var n=r(3),i=r(78),o=r(83),a=r(84),s=r(34);function u(e){s.call(this,"digest"),this._hash=e}n(u,s),u.prototype._update=function(e){this._hash.update(e)},u.prototype._final=function(){return this._hash.digest()},e.exports=function(e){return"md5"===(e=e.toLowerCase())?new i:"rmd160"===e||"ripemd160"===e?new o:new u(a(e))}},,function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){"use strict";var n=r(62),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=d;var o=r(13);o.inherits=r(3);var a=r(106),s=r(109);o.inherits(d,a);for(var u=i(s.prototype),c=0;c<u.length;c++){var f=u[c];d.prototype[f]||(d.prototype[f]=s.prototype[f])}function d(e){if(!(this instanceof d))return new d(e);a.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",h)}function h(){this.allowHalfOpen||this._writableState.ended||n(l,this)}function l(e){e.end()}Object.defineProperty(d.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),d.prototype._destroy=function(e,t){this.push(null),this.end(),n(t,e)}},function(e,t,r){(function(t){function r(e){try{if(!t.localStorage)return!1}catch(e){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=function(e,t){if(r("noDeprecation"))return e;var n=!1;return function(){if(!n){if(r("throwDeprecation"))throw new Error(t);r("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this,r(10))},function(e,t,r){"use strict";var n=r(17),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=d;var o=Object.create(r(13));o.inherits=r(3);var a=r(120),s=r(123);o.inherits(d,a);for(var u=i(s.prototype),c=0;c<u.length;c++){var f=u[c];d.prototype[f]||(d.prototype[f]=s.prototype[f])}function d(e){if(!(this instanceof d))return new d(e);a.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",h)}function h(){this.allowHalfOpen||this._writableState.ended||n.nextTick(l,this)}function l(e){e.end()}Object.defineProperty(d.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(d.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),d.prototype._destroy=function(e,t){this.push(null),this.end(),n.nextTick(t,e)}},function(e,t,r){var n=r(6).Buffer;function i(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){"string"==typeof e&&(e=n.from(e,t=t||"utf8"));for(var r=this._block,i=this._blockSize,o=e.length,a=this._len,s=0;s<o;){for(var u=a%i,c=Math.min(o-s,i-u),f=0;f<c;f++)r[u+f]=e[s+f];s+=c,(a+=c)%i==0&&this._update(r)}return this._len+=o,this},i.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=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;this._block.writeUInt32BE((r-n)/4294967296,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i},i.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=i},function(e,t,r){"use strict";var n={};function i(e,t,r){r||(r=Error);var i=function(e){var r,n;function i(r,n,i){return e.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,i))||this}return n=e,(r=i).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,i}(r);i.prototype.name=r.name,i.prototype.code=e,n[e]=i}function o(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(e){return String(e)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),i("ERR_INVALID_ARG_TYPE",function(e,t,r){var n,i;if("string"==typeof t&&"not "===t.substr(0,"not ".length)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))i="The ".concat(e," ").concat(n," ").concat(o(t,"type"));else{var a=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+".".length>e.length)&&-1!==e.indexOf(".",r)}(e)?"property":"argument";i='The "'.concat(e,'" ').concat(a," ").concat(n," ").concat(o(t,"type"))}return i+". Received type ".concat(typeof r)},TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=n},function(e,t,r){"use strict";(function(t){var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=c;var i=r(159),o=r(163);r(3)(c,i);for(var a=n(o.prototype),s=0;s<a.length;s++){var u=a[s];c.prototype[u]||(c.prototype[u]=o.prototype[u])}function c(e){if(!(this instanceof c))return new c(e);i.call(this,e),o.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",f)))}function f(){this._writableState.ended||t.nextTick(d,this)}function d(e){e.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}).call(this,r(9))},function(e,t,r){"use strict";var n=r(17),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=d;var o=Object.create(r(13));o.inherits=r(3);var a=r(174),s=r(177);o.inherits(d,a);for(var u=i(s.prototype),c=0;c<u.length;c++){var f=u[c];d.prototype[f]||(d.prototype[f]=s.prototype[f])}function d(e){if(!(this instanceof d))return new d(e);a.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",h)}function h(){this.allowHalfOpen||this._writableState.ended||n.nextTick(l,this)}function l(e){e.end()}Object.defineProperty(d.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(d.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),d.prototype._destroy=function(e,t){this.push(null),this.end(),n.nextTick(t,e)}},function(e,t,r){"use strict";var n=r(17),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=d;var o=Object.create(r(13));o.inherits=r(3);var a=r(183),s=r(186);o.inherits(d,a);for(var u=i(s.prototype),c=0;c<u.length;c++){var f=u[c];d.prototype[f]||(d.prototype[f]=s.prototype[f])}function d(e){if(!(this instanceof d))return new d(e);a.call(this,e),s.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",h)}function h(){this.allowHalfOpen||this._writableState.ended||n.nextTick(l,this)}function l(e){e.end()}Object.defineProperty(d.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(d.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),d.prototype._destroy=function(e,t){this.push(null),this.end(),n.nextTick(t,e)}},function(e,t,r){(function(t){var n=r(67),i=r(68),o=r(367),a=function(){},s=/^v?\.0/.test(t.version),u=function(e){return"function"==typeof e},c=function(e,t,r,c){c=n(c);var f=!1;e.on("close",function(){f=!0}),i(e,{readable:t,writable:r},function(e){if(e)return c(e);f=!0,c()});var d=!1;return function(t){if(!f&&!d)return d=!0,function(e){return!!s&&!!o&&(e instanceof(o.ReadStream||a)||e instanceof(o.WriteStream||a))&&u(e.close)}(e)?e.close(a):function(e){return e.setHeader&&u(e.abort)}(e)?e.abort():u(e.destroy)?e.destroy():void c(t||new Error("stream was destroyed"))}},f=function(e){e()},d=function(e,t){return e.pipe(t)};e.exports=function(){var e,t=Array.prototype.slice.call(arguments),r=u(t[t.length-1]||a)&&t.pop()||a;if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Error("pump requires two streams per minimum");var n=t.map(function(i,o){var a=o<t.length-1;return c(i,a,o>0,function(t){e||(e=t),t&&n.forEach(f),a||(n.forEach(f),r(e))})});return t.reduce(d)}}).call(this,r(9))},function(e,t){e.exports=r("iWIM")},function(e,t,r){(function(e){var n=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(i.call(setTimeout,n,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,n,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(n,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},r(203),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,r(10))},function(e,t,r){"use strict";var n=r(230),i=r(231);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}t.parse=v,t.resolve=function(e,t){return v(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?v(e,!1,!0).resolveObject(t):t},t.format=function(e){return i.isString(e)&&(e=v(e)),e instanceof o?e.format():o.prototype.format.call(e)},t.Url=o;var a=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),f=["'"].concat(c),d=["%","/","?",";","#"].concat(f),h=["/","?","#"],l=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,b={javascript:!0,"javascript:":!0},m={javascript:!0,"javascript:":!0},g={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=r(232);function v(e,t,r){if(e&&i.isObject(e)&&e instanceof o)return e;var n=new o;return n.parse(e,t,r),n}o.prototype.parse=function(e,t,r){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var o=e.indexOf("?"),s=-1!==o&&o<e.indexOf("#")?"?":"#",c=e.split(s);c[0]=c[0].replace(/\\/g,"/");var v=e=c.join(s);if(v=v.trim(),!r&&1===e.split("#").length){var w=u.exec(v);if(w)return this.path=v,this.href=v,this.pathname=w[1],w[2]?(this.search=w[2],this.query=t?y.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var _=a.exec(v);if(_){var S=(_=_[0]).toLowerCase();this.protocol=S,v=v.substr(_.length)}if(r||_||v.match(/^\/\/[^@\/]+@[^@\/]+/)){var E="//"===v.substr(0,2);!E||_&&m[_]||(v=v.substr(2),this.slashes=!0)}if(!m[_]&&(E||_&&!g[_])){for(var k,x,A=-1,O=0;O<h.length;O++)-1!==(M=v.indexOf(h[O]))&&(-1===A||M<A)&&(A=M);for(-1!==(x=-1===A?v.lastIndexOf("@"):v.lastIndexOf("@",A))&&(k=v.slice(0,x),v=v.slice(x+1),this.auth=decodeURIComponent(k)),A=-1,O=0;O<d.length;O++){var M;-1!==(M=v.indexOf(d[O]))&&(-1===A||M<A)&&(A=M)}-1===A&&(A=v.length),this.host=v.slice(0,A),v=v.slice(A),this.parseHost(),this.hostname=this.hostname||"";var j="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!j)for(var R=this.hostname.split(/\./),P=(O=0,R.length);O<P;O++){var T=R[O];if(T&&!T.match(l)){for(var I="",C=0,B=T.length;C<B;C++)T.charCodeAt(C)>127?I+="x":I+=T[C];if(!I.match(l)){var N=R.slice(0,O),L=R.slice(O+1),D=T.match(p);D&&(N.push(D[1]),L.unshift(D[2])),L.length&&(v="/"+L.join(".")+v),this.hostname=N.join(".");break}}}this.hostname=this.hostname.length>255?"":this.hostname.toLowerCase(),j||(this.hostname=n.toASCII(this.hostname));var q=this.port?":"+this.port:"";this.host=(this.hostname||"")+q,this.href+=this.host,j&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==v[0]&&(v="/"+v))}if(!b[S])for(O=0,P=f.length;O<P;O++){var U=f[O];if(-1!==v.indexOf(U)){var F=encodeURIComponent(U);F===U&&(F=escape(U)),v=v.split(U).join(F)}}var H=v.indexOf("#");-1!==H&&(this.hash=v.substr(H),v=v.slice(0,H));var z=v.indexOf("?");return-1!==z?(this.search=v.substr(z),this.query=v.substr(z+1),t&&(this.query=y.parse(this.query)),v=v.slice(0,z)):t&&(this.search="",this.query={}),v&&(this.pathname=v),g[S]&&this.hostname&&!this.pathname&&(this.pathname="/"),(this.pathname||this.search)&&(this.path=(q=this.pathname||"")+(this.search||"")),this.href=this.format(),this},o.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",o=!1,a="";this.host?o=e+this.host:this.hostname&&(o=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&i.isObject(this.query)&&Object.keys(this.query).length&&(a=y.stringify(this.query));var s=this.search||a&&"?"+a||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||g[t])&&!1!==o?(o="//"+(o||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):o||(o=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),t+o+(r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(s=s.replace("#","%23"))+n},o.prototype.resolve=function(e){return this.resolveObject(v(e,!1,!0)).format()},o.prototype.resolveObject=function(e){if(i.isString(e)){var t=new o;t.parse(e,!1,!0),e=t}for(var r=new o,n=Object.keys(this),a=0;a<n.length;a++){var s=n[a];r[s]=this[s]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var u=Object.keys(e),c=0;c<u.length;c++){var f=u[c];"protocol"!==f&&(r[f]=e[f])}return g[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!g[e.protocol]){for(var d=Object.keys(e),h=0;h<d.length;h++){var l=d[h];r[l]=e[l]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||m[e.protocol])r.pathname=e.pathname;else{for(var p=(e.pathname||"").split("/");p.length&&!(e.host=p.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),r.pathname=p.join("/")}return r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,(r.pathname||r.search)&&(r.path=(r.pathname||"")+(r.search||"")),r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var b=r.pathname&&"/"===r.pathname.charAt(0),y=e.host||e.pathname&&"/"===e.pathname.charAt(0),v=y||b||r.host&&e.pathname,w=v,_=r.pathname&&r.pathname.split("/")||[],S=(p=e.pathname&&e.pathname.split("/")||[],r.protocol&&!g[r.protocol]);if(S&&(r.hostname="",r.port=null,r.host&&(""===_[0]?_[0]=r.host:_.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===p[0]?p[0]=e.host:p.unshift(e.host)),e.host=null),v=v&&(""===p[0]||""===_[0])),y)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,_=p;else if(p.length)_||(_=[]),_.pop(),_=_.concat(p),r.search=e.search,r.query=e.query;else if(!i.isNullOrUndefined(e.search))return S&&(r.hostname=r.host=_.shift(),(O=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=O.shift(),r.host=r.hostname=O.shift())),r.search=e.search,r.query=e.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(!_.length)return r.pathname=null,r.path=r.search?"/"+r.search:null,r.href=r.format(),r;for(var E=_.slice(-1)[0],k=(r.host||e.host||_.length>1)&&("."===E||".."===E)||""===E,x=0,A=_.length;A>=0;A--)"."===(E=_[A])?_.splice(A,1):".."===E?(_.splice(A,1),x++):x&&(_.splice(A,1),x--);if(!v&&!w)for(;x--;x)_.unshift("..");!v||""===_[0]||_[0]&&"/"===_[0].charAt(0)||_.unshift(""),k&&"/"!==_.join("/").substr(-1)&&_.push("");var O,M=""===_[0]||_[0]&&"/"===_[0].charAt(0);return S&&(r.hostname=r.host=M?"":_.length?_.shift():"",(O=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=O.shift(),r.host=r.hostname=O.shift())),(v=v||r.host&&_.length)&&!M&&_.unshift(""),_.length?r.pathname=_.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=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t,r){"use strict";var n=r(28),i=r(22);function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}t.BlockHash=o,o.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending=this.pending?this.pending.concat(e):e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},o.prototype.digest=function(e){return this.update(this._pad()),i(null===this.pending),this._digest(e)},o.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},function(e,t,r){"use strict";var n=t;n.version=r(270).version,n.utils=r(23),n.rand=r(76),n.curve=r(134),n.curves=r(77),n.ec=r(276),n.eddsa=r(280)},function(e,t,r){(function(t){e.exports=function(e,r){for(var n=Math.min(e.length,r.length),i=new t(n),o=0;o<n;++o)i[o]=e[o]^r[o];return i}}).call(this,r(11).Buffer)},function(e,t,r){"use strict";const n=r(3),i=r(92).Reporter,o=r(90).Buffer;function a(e,t){i.call(this,t),o.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function s(e,t){if(Array.isArray(e))this.length=0,this.value=e.map(function(e){return s.isEncoderBuffer(e)||(e=new s(e,t)),this.length+=e.length,e},this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=o.byteLength(e);else{if(!o.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}n(a,i),t.DecoderBuffer=a,a.isDecoderBuffer=function(e){return e instanceof a||"object"==typeof e&&o.isBuffer(e.base)&&"DecoderBuffer"===e.constructor.name&&"number"==typeof e.offset&&"number"==typeof e.length&&"function"==typeof e.save&&"function"==typeof e.restore&&"function"==typeof e.isEmpty&&"function"==typeof e.readUInt8&&"function"==typeof e.skip&&"function"==typeof e.raw},a.prototype.save=function(){return{offset:this.offset,reporter:i.prototype.save.call(this)}},a.prototype.restore=function(e){const t=new a(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,i.prototype.restore.call(this,e.reporter),t},a.prototype.isEmpty=function(){return this.offset===this.length},a.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},a.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");const r=new a(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+e,this.offset+=e,r},a.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},t.EncoderBuffer=s,s.isEncoderBuffer=function(e){return e instanceof s||"object"==typeof e&&"EncoderBuffer"===e.constructor.name&&"number"==typeof e.length&&"function"==typeof e.join},s.prototype.join=function(e,t){return e||(e=o.alloc(this.length)),t||(t=0),0===this.length||(Array.isArray(this.value)?this.value.forEach(function(r){r.join(e,t),t+=r.length}):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):o.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(14);function i(e,t,r){try{Reflect.apply(e,t,r)}catch(e){setTimeout(()=>{throw e})}}t.default=class extends n.EventEmitter{emit(e,...t){let r="error"===e;const n=this._events;if(void 0!==n)r=r&&void 0===n.error;else if(!r)return!1;if(r){let e;if(t.length>0&&([e]=t),e instanceof Error)throw e;const r=new Error("Unhandled error."+(e?` (${e.message})`:""));throw r.context=e,r}const o=n[e];if(void 0===o)return!1;if("function"==typeof o)i(o,this,t);else{const e=o.length,r=function(e){const t=e.length,r=new Array(t);for(let n=0;n<t;n+=1)r[n]=e[n];return r}(o);for(let n=0;n<e;n+=1)i(r[n],this,t)}return!0}}},function(e,t,r){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,(function(t){return e[t]}).bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}([function(e,t){e.exports=r(12)},function(e,t){e.exports=r(100)},function(e,t){e.exports=r(15)},function(e,t){e.exports=r(2)},function(e,t,r){"use strict";r.r(t),r.d(t,"gatewayAuthHeader",function(){return b}),r.d(t,"gatewayEmbedHostHeader",function(){return m}),r.d(t,"setEmbedHost",function(){return g}),r.d(t,"clearEmbedHost",function(){return y}),r.d(t,"getEmbedHost",function(){return v}),r.d(t,"setAPIKey",function(){return w}),r.d(t,"clearAPIKey",function(){return _}),r.d(t,"getAPIKey",function(){return S}),r.d(t,"promiseTimeout",function(){return k}),r.d(t,"get",function(){return x}),r.d(t,"post",function(){return A}),r.d(t,"put",function(){return O}),r.d(t,"patch",function(){return M}),r.d(t,"remove",function(){return j}),r.d(t,"generateJsonRPCObject",function(){return R}),r.d(t,"promiseRace",function(){return P});var n=r(3),i=r.n(n),o=r(2),a=r.n(o),s=r(0),u=r.n(s),c=r(1),f=r.n(c);function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function h(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach(function(t){i()(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var l="torus-default",p="",b="x-api-key",m="x-embed-host";function g(e){p=e}function y(){p=""}function v(){return p}function w(e){l=e}function _(){l="torus-default"}function S(){return l}function E(){var e={};return l&&(e[b]=l),p&&(e[m]=p),e}var k=function(e,t){var r=new Promise(function(t,r){var n=setTimeout(function(){clearTimeout(n),r(new Error("Timed out in ".concat(e,"ms")))},e)});return Promise.race([t,r])},x=function(){var e=a()(u.a.mark(function e(t){var r,n,i,o,a=arguments;return u.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>1&&void 0!==a[1]?a[1]:{},n={mode:"cors",headers:{}},(a.length>2&&void 0!==a[2]?a[2]:{}).useAPIKey&&(n.headers=h(h({},n.headers),E())),i=f.a.all([n,r,{method:"GET"}]),e.next=7,fetch(t,i);case 7:if(!(o=e.sent).ok){e.next=10;break}return e.abrupt("return",o.json());case 10:throw o;case 11:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),A=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i={mode:"cors",headers:{"Content-Type":"application/json; charset=utf-8"}};n.useAPIKey&&(i.headers=h(h({},i.headers),E()));var o=f.a.all([i,r,{method:"POST"}]);return o.body=n.isUrlEncodedData?t:JSON.stringify(t),void 0===o.headers["Content-Type"]&&delete o.headers["Content-Type"],k(n.timeout||3e4,fetch(e,o).then(function(e){if(e.ok)return e.json();throw e}))},O=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i={mode:"cors",headers:{"Content-Type":"application/json; charset=utf-8"}};n.useAPIKey&&(i.headers=h(h({},i.headers),E()));var o=f.a.all([i,r,{method:"PUT"}]);return o.body=n.isUrlEncodedData?t:JSON.stringify(t),void 0===o.headers["Content-Type"]&&delete o.headers["Content-Type"],k(n.timeout||3e4,fetch(e,o).then(function(e){if(e.ok)return e.json();throw e}))},M=function(){var e=a()(u.a.mark(function e(t){var r,n,i,o,a,s,c=arguments;return u.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=c.length>1&&void 0!==c[1]?c[1]:{},n=c.length>2&&void 0!==c[2]?c[2]:{},o={mode:"cors",headers:{"Content-Type":"application/json; charset=utf-8"}},(i=c.length>3&&void 0!==c[3]?c[3]:{}).useAPIKey&&(o.headers=h(h({},o.headers),E())),(a=f.a.all([o,n,{method:"PATCH"}])).body=i.isUrlEncodedData?r:JSON.stringify(r),void 0===a.headers["Content-Type"]&&delete a.headers["Content-Type"],e.next=10,fetch(t,a);case 10:if(!(s=e.sent).ok){e.next=13;break}return e.abrupt("return",s.json());case 13:throw s;case 14:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),j=function(){var e=a()(u.a.mark(function e(t){var r,n,i,o,a=arguments;return u.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=a.length>2&&void 0!==a[2]?a[2]:{},n={mode:"cors",headers:{"Content-Type":"application/json; charset=utf-8"}},(a.length>3&&void 0!==a[3]?a[3]:{}).useAPIKey&&(n.headers=h(h({},n.headers),E())),i=f.a.all([n,r,{method:"DELETE"}]),e.next=8,fetch(t,i);case 8:if(!(o=e.sent).ok){e.next=11;break}return e.abrupt("return",o.json());case 11:throw o;case 12:case"end":return e.stop()}},e)}));return function(t){return e.apply(this,arguments)}}(),R=function(e,t){return{jsonrpc:"2.0",method:e,id:10,params:t}},P=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e4;return Promise.race([x(e,t),new Promise(function(e,t){setTimeout(function(){t(new Error("timed out"))},r)})])}}])},function(e,t,r){(t=e.exports=r(159)).Stream=t,t.Readable=t,t.Writable=r(163),t.Duplex=r(46),t.Transform=r(164),t.PassThrough=r(323),t.finished=r(88),t.pipeline=r(324)},function(e,t){e.exports=r("XH0y")},function(e,t){e.exports=r("cDf5")},function(e,t,r){"use strict";(function(t){e.exports=!t.version||0===t.version.indexOf("v0.")||0===t.version.indexOf("v1.")&&0!==t.version.indexOf("v1.8.")?function(e,r,n,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,a,s=arguments.length;switch(s){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick(function(){e.call(null,r)});case 3:return t.nextTick(function(){e.call(null,r,n)});case 4:return t.nextTick(function(){e.call(null,r,n,i)});default:for(o=new Array(s-1),a=0;a<o.length;)o[a++]=arguments[a];return t.nextTick(function(){e.apply(null,o)})}}:t.nextTick}).call(this,r(9))},function(e,t,r){"use strict";var n=r(1),i=r(23),o=i.getNAF,a=i.getJSF,s=i.assert;function u(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(e,t){s(e.precomputed);var r=e._getDoubles(),n=o(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var a,u,c=[];for(a=0;a<n.length;a+=r.step){u=0;for(var f=a+r.step-1;f>=a;f--)u=(u<<1)+n[f];c.push(u)}for(var d=this.jpoint(null,null,null),h=this.jpoint(null,null,null),l=i;l>0;l--){for(a=0;a<c.length;a++)(u=c[a])===l?h=h.mixedAdd(r.points[a]):u===-l&&(h=h.mixedAdd(r.points[a].neg()));d=d.add(h)}return d.toP()},u.prototype._wnafMul=function(e,t){for(var r=4,n=e._getNAFPoints(r),i=n.points,a=o(t,r=n.wnd,this._bitLength),u=this.jpoint(null,null,null),c=a.length-1;c>=0;c--){for(var f=0;c>=0&&0===a[c];c--)f++;if(c>=0&&f++,u=u.dblp(f),c<0)break;var d=a[c];s(0!==d),u="affine"===e.type?u.mixedAdd(d>0?i[d-1>>1]:i[-d-1>>1].neg()):u.add(d>0?i[d-1>>1]:i[-d-1>>1].neg())}return"affine"===e.type?u.toP():u},u.prototype._wnafMulAdd=function(e,t,r,n,i){var s,u,c,f=this._wnafT1,d=this._wnafT2,h=this._wnafT3,l=0;for(s=0;s<n;s++){var p=(c=t[s])._getNAFPoints(e);f[s]=p.wnd,d[s]=p.points}for(s=n-1;s>=1;s-=2){var b=s-1,m=s;if(1===f[b]&&1===f[m]){var g=[t[b],null,null,t[m]];0===t[b].y.cmp(t[m].y)?(g[1]=t[b].add(t[m]),g[2]=t[b].toJ().mixedAdd(t[m].neg())):0===t[b].y.cmp(t[m].y.redNeg())?(g[1]=t[b].toJ().mixedAdd(t[m]),g[2]=t[b].add(t[m].neg())):(g[1]=t[b].toJ().mixedAdd(t[m]),g[2]=t[b].toJ().mixedAdd(t[m].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],v=a(r[b],r[m]);for(l=Math.max(v[0].length,l),h[b]=new Array(l),h[m]=new Array(l),u=0;u<l;u++)h[b][u]=y[3*(1+(0|v[0][u]))+(1+(0|v[1][u]))],h[m][u]=0,d[b]=g}else h[b]=o(r[b],f[b],this._bitLength),h[m]=o(r[m],f[m],this._bitLength),l=Math.max(h[b].length,l),l=Math.max(h[m].length,l)}var w=this.jpoint(null,null,null),_=this._wnafT4;for(s=l;s>=0;s--){for(var S=0;s>=0;){var E=!0;for(u=0;u<n;u++)_[u]=0|h[u][s],0!==_[u]&&(E=!1);if(!E)break;S++,s--}if(s>=0&&S++,w=w.dblp(S),s<0)break;for(u=0;u<n;u++){var k=_[u];0!==k&&(k>0?c=d[u][k-1>>1]:k<0&&(c=d[u][-k-1>>1].neg()),w="affine"===c.type?w.mixedAdd(c):w.add(c))}}for(s=0;s<n;s++)d[s]=null;return i?w:w.toP()},u.BasePoint=c,c.prototype.eq=function(){throw new Error("Not implemented")},c.prototype.validate=function(){return this.curve.validate(this)},u.prototype.decodePoint=function(e,t){e=i.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?s(e[e.length-1]%2==0):7===e[0]&&s(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},c.prototype.encodeCompressed=function(e){return this.encode(e,!0)},c.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},c.prototype.encode=function(e,t){return i.encode(this._encode(t),e)},c.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},c.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},c.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},c.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},c.prototype._getBeta=function(){return null},c.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},function(e,t,r){var n=r(6).Buffer;function i(e){n.isBuffer(e)||(e=n.from(e));for(var t=e.length/4|0,r=new Array(t),i=0;i<t;i++)r[i]=e.readUInt32BE(4*i);return r}function o(e){for(;0<e.length;e++)e[0]=0}function a(e,t,r,n,i){for(var o,a,s,u,c=r[0],f=r[1],d=r[2],h=r[3],l=e[0]^t[0],p=e[1]^t[1],b=e[2]^t[2],m=e[3]^t[3],g=4,y=1;y<i;y++)o=c[l>>>24]^f[p>>>16&255]^d[b>>>8&255]^h[255&m]^t[g++],a=c[p>>>24]^f[b>>>16&255]^d[m>>>8&255]^h[255&l]^t[g++],s=c[b>>>24]^f[m>>>16&255]^d[l>>>8&255]^h[255&p]^t[g++],u=c[m>>>24]^f[l>>>16&255]^d[p>>>8&255]^h[255&b]^t[g++],l=o,p=a,b=s,m=u;return o=(n[l>>>24]<<24|n[p>>>16&255]<<16|n[b>>>8&255]<<8|n[255&m])^t[g++],a=(n[p>>>24]<<24|n[b>>>16&255]<<16|n[m>>>8&255]<<8|n[255&l])^t[g++],s=(n[b>>>24]<<24|n[m>>>16&255]<<16|n[l>>>8&255]<<8|n[255&p])^t[g++],u=(n[m>>>24]<<24|n[l>>>16&255]<<16|n[p>>>8&255]<<8|n[255&b])^t[g++],[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 e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<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;r[a]=c=c>>>8^255&c^99,n[c]=a;var f=e[a],d=e[f],h=e[d],l=257*e[c]^16843008*c;i[0][a]=l<<24|l>>>8,i[1][a]=l<<16|l>>>16,i[2][a]=l<<8|l>>>24,i[3][a]=l,o[0][c]=(l=16843009*h^65537*d^257*f^16843008*a)<<24|l>>>8,o[1][c]=l<<16|l>>>16,o[2][c]=l<<8|l>>>24,o[3][c]=l,0===a?a=s=1:(a=f^e[e[e[h^f]]],s^=e[e[s]])}return{SBOX:r,INV_SBOX:n,SUB_MIX:i,INV_SUB_MIX:o}}();function c(e){this._key=i(e),this._reset()}c.blockSize=16,c.keySize=32,c.prototype.blockSize=c.blockSize,c.prototype.keySize=c.keySize,c.prototype._reset=function(){for(var e=this._key,t=e.length,r=t+6,n=4*(r+1),i=[],o=0;o<t;o++)i[o]=e[o];for(o=t;o<n;o++){var a=i[o-1];o%t==0?(a=u.SBOX[(a=a<<8|a>>>24)>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a],a^=s[o/t|0]<<24):t>6&&o%t==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-t]^a}for(var c=[],f=0;f<n;f++){var d=n-f,h=i[d-(f%4?0:4)];c[f]=f<4||d<=4?h:u.INV_SUB_MIX[0][u.SBOX[h>>>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(e){return a(e=i(e),this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},c.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),r=n.allocUnsafe(16);return r.writeUInt32BE(t[0],0),r.writeUInt32BE(t[1],4),r.writeUInt32BE(t[2],8),r.writeUInt32BE(t[3],12),r},c.prototype.decryptBlock=function(e){var t=(e=i(e))[1];e[1]=e[3],e[3]=t;var r=a(e,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)},e.exports.AES=c},function(e,t,r){var n=r(6).Buffer,i=r(78);e.exports=function(e,t,r,o){if(n.isBuffer(e)||(e=n.from(e,"binary")),t&&(n.isBuffer(t)||(t=n.from(t,"binary")),8!==t.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(e),t&&f.update(t),c=f.digest();var d=0;if(a>0){var h=s.length-a;d=Math.min(a,c.length),c.copy(s,h,0,d),a-=d}if(d<c.length&&o>0){var l=u.length-o,p=Math.min(o,c.length-d);c.copy(u,l,d,d+p),o-=p}}return c.fill(0),{key:s,iv:u}}},function(e,t,r){var n=r(326),i=r(333),o=r(334),a=r(86),s=r(145),u=r(6).Buffer;function c(e){var t;"object"!=typeof e||u.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=u.from(e));var r,c,f=o(e,t),d=f.tag,h=f.data;switch(d){case"CERTIFICATE":c=n.certificate.decode(h,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(c||(c=n.PublicKey.decode(h,"der")),r=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 "+r)}case"ENCRYPTED PRIVATE KEY":h=function(e,t){var r=e.algorithm.decrypt.kde.kdeparams.salt,n=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),o=i[e.algorithm.decrypt.cipher.algo.join(".")],c=e.algorithm.decrypt.cipher.iv,f=e.subjectPrivateKey,d=parseInt(o.split("-")[1],10)/8,h=s.pbkdf2Sync(t,r,n,d,"sha1"),l=a.createDecipheriv(o,h,c),p=[];return p.push(l.update(f)),p.push(l.final()),u.concat(p)}(h=n.EncryptedPrivateKey.decode(h,"der"),t);case"PRIVATE KEY":switch(r=(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 "+r)}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 "+d)}}e.exports=c,c.signature=n.signature},function(e,t,r){var n=r(366);function i(e){var t=function(){return t.called?t.value:(t.called=!0,t.value=e.apply(this,arguments))};return t.called=!1,t}function o(e){var t=function(){if(t.called)throw new Error(t.onceError);return t.called=!0,t.value=e.apply(this,arguments)};return t.onceError=(e.name||"Function wrapped with `once`")+" shouldn't be called more than once",t.called=!1,t}e.exports=n(i),e.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(e,t,r){(function(t){var n=r(67),i=function(){},o=function(e,r,a){if("function"==typeof r)return o(e,null,r);r||(r={}),a=n(a||i);var s=e._writableState,u=e._readableState,c=r.readable||!1!==r.readable&&e.readable,f=r.writable||!1!==r.writable&&e.writable,d=!1,h=function(){e.writable||l()},l=function(){f=!1,c||a.call(e)},p=function(){c=!1,f||a.call(e)},b=function(t){a.call(e,t?new Error("exited with error code: "+t):null)},m=function(t){a.call(e,t)},g=function(){t.nextTick(y)},y=function(){if(!d)return(!c||u&&u.ended&&!u.destroyed)&&(!f||s&&s.ended&&!s.destroyed)?void 0:a.call(e,new Error("premature close"))},v=function(){e.req.on("finish",l)};return function(e){return e.setHeader&&"function"==typeof e.abort}(e)?(e.on("complete",l),e.on("abort",g),e.req?v():e.on("request",v)):f&&!s&&(e.on("end",h),e.on("close",h)),function(e){return e.stdio&&Array.isArray(e.stdio)&&3===e.stdio.length}(e)&&e.on("exit",b),e.on("end",p),e.on("finish",l),!1!==r.error&&e.on("error",m),e.on("close",g),function(){d=!0,e.removeListener("complete",l),e.removeListener("abort",g),e.removeListener("request",v),e.req&&e.req.removeListener("finish",l),e.removeListener("end",h),e.removeListener("close",h),e.removeListener("finish",l),e.removeListener("exit",b),e.removeListener("end",p),e.removeListener("error",m),e.removeListener("close",g)}};e.exports=o}).call(this,r(9))},function(e){e.exports=JSON.parse('{"a":"@toruslabs/torus-embed","b":"1.12.1"}')},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BasePostMessageStream=void 0;const n=r(198);function i(){}t.BasePostMessageStream=class extends n.Duplex{constructor(){super({objectMode:!0}),this._init=!1,this._haveSyn=!1}_handshake(){this._write("SYN",null,i),this.cork()}_onData(e){if(this._init)try{this.push(e)}catch(e){this.emit("error",e)}else"SYN"===e?(this._haveSyn=!0,this._write("ACK",null,i)):"ACK"===e&&(this._init=!0,this._haveSyn||this._write("ACK",null,i),this.uncork())}_read(){}_write(e,t,r){this._postMessage(e),r()}}},function(e,t,r){var n=r(11),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){"use strict";var n=Object.prototype.hasOwnProperty,i="~";function o(){}function a(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function s(e,t,r,n,o){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new a(r,n||e,o),u=i?i+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function u(e,t){0==--e._eventsCount?e._events=new o:delete e._events[t]}function c(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(i=!1)),c.prototype.eventNames=function(){var e,t,r=[];if(0===this._eventsCount)return r;for(t in e=this._events)n.call(e,t)&&r.push(i?t.slice(1):t);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},c.prototype.listeners=function(e){var t=this._events[i?i+e:e];if(!t)return[];if(t.fn)return[t.fn];for(var r=0,n=t.length,o=new Array(n);r<n;r++)o[r]=t[r].fn;return o},c.prototype.listenerCount=function(e){var t=this._events[i?i+e:e];return t?t.fn?1:t.length:0},c.prototype.emit=function(e,t,r,n,o,a){var s=i?i+e:e;if(!this._events[s])return!1;var u,c,f=this._events[s],d=arguments.length;if(f.fn){switch(f.once&&this.removeListener(e,f.fn,void 0,!0),d){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,t),!0;case 3:return f.fn.call(f.context,t,r),!0;case 4:return f.fn.call(f.context,t,r,n),!0;case 5:return f.fn.call(f.context,t,r,n,o),!0;case 6:return f.fn.call(f.context,t,r,n,o,a),!0}for(c=1,u=new Array(d-1);c<d;c++)u[c-1]=arguments[c];f.fn.apply(f.context,u)}else{var h,l=f.length;for(c=0;c<l;c++)switch(f[c].once&&this.removeListener(e,f[c].fn,void 0,!0),d){case 1:f[c].fn.call(f[c].context);break;case 2:f[c].fn.call(f[c].context,t);break;case 3:f[c].fn.call(f[c].context,t,r);break;case 4:f[c].fn.call(f[c].context,t,r,n);break;default:if(!u)for(h=1,u=new Array(d-1);h<d;h++)u[h-1]=arguments[h];f[c].fn.apply(f[c].context,u)}}return!0},c.prototype.on=function(e,t,r){return s(this,e,t,r,!1)},c.prototype.once=function(e,t,r){return s(this,e,t,r,!0)},c.prototype.removeListener=function(e,t,r,n){var o=i?i+e:e;if(!this._events[o])return this;if(!t)return u(this,o),this;var a=this._events[o];if(a.fn)a.fn!==t||n&&!a.once||r&&a.context!==r||u(this,o);else{for(var s=0,c=[],f=a.length;s<f;s++)(a[s].fn!==t||n&&!a[s].once||r&&a[s].context!==r)&&c.push(a[s]);c.length?this._events[o]=1===c.length?c[0]:c:u(this,o)}return this},c.prototype.removeAllListeners=function(e){var t;return e?this._events[t=i?i+e:e]&&u(this,t):(this._events=new o,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=i,c.EventEmitter=c,e.exports=c},function(e,t,r){(function(e){var n=r(242),i=r(118),o=r(125),a=r(248),s=r(52),u=t;u.request=function(t,r){t="string"==typeof t?s.parse(t):o(t);var i=-1===e.location.protocol.search(/^https?:$/)?"http:":"",a=t.protocol||i,u=t.hostname||t.host,c=t.port,f=t.path||"/";u&&-1!==u.indexOf(":")&&(u="["+u+"]"),t.url=(u?a+"//"+u:"")+(c?":"+c:"")+f,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{};var d=new n(t);return r&&d.on("response",r),d},u.get=function(e,t){var r=u.request(e,t);return r.end(),r},u.ClientRequest=n,u.IncomingMessage=i.IncomingMessage,u.Agent=function(){},u.Agent.defaultMaxSockets=4,u.globalAgent=new u.Agent,u.STATUS_CODES=a,u.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,r(10))},function(e,t,r){var n=r(11),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(){this.listeners={}}return e.prototype.addEventListener=function(e,t){e=e.toLowerCase(),this.listeners[e]=this.listeners[e]||[],this.listeners[e].push(t.handleEvent||t)},e.prototype.removeEventListener=function(e,t){if(e=e.toLowerCase(),this.listeners[e]){var r=this.listeners[e].indexOf(t.handleEvent||t);r<0||this.listeners[e].splice(r,1)}},e.prototype.dispatchEvent=function(e){var t=e.type.toLowerCase();if(e.target=this,this.listeners[t])for(var r=0,n=this.listeners[t];r<n.length;r++)n[r].call(this,e);var i=this["on"+t];return i&&i.call(this,e),!0},e}();t.XMLHttpRequestEventTarget=n},function(e,t,r){var n;function i(e){this.rand=e}if(e.exports=function(e){return n||(n=new i(null)),n.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=r(271);if("function"!=typeof o.randomBytes)throw new Error("Not supported");i.prototype._rand=function(e){return o.randomBytes(e)}}catch(e){}},function(e,t,r){"use strict";var n,i=t,o=r(20),a=r(134),s=r(23).assert;function u(e){this.curve="short"===e.type?new a.short(e):"edwards"===e.type?new a.edwards(e):new a.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new u(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=u,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(275)}catch(e){n=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},function(e,t,r){"use strict";var n=r(3),i=r(135),o=r(6).Buffer,a=new Array(16);function s(){i.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function u(e,t){return e<<t|e>>>32-t}function c(e,t,r,n,i,o,a){return u(e+(t&r|~t&n)+i+o|0,a)+t|0}function f(e,t,r,n,i,o,a){return u(e+(t&n|r&~n)+i+o|0,a)+t|0}function d(e,t,r,n,i,o,a){return u(e+(t^r^n)+i+o|0,a)+t|0}function h(e,t,r,n,i,o,a){return u(e+(r^(t|~n))+i+o|0,a)+t|0}n(s,i),s.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var r=this._a,n=this._b,i=this._c,o=this._d;r=c(r,n,i,o,e[0],3614090360,7),o=c(o,r,n,i,e[1],3905402710,12),i=c(i,o,r,n,e[2],606105819,17),n=c(n,i,o,r,e[3],3250441966,22),r=c(r,n,i,o,e[4],4118548399,7),o=c(o,r,n,i,e[5],1200080426,12),i=c(i,o,r,n,e[6],2821735955,17),n=c(n,i,o,r,e[7],4249261313,22),r=c(r,n,i,o,e[8],1770035416,7),o=c(o,r,n,i,e[9],2336552879,12),i=c(i,o,r,n,e[10],4294925233,17),n=c(n,i,o,r,e[11],2304563134,22),r=c(r,n,i,o,e[12],1804603682,7),o=c(o,r,n,i,e[13],4254626195,12),i=c(i,o,r,n,e[14],2792965006,17),r=f(r,n=c(n,i,o,r,e[15],1236535329,22),i,o,e[1],4129170786,5),o=f(o,r,n,i,e[6],3225465664,9),i=f(i,o,r,n,e[11],643717713,14),n=f(n,i,o,r,e[0],3921069994,20),r=f(r,n,i,o,e[5],3593408605,5),o=f(o,r,n,i,e[10],38016083,9),i=f(i,o,r,n,e[15],3634488961,14),n=f(n,i,o,r,e[4],3889429448,20),r=f(r,n,i,o,e[9],568446438,5),o=f(o,r,n,i,e[14],3275163606,9),i=f(i,o,r,n,e[3],4107603335,14),n=f(n,i,o,r,e[8],1163531501,20),r=f(r,n,i,o,e[13],2850285829,5),o=f(o,r,n,i,e[2],4243563512,9),i=f(i,o,r,n,e[7],1735328473,14),r=d(r,n=f(n,i,o,r,e[12],2368359562,20),i,o,e[5],4294588738,4),o=d(o,r,n,i,e[8],2272392833,11),i=d(i,o,r,n,e[11],1839030562,16),n=d(n,i,o,r,e[14],4259657740,23),r=d(r,n,i,o,e[1],2763975236,4),o=d(o,r,n,i,e[4],1272893353,11),i=d(i,o,r,n,e[7],4139469664,16),n=d(n,i,o,r,e[10],3200236656,23),r=d(r,n,i,o,e[13],681279174,4),o=d(o,r,n,i,e[0],3936430074,11),i=d(i,o,r,n,e[3],3572445317,16),n=d(n,i,o,r,e[6],76029189,23),r=d(r,n,i,o,e[9],3654602809,4),o=d(o,r,n,i,e[12],3873151461,11),i=d(i,o,r,n,e[15],530742520,16),r=h(r,n=d(n,i,o,r,e[2],3299628645,23),i,o,e[0],4096336452,6),o=h(o,r,n,i,e[7],1126891415,10),i=h(i,o,r,n,e[14],2878612391,15),n=h(n,i,o,r,e[5],4237533241,21),r=h(r,n,i,o,e[12],1700485571,6),o=h(o,r,n,i,e[3],2399980690,10),i=h(i,o,r,n,e[10],4293915773,15),n=h(n,i,o,r,e[1],2240044497,21),r=h(r,n,i,o,e[8],1873313359,6),o=h(o,r,n,i,e[15],4264355552,10),i=h(i,o,r,n,e[6],2734768916,15),n=h(n,i,o,r,e[13],1309151649,21),r=h(r,n,i,o,e[4],4149444226,6),o=h(o,r,n,i,e[11],3174756917,10),i=h(i,o,r,n,e[2],718787259,15),n=h(n,i,o,r,e[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+n|0,this._c=this._c+i|0,this._d=this._d+o|0},s.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=o.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},e.exports=s},function(e,t,r){e.exports=i;var n=r(14).EventEmitter;function i(){n.call(this)}r(3)(i,n),i.Readable=r(80),i.Writable=r(288),i.Duplex=r(289),i.Transform=r(290),i.PassThrough=r(291),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",s),r.on("close",u));var a=!1;function s(){a||(a=!0,e.end())}function u(){a||(a=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(f(),0===n.listenerCount(this,"error"))throw e}function f(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",s),r.removeListener("close",u),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",f),r.removeListener("close",f),e.removeListener("close",f)}return r.on("error",c),e.on("error",c),r.on("end",f),r.on("close",f),e.on("close",f),e.emit("pipe",r),e}},function(e,t,r){(t=e.exports=r(136)).Stream=t,t.Readable=t,t.Writable=r(82),t.Duplex=r(37),t.Transform=r(139),t.PassThrough=r(287)},function(e,t,r){var n=r(11),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){"use strict";(function(t,n,i){var o=r(17);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(void 0),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=y;var s,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?n:o.nextTick;y.WritableState=g;var c=Object.create(r(13));c.inherits=r(3);var f,d={deprecate:r(42)},h=r(137),l=r(81).Buffer,p=i.Uint8Array||function(){},b=r(138);function m(){}function g(e,t){s=s||r(37);var n=t instanceof s;this.objectMode=!!(e=e||{}).objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,c=e.writableHighWaterMark;this.highWaterMark=i||0===i?i:n&&(c||0===c)?c:this.objectMode?16:16384,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1,this.decodeStrings=!(!1===e.decodeStrings),this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(o.nextTick(i,n),o.nextTick(k,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),k(e,t))}(e,r,n,t,i);else{var a=S(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||_(e,r),n?u(w,e,r,a,i):w(e,r,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function y(e){if(s=s||r(37),!(f.call(y,this)||this instanceof s))return new y(e);this._writableState=new g(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),h.call(this)}function v(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function w(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),k(e,t)}function _(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=new Array(t.bufferedRequestCount),i=t.corkedRequestsFree;i.entry=r;for(var o=0,s=!0;r;)n[o]=r,r.isBuf||(s=!1),r=r.next,o+=1;n.allBuffers=s,v(e,t,!0,t.length,n,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk;if(v(e,t,!1,t.objectMode?1:u.length,u,r.encoding,r.callback),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function S(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function E(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),k(e,t)})}function k(e,t){var r=S(t);return r&&(function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(E,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}c.inherits(y,h),g.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(g.prototype,"buffer",{get:d.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(e){return!!f.call(this,e)||this===y&&e&&e._writableState instanceof g}})):f=function(e){return e instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(e,t,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(l.isBuffer(n=e)||n instanceof p);return s&&!l.isBuffer(e)&&(e=function(e){return l.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=m),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),o.nextTick(t,r)}(this,r):(s||function(e,t,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),o.nextTick(n,a),i=!1),i}(this,i,e,r))&&(i.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=l.from(t,r)),t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else v(e,t,!1,s,n,i,o);return u}(this,i,s,e,t,r)),a},y.prototype.cork=function(){this._writableState.corked++},y.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||_(this,e))},y.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,k(e,t),r&&(t.finished?o.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=b.destroy,y.prototype._undestroy=b.undestroy,y.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(9),r(51).setImmediate,r(10))},function(e,t,r){"use strict";var n=r(11).Buffer,i=r(3),o=r(135),a=new Array(16),s=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],u=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],c=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],f=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],d=[0,1518500249,1859775393,2400959708,2840853838],h=[1352829926,1548603684,1836072691,2053994217,0];function l(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(e,t){return e<<t|e>>>32-t}function b(e,t,r,n,i,o,a,s){return p(e+(t^r^n)+o+a|0,s)+i|0}function m(e,t,r,n,i,o,a,s){return p(e+(t&r|~t&n)+o+a|0,s)+i|0}function g(e,t,r,n,i,o,a,s){return p(e+((t|~r)^n)+o+a|0,s)+i|0}function y(e,t,r,n,i,o,a,s){return p(e+(t&n|r&~n)+o+a|0,s)+i|0}function v(e,t,r,n,i,o,a,s){return p(e+(t^(r|~n))+o+a|0,s)+i|0}i(l,o),l.prototype._update=function(){for(var e=a,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var r=0|this._a,n=0|this._b,i=0|this._c,o=0|this._d,l=0|this._e,w=0|this._a,_=0|this._b,S=0|this._c,E=0|this._d,k=0|this._e,x=0;x<80;x+=1){var A,O;x<16?(A=b(r,n,i,o,l,e[s[x]],d[0],c[x]),O=v(w,_,S,E,k,e[u[x]],h[0],f[x])):x<32?(A=m(r,n,i,o,l,e[s[x]],d[1],c[x]),O=y(w,_,S,E,k,e[u[x]],h[1],f[x])):x<48?(A=g(r,n,i,o,l,e[s[x]],d[2],c[x]),O=g(w,_,S,E,k,e[u[x]],h[2],f[x])):x<64?(A=y(r,n,i,o,l,e[s[x]],d[3],c[x]),O=m(w,_,S,E,k,e[u[x]],h[3],f[x])):(A=v(r,n,i,o,l,e[s[x]],d[4],c[x]),O=b(w,_,S,E,k,e[u[x]],h[4],f[x])),r=l,l=o,o=p(i,10),i=n,n=A,w=k,k=E,E=p(S,10),S=_,_=O}var M=this._b+i+E|0;this._b=this._c+o+k|0,this._c=this._d+l+w|0,this._d=this._e+r+_|0,this._e=this._a+n+S|0,this._a=M},l.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=n.alloc?n.alloc(20):new n(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},e.exports=l},function(e,t,r){(t=e.exports=function(e){e=e.toLowerCase();var r=t[e];if(!r)throw new Error(e+" is not supported (we accept pull requests)");return new r}).sha=r(292),t.sha1=r(293),t.sha224=r(294),t.sha256=r(140),t.sha384=r(295),t.sha512=r(141)},function(e,t,r){"use strict";var n=r(22);function i(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}e.exports=i,i.prototype._init=function(){},i.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},i.prototype._buffer=function(e,t){for(var r=Math.min(this.buffer.length-this.bufferOff,e.length-t),n=0;n<r;n++)this.buffer[this.bufferOff+n]=e[t+n];return this.bufferOff+=r,r},i.prototype._flushBuffer=function(e,t){return this._update(this.buffer,0,e,t),this.bufferOff=0,this.blockSize},i.prototype._updateEncrypt=function(e){var t=0,r=0,n=new Array(((this.bufferOff+e.length)/this.blockSize|0)*this.blockSize);0!==this.bufferOff&&(t+=this._buffer(e,t),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(n,r)));for(var i=e.length-(e.length-t)%this.blockSize;t<i;t+=this.blockSize)this._update(e,t,n,r),r+=this.blockSize;for(;t<e.length;t++,this.bufferOff++)this.buffer[this.bufferOff]=e[t];return n},i.prototype._updateDecrypt=function(e){for(var t=0,r=0,n=Math.ceil((this.bufferOff+e.length)/this.blockSize)-1,i=new Array(n*this.blockSize);n>0;n--)t+=this._buffer(e,t),r+=this._flushBuffer(i,r);return t+=this._buffer(e,t),i},i.prototype.final=function(e){var t,r;return e&&(t=this.update(e)),r="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(r):r},i.prototype._pad=function(e,t){if(0===t)return!1;for(;t<e.length;)e[t++]=0;return!0},i.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var e=new Array(this.blockSize);return this._update(this.buffer,0,e,0),e},i.prototype._unpad=function(e){return e},i.prototype._finalDecrypt=function(){n.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var e=new Array(this.blockSize);return this._flushBuffer(e,0),this._unpad(e)}},function(e,t,r){var n=r(304),i=r(312),o=r(154);t.createCipher=t.Cipher=n.createCipher,t.createCipheriv=t.Cipheriv=n.createCipheriv,t.createDecipher=t.Decipher=i.createDecipher,t.createDecipheriv=t.Decipheriv=i.createDecipheriv,t.listCiphers=t.getCiphers=function(){return Object.keys(o)}},function(e,t,r){var n={ECB:r(305),CBC:r(306),CFB:r(307),CFB8:r(308),CFB1:r(309),OFB:r(310),CTR:r(152),GCM:r(152)},i=r(154);for(var o in i)i[o].module=n[i[o].mode];e.exports=i},function(e,t,r){"use strict";var n=r(45).codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(o||i);var a=r.readable||!1!==r.readable&&t.readable,s=r.writable||!1!==r.writable&&t.writable,u=function(){t.writable||f()},c=t._writableState&&t._writableState.finished,f=function(){s=!1,c=!0,a||o.call(t)},d=t._readableState&&t._readableState.endEmitted,h=function(){a=!1,d=!0,s||o.call(t)},l=function(e){o.call(t,e)},p=function(){var e;return a&&!d?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):s&&!c?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},b=function(){t.req.on("finish",f)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",f),t.on("abort",p),t.req?b():t.on("request",b)):s&&!t._writableState&&(t.on("end",u),t.on("close",u)),t.on("end",h),t.on("finish",f),!1!==r.error&&t.on("error",l),t.on("close",p),function(){t.removeListener("complete",f),t.removeListener("abort",p),t.removeListener("request",b),t.req&&t.req.removeListener("finish",f),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",f),t.removeListener("end",h),t.removeListener("error",l),t.removeListener("close",p)}}},function(e,t,r){(function(t){var n=r(1),i=r(36);function o(e){var t,r=e.modulus.byteLength();do{t=new n(i(r))}while(t.cmp(e.modulus)>=0||!t.umod(e.prime1)||!t.umod(e.prime2));return t}function a(e,r){var i=function(e){var t=o(e);return{blinder:t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(r),a=r.modulus.byteLength(),s=new n(e).mul(i.blinder).umod(r.modulus),u=s.toRed(n.mont(r.prime1)),c=s.toRed(n.mont(r.prime2)),f=r.coefficient,d=r.prime1,h=r.prime2,l=u.redPow(r.exponent1).fromRed(),p=c.redPow(r.exponent2).fromRed(),b=l.isub(p).imul(f).umod(d).imul(h);return p.iadd(b).imul(i.unblinder).umod(r.modulus).toArrayLike(t,"be",a)}a.getr=o,e.exports=a}).call(this,r(11).Buffer)},function(e,t,r){"use strict";(function(t){var n,i=r(11),o=i.Buffer,a={};for(n in i)i.hasOwnProperty(n)&&"SlowBuffer"!==n&&"Buffer"!==n&&(a[n]=i[n]);var s=a.Buffer={};for(n in o)o.hasOwnProperty(n)&&"allocUnsafe"!==n&&"allocUnsafeSlow"!==n&&(s[n]=o[n]);if(a.Buffer.prototype=o.prototype,s.from&&s.from!==Uint8Array.from||(s.from=function(e,t,r){if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&void 0===e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return o(e,t,r)}),s.alloc||(s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var n=o(e);return t&&0!==t.length?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n}),!a.kStringMaxLength)try{a.kStringMaxLength=t.binding("buffer").kStringMaxLength}catch(e){}a.constants||(a.constants={MAX_LENGTH:a.kMaxLength},a.kStringMaxLength&&(a.constants.MAX_STRING_LENGTH=a.kStringMaxLength)),e.exports=a}).call(this,r(9))},function(e,t,r){"use strict";const n=r(92).Reporter,i=r(56).EncoderBuffer,o=r(56).DecoderBuffer,a=r(22),s=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],u=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(s);function c(e,t,r){const n={};this._baseState=n,n.name=r,n.enc=e,n.parent=t||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}e.exports=c;const f=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];c.prototype.clone=function(){const e=this._baseState,t={};f.forEach(function(r){t[r]=e[r]});const r=new this.constructor(t.parent);return r._baseState=t,r},c.prototype._wrap=function(){const e=this._baseState;u.forEach(function(t){this[t]=function(){const r=new this.constructor(this);return e.children.push(r),r[t].apply(r,arguments)}},this)},c.prototype._init=function(e){const t=this._baseState;a(null===t.parent),e.call(this),t.children=t.children.filter(function(e){return e._baseState.parent===this},this),a.equal(t.children.length,1,"Root node can have only one child")},c.prototype._useArgs=function(e){const t=this._baseState,r=e.filter(function(e){return e instanceof this.constructor},this);e=e.filter(function(e){return!(e instanceof this.constructor)},this),0!==r.length&&(a(null===t.children),t.children=r,r.forEach(function(e){e._baseState.parent=this},this)),0!==e.length&&(a(null===t.args),t.args=e,t.reverseArgs=e.map(function(e){if("object"!=typeof e||e.constructor!==Object)return e;const t={};return Object.keys(e).forEach(function(r){r==(0|r)&&(r|=0),t[e[r]]=r}),t}))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach(function(e){c.prototype[e]=function(){throw new Error(e+" not implemented for encoding: "+this._baseState.enc)}}),s.forEach(function(e){c.prototype[e]=function(){const t=this._baseState,r=Array.prototype.slice.call(arguments);return a(null===t.tag),t.tag=e,this._useArgs(r),this}}),c.prototype.use=function(e){a(e);const t=this._baseState;return a(null===t.use),t.use=e,this},c.prototype.optional=function(){return this._baseState.optional=!0,this},c.prototype.def=function(e){const t=this._baseState;return a(null===t.default),t.default=e,t.optional=!0,this},c.prototype.explicit=function(e){const t=this._baseState;return a(null===t.explicit&&null===t.implicit),t.explicit=e,this},c.prototype.implicit=function(e){const t=this._baseState;return a(null===t.explicit&&null===t.implicit),t.implicit=e,this},c.prototype.obj=function(){const e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},c.prototype.key=function(e){const t=this._baseState;return a(null===t.key),t.key=e,this},c.prototype.any=function(){return this._baseState.any=!0,this},c.prototype.choice=function(e){const t=this._baseState;return a(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map(function(t){return e[t]})),this},c.prototype.contains=function(e){const t=this._baseState;return a(null===t.use),t.contains=e,this},c.prototype._decode=function(e,t){const r=this._baseState;if(null===r.parent)return e.wrapResult(r.children[0]._decode(e,t));let n,i=r.default,a=!0,s=null;if(null!==r.key&&(s=e.enterKey(r.key)),r.optional){let n=null;if(null!==r.explicit?n=r.explicit:null!==r.implicit?n=r.implicit:null!==r.tag&&(n=r.tag),null!==n||r.any){if(a=this._peekTag(e,n,r.any),e.isError(a))return a}else{const n=e.save();try{null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t),a=!0}catch(e){a=!1}e.restore(n)}}if(r.obj&&a&&(n=e.enterObject()),a){if(null!==r.explicit){const t=this._decodeTag(e,r.explicit);if(e.isError(t))return t;e=t}const n=e.offset;if(null===r.use&&null===r.choice){let t;r.any&&(t=e.save());const n=this._decodeTag(e,null!==r.implicit?r.implicit:r.tag,r.any);if(e.isError(n))return n;r.any?i=e.raw(t):e=n}if(t&&t.track&&null!==r.tag&&t.track(e.path(),n,e.length,"tagged"),t&&t.track&&null!==r.tag&&t.track(e.path(),e.offset,e.length,"content"),r.any||(i=null===r.choice?this._decodeGeneric(r.tag,e,t):this._decodeChoice(e,t)),e.isError(i))return i;if(r.any||null!==r.choice||null===r.children||r.children.forEach(function(r){r._decode(e,t)}),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){const n=new o(i);i=this._getUse(r.contains,e._reporterState.obj)._decode(n,t)}}return r.obj&&a&&(i=e.leaveObject(n)),null===r.key||null===i&&!0!==a?null!==s&&e.exitKey(s):e.leaveKey(s,r.key,i),i},c.prototype._decodeGeneric=function(e,t,r){const n=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,n.args[0],r):/str$/.test(e)?this._decodeStr(t,e,r):"objid"===e&&n.args?this._decodeObjid(t,n.args[0],n.args[1],r):"objid"===e?this._decodeObjid(t,null,null,r):"gentime"===e||"utctime"===e?this._decodeTime(t,e,r):"null_"===e?this._decodeNull(t,r):"bool"===e?this._decodeBool(t,r):"objDesc"===e?this._decodeStr(t,e,r):"int"===e||"enum"===e?this._decodeInt(t,n.args&&n.args[0],r):null!==n.use?this._getUse(n.use,t._reporterState.obj)._decode(t,r):t.error("unknown tag: "+e)},c.prototype._getUse=function(e,t){const r=this._baseState;return r.useDecoder=this._use(e,t),a(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},c.prototype._decodeChoice=function(e,t){const r=this._baseState;let n=null,i=!1;return Object.keys(r.choice).some(function(o){const a=e.save(),s=r.choice[o];try{const r=s._decode(e,t);if(e.isError(r))return!1;n={type:o,value:r},i=!0}catch(t){return e.restore(a),!1}return!0},this),i?n:e.error("Choice not matched")},c.prototype._createEncoderBuffer=function(e){return new i(e,this.reporter)},c.prototype._encode=function(e,t,r){const n=this._baseState;if(null!==n.default&&n.default===e)return;const i=this._encodeValue(e,t,r);return void 0===i||this._skipDefault(i,t,r)?void 0:i},c.prototype._encodeValue=function(e,t,r){const i=this._baseState;if(null===i.parent)return i.children[0]._encode(e,t||new n);let o=null;if(this.reporter=t,i.optional&&void 0===e){if(null===i.default)return;e=i.default}let a=null,s=!1;if(i.any)o=this._createEncoderBuffer(e);else if(i.choice)o=this._encodeChoice(e,t);else if(i.contains)a=this._getUse(i.contains,r)._encode(e,t),s=!0;else if(i.children)a=i.children.map(function(r){if("null_"===r._baseState.tag)return r._encode(null,t,e);if(null===r._baseState.key)return t.error("Child should have a key");const n=t.enterKey(r._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");const i=r._encode(e[r._baseState.key],t,e);return t.leaveKey(n),i},this).filter(function(e){return e}),a=this._createEncoderBuffer(a);else if("seqof"===i.tag||"setof"===i.tag){if(!i.args||1!==i.args.length)return t.error("Too many args for : "+i.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");const r=this.clone();r._baseState.implicit=null,a=this._createEncoderBuffer(e.map(function(r){return this._getUse(this._baseState.args[0],e)._encode(r,t)},r))}else null!==i.use?o=this._getUse(i.use,r)._encode(e,t):(a=this._encodePrimitive(i.tag,e),s=!0);if(!i.any&&null===i.choice){const e=null!==i.implicit?i.implicit:i.tag,r=null===i.implicit?"universal":"context";null===e?null===i.use&&t.error("Tag could be omitted only for .use()"):null===i.use&&(o=this._encodeComposite(e,s,r,a))}return null!==i.explicit&&(o=this._encodeComposite(i.explicit,!1,"context",o)),o},c.prototype._encodeChoice=function(e,t){const r=this._baseState,n=r.choice[e.type];return n||a(!1,e.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(e.value,t)},c.prototype._encodePrimitive=function(e,t){const r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,r.args&&r.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},c.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},c.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}},function(e,t,r){"use strict";const n=r(3);function i(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function o(e,t){this.path=e,this.rethrow(t)}t.Reporter=i,i.prototype.isError=function(e){return e instanceof o},i.prototype.save=function(){const e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},i.prototype.restore=function(e){const t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},i.prototype.enterKey=function(e){return this._reporterState.path.push(e)},i.prototype.exitKey=function(e){const t=this._reporterState;t.path=t.path.slice(0,e-1)},i.prototype.leaveKey=function(e,t,r){const n=this._reporterState;this.exitKey(e),null!==n.obj&&(n.obj[t]=r)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){const e=this._reporterState,t=e.obj;return e.obj={},t},i.prototype.leaveObject=function(e){const t=this._reporterState,r=t.obj;return t.obj=e,r},i.prototype.error=function(e){let t;const r=this._reporterState,n=e instanceof o;if(t=n?e:new o(r.path.map(function(e){return"["+JSON.stringify(e)+"]"}).join(""),e.message||e,e.stack),!r.options.partial)throw t;return n||r.errors.push(t),t},i.prototype.wrapResult=function(e){const t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},n(o,Error),o.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},function(e,t,r){"use strict";function n(e){const t={};return Object.keys(e).forEach(function(r){(0|r)==r&&(r|=0),t[e[r]]=r}),t}t.tagClass={0:"universal",1:"application",2:"context",3:"private"},t.tagClassByName=n(t.tagClass),t.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},t.tagByName=n(t.tag)},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ObservableStore=void 0;const i=n(r(57));t.ObservableStore=class extends i.default{constructor(e){super(),this._state=e||{}}getState(){return this._getState()}putState(e){this._putState(e),this.emit("update",e)}updateState(e){if(e&&"object"==typeof e){const t=this.getState();this.putState(Object.assign(Object.assign({},t),e))}else this.putState(e)}subscribe(e){this.on("update",e)}unsubscribe(e){this.removeListener("update",e)}_getState(){return this._state}_putState(e){this._state=e}}},function(e,t,r){var n=r(11),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.EthereumProviderError=t.EthereumRpcError=void 0;const n=r(354);class i extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw new Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==r&&(this.data=r)}serialize(){const e={code:this.code,message:this.message};return void 0!==this.data&&(e.data=this.data),this.stack&&(e.stack=this.stack),e}toString(){return n.default(this.serialize(),o,2)}}function o(e,t){if("[Circular]"!==t)return t}t.EthereumRpcError=i,t.EthereumProviderError=class extends i{constructor(e,t,r){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorValues=t.errorCodes=void 0,t.errorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901}},t.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."}}},function(e,t,r){var n=r(11),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){(function(n,i){var o;!function(){"use strict";var a="input is invalid type",s="object"==typeof window,u=s?window:{};u.JS_SHA3_NO_WINDOW&&(s=!1);var c=!s&&"object"==typeof self;!u.JS_SHA3_NO_NODE_JS&&"object"==typeof n&&n.versions&&n.versions.node?u=i:c&&(u=self);var f=!u.JS_SHA3_NO_COMMON_JS&&"object"==typeof e&&e.exports,d=r(223),h=!u.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,l="0123456789abcdef".split(""),p=[4,1024,262144,67108864],b=[0,8,16,24],m=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],g=[224,256,384,512],y=[128,256],v=["hex","buffer","arrayBuffer","array","digest"],w={128:168,256:136};!u.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!h||!u.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var _=function(e,t,r){return function(n){return new N(e,t,e).update(n)[r]()}},S=function(e,t,r){return function(n,i){return new N(e,t,i).update(n)[r]()}},E=function(e,t,r){return function(t,n,i,o){return M["cshake"+e].update(t,n,i,o)[r]()}},k=function(e,t,r){return function(t,n,i,o){return M["kmac"+e].update(t,n,i,o)[r]()}},x=function(e,t,r,n){for(var i=0;i<v.length;++i){var o=v[i];e[o]=t(r,n,o)}return e},A=function(e,t){var r=_(e,t,"hex");return r.create=function(){return new N(e,t,e)},r.update=function(e){return r.create().update(e)},x(r,_,e,t)},O=[{name:"keccak",padding:[1,256,65536,16777216],bits:g,createMethod:A},{name:"sha3",padding:[6,1536,393216,100663296],bits:g,createMethod:A},{name:"shake",padding:[31,7936,2031616,520093696],bits:y,createMethod:function(e,t){var r=S(e,t,"hex");return r.create=function(r){return new N(e,t,r)},r.update=function(e,t){return r.create(t).update(e)},x(r,S,e,t)}},{name:"cshake",padding:p,bits:y,createMethod:function(e,t){var r=w[e],n=E(e,0,"hex");return n.create=function(n,i,o){return i||o?new N(e,t,n).bytepad([i,o],r):M["shake"+e].create(n)},n.update=function(e,t,r,i){return n.create(t,r,i).update(e)},x(n,E,e,t)}},{name:"kmac",padding:p,bits:y,createMethod:function(e,t){var r=w[e],n=k(e,0,"hex");return n.create=function(n,i,o){return new L(e,t,i).bytepad(["KMAC",o],r).bytepad([n],r)},n.update=function(e,t,r,i){return n.create(e,r,i).update(t)},x(n,k,e,t)}}],M={},j=[],R=0;R<O.length;++R)for(var P=O[R],T=P.bits,I=0;I<T.length;++I){var C=P.name+"_"+T[I];if(j.push(C),M[C]=P.createMethod(T[I],P.padding),"sha3"!==P.name){var B=P.name+T[I];j.push(B),M[B]=M[C]}}function N(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function L(e,t,r){N.call(this,e,t,r)}N.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(a);if(null===e)throw new Error(a);if(h&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||h&&ArrayBuffer.isView(e)))throw new Error(a);t=!0}for(var n,i,o=this.blocks,s=this.byteCount,u=e.length,c=this.blockCount,f=0,d=this.s;f<u;){if(this.reset)for(this.reset=!1,o[0]=this.block,n=1;n<c+1;++n)o[n]=0;if(t)for(n=this.start;f<u&&n<s;++f)o[n>>2]|=e[f]<<b[3&n++];else for(n=this.start;f<u&&n<s;++f)(i=e.charCodeAt(f))<128?o[n>>2]|=i<<b[3&n++]:i<2048?(o[n>>2]|=(192|i>>6)<<b[3&n++],o[n>>2]|=(128|63&i)<<b[3&n++]):i<55296||i>=57344?(o[n>>2]|=(224|i>>12)<<b[3&n++],o[n>>2]|=(128|i>>6&63)<<b[3&n++],o[n>>2]|=(128|63&i)<<b[3&n++]):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++f)),o[n>>2]|=(240|i>>18)<<b[3&n++],o[n>>2]|=(128|i>>12&63)<<b[3&n++],o[n>>2]|=(128|i>>6&63)<<b[3&n++],o[n>>2]|=(128|63&i)<<b[3&n++]);if(this.lastByteIndex=n,n>=s){for(this.start=n-s,this.block=o[c],n=0;n<c;++n)d[n]^=o[n];D(d),this.reset=!0}else this.start=n}return this},N.prototype.encode=function(e,t){var r=255&e,n=1,i=[r];for(r=255&(e>>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},N.prototype.encodeString=function(e){var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(a);if(null===e)throw new Error(a);if(h&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||h&&ArrayBuffer.isView(e)))throw new Error(a);t=!0}var n=0;if(t)n=e.length;else for(var i=0;i<e.length;++i){var o=e.charCodeAt(i);o<128?n+=1:o<2048?n+=2:o<55296||o>=57344?n+=3:(o=65536+((1023&o)<<10|1023&e.charCodeAt(++i)),n+=4)}return n+=this.encode(8*n),this.update(e),n},N.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n<e.length;++n)r+=this.encodeString(e[n]);var i=[];return i.length=t-r%t,this.update(i),this},N.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,r=this.blockCount,n=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t<r+1;++t)e[t]=0;for(e[r-1]|=2147483648,t=0;t<r;++t)n[t]^=e[t];D(n)}},N.prototype.toString=N.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s="";a<n;){for(o=0;o<t&&a<n;++o,++a)s+=l[(e=r[o])>>4&15]+l[15&e]+l[e>>12&15]+l[e>>8&15]+l[e>>20&15]+l[e>>16&15]+l[e>>28&15]+l[e>>24&15];a%t==0&&(D(r),o=0)}return i&&(s+=l[(e=r[o])>>4&15]+l[15&e],i>1&&(s+=l[e>>12&15]+l[e>>8&15]),i>2&&(s+=l[e>>20&15]+l[e>>16&15])),s},N.prototype.buffer=N.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(e);a<n;){for(o=0;o<t&&a<n;++o,++a)u[a]=r[o];a%t==0&&D(r)}return i&&(u[o]=r[o],e=e.slice(0,s)),e},N.prototype.digest=N.prototype.array=function(){this.finalize();for(var e,t,r=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,a=0,s=0,u=[];s<i;){for(a=0;a<r&&s<i;++a,++s)u[e=s<<2]=255&(t=n[a]),u[e+1]=t>>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;s%r==0&&D(n)}return o&&(u[e=s<<2]=255&(t=n[a]),o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u},(L.prototype=new N).finalize=function(){return this.encode(this.outputBits,!0),N.prototype.finalize.call(this)};var D=function(e){var t,r,n,i,o,a,s,u,c,f,d,h,l,p,b,g,y,v,w,_,S,E,k,x,A,O,M,j,R,P,T,I,C,B,N,L,D,q,U,F,H,z,W,K,V,J,G,X,Y,$,Z,Q,ee,te,re,ne,ie,oe,ae,se,ue,ce,fe;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],u=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],f=e[6]^e[16]^e[26]^e[36]^e[46],d=e[7]^e[17]^e[27]^e[37]^e[47],t=(h=e[8]^e[18]^e[28]^e[38]^e[48])^((a=e[2]^e[12]^e[22]^e[32]^e[42])<<1|(s=e[3]^e[13]^e[23]^e[33]^e[43])>>>31),r=(l=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,r=o^(c<<1|u>>>31),e[2]^=t=i^(u<<1|c>>>31),e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,r=s^(d<<1|f>>>31),e[4]^=t=a^(f<<1|d>>>31),e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,r=c^(l<<1|h>>>31),e[6]^=t=u^(h<<1|l>>>31),e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,r=d^(o<<1|i>>>31),e[8]^=t=f^(i<<1|o>>>31),e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,b=e[1],J=e[11]<<4|e[10]>>>28,G=e[10]<<4|e[11]>>>28,j=e[20]<<3|e[21]>>>29,R=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,z=e[40]<<18|e[41]>>>14,W=e[41]<<18|e[40]>>>14,B=e[2]<<1|e[3]>>>31,N=e[3]<<1|e[2]>>>31,y=e[12]<<12|e[13]>>>20,X=e[22]<<10|e[23]>>>22,Y=e[23]<<10|e[22]>>>22,P=e[33]<<13|e[32]>>>19,T=e[32]<<13|e[33]>>>19,ce=e[42]<<2|e[43]>>>30,fe=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,L=e[14]<<6|e[15]>>>26,D=e[15]<<6|e[14]>>>26,w=e[24]<<11|e[25]>>>21,$=e[34]<<15|e[35]>>>17,Z=e[35]<<15|e[34]>>>17,I=e[45]<<29|e[44]>>>3,C=e[44]<<29|e[45]>>>3,x=e[6]<<28|e[7]>>>4,A=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,q=e[26]<<25|e[27]>>>7,U=e[27]<<25|e[26]>>>7,_=e[36]<<21|e[37]>>>11,S=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,K=e[8]<<27|e[9]>>>5,V=e[9]<<27|e[8]>>>5,O=e[18]<<20|e[19]>>>12,M=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,F=e[38]<<8|e[39]>>>24,H=e[39]<<8|e[38]>>>24,E=e[48]<<14|e[49]>>>18,k=e[49]<<14|e[48]>>>18,e[0]=(p=e[0])^~(g=e[13]<<12|e[12]>>>20)&(v=e[25]<<11|e[24]>>>21),e[1]=b^~y&w,e[10]=x^~O&j,e[11]=A^~M&R,e[20]=B^~L&q,e[21]=N^~D&U,e[30]=K^~J&X,e[31]=V^~G&Y,e[40]=te^~ne&oe,e[41]=re^~ie&ae,e[2]=g^~v&_,e[3]=y^~w&S,e[12]=O^~j&P,e[13]=M^~R&T,e[22]=L^~q&F,e[23]=D^~U&H,e[32]=J^~X&$,e[33]=G^~Y&Z,e[42]=ne^~oe&se,e[43]=ie^~ae&ue,e[4]=v^~_&E,e[5]=w^~S&k,e[14]=j^~P&I,e[15]=R^~T&C,e[24]=q^~F&z,e[25]=U^~H&W,e[34]=X^~$&Q,e[35]=Y^~Z&ee,e[44]=oe^~se&ce,e[45]=ae^~ue&fe,e[6]=_^~E&p,e[7]=S^~k&b,e[16]=P^~I&x,e[17]=T^~C&A,e[26]=F^~z&B,e[27]=H^~W&N,e[36]=$^~Q&K,e[37]=Z^~ee&V,e[46]=se^~ce&te,e[47]=ue^~fe&re,e[8]=E^~p&g,e[9]=k^~b&y,e[18]=I^~x&O,e[19]=C^~A&M,e[28]=z^~B&L,e[29]=W^~N&D,e[38]=Q^~K&J,e[39]=ee^~V&G,e[48]=ce^~te&ne,e[49]=fe^~re&ie,e[0]^=m[n],e[1]^=m[n+1]};if(f)e.exports=M;else{for(R=0;R<j.length;++R)u[j[R]]=M[j[R]];d&&(void 0===(o=(function(){return M}).call(t,r,t,e))||(e.exports=o))}}()}).call(this,r(9),r(10))},function(e,t){e.exports=r("PE4B")},function(e,t){e.exports=r("QILm")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerParentPostMessageStream=t.WorkerPostMessageStream=t.WindowPostMessageStream=void 0;var n=r(197);Object.defineProperty(t,"WindowPostMessageStream",{enumerable:!0,get:function(){return n.WindowPostMessageStream}});var i=r(206);Object.defineProperty(t,"WorkerPostMessageStream",{enumerable:!0,get:function(){return i.WorkerPostMessageStream}});var o=r(207);Object.defineProperty(t,"WorkerParentPostMessageStream",{enumerable:!0,get:function(){return o.WorkerParentPostMessageStream}})},function(e,t,r){(function(t){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,(function(t){return e[t]}).bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=19)}([function(e,t){e.exports=r(1)},function(e,t){e.exports=r(12)},function(e,t){e.exports=r(58)},function(e,t){e.exports=r(15)},function(e,t){e.exports=r(33)},function(e,t){e.exports=r(265)},function(e,t){e.exports=r(269)},function(e,t){e.exports=r(2)},function(e,t){e.exports=r(24)},function(e,t){e.exports=r(16)},function(e,t){e.exports=r(341)},function(e,t){e.exports=r(61)},function(e,t){e.exports=r(25)},function(e,t){e.exports=r(54)},function(e,t){e.exports=r(342)},function(e,t){e.exports=r(60)},function(e,t){e.exports=r(30)},function(e,t){e.exports=r(31)},function(e,t){e.exports=r(343)},function(e,r,n){"use strict";n.r(r);var i=n(7),o=n.n(i),a=n(11),s=n.n(a),u=n(3),c=n.n(u),f=n(8),d=n.n(f),h=n(12),l=n.n(h),p=n(1),b=n.n(p),m=n(6),g=n(2),y=n(0),v=n.n(y),w=n(13),_=n(5),S=n.n(_),E=n(14),k=n.n(E),x=n(4),A=n(15),O=n.n(A).a.getLogger("torus.js"),M=n(16),j=n.n(M),R=n(17),P=n.n(R),T=n(9),I=n.n(T),C=n(18),B=function(e){j()(r,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var r,n=I()(e);if(t){var i=I()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return P()(this,r)}}(r);function r(e){var n,i=e.errors,o=e.responses,a=e.predicate;return d()(this,r),(n=t.call(this,"Unable to resolve enough promises.")).errors=i,n.responses=o,n.predicate=a,n}return r}(n.n(C)()(Error)),N=function(e,t){return new Promise(function(r,n){var i,o=0,a={resolved:!1},s=new Array(e.length).fill(void 0),u=new Array(e.length).fill(void 0);e.forEach(function(c,f){c.then(function(e){u[f]=e}).catch(function(e){s[f]=e}).finally(function(){a.resolved||t(u.slice(0),a).then(function(e){a.resolved=!0,r(e)}).catch(function(e){i=e}).finally(function(t){if((o+=1)===e.length){var r=Object.values(Object.fromEntries(u.map(function(e){var t;return[null==e?void 0:e.id,null===(t=e.error)||void 0===t?void 0:t.data]}))).filter(function(e){return"string"==typeof e&&e.length>0}).map(function(e){return e.startsWith("Error occurred while verifying params")?(t=e.substr(37)).charAt(0).toUpperCase()+t.slice(1):e;var t});if(r.length>0){var a=r.length>1?"\n".concat(r.map(function(e){return"\u2022 ".concat(e)}).join("\n")):r[0];n(new Error(a))}else{var c;n(new B({errors:s,responses:u,predicate:(null===(c=i)||void 0===c?void 0:c.message)||i}))}}})})})})},L=n(10),D=n.n(L);function q(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function U(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?q(Object(r),!0).forEach(function(t){o()(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):q(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var F=function e(t,r){var n=t;if("number"==typeof n&&(n=Array.from({length:n},function(e,t){return t})),r>n.length||r<=0)return[];if(r===n.length)return[n];if(1===r)return n.reduce(function(e,t){return[].concat(D()(e),[[t]])},[]);for(var i=[],o=[],a=0;a<=n.length-r+1;a+=1){o=e(n.slice(a+1),r-1);for(var s=0;s<o.length;s+=1)i.push([n[a]].concat(D()(o[s])))}return i},H=function(e,t){for(var r={},n=0;n<e.length;n+=1){var i=S()(e[n]);if(r[i]=r[i]?r[i]+1:1,r[i]===t)return e[n]}},z=function(e,t,r){var n=e.map(function(e){return Object(g.post)(e,Object(g.generateJsonRPCObject)("VerifierLookupRequest",{verifier:t,verifier_id:r.toString()})).catch(function(e){return O.error("lookup request failed",e)})});return N(n,function(t){var r=t.filter(function(e){return e}),n=H(r.map(function(e){return e&&e.error}),1+~~(e.length/2)),i=H(r.map(function(e){return e&&e.result}),1+~~(e.length/2));return i||n?Promise.resolve({keyResult:i,errorResult:n}):Promise.reject(new Error("invalid results ".concat(JSON.stringify(t))))}).catch(function(e){return O.error("Some for keylookup failed",e)})},W=function(e,t,r,n){return new Promise(function(i,o){setTimeout(function(){z(e,t,r).then(i).catch(o)},n)})},K=function e(t,r,n,i,o,a){var s,u;if(void 0===n?(s=Math.floor(Math.random()*t.length),u=s):s=n%t.length,s===i)throw new Error("Looped through all");void 0!==i&&(u=i);var c=Object(g.generateJsonRPCObject)("KeyAssign",{verifier:o,verifier_id:a.toString()});return Object(g.post)("https://signer.tor.us/api/sign",c,{headers:{pubKeyX:r[s].X,pubKeyY:r[s].Y}},{useAPIKey:!0}).then(function(n){return Object(g.post)(t[s],U(U({},c),n),{headers:{"Content-Type":"application/json; charset=utf-8"}}).catch(function(n){return e(t,r,s+1,u,o,a)})})};function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function J(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?V(Object(r),!0).forEach(function(t){o()(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):V(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var G=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.enableLogging,n=void 0!==r&&r,i=t.metadataHost,o=void 0===i?"https://metadata.tor.us":i,a=t.allowHost,s=void 0===a?"https://signer.tor.us/api/allow":a,u=t.serverTimeOffset,c=void 0===u?0:u;d()(this,e),this.ec=new w.ec("secp256k1"),this.metadataHost=o,this.allowHost=s,this.metadataCache=k.a,n||O.disableAll(),this.metadataLock={},this.serverTimeOffset=c||0}var r,n,i,o,a;return l()(e,[{key:"setCustomKey",value:(a=c()(b.a.mark(function e(t){var r,n,i,o,a,s,u,c,f;return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.privKeyHex,n=t.metadataNonce,o=t.customKeyHex,(i=t.torusKeyHex)?a=new v.a(i,16):(s=new v.a(r,16),a=s.sub(n).umod(this.ec.curve.n)),u=new v.a(o,16),c=u.sub(a).umod(this.ec.curve.n),f=this.generateMetadataParams(c.toString(16),a.toString(16)),e.next=7,this.setMetadata(f);case 7:case"end":return e.stop()}},e,this)})),function(e){return a.apply(this,arguments)})},{key:"retrieveShares",value:(o=c()(b.a.mark(function e(r,n,i,o,a){var u,f,d,h,l,p,y,w,_,S=this,E=arguments;return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return u=E.length>5&&void 0!==E[5]?E[5]:{},f=[],e.next=4,Object(g.get)(this.allowHost,{headers:{verifier:i,verifier_id:o.verifier_id}},{useAPIKey:!0});case 4:for(d=Object(m.generatePrivate)(),h=Object(m.getPublic)(d).toString("hex"),l=h.slice(2,66),p=h.slice(66),y=Object(x.keccak256)(a),w=0;w<r.length;w+=1)_=Object(g.post)(r[w],Object(g.generateJsonRPCObject)("CommitmentRequest",{messageprefix:"mug00",tokencommitment:y.slice(2),temppubx:l,temppuby:p,verifieridentifier:i})).catch(function(e){return O.error("commitment",e)}),f.push(_);return e.abrupt("return",N(f,function(e){return e.filter(function(e){return!(!e||"object"!==s()(e)||e.error)}).length>=3*~~(r.length/4)+1?Promise.resolve(e):Promise.reject(new Error("invalid ".concat(JSON.stringify(e))))}).then(function(e){for(var s=[],f=[],h=0;h<e.length;h+=1)e[h]&&f.push(e[h].result);for(var l=0;l<r.length;l+=1){var p=Object(g.post)(r[l],Object(g.generateJsonRPCObject)("ShareRequest",{encrypted:"yes",item:[J(J({},o),{},{idtoken:a,nodesignatures:f,verifieridentifier:i},u)]})).catch(function(e){return O.error("share req",e)});s.push(p)}return N(s,function(){var e=c()(b.a.mark(function e(i,o){var a,s,u,c,f,h,l,p,g,y,w,_,E,k;return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(a=i.filter(function(e){return e}),s=H(i.map(function(e){return e&&e.result&&e.result.keys[0].PublicKey}),1+~~(r.length/2)),!(a.length>=1+~~(r.length/2)&&s)){e.next=32;break}for(u=[],c=[],f=0;f<i.length;f+=1)i[f]&&i[f].result&&i[f].result.keys&&i[f].result.keys.length>0?(i[f].result.keys.sort(function(e,t){return new v.a(e.Index,16).cmp(new v.a(t.Index,16))}),i[f].result.keys[0].Metadata?(h={ephemPublicKey:t.from(i[f].result.keys[0].Metadata.ephemPublicKey,"hex"),iv:t.from(i[f].result.keys[0].Metadata.iv,"hex"),mac:t.from(i[f].result.keys[0].Metadata.mac,"hex"),mode:t.from(i[f].result.keys[0].Metadata.mode,"hex")},u.push(Object(m.decrypt)(d,J(J({},h),{},{ciphertext:t.from(atob(i[f].result.keys[0].Share).padStart(64,"0"),"hex")})).catch(function(e){return O.debug("share decryption",e)}))):u.push(Promise.resolve(t.from(i[f].result.keys[0].Share.padStart(64,"0"),"hex")))):u.push(Promise.resolve(void 0)),c.push(new v.a(n[f],16));return e.next=8,Promise.all(u);case 8:if(l=e.sent,!o.resolved){e.next=11;break}return e.abrupt("return",void 0);case 11:p=l.reduce(function(e,t,r){return t&&e.push({index:c[r],value:new v.a(t)}),e},[]),g=F(p.length,1+~~(r.length/2)),w=function(e){var r=g[e],n=p.filter(function(e,t){return r.includes(t)}),i=n.map(function(e){return e.value}),o=n.map(function(e){return e.index}),a=S.lagrangeInterpolation(i,o),u=Object(m.getPublic)(t.from(a.toString(16,64),"hex")).toString("hex"),c=u.slice(2,66),f=u.slice(66);if(0===new v.a(c,16).cmp(new v.a(s.X,16))&&0===new v.a(f,16).cmp(new v.a(s.Y,16)))return y=a,"break"},_=0;case 15:if(!(_<g.length)){e.next=22;break}if("break"!==w(_)){e.next=19;break}return e.abrupt("break",22);case 19:_+=1,e.next=15;break;case 22:if(void 0!==y){e.next=24;break}throw new Error("could not derive private key");case 24:return e.next=26,S.getMetadata({pub_key_X:s.X,pub_key_Y:s.Y});case 26:if(E=e.sent,!o.resolved){e.next=29;break}return e.abrupt("return",void 0);case 29:return y=y.add(E).umod(S.ec.curve.n),k=S.generateAddressFromPrivKey(y),e.abrupt("return",{ethAddress:k,privKey:y.toString("hex",64),metadataNonce:E});case 32:throw new Error("invalid");case 33:case"end":return e.stop()}},e)}));return function(t,r){return e.apply(this,arguments)}}())}));case 11:case"end":return e.stop()}},e,this)})),function(e,t,r,n,i){return o.apply(this,arguments)})},{key:"getMetadata",value:(i=c()(b.a.mark(function e(t,r){var n,i,o,a,s=this;return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,i=S()(t),null===this.metadataLock[i]){e.next=7;break}return e.next=5,this.metadataLock[i];case 5:e.next=8;break;case 7:this.metadataLock[i]=new Promise(function(e){n=function(){s.metadataLock[i]=null,e()}});case 8:if(null===(o=this.metadataCache.get(i))){e.next=12;break}return n&&n(),e.abrupt("return",o);case 12:return e.next=14,Object(g.post)("".concat(this.metadataHost,"/get"),t,r,{useAPIKey:!0});case 14:if((a=e.sent)&&a.message){e.next=19;break}return this.metadataCache.put(i,new v.a(0),6e4),n&&n(),e.abrupt("return",new v.a(0));case 19:return this.metadataCache.put(i,new v.a(a.message,16),6e4),e.abrupt("return",new v.a(a.message,16));case 23:return e.prev=23,e.t0=e.catch(0),O.error("get metadata error",e.t0),n&&n(),e.abrupt("return",new v.a(0));case 28:case"end":return e.stop()}},e,this,[[0,23]])})),function(e,t){return i.apply(this,arguments)})},{key:"generateMetadataParams",value:function(e,r){var n=this.ec.keyFromPrivate(r.toString("hex",64)),i={data:e,timestamp:new v.a(~~(this.serverTimeOffset+Date.now()/1e3)).toString(16)},o=n.sign(Object(x.keccak256)(S()(i)).slice(2));return{pub_key_X:n.getPublic().getX().toString("hex"),pub_key_Y:n.getPublic().getY().toString("hex"),set_data:i,signature:t.from(o.r.toString(16,64)+o.s.toString(16,64)+new v.a(o.v).toString(16,2),"hex").toString("base64")}}},{key:"setMetadata",value:(n=c()(b.a.mark(function e(t,r){return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,this.metadataCache.del(S()({pub_key_X:t.pub_key_X,pub_key_Y:t.pub_key_Y})),e.next=4,Object(g.post)("".concat(this.metadataHost,"/set"),t,r,{useAPIKey:!0});case 4:return e.abrupt("return",e.sent.message);case 8:return e.prev=8,e.t0=e.catch(0),O.error("set metadata error",e.t0),e.abrupt("return","");case 12:case"end":return e.stop()}},e,this,[[0,8]])})),function(e,t){return n.apply(this,arguments)})},{key:"lagrangeInterpolation",value:function(e,t){if(e.length!==t.length)return null;for(var r=new v.a(0),n=0;n<e.length;n+=1){for(var i=new v.a(1),o=new v.a(1),a=0;a<e.length;a+=1)if(n!==a){i=(i=i.mul(t[a].neg())).umod(this.ec.curve.n);var s=t[n].sub(t[a]);s=s.umod(this.ec.curve.n),o=o.mul(s).umod(this.ec.curve.n)}var u=i.mul(o.invm(this.ec.curve.n)).umod(this.ec.curve.n);u=u.mul(e[n]).umod(this.ec.curve.n),r=r.add(u)}return r.umod(this.ec.curve.n)}},{key:"generateAddressFromPrivKey",value:function(e){var r=this.ec.keyFromPrivate(e.toString("hex",64),"hex").getPublic().encode("hex").slice(2),n="0x".concat(Object(x.keccak256)(t.from(r,"hex")).slice(26));return Object(x.toChecksumAddress)(n)}},{key:"generateAddressFromPubKey",value:function(e,r){var n=this.ec.keyFromPublic({x:e.toString("hex",64),y:r.toString("hex",64)}).getPublic().encode("hex").slice(2),i="0x".concat(Object(x.keccak256)(t.from(n,"hex")).slice(26));return Object(x.toChecksumAddress)(i)}},{key:"getPublicAddress",value:(r=c()(b.a.mark(function e(t,r,n){var i,o,a,s,u,c,f,d,h,l,p,m,g,y=arguments;return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=n.verifier,o=n.verifierId,a=y.length>3&&void 0!==y[3]&&y[3],e.next=4,z(t,i,o);case 4:if(e.t0=e.sent,e.t0){e.next=7;break}e.t0={};case 7:if(c=(u=e.t0).keyResult,!(f=u.errorResult)||!JSON.stringify(f).includes("Verifier + VerifierID has not yet been assigned")){e.next=22;break}return e.next=13,K(t,r,void 0,void 0,i,o);case 13:return e.next=15,W(t,i,o,1e3);case 15:if(e.t1=e.sent,e.t1){e.next=18;break}e.t1={};case 18:s=e.t1.keyResult,e.next=27;break;case 22:if(!c){e.next=26;break}s=c,e.next=27;break;case 26:throw new Error("node results do not match at first lookup ".concat(JSON.stringify(c||{}),", ").concat(JSON.stringify(f||{})));case 27:if(!s){e.next=39;break}return h=(d=s.keys[0]).pub_key_X,l=d.pub_key_Y,e.next=31,this.getMetadata({pub_key_X:h,pub_key_Y:l});case 31:if(p=e.sent,m=this.ec.keyFromPublic({x:h.toString(16),y:l.toString(16)}).getPublic().add(this.ec.keyFromPrivate(p.toString(16)).getPublic()),h=m.getX().toString(16),l=m.getY().toString(16),g=this.generateAddressFromPubKey(m.getX(),m.getY()),a){e.next=38;break}return e.abrupt("return",g);case 38:return e.abrupt("return",{address:g,X:h,Y:l,metadataNonce:p});case 39:throw new Error("node results do not match at final lookup ".concat(JSON.stringify(c||{}),", ").concat(JSON.stringify(f||{})));case 40:case"end":return e.stop()}},e,this)})),function(e,t,n){return r.apply(this,arguments)})}],[{key:"setAPIKey",value:function(e){Object(g.setAPIKey)(e)}},{key:"setEmbedHost",value:function(e){Object(g.setEmbedHost)(e)}}]),e}();r.default=G}]).default}).call(this,r(11).Buffer)},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(344),t),i(r(345),t),i(r(346),t),i(r(94),t),i(r(347),t)},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(356),t),i(r(357),t),i(r(358),t),i(r(180),t),i(r(181),t),i(r(359),t)},function(e,t,r){"use strict";(function(t,n){var i=r(62);e.exports=v;var o,a=r(40);v.ReadableState=y,r(14);var s=function(e,t){return e.listeners(t).length},u=r(107),c=r(71).Buffer,f=t.Uint8Array||function(){},d=r(13);d.inherits=r(3);var h=r(201),l=void 0;l=h&&h.debuglog?h.debuglog("stream"):function(){};var p,b=r(202),m=r(108);d.inherits(v,u);var g=["error","close","destroy","pause","resume"];function y(e,t){o=o||r(41),this.objectMode=!!(e=e||{}).objectMode,t instanceof o&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var n=e.highWaterMark;this.highWaterMark=n||0===n?n:this.objectMode?16:16384,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new b,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=r(19).StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function v(e){if(o=o||r(41),!(this instanceof v))return new v(e);this._readableState=new y(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function w(e,t,r,n,i){var o,a=e._readableState;return null===t?(a.reading=!1,function(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,E(e)}}(e,a)):(i||(o=function(e,t){var r,n;return c.isBuffer(n=t)||n instanceof f||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}(a,t)),o?e.emit("error",o):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),n?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):_(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?_(e,a,t,!1):x(e,a)):_(e,a,t,!1))):n||(a.reading=!1)),function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(a)}function _(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&E(e)),x(e,t)}function S(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function E(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(l("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i(k,e):k(e))}function k(e){l("emit readable"),e.emit("readable"),j(e)}function x(e,t){t.readingMore||(t.readingMore=!0,i(A,e,t))}function A(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(l("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function O(e){l("readable nexttick read 0"),e.read(0)}function M(e,t){t.reading||(l("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),j(e),t.flowing&&!t.reading&&e.read(0)}function j(e){var t=e._readableState;for(l("flow",t.flowing);t.flowing&&null!==e.read(););}function R(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;return e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,n=1,i=r.data;for(e-=i.length;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(i+=a===o.length?o:o.slice(0,e),0==(e-=a)){a===o.length?(++n,t.head=r.next?r.next:t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=c.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0==(e-=a)){a===o.length?(++i,t.head=n.next?n.next:t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}(e,t),n}(e,t.buffer,t.decoder),r);var r}function P(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i(T,t,e))}function T(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function I(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),v.prototype.destroy=m.destroy,v.prototype._undestroy=m.undestroy,v.prototype._destroy=function(e,t){this.push(null),t(e)},v.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=c.from(e,t),t=""),r=!0),w(this,e,t,!1,r)},v.prototype.unshift=function(e){return w(this,e,null,!0,!1)},v.prototype.isPaused=function(){return!1===this._readableState.flowing},v.prototype.setEncoding=function(e){return p||(p=r(19).StringDecoder),this._readableState.decoder=new p(e),this._readableState.encoding=e,this},v.prototype.read=function(e){l("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return l("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?P(this):E(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&P(this),null;var n,i=t.needReadable;return l("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&l("length less than watermark",i=!0),t.ended||t.reading?l("reading or ended",i=!1):i&&(l("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=S(r,t))),null===(n=e>0?R(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&P(this)),null!==n&&this.emit("data",n),n},v.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},v.prototype.pipe=function(e,t){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,l("pipe count=%d opts=%j",o.pipesCount,t);var u=t&&!1===t.end||e===n.stdout||e===n.stderr?y:c;function c(){l("onend"),e.end()}o.endEmitted?i(u):r.once("end",u),e.on("unpipe",function t(n,i){l("onunpipe"),n===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,l("cleanup"),e.removeListener("close",m),e.removeListener("finish",g),e.removeListener("drain",f),e.removeListener("error",b),e.removeListener("unpipe",t),r.removeListener("end",c),r.removeListener("end",y),r.removeListener("data",p),d=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||f())});var f=function(e){return function(){var t=e._readableState;l("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,j(e))}}(r);e.on("drain",f);var d=!1,h=!1;function p(t){l("ondata"),h=!1,!1!==e.write(t)||h||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==I(o.pipes,e))&&!d&&(l("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,h=!0),r.pause())}function b(t){l("onerror",t),y(),e.removeListener("error",b),0===s(e,"error")&&e.emit("error",t)}function m(){e.removeListener("finish",g),y()}function g(){l("onfinish"),e.removeListener("close",m),y()}function y(){l("unpipe"),r.unpipe(e)}return r.on("data",p),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",b),e.once("close",m),e.once("finish",g),e.emit("pipe",r),o.flowing||(l("pipe resume"),r.resume()),e},v.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,r);return this}var a=I(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},v.prototype.addListener=v.prototype.on=function(e,t){var r=u.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&E(this):i(O,this))}return r},v.prototype.resume=function(){var e=this._readableState;return e.flowing||(l("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i(M,e,t))}(this,e)),this},v.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this},v.prototype.wrap=function(e){var t=this._readableState,r=!1,n=this;for(var i in e.on("end",function(){if(l("wrapped end"),t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&n.push(e)}n.push(null)}),e.on("data",function(i){l("wrapped data"),t.decoder&&(i=t.decoder.write(i)),t.objectMode&&null==i||(t.objectMode||i&&i.length)&&(n.push(i)||(r=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<g.length;o++)e.on(g[o],n.emit.bind(n,g[o]));return n._read=function(t){l("wrapped _read",t),r&&(r=!1,e.resume())},n},v._fromList=R}).call(this,r(10),r(9))},function(e,t,r){e.exports=r(14).EventEmitter},function(e,t,r){"use strict";var n=r(62);function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this;this._readableState&&this._readableState.destroyed||this._writableState&&this._writableState.destroyed?t?t(e):!e||this._writableState&&this._writableState.errorEmitted||n(i,this,e):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(n(i,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)}))},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,r){"use strict";(function(t,n,i){var o=r(62);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(void 0),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=y;var s,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?n:o;y.WritableState=g;var c=r(13);c.inherits=r(3);var f,d={deprecate:r(42)},h=r(107),l=r(71).Buffer,p=i.Uint8Array||function(){},b=r(108);function m(){}function g(e,t){s=s||r(41),this.objectMode=!!(e=e||{}).objectMode,t instanceof s&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var n=e.highWaterMark;this.highWaterMark=n||0===n?n:this.objectMode?16:16384,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1,this.decodeStrings=!(!1===e.decodeStrings),this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(o(i,n),o(k,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),k(e,t))}(e,r,n,t,i);else{var a=S(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||_(e,r),n?u(w,e,r,a,i):w(e,r,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function y(e){if(s=s||r(41),!(f.call(y,this)||this instanceof s))return new y(e);this._writableState=new g(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),h.call(this)}function v(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function w(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),k(e,t)}function _(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=new Array(t.bufferedRequestCount),i=t.corkedRequestsFree;i.entry=r;for(var o=0,s=!0;r;)n[o]=r,r.isBuf||(s=!1),r=r.next,o+=1;n.allBuffers=s,v(e,t,!0,t.length,n,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new a(t)}else{for(;r;){var u=r.chunk;if(v(e,t,!1,t.objectMode?1:u.length,u,r.encoding,r.callback),r=r.next,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequestCount=0,t.bufferedRequest=r,t.bufferProcessing=!1}function S(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function E(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),k(e,t)})}function k(e,t){var r=S(t);return r&&(function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o(E,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}c.inherits(y,h),g.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(g.prototype,"buffer",{get:d.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(e){return!!f.call(this,e)||e&&e._writableState instanceof g}})):f=function(e){return e instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(e,t,r){var n,i=this._writableState,a=!1,s=(l.isBuffer(n=e)||n instanceof p)&&!i.objectMode;return s&&!l.isBuffer(e)&&(e=function(e){return l.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=m),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),o(t,r)}(this,r):(s||function(e,t,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),o(n,a),i=!1),i}(this,i,e,r))&&(i.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=l.from(t,r)),t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else v(e,t,!1,s,n,i,o);return u}(this,i,s,e,t,r)),a},y.prototype.cork=function(){this._writableState.corked++},y.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||_(this,e))},y.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},y.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,k(e,t),r&&(t.finished?o(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=b.destroy,y.prototype._undestroy=b.undestroy,y.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(9),r(51).setImmediate,r(10))},function(e,t,r){"use strict";e.exports=a;var n=r(41),i=r(13);function o(e){this.afterTransform=function(t,r){return function(e,t,r){var n=e._transformState;n.transforming=!1;var i=n.writecb;if(!i)return e.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=r&&e.push(r),i(t);var o=e._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&e._read(o.highWaterMark)}(e,t,r)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null,this.writeencoding=null}function a(e){if(!(this instanceof a))return new a(e);n.call(this,e),this._transformState=new o(this);var t=this;this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.once("prefinish",function(){"function"==typeof this._flush?this._flush(function(e,r){s(t,e,r)}):s(t)})}function s(e,t,r){if(t)return e.emit("error",t);null!=r&&e.push(r);var n=e._transformState;if(e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(n.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}i.inherits=r(3),i.inherits(a,n),a.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},a.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},a.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},a.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},a.prototype._destroy=function(e,t){var r=this;n.prototype._destroy.call(this,e,function(e){t(e),r.emit("close")})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEDICATED_WORKER_NAME=void 0,t.DEDICATED_WORKER_NAME="dedicatedWorker"},function(e,t,r){(function(e){var n=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},i=/%[sdj%]/g;t.format=function(e){if(!g(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(s(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,o=n.length,a=String(e).replace(i,function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),u=n[r];r<o;u=n[++r])b(u)||!w(u)?a+=" "+u:a+=" "+s(u);return a},t.deprecate=function(r,n){if(void 0!==e&&!0===e.noDeprecation)return r;if(void 0===e)return function(){return t.deprecate(r,n).apply(this,arguments)};var i=!1;return function(){if(!i){if(e.throwDeprecation)throw new Error(n);e.traceDeprecation?console.trace(n):console.error(n),i=!0}return r.apply(this,arguments)}};var o,a={};function s(e,r){var n={seen:[],stylize:c};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(r)?n.showHidden=r:r&&t._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,e,n.depth)}function u(e,t){var r=s.styles[t];return r?"\x1b["+s.colors[r][0]+"m"+e+"\x1b["+s.colors[r][1]+"m":e}function c(e,t){return e}function f(e,r,n){if(e.customInspect&&r&&E(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return g(i)||(i=f(e,i,n)),i}var o=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(g(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return m(t)?e.stylize(""+t,"number"):p(t)?e.stylize(""+t,"boolean"):b(t)?e.stylize("null","null"):void 0}(e,r);if(o)return o;var a=Object.keys(r),s=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),S(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return d(r);if(0===a.length){if(E(r))return e.stylize("[Function"+(r.name?": "+r.name:"")+"]","special");if(v(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(_(r))return e.stylize(Date.prototype.toString.call(r),"date");if(S(r))return d(r)}var u,c="",w=!1,k=["{","}"];return l(r)&&(w=!0,k=["[","]"]),E(r)&&(c=" [Function"+(r.name?": "+r.name:"")+"]"),v(r)&&(c=" "+RegExp.prototype.toString.call(r)),_(r)&&(c=" "+Date.prototype.toUTCString.call(r)),S(r)&&(c=" "+d(r)),0!==a.length||w&&0!=r.length?n<0?v(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),u=w?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a<s;++a)M(t,String(a))?o.push(h(e,t,r,n,String(a),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(h(e,t,r,n,i,!0))}),o}(e,r,n,s,a):a.map(function(t){return h(e,r,n,s,t,w)}),e.seen.pop(),function(e,t,r){return e.reduce(function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(u,c,k)):k[0]+c+k[1]}function d(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,i,o){var a,s,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=e.stylize(u.set?"[Getter/Setter]":"[Getter]","special"):u.set&&(s=e.stylize("[Setter]","special")),M(n,i)||(a="["+i+"]"),s||(e.seen.indexOf(u.value)<0?(s=b(r)?f(e,u.value,null):f(e,u.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),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=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function l(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function b(e){return null===e}function m(e){return"number"==typeof e}function g(e){return"string"==typeof e}function y(e){return void 0===e}function v(e){return w(e)&&"[object RegExp]"===k(e)}function w(e){return"object"==typeof e&&null!==e}function _(e){return w(e)&&"[object Date]"===k(e)}function S(e){return w(e)&&("[object Error]"===k(e)||e instanceof Error)}function E(e){return"function"==typeof e}function k(e){return Object.prototype.toString.call(e)}function x(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(r){if(y(o)&&(o=e.env.NODE_DEBUG||""),r=r.toUpperCase(),!a[r])if(new RegExp("\\b"+r+"\\b","i").test(o)){var n=e.pid;a[r]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",r,n,e)}}else a[r]=function(){};return a[r]},t.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"},t.isArray=l,t.isBoolean=p,t.isNull=b,t.isNullOrUndefined=function(e){return null==e},t.isNumber=m,t.isString=g,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=y,t.isRegExp=v,t.isObject=w,t.isDate=_,t.isError=S,t.isFunction=E,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(211);var A=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function O(){var e=new Date,t=[x(e.getHours()),x(e.getMinutes()),x(e.getSeconds())].join(":");return[e.getDate(),A[e.getMonth()],t].join(" ")}function M(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",O(),t.format.apply(t,arguments))},t.inherits=r(212),t._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var j="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function R(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(j&&e[j]){var t;if("function"!=typeof(t=e[j]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,j,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise(function(e,n){t=e,r=n}),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push(function(e,n){e?r(e):t(n)});try{e.apply(this,i)}catch(e){r(e)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),j&&Object.defineProperty(t,j,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,n(e))},t.promisify.custom=j,t.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function r(){for(var r=[],n=0;n<arguments.length;n++)r.push(arguments[n]);var i=r.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,a=function(){return i.apply(o,arguments)};t.apply(this,r).then(function(t){e.nextTick(a,null,t)},function(t){e.nextTick(R,t,a)})}return Object.setPrototypeOf(r,Object.getPrototypeOf(t)),Object.defineProperties(r,n(t)),r}}).call(this,r(9))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){var n=r(1),i=r(217);e.exports=function(e){if("string"==typeof e||"number"==typeof e){var t=new n(1),r=String(e).toLowerCase().trim(),o="0x"===r.substr(0,2)||"-0x"===r.substr(0,3),a=i(r);if("-"===a.substr(0,1)&&(a=i(a.slice(1)),t=new n(-1,10)),!(a=""===a?"0":a).match(/^-?[0-9]+$/)&&a.match(/^[0-9A-Fa-f]+$/)||a.match(/^[a-fA-F]+$/)||!0===o&&a.match(/^[0-9A-Fa-f]+$/))return new n(a,16).mul(t);if((a.match(/^-?[0-9]+$/)||""===a)&&!1===o)return new n(a,10).mul(t)}else if("object"==typeof e&&e.toString&&!e.pop&&!e.push&&e.toString(10).match(/^-?[0-9]+$/)&&(e.mul||e.dividedToIntegerBy))return new n(e.toString(10),10);throw new Error("[number-to-bn] while converting number "+JSON.stringify(e)+" to BN.js instance, error: invalid number value. Value must be an integer, hex string, BN or BigNumber instance. Note, decimals are not supported.")}},function(e,t,r){(function(t){var n=r(29),i=r(1),o=r(114),a=r(219),s=r(220),u=r(221),c=function(e){return i.isBN(e)},f=function(e){return e&&e.constructor&&"BigNumber"===e.constructor.name},d=function(e){try{return o.apply(null,arguments)}catch(t){throw new Error(t+' Given value: "'+e+'"')}},h=function(e){return!!/^(0x)?[0-9a-f]{40}$/i.test(e)&&(!(!/^(0x|0X)?[0-9a-f]{40}$/.test(e)&&!/^(0x|0X)?[0-9A-F]{40}$/.test(e))||l(e))},l=function(e){e=e.replace(/^0x/i,"");for(var t=w(e.toLowerCase()).replace(/^0x/i,""),r=0;r<40;r++)if(parseInt(t[r],16)>7&&e[r].toUpperCase()!==e[r]||parseInt(t[r],16)<=7&&e[r].toLowerCase()!==e[r])return!1;return!0},p=function(e){var t="";e=(e=(e=(e=(e=a.encode(e)).replace(/^(?:\u0000)*/,"")).split("").reverse().join("")).replace(/^(?:\u0000)*/,"")).split("").reverse().join("");for(var r=0;r<e.length;r++){var n=e.charCodeAt(r).toString(16);t+=n.length<2?"0"+n:n}return"0x"+t},b=function(e){if(n.isNull(e)||n.isUndefined(e))return e;if(!isFinite(e)&&!g(e))throw new Error('Given input "'+e+'" is not a number.');var t=d(e),r=t.toString(16);return t.lt(new i(0))?"-0x"+r.substr(1):"0x"+r},m=function(e){if(e=e.toString(16),!g(e))throw new Error('Given value "'+e+'" is not a valid hex string.');e=e.replace(/^0x/i,"");for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substr(r,2),16));return t},g=function(e){return(n.isString(e)||n.isNumber(e))&&/^(-)?0x[0-9a-f]*$/i.test(e)},y=function(e){return(n.isString(e)||n.isNumber(e))&&/^(-0x|0x)?[0-9a-f]*$/i.test(e)},v="0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",w=function(e){c(e)&&(e=e.toString()),g(e)&&/^0x/i.test(e.toString())&&(e=m(e));var t=s.keccak256(e);return t===v?null:t};w._Hash=s,e.exports={BN:i,isBN:c,isBigNumber:f,toBN:d,isAddress:h,isBloom:function(e){return u.isBloom(e)},isUserEthereumAddressInBloom:function(e,t){return u.isUserEthereumAddressInBloom(e,t)},isContractAddressInBloom:function(e,t){return u.isContractAddressInBloom(e,t)},isTopic:function(e){return u.isTopic(e)},isTopicInBloom:function(e,t){return u.isTopicInBloom(e,t)},isInBloom:function(e,t){return u.isInBloom(e,t)},checkAddressChecksum:l,utf8ToHex:p,hexToUtf8:function(e){if(!g(e))throw new Error('The parameter "'+e+'" must be a valid HEX string.');for(var t="",r=0,n=(e=(e=(e=(e=(e=e.replace(/^0x/i,"")).replace(/^(?:00)*/,"")).split("").reverse().join("")).replace(/^(?:00)*/,"")).split("").reverse().join("")).length,i=0;i<n;i+=2)r=parseInt(e.substr(i,2),16),t+=String.fromCharCode(r);return a.decode(t)},hexToNumber:function(e){if(!e)return e;if(n.isString(e)&&!g(e))throw new Error('Given value "'+e+'" is not a valid hex string.');return d(e).toNumber()},hexToNumberString:function(e){if(!e)return e;if(n.isString(e)&&!g(e))throw new Error('Given value "'+e+'" is not a valid hex string.');return d(e).toString(10)},numberToHex:b,toHex:function(e,r){if(h(e))return r?"address":"0x"+e.toLowerCase().replace(/^0x/i,"");if(n.isBoolean(e))return r?"bool":e?"0x01":"0x00";if(t.isBuffer(e))return"0x"+e.toString("hex");if(n.isObject(e)&&!f(e)&&!c(e))return r?"string":p(JSON.stringify(e));if(n.isString(e)){if(0===e.indexOf("-0x")||0===e.indexOf("-0X"))return r?"int256":b(e);if(0===e.indexOf("0x")||0===e.indexOf("0X"))return r?"bytes":e;if(!isFinite(e))return r?"string":p(e)}return r?e<0?"int256":"uint256":b(e)},hexToBytes:m,bytesToHex:function(e){for(var t=[],r=0;r<e.length;r++)t.push((e[r]>>>4).toString(16)),t.push((15&e[r]).toString(16));return"0x"+t.join("")},isHex:y,isHexStrict:g,stripHexPrefix:function(e){return 0!==e&&y(e)?e.replace(/^(-)?0x/i,"$1"):e},leftPad:function(e,t,r){var n=/^0x/i.test(e)||"number"==typeof e,i=t-(e=e.toString(16).replace(/^0x/i,"")).length+1>=0?t-e.length+1:0;return(n?"0x":"")+new Array(i).join(r||"0")+e},rightPad:function(e,t,r){var n=/^0x/i.test(e)||"number"==typeof e,i=t-(e=e.toString(16).replace(/^0x/i,"")).length+1>=0?t-e.length+1:0;return(n?"0x":"")+e+new Array(i).join(r||"0")},toTwosComplement:function(e){return"0x"+d(e).toTwos(256).toString(16,64)},sha3:w,sha3Raw:function(e){return null===(e=w(e))?v:e}}}).call(this,r(11).Buffer)},function(e,t,r){"use strict";var n={messageId:0,toPayload:function(e,t){if(!e)throw new Error('JSONRPC method should be specified for params: "'+JSON.stringify(t)+'"!');return n.messageId++,{jsonrpc:"2.0",id:n.messageId,method:e,params:t||[]}},isValidResponse:function(e){return Array.isArray(e)?e.every(t):t(e);function t(e){return!(!e||e.error||"2.0"!==e.jsonrpc||"number"!=typeof e.id&&"string"!=typeof e.id||void 0===e.result)}},toBatchPayload:function(e){return e.map(function(e){return n.toPayload(e.method,e.params)})}};e.exports=n},function(e,t,r){(function(e){t.fetch=s(e.fetch)&&s(e.ReadableStream),t.writableStream=s(e.WritableStream),t.abortController=s(e.AbortController),t.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),t.blobConstructor=!0}catch(e){}var r;function n(){if(void 0!==r)return r;if(e.XMLHttpRequest){r=new e.XMLHttpRequest;try{r.open("GET",e.XDomainRequest?"/":"https://example.com")}catch(e){r=null}}else r=null;return r}function i(e){var t=n();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(e){}return!1}var o=void 0!==e.ArrayBuffer,a=o&&s(e.ArrayBuffer.prototype.slice);function s(e){return"function"==typeof e}t.arraybuffer=t.fetch||o&&i("arraybuffer"),t.msstream=!t.fetch&&a&&i("ms-stream"),t.mozchunkedarraybuffer=!t.fetch&&o&&i("moz-chunked-arraybuffer"),t.overrideMimeType=t.fetch||!!n()&&s(n().overrideMimeType),t.vbArray=s(e.VBArray),r=null}).call(this,r(10))},function(e,t,r){(function(e,n,i){var o=r(117),a=r(3),s=r(119),u=t.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},c=t.IncomingMessage=function(t,r,a,u){var c=this;if(s.Readable.call(c),c._mode=a,c.headers={},c.rawHeaders=[],c.trailers={},c.rawTrailers=[],c.on("end",function(){e.nextTick(function(){c.emit("close")})}),"fetch"===a){if(c._fetchResponse=r,c.url=r.url,c.statusCode=r.status,c.statusMessage=r.statusText,r.headers.forEach(function(e,t){c.headers[t.toLowerCase()]=e,c.rawHeaders.push(t,e)}),o.writableStream){var f=new WritableStream({write:function(e){return new Promise(function(t,r){c._destroyed?r():c.push(new n(e))?t():c._resumeFetch=t})},close:function(){i.clearTimeout(u),c._destroyed||c.push(null)},abort:function(e){c._destroyed||c.emit("error",e)}});try{return void r.body.pipeTo(f).catch(function(e){i.clearTimeout(u),c._destroyed||c.emit("error",e)})}catch(e){}}var d=r.body.getReader();!function e(){d.read().then(function(t){if(!c._destroyed){if(t.done)return i.clearTimeout(u),void c.push(null);c.push(new n(t.value)),e()}}).catch(function(e){i.clearTimeout(u),c._destroyed||c.emit("error",e)})}()}else if(c._xhr=t,c._pos=0,c.url=t.responseURL,c.statusCode=t.status,c.statusMessage=t.statusText,t.getAllResponseHeaders().split(/\r?\n/).forEach(function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var r=t[1].toLowerCase();"set-cookie"===r?(void 0===c.headers[r]&&(c.headers[r]=[]),c.headers[r].push(t[2])):void 0!==c.headers[r]?c.headers[r]+=", "+t[2]:c.headers[r]=t[2],c.rawHeaders.push(t[1],t[2])}}),c._charset="x-user-defined",!o.overrideMimeType){var h=c.rawHeaders["mime-type"];if(h){var l=h.match(/;\s*charset=([^;])(;|$)/);l&&(c._charset=l[1].toLowerCase())}c._charset||(c._charset="utf-8")}};a(c,s.Readable),c.prototype._read=function(){var e=this._resumeFetch;e&&(this._resumeFetch=null,e())},c.prototype._onXHRProgress=function(){var e=this,t=e._xhr,r=null;switch(e._mode){case"text:vbarray":if(t.readyState!==u.DONE)break;try{r=new i.VBArray(t.responseBody).toArray()}catch(e){}if(null!==r){e.push(new n(r));break}case"text":try{r=t.responseText}catch(t){e._mode="text:vbarray";break}if(r.length>e._pos){var o=r.substr(e._pos);if("x-user-defined"===e._charset){for(var a=new n(o.length),s=0;s<o.length;s++)a[s]=255&o.charCodeAt(s);e.push(a)}else e.push(o,e._charset);e._pos=r.length}break;case"arraybuffer":if(t.readyState!==u.DONE||!t.response)break;r=t.response,e.push(new n(new Uint8Array(r)));break;case"moz-chunked-arraybuffer":if(r=t.response,t.readyState!==u.LOADING||!r)break;e.push(new n(new Uint8Array(r)));break;case"ms-stream":if(r=t.response,t.readyState!==u.LOADING)break;var c=new i.MSStreamReader;c.onprogress=function(){c.result.byteLength>e._pos&&(e.push(new n(new Uint8Array(c.result.slice(e._pos)))),e._pos=c.result.byteLength)},c.onload=function(){e.push(null)},c.readAsArrayBuffer(r)}e._xhr.readyState===u.DONE&&"ms-stream"!==e._mode&&e.push(null)}}).call(this,r(9),r(11).Buffer,r(10))},function(e,t,r){(t=e.exports=r(120)).Stream=t,t.Readable=t,t.Writable=r(123),t.Duplex=r(43),t.Transform=r(124),t.PassThrough=r(246)},function(e,t,r){"use strict";(function(t,n){var i=r(17);e.exports=v;var o,a=r(40);v.ReadableState=y,r(14);var s=function(e,t){return e.listeners(t).length},u=r(121),c=r(74).Buffer,f=t.Uint8Array||function(){},d=Object.create(r(13));d.inherits=r(3);var h=r(243),l=void 0;l=h&&h.debuglog?h.debuglog("stream"):function(){};var p,b=r(244),m=r(122);d.inherits(v,u);var g=["error","close","destroy","pause","resume"];function y(e,t){e=e||{};var n=t instanceof(o=o||r(43));this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,a=e.readableHighWaterMark;this.highWaterMark=i||0===i?i:n&&(a||0===a)?a:this.objectMode?16:16384,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new b,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=r(19).StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function v(e){if(o=o||r(43),!(this instanceof v))return new v(e);this._readableState=new y(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function w(e,t,r,n,i){var o,a=e._readableState;return null===t?(a.reading=!1,function(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,E(e)}}(e,a)):(i||(o=function(e,t){var r,n;return c.isBuffer(n=t)||n instanceof f||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}(a,t)),o?e.emit("error",o):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),n?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):_(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?_(e,a,t,!1):x(e,a)):_(e,a,t,!1))):n||(a.reading=!1)),function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(a)}function _(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&E(e)),x(e,t)}function S(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function E(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(l("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(k,e):k(e))}function k(e){l("emit readable"),e.emit("readable"),j(e)}function x(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(A,e,t))}function A(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(l("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function O(e){l("readable nexttick read 0"),e.read(0)}function M(e,t){t.reading||(l("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),j(e),t.flowing&&!t.reading&&e.read(0)}function j(e){var t=e._readableState;for(l("flow",t.flowing);t.flowing&&null!==e.read(););}function R(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;return e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,n=1,i=r.data;for(e-=i.length;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(i+=a===o.length?o:o.slice(0,e),0==(e-=a)){a===o.length?(++n,t.head=r.next?r.next:t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=c.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0==(e-=a)){a===o.length?(++i,t.head=n.next?n.next:t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}(e,t),n}(e,t.buffer,t.decoder),r);var r}function P(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(T,t,e))}function T(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function I(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),v.prototype.destroy=m.destroy,v.prototype._undestroy=m.undestroy,v.prototype._destroy=function(e,t){this.push(null),t(e)},v.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=c.from(e,t),t=""),r=!0),w(this,e,t,!1,r)},v.prototype.unshift=function(e){return w(this,e,null,!0,!1)},v.prototype.isPaused=function(){return!1===this._readableState.flowing},v.prototype.setEncoding=function(e){return p||(p=r(19).StringDecoder),this._readableState.decoder=new p(e),this._readableState.encoding=e,this},v.prototype.read=function(e){l("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return l("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?P(this):E(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&P(this),null;var n,i=t.needReadable;return l("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&l("length less than watermark",i=!0),t.ended||t.reading?l("reading or ended",i=!1):i&&(l("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=S(r,t))),null===(n=e>0?R(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&P(this)),null!==n&&this.emit("data",n),n},v.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},v.prototype.pipe=function(e,t){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,l("pipe count=%d opts=%j",o.pipesCount,t);var u=t&&!1===t.end||e===n.stdout||e===n.stderr?y:c;function c(){l("onend"),e.end()}o.endEmitted?i.nextTick(u):r.once("end",u),e.on("unpipe",function t(n,i){l("onunpipe"),n===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,l("cleanup"),e.removeListener("close",m),e.removeListener("finish",g),e.removeListener("drain",f),e.removeListener("error",b),e.removeListener("unpipe",t),r.removeListener("end",c),r.removeListener("end",y),r.removeListener("data",p),d=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||f())});var f=function(e){return function(){var t=e._readableState;l("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,j(e))}}(r);e.on("drain",f);var d=!1,h=!1;function p(t){l("ondata"),h=!1,!1!==e.write(t)||h||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==I(o.pipes,e))&&!d&&(l("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,h=!0),r.pause())}function b(t){l("onerror",t),y(),e.removeListener("error",b),0===s(e,"error")&&e.emit("error",t)}function m(){e.removeListener("finish",g),y()}function g(){l("onfinish"),e.removeListener("close",m),y()}function y(){l("unpipe"),r.unpipe(e)}return r.on("data",p),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",b),e.once("close",m),e.once("finish",g),e.emit("pipe",r),o.flowing||(l("pipe resume"),r.resume()),e},v.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,r);return this}var a=I(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},v.prototype.addListener=v.prototype.on=function(e,t){var r=u.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&E(this):i.nextTick(O,this))}return r},v.prototype.resume=function(){var e=this._readableState;return e.flowing||(l("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(M,e,t))}(this,e)),this},v.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this},v.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",function(){if(l("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){l("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<g.length;o++)e.on(g[o],this.emit.bind(this,g[o]));return this._read=function(t){l("wrapped _read",t),n&&(n=!1,e.resume())},this},Object.defineProperty(v.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),v._fromList=R}).call(this,r(10),r(9))},function(e,t,r){e.exports=r(14).EventEmitter},function(e,t,r){"use strict";var n=r(17);function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this;return this._readableState&&this._readableState.destroyed||this._writableState&&this._writableState.destroyed?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||n.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(n.nextTick(i,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,r){"use strict";(function(t,n,i){var o=r(17);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(void 0),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=y;var s,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?n:o.nextTick;y.WritableState=g;var c=Object.create(r(13));c.inherits=r(3);var f,d={deprecate:r(42)},h=r(121),l=r(74).Buffer,p=i.Uint8Array||function(){},b=r(122);function m(){}function g(e,t){s=s||r(43);var n=t instanceof s;this.objectMode=!!(e=e||{}).objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,c=e.writableHighWaterMark;this.highWaterMark=i||0===i?i:n&&(c||0===c)?c:this.objectMode?16:16384,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1,this.decodeStrings=!(!1===e.decodeStrings),this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(o.nextTick(i,n),o.nextTick(k,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),k(e,t))}(e,r,n,t,i);else{var a=S(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||_(e,r),n?u(w,e,r,a,i):w(e,r,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function y(e){if(s=s||r(43),!(f.call(y,this)||this instanceof s))return new y(e);this._writableState=new g(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),h.call(this)}function v(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function w(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),k(e,t)}function _(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=new Array(t.bufferedRequestCount),i=t.corkedRequestsFree;i.entry=r;for(var o=0,s=!0;r;)n[o]=r,r.isBuf||(s=!1),r=r.next,o+=1;n.allBuffers=s,v(e,t,!0,t.length,n,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk;if(v(e,t,!1,t.objectMode?1:u.length,u,r.encoding,r.callback),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function S(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function E(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),k(e,t)})}function k(e,t){var r=S(t);return r&&(function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(E,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}c.inherits(y,h),g.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(g.prototype,"buffer",{get:d.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(e){return!!f.call(this,e)||this===y&&e&&e._writableState instanceof g}})):f=function(e){return e instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(e,t,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(l.isBuffer(n=e)||n instanceof p);return s&&!l.isBuffer(e)&&(e=function(e){return l.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=m),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),o.nextTick(t,r)}(this,r):(s||function(e,t,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),o.nextTick(n,a),i=!1),i}(this,i,e,r))&&(i.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=l.from(t,r)),t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else v(e,t,!1,s,n,i,o);return u}(this,i,s,e,t,r)),a},y.prototype.cork=function(){this._writableState.corked++},y.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||_(this,e))},y.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,k(e,t),r&&(t.finished?o.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=b.destroy,y.prototype._undestroy=b.undestroy,y.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(9),r(51).setImmediate,r(10))},function(e,t,r){"use strict";e.exports=a;var n=r(43),i=Object.create(r(13));function o(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function a(e){if(!(this instanceof a))return new a(e);n.call(this,e),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",s)}function s(){var e=this;"function"==typeof this._flush?this._flush(function(t,r){u(e,t,r)}):u(this,null,null)}function u(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}i.inherits=r(3),i.inherits(a,n),a.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},a.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},a.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},a.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},a.prototype._destroy=function(e,t){var r=this;n.prototype._destroy.call(this,e,function(e){t(e),r.emit("close")})}},function(e,t){e.exports=function(){for(var e={},t=0;t<arguments.length;t++){var n=arguments[t];for(var i in n)r.call(n,i)&&(e[i]=n[i])}return e};var r=Object.prototype.hasOwnProperty},function(e,t,r){var n=r(73),i=r(52),o=e.exports;for(var a in n)n.hasOwnProperty(a)&&(o[a]=n[a]);function s(e){if("string"==typeof e&&(e=i.parse(e)),e.protocol||(e.protocol="https:"),"https:"!==e.protocol)throw new Error('Protocol "'+e.protocol+'" not supported. Expected "https:"');return e}o.request=function(e,t){return e=s(e),n.request.call(this,e,t)},o.get=function(e,t){return e=s(e),n.get.call(this,e,t)}},function(e,t,r){"use strict";var n=r(29),i=r(21).errors,o=r(21).formatters,a=r(33),s=r(128),u=r(129).subscriptions,c=r(369),f=function(e){if(!e.call||!e.name)throw new Error('When creating a method you need to provide at least the "name" and "call" property.');this.name=e.name,this.call=e.call,this.params=e.params||0,this.inputFormatter=e.inputFormatter,this.outputFormatter=e.outputFormatter,this.transformPayload=e.transformPayload,this.extraFormatters=e.extraFormatters,this.abiCoder=e.abiCoder,this.requestManager=e.requestManager,this.accounts=e.accounts,this.defaultBlock=e.defaultBlock||"latest",this.defaultAccount=e.defaultAccount||null,this.transactionBlockTimeout=e.transactionBlockTimeout||50,this.transactionConfirmationBlocks=e.transactionConfirmationBlocks||24,this.transactionPollingTimeout=e.transactionPollingTimeout||750,this.defaultCommon=e.defaultCommon,this.defaultChain=e.defaultChain,this.defaultHardfork=e.defaultHardfork,this.handleRevert=e.handleRevert};f.prototype.setRequestManager=function(e,t){this.requestManager=e,t&&(this.accounts=t)},f.prototype.createFunction=function(e,t){var r=this.buildCall();return r.call=this.call,this.setRequestManager(e||this.requestManager,t||this.accounts),r},f.prototype.attachToObject=function(e){var t=this.buildCall();t.call=this.call;var r=this.name.split(".");r.length>1?(e[r[0]]=e[r[0]]||{},e[r[0]][r[1]]=t):e[r[0]]=t},f.prototype.getCall=function(e){return n.isFunction(this.call)?this.call(e):this.call},f.prototype.extractCallback=function(e){if(n.isFunction(e[e.length-1]))return e.pop()},f.prototype.validateArgs=function(e){if(e.length!==this.params)throw i.InvalidNumberOfParams(e.length,this.params,this.name)},f.prototype.formatInput=function(e){var t=this;return this.inputFormatter?this.inputFormatter.map(function(r,n){return r?r.call(t,e[n]):e[n]}):e},f.prototype.formatOutput=function(e){var t=this;return n.isArray(e)?e.map(function(e){return t.outputFormatter&&e?t.outputFormatter(e):e}):this.outputFormatter&&e?this.outputFormatter(e):e},f.prototype.toPayload=function(e){var t=this.getCall(e),r=this.extractCallback(e),n=this.formatInput(e);this.validateArgs(n);var i={method:t,params:n,callback:r};return this.transformPayload&&(i=this.transformPayload(i)),i},f.prototype._confirmTransaction=function(e,t,r){var d=this,h=!1,l=!0,p=0,b=0,m=null,g=null,y=n.isObject(r.params[0])&&r.params[0].gas?r.params[0].gas:null,v=n.isObject(r.params[0])&&r.params[0].data&&r.params[0].from&&!r.params[0].to,w=v&&r.params[0].data.length>2,_=[new f({name:"getBlockByNumber",call:"eth_getBlockByNumber",params:2,inputFormatter:[o.inputBlockNumberFormatter,function(e){return!!e}],outputFormatter:o.outputBlockFormatter}),new f({name:"getTransactionReceipt",call:"eth_getTransactionReceipt",params:1,inputFormatter:[null],outputFormatter:o.outputTransactionReceiptFormatter}),new f({name:"getCode",call:"eth_getCode",params:2,inputFormatter:[o.inputAddressFormatter,o.inputDefaultBlockNumberFormatter]}),new f({name:"getTransactionByHash",call:"eth_getTransactionByHash",params:1,inputFormatter:[null],outputFormatter:o.outputTransactionFormatter}),new u({name:"subscribe",type:"eth",subscriptions:{newBlockHeaders:{subscriptionName:"newHeads",params:0,outputFormatter:o.outputBlockFormatter}}})],S={};n.each(_,function(e){e.attachToObject(S),e.requestManager=d.requestManager});var E=function(n,u,f,_,E){if(!f)return E||(E={unsubscribe:function(){clearInterval(m)}}),(n?s.resolve(n):S.getTransactionReceipt(t)).catch(function(t){E.unsubscribe(),h=!0,a._fireError({message:"Failed to check for transaction receipt:",data:t},e.eventEmitter,e.reject)}).then(async function(t){if(!t||!t.blockHash)throw new Error("Receipt missing or blockHash null");if(d.extraFormatters&&d.extraFormatters.receiptFormatter&&(t=d.extraFormatters.receiptFormatter(t)),e.eventEmitter.listeners("confirmation").length>0){var r;if(void 0===n||0!==b){var i=await S.getBlockByNumber("latest"),o=i?i.hash:null;u?g?(r=await S.getBlockByNumber(g.number+1))&&(g=r,e.eventEmitter.emit("confirmation",b,t,o)):(r=await S.getBlockByNumber(t.blockNumber),g=r,e.eventEmitter.emit("confirmation",b,t,o)):e.eventEmitter.emit("confirmation",b,t,o)}(u&&r||!u)&&b++,l=!1,b===d.transactionConfirmationBlocks+1&&(E.unsubscribe(),e.eventEmitter.removeAllListeners())}return t}).then(async function(t){if(v&&!h){if(!t.contractAddress)return l&&(E.unsubscribe(),h=!0),void a._fireError(i.NoContractAddressFoundError(t),e.eventEmitter,e.reject,null,t);var r;try{r=await S.getCode(t.contractAddress)}catch(e){}if(!r)return;!0===t.status&&w||r.length>2?(e.eventEmitter.emit("receipt",t),e.resolve(d.extraFormatters&&d.extraFormatters.contractDeployFormatter?d.extraFormatters.contractDeployFormatter(t):t),l&&e.eventEmitter.removeAllListeners()):a._fireError(i.ContractCodeNotStoredError(t),e.eventEmitter,e.reject,null,t),l&&E.unsubscribe(),h=!0}return t}).then(async function(t){if(!v&&!h){if(t.outOfGas||y&&y===t.gasUsed||!0!==t.status&&"0x1"!==t.status&&void 0!==t.status)if(JSON.stringify(t,null,2),!1===t.status||"0x0"===t.status)try{var n;if(!d.handleRevert||"eth_sendTransaction"!==d.call&&"eth_sendRawTransaction"!==d.call)throw!1;var s=r.params[0];if("eth_sendRawTransaction"===d.call){var u=c.parse(r.params[0]);s=o.inputTransactionFormatter({data:u.data,to:u.to,from:u.from,gas:u.gasLimit.toHexString(),gasPrice:u.gasPrice.toHexString(),value:u.value.toHexString()})}if(!(n=await d.getRevertReason(s,t.blockNumber)))throw!1;a._fireError(i.TransactionRevertInstructionError(n.reason,n.signature,t),e.eventEmitter,e.reject,null,t)}catch(r){a._fireError(i.TransactionRevertedWithoutReasonError(t),e.eventEmitter,e.reject,null,t)}else a._fireError(i.TransactionOutOfGasError(t),e.eventEmitter,e.reject,null,t);else e.eventEmitter.emit("receipt",t),e.resolve(t),l&&e.eventEmitter.removeAllListeners();l&&E.unsubscribe(),h=!0}}).catch(function(){p++,u?p-1>=d.transactionPollingTimeout&&(E.unsubscribe(),h=!0,a._fireError(i.TransactionError("Transaction was not mined within "+d.transactionPollingTimeout+" seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!"),e.eventEmitter,e.reject)):p-1>=d.transactionBlockTimeout&&(E.unsubscribe(),h=!0,a._fireError(i.TransactionError("Transaction was not mined within "+d.transactionBlockTimeout+" blocks, please make sure your transaction was properly sent. Be aware that it might still be mined!"),e.eventEmitter,e.reject))});E.unsubscribe(),h=!0,a._fireError({message:"Failed to subscribe to new newBlockHeaders to confirm the transaction receipts.",data:f},e.eventEmitter,e.reject)},k=(function(e){const t=()=>{m=setInterval(E.bind(null,e,!0),1e3)};this.requestManager.provider.on?S.subscribe("newBlockHeaders",function(r,n,i){r||!n?t():E(e,!1,r,0,i)}):t()}).bind(this);S.getTransactionReceipt(t).then(function(t){t&&t.blockHash?(e.eventEmitter.listeners("confirmation").length>0&&k(t),E(t,!1)):h||k()}).catch(function(){h||k()})};var d=function(e,t){return n.isNumber(e)?t.wallet[e]:n.isObject(e)&&e.address&&e.privateKey?e:t.wallet[e.toLowerCase()]};f.prototype.buildCall=function(){var e=this,t="eth_sendTransaction"===e.call||"eth_sendRawTransaction"===e.call,r="eth_call"===e.call,o=function(){var o=s(!t),u=e.toPayload(Array.prototype.slice.call(arguments)),c=function(n,s){var c;if(e.handleRevert&&r&&e.abiCoder&&(!n&&e.isRevertReasonString(s)?c=s.substring(10):n&&n.data&&(c=n.data.substring(10)),c)){var f=e.abiCoder.decodeParameter("string","0x"+c);a._fireError(i.RevertInstructionError(f,"Error(String)"),o.eventEmitter,o.reject,u.callback,{reason:f,signature:"Error(String)"})}else{try{s=e.formatOutput(s)}catch(e){n=e}if(s instanceof Error&&(n=s),n)return n.error&&(n=n.error),a._fireError(n,o.eventEmitter,o.reject,u.callback);u.callback&&u.callback(null,s),t?(o.eventEmitter.emit("transactionHash",s),e._confirmTransaction(o,s,u)):n||o.resolve(s)}},h=function(t){var r=n.extend({},u,{method:"eth_sendRawTransaction",params:[t.rawTransaction]});e.requestManager.send(r,c)},l=function(e,t){var r;if(t&&t.accounts&&t.accounts.wallet&&t.accounts.wallet.length)if("eth_sendTransaction"===e.method){var i=e.params[0];if((r=d(n.isObject(i)?i.from:null,t.accounts))&&r.privateKey){var a=n.omit(i,"from");return t.defaultChain&&!a.chain&&(a.chain=t.defaultChain),t.defaultHardfork&&!a.hardfork&&(a.hardfork=t.defaultHardfork),t.defaultCommon&&!a.common&&(a.common=t.defaultCommon),void t.accounts.signTransaction(a,r.privateKey).then(h).catch(function(e){if(n.isFunction(o.eventEmitter.listeners)&&o.eventEmitter.listeners("error").length){try{o.eventEmitter.emit("error",e)}catch(e){}o.eventEmitter.removeAllListeners(),o.eventEmitter.catch(function(){})}o.reject(e)})}}else if("eth_sign"===e.method){var s=e.params[1];if((r=d(e.params[0],t.accounts))&&r.privateKey){var u=t.accounts.sign(s,r.privateKey);return e.callback&&e.callback(null,u.signature),void o.resolve(u.signature)}}return t.requestManager.send(e,c)};if(t&&n.isObject(u.params[0])&&void 0===u.params[0].gasPrice){var p=new f({name:"getGasPrice",call:"eth_gasPrice",params:0}).createFunction(e.requestManager);p(function(r,n){n&&(u.params[0].gasPrice=n),t&&setTimeout(()=>{o.eventEmitter.emit("sending",u)},0),l(u,e)})}else t&&setTimeout(()=>{o.eventEmitter.emit("sending",u)},0),l(u,e);return t&&setTimeout(()=>{o.eventEmitter.emit("sent",u)},0),o.eventEmitter};return o.method=e,o.request=this.request.bind(this),o},f.prototype.getRevertReason=function(e,t){var r=this;return new Promise(function(n,i){new f({name:"call",call:"eth_call",params:2,abiCoder:r.abiCoder,handleRevert:!0}).createFunction(r.requestManager)(e,a.numberToHex(t)).then(function(){n(!1)}).catch(function(e){e.reason?n({reason:e.reason,signature:e.signature}):i(e)})})},f.prototype.isRevertReasonString=function(e){return n.isString(e)&&(e.length-2)/2%32==4&&"0x08c379a0"===e.substring(0,10)},f.prototype.request=function(){var e=this.toPayload(Array.prototype.slice.call(arguments));return e.format=this.formatOutput.bind(this),e},e.exports=f},function(e,t,r){"use strict";var n=r(72),i=function(e){var t,r,i=new Promise(function(){t=arguments[0],r=arguments[1]});if(e)return{resolve:t,reject:r,eventEmitter:i};var o=new n;return i._events=o._events,i.emit=o.emit,i.on=o.on,i.once=o.once,i.off=o.off,i.listeners=o.listeners,i.addListener=o.addListener,i.removeListener=o.removeListener,i.removeAllListeners=o.removeAllListeners,{resolve:t,reject:r,eventEmitter:i}};i.resolve=function(e){var t=i(!0);return t.resolve(e),t.eventEmitter},e.exports=i},function(e,t,r){"use strict";var n=r(257),i=function(e){this.name=e.name,this.type=e.type,this.subscriptions=e.subscriptions||{},this.requestManager=null};i.prototype.setRequestManager=function(e){this.requestManager=e},i.prototype.attachToObject=function(e){var t=this.buildCall(),r=this.name.split(".");r.length>1?(e[r[0]]=e[r[0]]||{},e[r[0]][r[1]]=t):e[r[0]]=t},i.prototype.buildCall=function(){var e=this;return function(){e.subscriptions[arguments[0]]||console.warn("Subscription "+JSON.stringify(arguments[0])+" doesn't exist. Subscribing anyway.");var t=new n({subscription:e.subscriptions[arguments[0]]||{},requestManager:e.requestManager,type:e.type});return t.subscribe.apply(t,arguments)}},e.exports={subscriptions:i,subscription:n}},function(e,t,r){"use strict";var n=r(28).rotr32;function i(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function a(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?a(t,r,n):2===e?o(t,r,n):void 0},t.ch32=i,t.maj32=o,t.p32=a,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},function(e,t,r){"use strict";var n=r(28),i=r(53),o=r(130),a=r(22),s=n.sum32,u=n.sum32_4,c=n.sum32_5,f=o.ch32,d=o.maj32,h=o.s0_256,l=o.s1_256,p=o.g0_256,b=o.g1_256,m=i.BlockHash,g=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function y(){if(!(this instanceof y))return new y;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}n.inherits(y,m),e.exports=y,y.blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=u(b(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],m=this.h[2],g=this.h[3],y=this.h[4],v=this.h[5],w=this.h[6],_=this.h[7];for(a(this.k.length===r.length),n=0;n<r.length;n++){var S=c(_,l(y),f(y,v,w),this.k[n],r[n]),E=s(h(i),d(i,o,m));_=w,w=v,v=y,y=s(g,S),g=m,m=o,o=i,i=s(S,E)}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],m),this.h[3]=s(this.h[3],g),this.h[4]=s(this.h[4],y),this.h[5]=s(this.h[5],v),this.h[6]=s(this.h[6],w),this.h[7]=s(this.h[7],_)},y.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(e,t,r){"use strict";var n=r(28),i=r(53),o=r(22),a=n.rotr64_hi,s=n.rotr64_lo,u=n.shr64_hi,c=n.shr64_lo,f=n.sum64,d=n.sum64_hi,h=n.sum64_lo,l=n.sum64_4_hi,p=n.sum64_4_lo,b=n.sum64_5_hi,m=n.sum64_5_lo,g=i.BlockHash,y=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function v(){if(!(this instanceof v))return new v;g.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=y,this.W=new Array(160)}function w(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function _(e,t,r,n,i,o){var a=t&n^~t&o;return a<0&&(a+=4294967296),a}function S(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function E(e,t,r,n,i,o){var a=t&n^t&o^n&o;return a<0&&(a+=4294967296),a}function k(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function x(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function A(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=4294967296),r}function O(e,t){var r=s(e,t,14)^s(e,t,18)^s(t,e,9);return r<0&&(r+=4294967296),r}function M(e,t){var r=a(e,t,1)^a(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}function j(e,t){var r=s(e,t,1)^s(e,t,8)^c(e,t,7);return r<0&&(r+=4294967296),r}function R(e,t){var r=a(e,t,19)^a(t,e,29)^u(e,t,6);return r<0&&(r+=4294967296),r}function P(e,t){var r=s(e,t,19)^s(t,e,29)^c(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(v,g),e.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=R(r[n-4],r[n-3]),o=P(r[n-4],r[n-3]),a=r[n-14],s=r[n-13],u=M(r[n-30],r[n-29]),c=j(r[n-30],r[n-29]),f=r[n-32],d=r[n-31];r[n]=l(i,o,a,s,u,c,f,d),r[n+1]=p(i,o,a,s,u,c,f,d)}},v.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],i=this.h[1],a=this.h[2],s=this.h[3],u=this.h[4],c=this.h[5],l=this.h[6],p=this.h[7],g=this.h[8],y=this.h[9],v=this.h[10],M=this.h[11],j=this.h[12],R=this.h[13],P=this.h[14],T=this.h[15];o(this.k.length===r.length);for(var I=0;I<r.length;I+=2){var C=P,B=T,N=A(g,y),L=O(g,y),D=w(g,0,v,0,j),q=_(0,y,0,M,0,R),U=this.k[I],F=this.k[I+1],H=r[I],z=r[I+1],W=b(C,B,N,L,D,q,U,F,H,z),K=m(C,B,N,L,D,q,U,F,H,z);C=k(n,i),B=x(n,i),N=S(n,0,a,0,u),L=E(0,i,0,s,0,c);var V=d(C,B,N,L),J=h(C,B,N,L);P=j,T=R,j=v,R=M,v=g,M=y,g=d(l,p,W,K),y=h(p,p,W,K),l=u,p=c,u=a,c=s,a=n,s=i,n=d(W,K,V,J),i=h(W,K,V,J)}f(this.h,0,n,i),f(this.h,2,a,s),f(this.h,4,u,c),f(this.h,6,l,p),f(this.h,8,g,y),f(this.h,10,v,M),f(this.h,12,j,R),f(this.h,14,P,T)},v.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(e,t,r){"use strict";var n=t;function i(e){return 1===e.length?"0"+e:e}function o(e){for(var t="",r=0;r<e.length;r++)t+=i(e[r].toString(16));return t}n.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16));else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,a=255&i;o?r.push(o,a):r.push(a)}return r},n.zero2=i,n.toHex=o,n.encode=function(e,t){return"hex"===t?o(e):e}},function(e,t,r){"use strict";var n=t;n.base=r(63),n.short=r(272),n.mont=r(273),n.edwards=r(274)},function(e,t,r){"use strict";var n=r(6).Buffer,i=r(79).Transform;function o(e){i.call(this),this._block=n.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(3)(o,i),o.prototype._transform=function(e,t,r){var n=null;try{this.update(e,t)}catch(e){n=e}r(n)},o.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},o.prototype.update=function(e,t){if(function(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError("Data must be a string or a buffer")}(e),this._finalized)throw new Error("Digest already called");n.isBuffer(e)||(e=n.from(e,t));for(var r=this._block,i=0;this._blockOffset+e.length-i>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)r[o++]=e[i++];this._update(),this._blockOffset=0}for(;i<e.length;)r[this._blockOffset++]=e[i++];for(var a=0,s=8*e.length;s>0;++a)this._length[a]+=s,(s=this._length[a]/4294967296|0)>0&&(this._length[a]-=4294967296*s);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},o.prototype._digest=function(){throw new Error("_digest is not implemented")},e.exports=o},function(e,t,r){"use strict";(function(t,n){var i=r(17);e.exports=v;var o,a=r(40);v.ReadableState=y,r(14);var s=function(e,t){return e.listeners(t).length},u=r(137),c=r(81).Buffer,f=t.Uint8Array||function(){},d=Object.create(r(13));d.inherits=r(3);var h=r(284),l=void 0;l=h&&h.debuglog?h.debuglog("stream"):function(){};var p,b=r(285),m=r(138);d.inherits(v,u);var g=["error","close","destroy","pause","resume"];function y(e,t){e=e||{};var n=t instanceof(o=o||r(37));this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,a=e.readableHighWaterMark;this.highWaterMark=i||0===i?i:n&&(a||0===a)?a:this.objectMode?16:16384,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new b,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=r(19).StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function v(e){if(o=o||r(37),!(this instanceof v))return new v(e);this._readableState=new y(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function w(e,t,r,n,i){var o,a=e._readableState;return null===t?(a.reading=!1,function(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,E(e)}}(e,a)):(i||(o=function(e,t){var r,n;return c.isBuffer(n=t)||n instanceof f||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}(a,t)),o?e.emit("error",o):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),n?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):_(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?_(e,a,t,!1):x(e,a)):_(e,a,t,!1))):n||(a.reading=!1)),function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(a)}function _(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&E(e)),x(e,t)}function S(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function E(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(l("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(k,e):k(e))}function k(e){l("emit readable"),e.emit("readable"),j(e)}function x(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(A,e,t))}function A(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(l("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function O(e){l("readable nexttick read 0"),e.read(0)}function M(e,t){t.reading||(l("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),j(e),t.flowing&&!t.reading&&e.read(0)}function j(e){var t=e._readableState;for(l("flow",t.flowing);t.flowing&&null!==e.read(););}function R(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;return e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,n=1,i=r.data;for(e-=i.length;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(i+=a===o.length?o:o.slice(0,e),0==(e-=a)){a===o.length?(++n,t.head=r.next?r.next:t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=c.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0==(e-=a)){a===o.length?(++i,t.head=n.next?n.next:t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}(e,t),n}(e,t.buffer,t.decoder),r);var r}function P(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(T,t,e))}function T(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function I(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),v.prototype.destroy=m.destroy,v.prototype._undestroy=m.undestroy,v.prototype._destroy=function(e,t){this.push(null),t(e)},v.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=c.from(e,t),t=""),r=!0),w(this,e,t,!1,r)},v.prototype.unshift=function(e){return w(this,e,null,!0,!1)},v.prototype.isPaused=function(){return!1===this._readableState.flowing},v.prototype.setEncoding=function(e){return p||(p=r(19).StringDecoder),this._readableState.decoder=new p(e),this._readableState.encoding=e,this},v.prototype.read=function(e){l("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return l("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?P(this):E(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&P(this),null;var n,i=t.needReadable;return l("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&l("length less than watermark",i=!0),t.ended||t.reading?l("reading or ended",i=!1):i&&(l("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=S(r,t))),null===(n=e>0?R(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&P(this)),null!==n&&this.emit("data",n),n},v.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},v.prototype.pipe=function(e,t){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,l("pipe count=%d opts=%j",o.pipesCount,t);var u=t&&!1===t.end||e===n.stdout||e===n.stderr?y:c;function c(){l("onend"),e.end()}o.endEmitted?i.nextTick(u):r.once("end",u),e.on("unpipe",function t(n,i){l("onunpipe"),n===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,l("cleanup"),e.removeListener("close",m),e.removeListener("finish",g),e.removeListener("drain",f),e.removeListener("error",b),e.removeListener("unpipe",t),r.removeListener("end",c),r.removeListener("end",y),r.removeListener("data",p),d=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||f())});var f=function(e){return function(){var t=e._readableState;l("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,j(e))}}(r);e.on("drain",f);var d=!1,h=!1;function p(t){l("ondata"),h=!1,!1!==e.write(t)||h||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==I(o.pipes,e))&&!d&&(l("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,h=!0),r.pause())}function b(t){l("onerror",t),y(),e.removeListener("error",b),0===s(e,"error")&&e.emit("error",t)}function m(){e.removeListener("finish",g),y()}function g(){l("onfinish"),e.removeListener("close",m),y()}function y(){l("unpipe"),r.unpipe(e)}return r.on("data",p),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",b),e.once("close",m),e.once("finish",g),e.emit("pipe",r),o.flowing||(l("pipe resume"),r.resume()),e},v.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,r);return this}var a=I(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},v.prototype.addListener=v.prototype.on=function(e,t){var r=u.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&E(this):i.nextTick(O,this))}return r},v.prototype.resume=function(){var e=this._readableState;return e.flowing||(l("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(M,e,t))}(this,e)),this},v.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this},v.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",function(){if(l("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){l("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<g.length;o++)e.on(g[o],this.emit.bind(this,g[o]));return this._read=function(t){l("wrapped _read",t),n&&(n=!1,e.resume())},this},Object.defineProperty(v.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),v._fromList=R}).call(this,r(10),r(9))},function(e,t,r){e.exports=r(14).EventEmitter},function(e,t,r){"use strict";var n=r(17);function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this;return this._readableState&&this._readableState.destroyed||this._writableState&&this._writableState.destroyed?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||n.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(n.nextTick(i,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,r){"use strict";e.exports=a;var n=r(37),i=Object.create(r(13));function o(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function a(e){if(!(this instanceof a))return new a(e);n.call(this,e),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",s)}function s(){var e=this;"function"==typeof this._flush?this._flush(function(t,r){u(e,t,r)}):u(this,null,null)}function u(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}i.inherits=r(3),i.inherits(a,n),a.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},a.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},a.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},a.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},a.prototype._destroy=function(e,t){var r=this;n.prototype._destroy.call(this,e,function(e){t(e),r.emit("close")})}},function(e,t,r){var n=r(3),i=r(44),o=r(6).Buffer,a=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],s=new Array(64);function u(){this.init(),this._w=s,i.call(this,64,56)}function c(e,t,r){return r^e&(t^r)}function f(e,t,r){return e&t|r&(e|t)}function d(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function h(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function l(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}n(u,i),u.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,p=0|this._f,b=0|this._g,m=0|this._h,g=0;g<16;++g)r[g]=e.readInt32BE(4*g);for(;g<64;++g)r[g]=0|(((t=r[g-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+r[g-7]+l(r[g-15])+r[g-16];for(var y=0;y<64;++y){var v=m+h(u)+c(u,p,b)+a[y]+r[y]|0,w=d(n)+f(n,i,o)|0;m=b,b=p,p=u,u=s+v|0,s=o,o=i,i=n,n=v+w|0}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0,this._f=p+this._f|0,this._g=b+this._g|0,this._h=m+this._h|0},u.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=u},function(e,t,r){var n=r(3),i=r(44),o=r(6).Buffer,a=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],s=new Array(160);function u(){this.init(),this._w=s,i.call(this,128,112)}function c(e,t,r){return r^e&(t^r)}function f(e,t,r){return e&t|r&(e|t)}function d(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function h(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function l(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function b(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function m(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function g(e,t){return e>>>0<t>>>0?1:0}n(u,i),u.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},u.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,o=0|this._dh,s=0|this._eh,u=0|this._fh,y=0|this._gh,v=0|this._hh,w=0|this._al,_=0|this._bl,S=0|this._cl,E=0|this._dl,k=0|this._el,x=0|this._fl,A=0|this._gl,O=0|this._hl,M=0;M<32;M+=2)t[M]=e.readInt32BE(4*M),t[M+1]=e.readInt32BE(4*M+4);for(;M<160;M+=2){var j=t[M-30],R=t[M-30+1],P=l(j,R),T=p(R,j),I=b(j=t[M-4],R=t[M-4+1]),C=m(R,j),B=t[M-32],N=t[M-32+1],L=T+t[M-14+1]|0,D=P+t[M-14]+g(L,T)|0;D=(D=D+I+g(L=L+C|0,C)|0)+B+g(L=L+N|0,N)|0,t[M]=D,t[M+1]=L}for(var q=0;q<160;q+=2){D=t[q],L=t[q+1];var U=f(r,n,i),F=f(w,_,S),H=d(r,w),z=d(w,r),W=h(s,k),K=h(k,s),V=a[q],J=a[q+1],G=c(s,u,y),X=c(k,x,A),Y=O+K|0,$=v+W+g(Y,O)|0;$=($=($=$+G+g(Y=Y+X|0,X)|0)+V+g(Y=Y+J|0,J)|0)+D+g(Y=Y+L|0,L)|0;var Z=z+F|0,Q=H+U+g(Z,z)|0;v=y,O=A,y=u,A=x,u=s,x=k,s=o+$+g(k=E+Y|0,E)|0,o=i,E=S,i=n,S=_,n=r,_=w,r=$+Q+g(w=Y+Z|0,Y)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+S|0,this._dl=this._dl+E|0,this._el=this._el+k|0,this._fl=this._fl+x|0,this._gl=this._gl+A|0,this._hl=this._hl+O|0,this._ah=this._ah+r+g(this._al,w)|0,this._bh=this._bh+n+g(this._bl,_)|0,this._ch=this._ch+i+g(this._cl,S)|0,this._dh=this._dh+o+g(this._dl,E)|0,this._eh=this._eh+s+g(this._el,k)|0,this._fh=this._fh+u+g(this._fl,x)|0,this._gh=this._gh+y+g(this._gl,A)|0,this._hh=this._hh+v+g(this._hl,O)|0},u.prototype._hash=function(){var e=o.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=u},function(e,t,r){"use strict";var n=r(3),i=r(296),o=r(34),a=r(6).Buffer,s=r(143),u=r(83),c=r(84),f=a.alloc(128);function d(e,t){o.call(this,"digest"),"string"==typeof t&&(t=a.from(t));var r="sha512"===e||"sha384"===e?128:64;this._alg=e,this._key=t,t.length>r?t=("rmd160"===e?new u:c(e)).update(t).digest():t.length<r&&(t=a.concat([t,f],r));for(var n=this._ipad=a.allocUnsafe(r),i=this._opad=a.allocUnsafe(r),s=0;s<r;s++)n[s]=54^t[s],i[s]=92^t[s];this._hash="rmd160"===e?new u:c(e),this._hash.update(n)}n(d,o),d.prototype._update=function(e){this._hash.update(e)},d.prototype._final=function(){var e=this._hash.digest();return("rmd160"===this._alg?new u:c(this._alg)).update(this._opad).update(e).digest()},e.exports=function(e,t){return"rmd160"===(e=e.toLowerCase())||"ripemd160"===e?new d("rmd160",t):"md5"===e?new i(s,t):new d(e,t)}},function(e,t,r){var n=r(78);e.exports=function(e){return(new n).update(e).digest()}},function(e){e.exports=JSON.parse('{"sha224WithRSAEncryption":{"sign":"rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"RSA-SHA224":{"sign":"ecdsa/rsa","hash":"sha224","id":"302d300d06096086480165030402040500041c"},"sha256WithRSAEncryption":{"sign":"rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"RSA-SHA256":{"sign":"ecdsa/rsa","hash":"sha256","id":"3031300d060960864801650304020105000420"},"sha384WithRSAEncryption":{"sign":"rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"RSA-SHA384":{"sign":"ecdsa/rsa","hash":"sha384","id":"3041300d060960864801650304020205000430"},"sha512WithRSAEncryption":{"sign":"rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA512":{"sign":"ecdsa/rsa","hash":"sha512","id":"3051300d060960864801650304020305000440"},"RSA-SHA1":{"sign":"rsa","hash":"sha1","id":"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{"sign":"ecdsa","hash":"sha1","id":""},"sha256":{"sign":"ecdsa","hash":"sha256","id":""},"sha224":{"sign":"ecdsa","hash":"sha224","id":""},"sha384":{"sign":"ecdsa","hash":"sha384","id":""},"sha512":{"sign":"ecdsa","hash":"sha512","id":""},"DSA-SHA":{"sign":"dsa","hash":"sha1","id":""},"DSA-SHA1":{"sign":"dsa","hash":"sha1","id":""},"DSA":{"sign":"dsa","hash":"sha1","id":""},"DSA-WITH-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-SHA224":{"sign":"dsa","hash":"sha224","id":""},"DSA-WITH-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-SHA256":{"sign":"dsa","hash":"sha256","id":""},"DSA-WITH-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-SHA384":{"sign":"dsa","hash":"sha384","id":""},"DSA-WITH-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-SHA512":{"sign":"dsa","hash":"sha512","id":""},"DSA-RIPEMD160":{"sign":"dsa","hash":"rmd160","id":""},"ripemd160WithRSA":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"RSA-RIPEMD160":{"sign":"rsa","hash":"rmd160","id":"3021300906052b2403020105000414"},"md5WithRSAEncryption":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"},"RSA-MD5":{"sign":"rsa","hash":"md5","id":"3020300c06082a864886f70d020505000410"}}')},function(e,t,r){t.pbkdf2=r(298),t.pbkdf2Sync=r(148)},function(e,t){var r=Math.pow(2,30)-1;e.exports=function(e,t){if("number"!=typeof e)throw new TypeError("Iterations not a number");if(e<0)throw new TypeError("Bad iterations");if("number"!=typeof t)throw new TypeError("Key length not a number");if(t<0||t>r||t!=t)throw new TypeError("Bad key length")}},function(e,t,r){(function(t,r){var n;n=t.process&&t.process.browser?"utf-8":t.process&&t.process.version?parseInt(r.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary":"utf-8",e.exports=n}).call(this,r(10),r(9))},function(e,t,r){var n=r(143),i=r(83),o=r(84),a=r(6).Buffer,s=r(146),u=r(147),c=r(149),f=a.alloc(128),d={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function h(e,t,r){var s=function(e){return"rmd160"===e||"ripemd160"===e?function(e){return(new i).update(e).digest()}:"md5"===e?n:function(t){return o(e).update(t).digest()}}(e),u="sha512"===e||"sha384"===e?128:64;t.length>u?t=s(t):t.length<u&&(t=a.concat([t,f],u));for(var c=a.allocUnsafe(u+d[e]),h=a.allocUnsafe(u+d[e]),l=0;l<u;l++)c[l]=54^t[l],h[l]=92^t[l];var p=a.allocUnsafe(u+r+4);c.copy(p,0,0,u),this.ipad1=p,this.ipad2=c,this.opad=h,this.alg=e,this.blocksize=u,this.hash=s,this.size=d[e]}h.prototype.run=function(e,t){return e.copy(t,this.blocksize),this.hash(t).copy(this.opad,this.blocksize),this.hash(this.opad)},e.exports=function(e,t,r,n,i){s(r,n);var o=new h(i=i||"sha1",e=c(e,u,"Password"),(t=c(t,u,"Salt")).length),f=a.allocUnsafe(n),l=a.allocUnsafe(t.length+4);t.copy(l,0,0,t.length);for(var p=0,b=d[i],m=Math.ceil(n/b),g=1;g<=m;g++){l.writeUInt32BE(g,t.length);for(var y=o.run(l,o.ipad1),v=y,w=1;w<r;w++){v=o.run(v,o.ipad2);for(var _=0;_<b;_++)y[_]^=v[_]}y.copy(f,p),p+=b}return f}},function(e,t,r){var n=r(6).Buffer;e.exports=function(e,t,r){if(n.isBuffer(e))return e;if("string"==typeof e)return n.from(e,t);if(ArrayBuffer.isView(e))return n.from(e.buffer);throw new TypeError(r+" must be a string, a Buffer, a typed array or a DataView")}},function(e,t,r){"use strict";t.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},t.writeUInt32BE=function(e,t,r){e[0+r]=t>>>24,e[1+r]=t>>>16&255,e[2+r]=t>>>8&255,e[3+r]=255&t},t.ip=function(e,t,r,n){for(var i=0,o=0,a=6;a>=0;a-=2){for(var s=0;s<=24;s+=8)i<<=1,i|=t>>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=e>>>s+a&1}for(a=6;a>=0;a-=2){for(s=1;s<=25;s+=8)o<<=1,o|=t>>>s+a&1;for(s=1;s<=25;s+=8)o<<=1,o|=e>>>s+a&1}r[n+0]=i>>>0,r[n+1]=o>>>0},t.rip=function(e,t,r,n){for(var i=0,o=0,a=0;a<4;a++)for(var s=24;s>=0;s-=8)i<<=1,i|=t>>>s+a&1,i<<=1,i|=e>>>s+a&1;for(a=4;a<8;a++)for(s=24;s>=0;s-=8)o<<=1,o|=t>>>s+a&1,o<<=1,o|=e>>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},t.pc1=function(e,t,r,n){for(var i=0,o=0,a=7;a>=5;a--){for(var s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1;for(s=0;s<=24;s+=8)i<<=1,i|=e>>s+a&1}for(s=0;s<=24;s+=8)i<<=1,i|=t>>s+a&1;for(a=1;a<=3;a++){for(s=0;s<=24;s+=8)o<<=1,o|=t>>s+a&1;for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1}for(s=0;s<=24;s+=8)o<<=1,o|=e>>s+a&1;r[n+0]=i>>>0,r[n+1]=o>>>0},t.r28shl=function(e,t){return e<<t&268435455|e>>>28-t};var n=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];t.pc2=function(e,t,r,i){for(var o=0,a=0,s=n.length>>>1,u=0;u<s;u++)o<<=1,o|=e>>>n[u]&1;for(u=s;u<n.length;u++)a<<=1,a|=t>>>n[u]&1;r[i+0]=o>>>0,r[i+1]=a>>>0},t.expand=function(e,t,r){var n=0,i=0;n=(1&e)<<5|e>>>27;for(var o=23;o>=15;o-=4)n<<=6,n|=e>>>o&63;for(o=11;o>=3;o-=4)i|=e>>>o&63,i<<=6;i|=(31&e)<<1|e>>>31,t[r+0]=n>>>0,t[r+1]=i>>>0};var i=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];t.substitute=function(e,t){for(var r=0,n=0;n<4;n++)r<<=4,r|=i[64*n+(e>>>18-6*n&63)];for(n=0;n<4;n++)r<<=4,r|=i[256+64*n+(t>>>18-6*n&63)];return r>>>0};var o=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];t.permute=function(e){for(var t=0,r=0;r<o.length;r++)t<<=1,t|=e>>>o[r]&1;return t>>>0},t.padSplit=function(e,t,r){for(var n=e.toString(2);n.length<t;)n="0"+n;for(var i=[],o=0;o<t;o+=r)i.push(n.slice(o,o+r));return i.join(" ")}},function(e,t,r){"use strict";var n=r(22),i=r(3),o=r(150),a=r(85);function s(){this.tmp=new Array(2),this.keys=null}function u(e){a.call(this,e);var t=new s;this._desState=t,this.deriveKeys(t,e.key)}i(u,a),e.exports=u,u.create=function(e){return new u(e)};var c=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];u.prototype.deriveKeys=function(e,t){e.keys=new Array(32),n.equal(t.length,this.blockSize,"Invalid key length");var r=o.readUInt32BE(t,0),i=o.readUInt32BE(t,4);o.pc1(r,i,e.tmp,0),r=e.tmp[0],i=e.tmp[1];for(var a=0;a<e.keys.length;a+=2){var s=c[a>>>1];r=o.r28shl(r,s),i=o.r28shl(i,s),o.pc2(r,i,e.keys,a)}},u.prototype._update=function(e,t,r,n){var i=this._desState,a=o.readUInt32BE(e,t),s=o.readUInt32BE(e,t+4);o.ip(a,s,i.tmp,0),a=i.tmp[0],s=i.tmp[1],"encrypt"===this.type?this._encrypt(i,a,s,i.tmp,0):this._decrypt(i,a,s,i.tmp,0),s=i.tmp[1],o.writeUInt32BE(r,a=i.tmp[0],n),o.writeUInt32BE(r,s,n+4)},u.prototype._pad=function(e,t){for(var r=e.length-t,n=t;n<e.length;n++)e[n]=r;return!0},u.prototype._unpad=function(e){for(var t=e[e.length-1],r=e.length-t;r<e.length;r++)n.equal(e[r],t);return e.slice(0,e.length-t)},u.prototype._encrypt=function(e,t,r,n,i){for(var a=t,s=r,u=0;u<e.keys.length;u+=2){var c=e.keys[u],f=e.keys[u+1];o.expand(s,e.tmp,0);var d=o.substitute(c^=e.tmp[0],f^=e.tmp[1]),h=s;s=(a^o.permute(d))>>>0,a=h}o.rip(s,a,n,i)},u.prototype._decrypt=function(e,t,r,n,i){for(var a=r,s=t,u=e.keys.length-2;u>=0;u-=2){var c=e.keys[u],f=e.keys[u+1];o.expand(a,e.tmp,0);var d=o.substitute(c^=e.tmp[0],f^=e.tmp[1]),h=a;a=(s^o.permute(d))>>>0,s=h}o.rip(a,s,n,i)}},function(e,t,r){var n=r(55),i=r(6).Buffer,o=r(153);function a(e){var t=e._cipher.encryptBlockRaw(e._prev);return o(e._prev),t}t.encrypt=function(e,t){var r=Math.ceil(t.length/16),o=e._cache.length;e._cache=i.concat([e._cache,i.allocUnsafe(16*r)]);for(var s=0;s<r;s++){var u=a(e),c=o+16*s;e._cache.writeUInt32BE(u[0],c+0),e._cache.writeUInt32BE(u[1],c+4),e._cache.writeUInt32BE(u[2],c+8),e._cache.writeUInt32BE(u[3],c+12)}var f=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),n(t,f)}},function(e,t){e.exports=function(e){for(var t,r=e.length;r--;){if(255!==(t=e.readUInt8(r))){t++,e.writeUInt8(t,r);break}e.writeUInt8(0,r)}}},function(e){e.exports=JSON.parse('{"aes-128-ecb":{"cipher":"AES","key":128,"iv":0,"mode":"ECB","type":"block"},"aes-192-ecb":{"cipher":"AES","key":192,"iv":0,"mode":"ECB","type":"block"},"aes-256-ecb":{"cipher":"AES","key":256,"iv":0,"mode":"ECB","type":"block"},"aes-128-cbc":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes-192-cbc":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes-256-cbc":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes128":{"cipher":"AES","key":128,"iv":16,"mode":"CBC","type":"block"},"aes192":{"cipher":"AES","key":192,"iv":16,"mode":"CBC","type":"block"},"aes256":{"cipher":"AES","key":256,"iv":16,"mode":"CBC","type":"block"},"aes-128-cfb":{"cipher":"AES","key":128,"iv":16,"mode":"CFB","type":"stream"},"aes-192-cfb":{"cipher":"AES","key":192,"iv":16,"mode":"CFB","type":"stream"},"aes-256-cfb":{"cipher":"AES","key":256,"iv":16,"mode":"CFB","type":"stream"},"aes-128-cfb8":{"cipher":"AES","key":128,"iv":16,"mode":"CFB8","type":"stream"},"aes-192-cfb8":{"cipher":"AES","key":192,"iv":16,"mode":"CFB8","type":"stream"},"aes-256-cfb8":{"cipher":"AES","key":256,"iv":16,"mode":"CFB8","type":"stream"},"aes-128-cfb1":{"cipher":"AES","key":128,"iv":16,"mode":"CFB1","type":"stream"},"aes-192-cfb1":{"cipher":"AES","key":192,"iv":16,"mode":"CFB1","type":"stream"},"aes-256-cfb1":{"cipher":"AES","key":256,"iv":16,"mode":"CFB1","type":"stream"},"aes-128-ofb":{"cipher":"AES","key":128,"iv":16,"mode":"OFB","type":"stream"},"aes-192-ofb":{"cipher":"AES","key":192,"iv":16,"mode":"OFB","type":"stream"},"aes-256-ofb":{"cipher":"AES","key":256,"iv":16,"mode":"OFB","type":"stream"},"aes-128-ctr":{"cipher":"AES","key":128,"iv":16,"mode":"CTR","type":"stream"},"aes-192-ctr":{"cipher":"AES","key":192,"iv":16,"mode":"CTR","type":"stream"},"aes-256-ctr":{"cipher":"AES","key":256,"iv":16,"mode":"CTR","type":"stream"},"aes-128-gcm":{"cipher":"AES","key":128,"iv":12,"mode":"GCM","type":"auth"},"aes-192-gcm":{"cipher":"AES","key":192,"iv":12,"mode":"GCM","type":"auth"},"aes-256-gcm":{"cipher":"AES","key":256,"iv":12,"mode":"GCM","type":"auth"}}')},function(e,t,r){var n=r(64),i=r(6).Buffer,o=r(34),a=r(3),s=r(311),u=r(55),c=r(153);function f(e,t,r,a){o.call(this);var u=i.alloc(4,0);this._cipher=new n.AES(t);var f=this._cipher.encryptBlock(u);this._ghash=new s(f),r=function(e,t,r){if(12===t.length)return e._finID=i.concat([t,i.from([0,0,0,1])]),i.concat([t,i.from([0,0,0,2])]);var n=new s(r),o=t.length,a=o%16;n.update(t),a&&n.update(i.alloc(a=16-a,0)),n.update(i.alloc(8,0));var u=8*o,f=i.alloc(8);f.writeUIntBE(u,0,8),n.update(f),e._finID=n.state;var d=i.from(e._finID);return c(d),d}(this,r,f),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=a,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}a(f,o),f.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=i.alloc(t,0),this._ghash.update(t))}this._called=!0;var r=this._mode.encrypt(this,e);return this._ghash.update(this._decrypt?e:r),this._len+=e.length,r},f.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=u(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var r=0;e.length!==t.length&&r++;for(var n=Math.min(e.length,t.length),i=0;i<n;++i)r+=e[i]^t[i];return r}(e,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=e,this._cipher.scrub()},f.prototype.getAuthTag=function(){if(this._decrypt||!i.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},f.prototype.setAuthTag=function(e){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=e},f.prototype.setAAD=function(e){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(e),this._alen+=e.length},e.exports=f},function(e,t,r){var n=r(64),i=r(6).Buffer,o=r(34);function a(e,t,r,a){o.call(this),this._cipher=new n.AES(t),this._prev=i.from(r),this._cache=i.allocUnsafe(0),this._secCache=i.allocUnsafe(0),this._decrypt=a,this._mode=e}r(3)(a,o),a.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},a.prototype._final=function(){this._cipher.scrub()},e.exports=a},function(e,t,r){var n=r(36);e.exports=g,g.simpleSieve=b,g.fermatTest=m;var i=r(1),o=new i(24),a=new(r(158)),s=new i(1),u=new i(2),c=new i(5),f=(new i(16),new i(8),new i(10)),d=new i(3),h=(new i(7),new i(11)),l=new i(4),p=(new i(12),null);function b(e){for(var t=function(){if(null!==p)return p;var e=[];e[0]=2;for(var t=1,r=3;r<1048576;r+=2){for(var n=Math.ceil(Math.sqrt(r)),i=0;i<t&&e[i]<=n&&r%e[i]!=0;i++);t!==i&&e[i]<=n||(e[t++]=r)}return p=e,e}(),r=0;r<t.length;r++)if(0===e.modn(t[r]))return 0===e.cmpn(t[r]);return!0}function m(e){var t=i.mont(e);return 0===u.toRed(t).redPow(e.subn(1)).fromRed().cmpn(1)}function g(e,t){if(e<16)return new i(2===t||5===t?[140,123]:[140,39]);var r,p;for(t=new i(t);;){for(r=new i(n(Math.ceil(e/8)));r.bitLength()>e;)r.ishrn(1);if(r.isEven()&&r.iadd(s),r.testn(1)||r.iadd(u),t.cmp(u)){if(!t.cmp(c))for(;r.mod(f).cmp(d);)r.iadd(l)}else for(;r.mod(o).cmp(h);)r.iadd(l);if(b(p=r.shrn(1))&&b(r)&&m(p)&&m(r)&&a.test(p)&&a.test(r))return r}}},function(e,t,r){var n=r(1),i=r(76);function o(e){this.rand=e||new i.Rand}e.exports=o,o.create=function(e){return new o(e)},o.prototype._randbelow=function(e){var t=e.bitLength(),r=Math.ceil(t/8);do{var i=new n(this.rand.generate(r))}while(i.cmp(e)>=0);return i},o.prototype._randrange=function(e,t){var r=t.sub(e);return e.add(this._randbelow(r))},o.prototype.test=function(e,t,r){var i=e.bitLength(),o=n.mont(e),a=new n(1).toRed(o);t||(t=Math.max(1,i/48|0));for(var s=e.subn(1),u=0;!s.testn(u);u++);for(var c=e.shrn(u),f=s.toRed(o);t>0;t--){var d=this._randrange(new n(2),s);r&&r(d);var h=d.toRed(o).redPow(c);if(0!==h.cmp(a)&&0!==h.cmp(f)){for(var l=1;l<u;l++){if(0===(h=h.redSqr()).cmp(a))return!1;if(0===h.cmp(f))break}if(l===u)return!1}}return!0},o.prototype.getDivisor=function(e,t){var r=e.bitLength(),i=n.mont(e),o=new n(1).toRed(i);t||(t=Math.max(1,r/48|0));for(var a=e.subn(1),s=0;!a.testn(s);s++);for(var u=e.shrn(s),c=a.toRed(i);t>0;t--){var f=this._randrange(new n(2),a),d=e.gcd(f);if(0!==d.cmpn(1))return d;var h=f.toRed(i).redPow(u);if(0!==h.cmp(o)&&0!==h.cmp(c)){for(var l=1;l<s;l++){if(0===(h=h.redSqr()).cmp(o))return h.fromRed().subn(1).gcd(e);if(0===h.cmp(c))break}if(l===s)return(h=h.redSqr()).fromRed().subn(1).gcd(e)}}return!1}},function(e,t,r){"use strict";(function(t,n){var i;e.exports=x,x.ReadableState=k,r(14);var o,a=function(e,t){return e.listeners(t).length},s=r(160),u=r(11).Buffer,c=t.Uint8Array||function(){},f=r(318);o=f&&f.debuglog?f.debuglog("stream"):function(){};var d,h,l,p=r(319),b=r(161),m=r(162).getHighWaterMark,g=r(45).codes,y=g.ERR_INVALID_ARG_TYPE,v=g.ERR_STREAM_PUSH_AFTER_EOF,w=g.ERR_METHOD_NOT_IMPLEMENTED,_=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(3)(x,s);var S=b.errorOrDestroy,E=["error","close","destroy","pause","resume"];function k(e,t,n){i=i||r(46),"boolean"!=typeof n&&(n=t instanceof i),this.objectMode=!!(e=e||{}).objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=m(this,e,"readableHighWaterMark",n),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(d||(d=r(19).StringDecoder),this.decoder=new d(e.encoding),this.encoding=e.encoding)}function x(e){if(i=i||r(46),!(this instanceof x))return new x(e);this._readableState=new k(e,this,this instanceof i),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),s.call(this)}function A(e,t,r,n,i){o("readableAddChunk",t);var a,s=e._readableState;if(null===t)s.reading=!1,function(e,t){if(o("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?j(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,R(e)))}}(e,s);else if(i||(a=function(e,t){var r,n;return u.isBuffer(n=t)||n instanceof c||"string"==typeof t||void 0===t||e.objectMode||(r=new y("chunk",["string","Buffer","Uint8Array"],t)),r}(s,t)),a)S(e,a);else if(s.objectMode||t&&t.length>0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n)s.endEmitted?S(e,new _):O(e,s,t,!0);else if(s.ended)S(e,new v);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(t=s.decoder.write(t),s.objectMode||0!==t.length?O(e,s,t,!1):P(e,s)):O(e,s,t,!1)}else n||(s.reading=!1,P(e,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function O(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&j(e)),P(e,t)}function M(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=1073741824?e=1073741824:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function j(e){var t=e._readableState;o("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(o("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(R,e))}function R(e){var t=e._readableState;o("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,N(e)}function P(e,t){t.readingMore||(t.readingMore=!0,n.nextTick(T,e,t))}function T(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(o("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function I(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function C(e){o("readable nexttick read 0"),e.read(0)}function B(e,t){o("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),N(e),t.flowing&&!t.reading&&e.read(0)}function N(e){var t=e._readableState;for(o("flow",t.flowing);t.flowing&&null!==e.read(););}function L(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function D(e){var t=e._readableState;o("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(q,t,e))}function q(e,t){if(o("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function U(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),x.prototype.destroy=b.destroy,x.prototype._undestroy=b.undestroy,x.prototype._destroy=function(e,t){t(e)},x.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=u.from(e,t),t=""),r=!0),A(this,e,t,!1,r)},x.prototype.unshift=function(e){return A(this,e,null,!0,!1)},x.prototype.isPaused=function(){return!1===this._readableState.flowing},x.prototype.setEncoding=function(e){d||(d=r(19).StringDecoder);var t=new d(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this},x.prototype.read=function(e){o("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return o("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?D(this):j(this),null;if(0===(e=M(e,t))&&t.ended)return 0===t.length&&D(this),null;var n,i=t.needReadable;return o("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&o("length less than watermark",i=!0),t.ended||t.reading?o("reading or ended",i=!1):i&&(o("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=M(r,t))),null===(n=e>0?L(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&D(this)),null!==n&&this.emit("data",n),n},x.prototype._read=function(e){S(this,new w("_read()"))},x.prototype.pipe=function(e,t){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=e;break;case 1:i.pipes=[i.pipes,e];break;default:i.pipes.push(e)}i.pipesCount+=1,o("pipe count=%d opts=%j",i.pipesCount,t);var s=t&&!1===t.end||e===n.stdout||e===n.stderr?b:u;function u(){o("onend"),e.end()}i.endEmitted?n.nextTick(s):r.once("end",s),e.on("unpipe",function t(n,a){o("onunpipe"),n===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,o("cleanup"),e.removeListener("close",l),e.removeListener("finish",p),e.removeListener("drain",c),e.removeListener("error",h),e.removeListener("unpipe",t),r.removeListener("end",u),r.removeListener("end",b),r.removeListener("data",d),f=!0,!i.awaitDrain||e._writableState&&!e._writableState.needDrain||c())});var c=function(e){return function(){var t=e._readableState;o("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&a(e,"data")&&(t.flowing=!0,N(e))}}(r);e.on("drain",c);var f=!1;function d(t){o("ondata");var n=e.write(t);o("dest.write",n),!1===n&&((1===i.pipesCount&&i.pipes===e||i.pipesCount>1&&-1!==U(i.pipes,e))&&!f&&(o("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}function h(t){o("onerror",t),b(),e.removeListener("error",h),0===a(e,"error")&&S(e,t)}function l(){e.removeListener("finish",p),b()}function p(){o("onfinish"),e.removeListener("close",l),b()}function b(){o("unpipe"),r.unpipe(e)}return r.on("data",d),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",l),e.once("finish",p),e.emit("pipe",r),i.flowing||(o("pipe resume"),r.resume()),e},x.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=U(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},x.prototype.addListener=x.prototype.on=function(e,t){var r=s.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,o("on readable",i.length,i.reading),i.length?j(this):i.reading||n.nextTick(C,this))),r},x.prototype.removeListener=function(e,t){var r=s.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(I,this),r},x.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(I,this),t},x.prototype.resume=function(){var e=this._readableState;return e.flowing||(o("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(B,e,t))}(this,e)),e.paused=!1,this},x.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},x.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",function(){if(o("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){o("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var a=0;a<E.length;a++)e.on(E[a],this.emit.bind(this,E[a]));return this._read=function(t){o("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(x.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=r(321)),h(this)}),Object.defineProperty(x.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(x.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(x.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),x._fromList=L,Object.defineProperty(x.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(x.from=function(e,t){return void 0===l&&(l=r(322)),l(x,e,t)})}).call(this,r(10),r(9))},function(e,t,r){e.exports=r(14).EventEmitter},function(e,t,r){"use strict";(function(t){function r(e,t){i(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,o){var a=this;return this._readableState&&this._readableState.destroyed||this._writableState&&this._writableState.destroyed?(o?o(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,t.nextTick(i,this,e)):t.nextTick(i,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!o&&e?a._writableState?a._writableState.errorEmitted?t.nextTick(n,a):(a._writableState.errorEmitted=!0,t.nextTick(r,a,e)):t.nextTick(r,a,e):o?(t.nextTick(n,a),o(e)):t.nextTick(n,a)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}}).call(this,r(9))},function(e,t,r){"use strict";var n=r(45).codes.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},function(e,t,r){"use strict";(function(t,n){function i(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(void 0),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var o;e.exports=x,x.WritableState=k;var a,s={deprecate:r(42)},u=r(160),c=r(11).Buffer,f=t.Uint8Array||function(){},d=r(161),h=r(162).getHighWaterMark,l=r(45).codes,p=l.ERR_INVALID_ARG_TYPE,b=l.ERR_METHOD_NOT_IMPLEMENTED,m=l.ERR_MULTIPLE_CALLBACK,g=l.ERR_STREAM_CANNOT_PIPE,y=l.ERR_STREAM_DESTROYED,v=l.ERR_STREAM_NULL_VALUES,w=l.ERR_STREAM_WRITE_AFTER_END,_=l.ERR_UNKNOWN_ENCODING,S=d.errorOrDestroy;function E(){}function k(e,t,a){o=o||r(46),"boolean"!=typeof a&&(a=t instanceof o),this.objectMode=!!(e=e||{}).objectMode,a&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=h(this,e,"writableHighWaterMark",a),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1,this.decodeStrings=!(!1===e.decodeStrings),this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,i=r.sync,o=r.writecb;if("function"!=typeof o)throw new m;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,i,o){--t.pendingcb,r?(n.nextTick(o,i),n.nextTick(P,e,t),e._writableState.errorEmitted=!0,S(e,i)):(o(i),e._writableState.errorEmitted=!0,S(e,i),P(e,t))}(e,r,i,t,o);else{var a=j(r)||e.destroyed;a||r.corked||r.bufferProcessing||!r.bufferedRequest||M(e,r),i?n.nextTick(O,e,r,a,o):O(e,r,a,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function x(e){var t=this instanceof(o=o||r(46));if(!t&&!a.call(x,this))return new x(e);this._writableState=new k(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),u.call(this)}function A(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new y("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function O(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),P(e,t)}function M(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=new Array(t.bufferedRequestCount),o=t.corkedRequestsFree;o.entry=r;for(var a=0,s=!0;r;)n[a]=r,r.isBuf||(s=!1),r=r.next,a+=1;n.allBuffers=s,A(e,t,!0,t.length,n,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new i(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk;if(A(e,t,!1,t.objectMode?1:u.length,u,r.encoding,r.callback),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function j(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function R(e,t){e._final(function(r){t.pendingcb--,r&&S(e,r),t.prefinished=!0,e.emit("prefinish"),P(e,t)})}function P(e,t){var r=j(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,n.nextTick(R,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var i=e._readableState;(!i||i.autoDestroy&&i.endEmitted)&&e.destroy()}return r}r(3)(x,u),k.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(k.prototype,"buffer",{get:s.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(a=Function.prototype[Symbol.hasInstance],Object.defineProperty(x,Symbol.hasInstance,{value:function(e){return!!a.call(this,e)||this===x&&e&&e._writableState instanceof k}})):a=function(e){return e instanceof this},x.prototype.pipe=function(){S(this,new g)},x.prototype.write=function(e,t,r){var i,o=this._writableState,a=!1,s=!o.objectMode&&(c.isBuffer(i=e)||i instanceof f);return s&&!c.isBuffer(e)&&(e=function(e){return c.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof r&&(r=E),o.ending?function(e,t){var r=new w;S(e,r),n.nextTick(t,r)}(this,r):(s||function(e,t,r,i){var o;return null===r?o=new v:"string"==typeof r||t.objectMode||(o=new p("chunk",["string","Buffer"],r)),!o||(S(e,o),n.nextTick(i,o),!1)}(this,o,e,r))&&(o.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=c.from(t,r)),t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var f=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},f?f.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else A(e,t,!1,s,n,i,o);return u}(this,o,s,e,t,r)),a},x.prototype.cork=function(){this._writableState.corked++},x.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||M(this,e))},x.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(x.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(x.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),x.prototype._write=function(e,t,r){r(new b("_write()"))},x.prototype._writev=null,x.prototype.end=function(e,t,r){var i=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||function(e,t,r){t.ending=!0,P(e,t),r&&(t.finished?n.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,i,r),this},Object.defineProperty(x.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),x.prototype.destroy=d.destroy,x.prototype._undestroy=d.undestroy,x.prototype._destroy=function(e,t){t(e)}}).call(this,r(10),r(9))},function(e,t,r){"use strict";e.exports=f;var n=r(45).codes,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,a=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(46);function c(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function f(e){if(!(this instanceof f))return new f(e);u.call(this,e),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",d)}function d(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?h(this,null,null):this._flush(function(t,r){h(e,t,r)})}function h(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new s;if(e._transformState.transforming)throw new a;return e.push(null)}r(3)(f,u),f.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},f.prototype._transform=function(e,t,r){r(new i("_transform()"))},f.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},f.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},f.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,function(e){t(e)})}},function(e,t,r){"use strict";const n=t;n.bignum=r(1),n.define=r(327).define,n.base=r(330),n.constants=r(331),n.decoders=r(168),n.encoders=r(166)},function(e,t,r){"use strict";const n=t;n.der=r(167),n.pem=r(328)},function(e,t,r){"use strict";const n=r(3),i=r(90).Buffer,o=r(91),a=r(93);function s(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new u,this.tree._init(e.body)}function u(e){o.call(this,"der",e)}function c(e){return e<10?"0"+e:e}e.exports=s,s.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},n(u,o),u.prototype._encodeComposite=function(e,t,r,n){const o=function(e,t,r,n){let i;if("seqof"===e?e="seq":"setof"===e&&(e="set"),a.tagByName.hasOwnProperty(e))i=a.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return n.error("Unknown tag: "+e);i=e}return i>=31?n.error("Multi-octet tag encoding unsupported"):(t||(i|=32),i|=a.tagClassByName[r||"universal"]<<6,i)}(e,t,r,this.reporter);if(n.length<128){const e=i.alloc(2);return e[0]=o,e[1]=n.length,this._createEncoderBuffer([e,n])}let s=1;for(let i=n.length;i>=256;i>>=8)s++;const u=i.alloc(2+s);u[0]=o,u[1]=128|s;for(let i=1+s,a=n.length;a>0;i--,a>>=8)u[i]=255&a;return this._createEncoderBuffer([u,n])},u.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){const t=i.alloc(2*e.length);for(let r=0;r<e.length;r++)t.writeUInt16BE(e.charCodeAt(r),2*r);return this._createEncoderBuffer(t)}return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)||"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported")},u.prototype._encodeObjid=function(e,t,r){if("string"==typeof e){if(!t)return this.reporter.error("string objid given, but no values map found");if(!t.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=t[e].split(/[\s.]+/g);for(let t=0;t<e.length;t++)e[t]|=0}else if(Array.isArray(e)){e=e.slice();for(let t=0;t<e.length;t++)e[t]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!r){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}let n=0;for(let i=0;i<e.length;i++){let t=e[i];for(n++;t>=128;t>>=7)n++}const o=i.alloc(n);let a=o.length-1;for(let i=e.length-1;i>=0;i--){let t=e[i];for(o[a--]=127&t;(t>>=7)>0;)o[a--]=128|127&t}return this._createEncoderBuffer(o)},u.prototype._encodeTime=function(e,t){let r;const n=new Date(e);return"gentime"===t?r=[c(n.getUTCFullYear()),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):"utctime"===t?r=[c(n.getUTCFullYear()%100),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},u.prototype._encodeNull=function(){return this._createEncoderBuffer("")},u.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!i.isBuffer(e)){const t=e.toArray();!e.sign&&128&t[0]&&t.unshift(0),e=i.from(t)}if(i.isBuffer(e)){let t=e.length;0===e.length&&t++;const r=i.alloc(t);return e.copy(r),0===e.length&&(r[0]=0),this._createEncoderBuffer(r)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let r=1;for(let i=e;i>=256;i>>=8)r++;const n=new Array(r);for(let i=n.length-1;i>=0;i--)n[i]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(i.from(n))},u.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},u.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},u.prototype._skipDefault=function(e,t,r){const n=this._baseState;let i;if(null===n.default)return!1;const o=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),o.length!==n.defaultBuffer.length)return!1;for(i=0;i<o.length;i++)if(o[i]!==n.defaultBuffer[i])return!1;return!0}},function(e,t,r){"use strict";const n=t;n.der=r(169),n.pem=r(329)},function(e,t,r){"use strict";const n=r(3),i=r(1),o=r(56).DecoderBuffer,a=r(91),s=r(93);function u(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new c,this.tree._init(e.body)}function c(e){a.call(this,"der",e)}function f(e,t){let r=e.readUInt8(t);if(e.isError(r))return r;const n=s.tagClass[r>>6],i=0==(32&r);if(31==(31&r)){let n=r;for(r=0;128==(128&n);){if(n=e.readUInt8(t),e.isError(n))return n;r<<=7,r|=127&n}}else r&=31;return{cls:n,primitive:i,tag:r,tagStr:s.tag[r]}}function d(e,t,r){let n=e.readUInt8(r);if(e.isError(n))return n;if(!t&&128===n)return null;if(0==(128&n))return n;const i=127&n;if(i>4)return e.error("length octect is too long");n=0;for(let o=0;o<i;o++){n<<=8;const t=e.readUInt8(r);if(e.isError(t))return t;n|=t}return n}e.exports=u,u.prototype.decode=function(e,t){return o.isDecoderBuffer(e)||(e=new o(e,t)),this.tree._decode(e,t)},n(c,a),c.prototype._peekTag=function(e,t,r){if(e.isEmpty())return!1;const n=e.save(),i=f(e,'Failed to peek tag: "'+t+'"');return e.isError(i)?i:(e.restore(n),i.tag===t||i.tagStr===t||i.tagStr+"of"===t||r)},c.prototype._decodeTag=function(e,t,r){const n=f(e,'Failed to decode tag of "'+t+'"');if(e.isError(n))return n;let i=d(e,n.primitive,'Failed to get length of "'+t+'"');if(e.isError(i))return i;if(!r&&n.tag!==t&&n.tagStr!==t&&n.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(n.primitive||null!==i)return e.skip(i,'Failed to match body of: "'+t+'"');const o=e.save(),a=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(a)?a:(i=e.offset-o.offset,e.restore(o),e.skip(i,'Failed to match body of: "'+t+'"'))},c.prototype._skipUntilEnd=function(e,t){for(;;){const r=f(e,t);if(e.isError(r))return r;const n=d(e,r.primitive,t);if(e.isError(n))return n;let i;if(i=r.primitive||null!==n?e.skip(n):this._skipUntilEnd(e,t),e.isError(i))return i;if("end"===r.tagStr)break}},c.prototype._decodeList=function(e,t,r,n){const i=[];for(;!e.isEmpty();){const t=this._peekTag(e,"end");if(e.isError(t))return t;const o=r.decode(e,"der",n);if(e.isError(o)&&t)break;i.push(o)}return i},c.prototype._decodeStr=function(e,t){if("bitstr"===t){const t=e.readUInt8();return e.isError(t)?t:{unused:t,data:e.raw()}}if("bmpstr"===t){const t=e.raw();if(t.length%2==1)return e.error("Decoding of string type: bmpstr length mismatch");let r="";for(let e=0;e<t.length/2;e++)r+=String.fromCharCode(t.readUInt16BE(2*e));return r}if("numstr"===t){const t=e.raw().toString("ascii");return this._isNumstr(t)?t:e.error("Decoding of string type: numstr unsupported characters")}if("octstr"===t)return e.raw();if("objDesc"===t)return e.raw();if("printstr"===t){const t=e.raw().toString("ascii");return this._isPrintstr(t)?t:e.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(t)?e.raw().toString():e.error("Decoding of string type: "+t+" unsupported")},c.prototype._decodeObjid=function(e,t,r){let n;const i=[];let o=0,a=0;for(;!e.isEmpty();)a=e.readUInt8(),o<<=7,o|=127&a,0==(128&a)&&(i.push(o),o=0);if(128&a&&i.push(o),n=r?i:[i[0]/40|0,i[0]%40].concat(i.slice(1)),t){let e=t[n.join(" ")];void 0===e&&(e=t[n.join(".")]),void 0!==e&&(n=e)}return n},c.prototype._decodeTime=function(e,t){const r=e.raw().toString();let n,i,o,a,s,u;if("gentime"===t)n=0|r.slice(0,4),i=0|r.slice(4,6),o=0|r.slice(6,8),a=0|r.slice(8,10),s=0|r.slice(10,12),u=0|r.slice(12,14);else{if("utctime"!==t)return e.error("Decoding "+t+" time is not supported yet");n=0|r.slice(0,2),i=0|r.slice(2,4),o=0|r.slice(4,6),a=0|r.slice(6,8),s=0|r.slice(8,10),u=0|r.slice(10,12),n=n<70?2e3+n:1900+n}return Date.UTC(n,i-1,o,a,s,u,0)},c.prototype._decodeNull=function(){return null},c.prototype._decodeBool=function(e){const t=e.readUInt8();return e.isError(t)?t:0!==t},c.prototype._decodeInt=function(e,t){const r=e.raw();let n=new i(r);return t&&(n=t[n.toString(10)]||n),n},c.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getDecoder("der").tree}},function(e){e.exports=JSON.parse('{"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}')},function(e,t,r){var n=r(38),i=r(6).Buffer;function o(e){var t=i.allocUnsafe(4);return t.writeUInt32BE(e,0),t}e.exports=function(e,t){for(var r,a=i.alloc(0),s=0;a.length<t;)r=o(s++),a=i.concat([a,n("sha1").update(e).update(r).digest()]);return a.slice(0,t)}},function(e,t){e.exports=function(e,t){for(var r=e.length,n=-1;++n<r;)e[n]^=t[n];return e}},function(e,t,r){var n=r(1),i=r(6).Buffer;e.exports=function(e,t){return i.from(e.toRed(n.mont(t.modulus)).redPow(new n(t.publicExponent)).fromRed().toArray())}},function(e,t,r){"use strict";(function(t,n){var i=r(17);e.exports=v;var o,a=r(40);v.ReadableState=y,r(14);var s=function(e,t){return e.listeners(t).length},u=r(175),c=r(95).Buffer,f=t.Uint8Array||function(){},d=Object.create(r(13));d.inherits=r(3);var h=r(350),l=void 0;l=h&&h.debuglog?h.debuglog("stream"):function(){};var p,b=r(351),m=r(176);d.inherits(v,u);var g=["error","close","destroy","pause","resume"];function y(e,t){e=e||{};var n=t instanceof(o=o||r(47));this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,a=e.readableHighWaterMark;this.highWaterMark=i||0===i?i:n&&(a||0===a)?a:this.objectMode?16:16384,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new b,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=r(19).StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function v(e){if(o=o||r(47),!(this instanceof v))return new v(e);this._readableState=new y(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function w(e,t,r,n,i){var o,a=e._readableState;return null===t?(a.reading=!1,function(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,E(e)}}(e,a)):(i||(o=function(e,t){var r,n;return c.isBuffer(n=t)||n instanceof f||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}(a,t)),o?e.emit("error",o):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),n?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):_(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?_(e,a,t,!1):x(e,a)):_(e,a,t,!1))):n||(a.reading=!1)),function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(a)}function _(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&E(e)),x(e,t)}function S(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function E(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(l("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(k,e):k(e))}function k(e){l("emit readable"),e.emit("readable"),j(e)}function x(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(A,e,t))}function A(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(l("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function O(e){l("readable nexttick read 0"),e.read(0)}function M(e,t){t.reading||(l("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),j(e),t.flowing&&!t.reading&&e.read(0)}function j(e){var t=e._readableState;for(l("flow",t.flowing);t.flowing&&null!==e.read(););}function R(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;return e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,n=1,i=r.data;for(e-=i.length;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(i+=a===o.length?o:o.slice(0,e),0==(e-=a)){a===o.length?(++n,t.head=r.next?r.next:t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=c.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0==(e-=a)){a===o.length?(++i,t.head=n.next?n.next:t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}(e,t),n}(e,t.buffer,t.decoder),r);var r}function P(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(T,t,e))}function T(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function I(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),v.prototype.destroy=m.destroy,v.prototype._undestroy=m.undestroy,v.prototype._destroy=function(e,t){this.push(null),t(e)},v.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=c.from(e,t),t=""),r=!0),w(this,e,t,!1,r)},v.prototype.unshift=function(e){return w(this,e,null,!0,!1)},v.prototype.isPaused=function(){return!1===this._readableState.flowing},v.prototype.setEncoding=function(e){return p||(p=r(19).StringDecoder),this._readableState.decoder=new p(e),this._readableState.encoding=e,this},v.prototype.read=function(e){l("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return l("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?P(this):E(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&P(this),null;var n,i=t.needReadable;return l("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&l("length less than watermark",i=!0),t.ended||t.reading?l("reading or ended",i=!1):i&&(l("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=S(r,t))),null===(n=e>0?R(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&P(this)),null!==n&&this.emit("data",n),n},v.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},v.prototype.pipe=function(e,t){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,l("pipe count=%d opts=%j",o.pipesCount,t);var u=t&&!1===t.end||e===n.stdout||e===n.stderr?y:c;function c(){l("onend"),e.end()}o.endEmitted?i.nextTick(u):r.once("end",u),e.on("unpipe",function t(n,i){l("onunpipe"),n===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,l("cleanup"),e.removeListener("close",m),e.removeListener("finish",g),e.removeListener("drain",f),e.removeListener("error",b),e.removeListener("unpipe",t),r.removeListener("end",c),r.removeListener("end",y),r.removeListener("data",p),d=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||f())});var f=function(e){return function(){var t=e._readableState;l("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,j(e))}}(r);e.on("drain",f);var d=!1,h=!1;function p(t){l("ondata"),h=!1,!1!==e.write(t)||h||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==I(o.pipes,e))&&!d&&(l("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,h=!0),r.pause())}function b(t){l("onerror",t),y(),e.removeListener("error",b),0===s(e,"error")&&e.emit("error",t)}function m(){e.removeListener("finish",g),y()}function g(){l("onfinish"),e.removeListener("close",m),y()}function y(){l("unpipe"),r.unpipe(e)}return r.on("data",p),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",b),e.once("close",m),e.once("finish",g),e.emit("pipe",r),o.flowing||(l("pipe resume"),r.resume()),e},v.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,r);return this}var a=I(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},v.prototype.addListener=v.prototype.on=function(e,t){var r=u.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&E(this):i.nextTick(O,this))}return r},v.prototype.resume=function(){var e=this._readableState;return e.flowing||(l("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(M,e,t))}(this,e)),this},v.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this},v.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",function(){if(l("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){l("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<g.length;o++)e.on(g[o],this.emit.bind(this,g[o]));return this._read=function(t){l("wrapped _read",t),n&&(n=!1,e.resume())},this},Object.defineProperty(v.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),v._fromList=R}).call(this,r(10),r(9))},function(e,t,r){e.exports=r(14).EventEmitter},function(e,t,r){"use strict";var n=r(17);function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this;return this._readableState&&this._readableState.destroyed||this._writableState&&this._writableState.destroyed?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||n.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(n.nextTick(i,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,r){"use strict";(function(t,n,i){var o=r(17);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(void 0),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=y;var s,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?n:o.nextTick;y.WritableState=g;var c=Object.create(r(13));c.inherits=r(3);var f,d={deprecate:r(42)},h=r(175),l=r(95).Buffer,p=i.Uint8Array||function(){},b=r(176);function m(){}function g(e,t){s=s||r(47);var n=t instanceof s;this.objectMode=!!(e=e||{}).objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,c=e.writableHighWaterMark;this.highWaterMark=i||0===i?i:n&&(c||0===c)?c:this.objectMode?16:16384,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1,this.decodeStrings=!(!1===e.decodeStrings),this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(o.nextTick(i,n),o.nextTick(k,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),k(e,t))}(e,r,n,t,i);else{var a=S(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||_(e,r),n?u(w,e,r,a,i):w(e,r,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function y(e){if(s=s||r(47),!(f.call(y,this)||this instanceof s))return new y(e);this._writableState=new g(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),h.call(this)}function v(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function w(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),k(e,t)}function _(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=new Array(t.bufferedRequestCount),i=t.corkedRequestsFree;i.entry=r;for(var o=0,s=!0;r;)n[o]=r,r.isBuf||(s=!1),r=r.next,o+=1;n.allBuffers=s,v(e,t,!0,t.length,n,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk;if(v(e,t,!1,t.objectMode?1:u.length,u,r.encoding,r.callback),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function S(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function E(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),k(e,t)})}function k(e,t){var r=S(t);return r&&(function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(E,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}c.inherits(y,h),g.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(g.prototype,"buffer",{get:d.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(e){return!!f.call(this,e)||this===y&&e&&e._writableState instanceof g}})):f=function(e){return e instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(e,t,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(l.isBuffer(n=e)||n instanceof p);return s&&!l.isBuffer(e)&&(e=function(e){return l.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=m),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),o.nextTick(t,r)}(this,r):(s||function(e,t,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),o.nextTick(n,a),i=!1),i}(this,i,e,r))&&(i.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=l.from(t,r)),t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else v(e,t,!1,s,n,i,o);return u}(this,i,s,e,t,r)),a},y.prototype.cork=function(){this._writableState.corked++},y.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||_(this,e))},y.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,k(e,t),r&&(t.finished?o.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=b.destroy,y.prototype._undestroy=b.undestroy,y.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(9),r(51).setImmediate,r(10))},function(e,t,r){"use strict";e.exports=a;var n=r(47),i=Object.create(r(13));function o(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function a(e){if(!(this instanceof a))return new a(e);n.call(this,e),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",s)}function s(){var e=this;"function"==typeof this._flush?this._flush(function(t,r){u(e,t,r)}):u(this,null,null)}function u(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}i.inherits=r(3),i.inherits(a,n),a.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},a.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},a.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},a.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},a.prototype._destroy=function(e,t){var r=this;n.prototype._destroy.call(this,e,function(e){t(e),r.emit("close")})}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const n=r(97),i=r(96),o=n.errorCodes.rpc.internal,a={code:o,message:s(o)};function s(e,r="Unspecified error message. This is a bug, please report it."){if(Number.isInteger(e)){const r=e.toString();if(d(n.errorValues,r))return n.errorValues[r].message;if(c(e))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return r}function u(e){if(!Number.isInteger(e))return!1;const t=e.toString();return!!n.errorValues[t]||!!c(e)}function c(e){return e>=-32099&&e<=-32e3}function f(e){return e&&"object"==typeof e&&!Array.isArray(e)?Object.assign({},e):e}function d(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=s,t.isValidCode=u,t.serializeError=function(e,{fallbackError:t=a,shouldIncludeStack:r=!1}={}){var n,o;if(!t||!Number.isInteger(t.code)||"string"!=typeof t.message)throw new Error("Must provide fallback error with integer number code and string message.");if(e instanceof i.EthereumRpcError)return e.serialize();const c={};if(e&&"object"==typeof e&&!Array.isArray(e)&&d(e,"code")&&u(e.code)){const t=e;c.code=t.code,t.message&&"string"==typeof t.message?(c.message=t.message,d(t,"data")&&(c.data=t.data)):(c.message=s(c.code),c.data={originalError:f(e)})}else{c.code=t.code;const r=null===(n=e)||void 0===n?void 0:n.message;c.message=r&&"string"==typeof r?r:t.message,c.data={originalError:f(e)}}const h=null===(o=e)||void 0===o?void 0:o.stack;return r&&e&&h&&"string"==typeof h&&(c.stack=h),c}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUniqueId=void 0;let n=Math.floor(4294967295*Math.random());t.getUniqueId=function(){return n=(n+1)%4294967295,n}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.JsonRpcEngine=void 0;const i=n(r(57)),o=r(32);class a extends i.default{constructor(){super(),this._middleware=[]}push(e){this._middleware.push(e)}handle(e,t){if(t&&"function"!=typeof t)throw new Error('"callback" must be a function if provided.');return Array.isArray(e)?t?this._handleBatch(e,t):this._handleBatch(e):t?this._handle(e,t):this._promiseHandle(e)}asMiddleware(){return async(e,t,r,n)=>{try{const[i,o,s]=await a._runAllMiddleware(e,t,this._middleware);return o?(await a._runReturnHandlers(s),n(i)):r(async e=>{try{await a._runReturnHandlers(s)}catch(t){return e(t)}return e()})}catch(e){return n(e)}}}async _handleBatch(e,t){try{const r=await Promise.all(e.map(this._promiseHandle.bind(this)));return t?t(null,r):r}catch(e){if(t)return t(e);throw e}}_promiseHandle(e){return new Promise(t=>{this._handle(e,(e,r)=>{t(r)})})}async _handle(e,t){if(!e||Array.isArray(e)||"object"!=typeof e){const r=new o.EthereumRpcError(o.errorCodes.rpc.invalidRequest,"Requests must be plain objects. Received: "+typeof e,{request:e});return t(r,{id:void 0,jsonrpc:"2.0",error:r})}if("string"!=typeof e.method){const r=new o.EthereumRpcError(o.errorCodes.rpc.invalidRequest,"Must specify a string method. Received: "+typeof e.method,{request:e});return t(r,{id:e.id,jsonrpc:"2.0",error:r})}const r=Object.assign({},e),n={id:r.id,jsonrpc:r.jsonrpc};let i=null;try{await this._processRequest(r,n)}catch(e){i=e}return i&&(delete n.result,n.error||(n.error=o.serializeError(i))),t(i,n)}async _processRequest(e,t){const[r,n,i]=await a._runAllMiddleware(e,t,this._middleware);if(a._checkForCompletion(e,t,n),await a._runReturnHandlers(i),r)throw r}static async _runAllMiddleware(e,t,r){const n=[];let i=null,o=!1;for(const s of r)if([i,o]=await a._runMiddleware(e,t,s,n),o)break;return[i,o,n.reverse()]}static _runMiddleware(e,t,r,n){return new Promise(i=>{const a=e=>{const r=e||t.error;r&&(t.error=o.serializeError(r)),i([r,!0])},u=r=>{t.error?a(t.error):(r&&("function"!=typeof r&&a(new o.EthereumRpcError(o.errorCodes.rpc.internal,`JsonRpcEngine: "next" return handlers must be functions. Received "${typeof r}" for request:\n${s(e)}`,{request:e})),n.push(r)),i([null,!1]))};try{r(e,t,u,a)}catch(e){a(e)}})}static async _runReturnHandlers(e){for(const t of e)await new Promise((e,r)=>{t(t=>t?r(t):e())})}static _checkForCompletion(e,t,r){if(!("result"in t)&&!("error"in t))throw new o.EthereumRpcError(o.errorCodes.rpc.internal,"JsonRpcEngine: Response has no error or result for request:\n"+s(e),{request:e});if(!r)throw new o.EthereumRpcError(o.errorCodes.rpc.internal,"JsonRpcEngine: Nothing ended request:\n"+s(e),{request:e})}}function s(e){return JSON.stringify(e,null,2)}t.JsonRpcEngine=a},function(e,t,r){(t=e.exports=r(183)).Stream=t,t.Readable=t,t.Writable=r(186),t.Duplex=r(48),t.Transform=r(187),t.PassThrough=r(364)},function(e,t,r){"use strict";(function(t,n){var i=r(17);e.exports=v;var o,a=r(40);v.ReadableState=y,r(14);var s=function(e,t){return e.listeners(t).length},u=r(184),c=r(98).Buffer,f=t.Uint8Array||function(){},d=Object.create(r(13));d.inherits=r(3);var h=r(361),l=void 0;l=h&&h.debuglog?h.debuglog("stream"):function(){};var p,b=r(362),m=r(185);d.inherits(v,u);var g=["error","close","destroy","pause","resume"];function y(e,t){e=e||{};var n=t instanceof(o=o||r(48));this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,a=e.readableHighWaterMark;this.highWaterMark=i||0===i?i:n&&(a||0===a)?a:this.objectMode?16:16384,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new b,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=r(19).StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function v(e){if(o=o||r(48),!(this instanceof v))return new v(e);this._readableState=new y(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function w(e,t,r,n,i){var o,a=e._readableState;return null===t?(a.reading=!1,function(e,t){if(!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,E(e)}}(e,a)):(i||(o=function(e,t){var r,n;return c.isBuffer(n=t)||n instanceof f||"string"==typeof t||void 0===t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}(a,t)),o?e.emit("error",o):a.objectMode||t&&t.length>0?("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===c.prototype||(t=function(e){return c.from(e)}(t)),n?a.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):_(e,a,t,!0):a.ended?e.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?_(e,a,t,!1):x(e,a)):_(e,a,t,!1))):n||(a.reading=!1)),function(e){return!e.ended&&(e.needReadable||e.length<e.highWaterMark||0===e.length)}(a)}function _(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&E(e)),x(e,t)}function S(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function E(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(l("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(k,e):k(e))}function k(e){l("emit readable"),e.emit("readable"),j(e)}function x(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(A,e,t))}function A(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length<t.highWaterMark&&(l("maybeReadMore read 0"),e.read(0),r!==t.length);)r=t.length;t.readingMore=!1}function O(e){l("readable nexttick read 0"),e.read(0)}function M(e,t){t.reading||(l("resume read 0"),e.read(0)),t.resumeScheduled=!1,t.awaitDrain=0,e.emit("resume"),j(e),t.flowing&&!t.reading&&e.read(0)}function j(e){var t=e._readableState;for(l("flow",t.flowing);t.flowing&&null!==e.read(););}function R(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;return e<t.head.data.length?(n=t.head.data.slice(0,e),t.head.data=t.head.data.slice(e)):n=e===t.head.data.length?t.shift():r?function(e,t){var r=t.head,n=1,i=r.data;for(e-=i.length;r=r.next;){var o=r.data,a=e>o.length?o.length:e;if(i+=a===o.length?o:o.slice(0,e),0==(e-=a)){a===o.length?(++n,t.head=r.next?r.next:t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=c.allocUnsafe(e),n=t.head,i=1;for(n.data.copy(r),e-=n.data.length;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0==(e-=a)){a===o.length?(++i,t.head=n.next?n.next:t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}(e,t),n}(e,t.buffer,t.decoder),r);var r}function P(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(T,t,e))}function T(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function I(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),v.prototype.destroy=m.destroy,v.prototype._undestroy=m.undestroy,v.prototype._destroy=function(e,t){this.push(null),t(e)},v.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=c.from(e,t),t=""),r=!0),w(this,e,t,!1,r)},v.prototype.unshift=function(e){return w(this,e,null,!0,!1)},v.prototype.isPaused=function(){return!1===this._readableState.flowing},v.prototype.setEncoding=function(e){return p||(p=r(19).StringDecoder),this._readableState.decoder=new p(e),this._readableState.encoding=e,this},v.prototype.read=function(e){l("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return l("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?P(this):E(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&P(this),null;var n,i=t.needReadable;return l("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&l("length less than watermark",i=!0),t.ended||t.reading?l("reading or ended",i=!1):i&&(l("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=S(r,t))),null===(n=e>0?R(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&P(this)),null!==n&&this.emit("data",n),n},v.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},v.prototype.pipe=function(e,t){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,l("pipe count=%d opts=%j",o.pipesCount,t);var u=t&&!1===t.end||e===n.stdout||e===n.stderr?y:c;function c(){l("onend"),e.end()}o.endEmitted?i.nextTick(u):r.once("end",u),e.on("unpipe",function t(n,i){l("onunpipe"),n===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,l("cleanup"),e.removeListener("close",m),e.removeListener("finish",g),e.removeListener("drain",f),e.removeListener("error",b),e.removeListener("unpipe",t),r.removeListener("end",c),r.removeListener("end",y),r.removeListener("data",p),d=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||f())});var f=function(e){return function(){var t=e._readableState;l("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,j(e))}}(r);e.on("drain",f);var d=!1,h=!1;function p(t){l("ondata"),h=!1,!1!==e.write(t)||h||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==I(o.pipes,e))&&!d&&(l("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,h=!0),r.pause())}function b(t){l("onerror",t),y(),e.removeListener("error",b),0===s(e,"error")&&e.emit("error",t)}function m(){e.removeListener("finish",g),y()}function g(){l("onfinish"),e.removeListener("close",m),y()}function y(){l("unpipe"),r.unpipe(e)}return r.on("data",p),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?a(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",b),e.once("close",m),e.once("finish",g),e.emit("pipe",r),o.flowing||(l("pipe resume"),r.resume()),e},v.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,r);return this}var a=I(t.pipes,e);return-1===a||(t.pipes.splice(a,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},v.prototype.addListener=v.prototype.on=function(e,t){var r=u.prototype.on.call(this,e,t);if("data"===e)!1!==this._readableState.flowing&&this.resume();else if("readable"===e){var n=this._readableState;n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.emittedReadable=!1,n.reading?n.length&&E(this):i.nextTick(O,this))}return r},v.prototype.resume=function(){var e=this._readableState;return e.flowing||(l("resume"),e.flowing=!0,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(M,e,t))}(this,e)),this},v.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this},v.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",function(){if(l("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){l("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<g.length;o++)e.on(g[o],this.emit.bind(this,g[o]));return this._read=function(t){l("wrapped _read",t),n&&(n=!1,e.resume())},this},Object.defineProperty(v.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),v._fromList=R}).call(this,r(10),r(9))},function(e,t,r){e.exports=r(14).EventEmitter},function(e,t,r){"use strict";var n=r(17);function i(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this;return this._readableState&&this._readableState.destroyed||this._writableState&&this._writableState.destroyed?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||n.nextTick(i,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?(n.nextTick(i,r,e),r._writableState&&(r._writableState.errorEmitted=!0)):t&&t(e)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(e,t,r){"use strict";(function(t,n,i){var o=r(17);function a(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(void 0),n=n.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=y;var s,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?n:o.nextTick;y.WritableState=g;var c=Object.create(r(13));c.inherits=r(3);var f,d={deprecate:r(42)},h=r(184),l=r(98).Buffer,p=i.Uint8Array||function(){},b=r(185);function m(){}function g(e,t){s=s||r(48);var n=t instanceof s;this.objectMode=!!(e=e||{}).objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,c=e.writableHighWaterMark;this.highWaterMark=i||0===i?i:n&&(c||0===c)?c:this.objectMode?16:16384,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1,this.decodeStrings=!(!1===e.decodeStrings),this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,i){--t.pendingcb,r?(o.nextTick(i,n),o.nextTick(k,e,t),e._writableState.errorEmitted=!0,e.emit("error",n)):(i(n),e._writableState.errorEmitted=!0,e.emit("error",n),k(e,t))}(e,r,n,t,i);else{var a=S(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||_(e,r),n?u(w,e,r,a,i):w(e,r,a,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new a(this)}function y(e){if(s=s||r(48),!(f.call(y,this)||this instanceof s))return new y(e);this._writableState=new g(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),h.call(this)}function v(e,t,r,n,i,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function w(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),k(e,t)}function _(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=new Array(t.bufferedRequestCount),i=t.corkedRequestsFree;i.entry=r;for(var o=0,s=!0;r;)n[o]=r,r.isBuf||(s=!1),r=r.next,o+=1;n.allBuffers=s,v(e,t,!0,t.length,n,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new a(t),t.bufferedRequestCount=0}else{for(;r;){var u=r.chunk;if(v(e,t,!1,t.objectMode?1:u.length,u,r.encoding,r.callback),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function S(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function E(e,t){e._final(function(r){t.pendingcb--,r&&e.emit("error",r),t.prefinished=!0,e.emit("prefinish"),k(e,t)})}function k(e,t){var r=S(t);return r&&(function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,o.nextTick(E,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),r}c.inherits(y,h),g.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(g.prototype,"buffer",{get:d.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(f=Function.prototype[Symbol.hasInstance],Object.defineProperty(y,Symbol.hasInstance,{value:function(e){return!!f.call(this,e)||this===y&&e&&e._writableState instanceof g}})):f=function(e){return e instanceof this},y.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},y.prototype.write=function(e,t,r){var n,i=this._writableState,a=!1,s=!i.objectMode&&(l.isBuffer(n=e)||n instanceof p);return s&&!l.isBuffer(e)&&(e=function(e){return l.from(e)}(e)),"function"==typeof t&&(r=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof r&&(r=m),i.ended?function(e,t){var r=new Error("write after end");e.emit("error",r),o.nextTick(t,r)}(this,r):(s||function(e,t,r,n){var i=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||t.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(e.emit("error",a),o.nextTick(n,a),i=!1),i}(this,i,e,r))&&(i.pendingcb++,a=function(e,t,r,n,i,o){if(!r){var a=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=l.from(t,r)),t}(t,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=t.objectMode?1:n.length;t.length+=s;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var c=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},c?c.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else v(e,t,!1,s,n,i,o);return u}(this,i,s,e,t,r)),a},y.prototype.cork=function(){this._writableState.corked++},y.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||_(this,e))},y.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(e,t,r){r(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,k(e,t),r&&(t.finished?o.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),y.prototype.destroy=b.destroy,y.prototype._undestroy=b.undestroy,y.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,r(9),r(51).setImmediate,r(10))},function(e,t,r){"use strict";e.exports=a;var n=r(48),i=Object.create(r(13));function o(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function a(e){if(!(this instanceof a))return new a(e);n.call(this,e),this._transformState={afterTransform:o.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",s)}function s(){var e=this;"function"==typeof this._flush?this._flush(function(t,r){u(e,t,r)}):u(this,null,null)}function u(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}i.inherits=r(3),i.inherits(a,n),a.prototype.push=function(e,t){return this._transformState.needTransform=!1,n.prototype.push.call(this,e,t)},a.prototype._transform=function(e,t,r){throw new Error("_transform() is not implemented")},a.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},a.prototype._read=function(e){var t=this._transformState;null!==t.writechunk&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0},a.prototype._destroy=function(e,t){var r=this;n.prototype._destroy.call(this,e,function(e){t(e),r.emit("close")})}},function(e,t,r){"use strict";r.r(t),r.d(t,"ConstructorFragment",function(){return _}),r.d(t,"EventFragment",function(){return g}),r.d(t,"Fragment",function(){return m}),r.d(t,"FunctionFragment",function(){return S}),r.d(t,"ParamType",function(){return p}),r.d(t,"FormatTypes",function(){return h}),r.d(t,"AbiCoder",function(){return ie}),r.d(t,"defaultAbiCoder",function(){return oe}),r.d(t,"Interface",function(){return le}),r.d(t,"Indexed",function(){return de}),r.d(t,"checkResultErrors",function(){return j}),r.d(t,"LogDescription",function(){return ce}),r.d(t,"TransactionDescription",function(){return fe});var n=r(35),i=r(8),o=r(5);const a=new o.a("abi/5.0.7"),s={};let u={calldata:!0,memory:!0,storage:!0},c={calldata:!0,memory:!0};function f(e,t){if("bytes"===e||"string"===e){if(u[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&c[t])return!0;return(u[t]||"payable"===t)&&a.throwArgumentError("invalid modifier","name",t),!1}function d(e,t){for(let r in t)Object(i.c)(e,r,t[r])}const h=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),l=new RegExp(/^(.*)\[([0-9]*)\]$/);class p{constructor(e,t){e!==s&&a.throwError("use fromString",o.a.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),d(this,t);let r=this.type.match(l);d(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:p.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=h.sighash),h[e]||a.throwArgumentError("invalid format type","format",e),e===h.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map(t=>JSON.parse(t.format(e)))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==h.sighash&&(t+=this.type),t+="("+this.components.map(t=>t.format(e)).join(e===h.full?", ":",")+")"):t+=this.type,e!==h.sighash&&(!0===this.indexed&&(t+=" indexed"),e===h.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"==typeof e?p.fromString(e,t):p.fromObject(e)}static fromObject(e){return p.isParamType(e)?e:new p(s,{name:e.name||null,type:E(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(p.fromObject):null})}static fromString(e,t){return function(e){return p.fromObject({name:e.name,type:e.type,indexed:e.indexed,components:e.components})}(function(e,t){let r=e;function n(t){a.throwArgumentError("unexpected character at position "+t,"param",e)}function i(e){let r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");let o={type:"",name:"",state:{allowType:!0}},s=o;for(let a=0;a<e.length;a++){let r=e[a];switch(r){case"(":s.state.allowType&&""===s.type?s.type="tuple":s.state.allowParams||n(a),s.state.allowType=!1,s.type=E(s.type),s.components=[i(s)],s=s.components[0];break;case")":delete s.state,"indexed"===s.name&&(t||n(a),s.indexed=!0,s.name=""),f(s.type,s.name)&&(s.name=""),s.type=E(s.type);let e=s;s=s.parent,s||n(a),delete e.parent,s.state.allowParams=!1,s.state.allowName=!0,s.state.allowArray=!0;break;case",":delete s.state,"indexed"===s.name&&(t||n(a),s.indexed=!0,s.name=""),f(s.type,s.name)&&(s.name=""),s.type=E(s.type);let o=i(s.parent);s.parent.components.push(o),delete s.parent,s=o;break;case" ":s.state.allowType&&""!==s.type&&(s.type=E(s.type),delete s.state.allowType,s.state.allowName=!0,s.state.allowParams=!0),s.state.allowName&&""!==s.name&&("indexed"===s.name?(t||n(a),s.indexed&&n(a),s.indexed=!0,s.name=""):f(s.type,s.name)?s.name="":s.state.allowName=!1);break;case"[":s.state.allowArray||n(a),s.type+=r,s.state.allowArray=!1,s.state.allowName=!1,s.state.readArray=!0;break;case"]":s.state.readArray||n(a),s.type+=r,s.state.readArray=!1,s.state.allowArray=!0,s.state.allowName=!0;break;default:s.state.allowType?(s.type+=r,s.state.allowParams=!0,s.state.allowArray=!0):s.state.allowName?(s.name+=r,delete s.state.allowArray):s.state.readArray?s.type+=r:n(a)}}return s.parent&&a.throwArgumentError("unexpected eof","param",e),delete o.state,"indexed"===s.name?(t||n(r.length-7),s.indexed&&n(r.length-7),s.indexed=!0,s.name=""):f(s.type,s.name)&&(s.name=""),o.type=E(o.type),o}(e,!!t))}static isParamType(e){return!(null==e||!e._isParamType)}}function b(e,t){return function(e){e=e.trim();let t=[],r="",n=0;for(let i=0;i<e.length;i++){let o=e[i];","===o&&0===n?(t.push(r),r=""):(r+=o,"("===o?n++:")"===o&&(n--,-1===n&&a.throwArgumentError("unbalanced parenthesis","value",e)))}return r&&t.push(r),t}(e).map(e=>p.fromString(e,t))}class m{constructor(e,t){e!==s&&a.throwError("use a static from method",o.a.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),d(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return m.isFragment(e)?e:"string"==typeof e?m.fromString(e):m.fromObject(e)}static fromObject(e){if(m.isFragment(e))return e;switch(e.type){case"function":return S.fromObject(e);case"event":return g.fromObject(e);case"constructor":return _.fromObject(e);case"fallback":case"receive":return null}return a.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?g.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?S.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?_.fromString(e.trim()):a.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class g extends m{format(e){if(e||(e=h.sighash),h[e]||a.throwArgumentError("invalid format type","format",e),e===h.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(t=>JSON.parse(t.format(e)))});let t="";return e!==h.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map(t=>t.format(e)).join(e===h.full?", ":",")+") ",e!==h.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"==typeof e?g.fromString(e):g.fromObject(e)}static fromObject(e){if(g.isEventFragment(e))return e;"event"!==e.type&&a.throwArgumentError("invalid event object","value",e);const t={name:x(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(p.fromObject):[],type:"event"};return new g(s,t)}static fromString(e){let t=e.match(A);t||a.throwArgumentError("invalid event string","value",e);let r=!1;return t[3].split(" ").forEach(e=>{switch(e.trim()){case"anonymous":r=!0;break;case"":break;default:a.warn("unknown modifier: "+e)}}),g.fromObject({name:t[1].trim(),anonymous:r,inputs:b(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function y(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&&a.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||a.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=n.a.from(r[1]),r[0]):e}function v(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach(e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}})}function w(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&a.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&a.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||a.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.stateMutability=t.constant?"view":t.payable?"payable":"nonpayable",t.payable&&t.constant&&a.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&a.throwArgumentError("unable to determine stateMutability","value",e),t}class _ extends m{format(e){if(e||(e=h.sighash),h[e]||a.throwArgumentError("invalid format type","format",e),e===h.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payble:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(t=>JSON.parse(t.format(e)))});e===h.sighash&&a.throwError("cannot format a constructor for sighash",o.a.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map(t=>t.format(e)).join(e===h.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?_.fromString(e):_.fromObject(e)}static fromObject(e){if(_.isConstructorFragment(e))return e;"constructor"!==e.type&&a.throwArgumentError("invalid constructor object","value",e);let t=w(e);t.constant&&a.throwArgumentError("constructor cannot be constant","value",e);const r={name:null,type:e.type,inputs:e.inputs?e.inputs.map(p.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?n.a.from(e.gas):null};return new _(s,r)}static fromString(e){let t={type:"constructor"},r=(e=y(e,t)).match(A);return r&&"constructor"===r[1].trim()||a.throwArgumentError("invalid constructor string","value",e),t.inputs=b(r[2].trim(),!1),v(r[3].trim(),t),_.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class S extends _{format(e){if(e||(e=h.sighash),h[e]||a.throwArgumentError("invalid format type","format",e),e===h.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payble:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(t=>JSON.parse(t.format(e))),ouputs:this.outputs.map(t=>JSON.parse(t.format(e)))});let t="";return e!==h.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map(t=>t.format(e)).join(e===h.full?", ":",")+") ",e!==h.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map(t=>t.format(e)).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return"string"==typeof e?S.fromString(e):S.fromObject(e)}static fromObject(e){if(S.isFunctionFragment(e))return e;"function"!==e.type&&a.throwArgumentError("invalid function object","value",e);let t=w(e);const r={type:e.type,name:x(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(p.fromObject):[],outputs:e.outputs?e.outputs.map(p.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?n.a.from(e.gas):null};return new S(s,r)}static fromString(e){let t={type:"function"},r=(e=y(e,t)).split(" returns ");r.length>2&&a.throwArgumentError("invalid function string","value",e);let n=r[0].match(A);if(n||a.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&x(t.name),t.inputs=b(n[2],!1),v(n[3].trim(),t),r.length>1){let n=r[1].match(A);""==n[1].trim()&&""==n[3].trim()||a.throwArgumentError("unexpected tokens","value",e),t.outputs=b(n[2],!1)}else t.outputs=[];return S.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function E(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const k=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function x(e){return e&&e.match(k)||a.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const A=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");var O=r(0);const M=new o.a("abi/5.0.7");function j(e){const t=[],r=function(e,n){if(Array.isArray(n))for(let i in n){const o=e.slice();o.push(i);try{r(o,n[i])}catch(e){t.push({path:o,error:e})}}};return r([],e),t}class R{constructor(e,t,r,n){this.name=e,this.type=t,this.localName=r,this.dynamic=n}_throwError(e,t){M.throwArgumentError(e,this.localName,t)}}class P{constructor(e){Object(i.c)(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return Object(O.c)(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData(Object(O.b)(e._data))}writeBytes(e){let t=Object(O.a)(e);const r=t.length%this.wordSize;return r&&(t=Object(O.b)([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=Object(O.a)(n.a.from(e));return t.length>this.wordSize&&M.throwError("value out-of-bounds",o.a.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=Object(O.b)([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class T{constructor(e,t,r,n){Object(i.c)(this,"_data",Object(O.a)(e)),Object(i.c)(this,"wordSize",t||32),Object(i.c)(this,"_coerceFunc",r),Object(i.c)(this,"allowLoose",n),this._offset=0}get data(){return Object(O.g)(this._data)}get consumed(){return this._offset}static coerce(e,t){let r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):T.coerce(e,t)}_peekBytes(e,t,r){let n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:M.throwError("data out-of-bounds",o.a.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(e){return new T(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}readValue(){return n.a.from(this.readBytes(this.wordSize))}}var I=r(26);class C extends R{constructor(e){super("address","address",e,!1)}encode(e,t){try{Object(I.a)(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}decode(e){return Object(I.a)(Object(O.f)(e.readValue().toHexString(),20))}}class B extends R{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}const N=new o.a("abi/5.0.7");function L(e,t,r){let n=null;if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let e={};n=t.map(t=>{const n=t.localName;return n||N.throwError("cannot encode object for signature with missing names",o.a.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]&&N.throwError("cannot encode object for signature with duplicate names",o.a.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]=!0,r[n]})}else N.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&N.throwArgumentError("types/value length mismatch","tuple",r);let i=new P(e.wordSize),a=new P(e.wordSize),s=[];t.forEach((e,t)=>{let r=n[t];if(e.dynamic){let t=a.length;e.encode(a,r);let n=i.writeUpdatableValue();s.push(e=>{n(e+t)})}else e.encode(i,r)}),s.forEach(e=>{e(i.length)});let u=e.appendWriter(i);return u+=e.appendWriter(a),u}function D(e,t){let r=[],n=e.subReader(0);t.forEach(t=>{let i=null;if(t.dynamic){let r=e.readValue(),a=n.subReader(r.toNumber());try{i=t.decode(a)}catch(e){if(e.code===o.a.errors.BUFFER_OVERRUN)throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(e){if(e.code===o.a.errors.BUFFER_OVERRUN)throw e;i=e,i.baseType=t.name,i.name=t.localName,i.type=t.type}null!=i&&r.push(i)});const i=t.reduce((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e},{});t.forEach((e,t)=>{let n=e.localName;if(!n||1!==i[n])return;if("length"===n&&(n="_length"),null!=r[n])return;const o=r[t];o instanceof Error?Object.defineProperty(r,n,{get:()=>{throw o}}):r[n]=o});for(let o=0;o<r.length;o++){const e=r[o];e instanceof Error&&Object.defineProperty(r,o,{get:()=>{throw e}})}return Object.freeze(r)}class q extends R{constructor(e,t,r){super("array",e.type+"["+(t>=0?t:"")+"]",r,-1===t||e.dynamic),this.coder=e,this.length=t}encode(e,t){Array.isArray(t)||this._throwError("expected array value",t);let r=this.length;-1===r&&(r=t.length,e.writeValue(t.length)),N.checkArgumentCount(t.length,r,"coder array"+(this.localName?" "+this.localName:""));let n=[];for(let i=0;i<t.length;i++)n.push(this.coder);return L(e,n,t)}decode(e){let t=this.length;-1===t&&(t=e.readValue().toNumber());let r=[];for(let n=0;n<t;n++)r.push(new B(this.coder));return e.coerce(this.name,D(e,r))}}class U extends R{constructor(e){super("bool","bool",e,!1)}encode(e,t){return e.writeValue(t?1:0)}decode(e){return e.coerce(this.type,!e.readValue().isZero())}}class F extends R{constructor(e,t){super(e,e,t,!0)}encode(e,t){t=Object(O.a)(t);let r=e.writeValue(t.length);return r+=e.writeBytes(t),r}decode(e){return e.readBytes(e.readValue().toNumber(),!0)}}class H extends F{constructor(e){super("bytes",e)}decode(e){return e.coerce(this.name,Object(O.g)(super.decode(e)))}}class z extends R{constructor(e,t){let r="bytes"+String(e);super(r,r,t,!1),this.size=e}encode(e,t){let r=Object(O.a)(t);return r.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(r)}decode(e){return e.coerce(this.name,Object(O.g)(e.readBytes(this.size)))}}class W extends R{constructor(e){super("null","",e,!1)}encode(e,t){return null!=t&&this._throwError("not null",t),e.writeBytes([])}decode(e){return e.readBytes(0),e.coerce(this.name,null)}}var K=r(371);class V extends R{constructor(e,t,r){const n=(t?"int":"uint")+8*e;super(n,n,r,!1),this.size=e,this.signed=t}encode(e,t){let r=n.a.from(t),i=K.a.mask(8*e.wordSize);if(this.signed){let e=i.mask(8*this.size-1);(r.gt(e)||r.lt(e.add(K.c).mul(K.b)))&&this._throwError("value out-of-bounds",t)}else(r.lt(K.d)||r.gt(i.mask(8*this.size)))&&this._throwError("value out-of-bounds",t);return r=r.toTwos(8*this.size).mask(8*this.size),this.signed&&(r=r.fromTwos(8*this.size).toTwos(8*e.wordSize)),e.writeValue(r)}decode(e){let t=e.readValue().mask(8*this.size);return this.signed&&(t=t.fromTwos(8*this.size)),e.coerce(this.name,t)}}const J=new o.a("strings/5.4.0");var G,X;function Y(e,t,r,n,i){if(e===X.BAD_PREFIX||e===X.UNEXPECTED_CONTINUE){let e=0;for(let n=t+1;n<r.length&&r[n]>>6==2;n++)e++;return e}return e===X.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(G||(G={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(X||(X={}));const $=Object.freeze({error:function(e,t,r,n,i){return J.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:Y,replace:function(e,t,r,n,i){return e===X.OVERLONG?(n.push(i),0):(n.push(65533),Y(e,t,r))}});function Z(e,t=G.current){t!=G.current&&(J.checkNormalize(),e=e.normalize(t));let r=[];for(let n=0;n<e.length;n++){const t=e.charCodeAt(n);if(t<128)r.push(t);else if(t<2048)r.push(t>>6|192),r.push(63&t|128);else if(55296==(64512&t)){n++;const i=e.charCodeAt(n);if(n>=e.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const o=65536+((1023&t)<<10)+(1023&i);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(63&o|128)}else r.push(t>>12|224),r.push(t>>6&63|128),r.push(63&t|128)}return Object(O.a)(r)}class Q extends F{constructor(e){super("string",e)}encode(e,t){return super.encode(e,Z(t))}decode(e){return function(e,t){return function(e,t){null==t&&(t=$.error),e=Object(O.a)(e);const r=[];let n=0;for(;n<e.length;){const i=e[n++];if(i>>7==0){r.push(i);continue}let o=null,a=null;if(192==(224&i))o=1,a=127;else if(224==(240&i))o=2,a=2047;else{if(240!=(248&i)){n+=t(128==(192&i)?X.UNEXPECTED_CONTINUE:X.BAD_PREFIX,n-1,e,r);continue}o=3,a=65535}if(n-1+o>=e.length){n+=t(X.OVERRUN,n-1,e,r);continue}let s=i&(1<<8-o-1)-1;for(let u=0;u<o;u++){let i=e[n];if(128!=(192&i)){n+=t(X.MISSING_CONTINUE,n,e,r),s=null;break}s=s<<6|63&i,n++}null!==s&&(s>1114111?n+=t(X.OUT_OF_RANGE,n-1-o,e,r,s):s>=55296&&s<=57343?n+=t(X.UTF16_SURROGATE,n-1-o,e,r,s):s<=a?n+=t(X.OVERLONG,n-1-o,e,r,s):r.push(s))}return r}(e,void 0).map(e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e)))).join("")}(super.decode(e))}}class ee extends R{constructor(e,t){let r=!1;const n=[];e.forEach(e=>{e.dynamic&&(r=!0),n.push(e.type)}),super("tuple","tuple("+n.join(",")+")",t,r),this.coders=e}encode(e,t){return L(e,this.coders,t)}decode(e){return e.coerce(this.name,D(e,this.coders))}}const te=new o.a("abi/5.0.7"),re=new RegExp(/^bytes([0-9]*)$/),ne=new RegExp(/^(u?int)([0-9]*)$/);class ie{constructor(e){te.checkNew(new.target,ie),Object(i.c)(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new C(e.name);case"bool":return new U(e.name);case"string":return new Q(e.name);case"bytes":return new H(e.name);case"array":return new q(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new ee((e.components||[]).map(e=>this._getCoder(e)),e.name);case"":return new W(e.name)}let t=e.type.match(ne);if(t){let r=parseInt(t[2]||"256");return(0===r||r>256||r%8!=0)&&te.throwArgumentError("invalid "+t[1]+" bit length","param",e),new V(r/8,"int"===t[1],e.name)}if(t=e.type.match(re),t){let r=parseInt(t[1]);return(0===r||r>32)&&te.throwArgumentError("invalid bytes length","param",e),new z(r,e.name)}return te.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new T(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new P(this._getWordSize())}encode(e,t){e.length!==t.length&&te.throwError("types/values length mismatch",o.a.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const r=e.map(e=>this._getCoder(p.from(e))),n=new ee(r,"_"),i=this._getWriter();return n.encode(i,t),i.data}decode(e,t,r){const n=e.map(e=>this._getCoder(p.from(e)));return new ee(n,"_").decode(this._getReader(Object(O.a)(t),r))}}const oe=new ie;var ae=r(18);function se(e){return Object(ae.a)(Z(e))}const ue=new o.a("abi/5.0.7");class ce extends i.a{}class fe extends i.a{}class de extends i.a{static isIndexed(e){return!(!e||!e._isIndexed)}}function he(e,t){const r=new Error("deferred error during ABI decoding triggered accessing "+e);return r.error=t,r}class le{constructor(e){ue.checkNew(new.target,le);let t=[];t="string"==typeof e?JSON.parse(e):e,Object(i.c)(this,"fragments",t.map(e=>m.from(e)).filter(e=>null!=e)),Object(i.c)(this,"_abiCoder",Object(i.d)(new.target,"getAbiCoder")()),Object(i.c)(this,"functions",{}),Object(i.c)(this,"errors",{}),Object(i.c)(this,"events",{}),Object(i.c)(this,"structs",{}),this.fragments.forEach(e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void ue.warn("duplicate definition - constructor"):void Object(i.c)(this,"deploy",e);case"function":t=this.functions;break;case"event":t=this.events;break;default:return}let r=e.format();t[r]?ue.warn("duplicate definition - "+r):t[r]=e}),this.deploy||Object(i.c)(this,"deploy",_.from({payable:!1,type:"constructor"})),Object(i.c)(this,"_isInterface",!0)}format(e){e||(e=h.full),e===h.sighash&&ue.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map(t=>t.format(e));return e===h.json?JSON.stringify(t.map(e=>JSON.parse(e))):t}static getAbiCoder(){return oe}static getAddress(e){return Object(I.a)(e)}static getSighash(e){return Object(O.e)(se(e.format()),0,4)}static getEventTopic(e){return se(e.format())}getFunction(e){if(Object(O.j)(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];ue.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.functions).filter(e=>e.split("(")[0]===t);return 0===r.length?ue.throwArgumentError("no matching function","name",t):r.length>1&&ue.throwArgumentError("multiple matching functions","name",t),this.functions[r[0]]}const t=this.functions[S.fromString(e).format()];return t||ue.throwArgumentError("no matching function","signature",e),t}getEvent(e){if(Object(O.j)(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];ue.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.events).filter(e=>e.split("(")[0]===t);return 0===r.length?ue.throwArgumentError("no matching event","name",t):r.length>1&&ue.throwArgumentError("multiple matching events","name",t),this.events[r[0]]}const t=this.events[g.fromString(e).format()];return t||ue.throwArgumentError("no matching event","signature",e),t}getSighash(e){return"string"==typeof e&&(e=this.getFunction(e)),Object(i.d)(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),Object(i.d)(this.constructor,"getEventTopic")(e)}_decodeParams(e,t){return this._abiCoder.decode(e,t)}_encodeParams(e,t){return this._abiCoder.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));const r=Object(O.a)(t);return Object(O.g)(r.slice(0,4))!==this.getSighash(e)&&ue.throwArgumentError(`data signature does not match function ${e.name}.`,"data",Object(O.g)(r)),this._decodeParams(e.inputs,r.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Object(O.g)(Object(O.b)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let r=Object(O.a)(t),n=null,i=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(e){}break;case 4:"0x08c379a0"===Object(O.g)(r.slice(0,4))&&(i="Error(string)",n=this._abiCoder.decode(["string"],r.slice(4))[0])}return ue.throwError("call revert exception",o.a.errors.CALL_EXCEPTION,{method:e.format(),errorSignature:i,errorArgs:[n],reason:n})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Object(O.g)(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&ue.throwError("too many arguments for "+e.format(),o.a.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let r=[];e.anonymous||r.push(this.getEventTopic(e));const n=(e,t)=>"string"===e.type?se(t):"bytes"===e.type?Object(ae.a)(Object(O.g)(t)):("address"===e.type&&this._abiCoder.encode(["address"],[t]),Object(O.f)(Object(O.g)(t),32));for(t.forEach((t,i)=>{let o=e.inputs[i];o.indexed?null==t?r.push(null):"array"===o.baseType||"tuple"===o.baseType?ue.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,t):Array.isArray(t)?r.push(t.map(e=>n(o,e))):r.push(n(o,t)):null!=t&&ue.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,t)});r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(e,t){"string"==typeof e&&(e=this.getEvent(e));const r=[],n=[],i=[];return e.anonymous||r.push(this.getEventTopic(e)),t.length!==e.inputs.length&&ue.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach((e,o)=>{const a=t[o];if(e.indexed)if("string"===e.type)r.push(se(a));else if("bytes"===e.type)r.push(Object(ae.a)(a));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");r.push(this._abiCoder.encode([e.type],[a]))}else n.push(e),i.push(a)}),{data:this._abiCoder.encode(n,i),topics:r}}decodeEventLog(e,t,r){if("string"==typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){let t=this.getEventTopic(e);Object(O.j)(r[0],32)&&r[0].toLowerCase()===t||ue.throwError("fragment/topic mismatch",o.a.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:t,value:r[0]}),r=r.slice(1)}let n=[],i=[],a=[];e.inputs.forEach((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(n.push(p.fromObject({type:"bytes32",name:e.name})),a.push(!0)):(n.push(e),a.push(!1)):(i.push(e),a.push(!1))});let s=null!=r?this._abiCoder.decode(n,Object(O.b)(r)):null,u=this._abiCoder.decode(i,t,!0),c=[],f=0,d=0;e.inputs.forEach((e,t)=>{if(e.indexed)if(null==s)c[t]=new de({_isIndexed:!0,hash:null});else if(a[t])c[t]=new de({_isIndexed:!0,hash:s[d++]});else try{c[t]=s[d++]}catch(e){c[t]=e}else try{c[t]=u[f++]}catch(e){c[t]=e}if(e.name&&null==c[e.name]){const r=c[t];r instanceof Error?Object.defineProperty(c,e.name,{get:()=>{throw he("property "+JSON.stringify(e.name),r)}}):c[e.name]=r}});for(let o=0;o<c.length;o++){const e=c[o];e instanceof Error&&Object.defineProperty(c,o,{get:()=>{throw he("index "+o,e)}})}return Object.freeze(c)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new fe({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:n.a.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new ce({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}static isInterface(e){return!(!e||!e._isInterface)}}},function(e,t,r){e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,(function(t){return e[t]}).bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=7)}([function(e,t){e.exports=r(2)},function(e,t){e.exports=r(12)},function(e,t){e.exports=r(208)},function(e,t){e.exports=r(33)},function(e,t){e.exports=r(15)},function(e,t){e.exports=r(24)},function(e,t){e.exports=r(25)},function(e,t,r){"use strict";r.r(t),r.d(t,"ETHEREUM_NETWORK",function(){return n}),r.d(t,"abi",function(){return i}),r.d(t,"default",function(){return y});var n={ROPSTEN:"ropsten",MAINNET:"mainnet"},i=[{constant:!0,inputs:[],name:"currentEpoch",outputs:[{internalType:"uint256",name:"",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"uint256",name:"epoch",type:"uint256"}],name:"getEpochInfo",outputs:[{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"n",type:"uint256"},{internalType:"uint256",name:"k",type:"uint256"},{internalType:"uint256",name:"t",type:"uint256"},{internalType:"address[]",name:"nodeList",type:"address[]"},{internalType:"uint256",name:"prevEpoch",type:"uint256"},{internalType:"uint256",name:"nextEpoch",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"},{constant:!0,inputs:[{internalType:"address",name:"nodeAddress",type:"address"}],name:"getNodeDetails",outputs:[{internalType:"string",name:"declaredIp",type:"string"},{internalType:"uint256",name:"position",type:"uint256"},{internalType:"uint256",name:"pubKx",type:"uint256"},{internalType:"uint256",name:"pubKy",type:"uint256"},{internalType:"string",name:"tmP2PListenAddress",type:"string"},{internalType:"string",name:"p2pListenAddress",type:"string"}],payable:!1,stateMutability:"view",type:"function"}],o=r(4),a=r.n(o),s=r(5),u=r.n(s),c=r(6),f=r.n(c),d=r(0),h=r.n(d),l=r(1),p=r.n(l),b=r(2),m=r.n(b),g=r(3),y=function(){function e(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=r.network,a=void 0===o?n.MAINNET:o,s=r.proxyAddress,c=void 0===s?"0x638646503746d5456209e33a2ff5e3226d698bea":s;u()(this,e),h()(this,"_currentEpoch","19"),h()(this,"_torusNodeEndpoints",["https://torus-19.torusnode.com/jrpc","https://torus-node.ens.domains/jrpc","https://torus-node.matic.network/jrpc","https://torus.zilliqa.network/jrpc","https://torus-mainnet.cosmos.network/jrpc","https://torus2.etherscan.com/jrpc","https://torus-node-v2.skalelabs.com/jrpc","https://torus-node.binancex.dev/jrpc","https://torusnode.ont.io/jrpc"]),h()(this,"_torusNodePub",[{X:"bbe83c64177c3775550e6ba6ac2bc059f6847d644c9e4894e42c60d7974d8c2b",Y:"82b49a7caf70def38cdad2740af45c1e4f969650105c5019a29bb18b21a9acb5"},{X:"c208cac4ef9a47d386097a9c915b28e9cb89213abee8d26a17198ee261201b0d",Y:"c7db2fe4631109f40833de9dc78d07e35706549ee48fa557b33e4e75e1047873"},{X:"ca1766bb426d4ca5582818a0c5439d560ea64f5baa060793ab29dd3d0ceacfe",Y:"d46c1d08c40e1306e1bca328c2287b8268166b11a1ba4b8442ea2ad0c5e32152"},{X:"c3934dd2f6f4b3d2e1e398cc501e143c1e1a381b52feb6d1525af34d16253768",Y:"71f5141a5035799099f5ea3e241e66946bc55dc857ac3bd7d6fcdb8dcd3eeeef"},{X:"22e66f1929631d00bf026227581597f085fd94fd952fc0dca9f0833398b5c064",Y:"6088b3912e10a1e9d50355a609c10db7d188f16a2e2fd7357e51bf4f6a74f0a1"},{X:"9dc9fa410f3ce9eb70df70cdea00a49f2c4cc7a31c08c0dab5f863ed35ff5139",Y:"627a291cb87a75c61da3f65d6818e1e05e360217179817ed27e8c73bca7ec122"},{X:"118b9fc07e97b096d899b9f6658463ce6a8caa64038e37fc969df4e6023dd8c6",Y:"baf9fa4e51770f4796ea165dd03a769b8606681a38954a0a92c4cbffd6609ce9"},{X:"8a6d8b925da15a273dec3d8f8395ec35cd6878f274b2b180e4e106999db64043",Y:"96f67f870c157743da0b1eb84d89bf30500d74dc84c11f501ee1cb013acc8c46"},{X:"39cecb62e863729f572f7dfc46c24867981bf04bb405fed0df39e33984bfade5",Y:"61c2364434012e68a2be2e9952805037e52629d7762fafc8e10e9fb5bad8f790"}]),h()(this,"_torusIndexes",[1,2,3,4,5,6,7,8,9]),h()(this,"_network",n.MAINNET),h()(this,"nodeListAddress",void 0),h()(this,"updated",void 0),h()(this,"nodeListContract",void 0);try{var f=new URL(a);t=f.href}catch(e){t="https://".concat(a,".infura.io/v3/").concat("b8cdb0e4cff24599a286bf8e87ff1c96")}m.a.setProvider(t),this.nodeListContract=new m.a(i,c),this.nodeListAddress=c,this.updated=!1,this._network=a}var t;return f()(e,[{key:"_nodeDetails",get:function(){return{currentEpoch:this._currentEpoch,nodeListAddress:this.nodeListAddress,torusNodeEndpoints:this._torusNodeEndpoints,torusNodePub:this._torusNodePub,torusIndexes:this._torusIndexes,updated:this.updated}}},{key:"getCurrentEpoch",value:function(){return this.nodeListContract.methods.currentEpoch().call()}},{key:"getEpochInfo",value:function(e){return this.nodeListContract.methods.getEpochInfo(e).call()}},{key:"getNodeEndpoint",value:function(e){return this.nodeListContract.methods.getNodeDetails(e).call()}},{key:"getNodeDetails",value:(t=a()(p.a.mark(function e(){var t,r,i,o,a,s,u,c,f,d,h,l,b=this,m=arguments;return p.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=m.length>0&&void 0!==m[0]&&m[0],r=m.length>1&&void 0!==m[1]&&m[1],e.prev=2,!t||this._network!==n.MAINNET){e.next=5;break}return e.abrupt("return",this._nodeDetails);case 5:if(!this.updated){e.next=7;break}return e.abrupt("return",this._nodeDetails);case 7:return e.next=9,this.getCurrentEpoch();case 9:if(i=e.sent,!r||this._network!==n.MAINNET||i!==this._currentEpoch){e.next=12;break}return e.abrupt("return",this._nodeDetails);case 12:return this._currentEpoch=i,e.next=15,this.getEpochInfo(i);case 15:return a=(o=e.sent).nodeList.map(function(e,t){return t+1}),this._torusIndexes=a,s=o.nodeList.map(function(e){return b.getNodeEndpoint(e)}),e.next=21,Promise.all(s);case 21:for(u=e.sent,c=[],f=[],d=0;d<u.length;d+=1)l="https://".concat((h=u[d]).declaredIp.split(":")[0],"/jrpc"),c.push(l),f.push({X:Object(g.toHex)(h.pubKx).replace("0x",""),Y:Object(g.toHex)(h.pubKy).replace("0x","")});return this._torusNodeEndpoints=c,this._torusNodePub=f,this.updated=!0,e.abrupt("return",this._nodeDetails);case 31:return e.prev=31,e.t0=e.catch(2),e.abrupt("return",this._nodeDetails);case 34:case"end":return e.stop()}},e,this,[[2,31]])})),function(){return t.apply(this,arguments)})}]),e}()}]).default},function(e,t,r){"use strict";(function(e){r.d(t,"a",function(){return H});var n=r(1),i=r.n(n),o=r(20),a=r.n(o);function s(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},r.exports),r.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e||"undefined"!=typeof self&&self;var u=c;function c(e,t){if(!e)throw new Error(t||"Assertion failed")}c.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var f=s(function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16));else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,a=255&i;o?r.push(o,a):r.push(a)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}}),d=s(function(e,t){var r=t;r.assert=u,r.toArray=f.toArray,r.zero2=f.zero2,r.toHex=f.toHex,r.encode=f.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<<t+1,o=e.clone(),a=0;a<n.length;a++){var s,u=o.andln(i-1);o.isOdd()?o.isubn(s=u>(i>>1)-1?(i>>1)-u:u):s=0,n[a]=s,o.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,u=e.andln(3)+i&3,c=t.andln(3)+o&3;3===u&&(u=-1),3===c&&(c=-1),a=0==(1&u)?0:3!=(n=e.andln(7)+i&7)&&5!==n||2!==c?u:-u,r[0].push(a),s=0==(1&c)?0:3!=(n=t.andln(7)+o&7)&&5!==n||2!==u?c:-c,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new i.a(e,"hex","le")}}),h=d.getNAF,l=d.getJSF,p=d.assert;function b(e,t){this.type=e,this.p=new i.a(t.p,16),this.red=t.prime?i.a.red(t.prime):i.a.mont(this.p),this.zero=new i.a(0).toRed(this.red),this.one=new i.a(1).toRed(this.red),this.two=new i.a(2).toRed(this.red),this.n=t.n&&new i.a(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var m=b;function g(e,t){this.curve=e,this.type=t,this.precomputed=null}b.prototype.point=function(){throw new Error("Not implemented")},b.prototype.validate=function(){throw new Error("Not implemented")},b.prototype._fixedNafMul=function(e,t){p(e.precomputed);var r=e._getDoubles(),n=h(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var o,a,s=[];for(o=0;o<n.length;o+=r.step){a=0;for(var u=o+r.step-1;u>=o;u--)a=(a<<1)+n[u];s.push(a)}for(var c=this.jpoint(null,null,null),f=this.jpoint(null,null,null),d=i;d>0;d--){for(o=0;o<s.length;o++)(a=s[o])===d?f=f.mixedAdd(r.points[o]):a===-d&&(f=f.mixedAdd(r.points[o].neg()));c=c.add(f)}return c.toP()},b.prototype._wnafMul=function(e,t){for(var r=4,n=e._getNAFPoints(r),i=n.points,o=h(t,r=n.wnd,this._bitLength),a=this.jpoint(null,null,null),s=o.length-1;s>=0;s--){for(var u=0;s>=0&&0===o[s];s--)u++;if(s>=0&&u++,a=a.dblp(u),s<0)break;var c=o[s];p(0!==c),a="affine"===e.type?a.mixedAdd(c>0?i[c-1>>1]:i[-c-1>>1].neg()):a.add(c>0?i[c-1>>1]:i[-c-1>>1].neg())}return"affine"===e.type?a.toP():a},b.prototype._wnafMulAdd=function(e,t,r,n,i){var o,a,s,u=this._wnafT1,c=this._wnafT2,f=this._wnafT3,d=0;for(o=0;o<n;o++){var p=(s=t[o])._getNAFPoints(e);u[o]=p.wnd,c[o]=p.points}for(o=n-1;o>=1;o-=2){var b=o-1,m=o;if(1===u[b]&&1===u[m]){var g=[t[b],null,null,t[m]];0===t[b].y.cmp(t[m].y)?(g[1]=t[b].add(t[m]),g[2]=t[b].toJ().mixedAdd(t[m].neg())):0===t[b].y.cmp(t[m].y.redNeg())?(g[1]=t[b].toJ().mixedAdd(t[m]),g[2]=t[b].add(t[m].neg())):(g[1]=t[b].toJ().mixedAdd(t[m]),g[2]=t[b].toJ().mixedAdd(t[m].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],v=l(r[b],r[m]);for(d=Math.max(v[0].length,d),f[b]=new Array(d),f[m]=new Array(d),a=0;a<d;a++)f[b][a]=y[3*(1+(0|v[0][a]))+(1+(0|v[1][a]))],f[m][a]=0,c[b]=g}else f[b]=h(r[b],u[b],this._bitLength),f[m]=h(r[m],u[m],this._bitLength),d=Math.max(f[b].length,d),d=Math.max(f[m].length,d)}var w=this.jpoint(null,null,null),_=this._wnafT4;for(o=d;o>=0;o--){for(var S=0;o>=0;){var E=!0;for(a=0;a<n;a++)_[a]=0|f[a][o],0!==_[a]&&(E=!1);if(!E)break;S++,o--}if(o>=0&&S++,w=w.dblp(S),o<0)break;for(a=0;a<n;a++){var k=_[a];0!==k&&(k>0?s=c[a][k-1>>1]:k<0&&(s=c[a][-k-1>>1].neg()),w="affine"===s.type?w.mixedAdd(s):w.add(s))}}for(o=0;o<n;o++)c[o]=null;return i?w:w.toP()},b.BasePoint=g,g.prototype.eq=function(){throw new Error("Not implemented")},g.prototype.validate=function(){return this.curve.validate(this)},b.prototype.decodePoint=function(e,t){e=d.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?p(e[e.length-1]%2==0):7===e[0]&&p(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},g.prototype.encodeCompressed=function(e){return this.encode(e,!0)},g.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},g.prototype.encode=function(e,t){return d.encode(this._encode(t),e)},g.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},g.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},g.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},g.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},g.prototype._getBeta=function(){return null},g.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var y=s(function(e){e.exports="function"==typeof Object.create?function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}}),v=d.assert;function w(e){m.call(this,"short",e),this.a=new i.a(e.a,16).toRed(this.red),this.b=new i.a(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}y(w,m);var _=w;function S(e,t,r,n){m.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i.a(t,16),this.y=new i.a(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function E(e,t,r,n){m.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i.a(0)):(this.x=new i.a(t,16),this.y=new i.a(r,16),this.z=new i.a(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}w.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new i.a(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new i.a(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:v(0===this.g.mul(r=o[1]).x.cmp(this.g.x.redMul(t)))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new i.a(e.a,16),b:new i.a(e.b,16)}}):this._getEndoBasis(r)}}},w.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.a.mont(e),r=new i.a(2).toRed(t).redInvm(),n=r.redNeg(),o=new i.a(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},w.prototype._getEndoBasis=function(e){for(var t,r,n,o,a,s,u,c,f,d=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=e,l=this.n.clone(),p=new i.a(1),b=new i.a(0),m=new i.a(0),g=new i.a(1),y=0;0!==h.cmpn(0);){var v=l.div(h);c=l.sub(v.mul(h)),f=m.sub(v.mul(p));var w=g.sub(v.mul(b));if(!n&&c.cmp(d)<0)t=u.neg(),r=p,n=c.neg(),o=f;else if(n&&2==++y)break;u=c,l=h,h=c,m=p,p=f,g=b,b=w}a=c.neg(),s=f;var _=n.sqr().add(o.sqr());return a.sqr().add(s.sqr()).cmp(_)>=0&&(a=t,s=r),n.negative&&(n=n.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:o},{a:a,b:s}]},w.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),c=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},w.prototype.pointFromX=function(e,t){(e=new i.a(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},w.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},w.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(t[o]),s=e[o],u=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),u=u.neg(!0)),n[2*o]=s,n[2*o+1]=u,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var c=this._wnafMulAdd(1,n,i,2*o,r),f=0;f<2*o;f++)n[f]=null,i[f]=null;return c},y(S,m.BasePoint),w.prototype.point=function(e,t,r){return new S(this,e,t,r)},w.prototype.pointFromJSON=function(e,t){return S.fromJSON(this,e,t)},S.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},S.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},S.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},S.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},S.prototype.isInfinity=function(){return this.inf},S.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},S.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},S.prototype.getX=function(){return this.x.fromRed()},S.prototype.getY=function(){return this.y.fromRed()},S.prototype.mul=function(e){return e=new i.a(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},S.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},S.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},S.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},S.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},S.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},y(E,m.BasePoint),w.prototype.jpoint=function(e,t,r){return new E(this,e,t,r)},E.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},E.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},E.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),f=c.redMul(s),d=n.redMul(c),h=u.redSqr().redIAdd(f).redISub(d).redISub(d),l=u.redMul(d.redISub(h)).redISub(o.redMul(f)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,l,p)},E.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),f=r.redMul(u),d=s.redSqr().redIAdd(c).redISub(f).redISub(f),h=s.redMul(f.redISub(d)).redISub(i.redMul(c)),l=this.z.redMul(a);return this.curve.jpoint(d,h,l)},E.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,s=this.z,u=s.redSqr().redSqr(),c=a.redAdd(a);for(t=0;t<e;t++){var f=o.redSqr(),d=c.redSqr(),h=d.redSqr(),l=f.redAdd(f).redIAdd(f).redIAdd(n.redMul(u)),p=o.redMul(d),b=l.redSqr().redISub(p.redAdd(p)),m=p.redISub(b),g=l.redMul(m);g=g.redIAdd(g).redISub(h);var y=c.redMul(s);t+1<e&&(u=u.redMul(h)),o=b,s=y,c=g}return this.curve.jpoint(o,c.redMul(i),s)},E.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},E.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n),u=s.redSqr().redISub(a).redISub(a),c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),e=u,t=s.redMul(a.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var f=this.x.redSqr(),d=this.y.redSqr(),h=d.redSqr(),l=this.x.redAdd(d).redSqr().redISub(f).redISub(h);l=l.redIAdd(l);var p=f.redAdd(f).redIAdd(f),b=p.redSqr(),m=h.redIAdd(h);m=(m=m.redIAdd(m)).redIAdd(m),e=b.redISub(l).redISub(l),t=p.redMul(l.redISub(e)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},E.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=s.redSqr().redISub(a).redISub(a);e=u;var c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),t=s.redMul(a.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var f=this.z.redSqr(),d=this.y.redSqr(),h=this.x.redMul(d),l=this.x.redSub(f).redMul(this.x.redAdd(f));l=l.redAdd(l).redIAdd(l);var p=h.redIAdd(h),b=(p=p.redIAdd(p)).redAdd(p);e=l.redSqr().redISub(b),r=this.y.redAdd(this.z).redSqr().redISub(d).redISub(f);var m=d.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=l.redMul(p.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,r)},E.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),a=r.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),u=t.redAdd(t),c=(u=u.redIAdd(u)).redMul(a),f=s.redSqr().redISub(c.redAdd(c)),d=c.redISub(f),h=a.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var l=s.redMul(d).redISub(h),p=r.redAdd(r).redMul(n);return this.curve.jpoint(f,l,p)},E.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(n),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var c=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(u),f=t.redMul(c);f=(f=f.redIAdd(f)).redIAdd(f);var d=this.x.redMul(s).redISub(f);d=(d=d.redIAdd(d)).redIAdd(d);var h=this.y.redMul(c.redMul(u.redISub(c)).redISub(a.redMul(s)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var l=this.z.redAdd(a).redSqr().redISub(r).redISub(s);return this.curve.jpoint(d,h,l)},E.prototype.mul=function(e,t){return e=new i.a(e,t),this.curve._wnafMul(this,e)},E.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},E.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},E.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},E.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var k=s(function(e,t){var r=t;r.base=m,r.short=_,r.mont=null,r.edwards=null}),x=s(function(e,t){var r,n=t,i=d.assert;function o(e){this.curve="short"===e.type?new k.short(e):"edwards"===e.type?new k.edwards(e):new k.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:a.a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:a.a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:a.a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:a.a.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:a.a.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.a.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:a.a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(e){r=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:a.a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})});function A(e){if(!(this instanceof A))return new A(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=f.toArray(e.entropy,e.entropyEnc||"hex"),r=f.toArray(e.nonce,e.nonceEnc||"hex"),n=f.toArray(e.pers,e.persEnc||"hex");u(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var O=A;A.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},A.prototype._hmac=function(){return new a.a.hmac(this.hash,this.K)},A.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},A.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=f.toArray(e,t),r=f.toArray(r,n),u(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},A.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=f.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length<e;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var o=i.slice(0,e);return this._update(r),this._reseed++,f.encode(o,t)};var M=d.assert;function j(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var R=j;j.fromPublic=function(e,t,r){return t instanceof j?t:new j(e,{pub:t,pubEnc:r})},j.fromPrivate=function(e,t,r){return t instanceof j?t:new j(e,{priv:t,privEnc:r})},j.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},j.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},j.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},j.prototype._importPrivate=function(e,t){this.priv=new i.a(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},j.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?M(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||M(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},j.prototype.derive=function(e){return e.validate()||M(e.validate(),"public point not validated"),e.mul(this.priv).getX()},j.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},j.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},j.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var P=d.assert;function T(e,t){if(e instanceof T)return e;this._importDER(e,t)||(P(e.r&&e.s,"Signature without r or s"),this.r=new i.a(e.r,16),this.s=new i.a(e.s,16),this.recoveryParam=void 0===e.recoveryParam?null:e.recoveryParam)}var I=T;function C(){this.place=0}function B(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=t.place;o<n;o++,a++)i<<=8,i|=e[a],i>>>=0;return!(i<=127)&&(t.place=a,i)}function N(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function L(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}T.prototype._importDER=function(e,t){e=d.toArray(e,t);var r=new C;if(48!==e[r.place++])return!1;var n=B(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var o=B(e,r);if(!1===o)return!1;var a=e.slice(r.place,o+r.place);if(r.place+=o,2!==e[r.place++])return!1;var s=B(e,r);if(!1===s)return!1;if(e.length!==s+r.place)return!1;var u=e.slice(r.place,s+r.place);if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}return this.r=new i.a(a),this.s=new i.a(u),this.recoveryParam=null,!0},T.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=N(t),r=N(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];L(n,t.length),(n=n.concat(t)).push(2),L(n,r.length);var i=n.concat(r),o=[48];return L(o,i.length),o=o.concat(i),d.encode(o,e)};var D=function(){throw new Error("unsupported")},q=d.assert;function U(e){if(!(this instanceof U))return new U(e);"string"==typeof e&&(q(Object.prototype.hasOwnProperty.call(x,e),"Unknown curve "+e),e=x[e]),e instanceof x.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var F=U;U.prototype.keyPair=function(e){return new R(this,e)},U.prototype.keyFromPrivate=function(e,t){return R.fromPrivate(this,e,t)},U.prototype.keyFromPublic=function(e,t){return R.fromPublic(this,e,t)},U.prototype.genKeyPair=function(e){e||(e={});for(var t=new O({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||D(),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new i.a(2));;){var o=new i.a(t.generate(r));if(!(o.cmp(n)>0))return o.iaddn(1),this.keyFromPrivate(o)}},U.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},U.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new i.a(e,16));for(var o=this.n.byteLength(),a=t.getPrivate().toArray("be",o),s=e.toArray("be",o),u=new O({hash:this.hash,entropy:a,nonce:s,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new i.a(1)),f=0;;f++){var d=n.k?n.k(f):new i.a(u.generate(this.n.byteLength()));if(!((d=this._truncateToN(d,!0)).cmpn(1)<=0||d.cmp(c)>=0)){var h=this.g.mul(d);if(!h.isInfinity()){var l=h.getX(),p=l.umod(this.n);if(0!==p.cmpn(0)){var b=d.invm(this.n).mul(p.mul(t.getPrivate()).iadd(e));if(0!==(b=b.umod(this.n)).cmpn(0)){var m=(h.getY().isOdd()?1:0)|(0!==l.cmp(p)?2:0);return n.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),m^=1),new I({r:p,s:b,recoveryParam:m})}}}}}},U.prototype.verify=function(e,t,r,n){e=this._truncateToN(new i.a(e,16)),r=this.keyFromPublic(r,n);var o=(t=new I(t,"hex")).r,a=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,u=a.invm(this.n),c=u.mul(e).umod(this.n),f=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),f)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(c,r.getPublic(),f)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},U.prototype.recoverPubKey=function(e,t,r,n){q((3&r)===r,"The recovery param is more than two bits"),t=new I(t,n);var o=this.n,a=new i.a(e),s=t.r,u=t.s,c=1&r,f=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw new Error("Unable to find sencond key candinate");s=this.curve.pointFromX(f?s.add(this.curve.n):s,c);var d=t.r.invm(o),h=o.sub(a).mul(d).umod(o),l=u.mul(d).umod(o);return this.g.mulAdd(h,s,l)},U.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new I(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var H=s(function(e,t){var r=t;r.version="6.5.4",r.utils=d,r.rand=function(){throw new Error("unsupported")},r.curve=k,r.curves=x,r.ec=F,r.eddsa=null}).ec}).call(this,r(10))},function(e,t){e.exports=r("aUsF")},function(e,t,r){"use strict";const n=e=>null!==e&&"object"==typeof e&&"function"==typeof e.pipe;n.writable=e=>n(e)&&!1!==e.writable&&"function"==typeof e._write&&"object"==typeof e._writableState,n.readable=e=>n(e)&&!1!==e.readable&&"function"==typeof e._read&&"object"==typeof e._readableState,n.duplex=e=>n.writable(e)&&n.readable(e),n.transform=e=>n.duplex(e)&&"function"==typeof e._transform&&"object"==typeof e._transformState,e.exports=n},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createStreamMiddleware=t.createEngineStream=void 0;const i=n(r(360));t.createEngineStream=i.default;const o=n(r(365));t.createStreamMiddleware=o.default},function(e,t){e.exports=r("q1ed")},,,function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WindowPostMessageStream=void 0;const n=r(70);t.WindowPostMessageStream=class extends n.BasePostMessageStream{constructor({name:e,target:t,targetWindow:r}){if(!e||!t)throw new Error("Invalid input.");super(),this._name=e,this._target=t,this._targetOrigin=r?"*":location.origin,this._targetWindow=r||window,this._onMessage=this._onMessage.bind(this),window.addEventListener("message",this._onMessage,!1),this._handshake()}_postMessage(e){this._targetWindow.postMessage({target:this._target,data:e},this._targetOrigin)}_onMessage(e){const t=e.data;"*"!==this._targetOrigin&&e.origin!==this._targetOrigin||e.source!==this._targetWindow||"object"!=typeof t||t.target!==this._name||!t.data||this._onData(t.data)}_destroy(){window.removeEventListener("message",this._onMessage,!1)}}},function(e,t,r){(t=e.exports=r(106)).Stream=t,t.Readable=t,t.Writable=r(109),t.Duplex=r(41),t.Transform=r(110),t.PassThrough=r(205)},function(e,t,r){"use strict";t.byteLength=function(e){var t=c(e),r=t[1];return 3*(t[0]+r)/4-r},t.toByteArray=function(e){var t,r,n=c(e),a=n[0],s=n[1],u=new o(function(e,t,r){return 3*(t+r)/4-r}(0,a,s)),f=0,d=s>0?a-4:a;for(r=0;r<d;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],u[f++]=t>>16&255,u[f++]=t>>8&255,u[f++]=255&t;return 2===s&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[f++]=255&t),1===s&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[f++]=t>>8&255,u[f++]=255&t),u},t.fromByteArray=function(e){for(var t,r=e.length,i=r%3,o=[],a=0,s=r-i;a<s;a+=16383)o.push(f(e,a,a+16383>s?s:a+16383));return 1===i?o.push(n[(t=e[r-1])>>2]+n[t<<4&63]+"=="):2===i&&o.push(n[(t=(e[r-2]<<8)+e[r-1])>>10]+n[t>>4&63]+n[t<<2&63]+"="),o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s<u;++s)n[s]=a[s],i[a.charCodeAt(s)]=s;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function f(e,t,r){for(var i,o=[],a=t;a<r;a+=3)o.push(n[(i=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]))>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(e,t){t.read=function(e,t,r,n,i){var o,a,s=8*i-n-1,u=(1<<s)-1,c=u>>1,f=-7,d=r?i-1:0,h=r?-1:1,l=e[t+d];for(d+=h,o=l&(1<<-f)-1,l>>=-f,f+=s;f>0;o=256*o+e[t+d],d+=h,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+e[t+d],d+=h,f-=8);if(0===o)o=1-c;else{if(o===u)return a?NaN:1/0*(l?-1:1);a+=Math.pow(2,n),o-=c}return(l?-1:1)*a*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var a,s,u,c=8*o-i-1,f=(1<<c)-1,d=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:o-1,p=n?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-a))<1&&(a--,u*=2),(t+=a+d>=1?h/u:h*Math.pow(2,1-d))*u>=2&&(a++,u/=2),a+d>=f?(s=0,a=f):a+d>=1?(s=(t*u-1)*Math.pow(2,i),a+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),a=0));i>=8;e[r+l]=255&s,l+=p,s/=256,i-=8);for(a=a<<i|s,c+=i;c>0;e[r+l]=255&a,l+=p,a/=256,c-=8);e[r+l-p]|=128*b}},function(e,t){},function(e,t,r){"use strict";var n=r(71).Buffer;e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t=n.allocUnsafe(e>>>0),r=this.head,i=0;r;)r.data.copy(t,i),i+=r.data.length,r=r.next;return t},e}()},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var n,i,o,a,s,u=1,c={},f=!1,d=e.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(e);h=h&&h.setTimeout?h:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick(function(){p(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&p(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),n=function(t){e.postMessage(a+t,"*")}):e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){p(e.data)},n=function(e){o.port2.postMessage(e)}):d&&"onreadystatechange"in d.createElement("script")?(i=d.documentElement,n=function(e){var t=d.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):n=function(e){setTimeout(p,0,e)},h.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];var i={callback:e,args:t};return c[u]=i,n(u),u++},h.clearImmediate=l}function l(e){delete c[e]}function p(e){if(f)setTimeout(p,0,e);else{var t=c[e];if(t){f=!0;try{!function(e){var t=e.callback,r=e.args;switch(r.length){case 0:t();break;case 1:t(r[0]);break;case 2:t(r[0],r[1]);break;case 3:t(r[0],r[1],r[2]);break;default:t.apply(void 0,r)}}(t)}finally{l(e),f=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,r(10),r(9))},function(e,t,r){var n=r(11),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=a),o(i,a),a.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},function(e,t,r){"use strict";e.exports=o;var n=r(110),i=r(13);function o(e){if(!(this instanceof o))return new o(e);n.call(this,e)}i.inherits=r(3),i.inherits(o,n),o.prototype._transform=function(e,t,r){r(null,e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerPostMessageStream=void 0;const n=r(70),i=r(111);t.WorkerPostMessageStream=class extends n.BasePostMessageStream{constructor(){super(),this._name=i.DEDICATED_WORKER_NAME,self.onmessage=this._onMessage.bind(this),this._handshake()}_postMessage(e){self.postMessage({data:e})}_onMessage(e){const t=e.data;"object"==typeof t&&t.target===this._name&&t.data&&this._onData(t.data)}_destroy(){}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WorkerParentPostMessageStream=void 0;const n=r(70),i=r(111);t.WorkerParentPostMessageStream=class extends n.BasePostMessageStream{constructor({worker:e}){if(!e)throw new Error("Invalid input.");super(),this._target=i.DEDICATED_WORKER_NAME,this._worker=e,this._worker.onmessage=this._onMessage.bind(this),this._handshake()}_postMessage(e){this._worker.postMessage({target:this._target,data:e})}_onMessage(e){const t=e.data;"object"==typeof t&&t.data&&this._onData(t.data)}_destroy(){this._worker.onmessage=null,this._worker=null}}},function(e,t,r){"use strict";var n=r(29),i=r(209),o=r(127),a=r(33),s=r(129).subscription,u=r(21).formatters,c=r(21).errors,f=r(128),d=r(264),h=function e(t,r,o){var s=this,f=Array.prototype.slice.call(arguments);if(!(this instanceof e))throw new Error('Please use the "new" keyword to instantiate a web3.eth.Contract() object!');if(this.setProvider=function(){i.packageInit(s,arguments),s.clearSubscriptions=s._requestManager.clearSubscriptions},i.packageInit(this,[this.constructor]),this.clearSubscriptions=this._requestManager.clearSubscriptions,!t||!Array.isArray(t))throw c.ContractMissingABIError();this.options={};var h=f[f.length-1];n.isObject(h)&&!n.isArray(h)&&(this.options=n.extend(this.options,this._getOrSetDefaultOptions(o=h)),n.isObject(r)&&(r=null)),Object.defineProperty(this.options,"address",{set:function(e){e&&(s._address=a.toChecksumAddress(u.inputAddressFormatter(e)))},get:function(){return s._address},enumerable:!0}),Object.defineProperty(this.options,"jsonInterface",{set:function(e){return s.methods={},s.events={},s._jsonInterface=e.map(function(e){var t,r;if(e.constant="view"===e.stateMutability||"pure"===e.stateMutability||e.constant,e.payable="payable"===e.stateMutability||e.payable,e.name&&(r=a._jsonInterfaceMethodToString(e)),"function"===e.type){if(e.signature=d.encodeFunctionSignature(r),t=s._createTxObject.bind({method:e,parent:s}),s.methods[e.name]){var n=s._createTxObject.bind({method:e,parent:s,nextMethod:s.methods[e.name]});s.methods[e.name]=n}else s.methods[e.name]=t;s.methods[e.signature]=t,s.methods[r]=t}else if("event"===e.type){e.signature=d.encodeEventSignature(r);var i=s._on.bind(s,e.signature);s.events[e.name]&&"bound "!==s.events[e.name].name||(s.events[e.name]=i),s.events[e.signature]=i,s.events[r]=i}return e}),s.events.allEvents=s._on.bind(s,"allevents"),s._jsonInterface},get:function(){return s._jsonInterface},enumerable:!0});var l=this.constructor.defaultAccount,p=this.constructor.defaultBlock||"latest";Object.defineProperty(this,"handleRevert",{get:function(){return!1===s.options.handleRevert||!0===s.options.handleRevert?s.options.handleRevert:this.constructor.handleRevert},set:function(e){s.options.handleRevert=e},enumerable:!0}),Object.defineProperty(this,"defaultCommon",{get:function(){return s.options.common||this.constructor.defaultCommon},set:function(e){s.options.common=e},enumerable:!0}),Object.defineProperty(this,"defaultHardfork",{get:function(){return s.options.hardfork||this.constructor.defaultHardfork},set:function(e){s.options.hardfork=e},enumerable:!0}),Object.defineProperty(this,"defaultChain",{get:function(){return s.options.chain||this.constructor.defaultChain},set:function(e){s.options.chain=e},enumerable:!0}),Object.defineProperty(this,"transactionPollingTimeout",{get:function(){return 0===s.options.transactionPollingTimeout?s.options.transactionPollingTimeout:s.options.transactionPollingTimeout||this.constructor.transactionPollingTimeout},set:function(e){s.options.transactionPollingTimeout=e},enumerable:!0}),Object.defineProperty(this,"transactionConfirmationBlocks",{get:function(){return 0===s.options.transactionConfirmationBlocks?s.options.transactionConfirmationBlocks:s.options.transactionConfirmationBlocks||this.constructor.transactionConfirmationBlocks},set:function(e){s.options.transactionConfirmationBlocks=e},enumerable:!0}),Object.defineProperty(this,"transactionBlockTimeout",{get:function(){return 0===s.options.transactionBlockTimeout?s.options.transactionBlockTimeout:s.options.transactionBlockTimeout||this.constructor.transactionBlockTimeout},set:function(e){s.options.transactionBlockTimeout=e},enumerable:!0}),Object.defineProperty(this,"defaultAccount",{get:function(){return l},set:function(e){return e&&(l=a.toChecksumAddress(u.inputAddressFormatter(e))),e},enumerable:!0}),Object.defineProperty(this,"defaultBlock",{get:function(){return p},set:function(e){return p=e,e},enumerable:!0}),this.methods={},this.events={},this._address=null,this._jsonInterface=[],this.options.address=r,this.options.jsonInterface=t};h.setProvider=function(e,t){i.packageInit(this,[e]),this._ethAccounts=t},h.prototype._getCallback=function(e){if(e&&n.isFunction(e[e.length-1]))return e.pop()},h.prototype._checkListener=function(e,t){if(t===e)throw c.ContractReservedEventError(e)},h.prototype._getOrSetDefaultOptions=function(e){var t=e.gasPrice?String(e.gasPrice):null,r=e.from?a.toChecksumAddress(u.inputAddressFormatter(e.from)):null;return e.data=e.data||this.options.data,e.from=r||this.options.from,e.gasPrice=t||this.options.gasPrice,e.gas=e.gas||e.gasLimit||this.options.gas,delete e.gasLimit,e},h.prototype._encodeEventABI=function(e,t){var r=(t=t||{}).filter||{},i={};if(["fromBlock","toBlock"].filter(function(e){return void 0!==t[e]}).forEach(function(e){i[e]=u.inputBlockNumberFormatter(t[e])}),n.isArray(t.topics))i.topics=t.topics;else{if(i.topics=[],e&&!e.anonymous&&"ALLEVENTS"!==e.name&&i.topics.push(e.signature),"ALLEVENTS"!==e.name){var o=e.inputs.filter(function(e){return!0===e.indexed}).map(function(e){var t=r[e.name];return t?n.isArray(t)?t.map(function(t){return d.encodeParameter(e.type,t)}):d.encodeParameter(e.type,t):null});i.topics=i.topics.concat(o)}i.topics.length||delete i.topics}return this.options.address&&(i.address=this.options.address.toLowerCase()),i},h.prototype._decodeEventABI=function(e){var t=this;e.data=e.data||"",e.topics=e.topics||[];var r=u.outputLogFormatter(e);if("ALLEVENTS"===t.name&&(t=t.jsonInterface.find(function(t){return t.signature===e.topics[0]})||{anonymous:!0}),t.inputs=t.inputs||[],!t.anonymous){let r=0;t.inputs.forEach(e=>e.indexed?r++:null),r>0&&e.topics.length!==r+1&&(t={anonymous:!0,inputs:[]})}var n=t.anonymous?e.topics:e.topics.slice(1);return r.returnValues=d.decodeLog(t.inputs,e.data,n),delete r.returnValues.__length__,r.event=t.name,r.signature=t.anonymous||!e.topics[0]?null:e.topics[0],r.raw={data:r.data,topics:r.topics},delete r.data,delete r.topics,r},h.prototype._encodeMethodABI=function(){var e=this._method.signature,t=this.arguments||[],r=!1,i=this._parent.options.jsonInterface.filter(function(t){return"constructor"===e&&t.type===e||(t.signature===e||t.signature===e.replace("0x","")||t.name===e)&&"function"===t.type}).map(function(e){var i=n.isArray(e.inputs)?e.inputs.length:0;if(i!==t.length)throw new Error("The number of arguments is not matching the methods required number. You need to pass "+i+" arguments.");return"function"===e.type&&(r=e.signature),n.isArray(e.inputs)?e.inputs:[]}).map(function(e){return d.encodeParameters(e,t).replace("0x","")})[0]||"";if("constructor"===e){if(!this._deployData)throw new Error("The contract has no contract data option set. This is necessary to append the constructor parameters.");return this._deployData.startsWith("0x")||(this._deployData="0x"+this._deployData),this._deployData+i}var o=r?r+i:i;if(!o)throw new Error("Couldn't find a matching contract method named \""+this._method.name+'".');return o},h.prototype._decodeMethodReturn=function(e,t){if(!t)return null;t=t.length>=2?t.slice(2):t;var r=d.decodeParameters(e,t);return 1===r.__length__?r[0]:(delete r.__length__,r)},h.prototype.deploy=function(e,t){if((e=e||{}).arguments=e.arguments||[],!(e=this._getOrSetDefaultOptions(e)).data){if("function"==typeof t)return t(c.ContractMissingDeployDataError());throw c.ContractMissingDeployDataError()}var r=n.find(this.options.jsonInterface,function(e){return"constructor"===e.type})||{};return r.signature="constructor",this._createTxObject.apply({method:r,parent:this,deployData:e.data,_ethAccounts:this.constructor._ethAccounts},e.arguments)},h.prototype._generateEventOptions=function(){var e=Array.prototype.slice.call(arguments),t=this._getCallback(e),r=n.isObject(e[e.length-1])?e.pop():{},i=n.isString(e[0])?e[0]:"allevents",o="allevents"===i.toLowerCase()?{name:"ALLEVENTS",jsonInterface:this.options.jsonInterface}:this.options.jsonInterface.find(function(e){return"event"===e.type&&(e.name===i||e.signature==="0x"+i.replace("0x",""))});if(!o)throw c.ContractEventDoesNotExistError(i);if(!a.isAddress(this.options.address))throw c.ContractNoAddressDefinedError();return{params:this._encodeEventABI(o,r),event:o,callback:t}},h.prototype.clone=function(){return new this.constructor(this.options.jsonInterface,this.options.address,this.options)},h.prototype.once=function(e,t,r){var i=Array.prototype.slice.call(arguments);if(!(r=this._getCallback(i)))throw c.ContractOnceRequiresCallbackError();t&&delete t.fromBlock,this._on(e,t,function(e,t,i){i.unsubscribe(),n.isFunction(r)&&r(e,t,i)})},h.prototype._on=function(){var e=this._generateEventOptions.apply(this,arguments);e.params&&e.params.toBlock&&(delete e.params.toBlock,console.warn("Invalid option: toBlock. Use getPastEvents for specific range.")),this._checkListener("newListener",e.event.name),this._checkListener("removeListener",e.event.name);var t=new s({subscription:{params:1,inputFormatter:[u.inputLogFormatter],outputFormatter:this._decodeEventABI.bind(e.event),subscriptionHandler:function(e){this.emit(e.removed?"changed":"data",e),n.isFunction(this.callback)&&this.callback(null,e,this)}},type:"eth",requestManager:this._requestManager});return t.subscribe("logs",e.params,e.callback||function(){}),t},h.prototype.getPastEvents=function(){var e=this._generateEventOptions.apply(this,arguments),t=new o({name:"getPastLogs",call:"eth_getLogs",params:1,inputFormatter:[u.inputLogFormatter],outputFormatter:this._decodeEventABI.bind(e.event)});t.setRequestManager(this._requestManager);var r=t.buildCall();return t=null,r(e.params,e.callback)},h.prototype._createTxObject=function(){var e=Array.prototype.slice.call(arguments),t={};if("function"===this.method.type&&(t.call=this.parent._executeMethod.bind(t,"call"),t.call.request=this.parent._executeMethod.bind(t,"call",!0)),t.send=this.parent._executeMethod.bind(t,"send"),t.send.request=this.parent._executeMethod.bind(t,"send",!0),t.encodeABI=this.parent._encodeMethodABI.bind(t),t.estimateGas=this.parent._executeMethod.bind(t,"estimate"),e&&this.method.inputs&&e.length!==this.method.inputs.length){if(this.nextMethod)return this.nextMethod.apply(null,e);throw c.InvalidNumberOfParams(e.length,this.method.inputs.length,this.method.name)}return t.arguments=e||[],t._method=this.method,t._parent=this.parent,t._ethAccounts=this.parent.constructor._ethAccounts||this._ethAccounts,this.deployData&&(t._deployData=this.deployData),t},h.prototype._processExecuteArguments=function(e,t){var r={};if(r.type=e.shift(),r.callback=this._parent._getCallback(e),"call"===r.type&&!0!==e[e.length-1]&&(n.isString(e[e.length-1])||isFinite(e[e.length-1]))&&(r.defaultBlock=e.pop()),r.options=n.isObject(e[e.length-1])?e.pop():{},r.generateRequest=!0===e[e.length-1]&&e.pop(),r.options=this._parent._getOrSetDefaultOptions(r.options),r.options.data=this.encodeABI(),!this._deployData&&!a.isAddress(this._parent.options.address))throw c.ContractNoAddressDefinedError();return this._deployData||(r.options.to=this._parent.options.address),r.options.data?r:a._fireError(new Error("Couldn't find a matching contract method, or the number of parameters is wrong."),t.eventEmitter,t.reject,r.callback)},h.prototype._executeMethod=function(){var e=this,t=this._parent._processExecuteArguments.call(this,Array.prototype.slice.call(arguments),r),r=f("send"!==t.type),i=e.constructor._ethAccounts||e._ethAccounts;if(t.generateRequest){var s={params:[u.inputCallFormatter.call(this._parent,t.options)],callback:t.callback};return"call"===t.type?(s.params.push(u.inputDefaultBlockNumberFormatter.call(this._parent,t.defaultBlock)),s.method="eth_call",s.format=this._parent._decodeMethodReturn.bind(null,this._method.outputs)):s.method="eth_sendTransaction",s}switch(t.type){case"estimate":var h=new o({name:"estimateGas",call:"eth_estimateGas",params:1,inputFormatter:[u.inputCallFormatter],outputFormatter:a.hexToNumber,requestManager:e._parent._requestManager,accounts:i,defaultAccount:e._parent.defaultAccount,defaultBlock:e._parent.defaultBlock}).createFunction();return h(t.options,t.callback);case"call":var l=new o({name:"call",call:"eth_call",params:2,inputFormatter:[u.inputCallFormatter,u.inputDefaultBlockNumberFormatter],outputFormatter:function(t){return e._parent._decodeMethodReturn(e._method.outputs,t)},requestManager:e._parent._requestManager,accounts:i,defaultAccount:e._parent.defaultAccount,defaultBlock:e._parent.defaultBlock,handleRevert:e._parent.handleRevert,abiCoder:d}).createFunction();return l(t.options,t.defaultBlock,t.callback);case"send":if(!a.isAddress(t.options.from))return a._fireError(c.ContractNoFromAddressDefinedError(),r.eventEmitter,r.reject,t.callback);if(n.isBoolean(this._method.payable)&&!this._method.payable&&t.options.value&&t.options.value>0)return a._fireError(new Error("Can not send value to non-payable contract method or constructor"),r.eventEmitter,r.reject,t.callback);var p={receiptFormatter:function(t){if(n.isArray(t.logs)){var r=n.map(t.logs,function(t){return e._parent._decodeEventABI.call({name:"ALLEVENTS",jsonInterface:e._parent.options.jsonInterface},t)});t.events={};var i=0;r.forEach(function(e){e.event?t.events[e.event]?Array.isArray(t.events[e.event])?t.events[e.event].push(e):t.events[e.event]=[t.events[e.event],e]:t.events[e.event]=e:(t.events[i]=e,i++)}),delete t.logs}return t},contractDeployFormatter:function(t){var r=e._parent.clone();return r.options.address=t.contractAddress,r}},b=new o({name:"sendTransaction",call:"eth_sendTransaction",params:1,inputFormatter:[u.inputTransactionFormatter],requestManager:e._parent._requestManager,accounts:e.constructor._ethAccounts||e._ethAccounts,defaultAccount:e._parent.defaultAccount,defaultBlock:e._parent.defaultBlock,transactionBlockTimeout:e._parent.transactionBlockTimeout,transactionConfirmationBlocks:e._parent.transactionConfirmationBlocks,transactionPollingTimeout:e._parent.transactionPollingTimeout,defaultCommon:e._parent.defaultCommon,defaultChain:e._parent.defaultChain,defaultHardfork:e._parent.defaultHardfork,handleRevert:e._parent.handleRevert,extraFormatters:p,abiCoder:d}).createFunction();return b(t.options,t.callback);default:throw new Error('Method "'+t.type+'" not implemented.')}},e.exports=h},function(e,t,r){const n=r(210),i=r(256);e.exports={packageInit:(e,t)=>{if(t=Array.prototype.slice.call(t),!e)throw new Error('You need to instantiate using the "new" keyword.');Object.defineProperty(e,"currentProvider",{get:()=>e._provider,set:t=>e.setProvider(t),enumerable:!0,configurable:!0}),e._requestManager=t[0]&&t[0]._requestManager?t[0]._requestManager:new n.Manager(t[0],t[1]),e.givenProvider=n.Manager.givenProvider,e.providers=n.Manager.providers,e._provider=e._requestManager.provider,e.setProvider||(e.setProvider=(t,r)=>(e._requestManager.setProvider(t,r),e._provider=e._requestManager.provider,!0)),e.setRequestManager=t=>{e._requestManager=t,e._provider=t.provider},e.BatchRequest=n.BatchManager.bind(null,e._requestManager),e.extend=i(e)},addProviders:e=>{e.givenProvider=n.Manager.givenProvider,e.providers=n.Manager.providers}}},function(e,t,r){"use strict";const{callbackify:n}=r(112);var i=r(29),o=r(21).errors,a=r(116),s=r(226),u=r(227),c=function e(t,r){this.provider=null,this.providers=e.providers,this.setProvider(t,r),this.subscriptions=new Map};c.givenProvider=u,c.providers={WebsocketProvider:r(228),HttpProvider:r(239),IpcProvider:r(254)},c.prototype.setProvider=function(e,t){var r=this;if(e&&"string"==typeof e&&this.providers)if(/^http(s)?:\/\//i.test(e))e=new this.providers.HttpProvider(e);else if(/^ws(s)?:\/\//i.test(e))e=new this.providers.WebsocketProvider(e);else if(e&&"object"==typeof t&&"function"==typeof t.connect)e=new this.providers.IpcProvider(e,t);else if(e)throw new Error("Can't autodetect provider for \""+e+'"');if(this.provider&&this.provider.connected&&this.clearSubscriptions(),this.provider=e||null,this.provider&&this.provider.on){"function"==typeof e.request?this.provider.on("message",function(e){if(e&&"eth_subscription"===e.type&&e.data){const t=e.data;t.subscription&&r.subscriptions.has(t.subscription)&&r.subscriptions.get(t.subscription).callback(null,t.result)}}):this.provider.on("data",function(e,t){(e=e||t).method&&e.params&&e.params.subscription&&r.subscriptions.has(e.params.subscription)&&r.subscriptions.get(e.params.subscription).callback(null,e.params.result)}),this.provider.on("connect",function(){r.subscriptions.forEach(function(e){e.subscription.resubscribe()})}),this.provider.on("error",function(e){r.subscriptions.forEach(function(t){t.callback(e)})});const t=function(e){r._isCleanCloseEvent(e)&&!r._isIpcCloseError(e)||(r.subscriptions.forEach(function(t){t.callback(o.ConnectionCloseError(e)),r.subscriptions.delete(t.subscription.id)}),r.provider&&r.provider.emit&&r.provider.emit("error",o.ConnectionCloseError(e))),r.provider&&r.provider.emit&&r.provider.emit("end",e)};this.provider.on("close",t),this.provider.on("disconnect",t)}},c.prototype.send=function(e,t){if(t=t||function(){},!this.provider)return t(o.InvalidProvider());const{method:r,params:i}=e,s=a.toPayload(r,i),u=this._jsonrpcResultCallback(t,s);if(this.provider.request)n(this.provider.request.bind(this.provider))({method:r,params:i},t);else if(this.provider.sendAsync)this.provider.sendAsync(s,u);else{if(!this.provider.send)throw new Error("Provider does not have a request or send method to use.");this.provider.send(s,u)}},c.prototype.sendBatch=function(e,t){if(!this.provider)return t(o.InvalidProvider());var r=a.toBatchPayload(e);this.provider[this.provider.sendAsync?"sendAsync":"send"](r,function(e,r){return e?t(e):i.isArray(r)?void t(null,r):t(o.InvalidResponse(r))})},c.prototype.addSubscription=function(e,t){if(!this.provider.on)throw new Error("The provider doesn't support subscriptions: "+this.provider.constructor.name);this.subscriptions.set(e.id,{callback:t,subscription:e})},c.prototype.removeSubscription=function(e,t){if(this.subscriptions.has(e)){var r=this.subscriptions.get(e).subscription.options.type;return this.subscriptions.delete(e),void this.send({method:r+"_unsubscribe",params:[e]},t)}"function"==typeof t&&t(null)},c.prototype.clearSubscriptions=function(e){try{var t=this;return this.subscriptions.size>0&&this.subscriptions.forEach(function(r,n){e&&"syncing"===r.name||t.removeSubscription(n)}),this.provider.reset&&this.provider.reset(),!0}catch(e){throw new Error("Error while clearing subscriptions: "+e)}},c.prototype._isCleanCloseEvent=function(e){return"object"==typeof e&&([1e3].includes(e.code)||!0===e.wasClean)},c.prototype._isIpcCloseError=function(e){return"boolean"==typeof e&&e},c.prototype._jsonrpcResultCallback=function(e,t){return function(r,n){return n&&n.id&&t.id!==n.id?e(new Error(`Wrong response id ${n.id} (expected: ${t.id}) in ${JSON.stringify(t)}`)):r?e(r):n&&n.error?e(o.ErrorResponse(n)):a.isValidResponse(n)?void e(null,n.result):e(o.InvalidResponse(n))}},e.exports={Manager:c,BatchManager:s}},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){e.exports="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t,r){"use strict";e.exports={ErrorResponse:function(e){var t=e&&e.error&&e.error.message?e.error.message:JSON.stringify(e),r=e.error&&e.error.data?e.error.data:null,n=new Error("Returned error: "+t);return n.data=r,n},InvalidNumberOfParams:function(e,t,r){return new Error('Invalid number of parameters for "'+r+'". Got '+e+" expected "+t+"!")},InvalidConnection:function(e,t){return this.ConnectionError("CONNECTION ERROR: Couldn't connect to node "+e+".",t)},InvalidProvider:function(){return new Error("Provider not set or invalid")},InvalidResponse:function(e){var t=e&&e.error&&e.error.message?e.error.message:"Invalid JSON RPC response: "+JSON.stringify(e);return new Error(t)},ConnectionTimeout:function(e){return new Error("CONNECTION TIMEOUT: timeout of "+e+" ms achived")},ConnectionNotOpenError:function(e){return this.ConnectionError("connection not open on send()",e)},ConnectionCloseError:function(e){return"object"==typeof e&&e.code&&e.reason?this.ConnectionError("CONNECTION ERROR: The connection got closed with the close code `"+e.code+"` and the following reason string `"+e.reason+"`",e):new Error("CONNECTION ERROR: The connection closed unexpectedly")},MaxAttemptsReachedOnReconnectingError:function(){return new Error("Maximum number of reconnect attempts reached!")},PendingRequestsOnReconnectingError:function(){return new Error("CONNECTION ERROR: Provider started to reconnect before the response got received!")},ConnectionError:function(e,t){const r=new Error(e);return t&&(r.code=t.code,r.reason=t.reason),r},RevertInstructionError:function(e,t){var r=new Error("Your request got reverted with the following reason string: "+e);return r.reason=e,r.signature=t,r},TransactionRevertInstructionError:function(e,t,r){var n=new Error("Transaction has been reverted by the EVM:\n"+JSON.stringify(r,null,2));return n.reason=e,n.signature=t,n.receipt=r,n},TransactionError:function(e,t){var r=new Error(e);return r.receipt=t,r},NoContractAddressFoundError:function(e){return this.TransactionError("The transaction receipt didn't contain a contract address.",e)},ContractCodeNotStoredError:function(e){return this.TransactionError("The contract code couldn't be stored, please check your gas limit.",e)},TransactionRevertedWithoutReasonError:function(e){return this.TransactionError("Transaction has been reverted by the EVM:\n"+JSON.stringify(e,null,2),e)},TransactionOutOfGasError:function(e){return this.TransactionError("Transaction ran out of gas. Please provide more gas:\n"+JSON.stringify(e,null,2),e)},ResolverMethodMissingError:function(e,t){return new Error("The resolver at "+e+'does not implement requested method: "'+t+'".')},ContractMissingABIError:function(){return new Error("You must provide the json interface of the contract when instantiating a contract object.")},ContractOnceRequiresCallbackError:function(){return new Error("Once requires a callback as the second parameter.")},ContractEventDoesNotExistError:function(e){return new Error('Event "'+e+"\" doesn't exist in this contract.")},ContractReservedEventError:function(e){return new Error('The event "'+e+"\" is a reserved event name, you can't use it.")},ContractMissingDeployDataError:function(){return new Error('No "data" specified in neither the given options, nor the default options.')},ContractNoAddressDefinedError:function(){return new Error("This contract object doesn't have address set yet, please set an address first.")},ContractNoFromAddressDefinedError:function(){return new Error('No "from" address specified in neither the given options, nor the default options.')}}},function(e,t,r){"use strict";var n=r(29),i=r(33),o=r(225),a=function(e){return i.toBN(e).toString(10)},s=function(e){if(void 0!==e)return function(e){return"latest"===e||"pending"===e||"earliest"===e}(e)?e:"genesis"===e?"0x0":i.isHexStrict(e)?n.isString(e)?e.toLowerCase():e:i.numberToHex(e)},u=function(e){if(e.to&&(e.to=d(e.to)),e.data&&e.input)throw new Error('You can\'t have "data" and "input" as properties of transactions at the same time, please use either "data" or "input" instead.');if(!e.data&&e.input&&(e.data=e.input,delete e.input),e.data&&!e.data.startsWith("0x")&&(e.data="0x"+e.data),e.data&&!i.isHex(e.data))throw new Error("The data field must be HEX encoded data.");return(e.gas||e.gasLimit)&&(e.gas=e.gas||e.gasLimit),["gasPrice","gas","value","nonce"].filter(function(t){return void 0!==e[t]}).forEach(function(t){e[t]=i.numberToHex(e[t])}),e},c=function(e){return null!==e.blockNumber&&(e.blockNumber=i.hexToNumber(e.blockNumber)),null!==e.transactionIndex&&(e.transactionIndex=i.hexToNumber(e.transactionIndex)),e.nonce=i.hexToNumber(e.nonce),e.gas=i.hexToNumber(e.gas),e.gasPrice=a(e.gasPrice),e.value=a(e.value),e.to=e.to&&i.isAddress(e.to)?i.toChecksumAddress(e.to):null,e.from&&(e.from=i.toChecksumAddress(e.from)),e},f=function(e){if("string"==typeof e.blockHash&&"string"==typeof e.transactionHash&&"string"==typeof e.logIndex){var t=i.sha3(e.blockHash.replace("0x","")+e.transactionHash.replace("0x","")+e.logIndex.replace("0x",""));e.id="log_"+t.replace("0x","").substr(0,8)}else e.id||(e.id=null);return null!==e.blockNumber&&(e.blockNumber=i.hexToNumber(e.blockNumber)),null!==e.transactionIndex&&(e.transactionIndex=i.hexToNumber(e.transactionIndex)),null!==e.logIndex&&(e.logIndex=i.hexToNumber(e.logIndex)),e.address&&(e.address=i.toChecksumAddress(e.address)),e},d=function(e){var t=new o(e);if(t.isValid()&&t.isDirect())return t.toAddress().toLowerCase();if(i.isAddress(e))return"0x"+e.toLowerCase().replace("0x","");throw new Error(`Provided address ${e} is invalid, the capitalization checksum test failed, or it's an indirect IBAN address which can't be converted.`)};e.exports={inputDefaultBlockNumberFormatter:function(e){return s(this&&null==e?this.defaultBlock:e)},inputBlockNumberFormatter:s,inputCallFormatter:function(e){var t=(e=u(e)).from||(this?this.defaultAccount:null);return t&&(e.from=d(t)),e},inputTransactionFormatter:function(e){if(e=u(e),!n.isNumber(e.from)&&!n.isObject(e.from)){if(e.from=e.from||(this?this.defaultAccount:null),!e.from&&!n.isNumber(e.from))throw new Error('The send transactions "from" field must be defined!');e.from=d(e.from)}return e},inputAddressFormatter:d,inputPostFormatter:function(e){return e.ttl&&(e.ttl=i.numberToHex(e.ttl)),e.workToProve&&(e.workToProve=i.numberToHex(e.workToProve)),e.priority&&(e.priority=i.numberToHex(e.priority)),n.isArray(e.topics)||(e.topics=e.topics?[e.topics]:[]),e.topics=e.topics.map(function(e){return 0===e.indexOf("0x")?e:i.fromUtf8(e)}),e},inputLogFormatter:function(e){var t=function(e){return null==e?null:0===(e=String(e)).indexOf("0x")?e:i.fromUtf8(e)};return void 0===e&&(e={}),void 0===e.fromBlock&&(e={...e,fromBlock:"latest"}),(e.fromBlock||0===e.fromBlock)&&(e.fromBlock=s(e.fromBlock)),(e.toBlock||0===e.toBlock)&&(e.toBlock=s(e.toBlock)),e.topics=e.topics||[],e.topics=e.topics.map(function(e){return n.isArray(e)?e.map(t):t(e)}),t=null,e.address&&(e.address=n.isArray(e.address)?e.address.map(function(e){return d(e)}):d(e.address)),e},inputSignFormatter:function(e){return i.isHexStrict(e)?e:i.utf8ToHex(e)},inputStorageKeysFormatter:function(e){return e.map(i.numberToHex)},outputProofFormatter:function(e){return e.address=i.toChecksumAddress(e.address),e.nonce=i.hexToNumberString(e.nonce),e.balance=i.hexToNumberString(e.balance),e},outputBigNumberFormatter:a,outputTransactionFormatter:c,outputTransactionReceiptFormatter:function(e){if("object"!=typeof e)throw new Error("Received receipt is invalid: "+e);return null!==e.blockNumber&&(e.blockNumber=i.hexToNumber(e.blockNumber)),null!==e.transactionIndex&&(e.transactionIndex=i.hexToNumber(e.transactionIndex)),e.cumulativeGasUsed=i.hexToNumber(e.cumulativeGasUsed),e.gasUsed=i.hexToNumber(e.gasUsed),n.isArray(e.logs)&&(e.logs=e.logs.map(f)),e.contractAddress&&(e.contractAddress=i.toChecksumAddress(e.contractAddress)),null!=e.status&&(e.status=Boolean(parseInt(e.status))),e},outputBlockFormatter:function(e){return e.gasLimit=i.hexToNumber(e.gasLimit),e.gasUsed=i.hexToNumber(e.gasUsed),e.size=i.hexToNumber(e.size),e.timestamp=i.hexToNumber(e.timestamp),null!==e.number&&(e.number=i.hexToNumber(e.number)),e.difficulty&&(e.difficulty=a(e.difficulty)),e.totalDifficulty&&(e.totalDifficulty=a(e.totalDifficulty)),n.isArray(e.transactions)&&e.transactions.forEach(function(e){if(!n.isString(e))return c(e)}),e.miner&&(e.miner=i.toChecksumAddress(e.miner)),e},outputLogFormatter:f,outputPostFormatter:function(e){return e.expiry=i.hexToNumber(e.expiry),e.sent=i.hexToNumber(e.sent),e.ttl=i.hexToNumber(e.ttl),e.workProved=i.hexToNumber(e.workProved),e.topics||(e.topics=[]),e.topics=e.topics.map(function(e){return i.toUtf8(e)}),e},outputSyncingFormatter:function(e){return e.startingBlock=i.hexToNumber(e.startingBlock),e.currentBlock=i.hexToNumber(e.currentBlock),e.highestBlock=i.hexToNumber(e.highestBlock),e.knownStates&&(e.knownStates=i.hexToNumber(e.knownStates),e.pulledStates=i.hexToNumber(e.pulledStates)),e}}},function(e,t,r){"use strict";var n=r(1),i=r(114),o=new n(0),a=new n(-1),s={noether:"0",wei:"1",kwei:"1000",Kwei:"1000",babbage:"1000",femtoether:"1000",mwei:"1000000",Mwei:"1000000",lovelace:"1000000",picoether:"1000000",gwei:"1000000000",Gwei:"1000000000",shannon:"1000000000",nanoether:"1000000000",nano:"1000000000",szabo:"1000000000000",microether:"1000000000000",micro:"1000000000000",finney:"1000000000000000",milliether:"1000000000000000",milli:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"};function u(e){var t=e?e.toLowerCase():"ether",r=s[t];if("string"!=typeof r)throw new Error("[ethjs-unit] the unit provided "+e+" doesn't exists, please use the one of the following units "+JSON.stringify(s,null,2));return new n(r,10)}function c(e){if("string"==typeof e){if(!e.match(/^-?[0-9.]+$/))throw new Error("while converting number to string, invalid number value '"+e+"', should be a number matching (^-?[0-9.]+).");return e}if("number"==typeof e)return String(e);if("object"==typeof e&&e.toString&&(e.toTwos||e.dividedToIntegerBy))return e.toPrecision?String(e.toPrecision()):e.toString(10);throw new Error("while converting number to string, invalid number value '"+e+"' type "+typeof e+".")}e.exports={unitMap:s,numberToString:c,getValueOfUnit:u,fromWei:function(e,t,r){var n=i(e),c=n.lt(o),f=u(t),d=s[t].length-1||1,h=r||{};c&&(n=n.mul(a));for(var l=n.mod(f).toString(10);l.length<d;)l="0"+l;h.pad||(l=l.match(/^([0-9]*[1-9]|0)(0*)/)[1]);var p=n.div(f).toString(10);h.commify&&(p=p.replace(/\B(?=(\d{3})+(?!\d))/g,","));var b=p+("0"==l?"":"."+l);return c&&(b="-"+b),b},toWei:function(e,t){var r=c(e),i=u(t),o=s[t].length-1||1,f="-"===r.substring(0,1);if(f&&(r=r.substring(1)),"."===r)throw new Error("[ethjs-unit] while converting number "+e+" to wei, invalid value");var d=r.split(".");if(d.length>2)throw new Error("[ethjs-unit] while converting number "+e+" to wei, too many decimal points");var h=d[0],l=d[1];if(h||(h="0"),l||(l="0"),l.length>o)throw new Error("[ethjs-unit] while converting number "+e+" to wei, too many decimal places");for(;l.length<o;)l+="0";h=new n(h),l=new n(l);var p=h.mul(i).add(l);return f&&(p=p.mul(a)),new n(p.toString(10),10)}}},function(e,t){},function(e,t,r){var n=r(218);e.exports=function(e){return"string"!=typeof e?e:n(e)?e.slice(2):e}},function(e,t){e.exports=function(e){if("string"!=typeof e)throw new Error("[is-hex-prefixed] value must be type 'string', is currently type "+typeof e+", while checking isHexPrefixed.");return"0x"===e.slice(0,2)}},function(e,t,r){!function(e){var t,r,n,i=String.fromCharCode;function o(e){for(var t,r,n=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function a(e){if(e>=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}function s(e,t){return i(e>>t&63|128)}function u(e){if(0==(4294967168&e))return i(e);var t="";return 0==(4294965248&e)?t=i(e>>6&31|192):0==(4294901760&e)?(a(e),t=i(e>>12&15|224),t+=s(e,6)):0==(4292870144&e)&&(t=i(e>>18&7|240),t+=s(e,12),t+=s(e,6)),t+i(63&e|128)}function c(){if(n>=r)throw Error("Invalid byte index");var e=255&t[n];if(n++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function f(){var e,i;if(n>r)throw Error("Invalid byte index");if(n==r)return!1;if(e=255&t[n],n++,0==(128&e))return e;if(192==(224&e)){if((i=(31&e)<<6|c())>=128)return i;throw Error("Invalid continuation byte")}if(224==(240&e)){if((i=(15&e)<<12|c()<<6|c())>=2048)return a(i),i;throw Error("Invalid continuation byte")}if(240==(248&e)&&(i=(7&e)<<18|c()<<12|c()<<6|c())>=65536&&i<=1114111)return i;throw Error("Invalid UTF-8 detected")}e.version="3.0.0",e.encode=function(e){for(var t=o(e),r=t.length,n=-1,i="";++n<r;)i+=u(t[n]);return i},e.decode=function(e){t=o(e),r=t.length,n=0;for(var a,s=[];!1!==(a=f());)s.push(a);return function(e){for(var t,r=e.length,n=-1,o="";++n<r;)(t=e[n])>65535&&(o+=i((t-=65536)>>>10&1023|55296),t=56320|1023&t),o+=i(t);return o}(s)}}(t)},function(e,t){const r="0123456789abcdef".split(""),n=[1,256,65536,16777216],i=[0,8,16,24],o=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],a=e=>{var t,r,n,i,a,s,u,c,f,d,h,l,p,b,m,g,y,v,w,_,S,E,k,x,A,O,M,j,R,P,T,I,C,B,N,L,D,q,U,F,H,z,W,K,V,J,G,X,Y,$,Z,Q,ee,te,re,ne,ie,oe,ae,se,ue,ce,fe;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],a=e[1]^e[11]^e[21]^e[31]^e[41],c=e[4]^e[14]^e[24]^e[34]^e[44],f=e[5]^e[15]^e[25]^e[35]^e[45],d=e[6]^e[16]^e[26]^e[36]^e[46],h=e[7]^e[17]^e[27]^e[37]^e[47],t=(l=e[8]^e[18]^e[28]^e[38]^e[48])^((s=e[2]^e[12]^e[22]^e[32]^e[42])<<1|(u=e[3]^e[13]^e[23]^e[33]^e[43])>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(u<<1|s>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,r=a^(f<<1|c>>>31),e[2]^=t=i^(c<<1|f>>>31),e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,r=u^(h<<1|d>>>31),e[4]^=t=s^(d<<1|h>>>31),e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,r=f^(p<<1|l>>>31),e[6]^=t=c^(l<<1|p>>>31),e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,r=h^(a<<1|i>>>31),e[8]^=t=d^(i<<1|a>>>31),e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,m=e[1],J=e[11]<<4|e[10]>>>28,G=e[10]<<4|e[11]>>>28,j=e[20]<<3|e[21]>>>29,R=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,z=e[40]<<18|e[41]>>>14,W=e[41]<<18|e[40]>>>14,B=e[2]<<1|e[3]>>>31,N=e[3]<<1|e[2]>>>31,y=e[12]<<12|e[13]>>>20,X=e[22]<<10|e[23]>>>22,Y=e[23]<<10|e[22]>>>22,P=e[33]<<13|e[32]>>>19,T=e[32]<<13|e[33]>>>19,ce=e[42]<<2|e[43]>>>30,fe=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,L=e[14]<<6|e[15]>>>26,D=e[15]<<6|e[14]>>>26,w=e[24]<<11|e[25]>>>21,$=e[34]<<15|e[35]>>>17,Z=e[35]<<15|e[34]>>>17,I=e[45]<<29|e[44]>>>3,C=e[44]<<29|e[45]>>>3,x=e[6]<<28|e[7]>>>4,A=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,q=e[26]<<25|e[27]>>>7,U=e[27]<<25|e[26]>>>7,_=e[36]<<21|e[37]>>>11,S=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,K=e[8]<<27|e[9]>>>5,V=e[9]<<27|e[8]>>>5,O=e[18]<<20|e[19]>>>12,M=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,F=e[38]<<8|e[39]>>>24,H=e[39]<<8|e[38]>>>24,E=e[48]<<14|e[49]>>>18,k=e[49]<<14|e[48]>>>18,e[0]=(b=e[0])^~(g=e[13]<<12|e[12]>>>20)&(v=e[25]<<11|e[24]>>>21),e[1]=m^~y&w,e[10]=x^~O&j,e[11]=A^~M&R,e[20]=B^~L&q,e[21]=N^~D&U,e[30]=K^~J&X,e[31]=V^~G&Y,e[40]=te^~ne&oe,e[41]=re^~ie&ae,e[2]=g^~v&_,e[3]=y^~w&S,e[12]=O^~j&P,e[13]=M^~R&T,e[22]=L^~q&F,e[23]=D^~U&H,e[32]=J^~X&$,e[33]=G^~Y&Z,e[42]=ne^~oe&se,e[43]=ie^~ae&ue,e[4]=v^~_&E,e[5]=w^~S&k,e[14]=j^~P&I,e[15]=R^~T&C,e[24]=q^~F&z,e[25]=U^~H&W,e[34]=X^~$&Q,e[35]=Y^~Z&ee,e[44]=oe^~se&ce,e[45]=ae^~ue&fe,e[6]=_^~E&b,e[7]=S^~k&m,e[16]=P^~I&x,e[17]=T^~C&A,e[26]=F^~z&B,e[27]=H^~W&N,e[36]=$^~Q&K,e[37]=Z^~ee&V,e[46]=se^~ce&te,e[47]=ue^~fe&re,e[8]=E^~b&g,e[9]=k^~m&y,e[18]=I^~x&O,e[19]=C^~A&M,e[28]=z^~B&L,e[29]=W^~N&D,e[38]=Q^~K&J,e[39]=ee^~V&G,e[48]=ce^~te&ne,e[49]=fe^~re&ie,e[0]^=o[n],e[1]^=o[n+1]},s=e=>t=>{var o;if("0x"===t.slice(0,2)){o=[];for(var s=2,u=t.length;s<u;s+=2)o.push(parseInt(t.slice(s,s+2),16))}else o=t;return((e,t)=>{for(var o,s=t.length,u=e.blocks,c=e.blockCount<<2,f=e.blockCount,d=e.outputBlocks,h=e.s,l=0;l<s;){if(e.reset)for(e.reset=!1,u[0]=e.block,m=1;m<f+1;++m)u[m]=0;if("string"!=typeof t)for(m=e.start;l<s&&m<c;++l)u[m>>2]|=t[l]<<i[3&m++];else for(m=e.start;l<s&&m<c;++l)(o=t.charCodeAt(l))<128?u[m>>2]|=o<<i[3&m++]:o<2048?(u[m>>2]|=(192|o>>6)<<i[3&m++],u[m>>2]|=(128|63&o)<<i[3&m++]):o<55296||o>=57344?(u[m>>2]|=(224|o>>12)<<i[3&m++],u[m>>2]|=(128|o>>6&63)<<i[3&m++],u[m>>2]|=(128|63&o)<<i[3&m++]):(o=65536+((1023&o)<<10|1023&t.charCodeAt(++l)),u[m>>2]|=(240|o>>18)<<i[3&m++],u[m>>2]|=(128|o>>12&63)<<i[3&m++],u[m>>2]|=(128|o>>6&63)<<i[3&m++],u[m>>2]|=(128|63&o)<<i[3&m++]);if(e.lastByteIndex=m,m>=c){for(e.start=m-c,e.block=u[f],m=0;m<f;++m)h[m]^=u[m];a(h),e.reset=!0}else e.start=m}if(u[(m=e.lastByteIndex)>>2]|=n[3&m],e.lastByteIndex===c)for(u[0]=u[f],m=1;m<f+1;++m)u[m]=0;for(u[f-1]|=2147483648,m=0;m<f;++m)h[m]^=u[m];a(h);for(var p,b="",m=0,g=0;g<d;){for(m=0;m<f&&g<d;++m,++g)b+=r[(p=h[m])>>4&15]+r[15&p]+r[p>>12&15]+r[p>>8&15]+r[p>>20&15]+r[p>>16&15]+r[p>>28&15]+r[p>>24&15];g%f==0&&(a(h),m=0)}return"0x"+b})((e=>{return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(e<<1)>>5,outputBlocks:e>>5,s:(t=[0,0,0,0,0,0,0,0,0,0],[].concat(t,t,t,t,t))};var t})(e),o)};e.exports={keccak256:s(256),keccak512:s(512),keccak256s:s(256),keccak512s:s(512)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(222);function i(e){return!("string"!=typeof e||!/^(0x)?[0-9a-f]{512}$/i.test(e)||!/^(0x)?[0-9a-f]{512}$/.test(e)&&!/^(0x)?[0-9A-F]{512}$/.test(e))}function o(e,t){"object"==typeof t&&t.constructor===Uint8Array&&(t=n.bytesToHex(t));const r=n.keccak256(t).replace("0x","");for(let n=0;n<12;n+=4){const t=(parseInt(r.substr(n,2),16)<<8)+parseInt(r.substr(n+2,2),16)&2047,i=1<<t%4;if((a(e.charCodeAt(e.length-1-Math.floor(t/4)))&i)!==i)return!1}return!0}function a(e){if(e>=48&&e<=57)return e-48;if(e>=65&&e<=70)return e-55;if(e>=97&&e<=102)return e-87;throw new Error("invalid bloom")}function s(e){return!("string"!=typeof e||!/^(0x)?[0-9a-f]{64}$/i.test(e)||!/^(0x)?[0-9a-f]{64}$/.test(e)&&!/^(0x)?[0-9A-F]{64}$/.test(e))}function u(e){return!("string"!=typeof e||!e.match(/^(0x)?[0-9a-fA-F]{40}$/)&&!e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/))}t.isBloom=i,t.isInBloom=o,t.isUserEthereumAddressInBloom=function(e,t){if(!i(e))throw new Error("Invalid bloom given");if(!u(t))throw new Error(`Invalid ethereum address given: "${t}"`);return o(e,n.padLeft(t,64))},t.isContractAddressInBloom=function(e,t){if(!i(e))throw new Error("Invalid bloom given");if(!u(t))throw new Error(`Invalid contract address given: "${t}"`);return o(e,t)},t.isTopicInBloom=function(e,t){if(!i(e))throw new Error("Invalid bloom given");if(!s(t))throw new Error("Invalid topic");return o(e,t)},t.isTopic=s,t.isAddress=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(99);function i(e){if(null==e)throw new Error("cannot convert null value to array");if("string"==typeof e){const t=e.match(/^(0x)?[0-9a-fA-F]*$/);if(!t)throw new Error("invalid hexidecimal string");if("0x"!==t[1])throw new Error("hex string must have 0x prefix");(e=e.substring(2)).length%2&&(e="0"+e);const r=[];for(let n=0;n<e.length;n+=2)r.push(parseInt(e.substr(n,2),16));return o(new Uint8Array(r))}if(function(e){if(!e||parseInt(String(e.length))!=e.length||"string"==typeof e)return!1;for(let t=0;t<e.length;t++){const r=e[t];if(r<0||r>=256||parseInt(String(r))!=r)return!1}return!0}(e))return o(new Uint8Array(e));throw new Error("invalid arrayify value")}function o(e){return void 0!==e.slice||(e.slice=()=>{const t=Array.prototype.slice.call(arguments);return o(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}t.keccak256=function(e){return"0x"+n.keccak_256(i(e))},t.padLeft=(e,t)=>{const r=/^0x/i.test(e)||"number"==typeof e,n=t-(e=e.toString().replace(/^0x/i,"")).length+1>=0?t-e.length+1:0;return(r?"0x":"")+new Array(n).join("0")+e},t.bytesToHex=function(e){const t=[];for(let r=0;r<e.length;r++)t.push((e[r]>>>4).toString(16)),t.push((15&e[r]).toString(16));return"0x"+t.join("").replace(/^0+/,"")},t.toByteArray=i},function(e,t){(function(t){e.exports=t}).call(this,{})},function(e,t,r){var n=r(29),i=r(1),o=r(115),a=function(e){var t=typeof e;if("string"===t)return o.isHexStrict(e)?new i(e.replace(/0x/i,""),16):new i(e,10);if("number"===t)return new i(e);if(o.isBigNumber(e))return new i(e.toString(10));if(o.isBN(e))return e;throw new Error(e+" is not a number")},s=function(e,t,r){var n,s,u;if("bytes"===(e=(u=e).startsWith("int[")?"int256"+u.slice(3):"int"===u?"int256":u.startsWith("uint[")?"uint256"+u.slice(4):"uint"===u?"uint256":u.startsWith("fixed[")?"fixed128x128"+u.slice(5):"fixed"===u?"fixed128x128":u.startsWith("ufixed[")?"ufixed128x128"+u.slice(6):"ufixed"===u?"ufixed128x128":u)){if(t.replace(/^0x/i,"").length%2!=0)throw new Error("Invalid bytes characters "+t.length);return t}if("string"===e)return o.utf8ToHex(t);if("bool"===e)return t?"01":"00";if(e.startsWith("address")){if(n=r?64:40,!o.isAddress(t))throw new Error(t+" is not a valid address, or the checksum is invalid.");return o.leftPad(t.toLowerCase(),n)}if(n=function(e){var t=/^\D+(\d+).*$/.exec(e);return t?parseInt(t[1],10):null}(e),e.startsWith("bytes")){if(!n)throw new Error("bytes[] not yet supported in solidity");if(r&&(n=32),n<1||n>32||n<t.replace(/^0x/i,"").length/2)throw new Error("Invalid bytes"+n+" for "+t);return o.rightPad(t,2*n)}if(e.startsWith("uint")){if(n%8||n<8||n>256)throw new Error("Invalid uint"+n+" size");if((s=a(t)).bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+s.bitLength());if(s.lt(new i(0)))throw new Error("Supplied uint "+s.toString()+" is negative");return n?o.leftPad(s.toString("hex"),n/8*2):s}if(e.startsWith("int")){if(n%8||n<8||n>256)throw new Error("Invalid int"+n+" size");if((s=a(t)).bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+s.bitLength());return s.lt(new i(0))?s.toTwos(n).toString("hex"):n?o.leftPad(s.toString("hex"),n/8*2):s}throw new Error("Unsupported or invalid type: "+e)},u=function(e){if(n.isArray(e))throw new Error("Autodetection of array types is not supported.");var t,r,a="";if(n.isObject(e)&&(e.hasOwnProperty("v")||e.hasOwnProperty("t")||e.hasOwnProperty("value")||e.hasOwnProperty("type"))?(t=e.hasOwnProperty("t")?e.t:e.type,a=e.hasOwnProperty("v")?e.v:e.value):(t=o.toHex(e,!0),a=o.toHex(e),t.startsWith("int")||t.startsWith("uint")||(t="bytes")),!t.startsWith("int")&&!t.startsWith("uint")||"string"!=typeof a||/^(-)?0x/i.test(a)||(a=new i(a)),n.isArray(a)){if((r=function(e){var t=/^\D+\d*\[(\d+)\]$/.exec(e);return t?parseInt(t[1],10):null}(t))&&a.length!==r)throw new Error(t+" is not matching the given array "+JSON.stringify(a));r=a.length}return n.isArray(a)?a.map(function(e){return s(t,e,r).toString("hex").replace("0x","")}).join(""):s(t,a,r).toString("hex").replace("0x","")};e.exports={soliditySha3:function(){var e=Array.prototype.slice.call(arguments),t=n.map(e,u);return o.sha3("0x"+t.join(""))},soliditySha3Raw:function(){return o.sha3Raw("0x"+n.map(Array.prototype.slice.call(arguments),u).join(""))},encodePacked:function(){var e=Array.prototype.slice.call(arguments),t=n.map(e,u);return"0x"+t.join("").toLowerCase()}}},function(e,t,r){"use strict";const n=r(33),i=r(1),o=function(e){const t="A".charCodeAt(0),r="Z".charCodeAt(0);return(e=(e=e.toUpperCase()).substr(4)+e.substr(0,4)).split("").map(function(e){const n=e.charCodeAt(0);return n>=t&&n<=r?n-t+10:e}).join("")},a=function(e){let t,r=e;for(;r.length>2;)t=r.slice(0,9),r=parseInt(t,10)%97+r.slice(t.length);return parseInt(r,10)%97};class s{constructor(e){this._iban=e}static toAddress(e){if(!(e=new s(e)).isDirect())throw new Error("IBAN is indirect and can't be converted");return e.toAddress()}static toIban(e){return s.fromAddress(e).toString()}static fromAddress(e){if(!n.isAddress(e))throw new Error("Provided address is not a valid address: "+e);e=e.replace("0x","").replace("0X","");const t=function(e,t){let r=e;for(;r.length<30;)r="0"+r;return r}(new i(e,16).toString(36));return s.fromBban(t.toUpperCase())}static fromBban(e){const t=("0"+(98-a(o("XE00"+e)))).slice(-2);return new s("XE"+t+e)}static createIndirect(e){return s.fromBban("ETH"+e.institution+e.identifier)}static isValid(e){return new s(e).isValid()}isValid(){return/^XE[0-9]{2}(ETH[0-9A-Z]{13}|[0-9A-Z]{30,31})$/.test(this._iban)&&1===a(o(this._iban))}isDirect(){return 34===this._iban.length||35===this._iban.length}isIndirect(){return 20===this._iban.length}checksum(){return this._iban.substr(2,2)}institution(){return this.isIndirect()?this._iban.substr(7,4):""}client(){return this.isIndirect()?this._iban.substr(11):""}toAddress(){if(this.isDirect()){const e=this._iban.substr(4),t=new i(e,36);return n.toChecksumAddress(t.toString(16,20))}return""}toString(){return this._iban}}e.exports=s},function(e,t,r){"use strict";var n=r(116),i=r(21).errors,o=function(e){this.requestManager=e,this.requests=[]};o.prototype.add=function(e){this.requests.push(e)},o.prototype.execute=function(){var e=this.requests;this.requestManager.sendBatch(e,function(t,r){r=r||[],e.map(function(e,t){return r[t]||{}}).forEach(function(t,r){if(e[r].callback){if(t&&t.error)return e[r].callback(i.ErrorResponse(t));if(!n.isValidResponse(t))return e[r].callback(i.InvalidResponse(t));try{e[r].callback(null,e[r].format?e[r].format(t.result):t.result)}catch(t){e[r].callback(t)}}})})},e.exports=o},function(e,t,r){"use strict";var n,i=null;try{n=Function("return this")()}catch(e){n=window}void 0!==n.ethereum?i=n.ethereum:void 0!==n.web3&&n.web3.currentProvider&&(n.web3.currentProvider.sendAsync&&(n.web3.currentProvider.send=n.web3.currentProvider.sendAsync,delete n.web3.currentProvider.sendAsync),!n.web3.currentProvider.on&&n.web3.currentProvider.connection&&"ipcProviderWrapper"===n.web3.currentProvider.connection.constructor.name&&(n.web3.currentProvider.on=function(e,t){if("function"!=typeof t)throw new Error("The second parameter callback must be a function.");switch(e){case"data":this.connection.on("data",function(e){var r="";e=e.toString();try{r=JSON.parse(e)}catch(r){return t(new Error("Couldn't parse response data"+e))}r.id||-1===r.method.indexOf("_subscription")||t(null,r)});break;default:this.connection.on(e,t)}}),i=n.web3.currentProvider),e.exports=i},function(e,t,r){"use strict";var n=r(72),i=r(229),o=r(21).errors,a=r(235).w3cwebsocket,s=function(e,t){n.call(this),t=t||{},this.url=e,this._customTimeout=t.timeout||15e3,this.headers=t.headers||{},this.protocol=t.protocol||void 0,this.reconnectOptions=Object.assign({auto:!1,delay:5e3,maxAttempts:!1,onTimeout:!1},t.reconnect),this.clientConfig=t.clientConfig||void 0,this.requestOptions=t.requestOptions||void 0,this.DATA="data",this.CLOSE="close",this.ERROR="error",this.CONNECT="connect",this.RECONNECT="reconnect",this.connection=null,this.requestQueue=new Map,this.responseQueue=new Map,this.reconnectAttempts=0,this.reconnecting=!1;var r=i.parseURL(e);r.username&&r.password&&(this.headers.authorization="Basic "+i.btoa(r.username+":"+r.password)),r.auth&&(this.headers.authorization="Basic "+i.btoa(r.auth)),Object.defineProperty(this,"connected",{get:function(){return this.connection&&this.connection.readyState===this.connection.OPEN},enumerable:!0}),this.connect()};(s.prototype=Object.create(n.prototype)).constructor=s,s.prototype.connect=function(){this.connection=new a(this.url,this.protocol,void 0,this.headers,this.requestOptions,this.clientConfig),this._addSocketListeners()},s.prototype._onMessage=function(e){var t=this;this._parseResponse("string"==typeof e.data?e.data:"").forEach(function(e){if(e.method&&-1!==e.method.indexOf("_subscription"))t.emit(t.DATA,e);else{var r=e.id;Array.isArray(e)&&(r=e[0].id),t.responseQueue.has(r)&&(void 0!==t.responseQueue.get(r).callback&&t.responseQueue.get(r).callback(!1,e),t.responseQueue.delete(r))}})},s.prototype._onConnect=function(){if(this.emit(this.CONNECT),this.reconnectAttempts=0,this.reconnecting=!1,this.requestQueue.size>0){var e=this;this.requestQueue.forEach(function(t,r){e.send(t.payload,t.callback),e.requestQueue.delete(r)})}},s.prototype._onClose=function(e){var t=this;!this.reconnectOptions.auto||[1e3,1001].includes(e.code)&&!1!==e.wasClean?(this.emit(this.CLOSE,e),this.requestQueue.size>0&&this.requestQueue.forEach(function(r,n){r.callback(o.ConnectionNotOpenError(e)),t.requestQueue.delete(n)}),this.responseQueue.size>0&&this.responseQueue.forEach(function(r,n){r.callback(o.InvalidConnection("on WS",e)),t.responseQueue.delete(n)}),this._removeSocketListeners(),this.removeAllListeners()):this.reconnect()},s.prototype._addSocketListeners=function(){this.connection.addEventListener("message",this._onMessage.bind(this)),this.connection.addEventListener("open",this._onConnect.bind(this)),this.connection.addEventListener("close",this._onClose.bind(this))},s.prototype._removeSocketListeners=function(){this.connection.removeEventListener("message",this._onMessage),this.connection.removeEventListener("open",this._onConnect),this.connection.removeEventListener("close",this._onClose)},s.prototype._parseResponse=function(e){var t=this,r=[];return e.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|").forEach(function(e){t.lastChunk&&(e=t.lastChunk+e);var n=null;try{n=JSON.parse(e)}catch(r){return t.lastChunk=e,clearTimeout(t.lastChunkTimeout),void(t.lastChunkTimeout=setTimeout(function(){t.reconnectOptions.auto&&t.reconnectOptions.onTimeout?t.reconnect():(t.emit(t.ERROR,o.ConnectionTimeout(t._customTimeout)),t.requestQueue.size>0&&t.requestQueue.forEach(function(e,r){e.callback(o.ConnectionTimeout(t._customTimeout)),t.requestQueue.delete(r)}))},t._customTimeout))}clearTimeout(t.lastChunkTimeout),t.lastChunk=null,n&&r.push(n)}),r},s.prototype.send=function(e,t){var r=e.id,n={payload:e,callback:t};if(Array.isArray(e)&&(r=e[0].id),this.connection.readyState===this.connection.CONNECTING||this.reconnecting)this.requestQueue.set(r,n);else{if(this.connection.readyState!==this.connection.OPEN)return this.requestQueue.delete(r),this.emit(this.ERROR,o.ConnectionNotOpenError()),void n.callback(o.ConnectionNotOpenError());this.responseQueue.set(r,n),this.requestQueue.delete(r);try{this.connection.send(JSON.stringify(n.payload))}catch(e){n.callback(e),this.responseQueue.delete(r)}}},s.prototype.reset=function(){this.responseQueue.clear(),this.requestQueue.clear(),this.removeAllListeners(),this._removeSocketListeners(),this._addSocketListeners()},s.prototype.disconnect=function(e,t){this._removeSocketListeners(),this.connection.close(e||1e3,t)},s.prototype.supportsSubscriptions=function(){return!0},s.prototype.reconnect=function(){var e=this;this.reconnecting=!0,this.responseQueue.size>0&&this.responseQueue.forEach(function(t,r){t.callback(o.PendingRequestsOnReconnectingError()),e.responseQueue.delete(r)}),!this.reconnectOptions.maxAttempts||this.reconnectAttempts<this.reconnectOptions.maxAttempts?setTimeout(function(){e.reconnectAttempts++,e._removeSocketListeners(),e.emit(e.RECONNECT,e.reconnectAttempts),e.connect()},this.reconnectOptions.delay):(this.emit(this.ERROR,o.MaxAttemptsReachedOnReconnectingError()),this.reconnecting=!1,this.requestQueue.size>0&&this.requestQueue.forEach(function(t,r){t.callback(o.MaxAttemptsReachedOnReconnectingError()),e.requestQueue.delete(r)}))},e.exports=s},function(e,t,r){(function(t,n){var i="[object process]"===Object.prototype.toString.call(void 0!==t?t:0),o="undefined"!=typeof navigator&&"ReactNative"===navigator.product,a=null,s=null;if(i||o){a=function(e){return n.from(e).toString("base64")};var u=r(52);if(u.URL){var c=u.URL;s=function(e){return new c(e)}}else s=r(52).parse}else a=btoa.bind(window),s=function(e){return new URL(e)};e.exports={parseURL:s,btoa:a}}).call(this,r(9),r(11).Buffer)},function(e,t,r){(function(e,n){var i;!function(n){var o,a=2147483647,s=/^xn--/,u=/[^\x20-\x7E]/,c=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,h=String.fromCharCode;function l(e){throw new RangeError(f[e])}function p(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function b(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+p((e=e.replace(c,".")).split("."),t).join(".")}function m(e){for(var t,r,n=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function g(e){return p(e,function(e){var t="";return e>65535&&(t+=h((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+h(e)}).join("")}function y(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function v(e,t,r){var n=0;for(e=r?d(e/700):e>>1,e+=d(e/t);e>455;n+=36)e=d(e/35);return d(n+36*e/(e+38))}function w(e){var t,r,n,i,o,s,u,c,f,h,p,b=[],m=e.length,y=0,w=128,_=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&l("not-basic"),b.push(e.charCodeAt(n));for(i=r>0?r+1:0;i<m;){for(o=y,s=1,u=36;i>=m&&l("invalid-input"),((c=(p=e.charCodeAt(i++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:36)>=36||c>d((a-y)/s))&&l("overflow"),y+=c*s,!(c<(f=u<=_?1:u>=_+26?26:u-_));u+=36)s>d(a/(h=36-f))&&l("overflow"),s*=h;_=v(y-o,t=b.length+1,0==o),d(y/t)>a-w&&l("overflow"),w+=d(y/t),y%=t,b.splice(y++,0,w)}return g(b)}function _(e){var t,r,n,i,o,s,u,c,f,p,b,g,w,_,S,E=[];for(g=(e=m(e)).length,t=128,r=0,o=72,s=0;s<g;++s)(b=e[s])<128&&E.push(h(b));for(n=i=E.length,i&&E.push("-");n<g;){for(u=a,s=0;s<g;++s)(b=e[s])>=t&&b<u&&(u=b);for(u-t>d((a-r)/(w=n+1))&&l("overflow"),r+=(u-t)*w,t=u,s=0;s<g;++s)if((b=e[s])<t&&++r>a&&l("overflow"),b==t){for(c=r,f=36;!(c<(p=f<=o?1:f>=o+26?26:f-o));f+=36)E.push(h(y(p+(S=c-p)%(_=36-p),0))),c=d(S/_);E.push(h(y(c,0))),o=v(r,w,n==i),r=0,++n}++r,++t}return E.join("")}o={version:"1.4.1",ucs2:{decode:m,encode:g},decode:w,encode:_,toASCII:function(e){return b(e,function(e){return u.test(e)?"xn--"+_(e):e})},toUnicode:function(e){return b(e,function(e){return s.test(e)?w(e.slice(4).toLowerCase()):e})}},void 0===(i=(function(){return o}).call(t,r,t,e))||(e.exports=i)}()}).call(this,r(113)(e),r(10))},function(e,t,r){"use strict";e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,r){"use strict";t.decode=t.parse=r(233),t.encode=t.stringify=r(234)},function(e,t,r){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,r,o){r=r||"=";var a={};if("string"!=typeof e||0===e.length)return a;var s=/\+/g;e=e.split(t=t||"&");var u=1e3;o&&"number"==typeof o.maxKeys&&(u=o.maxKeys);var c=e.length;u>0&&c>u&&(c=u);for(var f=0;f<c;++f){var d,h,l,p,b=e[f].replace(s,"%20"),m=b.indexOf(r);m>=0?(d=b.substr(0,m),h=b.substr(m+1)):(d=b,h=""),l=decodeURIComponent(d),p=decodeURIComponent(h),n(a,l)?i(a[l])?a[l].push(p):a[l]=[a[l],p]:a[l]=p}return a};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,r){"use strict";var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,r,s){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?o(a(e),function(a){var s=encodeURIComponent(n(a))+r;return i(e[a])?o(e[a],function(e){return s+encodeURIComponent(n(e))}).join(t):s+encodeURIComponent(n(e[a]))}).join(t):s?encodeURIComponent(n(s))+r+encodeURIComponent(n(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function o(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}var a=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t}},function(e,t,r){var n;if("object"==typeof globalThis)n=globalThis;else try{n=r(236)}catch(e){}finally{if(n||"undefined"==typeof window||(n=window),!n)throw new Error("Could not determine global this")}var i=n.WebSocket||n.MozWebSocket,o=r(237);function a(e,t){return t?new i(e,t):new i(e)}i&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach(function(e){Object.defineProperty(a,e,{get:function(){return i[e]}})}),e.exports={w3cwebsocket:i?a:null,version:o}},function(e,t){var r=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw new Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;if("object"==typeof globalThis&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(e){return r()}try{return __global__||r()}finally{delete Object.prototype.__global__}}()},function(e,t,r){e.exports=r(238).version},function(e){e.exports=JSON.parse('{"_args":[["websocket@1.0.34","/home/circleci/torus-embed"]],"_from":"websocket@1.0.34","_id":"websocket@1.0.34","_inBundle":false,"_integrity":"sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ==","_location":"/websocket","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"websocket@1.0.34","name":"websocket","escapedName":"websocket","rawSpec":"1.0.34","saveSpec":null,"fetchSpec":"1.0.34"},"_requiredBy":["/web3-providers-ws"],"_resolved":"https://registry.npmjs.org/websocket/-/websocket-1.0.34.tgz","_spec":"1.0.34","_where":"/home/circleci/torus-embed","author":{"name":"Brian McKelvey","email":"theturtle32@gmail.com","url":"https://github.com/theturtle32"},"browser":"lib/browser.js","bugs":{"url":"https://github.com/theturtle32/WebSocket-Node/issues"},"config":{"verbose":false},"contributors":[{"name":"I\xf1aki Baz Castillo","email":"ibc@aliax.net","url":"http://dev.sipdoc.net"}],"dependencies":{"bufferutil":"^4.0.1","debug":"^2.2.0","es5-ext":"^0.10.50","typedarray-to-buffer":"^3.1.5","utf-8-validate":"^5.0.2","yaeti":"^0.0.6"},"description":"Websocket Client & Server Library implementing the WebSocket protocol as specified in RFC 6455.","devDependencies":{"buffer-equal":"^1.0.0","gulp":"^4.0.2","gulp-jshint":"^2.0.4","jshint":"^2.0.0","jshint-stylish":"^2.2.1","tape":"^4.9.1"},"directories":{"lib":"./lib"},"engines":{"node":">=4.0.0"},"homepage":"https://github.com/theturtle32/WebSocket-Node","keywords":["websocket","websockets","socket","networking","comet","push","RFC-6455","realtime","server","client"],"license":"Apache-2.0","main":"index","name":"websocket","repository":{"type":"git","url":"git+https://github.com/theturtle32/WebSocket-Node.git"},"scripts":{"gulp":"gulp","test":"tape test/unit/*.js"},"version":"1.0.34"}')},function(e,t,r){var n=r(21).errors,i=r(240).XMLHttpRequest,o=r(73),a=r(126),s=function(e,t){this.withCredentials=(t=t||{}).withCredentials||!1,this.timeout=t.timeout||0,this.headers=t.headers,this.agent=t.agent,this.connected=!1;const r=!1!==t.keepAlive;this.host=e||"http://localhost:8545",this.agent||("https"===this.host.substring(0,5)?this.httpsAgent=new a.Agent({keepAlive:r}):this.httpAgent=new o.Agent({keepAlive:r}))};s.prototype._prepareRequest=function(){var e;if("undefined"!=typeof XMLHttpRequest)e=new XMLHttpRequest;else{e=new i;var t={httpsAgent:this.httpsAgent,httpAgent:this.httpAgent,baseUrl:this.baseUrl};this.agent&&(t.httpsAgent=this.agent.https,t.httpAgent=this.agent.http,t.baseUrl=this.agent.baseUrl),e.nodejsSet(t)}return e.open("POST",this.host,!0),e.setRequestHeader("Content-Type","application/json"),e.timeout=this.timeout,e.withCredentials=this.withCredentials,this.headers&&this.headers.forEach(function(t){e.setRequestHeader(t.name,t.value)}),e},s.prototype.send=function(e,t){var r=this,i=this._prepareRequest();i.onreadystatechange=function(){if(4===i.readyState&&1!==i.timeout){var e=i.responseText,o=null;try{e=JSON.parse(e)}catch(e){o=n.InvalidResponse(i.responseText)}r.connected=!0,t(o,e)}},i.ontimeout=function(){r.connected=!1,t(n.ConnectionTimeout(this.timeout))};try{i.send(JSON.stringify(e))}catch(e){this.connected=!1,t(n.InvalidConnection(this.host))}},s.prototype.disconnect=function(){},s.prototype.supportsSubscriptions=function(){return!1},e.exports=s},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var r in e)t.hasOwnProperty(r)||(t[r]=e[r])}(r(241));var n=r(75);t.XMLHttpRequestEventTarget=n.XMLHttpRequestEventTarget},function(e,t,r){"use strict";(function(e,n){var i,o=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),a=this&&this.__assign||Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e};Object.defineProperty(t,"__esModule",{value:!0});var s=r(73),u=r(126),c=r(249),f=r(52),d=r(250),h=r(251),l=r(75),p=r(252),b=r(253),m=function(t){function r(n){void 0===n&&(n={});var i=t.call(this)||this;return i.UNSENT=r.UNSENT,i.OPENED=r.OPENED,i.HEADERS_RECEIVED=r.HEADERS_RECEIVED,i.LOADING=r.LOADING,i.DONE=r.DONE,i.onreadystatechange=null,i.readyState=r.UNSENT,i.response=null,i.responseText="",i.responseType="",i.status=0,i.statusText="",i.timeout=0,i.upload=new p.XMLHttpRequestUpload,i.responseUrl="",i.withCredentials=!1,i._method=null,i._url=null,i._sync=!1,i._headers={},i._loweredHeaders={},i._mimeOverride=null,i._request=null,i._response=null,i._responseParts=null,i._responseHeaders=null,i._aborting=null,i._error=null,i._loadedBytes=0,i._totalBytes=0,i._lengthComputable=!1,i._restrictedMethods={CONNECT:!0,TRACE:!0,TRACK:!0},i._restrictedHeaders={"accept-charset":!0,"accept-encoding":!0,"access-control-request-headers":!0,"access-control-request-method":!0,connection:!0,"content-length":!0,cookie:!0,cookie2:!0,date:!0,dnt:!0,expect:!0,host:!0,"keep-alive":!0,origin:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,via:!0},i._privateHeaders={"set-cookie":!0,"set-cookie2":!0},i._userAgent="Mozilla/5.0 ("+c.type()+" "+c.arch()+") node.js/"+e.versions.node+" v8/"+e.versions.v8,i._anonymous=n.anon||!1,i}return o(r,t),r.prototype.open=function(e,t,n,i,o){if(void 0===n&&(n=!0),e=e.toUpperCase(),this._restrictedMethods[e])throw new r.SecurityError("HTTP method "+e+" is not allowed in XHR");var a=this._parseUrl(t,i,o);this._method=e,this._url=a,this._sync=!n,this._headers={},this._loweredHeaders={},this._mimeOverride=null,this._setReadyState(r.OPENED),this._request=null,this._response=null,this.status=0,this.statusText="",this._responseParts=[],this._responseHeaders=null,this._loadedBytes=0,this._totalBytes=0,this._lengthComputable=!1},r.prototype.setRequestHeader=function(e,t){if(this.readyState!==r.OPENED)throw new r.InvalidStateError("XHR readyState must be OPENED");var n=e.toLowerCase();this._restrictedHeaders[n]||/^sec-/.test(n)||/^proxy-/.test(n)?console.warn('Refused to set unsafe header "'+e+'"'):(t=t.toString(),null!=this._loweredHeaders[n]?this._headers[e=this._loweredHeaders[n]]=this._headers[e]+", "+t:(this._loweredHeaders[n]=e,this._headers[e]=t))},r.prototype.send=function(e){if(this.readyState!==r.OPENED)throw new r.InvalidStateError("XHR readyState must be OPENED");if(this._request)throw new r.InvalidStateError("send() already called");switch(this._url.protocol){case"file:":return this._sendFile(e);case"http:":case"https:":return this._sendHttp(e);default:throw new r.NetworkError("Unsupported protocol "+this._url.protocol)}},r.prototype.abort=function(){null!=this._request&&(this._request.abort(),this._setError(),this._dispatchProgress("abort"),this._dispatchProgress("loadend"))},r.prototype.getResponseHeader=function(e){if(null==this._responseHeaders||null==e)return null;var t=e.toLowerCase();return this._responseHeaders.hasOwnProperty(t)?this._responseHeaders[e.toLowerCase()]:null},r.prototype.getAllResponseHeaders=function(){var e=this;return null==this._responseHeaders?"":Object.keys(this._responseHeaders).map(function(t){return t+": "+e._responseHeaders[t]}).join("\r\n")},r.prototype.overrideMimeType=function(e){if(this.readyState===r.LOADING||this.readyState===r.DONE)throw new r.InvalidStateError("overrideMimeType() not allowed in LOADING or DONE");this._mimeOverride=e.toLowerCase()},r.prototype.nodejsSet=function(e){if(this.nodejsHttpAgent=e.httpAgent||this.nodejsHttpAgent,this.nodejsHttpsAgent=e.httpsAgent||this.nodejsHttpsAgent,e.hasOwnProperty("baseUrl")){if(null!=e.baseUrl&&!f.parse(e.baseUrl,!1,!0).protocol)throw new r.SyntaxError("baseUrl must be an absolute URL");this.nodejsBaseUrl=e.baseUrl}},r.nodejsSet=function(e){r.prototype.nodejsSet(e)},r.prototype._setReadyState=function(e){this.readyState=e,this.dispatchEvent(new d.ProgressEvent("readystatechange"))},r.prototype._sendFile=function(e){throw new Error("Protocol file: not implemented")},r.prototype._sendHttp=function(e){if(this._sync)throw new Error("Synchronous XHR processing not implemented");!e||"GET"!==this._method&&"HEAD"!==this._method?e=e||"":(console.warn("Discarding entity body for "+this._method+" requests"),e=null),this.upload._setData(e),this._finalizeHeaders(),this._sendHxxpRequest()},r.prototype._sendHxxpRequest=function(){var e=this;if(this.withCredentials){var t=r.cookieJar.getCookies(b.CookieAccessInfo(this._url.hostname,this._url.pathname,"https:"===this._url.protocol)).toValueString();this._headers.cookie=this._headers.cookie2=t}var n="http:"===this._url.protocol?[s,this.nodejsHttpAgent]:[u,this.nodejsHttpsAgent],i=n[0],o=n[1],a=i.request.bind(i)({hostname:this._url.hostname,port:+this._url.port,path:this._url.path,auth:this._url.auth,method:this._method,headers:this._headers,agent:o});this._request=a,this.timeout&&a.setTimeout(this.timeout,function(){return e._onHttpTimeout(a)}),a.on("response",function(t){return e._onHttpResponse(a,t)}),a.on("error",function(t){return e._onHttpRequestError(a,t)}),this.upload._startUpload(a),this._request===a&&this._dispatchProgress("loadstart")},r.prototype._finalizeHeaders=function(){this._headers=a({},this._headers,{Connection:"keep-alive",Host:this._url.host,"User-Agent":this._userAgent},this._anonymous?{Referer:"about:blank"}:{}),this.upload._finalizeHeaders(this._headers,this._loweredHeaders)},r.prototype._onHttpResponse=function(e,t){var n=this;if(this._request===e){if(this.withCredentials&&(t.headers["set-cookie"]||t.headers["set-cookie2"])&&r.cookieJar.setCookies(t.headers["set-cookie"]||t.headers["set-cookie2"]),[301,302,303,307,308].indexOf(t.statusCode)>=0)return this._url=this._parseUrl(t.headers.location),this._method="GET",this._loweredHeaders["content-type"]&&(delete this._headers[this._loweredHeaders["content-type"]],delete this._loweredHeaders["content-type"]),null!=this._headers["Content-Type"]&&delete this._headers["Content-Type"],delete this._headers["Content-Length"],this.upload._reset(),this._finalizeHeaders(),void this._sendHxxpRequest();this._response=t,this._response.on("data",function(e){return n._onHttpResponseData(t,e)}),this._response.on("end",function(){return n._onHttpResponseEnd(t)}),this._response.on("close",function(){return n._onHttpResponseClose(t)}),this.responseUrl=this._url.href.split("#")[0],this.status=t.statusCode,this.statusText=s.STATUS_CODES[this.status],this._parseResponseHeaders(t);var i=this._responseHeaders["content-length"]||"";this._totalBytes=+i,this._lengthComputable=!!i,this._setReadyState(r.HEADERS_RECEIVED)}},r.prototype._onHttpResponseData=function(e,t){this._response===e&&(this._responseParts.push(new n(t)),this._loadedBytes+=t.length,this.readyState!==r.LOADING&&this._setReadyState(r.LOADING),this._dispatchProgress("progress"))},r.prototype._onHttpResponseEnd=function(e){this._response===e&&(this._parseResponse(),this._request=null,this._response=null,this._setReadyState(r.DONE),this._dispatchProgress("load"),this._dispatchProgress("loadend"))},r.prototype._onHttpResponseClose=function(e){if(this._response===e){var t=this._request;this._setError(),t.abort(),this._setReadyState(r.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend")}},r.prototype._onHttpTimeout=function(e){this._request===e&&(this._setError(),e.abort(),this._setReadyState(r.DONE),this._dispatchProgress("timeout"),this._dispatchProgress("loadend"))},r.prototype._onHttpRequestError=function(e,t){this._request===e&&(this._setError(),e.abort(),this._setReadyState(r.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend"))},r.prototype._dispatchProgress=function(e){var t=new r.ProgressEvent(e);t.lengthComputable=this._lengthComputable,t.loaded=this._loadedBytes,t.total=this._totalBytes,this.dispatchEvent(t)},r.prototype._setError=function(){this._request=null,this._response=null,this._responseHeaders=null,this._responseParts=null},r.prototype._parseUrl=function(e,t,r){var n=null==this.nodejsBaseUrl?e:f.resolve(this.nodejsBaseUrl,e),i=f.parse(n,!1,!0);i.hash=null;var o=(i.auth||"").split(":"),a=o[0],s=o[1];return(a||s||t||r)&&(i.auth=(t||a||"")+":"+(r||s||"")),i},r.prototype._parseResponseHeaders=function(e){for(var t in this._responseHeaders={},e.headers){var r=t.toLowerCase();this._privateHeaders[r]||(this._responseHeaders[r]=e.headers[t])}null!=this._mimeOverride&&(this._responseHeaders["content-type"]=this._mimeOverride)},r.prototype._parseResponse=function(){var e=n.concat(this._responseParts);switch(this._responseParts=null,this.responseType){case"json":this.responseText=null;try{this.response=JSON.parse(e.toString("utf-8"))}catch(e){this.response=null}return;case"buffer":return this.responseText=null,void(this.response=e);case"arraybuffer":this.responseText=null;for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),i=0;i<e.length;i++)r[i]=e[i];return void(this.response=t);case"text":default:try{this.responseText=e.toString(this._parseResponseEncoding())}catch(t){this.responseText=e.toString("binary")}this.response=this.responseText}},r.prototype._parseResponseEncoding=function(){return/;\s*charset=(.*)$/.exec(this._responseHeaders["content-type"]||"")[1]||"utf-8"},r.ProgressEvent=d.ProgressEvent,r.InvalidStateError=h.InvalidStateError,r.NetworkError=h.NetworkError,r.SecurityError=h.SecurityError,r.SyntaxError=h.SyntaxError,r.XMLHttpRequestUpload=p.XMLHttpRequestUpload,r.UNSENT=0,r.OPENED=1,r.HEADERS_RECEIVED=2,r.LOADING=3,r.DONE=4,r.cookieJar=b.CookieJar(),r}(l.XMLHttpRequestEventTarget);t.XMLHttpRequest=m,m.prototype.nodejsHttpAgent=s.globalAgent,m.prototype.nodejsHttpsAgent=u.globalAgent,m.prototype.nodejsBaseUrl=null}).call(this,r(9),r(11).Buffer)},function(e,t,r){(function(t,n,i){var o=r(117),a=r(3),s=r(118),u=r(119),c=r(247),f=s.IncomingMessage,d=s.readyStates,h=e.exports=function(e){var r,n=this;u.Writable.call(n),n._opts=e,n._body=[],n._headers={},e.auth&&n.setHeader("Authorization","Basic "+new t(e.auth).toString("base64")),Object.keys(e.headers).forEach(function(t){n.setHeader(t,e.headers[t])});var i=!0;if("disable-fetch"===e.mode||"requestTimeout"in e&&!o.abortController)i=!1,r=!0;else if("prefer-streaming"===e.mode)r=!1;else if("allow-wrong-content-type"===e.mode)r=!o.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");r=!0}n._mode=function(e,t){return o.fetch&&t?"fetch":o.mozchunkedarraybuffer?"moz-chunked-arraybuffer":o.msstream?"ms-stream":o.arraybuffer&&e?"arraybuffer":o.vbArray&&e?"text:vbarray":"text"}(r,i),n._fetchTimer=null,n.on("finish",function(){n._onFinish()})};a(h,u.Writable),h.prototype.setHeader=function(e,t){var r=e.toLowerCase();-1===l.indexOf(r)&&(this._headers[r]={name:e,value:t})},h.prototype.getHeader=function(e){var t=this._headers[e.toLowerCase()];return t?t.value:null},h.prototype.removeHeader=function(e){delete this._headers[e.toLowerCase()]},h.prototype._onFinish=function(){var e=this;if(!e._destroyed){var r=e._opts,a=e._headers,s=null;"GET"!==r.method&&"HEAD"!==r.method&&(s=o.arraybuffer?c(t.concat(e._body)):o.blobConstructor?new n.Blob(e._body.map(function(e){return c(e)}),{type:(a["content-type"]||{}).value||""}):t.concat(e._body).toString());var u=[];if(Object.keys(a).forEach(function(e){var t=a[e].name,r=a[e].value;Array.isArray(r)?r.forEach(function(e){u.push([t,e])}):u.push([t,r])}),"fetch"===e._mode){var f=null;if(o.abortController){var h=new AbortController;f=h.signal,e._fetchAbortController=h,"requestTimeout"in r&&0!==r.requestTimeout&&(e._fetchTimer=n.setTimeout(function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()},r.requestTimeout))}n.fetch(e._opts.url,{method:e._opts.method,headers:u,body:s||void 0,mode:"cors",credentials:r.withCredentials?"include":"same-origin",signal:f}).then(function(t){e._fetchResponse=t,e._connect()},function(t){n.clearTimeout(e._fetchTimer),e._destroyed||e.emit("error",t)})}else{var l=e._xhr=new n.XMLHttpRequest;try{l.open(e._opts.method,e._opts.url,!0)}catch(t){return void i.nextTick(function(){e.emit("error",t)})}"responseType"in l&&(l.responseType=e._mode.split(":")[0]),"withCredentials"in l&&(l.withCredentials=!!r.withCredentials),"text"===e._mode&&"overrideMimeType"in l&&l.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in r&&(l.timeout=r.requestTimeout,l.ontimeout=function(){e.emit("requestTimeout")}),u.forEach(function(e){l.setRequestHeader(e[0],e[1])}),e._response=null,l.onreadystatechange=function(){switch(l.readyState){case d.LOADING:case d.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(l.onprogress=function(){e._onXHRProgress()}),l.onerror=function(){e._destroyed||e.emit("error",new Error("XHR error"))};try{l.send(s)}catch(t){return void i.nextTick(function(){e.emit("error",t)})}}}},h.prototype._onXHRProgress=function(){(function(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}})(this._xhr)&&!this._destroyed&&(this._response||this._connect(),this._response._onXHRProgress())},h.prototype._connect=function(){var e=this;e._destroyed||(e._response=new f(e._xhr,e._fetchResponse,e._mode,e._fetchTimer),e._response.on("error",function(t){e.emit("error",t)}),e.emit("response",e._response))},h.prototype._write=function(e,t,r){this._body.push(e),r()},h.prototype.abort=h.prototype.destroy=function(){this._destroyed=!0,n.clearTimeout(this._fetchTimer),this._response&&(this._response._destroyed=!0),this._xhr?this._xhr.abort():this._fetchAbortController&&this._fetchAbortController.abort()},h.prototype.end=function(e,t,r){"function"==typeof e&&(r=e,e=void 0),u.Writable.prototype.end.call(this,e,t,r)},h.prototype.flushHeaders=function(){},h.prototype.setTimeout=function(){},h.prototype.setNoDelay=function(){},h.prototype.setSocketKeepAlive=function(){};var l=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]}).call(this,r(11).Buffer,r(10),r(9))},function(e,t){},function(e,t,r){"use strict";var n=r(74).Buffer,i=r(245);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t=n.allocUnsafe(e>>>0),r=this.head,i=0;r;)r.data.copy(t,i),i+=r.data.length,r=r.next;return t},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,r){"use strict";e.exports=o;var n=r(124),i=Object.create(r(13));function o(e){if(!(this instanceof o))return new o(e);n.call(this,e)}i.inherits=r(3),i.inherits(o,n),o.prototype._transform=function(e,t,r){r(null,e)}},function(e,t,r){var n=r(11).Buffer;e.exports=function(e){if(e instanceof Uint8Array){if(0===e.byteOffset&&e.byteLength===e.buffer.byteLength)return e.buffer;if("function"==typeof e.buffer.slice)return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(n.isBuffer(e)){for(var t=new Uint8Array(e.length),r=e.length,i=0;i<r;i++)t[i]=e[i];return t.buffer}throw new Error("Argument must be a Buffer")}},function(e,t){e.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},function(e,t){t.endianness=function(){return"LE"},t.hostname=function(){return"undefined"!=typeof location?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL="\n",t.homedir=function(){return"/"}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressEvent=function(e){this.type=e,this.bubbles=!1,this.cancelable=!1,this.loaded=0,this.lengthComputable=!1,this.total=0}},function(e,t,r){"use strict";var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(Error);t.SecurityError=o;var a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(Error);t.InvalidStateError=a;var s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(Error);t.NetworkError=s;var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(Error);t.SyntaxError=u},function(e,t,r){"use strict";(function(e){var n,i=this&&this.__extends||(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var o=function(t){function r(){var e=t.call(this)||this;return e._contentType=null,e._body=null,e._reset(),e}return i(r,t),r.prototype._reset=function(){this._contentType=null,this._body=null},r.prototype._setData=function(t){if(null!=t)if("string"==typeof t)0!==t.length&&(this._contentType="text/plain;charset=UTF-8"),this._body=new e(t,"utf-8");else if(e.isBuffer(t))this._body=t;else if(t instanceof ArrayBuffer){for(var r=new e(t.byteLength),n=new Uint8Array(t),i=0;i<t.byteLength;i++)r[i]=n[i];this._body=r}else{if(!(t.buffer&&t.buffer instanceof ArrayBuffer))throw new Error("Unsupported send() data "+t);r=new e(t.byteLength);var o=t.byteOffset;for(n=new Uint8Array(t.buffer),i=0;i<t.byteLength;i++)r[i]=n[i+o];this._body=r}},r.prototype._finalizeHeaders=function(e,t){this._contentType&&!t["content-type"]&&(e["Content-Type"]=this._contentType),this._body&&(e["Content-Length"]=this._body.length.toString())},r.prototype._startUpload=function(e){this._body&&e.write(this._body),e.end()},r}(r(75).XMLHttpRequestEventTarget);t.XMLHttpRequestUpload=o}).call(this,r(11).Buffer)},function(e,t){!function(){"use strict";function e(t,r,n,i){return this instanceof e?(this.domain=t||void 0,this.path=r||"/",this.secure=!!n,this.script=!!i,this):new e(t,r,n,i)}function r(e,t,n){return e instanceof r?e:this instanceof r?(this.name=null,this.value=null,this.expiration_date=1/0,this.path=String(n||"/"),this.explicit_path=!1,this.domain=t||null,this.explicit_domain=!1,this.secure=!1,this.noscript=!1,e&&this.parse(e,t,n),this):new r(e,t,n)}e.All=Object.freeze(Object.create(null)),t.CookieAccessInfo=e,t.Cookie=r,r.prototype.toString=function(){var e=[this.name+"="+this.value];return this.expiration_date!==1/0&&e.push("expires="+new Date(this.expiration_date).toGMTString()),this.domain&&e.push("domain="+this.domain),this.path&&e.push("path="+this.path),this.secure&&e.push("secure"),this.noscript&&e.push("httponly"),e.join("; ")},r.prototype.toValueString=function(){return this.name+"="+this.value};var n=/[:](?=\s*[a-zA-Z0-9_\-]+\s*[=])/g;function i(){var e,t;return this instanceof i?(e=Object.create(null),this.setCookie=function(n,i,o){var a,s;if(a=(n=new r(n,i,o)).expiration_date<=Date.now(),void 0!==e[n.name]){for(t=e[n.name],s=0;s<t.length;s+=1)if(t[s].collidesWith(n))return a?(t.splice(s,1),0===t.length&&delete e[n.name],!1):(t[s]=n,n);return!a&&(t.push(n),n)}return!a&&(e[n.name]=[n],e[n.name])},this.getCookie=function(r,n){var i,o;if(t=e[r])for(o=0;o<t.length;o+=1)if((i=t[o]).expiration_date<=Date.now())0===t.length&&delete e[i.name];else if(i.matches(n))return i},this.getCookies=function(t){var r,n,i=[];for(r in e)(n=this.getCookie(r,t))&&i.push(n);return i.toString=function(){return i.join(":")},i.toValueString=function(){return i.map(function(e){return e.toValueString()}).join(";")},i},this):new i}r.prototype.parse=function(e,t,n){if(this instanceof r){var i,o=e.split(";").filter(function(e){return!!e}),a=o[0].match(/([^=]+)=([\s\S]*)/);if(!a)return void console.warn("Invalid cookie header encountered. Header: '"+e+"'");var s=a[1],u=a[2];if("string"!=typeof s||0===s.length||"string"!=typeof u)return void console.warn("Unable to extract values from cookie header. Cookie: '"+e+"'");for(this.name=s,this.value=u,i=1;i<o.length;i+=1)switch(s=(a=o[i].match(/([^=]+)(?:=([\s\S]*))?/))[1].trim().toLowerCase(),u=a[2],s){case"httponly":this.noscript=!0;break;case"expires":this.expiration_date=u?Number(Date.parse(u)):1/0;break;case"path":this.path=u?u.trim():"",this.explicit_path=!0;break;case"domain":this.domain=u?u.trim():"",this.explicit_domain=!!this.domain;break;case"secure":this.secure=!0}return this.explicit_path||(this.path=n||"/"),this.explicit_domain||(this.domain=t),this}return(new r).parse(e,t,n)},r.prototype.matches=function(t){return t===e.All||!(this.noscript&&t.script||this.secure&&!t.secure||!this.collidesWith(t))},r.prototype.collidesWith=function(e){if(this.path&&!e.path||this.domain&&!e.domain)return!1;if(this.path&&0!==e.path.indexOf(this.path))return!1;if(this.explicit_path&&0!==e.path.indexOf(this.path))return!1;var t=e.domain&&e.domain.replace(/^[\.]/,""),r=this.domain&&this.domain.replace(/^[\.]/,"");if(r===t)return!0;if(r){if(!this.explicit_domain)return!1;var n=t.indexOf(r);return-1!==n&&n===t.length-r.length}return!0},t.CookieJar=i,i.prototype.setCookies=function(e,t,i){var o,a,s=[];for(e=(e=Array.isArray(e)?e:e.split(n)).map(function(e){return new r(e,t,i)}),o=0;o<e.length;o+=1)this.setCookie(a=e[o],t,i)&&s.push(a);return s}}()},function(e,t,r){"use strict";var n=r(29),i=r(21).errors,o=r(255),a=function(e,t){var r=this;this.responseCallbacks={},this.notificationCallbacks=[],this.path=e,this.connected=!1,this.connection=t.connect({path:this.path}),this.addDefaultEvents();var i=function(e){var t=null;n.isArray(e)?e.forEach(function(e){r.responseCallbacks[e.id]&&(t=e.id)}):t=e.id,t||-1===e.method.indexOf("_subscription")?r.responseCallbacks[t]&&(r.responseCallbacks[t](null,e),delete r.responseCallbacks[t]):r.notificationCallbacks.forEach(function(t){n.isFunction(t)&&t(e)})};"Socket"===t.constructor.name?o(this.connection).done(i):this.connection.on("data",function(e){r._parseResponse(e.toString()).forEach(i)})};a.prototype.addDefaultEvents=function(){var e=this;this.connection.on("connect",function(){e.connected=!0}),this.connection.on("close",function(){e.connected=!1}),this.connection.on("error",function(){e._timeout()}),this.connection.on("end",function(){e._timeout()}),this.connection.on("timeout",function(){e._timeout()})},a.prototype._parseResponse=function(e){var t=this,r=[];return e.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|").forEach(function(e){t.lastChunk&&(e=t.lastChunk+e);var n=null;try{n=JSON.parse(e)}catch(r){return t.lastChunk=e,clearTimeout(t.lastChunkTimeout),void(t.lastChunkTimeout=setTimeout(function(){throw t._timeout(),i.InvalidResponse(e)},15e3))}clearTimeout(t.lastChunkTimeout),t.lastChunk=null,n&&r.push(n)}),r},a.prototype._addResponseCallback=function(e,t){var r=e.id||e[0].id,n=e.method||e[0].method;this.responseCallbacks[r]=t,this.responseCallbacks[r].method=n},a.prototype._timeout=function(){for(var e in this.responseCallbacks)this.responseCallbacks.hasOwnProperty(e)&&(this.responseCallbacks[e](i.InvalidConnection("on IPC")),delete this.responseCallbacks[e])},a.prototype.reconnect=function(){this.connection.connect({path:this.path})},a.prototype.send=function(e,t){this.connection.writable||this.connection.connect({path:this.path}),this.connection.write(JSON.stringify(e)),this._addResponseCallback(e,t)},a.prototype.on=function(e,t){if("function"!=typeof t)throw new Error("The second parameter callback must be a function.");switch(e){case"data":this.notificationCallbacks.push(t);break;default:this.connection.on(e,t)}},a.prototype.once=function(e,t){if("function"!=typeof t)throw new Error("The second parameter callback must be a function.");this.connection.once(e,t)},a.prototype.removeListener=function(e,t){var r=this;switch(e){case"data":this.notificationCallbacks.forEach(function(e,n){e===t&&r.notificationCallbacks.splice(n,1)});break;default:this.connection.removeListener(e,t)}},a.prototype.removeAllListeners=function(e){switch(e){case"data":this.notificationCallbacks=[];break;default:this.connection.removeAllListeners(e)}},a.prototype.reset=function(){this._timeout(),this.notificationCallbacks=[],this.connection.removeAllListeners("error"),this.connection.removeAllListeners("end"),this.connection.removeAllListeners("timeout"),this.addDefaultEvents()},a.prototype.supportsSubscriptions=function(){return!0},e.exports=a},function(e,t,r){var n;"undefined"!=typeof self&&self,n=function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:n})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=7)}([function(e,t,r){"use strict";r.d(t,"j",function(){return i}),r.d(t,"d",function(){return o}),r.d(t,"c",function(){return a}),r.d(t,"h",function(){return s}),r.d(t,"b",function(){return u}),r.d(t,"k",function(){return c}),r.d(t,"e",function(){return f}),r.d(t,"g",function(){return d}),r.d(t,"i",function(){return h}),r.d(t,"a",function(){return l}),r.d(t,"f",function(){return p});var n=r(1),i=c(function(e,t){var r=t.length;return c(function(n){for(var i=0;i<n.length;i++)t[r+i]=n[i];return t.length=r+n.length,e.apply(this,t)})});function o(e,t){return function(){return e.call(this,t.apply(this,arguments))}}function a(e){return function(t){return t[e]}}c(function(e){var t=Object(n.c)(e);function r(e,t){return[u(e,t)]}return c(function(e){return Object(n.f)(r,e,t)[0]})});var s=c(function(e){return c(function(t){for(var r,n=0;n<a("length")(e);n++)if(r=u(t,e[n]))return r})});function u(e,t){return t.apply(void 0,e)}function c(e){var t=e.length-1,r=Array.prototype.slice;if(0===t)return function(){return e.call(this,r.call(arguments))};if(1===t)return function(){return e.call(this,arguments[0],r.call(arguments,1))};var n=Array(e.length);return function(){for(var i=0;i<t;i++)n[i]=arguments[i];return n[t]=r.call(arguments,t),e.apply(this,n)}}function f(e){return function(t,r){return e(r,t)}}function d(e,t){return function(r){return e(r)&&t(r)}}function h(){}function l(){return!0}function p(e){return function(){return e}}},function(e,t,r){"use strict";r.d(t,"d",function(){return i}),r.d(t,"g",function(){return o}),r.d(t,"l",function(){return a}),r.d(t,"c",function(){return s}),r.d(t,"h",function(){return u}),r.d(t,"i",function(){return c}),r.d(t,"j",function(){return f}),r.d(t,"f",function(){return d}),r.d(t,"m",function(){return h}),r.d(t,"a",function(){return l}),r.d(t,"b",function(){return p}),r.d(t,"k",function(){return b}),r.d(t,"e",function(){return m});var n=r(0);function i(e,t){return[e,t]}var o=Object(n.c)(0),a=Object(n.c)(1);function s(e){return b(e.reduce(Object(n.e)(i),null))}var u=Object(n.k)(s);function c(e){return d(function(e,t){return e.unshift(t),e},[],e)}function f(e,t){return t?i(e(o(t)),f(e,a(t))):null}function d(e,t,r){return r?e(d(e,t,a(r)),o(r)):t}function h(e,t,r){return function e(r,n){return r?t(o(r))?(n(o(r)),a(r)):i(o(r),e(a(r),n)):null}(e,r||n.i)}function l(e,t){return!t||e(o(t))&&l(e,a(t))}function p(e,t){e&&(o(e).apply(null,t),p(a(e),t))}function b(e){return function e(t,r){return t?e(a(t),i(o(t),r)):r}(e,null)}function m(e,t){return t&&(e(o(t))?o(t):m(e,a(t)))}},function(e,t,r){"use strict";r.d(t,"c",function(){return o}),r.d(t,"e",function(){return a}),r.d(t,"d",function(){return s}),r.d(t,"a",function(){return u}),r.d(t,"b",function(){return c});var n=r(1),i=r(0);function o(e,t){return t&&t.constructor===e}var a=Object(i.c)("length"),s=Object(i.j)(o,String);function u(e){return void 0!==e}function c(e,t){return t instanceof Object&&Object(n.a)(function(e){return e in t},e)}},function(e,t,r){"use strict";r.d(t,"f",function(){return i}),r.d(t,"d",function(){return o}),r.d(t,"g",function(){return a}),r.d(t,"e",function(){return s}),r.d(t,"b",function(){return u}),r.d(t,"h",function(){return c}),r.d(t,"i",function(){return f}),r.d(t,"c",function(){return d}),r.d(t,"m",function(){return h}),r.d(t,"n",function(){return l}),r.d(t,"a",function(){return p}),r.d(t,"j",function(){return b}),r.d(t,"l",function(){return m}),r.d(t,"k",function(){return g}),r.d(t,"o",function(){return y});var n=1,i=n++,o=n++,a=n++,s=n++,u="fail",c=n++,f=n++,d="start",h="data",l="end",p=n++,b=n++,m=n++,g=n++;function y(e,t,r){try{var n=JSON.parse(t)}catch(e){}return{statusCode:e,body:t,jsonBody:n,thrown:r}}},function(e,t,r){"use strict";r.d(t,"b",function(){return i}),r.d(t,"a",function(){return o}),r.d(t,"c",function(){return a});var n=r(0);function i(e,t){return{key:e,node:t}}var o=Object(n.c)("key"),a=Object(n.c)("node")},function(e,t,r){"use strict";r.d(t,"a",function(){return u});var n=r(1),i=r(0),o=r(2),a=r(8),s=r(9);function u(e){var t=Object(n.h)("resume","pause","pipe"),r=Object(i.j)(o.b,t);return e?r(e)||Object(o.d)(e)?Object(a.a)(s.a,e):Object(a.a)(s.a,e.url,e.method,e.body,e.headers,e.withCredentials,e.cached):Object(s.a)()}u.drop=function(){return u.drop}},function(e,t,r){"use strict";r.d(t,"b",function(){return u}),r.d(t,"a",function(){return s});var n=r(3),i=r(4),o=r(2),a=r(1),s={};function u(e){var t=e(n.f).emit,r=e(n.d).emit,u=e(n.i).emit,c=e(n.h).emit;function f(e,t,r){Object(i.c)(Object(a.g)(e))[t]=r}function d(e,r,n){e&&f(e,r,n);var o=Object(a.d)(Object(i.b)(r,n),e);return t(o),o}var h={};return h[n.l]=function(e,t){if(!e)return u(t),d(e,s,t);var r=function(e,t){var r=Object(i.c)(Object(a.g)(e));return Object(o.c)(Array,r)?d(e,Object(o.e)(r),t):e}(e,t),n=Object(a.l)(r),c=Object(i.a)(Object(a.g)(r));return f(n,c,t),Object(a.d)(Object(i.b)(c,t),n)},h[n.k]=function(e){return r(e),Object(a.l)(e)||c(Object(i.c)(Object(a.g)(e)))},h[n.j]=d,h}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(5);t.default=n.a},function(e,t,r){"use strict";r.d(t,"a",function(){return i});var n=r(2);function i(e,t,r,i,o,a,s){return o=o?JSON.parse(JSON.stringify(o)):{},i?(Object(n.d)(i)||(i=JSON.stringify(i),o["Content-Type"]=o["Content-Type"]||"application/json"),o["Content-Length"]=o["Content-Length"]||i.length):i=null,e(r||"GET",function(e,t){return!1===t&&(-1===e.indexOf("?")?e+="?":e+="&",e+="_="+(new Date).getTime()),e}(t,s),i,o,a||!1)}},function(e,t,r){"use strict";r.d(t,"a",function(){return d});var n=r(10),i=r(12),o=r(6),a=r(13),s=r(14),u=r(16),c=r(17),f=r(18);function d(e,t,r,d,h){var l=Object(n.a)();return t&&Object(f.b)(l,Object(f.a)(),e,t,r,d,h),Object(c.a)(l),Object(i.a)(l,Object(o.b)(l)),Object(a.a)(l,s.a),Object(u.a)(l,t)}},function(e,t,r){"use strict";r.d(t,"a",function(){return o});var n=r(11),i=r(0);function o(){var e={},t=o("newListener"),r=o("removeListener");function o(i){return e[i]=Object(n.a)(i,t,r),e[i]}function a(t){return e[t]||o(t)}return["emit","on","un"].forEach(function(e){a[e]=Object(i.k)(function(t,r){Object(i.b)(r,a(t)[e])})}),a}},function(e,t,r){"use strict";r.d(t,"a",function(){return a});var n=r(1),i=r(2),o=r(0);function a(e,t,r){var a,s;function u(e){return function(t){return t.id===e}}return{on:function(r,i){var o={listener:r,id:i||r};return t&&t.emit(e,r,o.id),a=Object(n.d)(o,a),s=Object(n.d)(r,s),this},emit:function(){Object(n.b)(s,arguments)},un:function(t){var i;a=Object(n.m)(a,u(t),function(e){i=e}),i&&(s=Object(n.m)(s,function(e){return e===i.listener}),r&&r.emit(e,i.listener,i.id))},listeners:function(){return s},hasListener:function(e){var t=e?u(e):o.a;return Object(i.a)(Object(n.e)(t,a))}}}},function(e,t,r){"use strict";r.d(t,"a",function(){return a});var n=r(4),i=r(3),o=r(1);function a(e,t){var r,a={};function s(e){return function(t){r=e(r,t)}}for(var u in t)e(u).on(s(t[u]),a);e(i.g).on(function(e){var t=Object(o.g)(r),i=Object(n.a)(t),a=Object(o.l)(r);a&&(Object(n.c)(Object(o.g)(a))[i]=e)}),e(i.e).on(function(){var e=Object(o.g)(r),t=Object(n.a)(e),i=Object(o.l)(r);i&&delete Object(n.c)(Object(o.g)(i))[t]}),e(i.a).on(function(){for(var r in t)e(r).un(a)})}},function(e,t,r){"use strict";r.d(t,"a",function(){return a});var n=r(3),i=r(1),o=r(4);function a(e,t){var r={node:e(n.d),path:e(n.f)};function a(t,r,n){var a=e(t).emit;r.on(function(e){var t=n(e);!1!==t&&function(e,t,r){var n=Object(i.k)(r);e(t,Object(i.i)(Object(i.l)(Object(i.j)(o.a,n))),Object(i.i)(Object(i.j)(o.c,n)))}(a,Object(o.c)(t),e)},t),e("removeListener").on(function(n){n===t&&(e(n).listeners()||r.un(t))})}e("newListener").on(function(e){var n=/(node|path):(.*)/.exec(e);if(n){var i=r[n[1]];i.hasListener(e)||a(e,i,t(n[2]))}})}},function(e,t,r){"use strict";r.d(t,"a",function(){return c});var n=r(0),i=r(1),o=r(4),a=r(2),s=r(6),u=r(15),c=Object(u.a)(function(e,t,r,u,c){var f=Object(n.d)(o.a,i.g),d=Object(n.d)(o.c,i.g);function h(e,t){return t[1]?Object(n.g)(e,i.g):e}function l(e){return e===n.a?n.a:Object(n.g)(function(e){return f(e)!==s.a},Object(n.d)(e,i.l))}function p(){return function(e){return f(e)===s.a}}function b(e,t,r,n,o){var s=e(r);if(s){var u=function(e,t,r){return Object(i.f)(function(e,t){return t(e,r)},t,e)}(t,n,s);return o(r.substr(Object(a.e)(s[0])),u)}}function m(e,t){return Object(n.j)(b,e,t)}var g=Object(n.h)(m(e,Object(i.h)(h,function(e,t){var r=t[3];if(!r)return e;var o=Object(n.j)(a.b,Object(i.c)(r.split(/\W+/))),s=Object(n.d)(o,d);return Object(n.g)(s,e)},function(e,t){var r=t[2],i=r&&"*"!==r?function(e){return String(f(e))===r}:n.a;return Object(n.g)(i,e)},l)),m(t,Object(i.h)(function(e){if(e===n.a)return n.a;var t=p(),r=e,i=l(function(e){return o(e)}),o=Object(n.h)(t,r,i);return o})),m(r,Object(i.h)()),m(u,Object(i.h)(h,p)),m(c,Object(i.h)(function(e){return function(t){var r=e(t);return!0===r?Object(i.g)(t):r}})),function(e){throw Error('"'+e+'" could not be tokenised')});function y(e,t){return t}function v(e,t){return g(e,t,e?v:y)}return function(e){try{return v(e,n.a)}catch(t){throw Error('Could not compile "'+e+'" because '+t.message)}}})},function(e,t,r){"use strict";r.d(t,"a",function(){return b});var n,i,o,a,s,u,c,f,d,h,l,p=r(0),b=(n=Object(p.k)(function(e){return e.unshift(/^/),(t=RegExp(e.map(Object(p.c)("source")).join(""))).exec.bind(t);var t}),a=n(i=/(\$?)/,/([\w-_]+|\*)/,o=/(?:{([\w ]*?)})?/),s=n(i,/\["([^"]+)"\]/,o),u=n(i,/\[(\d+|\*)\]/,o),c=n(i,/()/,/{([\w ]*?)}/),f=n(/\.\./),d=n(/\./),h=n(i,/!/),l=n(/$/),function(e){return e(Object(p.h)(a,s,u,c),f,d,h,l)})},function(e,t,r){"use strict";r.d(t,"a",function(){return s});var n=r(3),i=r(0),o=r(2),a=r(5);function s(e,t){var r,s=/^(node|path):./,u=e(n.h),c=e(n.e).emit,f=e(n.g).emit,d=Object(i.k)(function(t,n){if(r[t])Object(i.b)(n,r[t]);else{var o=e(t),a=n[0];s.test(t)?h(o,p(a)):o.on(a)}return r});function h(e,t,n){n=n||t;var o=l(t);return e.on(function(){var t=!1;r.forget=function(){t=!0},Object(i.b)(arguments,o),delete r.forget,t&&e.un(n)},n),r}function l(e){return function(){try{return e.apply(r,arguments)}catch(e){setTimeout(function(){throw new Error(e.message)})}}}function p(e){return function(){var t=e.apply(this,arguments);Object(o.a)(t)&&(t===a.a.drop?c():f(t))}}function b(t,r,n){var i;i="node"===t?p(n):n,h(function(t,r){return e(t+":"+r)}(t,r),i,n)}function m(e,t,n){return Object(o.d)(t)?b(e,t,n):function(e,t){for(var r in t)b(e,r,t[r])}(e,t),r}return e(n.i).on(function(e){r.root=Object(i.f)(e)}),e(n.c).on(function(e,t){r.header=function(e){return e?t[e]:t}}),r={on:d,addListener:d,removeListener:function(t,n,i){if("done"===t)u.un(n);else if("node"===t||"path"===t)e.un(t+":"+n,i);else{var o=n;e(t).un(o)}return r},emit:e.emit,node:Object(i.j)(m,"node"),path:Object(i.j)(m,"path"),done:Object(i.j)(h,u),start:Object(i.j)(function(t,n){return e(t).on(l(n),n),r},n.c),fail:e(n.b).on,abort:e(n.a).emit,header:i.i,root:i.i,source:t}}},function(e,t,r){"use strict";r.d(t,"a",function(){return i});var n=r(3);function i(e){var t,r,i,o,a=e(n.j).emit,s=e(n.l).emit,u=e(n.k).emit,c=e(n.b).emit,f=/[\\"\n]/g,d=0,h=d++,l=d++,p=d++,b=d++,m=d++,g=d++,y=d++,v=d++,w=d++,_=d++,S=d++,E=d++,k=d++,x=d++,A=d++,O=d++,M=d++,j=d++,R=d++,P=d++,T=65536,I="",C=!1,B=!1,N=h,L=[],D=null,q=0,U=0,F=0,H=0,z=1;function W(e){void 0!==o&&(s(o),u(),o=void 0),t=Error(e+"\nLn: "+z+"\nCol: "+H+"\nChr: "+r),c(Object(n.o)(void 0,void 0,t))}function K(e){return"\r"===e||"\n"===e||" "===e||"\t"===e}e(n.m).on(function(e){if(!t){if(B)return W("Cannot write after close");var n,c=0;for(r=e[0];r&&(c>0&&(i=r),r=e[c++]);)switch(F++,"\n"===r?(z++,H=0):H++,N){case h:if("{"===r)N=p;else if("["===r)N=m;else if(!K(r))return W("Non-whitespace before {[.");continue;case v:case p:if(K(r))continue;if(N===v)L.push(w);else{if("}"===r){s({}),u(),N=L.pop()||l;continue}L.push(b)}if('"'!==r)return W('Malformed object key should start with " ');N=y;continue;case w:case b:if(K(r))continue;if(":"===r)N===b?(L.push(b),void 0!==o&&(s({}),a(o),o=void 0),U++):void 0!==o&&(a(o),o=void 0),N=l;else if("}"===r)void 0!==o&&(s(o),u(),o=void 0),u(),U--,N=L.pop()||l;else{if(","!==r)return W("Bad object");N===b&&L.push(b),void 0!==o&&(s(o),u(),o=void 0),N=v}continue;case m:case l:if(K(r))continue;if(N===m){if(s([]),U++,N=l,"]"===r){u(),U--,N=L.pop()||l;continue}L.push(g)}if('"'===r)N=y;else if("{"===r)N=p;else if("["===r)N=m;else if("t"===r)N=_;else if("f"===r)N=k;else if("n"===r)N=M;else if("-"===r)I+=r;else if("0"===r)I+=r,N=20;else{if(-1==="123456789".indexOf(r))return W("Bad value");I+=r,N=20}continue;case g:if(","===r)L.push(g),void 0!==o&&(s(o),u(),o=void 0),N=l;else{if("]"!==r){if(K(r))continue;return W("Bad array")}void 0!==o&&(s(o),u(),o=void 0),u(),U--,N=L.pop()||l}continue;case y:void 0===o&&(o="");var d=c-1;e:for(;;){for(;q>0;)if(D+=r,r=e.charAt(c++),4===q?(o+=String.fromCharCode(parseInt(D,16)),q=0,d=c-1):q++,!r)break e;if('"'===r&&!C){N=L.pop()||l,o+=e.substring(d,c-1);break}if(!("\\"!==r||C||(C=!0,o+=e.substring(d,c-1),r=e.charAt(c++))))break;if(C){if(C=!1,"n"===r?o+="\n":"r"===r?o+="\r":"t"===r?o+="\t":"f"===r?o+="\f":"b"===r?o+="\b":"u"===r?(q=1,D=""):o+=r,r=e.charAt(c++),d=c-1,r)continue;break}f.lastIndex=c;var V=f.exec(e);if(!V){o+=e.substring(d,(c=e.length+1)-1);break}if(c=V.index+1,!(r=e.charAt(V.index))){o+=e.substring(d,c-1);break}}continue;case _:if(!r)continue;if("r"!==r)return W("Invalid true started with t"+r);N=S;continue;case S:if(!r)continue;if("u"!==r)return W("Invalid true started with tr"+r);N=E;continue;case E:if(!r)continue;if("e"!==r)return W("Invalid true started with tru"+r);s(!0),u(),N=L.pop()||l;continue;case k:if(!r)continue;if("a"!==r)return W("Invalid false started with f"+r);N=x;continue;case x:if(!r)continue;if("l"!==r)return W("Invalid false started with fa"+r);N=A;continue;case A:if(!r)continue;if("s"!==r)return W("Invalid false started with fal"+r);N=O;continue;case O:if(!r)continue;if("e"!==r)return W("Invalid false started with fals"+r);s(!1),u(),N=L.pop()||l;continue;case M:if(!r)continue;if("u"!==r)return W("Invalid null started with n"+r);N=j;continue;case j:if(!r)continue;if("l"!==r)return W("Invalid null started with nu"+r);N=R;continue;case R:if(!r)continue;if("l"!==r)return W("Invalid null started with nul"+r);s(null),u(),N=L.pop()||l;continue;case P:if("."!==r)return W("Leading zero not followed by .");I+=r,N=20;continue;case 20:if(-1!=="0123456789".indexOf(r))I+=r;else if("."===r){if(-1!==I.indexOf("."))return W("Invalid number has two dots");I+=r}else if("e"===r||"E"===r){if(-1!==I.indexOf("e")||-1!==I.indexOf("E"))return W("Invalid number has two exponential");I+=r}else if("+"===r||"-"===r){if("e"!==i&&"E"!==i)return W("Invalid symbol in number");I+=r}else I&&(s(parseFloat(I)),u(),I=""),c--,N=L.pop()||l;continue;default:return W("Unknown state: "+N)}F>=T&&(n=0,void 0!==o&&o.length>65536&&(W("Max buffer length exceeded: textNode"),n=Math.max(n,o.length)),I.length>65536&&(W("Max buffer length exceeded: numberNode"),n=Math.max(n,I.length)),T=65536-n+F)}}),e(n.n).on(function(){if(N===h)return s({}),u(),void(B=!0);N===l&&0===U||W("Unexpected end"),void 0!==o&&(s(o),u(),o=void 0),B=!0})}},function(e,t,r){"use strict";r.d(t,"a",function(){return u}),r.d(t,"b",function(){return c});var n=r(19),i=r(3),o=r(2),a=r(20),s=r(0);function u(){return new XMLHttpRequest}function c(e,t,r,u,c,f,d){var h=e(i.m).emit,l=e(i.b).emit,p=0,b=!0;function m(){if("2"===String(t.status)[0]){var e=t.responseText,r=(" "+e.substr(p)).substr(1);r&&h(r),p=Object(o.e)(e)}}function g(t){try{b&&e(i.c).emit(t.status,Object(a.a)(t.getAllResponseHeaders())),b=!1}catch(e){}}e(i.a).on(function(){t.onreadystatechange=null,t.abort()}),"onprogress"in t&&(t.onprogress=m),t.onreadystatechange=function(){switch(t.readyState){case 2:case 3:return g(t);case 4:g(t),"2"===String(t.status)[0]?(m(),e(i.n).emit()):l(Object(i.o)(t.status,t.responseText))}};try{for(var y in t.open(r,u,!0),f)t.setRequestHeader(y,f[y]);Object(n.a)(window.location,Object(n.b)(u))||t.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.withCredentials=d,t.send(c)}catch(e){window.setTimeout(Object(s.j)(l,Object(i.o)(void 0,void 0,e)),0)}}},function(e,t,r){"use strict";function n(e,t){function r(t){return String(t.port||{"http:":80,"https:":443}[t.protocol||e.protocol])}return!!(t.protocol&&t.protocol!==e.protocol||t.host&&t.host!==e.host||t.host&&r(t)!==r(e))}function i(e){var t=/(\w+:)?(?:\/\/)([\w.-]+)?(?::(\d+))?\/?/.exec(e)||[];return{protocol:t[1]||"",host:t[2]||"",port:t[3]||""}}r.d(t,"a",function(){return n}),r.d(t,"b",function(){return i})},function(e,t,r){"use strict";function n(e){var t={};return e&&e.split("\r\n").forEach(function(e){var r=e.indexOf(": ");t[e.substring(0,r)]=e.substring(r+2)}),t}r.d(t,"a",function(){return n})}]).default},e.exports=n()},function(e,t,r){"use strict";var n=r(21).formatters,i=r(127),o=r(33);e.exports=function(e){var t=function(t){var r;return t.property?(e[t.property]||(e[t.property]={}),r=e[t.property]):r=e,t.methods&&t.methods.forEach(function(t){t instanceof i||(t=new i(t)),t.attachToObject(r),t.setRequestManager(e._requestManager)}),e};return t.formatters=n,t.utils=o,t.Method=i,t}},function(e,t,r){"use strict";var n=r(29),i=r(21).errors,o=r(72),a=r(21).formatters;function s(e){o.call(this),this.id=null,this.callback=n.identity,this.arguments=null,this.lastBlock=null,this.options={subscription:e.subscription,type:e.type,requestManager:e.requestManager}}(s.prototype=Object.create(o.prototype)).constructor=s,s.prototype._extractCallback=function(e){if(n.isFunction(e[e.length-1]))return e.pop()},s.prototype._validateArgs=function(e){var t=this.options.subscription;if(t||(t={}),t.params||(t.params=0),e.length!==t.params)throw i.InvalidNumberOfParams(e.length,t.params,t.subscriptionName)},s.prototype._formatInput=function(e){var t=this.options.subscription;return t&&t.inputFormatter?t.inputFormatter.map(function(t,r){return t?t(e[r]):e[r]}):e},s.prototype._formatOutput=function(e){var t=this.options.subscription;return t&&t.outputFormatter&&e?t.outputFormatter(e):e},s.prototype._toPayload=function(e){var t=[];if(this.callback=this._extractCallback(e)||n.identity,this.subscriptionMethod||(this.subscriptionMethod=e.shift(),this.options.subscription.subscriptionName&&(this.subscriptionMethod=this.options.subscription.subscriptionName)),this.arguments||(this.arguments=this._formatInput(e),this._validateArgs(this.arguments),e=[]),t.push(this.subscriptionMethod),t=t.concat(this.arguments),e.length)throw new Error("Only a callback is allowed as parameter on an already instantiated subscription.");return{method:this.options.type+"_subscribe",params:t}},s.prototype.unsubscribe=function(e){this.options.requestManager.removeSubscription(this.id,e),this.id=null,this.lastBlock=null,this.removeAllListeners()},s.prototype.subscribe=function(){var e=this,t=Array.prototype.slice.call(arguments),r=this._toPayload(t);if(!r)return this;if(!this.options.requestManager.provider)return setTimeout(function(){var t=new Error("No provider set.");e.callback(t,null,e),e.emit("error",t)},0),this;if(!this.options.requestManager.provider.on)return setTimeout(function(){var t=new Error("The current provider doesn't support subscriptions: "+e.options.requestManager.provider.constructor.name);e.callback(t,null,e),e.emit("error",t)},0),this;if(this.lastBlock&&n.isObject(this.options.params)&&(r.params[1]=this.options.params,r.params[1].fromBlock=a.inputBlockNumberFormatter(this.lastBlock+1)),this.id&&this.unsubscribe(),this.options.params=r.params[1],"logs"===r.params[0]&&n.isObject(r.params[1])&&r.params[1].hasOwnProperty("fromBlock")&&isFinite(r.params[1].fromBlock)){var i=Object.assign({},r.params[1]);this.options.requestManager.send({method:"eth_getLogs",params:[i]},function(t,r){t?setTimeout(function(){e.callback(t,null,e),e.emit("error",t)},0):r.forEach(function(t){var r=e._formatOutput(t);e.callback(null,r,e),e.emit("data",r)})})}return"object"==typeof r.params[1]&&delete r.params[1].fromBlock,this.options.requestManager.send(r,function(t,i){!t&&i?(e.id=i,e.method=r.params[0],e.emit("connected",i),e.options.requestManager.addSubscription(e,function(t,r){t?(e.callback(t,!1,e),e.emit("error",t)):(n.isArray(r)||(r=[r]),r.forEach(function(t){var r=e._formatOutput(t);if(e.lastBlock=n.isObject(r)?r.blockNumber:null,n.isFunction(e.options.subscription.subscriptionHandler))return e.options.subscription.subscriptionHandler.call(e,r);e.emit("data",r),e.callback(null,r,e)}))})):setTimeout(function(){e.callback(t,!1,e),e.emit("error",t)},0)}),this},s.prototype.resubscribe=function(){this.options.requestManager.removeSubscription(this.id),this.id=null,this.subscribe(this.callback)},e.exports=s},function(e,t,r){"use strict";t.sha1=r(259),t.sha224=r(260),t.sha256=r(131),t.sha384=r(261),t.sha512=r(132)},function(e,t,r){"use strict";var n=r(28),i=r(53),o=r(130),a=n.rotl32,s=n.sum32,u=n.sum32_5,c=o.ft_1,f=i.BlockHash,d=[1518500249,1859775393,2400959708,3395469782];function h(){if(!(this instanceof h))return new h;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(h,f),e.exports=h,h.blockSize=512,h.outSize=160,h.hmacStrength=80,h.padLength=64,h.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=a(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],f=this.h[2],h=this.h[3],l=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),b=u(a(i,5),c(p,o,f,h),l,r[n],d[p]);l=h,h=f,f=a(o,30),o=i,i=b}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],f),this.h[3]=s(this.h[3],h),this.h[4]=s(this.h[4],l)},h.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(e,t,r){"use strict";var n=r(28),i=r(131);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},function(e,t,r){"use strict";var n=r(28),i=r(132);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},function(e,t,r){"use strict";var n=r(28),i=r(53),o=n.rotl32,a=n.sum32,s=n.sum32_3,u=n.sum32_4,c=i.BlockHash;function f(){if(!(this instanceof f))return new f;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function d(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function h(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function l(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(f,c),t.ripemd160=f,f.blockSize=512,f.outSize=160,f.hmacStrength=192,f.padLength=64,f.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],c=this.h[3],f=this.h[4],y=r,v=n,w=i,_=c,S=f,E=0;E<80;E++){var k=a(o(u(r,d(E,n,i,c),e[p[E]+t],h(E)),m[E]),f);r=f,f=c,c=o(i,10),i=n,n=k,k=a(o(u(y,d(79-E,v,w,_),e[b[E]+t],l(E)),g[E]),S),y=S,S=_,_=o(w,10),w=v,v=k}k=s(this.h[1],i,_),this.h[1]=s(this.h[2],c,S),this.h[2]=s(this.h[3],f,y),this.h[3]=s(this.h[4],r,v),this.h[4]=s(this.h[0],n,w),this.h[0]=k},f.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],b=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],m=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],g=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},function(e,t,r){"use strict";var n=r(28),i=r(22);function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=o,o.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},function(e,t,r){var n=r(11).Buffer,i=r(29),o=r(33),a=r(188).AbiCoder,s=r(188).ParamType,u=new a(function(e,t){return!e.match(/^u?int/)||i.isArray(t)||i.isObject(t)&&"BN"===t.constructor.name?t:t.toString()});function c(){}var f=function(){};f.prototype.encodeFunctionSignature=function(e){return i.isObject(e)&&(e=o._jsonInterfaceMethodToString(e)),o.sha3(e).slice(0,10)},f.prototype.encodeEventSignature=function(e){return i.isObject(e)&&(e=o._jsonInterfaceMethodToString(e)),o.sha3(e)},f.prototype.encodeParameter=function(e,t){return this.encodeParameters([e],[t])},f.prototype.encodeParameters=function(e,t){var r=this;return e=r.mapTypes(e),t=t.map(function(t,n){let i=e[n];if("object"==typeof i&&i.type&&(i=i.type),t=r.formatParam(i,t),"string"==typeof i&&i.includes("tuple")){const e=u._getCoder(s.from(i)),n=(e,t)=>{if("array"===e.name)return t.map(t=>n(u._getCoder(s.from(e.type.replace("[]",""))),t));e.coders.forEach((e,i)=>{"tuple"===e.name?n(e,t[i]):t[i]=r.formatParam(e.name,t[i])})};n(e,t)}return t}),u.encode(e,t)},f.prototype.mapTypes=function(e){var t=this,r=[];return e.forEach(function(e){if("object"==typeof e&&"function"===e.type&&(e=Object.assign({},e,{type:"bytes24"})),t.isSimplifiedStructFormat(e)){var n=Object.keys(e)[0];r.push(Object.assign(t.mapStructNameAndType(n),{components:t.mapStructToCoderFormat(e[n])}))}else r.push(e)}),r},f.prototype.isSimplifiedStructFormat=function(e){return"object"==typeof e&&void 0===e.components&&void 0===e.name},f.prototype.mapStructNameAndType=function(e){var t="tuple";return e.indexOf("[]")>-1&&(t="tuple[]",e=e.slice(0,-2)),{type:t,name:e}},f.prototype.mapStructToCoderFormat=function(e){var t=this,r=[];return Object.keys(e).forEach(function(n){r.push("object"!=typeof e[n]?{name:n,type:e[n]}:Object.assign(t.mapStructNameAndType(n),{components:t.mapStructToCoderFormat(e[n])}))}),r},f.prototype.formatParam=function(e,t){const r=new RegExp(/^bytes([0-9]*)$/),i=new RegExp(/^bytes([0-9]*)\[\]$/),a=new RegExp(/^(u?int)([0-9]*)$/),s=new RegExp(/^(u?int)([0-9]*)\[\]$/);if(o.isBN(t)||o.isBigNumber(t))return t.toString(10);if(e.match(i)||e.match(s))return t.map(t=>this.formatParam(e.replace("[]",""),t));let u=e.match(a);if(u){let e=parseInt(u[2]||"256");e/8<t.length&&(t=o.leftPad(t,e))}if(u=e.match(r),u){n.isBuffer(t)&&(t=o.toHex(t));let e=parseInt(u[1]);if(e){let r=2*e;"0x"===t.substring(0,2)&&(r+=2),t.length<r&&(t=o.rightPad(t,2*e))}t.length%2==1&&(t="0x0"+t.substring(2))}return t},f.prototype.encodeFunctionCall=function(e,t){return this.encodeFunctionSignature(e)+this.encodeParameters(e.inputs,t).replace("0x","")},f.prototype.decodeParameter=function(e,t){return this.decodeParameters([e],t)[0]},f.prototype.decodeParameters=function(e,t){return this.decodeParametersWith(e,t,!1)},f.prototype.decodeParametersWith=function(e,t,r){if(e.length>0&&(!t||"0x"===t||"0X"===t))throw new Error("Returned values aren't valid, did it run Out of Gas? You might also see this error if you are not using the correct ABI for the contract you are retrieving data from, requesting data from a block number that does not exist, or querying a node which is not fully synced.");var n=u.decode(this.mapTypes(e),"0x"+t.replace(/0x/i,""),r),o=new c;return o.__length__=0,e.forEach(function(e,t){var r=n[o.__length__];o[t]=r="0x"===r?null:r,i.isObject(e)&&e.name&&(o[e.name]=r),o.__length__++}),o},f.prototype.decodeLog=function(e,t,r){var n=this;r=i.isArray(r)?r:[r],t=t||"";var o=[],a=[],s=0;e.forEach(function(e,t){e.indexed?(a[t]=["bool","int","uint","address","fixed","ufixed"].find(function(t){return-1!==e.type.indexOf(t)})?n.decodeParameter(e.type,r[s]):r[s],s++):o[t]=e});var u=t?this.decodeParametersWith(o,t,!0):[],f=new c;return f.__length__=0,e.forEach(function(e,t){f[t]="string"===e.type?"":null,void 0!==u[t]&&(f[t]=u[t]),void 0!==a[t]&&(f[t]=a[t]),e.name&&(f[e.name]=f[t]),f.__length__++}),f};var d=new f;e.exports=d},function(e,t,r){var n="undefined"!=typeof JSON?JSON:r(266);e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r=t.space||"";"number"==typeof r&&(r=Array(r+1).join(" "));var a,s="boolean"==typeof t.cycles&&t.cycles,u=t.replacer||function(e,t){return t},c=t.cmp&&(a=t.cmp,function(e){return function(t,r){return a({key:t,value:e[t]},{key:r,value:e[r]})}}),f=[];return function e(t,a,d,h){var l=r?"\n"+new Array(h+1).join(r):"",p=r?": ":":";if(d&&d.toJSON&&"function"==typeof d.toJSON&&(d=d.toJSON()),void 0!==(d=u.call(t,a,d))){if("object"!=typeof d||null===d)return n.stringify(d);if(i(d)){for(var b=[],m=0;m<d.length;m++){var g=e(d,m,d[m],h+1)||n.stringify(null);b.push(l+r+g)}return"["+b.join(",")+l+"]"}if(-1!==f.indexOf(d)){if(s)return n.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}f.push(d);var y=o(d).sort(c&&c(d));for(b=[],m=0;m<y.length;m++){var v=e(d,a=y[m],d[a],h+1);if(v){var w=n.stringify(a)+p+v;b.push(l+r+w)}}return f.splice(f.indexOf(d),1),"{"+b.join(",")+l+"}"}}({"":e},"",e,0)};var i=Array.isArray||function(e){return"[object Array]"==={}.toString.call(e)},o=Object.keys||function(e){var t=Object.prototype.hasOwnProperty||function(){return!0},r=[];for(var n in e)t.call(e,n)&&r.push(n);return r}},function(e,t,r){t.parse=r(267),t.stringify=r(268)},function(e,t){var r,n,i,o,a={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"},s=function(e){throw{name:"SyntaxError",message:e,at:r,text:i}},u=function(e){return e&&e!==n&&s("Expected '"+e+"' instead of '"+n+"'"),n=i.charAt(r),r+=1,n},c=function(){var e,t="";for("-"===n&&(t="-",u("-"));n>="0"&&n<="9";)t+=n,u();if("."===n)for(t+=".";u()&&n>="0"&&n<="9";)t+=n;if("e"===n||"E"===n)for(t+=n,u(),"-"!==n&&"+"!==n||(t+=n,u());n>="0"&&n<="9";)t+=n,u();if(e=+t,isFinite(e))return e;s("Bad number")},f=function(){var e,t,r,i="";if('"'===n)for(;u();){if('"'===n)return u(),i;if("\\"===n)if(u(),"u"===n){for(r=0,t=0;t<4&&(e=parseInt(u(),16),isFinite(e));t+=1)r=16*r+e;i+=String.fromCharCode(r)}else{if("string"!=typeof a[n])break;i+=a[n]}else i+=n}s("Bad string")},d=function(){for(;n&&n<=" ";)u()};o=function(){switch(d(),n){case"{":return function(){var e,t={};if("{"===n){if(u("{"),d(),"}"===n)return u("}"),t;for(;n;){if(e=f(),d(),u(":"),Object.hasOwnProperty.call(t,e)&&s('Duplicate key "'+e+'"'),t[e]=o(),d(),"}"===n)return u("}"),t;u(","),d()}}s("Bad object")}();case"[":return function(){var e=[];if("["===n){if(u("["),d(),"]"===n)return u("]"),e;for(;n;){if(e.push(o()),d(),"]"===n)return u("]"),e;u(","),d()}}s("Bad array")}();case'"':return f();case"-":return c();default:return n>="0"&&n<="9"?c():function(){switch(n){case"t":return u("t"),u("r"),u("u"),u("e"),!0;case"f":return u("f"),u("a"),u("l"),u("s"),u("e"),!1;case"n":return u("n"),u("u"),u("l"),u("l"),null}s("Unexpected '"+n+"'")}()}},e.exports=function(e,t){var a;return i=e,r=0,n=" ",a=o(),d(),n&&s("Syntax error"),"function"==typeof t?function e(r,n){var i,o,a=r[n];if(a&&"object"==typeof a)for(i in a)Object.prototype.hasOwnProperty.call(a,i)&&(void 0!==(o=e(a,i))?a[i]=o:delete a[i]);return t.call(r,n,a)}({"":a},""):a}},function(e,t){var r,n,i,o=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};function s(e){return o.lastIndex=0,o.test(e)?'"'+e.replace(o,function(e){var t=a[e];return"string"==typeof t?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}e.exports=function(e,t,o){var a;if(r="",n="","number"==typeof o)for(a=0;a<o;a+=1)n+=" ";else"string"==typeof o&&(n=o);if(i=t,t&&"function"!=typeof t&&("object"!=typeof t||"number"!=typeof t.length))throw new Error("JSON.stringify");return function e(t,o){var a,u,c,f,d,h=r,l=o[t];switch(l&&"object"==typeof l&&"function"==typeof l.toJSON&&(l=l.toJSON(t)),"function"==typeof i&&(l=i.call(o,t,l)),typeof l){case"string":return s(l);case"number":return isFinite(l)?String(l):"null";case"boolean":case"null":return String(l);case"object":if(!l)return"null";if(r+=n,d=[],"[object Array]"===Object.prototype.toString.apply(l)){for(f=l.length,a=0;a<f;a+=1)d[a]=e(a,l)||"null";return c=0===d.length?"[]":r?"[\n"+r+d.join(",\n"+r)+"\n"+h+"]":"["+d.join(",")+"]",r=h,c}if(i&&"object"==typeof i)for(f=i.length,a=0;a<f;a+=1)"string"==typeof(u=i[a])&&(c=e(u,l))&&d.push(s(u)+(r?": ":":")+c);else for(u in l)Object.prototype.hasOwnProperty.call(l,u)&&(c=e(u,l))&&d.push(s(u)+(r?": ":":")+c);return c=0===d.length?"{}":r?"{\n"+r+d.join(",\n"+r)+"\n"+h+"}":"{"+d.join(",")+"}",r=h,c}}("",{"":e})}},function(e,t,r){"use strict";(function(e,n){var i=new(0,r(54).ec)("secp256k1"),o=e.crypto||e.msCrypto||{},a=o.subtle||o.webkitSubtle,s=r(283);const u=n.from("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141","hex"),c=n.alloc(32,0);function f(e,t){if(!e)throw new Error(t||"Assertion failed")}function d(e){return!(!n.isBuffer(t=e)||32!==t.length)&&e.compare(c)>0&&e.compare(u)<0;var t}function h(e){var t=new Uint8Array(e);return void 0===o.getRandomValues?n.from(s.randomBytes(e)):(o.getRandomValues(t),n.from(t))}function l(e){return new Promise(function(t){var r=s.createHash("sha512").update(e).digest();t(new Uint8Array(r))})}function p(e){return function(t,r,i){return new Promise(function(o){if(a)return a.importKey("raw",r,{name:"AES-CBC"},!1,[e]).then(function(r){return a[e]({name:"AES-CBC",iv:t},r,i)}).then(function(e){o(n.from(new Uint8Array(e)))});if("encrypt"===e){var u=s.createCipheriv("aes-256-cbc",r,t);let e=u.update(i),a=u.final();o(n.concat([e,a]))}else if("decrypt"===e){var c=s.createDecipheriv("aes-256-cbc",r,t);let e=c.update(i),a=c.final();o(n.concat([e,a]))}})}}var b=p("encrypt"),m=p("decrypt");t.generatePrivate=function(){for(var e=h(32);!d(e);)e=h(32);return e};var g=t.getPublic=function(e){return f(32===e.length,"Bad private key"),f(d(e),"Bad private key"),n.from(i.keyFromPrivate(e).getPublic("arr"))};t.getPublicCompressed=function(e){return f(32===e.length,"Bad private key"),f(d(e),"Bad private key"),n.from(i.keyFromPrivate(e).getPublic(!0,"arr"))},t.sign=function(e,t){return new Promise(function(r){f(32===e.length,"Bad private key"),f(d(e),"Bad private key"),f(t.length>0,"Message should not be empty"),f(t.length<=32,"Message is too long"),r(n.from(i.sign(t,e,{canonical:!0}).toDER()))})},t.verify=function(e,t,r){return new Promise(function(n,o){f(65===e.length||33===e.length,"Bad public key"),65===e.length&&f(4===e[0],"Bad public key"),33===e.length&&f(2===e[0]||3===e[0],"Bad public key"),f(t.length>0,"Message should not be empty"),f(t.length<=32,"Message is too long"),i.verify(t,r,e)?n(null):o(new Error("Bad signature"))})};var y=t.derive=function(e,t){return new Promise(function(r){f(n.isBuffer(e),"Bad private key"),f(n.isBuffer(t),"Bad public key"),f(32===e.length,"Bad private key"),f(d(e),"Bad private key"),f(65===t.length||33===t.length,"Bad public key"),65===t.length&&f(4===t[0],"Bad public key"),33===t.length&&f(2===t[0]||3===t[0],"Bad public key");var o=i.keyFromPrivate(e),a=i.keyFromPublic(t),s=o.derive(a.getPublic());r(n.from(s.toArray()))})};t.encrypt=function(e,t,r){var i,o,a,u;return r=r||{},new Promise(function(t){for(var n=r.ephemPrivateKey||h(32);!d(n);)n=r.ephemPrivateKey||h(32);o=g(n),t(y(n,e))}).then(function(e){return l(e)}).then(function(e){i=r.iv||h(16);var n=e.slice(0,32);return u=e.slice(32),b(i,n,t)}).then(function(e){var t=n.concat([i,o,a=e]);return function(e,t){return new Promise(function(r){var i=s.createHmac("sha256",n.from(e));i.update(t),r(i.digest())})}(u,t)}).then(function(e){return{iv:i,ephemPublicKey:o,ciphertext:a,mac:e}})},t.decrypt=function(e,t){var r;return y(e,t.ephemPublicKey).then(function(e){return l(e)}).then(function(e){r=e.slice(0,32);var i,o,a,u=e.slice(32),c=n.concat([t.iv,t.ephemPublicKey,t.ciphertext]);return i=u,o=c,a=t.mac,new Promise(function(e){var t=s.createHmac("sha256",n.from(i));t.update(o),e(function(e,t){if(e.length!==t.length)return!1;for(var r=0,n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r}(t.digest(),a))})}).then(function(e){return f(e,"Bad MAC"),m(t.iv,r,t.ciphertext)}).then(function(e){return n.from(new Uint8Array(e))})}}).call(this,r(10),r(11).Buffer)},function(e){e.exports=JSON.parse('{"_args":[["elliptic@6.5.4","/home/circleci/torus-embed"]],"_from":"elliptic@6.5.4","_id":"elliptic@6.5.4","_inBundle":false,"_integrity":"sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==","_location":"/elliptic","_phantomChildren":{},"_requested":{"type":"version","registry":true,"raw":"elliptic@6.5.4","name":"elliptic","escapedName":"elliptic","rawSpec":"6.5.4","saveSpec":null,"fetchSpec":"6.5.4"},"_requiredBy":["/@ethersproject/signing-key","/@toruslabs/eccrypto","/@toruslabs/torus.js","/browserify-sign","/create-ecdh","/eth-lib","/secp256k1"],"_resolved":"https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz","_spec":"6.5.4","_where":"/home/circleci/torus-embed","author":{"name":"Fedor Indutny","email":"fedor@indutny.com"},"bugs":{"url":"https://github.com/indutny/elliptic/issues"},"dependencies":{"bn.js":"^4.11.9","brorand":"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1","inherits":"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"},"description":"EC cryptography","devDependencies":{"brfs":"^2.0.2","coveralls":"^3.1.0","eslint":"^7.6.0","grunt":"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1","istanbul":"^0.4.5","mocha":"^8.0.1"},"files":["lib"],"homepage":"https://github.com/indutny/elliptic","keywords":["EC","Elliptic","curve","Cryptography"],"license":"MIT","main":"lib/elliptic.js","name":"elliptic","repository":{"type":"git","url":"git+ssh://git@github.com/indutny/elliptic.git"},"scripts":{"lint":"eslint lib test","lint:fix":"npm run lint -- --fix","test":"npm run lint && npm run unit","unit":"istanbul test _mocha --reporter=spec test/index.js","version":"grunt dist && git add dist/"},"version":"6.5.4"}')},function(e,t){},function(e,t,r){"use strict";var n=r(23),i=r(1),o=r(3),a=r(63),s=n.assert;function u(e){a.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(e,t,r,n){a.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function f(e,t,r,n){a.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(u,a),e.exports=u,u.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new i(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new i(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:s(0===this.g.mul(r=o[1]).x.cmp(this.g.x.redMul(t)))}return{beta:t,lambda:r,basis:e.basis?e.basis.map(function(e){return{a:new i(e.a,16),b:new i(e.b,16)}}):this._getEndoBasis(r)}}},u.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),r=new i(2).toRed(t).redInvm(),n=r.redNeg(),o=new i(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},u.prototype._getEndoBasis=function(e){for(var t,r,n,o,a,s,u,c,f,d=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=e,l=this.n.clone(),p=new i(1),b=new i(0),m=new i(0),g=new i(1),y=0;0!==h.cmpn(0);){var v=l.div(h);c=l.sub(v.mul(h)),f=m.sub(v.mul(p));var w=g.sub(v.mul(b));if(!n&&c.cmp(d)<0)t=u.neg(),r=p,n=c.neg(),o=f;else if(n&&2==++y)break;u=c,l=h,h=c,m=p,p=f,g=b,b=w}a=c.neg(),s=f;var _=n.sqr().add(o.sqr());return a.sqr().add(s.sqr()).cmp(_)>=0&&(a=t,s=r),n.negative&&(n=n.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:o},{a:a,b:s}]},u.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),c=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},u.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},u.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(t[o]),s=e[o],u=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),u=u.neg(!0)),n[2*o]=s,n[2*o+1]=u,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var c=this._wnafMulAdd(1,n,i,2*o,r),f=0;f<2*o;f++)n[f]=null,i[f]=null;return c},o(c,a.BasePoint),u.prototype.point=function(e,t,r){return new c(this,e,t,r)},u.prototype.pointFromJSON=function(e,t){return c.fromJSON(this,e,t)},c.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},c.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},c.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},c.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new i(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},c.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(f,a.BasePoint),u.prototype.jpoint=function(e,t,r){return new f(this,e,t,r)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),f=c.redMul(s),d=n.redMul(c),h=u.redSqr().redIAdd(f).redISub(d).redISub(d),l=u.redMul(d.redISub(h)).redISub(o.redMul(f)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,l,p)},f.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),f=r.redMul(u),d=s.redSqr().redIAdd(c).redISub(f).redISub(f),h=s.redMul(f.redISub(d)).redISub(i.redMul(c)),l=this.z.redMul(a);return this.curve.jpoint(d,h,l)},f.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,s=this.z,u=s.redSqr().redSqr(),c=a.redAdd(a);for(t=0;t<e;t++){var f=o.redSqr(),d=c.redSqr(),h=d.redSqr(),l=f.redAdd(f).redIAdd(f).redIAdd(n.redMul(u)),p=o.redMul(d),b=l.redSqr().redISub(p.redAdd(p)),m=p.redISub(b),g=l.redMul(m);g=g.redIAdd(g).redISub(h);var y=c.redMul(s);t+1<e&&(u=u.redMul(h)),o=b,s=y,c=g}return this.curve.jpoint(o,c.redMul(i),s)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},f.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n),u=s.redSqr().redISub(a).redISub(a),c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),e=u,t=s.redMul(a.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var f=this.x.redSqr(),d=this.y.redSqr(),h=d.redSqr(),l=this.x.redAdd(d).redSqr().redISub(f).redISub(h);l=l.redIAdd(l);var p=f.redAdd(f).redIAdd(f),b=p.redSqr(),m=h.redIAdd(h);m=(m=m.redIAdd(m)).redIAdd(m),e=b.redISub(l).redISub(l),t=p.redMul(l.redISub(e)).redISub(m),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},f.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=s.redSqr().redISub(a).redISub(a);e=u;var c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),t=s.redMul(a.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var f=this.z.redSqr(),d=this.y.redSqr(),h=this.x.redMul(d),l=this.x.redSub(f).redMul(this.x.redAdd(f));l=l.redAdd(l).redIAdd(l);var p=h.redIAdd(h),b=(p=p.redIAdd(p)).redAdd(p);e=l.redSqr().redISub(b),r=this.y.redAdd(this.z).redSqr().redISub(d).redISub(f);var m=d.redSqr();m=(m=(m=m.redIAdd(m)).redIAdd(m)).redIAdd(m),t=l.redMul(p.redISub(e)).redISub(m)}return this.curve.jpoint(e,t,r)},f.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),a=r.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),u=t.redAdd(t),c=(u=u.redIAdd(u)).redMul(a),f=s.redSqr().redISub(c.redAdd(c)),d=c.redISub(f),h=a.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var l=s.redMul(d).redISub(h),p=r.redAdd(r).redMul(n);return this.curve.jpoint(f,l,p)},f.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(n),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var c=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(u),f=t.redMul(c);f=(f=f.redIAdd(f)).redIAdd(f);var d=this.x.redMul(s).redISub(f);d=(d=d.redIAdd(d)).redIAdd(d);var h=this.y.redMul(c.redMul(u.redISub(c)).redISub(a.redMul(s)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var l=this.z.redAdd(a).redSqr().redISub(r).redISub(s);return this.curve.jpoint(d,h,l)},f.prototype.mul=function(e,t){return e=new i(e,t),this.curve._wnafMul(this,e)},f.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},f.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},f.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(e,t,r){"use strict";var n=r(1),i=r(3),o=r(63),a=r(23);function s(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function u(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(s,o),e.exports=s,s.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},i(u,o.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(a.toArray(e,t),1)},s.prototype.point=function(e,t){return new u(this,e,t)},s.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},u.prototype.precompute=function(){},u.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},u.fromJSON=function(e,t){return new u(e,t[0],t[1]||e.one)},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},u.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},u.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),s=t.z.redMul(o.redAdd(a).redSqr()),u=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,u)},u.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},u.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},u.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},u.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(e,t,r){"use strict";var n=r(23),i=r(1),o=r(3),a=r(63),s=n.assert;function u(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,a.call(this,"edwards",e),this.a=new i(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function c(e,t,r,n,o){a.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(t,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(u,a),e.exports=u,u.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},u.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},u.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},u.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(o.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var u=s.fromRed().isOdd();return(t&&!u||!t&&u)&&(s=s.redNeg()),this.point(e,s)},u.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(o.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==t&&(s=s.redNeg()),this.point(s,e)},u.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},o(c,a.BasePoint),u.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},u.prototype.point=function(e,t,r,n){return new c(this,e,t,r,n)},c.fromJSON=function(e,t){return new c(e,t[0],t[1],t[2])},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),s=n.redSub(t),u=i.redMul(a),c=o.redMul(s),f=i.redMul(s),d=a.redMul(o);return this.curve.point(u,c,d,f)},c.prototype._projDbl=function(){var e,t,r,n,i,o,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),u=this.y.redSqr();if(this.curve.twisted){var c=(n=this.curve._mulA(s)).redAdd(u);this.zOne?(e=a.redSub(s).redSub(u).redMul(c.redSub(this.curve.two)),t=c.redMul(n.redSub(u)),r=c.redSqr().redSub(c).redSub(c)):(i=this.z.redSqr(),o=c.redSub(i).redISub(i),e=a.redSub(s).redISub(u).redMul(o),t=c.redMul(n.redSub(u)),r=c.redMul(o))}else n=s.redAdd(u),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(a.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(s.redISub(u)),r=n.redMul(o);return this.curve.point(e,t,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),s=i.redAdd(n),u=r.redAdd(t),c=o.redMul(a),f=s.redMul(u),d=o.redMul(u),h=a.redMul(s);return this.curve.point(c,f,h,d)},c.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),u=i.redSub(s),c=i.redAdd(s),f=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),d=n.redMul(u).redMul(f);return this.curve.twisted?(t=n.redMul(c).redMul(a.redSub(this.curve._mulA(o))),r=u.redMul(c)):(t=n.redMul(c).redMul(a.redSub(o)),r=this.curve._mulC(u).redMul(c)),this.curve.point(d,t,r)},c.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},c.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},c.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},c.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},function(e,t){e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},function(e,t,r){"use strict";var n=r(1),i=r(277),o=r(23),a=r(77),s=r(76),u=o.assert,c=r(278),f=r(279);function d(e){if(!(this instanceof d))return new d(e);"string"==typeof e&&(u(Object.prototype.hasOwnProperty.call(a,e),"Unknown curve "+e),e=a[e]),e instanceof a.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=d,d.prototype.keyPair=function(e){return new c(this,e)},d.prototype.keyFromPrivate=function(e,t){return c.fromPrivate(this,e,t)},d.prototype.keyFromPublic=function(e,t){return c.fromPublic(this,e,t)},d.prototype.genKeyPair=function(e){e||(e={});for(var t=new i({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||s(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var a=new n(t.generate(r));if(!(a.cmp(o)>0))return a.iaddn(1),this.keyFromPrivate(a)}},d.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},d.prototype.sign=function(e,t,r,o){"object"==typeof r&&(o=r,r=null),o||(o={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new n(e,16));for(var a=this.n.byteLength(),s=t.getPrivate().toArray("be",a),u=e.toArray("be",a),c=new i({hash:this.hash,entropy:s,nonce:u,pers:o.pers,persEnc:o.persEnc||"utf8"}),d=this.n.sub(new n(1)),h=0;;h++){var l=o.k?o.k(h):new n(c.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(d)>=0)){var p=this.g.mul(l);if(!p.isInfinity()){var b=p.getX(),m=b.umod(this.n);if(0!==m.cmpn(0)){var g=l.invm(this.n).mul(m.mul(t.getPrivate()).iadd(e));if(0!==(g=g.umod(this.n)).cmpn(0)){var y=(p.getY().isOdd()?1:0)|(0!==b.cmp(m)?2:0);return o.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),y^=1),new f({r:m,s:g,recoveryParam:y})}}}}}},d.prototype.verify=function(e,t,r,i){e=this._truncateToN(new n(e,16)),r=this.keyFromPublic(r,i);var o=(t=new f(t,"hex")).r,a=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,u=a.invm(this.n),c=u.mul(e).umod(this.n),d=u.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),d)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(c,r.getPublic(),d)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},d.prototype.recoverPubKey=function(e,t,r,i){u((3&r)===r,"The recovery param is more than two bits"),t=new f(t,i);var o=this.n,a=new n(e),s=t.r,c=t.s,d=1&r,h=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");s=this.curve.pointFromX(h?s.add(this.curve.n):s,d);var l=t.r.invm(o),p=o.sub(a).mul(l).umod(o),b=c.mul(l).umod(o);return this.g.mulAdd(p,s,b)},d.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new f(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(e,t,r){"use strict";var n=r(20),i=r(133),o=r(22);function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=a,a.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},a.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},a.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},a.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=i.toArray(e,t),r=i.toArray(r,n),o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var a=o.slice(0,e);return this._update(r),this._reseed++,i.encode(a,t)}},function(e,t,r){"use strict";var n=r(1),i=r(23).assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=o,o.fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.validate()||i(e.validate(),"public point not validated"),e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},function(e,t,r){"use strict";var n=r(1),i=r(23),o=i.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),this.recoveryParam=void 0===e.recoveryParam?null:e.recoveryParam)}function s(){this.place=0}function u(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=t.place;o<n;o++,a++)i<<=8,i|=e[a],i>>>=0;return!(i<=127)&&(t.place=a,i)}function c(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function f(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=a,a.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new s;if(48!==e[r.place++])return!1;var o=u(e,r);if(!1===o)return!1;if(o+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var a=u(e,r);if(!1===a)return!1;var c=e.slice(r.place,a+r.place);if(r.place+=a,2!==e[r.place++])return!1;var f=u(e,r);if(!1===f)return!1;if(e.length!==f+r.place)return!1;var d=e.slice(r.place,f+r.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}return this.r=new n(c),this.s=new n(d),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=c(t),r=c(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];f(n,t.length),(n=n.concat(t)).push(2),f(n,r.length);var o=n.concat(r),a=[48];return f(a,o.length),a=a.concat(o),i.encode(a,e)}},function(e,t,r){"use strict";var n=r(20),i=r(77),o=r(23),a=o.assert,s=o.parseBytes,u=r(281),c=r(282);function f(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof f))return new f(e);this.curve=e=i[e].curve,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=f,f.prototype.sign=function(e,t){e=s(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),u=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:u,Rencoded:o})},f.prototype.verify=function(e,t,r){e=s(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},f.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return o.intFromLE(e.digest()).umod(this.curve.n)},f.prototype.keyFromPublic=function(e){return u.fromPublic(this,e)},f.prototype.keyFromSecret=function(e){return u.fromSecret(this,e)},f.prototype.makeSignature=function(e){return e instanceof c?e:new c(this,e)},f.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},f.prototype.decodePoint=function(e){var t=(e=o.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=0!=(128&e[t]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},f.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},f.prototype.decodeInt=function(e){return o.intFromLE(e)},f.prototype.isPoint=function(e){return e instanceof this.pointClass}},function(e,t,r){"use strict";var n=r(23),i=n.assert,o=n.parseBytes,a=n.cachedProperty;function s(e,t){this.eddsa=e,this._secret=o(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=o(t.pub)}s.fromPublic=function(e,t){return t instanceof s?t:new s(e,{pub:t})},s.fromSecret=function(e,t){return t instanceof s?t:new s(e,{secret:t})},s.prototype.secret=function(){return this._secret},a(s,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),a(s,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),a(s,"privBytes",function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n}),a(s,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),a(s,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),a(s,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),s.prototype.sign=function(e){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},s.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},s.prototype.getSecret=function(e){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},s.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},e.exports=s},function(e,t,r){"use strict";var n=r(1),i=r(23),o=i.assert,a=i.cachedProperty,s=i.parseBytes;function u(e,t){this.eddsa=e,"object"!=typeof t&&(t=s(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),o(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof n&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}a(u,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),a(u,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),a(u,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),a(u,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),u.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},u.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},e.exports=u},function(e,t,r){"use strict";t.randomBytes=t.rng=t.pseudoRandomBytes=t.prng=r(36),t.createHash=t.Hash=r(38),t.createHmac=t.Hmac=r(142);var n=r(297),i=Object.keys(n),o=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);t.getHashes=function(){return o};var a=r(145);t.pbkdf2=a.pbkdf2,t.pbkdf2Sync=a.pbkdf2Sync;var s=r(299);t.Cipher=s.Cipher,t.createCipher=s.createCipher,t.Cipheriv=s.Cipheriv,t.createCipheriv=s.createCipheriv,t.Decipher=s.Decipher,t.createDecipher=s.createDecipher,t.Decipheriv=s.Decipheriv,t.createDecipheriv=s.createDecipheriv,t.getCiphers=s.getCiphers,t.listCiphers=s.listCiphers;var u=r(314);t.DiffieHellmanGroup=u.DiffieHellmanGroup,t.createDiffieHellmanGroup=u.createDiffieHellmanGroup,t.getDiffieHellman=u.getDiffieHellman,t.createDiffieHellman=u.createDiffieHellman,t.DiffieHellman=u.DiffieHellman;var c=r(317);t.createSign=c.createSign,t.Sign=c.Sign,t.createVerify=c.createVerify,t.Verify=c.Verify,t.createECDH=r(336);var f=r(337);t.publicEncrypt=f.publicEncrypt,t.privateEncrypt=f.privateEncrypt,t.publicDecrypt=f.publicDecrypt,t.privateDecrypt=f.privateDecrypt;var d=r(340);t.randomFill=d.randomFill,t.randomFillSync=d.randomFillSync,t.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},t.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(e,t){},function(e,t,r){"use strict";var n=r(81).Buffer,i=r(286);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t=n.allocUnsafe(e>>>0),r=this.head,i=0;r;)r.data.copy(t,i),i+=r.data.length,r=r.next;return t},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,r){"use strict";e.exports=o;var n=r(139),i=Object.create(r(13));function o(e){if(!(this instanceof o))return new o(e);n.call(this,e)}i.inherits=r(3),i.inherits(o,n),o.prototype._transform=function(e,t,r){r(null,e)}},function(e,t,r){e.exports=r(82)},function(e,t,r){e.exports=r(37)},function(e,t,r){e.exports=r(80).Transform},function(e,t,r){e.exports=r(80).PassThrough},function(e,t,r){var n=r(3),i=r(44),o=r(6).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function c(e){return e<<30|e>>>2}function f(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,d=0;d<16;++d)r[d]=e.readInt32BE(4*d);for(;d<80;++d)r[d]=r[d-3]^r[d-8]^r[d-14]^r[d-16];for(var h=0;h<80;++h){var l=~~(h/20),p=0|((t=n)<<5|t>>>27)+f(l,i,o,s)+u+r[h]+a[l];u=s,s=o,o=c(i),i=n,n=p}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},function(e,t,r){var n=r(3),i=r(44),o=r(6).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function u(){this.init(),this._w=s,i.call(this,64,56)}function c(e){return e<<5|e>>>27}function f(e){return e<<30|e>>>2}function d(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(u,i),u.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},u.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,h=0;h<16;++h)r[h]=e.readInt32BE(4*h);for(;h<80;++h)r[h]=(t=r[h-3]^r[h-8]^r[h-14]^r[h-16])<<1|t>>>31;for(var l=0;l<80;++l){var p=~~(l/20),b=c(n)+d(p,i,o,s)+u+r[l]+a[p]|0;u=s,s=o,o=f(i),i=n,n=b}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=u+this._e|0},u.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=u},function(e,t,r){var n=r(3),i=r(140),o=r(44),a=r(6).Buffer,s=new Array(64);function u(){this.init(),this._w=s,o.call(this,64,56)}n(u,i),u.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=u},function(e,t,r){var n=r(3),i=r(141),o=r(44),a=r(6).Buffer,s=new Array(160);function u(){this.init(),this._w=s,o.call(this,128,112)}n(u,i),u.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},u.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=u},function(e,t,r){"use strict";var n=r(3),i=r(6).Buffer,o=r(34),a=i.alloc(128);function s(e,t){o.call(this,"digest"),"string"==typeof t&&(t=i.from(t)),this._alg=e,this._key=t,t.length>64?t=e(t):t.length<64&&(t=i.concat([t,a],64));for(var r=this._ipad=i.allocUnsafe(64),n=this._opad=i.allocUnsafe(64),s=0;s<64;s++)r[s]=54^t[s],n[s]=92^t[s];this._hash=[r]}n(s,o),s.prototype._update=function(e){this._hash.push(e)},s.prototype._final=function(){var e=this._alg(i.concat(this._hash));return this._alg(i.concat([this._opad,e]))},e.exports=s},function(e,t,r){e.exports=r(144)},function(e,t,r){(function(t){var n,i,o=r(6).Buffer,a=r(146),s=r(147),u=r(148),c=r(149),f=t.crypto&&t.crypto.subtle,d={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},h=[];function l(){return i||(i=t.process&&t.process.nextTick?t.process.nextTick:t.queueMicrotask?t.queueMicrotask:t.setImmediate?t.setImmediate:t.setTimeout)}function p(e,t,r,n,i){return f.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then(function(e){return f.deriveBits({name:"PBKDF2",salt:t,iterations:r,hash:{name:i}},e,n<<3)}).then(function(e){return o.from(e)})}e.exports=function(e,r,i,b,m,g){"function"==typeof m&&(g=m,m=void 0);var y=d[(m=m||"sha1").toLowerCase()];if(y&&"function"==typeof t.Promise){if(a(i,b),e=c(e,s,"Password"),r=c(r,s,"Salt"),"function"!=typeof g)throw new Error("No callback provided to pbkdf2");!function(e,t){e.then(function(e){l()(function(){t(null,e)})},function(e){l()(function(){t(e)})})}(function(e){if(t.process&&!t.process.browser)return Promise.resolve(!1);if(!f||!f.importKey||!f.deriveBits)return Promise.resolve(!1);if(void 0!==h[e])return h[e];var r=p(n=n||o.alloc(8),n,10,128,e).then(function(){return!0}).catch(function(){return!1});return h[e]=r,r}(y).then(function(t){return t?p(e,r,i,b,y):u(e,r,i,b,m)}),g)}else l()(function(){var t;try{t=u(e,r,i,b,m)}catch(e){return g(e)}g(null,t)})}}).call(this,r(10))},function(e,t,r){var n=r(300),i=r(86),o=r(87),a=r(313),s=r(65);function u(e,t,r){if(e=e.toLowerCase(),o[e])return i.createCipheriv(e,t,r);if(a[e])return new n({key:t,iv:r,mode:e});throw new TypeError("invalid suite type")}function c(e,t,r){if(e=e.toLowerCase(),o[e])return i.createDecipheriv(e,t,r);if(a[e])return new n({key:t,iv:r,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}t.createCipher=t.Cipher=function(e,t){var r,n;if(e=e.toLowerCase(),o[e])r=o[e].key,n=o[e].iv;else{if(!a[e])throw new TypeError("invalid suite type");r=8*a[e].key,n=a[e].iv}var i=s(t,!1,r,n);return u(e,i.key,i.iv)},t.createCipheriv=t.Cipheriv=u,t.createDecipher=t.Decipher=function(e,t){var r,n;if(e=e.toLowerCase(),o[e])r=o[e].key,n=o[e].iv;else{if(!a[e])throw new TypeError("invalid suite type");r=8*a[e].key,n=a[e].iv}var i=s(t,!1,r,n);return c(e,i.key,i.iv)},t.createDecipheriv=t.Decipheriv=c,t.listCiphers=t.getCiphers=function(){return Object.keys(a).concat(i.getCiphers())}},function(e,t,r){var n=r(34),i=r(301),o=r(3),a=r(6).Buffer,s={"des-ede3-cbc":i.CBC.instantiate(i.EDE),"des-ede3":i.EDE,"des-ede-cbc":i.CBC.instantiate(i.EDE),"des-ede":i.EDE,"des-cbc":i.CBC.instantiate(i.DES),"des-ecb":i.DES};function u(e){n.call(this);var t,r=e.mode.toLowerCase(),i=s[r];t=e.decrypt?"decrypt":"encrypt";var o=e.key;a.isBuffer(o)||(o=a.from(o)),"des-ede"!==r&&"des-ede-cbc"!==r||(o=a.concat([o,o.slice(0,8)]));var u=e.iv;a.isBuffer(u)||(u=a.from(u)),this._des=i.create({key:o,iv:u,type:t})}s.des=s["des-cbc"],s.des3=s["des-ede3-cbc"],e.exports=u,o(u,n),u.prototype._update=function(e){return a.from(this._des.update(e))},u.prototype._final=function(){return a.from(this._des.final())}},function(e,t,r){"use strict";t.utils=r(150),t.Cipher=r(85),t.DES=r(151),t.CBC=r(302),t.EDE=r(303)},function(e,t,r){"use strict";var n=r(22),i=r(3),o={};function a(e){n.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t<this.iv.length;t++)this.iv[t]=e[t]}t.instantiate=function(e){function t(t){e.call(this,t),this._cbcInit()}i(t,e);for(var r=Object.keys(o),n=0;n<r.length;n++){var a=r[n];t.prototype[a]=o[a]}return t.create=function(e){return new t(e)},t},o._cbcInit=function(){var e=new a(this.options.iv);this._cbcState=e},o._update=function(e,t,r,n){var i=this.constructor.super_.prototype,o=this._cbcState.iv;if("encrypt"===this.type){for(var a=0;a<this.blockSize;a++)o[a]^=e[t+a];for(i._update.call(this,o,0,r,n),a=0;a<this.blockSize;a++)o[a]=r[n+a]}else{for(i._update.call(this,e,t,r,n),a=0;a<this.blockSize;a++)r[n+a]^=o[a];for(a=0;a<this.blockSize;a++)o[a]=e[t+a]}}},function(e,t,r){"use strict";var n=r(22),i=r(3),o=r(85),a=r(151);function s(e,t){n.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),o=t.slice(16,24);this.ciphers="encrypt"===e?[a.create({type:"encrypt",key:r}),a.create({type:"decrypt",key:i}),a.create({type:"encrypt",key:o})]:[a.create({type:"decrypt",key:o}),a.create({type:"encrypt",key:i}),a.create({type:"decrypt",key:r})]}function u(e){o.call(this,e);var t=new s(this.type,this.options.key);this._edeState=t}i(u,o),e.exports=u,u.create=function(e){return new u(e)},u.prototype._update=function(e,t,r,n){var i=this._edeState;i.ciphers[0]._update(e,t,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},u.prototype._pad=a.prototype._pad,u.prototype._unpad=a.prototype._unpad},function(e,t,r){var n=r(87),i=r(155),o=r(6).Buffer,a=r(156),s=r(34),u=r(64),c=r(65);function f(e,t,r){s.call(this),this._cache=new h,this._cipher=new u.AES(t),this._prev=o.from(r),this._mode=e,this._autopadding=!0}r(3)(f,s),f.prototype._update=function(e){var t,r;this._cache.add(e);for(var n=[];t=this._cache.get();)r=this._mode.encrypt(this,t),n.push(r);return o.concat(n)};var d=o.alloc(16,16);function h(){this.cache=o.allocUnsafe(0)}function l(e,t,r){var s=n[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=o.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);if("string"==typeof r&&(r=o.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===s.type?new a(s.module,t,r):"auth"===s.type?new i(s.module,t,r):new f(s.module,t,r)}f.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(d))throw this._cipher.scrub(),new Error("data not multiple of block length")},f.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},h.prototype.add=function(e){this.cache=o.concat([this.cache,e])},h.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},h.prototype.flush=function(){for(var e=16-this.cache.length,t=o.allocUnsafe(e),r=-1;++r<e;)t.writeUInt8(e,r);return o.concat([this.cache,t])},t.createCipheriv=l,t.createCipher=function(e,t){var r=n[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=c(t,!1,r.key,r.iv);return l(e,i.key,i.iv)}},function(e,t){t.encrypt=function(e,t){return e._cipher.encryptBlock(t)},t.decrypt=function(e,t){return e._cipher.decryptBlock(t)}},function(e,t,r){var n=r(55);t.encrypt=function(e,t){var r=n(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},t.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return n(i,r)}},function(e,t,r){var n=r(6).Buffer,i=r(55);function o(e,t,r){var o=t.length,a=i(t,e._cache);return e._cache=e._cache.slice(o),e._prev=n.concat([e._prev,r?t:a]),a}t.encrypt=function(e,t,r){for(var i,a=n.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=n.allocUnsafe(0)),!(e._cache.length<=t.length)){a=n.concat([a,o(e,t,r)]);break}a=n.concat([a,o(e,t.slice(0,i=e._cache.length),r)]),t=t.slice(i)}return a}},function(e,t,r){var n=r(6).Buffer;function i(e,t,r){var i=e._cipher.encryptBlock(e._prev)[0]^t;return e._prev=n.concat([e._prev.slice(1),n.from([r?t:i])]),i}t.encrypt=function(e,t,r){for(var o=t.length,a=n.allocUnsafe(o),s=-1;++s<o;)a[s]=i(e,t[s],r);return a}},function(e,t,r){var n=r(6).Buffer;function i(e,t,r){for(var n,i,a=-1,s=0;++a<8;)n=t&1<<7-a?128:0,s+=(128&(i=e._cipher.encryptBlock(e._prev)[0]^n))>>a%8,e._prev=o(e._prev,r?n:i);return s}function o(e,t){var r=e.length,i=-1,o=n.allocUnsafe(e.length);for(e=n.concat([e,n.from([t])]);++i<r;)o[i]=e[i]<<1|e[i+1]>>7;return o}t.encrypt=function(e,t,r){for(var o=t.length,a=n.allocUnsafe(o),s=-1;++s<o;)a[s]=i(e,t[s],r);return a}},function(e,t,r){(function(e){var n=r(55);function i(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}t.encrypt=function(t,r){for(;t._cache.length<r.length;)t._cache=e.concat([t._cache,i(t)]);var o=t._cache.slice(0,r.length);return t._cache=t._cache.slice(r.length),n(r,o)}}).call(this,r(11).Buffer)},function(e,t,r){var n=r(6).Buffer,i=n.alloc(16,0);function o(e){var t=n.allocUnsafe(16);return t.writeUInt32BE(e[0]>>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t<e.length;)this.state[t]^=e[t];this._multiply()},a.prototype._multiply=function(){for(var e,t,r,n=[(e=this.h).readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)],i=[0,0,0,0],a=-1;++a<128;){for(0!=(this.state[~~(a/8)]&1<<7-a%8)&&(i[0]^=n[0],i[1]^=n[1],i[2]^=n[2],i[3]^=n[3]),r=0!=(1&n[3]),t=3;t>0;t--)n[t]=n[t]>>>1|(1&n[t-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=o(i)},a.prototype.update=function(e){var t;for(this.cache=n.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(o([0,e,0,t])),this.state},e.exports=a},function(e,t,r){var n=r(155),i=r(6).Buffer,o=r(87),a=r(156),s=r(34),u=r(64),c=r(65);function f(e,t,r){s.call(this),this._cache=new d,this._last=void 0,this._cipher=new u.AES(t),this._prev=i.from(r),this._mode=e,this._autopadding=!0}function d(){this.cache=i.allocUnsafe(0)}function h(e,t,r){var s=o[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=i.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof t&&(t=i.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===s.type?new a(s.module,t,r,!0):"auth"===s.type?new n(s.module,t,r,!0):new f(s.module,t,r)}r(3)(f,s),f.prototype._update=function(e){var t,r;this._cache.add(e);for(var n=[];t=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,t),n.push(r);return i.concat(n)},f.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");for(var r=-1;++r<t;)if(e[r+(16-t)]!==t)throw new Error("unable to decrypt data");if(16!==t)return e.slice(0,16-t)}(this._mode.decrypt(this,e));if(e)throw new Error("data not multiple of block length")},f.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},d.prototype.add=function(e){this.cache=i.concat([this.cache,e])},d.prototype.get=function(e){var t;if(e){if(this.cache.length>16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},d.prototype.flush=function(){if(this.cache.length)return this.cache},t.createDecipher=function(e,t){var r=o[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=c(t,!1,r.key,r.iv);return h(e,n.key,n.iv)},t.createDecipheriv=h},function(e,t){t["des-ecb"]={key:8,iv:0},t["des-cbc"]=t.des={key:8,iv:8},t["des-ede3-cbc"]=t.des3={key:24,iv:8},t["des-ede3"]={key:24,iv:0},t["des-ede-cbc"]={key:16,iv:8},t["des-ede"]={key:16,iv:0}},function(e,t,r){(function(e){var n=r(157),i=r(315),o=r(316),a={binary:!0,hex:!0,base64:!0};t.DiffieHellmanGroup=t.createDiffieHellmanGroup=t.getDiffieHellman=function(t){var r=new e(i[t].prime,"hex"),n=new e(i[t].gen,"hex");return new o(r,n)},t.createDiffieHellman=t.DiffieHellman=function t(r,i,s,u){return e.isBuffer(i)||void 0===a[i]?t(r,"binary",i,s):(i=i||"binary",u=u||"binary",s=s||new e([2]),e.isBuffer(s)||(s=new e(s,u)),"number"==typeof r?new o(n(r,s),s,!0):(e.isBuffer(r)||(r=new e(r,i)),new o(r,s,!0)))}}).call(this,r(11).Buffer)},function(e){e.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},function(e,t,r){(function(t){var n=r(1),i=new(r(158)),o=new n(24),a=new n(11),s=new n(10),u=new n(3),c=new n(7),f=r(157),d=r(36);function h(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this._pub=new n(e),this}function l(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this._priv=new n(e),this}e.exports=b;var p={};function b(e,t,r){this.setGenerator(t),this.__prime=new n(e),this._prime=n.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=h,this.setPrivateKey=l):this._primeCode=8}function m(e,r){var n=new t(e.toArray());return r?n.toString(r):n}Object.defineProperty(b.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,t){var r=t.toString("hex"),n=[r,e.toString(16)].join("_");if(n in p)return p[n];var d,h=0;if(e.isEven()||!f.simpleSieve||!f.fermatTest(e)||!i.test(e))return h+=1,p[n]=h+="02"===r||"05"===r?8:4,h;switch(i.test(e.shrn(1))||(h+=2),r){case"02":e.mod(o).cmp(a)&&(h+=8);break;case"05":(d=e.mod(s)).cmp(u)&&d.cmp(c)&&(h+=8);break;default:h+=4}return p[n]=h,h}(this.__prime,this.__gen)),this._primeCode}}),b.prototype.generateKeys=function(){return this._priv||(this._priv=new n(d(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},b.prototype.computeSecret=function(e){var r=(e=(e=new n(e)).toRed(this._prime)).redPow(this._priv).fromRed(),i=new t(r.toArray()),o=this.getPrime();if(i.length<o.length){var a=new t(o.length-i.length);a.fill(0),i=t.concat([a,i])}return i},b.prototype.getPublicKey=function(e){return m(this._pub,e)},b.prototype.getPrivateKey=function(e){return m(this._priv,e)},b.prototype.getPrime=function(e){return m(this.__prime,e)},b.prototype.getGenerator=function(e){return m(this._gen,e)},b.prototype.setGenerator=function(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this.__gen=e,this._gen=new n(e),this}}).call(this,r(11).Buffer)},function(e,t,r){var n=r(6).Buffer,i=r(38),o=r(59),a=r(3),s=r(325),u=r(335),c=r(144);function f(e){o.Writable.call(this);var t=c[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash,this._hash=i(t.hash),this._tag=t.id,this._signType=t.sign}function d(e){o.Writable.call(this);var t=c[e];if(!t)throw new Error("Unknown message digest");this._hash=i(t.hash),this._tag=t.id,this._signType=t.sign}function h(e){return new f(e)}function l(e){return new d(e)}Object.keys(c).forEach(function(e){c[e].id=n.from(c[e].id,"hex"),c[e.toLowerCase()]=c[e]}),a(f,o.Writable),f.prototype._write=function(e,t,r){this._hash.update(e),r()},f.prototype.update=function(e,t){return"string"==typeof e&&(e=n.from(e,t)),this._hash.update(e),this},f.prototype.sign=function(e,t){this.end();var r=this._hash.digest(),n=s(r,e,this._hashType,this._signType,this._tag);return t?n.toString(t):n},a(d,o.Writable),d.prototype._write=function(e,t,r){this._hash.update(e),r()},d.prototype.update=function(e,t){return"string"==typeof e&&(e=n.from(e,t)),this._hash.update(e),this},d.prototype.verify=function(e,t,r){"string"==typeof t&&(t=n.from(t,r)),this.end();var i=this._hash.digest();return u(t,i,e,this._signType,this._tag)},e.exports={Sign:h,Verify:l,createSign:h,createVerify:l}},function(e,t){},function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(11).Buffer,a=r(320).inspect,s=a&&a.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t;return(t=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return o.alloc(0);for(var t=o.allocUnsafe(e>>>0),r=this.head,n=0;r;)o.prototype.copy.call(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(n+=o===i.length?i:i.slice(0,e),0==(e-=o)){o===i.length?(++r,this.head=t.next?t.next:this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=o.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,a=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,a),0==(e-=a)){a===i.length?(++n,this.head=r.next?r.next:this.tail=null):(this.head=r,r.data=i.slice(a));break}++n}return this.length-=n,t}},{key:s,value:function(e,t){return a(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){i(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},t,{depth:0,customInspect:!1}))}}])&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,t),e}()},function(e,t){},function(e,t,r){"use strict";(function(t){var n;function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(88),a=Symbol("lastResolve"),s=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),f=Symbol("lastPromise"),d=Symbol("handlePromise"),h=Symbol("stream");function l(e,t){return{value:e,done:t}}function p(e){var t=e[a];if(null!==t){var r=e[h].read();null!==r&&(e[f]=null,e[a]=null,e[s]=null,t(l(r,!1)))}}function b(e){t.nextTick(p,e)}var m=Object.getPrototypeOf(function(){}),g=Object.setPrototypeOf((i(n={get stream(){return this[h]},next:function(){var e=this,r=this[u];if(null!==r)return Promise.reject(r);if(this[c])return Promise.resolve(l(void 0,!0));if(this[h].destroyed)return new Promise(function(r,n){t.nextTick(function(){e[u]?n(e[u]):r(l(void 0,!0))})});var n,i=this[f];if(i)n=new Promise(function(e,t){return function(r,n){e.then(function(){t[c]?r(l(void 0,!0)):t[d](r,n)},n)}}(i,this));else{var o=this[h].read();if(null!==o)return Promise.resolve(l(o,!1));n=new Promise(this[d])}return this[f]=n,n}},Symbol.asyncIterator,function(){return this}),i(n,"return",function(){var e=this;return new Promise(function(t,r){e[h].destroy(null,function(e){e?r(e):t(l(void 0,!0))})})}),n),m);e.exports=function(e){var t,r=Object.create(g,(i(t={},h,{value:e,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,c,{value:e._readableState.endEmitted,writable:!0}),i(t,d,{value:function(e,t){var n=r[h].read();n?(r[f]=null,r[a]=null,r[s]=null,e(l(n,!1))):(r[a]=e,r[s]=t)},writable:!0}),t));return r[f]=null,o(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[s];return null!==t&&(r[f]=null,r[a]=null,r[s]=null,t(e)),void(r[u]=e)}var n=r[a];null!==n&&(r[f]=null,r[a]=null,r[s]=null,n(l(void 0,!0))),r[c]=!0}),e.on("readable",b.bind(null,r)),r}}).call(this,r(9))},function(e,t){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},function(e,t,r){"use strict";e.exports=i;var n=r(164);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(3)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},function(e,t,r){"use strict";var n,i=r(45).codes,o=i.ERR_MISSING_ARGS,a=i.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function u(e,t,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var s=!1;e.on("close",function(){s=!0}),void 0===n&&(n=r(88)),n(e,{readable:t,writable:i},function(e){if(e)return o(e);s=!0,o()});var u=!1;return function(t){if(!s&&!u)return u=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void o(t||new a("pipe"))}}function c(e){e()}function f(e,t){return e.pipe(t)}function d(e){return e.length?"function"!=typeof e[e.length-1]?s:e.pop():s}e.exports=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,i=d(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var a=t.map(function(e,r){var o=r<t.length-1;return u(e,o,r>0,function(e){n||(n=e),e&&a.forEach(c),o||(a.forEach(c),i(n))})});return t.reduce(f)}},function(e,t,r){var n=r(6).Buffer,i=r(142),o=r(89),a=r(54).ec,s=r(1),u=r(66),c=r(170);function f(e,t,r,o){if((e=n.from(e.toArray())).length<t.byteLength()){var a=n.alloc(t.byteLength()-e.length);e=n.concat([a,e])}var s=r.length,u=function(e,t){e=(e=d(e,t)).mod(t);var r=n.from(e.toArray());if(r.length<t.byteLength()){var i=n.alloc(t.byteLength()-r.length);r=n.concat([i,r])}return r}(r,t),c=n.alloc(s);c.fill(1);var f=n.alloc(s);return f=i(o,f).update(c).update(n.from([0])).update(e).update(u).digest(),c=i(o,f).update(c).digest(),{k:f=i(o,f).update(c).update(n.from([1])).update(e).update(u).digest(),v:c=i(o,f).update(c).digest()}}function d(e,t){var r=new s(e),n=(e.length<<3)-t.bitLength();return n>0&&r.ishrn(n),r}function h(e,t,r){var o,a;do{for(o=n.alloc(0);8*o.length<e.bitLength();)t.v=i(r,t.k).update(t.v).digest(),o=n.concat([o,t.v]);a=d(o,e),t.k=i(r,t.k).update(t.v).update(n.from([0])).digest(),t.v=i(r,t.k).update(t.v).digest()}while(-1!==a.cmp(e));return a}function l(e,t,r,n){return e.toRed(s.mont(r)).redPow(t).fromRed().mod(n)}e.exports=function(e,t,r,i,p){var b=u(t);if(b.curve){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");return function(e,t){var r=c[t.curve.join(".")];if(!r)throw new Error("unknown curve "+t.curve.join("."));var i=new a(r).keyFromPrivate(t.privateKey).sign(e);return n.from(i.toDER())}(e,b)}if("dsa"===b.type){if("dsa"!==i)throw new Error("wrong private key type");return function(e,t,r){for(var i,o=t.params.priv_key,a=t.params.p,u=t.params.q,c=t.params.g,p=new s(0),b=d(e,u).mod(u),m=!1,g=f(o,u,e,r);!1===m;)p=l(c,i=h(u,g,r),a,u),0===(m=i.invm(u).imul(b.add(o.mul(p))).mod(u)).cmpn(0)&&(m=!1,p=new s(0));return function(e,t){e=e.toArray(),t=t.toArray(),128&e[0]&&(e=[0].concat(e)),128&t[0]&&(t=[0].concat(t));var r=[48,e.length+t.length+4,2,e.length];return r=r.concat(e,[2,t.length],t),n.from(r)}(p,m)}(e,b,r)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");e=n.concat([p,e]);for(var m=b.modulus.byteLength(),g=[0,1];e.length+g.length+1<m;)g.push(255);g.push(0);for(var y=-1;++y<e.length;)g.push(e[y]);return o(g,b)},e.exports.getKey=f,e.exports.makeKey=h},function(e,t,r){"use strict";var n=r(165);t.certificate=r(332);var i=n.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});t.RSAPrivateKey=i;var o=n.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});t.RSAPublicKey=o;var a=n.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())});t.PublicKey=a;var s=n.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),u=n.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())});t.PrivateKey=u;var c=n.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});t.EncryptedPrivateKey=c;var f=n.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});t.DSAPrivateKey=f,t.DSAparam=n.define("DSAparam",function(){this.int()});var d=n.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())});t.ECPrivateKey=d;var h=n.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});t.signature=n.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})},function(e,t,r){"use strict";const n=r(166),i=r(168),o=r(3);function a(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}t.define=function(e,t){return new a(e,t)},a.prototype._createNamed=function(e){const t=this.name;function r(e){this._initNamed(e,t)}return o(r,e),r.prototype._initNamed=function(t,r){e.call(this,t,r)},new r(this)},a.prototype._getDecoder=function(e){return this.decoders.hasOwnProperty(e=e||"der")||(this.decoders[e]=this._createNamed(i[e])),this.decoders[e]},a.prototype.decode=function(e,t,r){return this._getDecoder(t).decode(e,r)},a.prototype._getEncoder=function(e){return this.encoders.hasOwnProperty(e=e||"der")||(this.encoders[e]=this._createNamed(n[e])),this.encoders[e]},a.prototype.encode=function(e,t,r){return this._getEncoder(t).encode(e,r)}},function(e,t,r){"use strict";const n=r(3),i=r(167);function o(e){i.call(this,e),this.enc="pem"}n(o,i),e.exports=o,o.prototype.encode=function(e,t){const r=i.prototype.encode.call(this,e).toString("base64"),n=["-----BEGIN "+t.label+"-----"];for(let i=0;i<r.length;i+=64)n.push(r.slice(i,i+64));return n.push("-----END "+t.label+"-----"),n.join("\n")}},function(e,t,r){"use strict";const n=r(3),i=r(90).Buffer,o=r(169);function a(e){o.call(this,e),this.enc="pem"}n(a,o),e.exports=a,a.prototype.decode=function(e,t){const r=e.toString().split(/[\r\n]+/g),n=t.label.toUpperCase(),a=/^-----(BEGIN|END) ([^-]+)-----$/;let s=-1,u=-1;for(let i=0;i<r.length;i++){const e=r[i].match(a);if(null!==e&&e[2]===n){if(-1!==s){if("END"!==e[1])break;u=i;break}if("BEGIN"!==e[1])break;s=i}}if(-1===s||-1===u)throw new Error("PEM section not found for: "+n);const c=r.slice(s+1,u).join("");c.replace(/[^a-z0-9+/=]+/gi,"");const f=i.from(c,"base64");return o.prototype.decode.call(this,f,t)}},function(e,t,r){"use strict";const n=t;n.Reporter=r(92).Reporter,n.DecoderBuffer=r(56).DecoderBuffer,n.EncoderBuffer=r(56).EncoderBuffer,n.Node=r(91)},function(e,t,r){"use strict";const n=t;n._reverse=function(e){const t={};return Object.keys(e).forEach(function(r){(0|r)==r&&(r|=0),t[e[r]]=r}),t},n.der=r(93)},function(e,t,r){"use strict";var n=r(165),i=n.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),o=n.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),a=n.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),s=n.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}),u=n.define("RelativeDistinguishedName",function(){this.setof(o)}),c=n.define("RDNSequence",function(){this.seqof(u)}),f=n.define("Name",function(){this.choice({rdnSequence:this.use(c)})}),d=n.define("Validity",function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))}),h=n.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),l=n.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(a),this.key("issuer").use(f),this.key("validity").use(d),this.key("subject").use(f),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())}),p=n.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(l),this.key("signatureAlgorithm").use(a),this.key("signatureValue").bitstr())});e.exports=p},function(e){e.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')},function(e,t,r){var n=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,o=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,a=r(65),s=r(86),u=r(6).Buffer;e.exports=function(e,t){var r,c=e.toString(),f=c.match(n);if(f){var d="aes"+f[1],h=u.from(f[2],"hex"),l=u.from(f[3].replace(/[\r\n]/g,""),"base64"),p=a(t,h.slice(0,8),parseInt(f[1],10)).key,b=[],m=s.createDecipheriv(d,p,h);b.push(m.update(l)),b.push(m.final()),r=u.concat(b)}else{var g=c.match(o);r=u.from(g[2].replace(/[\r\n]/g,""),"base64")}return{tag:c.match(i)[1],data:r}}},function(e,t,r){var n=r(6).Buffer,i=r(1),o=r(54).ec,a=r(66),s=r(170);function u(e,t){if(e.cmpn(0)<=0)throw new Error("invalid sig");if(e.cmp(t)>=t)throw new Error("invalid sig")}e.exports=function(e,t,r,c,f){var d=a(r);if("ec"===d.type){if("ecdsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");return function(e,t,r){var n=s[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));return new o(n).verify(t,e,r.data.subjectPrivateKey.data)}(e,t,d)}if("dsa"===d.type){if("dsa"!==c)throw new Error("wrong public key type");return function(e,t,r){var n=r.data.p,o=r.data.q,s=r.data.g,c=r.data.pub_key,f=a.signature.decode(e,"der"),d=f.s,h=f.r;u(d,o),u(h,o);var l=i.mont(n),p=d.invm(o);return 0===s.toRed(l).redPow(new i(t).mul(p).mod(o)).fromRed().mul(c.toRed(l).redPow(h.mul(p).mod(o)).fromRed()).mod(n).mod(o).cmp(h)}(e,t,d)}if("rsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");t=n.concat([f,t]);for(var h=d.modulus.byteLength(),l=[1],p=0;t.length+l.length+2<h;)l.push(255),p++;l.push(0);for(var b=-1;++b<t.length;)l.push(t[b]);l=n.from(l);var m=i.mont(d.modulus);e=(e=new i(e).toRed(m)).redPow(new i(d.publicExponent)),e=n.from(e.fromRed().toArray());var g=p<8?1:0;for(h=Math.min(e.length,l.length),e.length!==l.length&&(g=1),b=-1;++b<h;)g|=e[b]^l[b];return 0===g}},function(e,t,r){(function(t){var n=r(54),i=r(1);e.exports=function(e){return new a(e)};var o={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function a(e){this.curveType=o[e],this.curveType||(this.curveType={name:e}),this.curve=new n.ec(this.curveType.name),this.keys=void 0}function s(e,r,n){Array.isArray(e)||(e=e.toArray());var i=new t(e);if(n&&i.length<n){var o=new t(n-i.length);o.fill(0),i=t.concat([o,i])}return r?i.toString(r):i}o.p224=o.secp224r1,o.p256=o.secp256r1=o.prime256v1,o.p192=o.secp192r1=o.prime192v1,o.p384=o.secp384r1,o.p521=o.secp521r1,a.prototype.generateKeys=function(e,t){return this.keys=this.curve.genKeyPair(),this.getPublicKey(e,t)},a.prototype.computeSecret=function(e,r,n){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),s(this.curve.keyFromPublic(e).getPublic().mul(this.keys.getPrivate()).getX(),n,this.curveType.byteLength)},a.prototype.getPublicKey=function(e,t){var r=this.keys.getPublic("compressed"===t,!0);return"hybrid"===t&&(r[0]=r[r.length-1]%2?7:6),s(r,e)},a.prototype.getPrivateKey=function(e){return s(this.keys.getPrivate(),e)},a.prototype.setPublicKey=function(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this.keys._importPublic(e),this},a.prototype.setPrivateKey=function(e,r){r=r||"utf8",t.isBuffer(e)||(e=new t(e,r));var n=new i(e);return n=n.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(n),this}}).call(this,r(11).Buffer)},function(e,t,r){t.publicEncrypt=r(338),t.privateDecrypt=r(339),t.privateEncrypt=function(e,r){return t.publicEncrypt(e,r,!0)},t.publicDecrypt=function(e,r){return t.privateDecrypt(e,r,!0)}},function(e,t,r){var n=r(66),i=r(36),o=r(38),a=r(171),s=r(172),u=r(1),c=r(173),f=r(89),d=r(6).Buffer;e.exports=function(e,t,r){var h;h=e.padding?e.padding:r?1:4;var l,p=n(e);if(4===h)l=function(e,t){var r=e.modulus.byteLength(),n=t.length,c=o("sha1").update(d.alloc(0)).digest(),f=c.length,h=2*f;if(n>r-h-2)throw new Error("message too long");var l=d.alloc(r-n-h-2),p=r-f-1,b=i(f),m=s(d.concat([c,l,d.alloc(1,1),t],p),a(b,p)),g=s(b,a(m,f));return new u(d.concat([d.alloc(1),g,m],r))}(p,t);else if(1===h)l=function(e,t,r){var n,o=t.length,a=e.modulus.byteLength();if(o>a-11)throw new Error("message too long");return n=r?d.alloc(a-o-3,255):function(e){for(var t,r=d.allocUnsafe(e),n=0,o=i(2*e),a=0;n<e;)a===o.length&&(o=i(2*e),a=0),(t=o[a++])&&(r[n++]=t);return r}(a-o-3),new u(d.concat([d.from([0,r?1:2]),n,d.alloc(1),t],a))}(p,t,r);else{if(3!==h)throw new Error("unknown padding");if((l=new u(t)).cmp(p.modulus)>=0)throw new Error("data too long for modulus")}return r?f(l,p):c(l,p)}},function(e,t,r){var n=r(66),i=r(171),o=r(172),a=r(1),s=r(89),u=r(38),c=r(173),f=r(6).Buffer;e.exports=function(e,t,r){var d;d=e.padding?e.padding:r?1:4;var h,l=n(e),p=l.modulus.byteLength();if(t.length>p||new a(t).cmp(l.modulus)>=0)throw new Error("decryption error");h=r?c(new a(t),l):s(t,l);var b=f.alloc(p-h.length);if(h=f.concat([b,h],p),4===d)return function(e,t){var r=e.modulus.byteLength(),n=u("sha1").update(f.alloc(0)).digest(),a=n.length;if(0!==t[0])throw new Error("decryption error");var s=t.slice(1,a+1),c=t.slice(a+1),d=o(s,i(c,a)),h=o(c,i(d,r-a-1));if(function(e,t){e=f.from(e),t=f.from(t);var r=0,n=e.length;e.length!==t.length&&(r++,n=Math.min(e.length,t.length));for(var i=-1;++i<n;)r+=e[i]^t[i];return r}(n,h.slice(0,a)))throw new Error("decryption error");for(var l=a;0===h[l];)l++;if(1!==h[l++])throw new Error("decryption error");return h.slice(l)}(l,h);if(1===d)return function(e,t,r){for(var n=t.slice(0,2),i=2,o=0;0!==t[i++];)if(i>=t.length){o++;break}var a=t.slice(2,i-1);if(("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&o++,a.length<8&&o++,o)throw new Error("decryption error");return t.slice(i)}(0,h,r);if(3===d)return h;throw new Error("unknown padding")}},function(e,t,r){"use strict";(function(e,n){function i(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=r(6),a=r(36),s=o.Buffer,u=o.kMaxLength,c=e.crypto||e.msCrypto,f=Math.pow(2,32)-1;function d(e,t){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(e>f||e<0)throw new TypeError("offset must be a uint32");if(e>u||e>t)throw new RangeError("offset out of range")}function h(e,t,r){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>f||e<0)throw new TypeError("size must be a uint32");if(e+t>r||e>u)throw new RangeError("buffer too small")}function l(e,t,r,i){if(n.browser){var o=new Uint8Array(e.buffer,t,r);return c.getRandomValues(o),i?void n.nextTick(function(){i(null,e)}):e}if(!i)return a(r).copy(e,t),e;a(r,function(r,n){if(r)return i(r);n.copy(e,t),i(null,e)})}c&&c.getRandomValues||!n.browser?(t.randomFill=function(t,r,n,i){if(!(s.isBuffer(t)||t instanceof e.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof r)i=r,r=0,n=t.length;else if("function"==typeof n)i=n,n=t.length-r;else if("function"!=typeof i)throw new TypeError('"cb" argument must be a function');return d(r,t.length),h(n,r,t.length),l(t,r,n,i)},t.randomFillSync=function(t,r,n){if(void 0===r&&(r=0),!(s.isBuffer(t)||t instanceof e.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return d(r,t.length),void 0===n&&(n=t.length-r),h(n,r,t.length),l(t,r,n)}):(t.randomFill=i,t.randomFillSync=i)}).call(this,r(10),r(9))},function(e,t){e.exports=r("RIqP")},function(e,t,r){"use strict";function n(){var e=Object.create(null),t=0,r=0,n=0,i=!1;function o(t){n--,delete e[t]}this.put=function(t,r,a,s){if(i&&console.log("caching: %s = %j (@%s)",t,r,a),void 0!==a&&("number"!=typeof a||isNaN(a)||a<=0))throw new Error("Cache timeout must be a positive number");if(void 0!==s&&"function"!=typeof s)throw new Error("Cache timeout callback must be a function");var u=e[t];u?clearTimeout(u.timeout):n++;var c={value:r,expire:a+Date.now()};return isNaN(c.expire)||(c.timeout=setTimeout((function(){o(t),s&&s(t,r)}).bind(this),a)),e[t]=c,r},this.del=function(t){var r=!0,n=e[t];return n?(clearTimeout(n.timeout),!isNaN(n.expire)&&n.expire<Date.now()&&(r=!1)):r=!1,r&&o(t),r},this.clear=function(){for(var o in e)clearTimeout(e[o].timeout);n=0,e=Object.create(null),i&&(t=0,r=0)},this.get=function(o){var a=e[o];if(void 0!==a){if(isNaN(a.expire)||a.expire>=Date.now())return i&&t++,a.value;i&&r++,n--,delete e[o]}else i&&r++;return null},this.size=function(){return n},this.memsize=function(){var t,r=0;for(t in e)r++;return r},this.debug=function(e){i=e},this.hits=function(){return t},this.misses=function(){return r},this.keys=function(){return Object.keys(e)},this.exportJson=function(){var t={};for(var r in e){var n=e[r];t[r]={value:n.value,expire:n.expire||"NaN"}}return JSON.stringify(t)},this.importJson=function(t,r){var n=JSON.parse(t),o=Date.now(),a=r&&r.skipDuplicates;for(var s in n)if(n.hasOwnProperty(s)){if(a&&e[s]){i&&console.log("Skipping duplicate imported key '%s'",s);continue}var u=n[s],c=u.expire-o;if(c<=0){this.del(s);continue}this.put(s,u.value,c=c>0?c:void 0)}return this.size()}}e.exports=new n,e.exports.Cache=n},function(e,t){e.exports=r("oShl")},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeAsStream=void 0;const n=r(79);class i extends n.Duplex{constructor(e){super({objectMode:!0}),this.resume(),this.handler=e=>this.push(e),this.obsStore=e,this.obsStore.subscribe(this.handler)}pipe(e,t){const r=super.pipe(e,t);return e.write(this.obsStore.getState()),r}_write(e,t,r){this.obsStore.putState(e),r()}_read(e){}_destroy(e,t){this.obsStore.unsubscribe(this.handler),super._destroy(e,t)}}t.storeAsStream=function(e){return new i(e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ComposedStore=void 0;const n=r(94);t.ComposedStore=class extends n.ObservableStore{constructor(e){super({}),this._children=e||{},Object.keys(this._children).forEach(e=>{this._addChild(e,this._children[e])})}_addChild(e,t){const r=t=>{const r=this.getState();r[e]=t,this.putState(r)};t.subscribe(r),r(t.getState())}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MergedStore=void 0;const n=r(94);t.MergedStore=class extends n.ObservableStore{constructor(e=[]){super({}),this._children=e,e.forEach(e=>this._addChild(e)),this._updateWholeState()}_addChild(e){e.subscribe(()=>this._updateWholeState())}_updateWholeState(){const e=this._children.map(e=>e.getState()),t=Object.assign({},...e);this.putState(t)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.storeTransformStream=void 0;const n=r(348);t.storeTransformStream=function(e){return n.obj((t,r,n)=>{try{return void n(null,e(t))}catch(e){return void n(e)}})}},function(e,t,r){(function(t){var n=r(349).Transform,i=r(112).inherits,o=r(125);function a(e){n.call(this,e),this._destroyed=!1}function s(e,t,r){r(null,e)}function u(e){return function(t,r,n){return"function"==typeof t&&(n=r,r=t,t={}),"function"!=typeof r&&(r=s),"function"!=typeof n&&(n=null),e(t,r,n)}}i(a,n),a.prototype.destroy=function(e){if(!this._destroyed){this._destroyed=!0;var r=this;t.nextTick(function(){e&&r.emit("error",e),r.emit("close")})}},e.exports=u(function(e,t,r){var n=new a(e);return n._transform=t,r&&(n._flush=r),n}),e.exports.ctor=u(function(e,t,r){function n(t){if(!(this instanceof n))return new n(t);this.options=o(e,t),a.call(this,this.options)}return i(n,a),n.prototype._transform=t,r&&(n.prototype._flush=r),n}),e.exports.obj=u(function(e,t,r){var n=new a(o({objectMode:!0,highWaterMark:16},e));return n._transform=t,r&&(n._flush=r),n})}).call(this,r(9))},function(e,t,r){(t=e.exports=r(174)).Stream=t,t.Readable=t,t.Writable=r(177),t.Duplex=r(47),t.Transform=r(178),t.PassThrough=r(353)},function(e,t){},function(e,t,r){"use strict";var n=r(95).Buffer,i=r(352);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t=n.allocUnsafe(e>>>0),r=this.head,i=0;r;)r.data.copy(t,i),i+=r.data.length,r=r.next;return t},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,r){"use strict";e.exports=o;var n=r(178),i=Object.create(r(13));function o(e){if(!(this instanceof o))return new o(e);n.call(this,e)}i.inherits=r(3),i.inherits(o,n),o.prototype._transform=function(e,t,r){r(null,e)}},function(e,t){e.exports=i,i.default=i,i.stable=a,i.stableStringify=a;var r=[],n=[];function i(e,t,i){var o;for(function e(t,i,o,a){var s;if("object"==typeof t&&null!==t){for(s=0;s<o.length;s++)if(o[s]===t){var u=Object.getOwnPropertyDescriptor(a,i);return void(void 0!==u.get?u.configurable?(Object.defineProperty(a,i,{value:"[Circular]"}),r.push([a,i,t,u])):n.push([t,i]):(a[i]="[Circular]",r.push([a,i,t])))}if(o.push(t),Array.isArray(t))for(s=0;s<t.length;s++)e(t[s],s,o,t);else{var c=Object.keys(t);for(s=0;s<c.length;s++){var f=c[s];e(t[f],f,o,t)}}o.pop()}}(e,"",[],void 0),o=0===n.length?JSON.stringify(e,t,i):JSON.stringify(e,s(t),i);0!==r.length;){var a=r.pop();4===a.length?Object.defineProperty(a[0],a[1],a[3]):a[0][a[1]]=a[2]}return o}function o(e,t){return e<t?-1:e>t?1:0}function a(e,t,i){var a,u=function e(t,i,a,s){var u;if("object"==typeof t&&null!==t){for(u=0;u<a.length;u++)if(a[u]===t){var c=Object.getOwnPropertyDescriptor(s,i);return void(void 0!==c.get?c.configurable?(Object.defineProperty(s,i,{value:"[Circular]"}),r.push([s,i,t,c])):n.push([t,i]):(s[i]="[Circular]",r.push([s,i,t])))}if("function"==typeof t.toJSON)return;if(a.push(t),Array.isArray(t))for(u=0;u<t.length;u++)e(t[u],u,a,t);else{var f={},d=Object.keys(t).sort(o);for(u=0;u<d.length;u++){var h=d[u];e(t[h],h,a,t),f[h]=t[h]}if(void 0===s)return f;r.push([s,i,t]),s[i]=f}a.pop()}}(e,"",[],void 0)||e;for(a=0===n.length?JSON.stringify(u,t,i):JSON.stringify(u,s(t),i);0!==r.length;){var c=r.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}return a}function s(e){return e=void 0!==e?e:function(e,t){return t},function(t,r){if(n.length>0)for(var i=0;i<n.length;i++){var o=n[i];if(o[1]===t&&o[0]===r){r="[Circular]",n.splice(i,1);break}}return e.call(this,t,r)}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ethErrors=void 0;const n=r(96),i=r(179),o=r(97);function a(e,t){const[r,o]=u(t);return new n.EthereumRpcError(e,r||i.getMessageFromCode(e),o)}function s(e,t){const[r,o]=u(t);return new n.EthereumProviderError(e,r||i.getMessageFromCode(e),o)}function u(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:r}=e;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}t.ethErrors={rpc:{parse:e=>a(o.errorCodes.rpc.parse,e),invalidRequest:e=>a(o.errorCodes.rpc.invalidRequest,e),invalidParams:e=>a(o.errorCodes.rpc.invalidParams,e),methodNotFound:e=>a(o.errorCodes.rpc.methodNotFound,e),internal:e=>a(o.errorCodes.rpc.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return a(t,e)},invalidInput:e=>a(o.errorCodes.rpc.invalidInput,e),resourceNotFound:e=>a(o.errorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>a(o.errorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>a(o.errorCodes.rpc.transactionRejected,e),methodNotSupported:e=>a(o.errorCodes.rpc.methodNotSupported,e),limitExceeded:e=>a(o.errorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>s(o.errorCodes.provider.userRejectedRequest,e),unauthorized:e=>s(o.errorCodes.provider.unauthorized,e),unsupportedMethod:e=>s(o.errorCodes.provider.unsupportedMethod,e),disconnected:e=>s(o.errorCodes.provider.disconnected,e),chainDisconnected:e=>s(o.errorCodes.provider.chainDisconnected,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:i}=e;if(!r||"string"!=typeof r)throw new Error('"message" must be a nonempty string');return new n.EthereumProviderError(t,r,i)}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createIdRemapMiddleware=void 0;const n=r(180);t.createIdRemapMiddleware=function(){return(e,t,r,i)=>{const o=e.id,a=n.getUniqueId();e.id=a,t.id=a,r(r=>{e.id=o,t.id=o,r()})}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createAsyncMiddleware=void 0,t.createAsyncMiddleware=function(e){return async(t,r,n,i)=>{let o;const a=new Promise(e=>{o=e});let s=null,u=!1;const c=async()=>{u=!0,n(e=>{s=e,o()}),await a};try{await e(t,r,c),u?(await a,s(null)):i(null)}catch(e){s?s(e):i(e)}}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createScaffoldMiddleware=void 0,t.createScaffoldMiddleware=function(e){return(t,r,n,i)=>{const o=e[t.method];return void 0===o?n():"function"==typeof o?o(t,r,n,i):(r.result=o,i())}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mergeMiddleware=void 0;const n=r(181);t.mergeMiddleware=function(e){const t=new n.JsonRpcEngine;return e.forEach(e=>t.push(e)),t.asMiddleware()}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(182);t.default=function(e){if(!e||!e.engine)throw new Error("Missing engine parameter!");const{engine:t}=e,r=new n.Duplex({objectMode:!0,read:function(){},write:function(e,n,i){t.handle(e,(e,t)=>{r.push(t)}),i()}});return t.on&&t.on("notification",e=>{r.push(e)}),r}},function(e,t){},function(e,t,r){"use strict";var n=r(98).Buffer,i=r(363);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return this.head=1===this.length?this.tail=null:this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t=n.allocUnsafe(e>>>0),r=this.head,i=0;r;)r.data.copy(t,i),i+=r.data.length,r=r.next;return t},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,r){"use strict";e.exports=o;var n=r(187),i=Object.create(r(13));function o(e){if(!(this instanceof o))return new o(e);n.call(this,e)}i.inherits=r(3),i.inherits(o,n),o.prototype._transform=function(e,t,r){r(null,e)}},function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(57)),o=r(182);t.default=function(){const e={},t=new o.Duplex({objectMode:!0,read:function(){return!1},write:function(t,n,i){let o;try{t.id?function(t){const r=e[t.id];if(!r)throw new Error(`StreamMiddleware - Unknown response id "${t.id}"`);delete e[t.id],Object.assign(r.res,t),setTimeout(r.end)}(t):function(e){r.emit("notification",e)}(t)}catch(e){o=e}i(o)}}),r=new i.default;return{events:r,middleware:(r,n,i,o)=>{t.push(r),e[r.id]={req:r,res:n,next:i,end:o}},stream:t}}},function(e,t){e.exports=function e(t,r){if(t&&r)return e(t)(r);if("function"!=typeof t)throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(e){n[e]=t[e]}),n;function n(){for(var e=new Array(arguments.length),r=0;r<e.length;r++)e[r]=arguments[r];var n=t.apply(this,e),i=e[e.length-1];return"function"==typeof n&&n!==i&&Object.keys(i).forEach(function(e){n[e]=i[e]}),n}}},function(e,t){},function(e,t,r){"use strict";r.r(t),r.d(t,"default",function(){return it}),r.d(t,"TorusInpageProvider",function(){return Ne}),r.d(t,"LOGIN_PROVIDER",function(){return k}),r.d(t,"PAYMENT_PROVIDER",function(){return x}),r.d(t,"TORUS_BUILD_ENV",function(){return A}),r.d(t,"BUTTON_POSITION",function(){return O});var n,i=r(101),o=r.n(i),a=r(24),s=r.n(a),u=r(25),c=r.n(u),f=r(15),d=r.n(f),h=r(2),l=r.n(h),p=r(12),b=r.n(p),m=r(102),g=r(189),y=r.n(g),v=r(58),w=r(103),_=r.n(w),S=r(100),E=r.n(S),k={GOOGLE:"google",FACEBOOK:"facebook",TWITCH:"twitch",REDDIT:"reddit",DISCORD:"discord"},x={MOONPAY:"moonpay",WYRE:"wyre",RAMPNETWORK:"rampnetwork",XANPOOL:"xanpool",MERCURYO:"mercuryo"},A={PRODUCTION:"production",DEVELOPMENT:"development",BINANCE:"binance",TESTING:"testing",LRC:"lrc",BETA:"beta"},O={BOTTOM_LEFT:"bottom-left",TOP_LEFT:"top-left",BOTTOM_RIGHT:"bottom-right",TOP_RIGHT:"top-right"},M=(n={},l()(n,x.RAMPNETWORK,{line1:"Debit Card/ Apple Pay/ Bank transfer",line2:"0.49% - 2.9%",line3:"5,000\u20ac/purchase, 20,000\u20ac/mo",supportPage:"https://instant.ramp.network/",minOrderValue:50,maxOrderValue:2e4,validCurrencies:["GBP","EUR","USD"],validCryptoCurrencies:["ETH","DAI","USDC","BSC_BNB"],includeFees:!0,enforceMax:!1}),l()(n,x.MOONPAY,{line1:"Credit / Debit Card / Apple Pay",line2:"4.5% or 5 USD",line3:"2,000\u20ac/day, 10,000\u20ac/mo",supportPage:"https://help.moonpay.io/en/",minOrderValue:24.99,maxOrderValue:5e4,validCurrencies:["USD","EUR","GBP","AUD","CAD","SGD","RUB"],validCryptoCurrencies:["ETH","DAI","TUSD","USDC","USDT","BNB_BSC","BUSD_BSC"],includeFees:!0,enforceMax:!1}),l()(n,x.WYRE,{line1:"Apple Pay/ Debit/ Credit Card",line2:"4.9% + 30\xa2 or 5 USD",line3:"$250/day",supportPage:"https://support.sendwyre.com/en/",minOrderValue:5,maxOrderValue:500,validCurrencies:["USD","AUD","CAD","GBP","EUR"],validCryptoCurrencies:["ETH","DAI","USDC","USDT"],includeFees:!1,enforceMax:!1}),l()(n,x.XANPOOL,{line1:"PayNow/ InstaPay/ FPS/ GoJekPay/ UPI/ PromptPay/ VietelPay/ DuitNow",line2:"2.5% buying, 3% selling",line3:"$2,500 / day",supportPage:"mailto:support@xanpool.com",minOrderValue:100,maxOrderValue:2500,validCurrencies:["SGD","HKD","MYR","PHP","INR","VND","THB","IDR"],validCryptoCurrencies:["ETH","USDT"],includeFees:!0,sell:!0,enforceMax:!1}),l()(n,x.MERCURYO,{line1:"Credit/ Debit Card/ Apple Pay",line2:"3.95% or 4 USD",line3:"10,000\u20ac/day, 25,000\u20ac/mo",supportPage:"mailto:support@mercuryo.io",minOrderValue:30,maxOrderValue:5e3,validCurrencies:["USD","EUR","RUB","TRY","GBP","UAH"],validCryptoCurrencies:["ETH","DAI","BAT","USDT","OKB"],includeFees:!0,enforceMax:!1}),n),j={supportedVerifierList:[k.GOOGLE,k.REDDIT,k.DISCORD],paymentProviders:M,api:"https://api.tor.us",translations:{en:{embed:{continue:"Continue",actionRequired:"Authorization required",pendingAction:"Click continue to proceed with your request in a popup",cookiesRequired:"Cookies Required",enableCookies:"Please enable cookies in your browser preferences to access Torus",clickHere:"More Info"}},de:{embed:{continue:"Fortsetzen",actionRequired:"Autorisierung erforderlich",pendingAction:"Klicken Sie in einem Popup auf Weiter, um mit Ihrer Anfrage fortzufahren",cookiesRequired:"Cookies ben\xf6tigt",enableCookies:"Bitte aktivieren Sie Cookies in Ihren Browsereinstellungen, um auf Torus zuzugreifen",clickHere:"Mehr Info"}},ja:{embed:{continue:"\u7d99\u7d9a\u3059\u308b",actionRequired:"\u8a8d\u8a3c\u304c\u5fc5\u8981\u3067\u3059",pendingAction:"\u7d9a\u884c\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u3001\u30dd\u30c3\u30d7\u30a2\u30c3\u30d7\u3067\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u7d9a\u884c\u3057\u307e\u3059",cookiesRequired:"\u5fc5\u8981\u306a\u30af\u30c3\u30ad\u30fc",enableCookies:"Torus\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u306b\u306f\u3001\u30d6\u30e9\u30a6\u30b6\u306e\u8a2d\u5b9a\u3067Cookie\u3092\u6709\u52b9\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002",clickHere:"\u8a73\u3057\u304f\u306f"}},ko:{embed:{continue:"\uacc4\uc18d\ud558\ub2e4",actionRequired:"\uc2b9\uc778 \ud544\uc694",pendingAction:"\ud31d\uc5c5\uc5d0\uc11c \uc694\uccad\uc744 \uc9c4\ud589\ud558\ub824\uba74 \uacc4\uc18d\uc744 \ud074\ub9ad\ud558\uc2ed\uc2dc\uc624.",cookiesRequired:"\ucfe0\ud0a4 \ud544\uc694",enableCookies:"\ube0c\ub77c\uc6b0\uc800 \ud658\uacbd \uc124\uc815\uc5d0\uc11c \ucfe0\ud0a4\ub97c \ud65c\uc131\ud654\ud558\uc5ec Torus\uc5d0 \uc561\uc138\uc2a4\ud558\uc2ed\uc2dc\uc624.",clickHere:"\ub354 \ub9ce\uc740 \uc815\ubcf4"}},zh:{embed:{continue:"\u7ee7\u7eed",actionRequired:"\u9700\u8981\u6388\u6743",pendingAction:"\u5355\u51fb\u7ee7\u7eed\u4ee5\u5728\u5f39\u51fa\u7a97\u53e3\u4e2d\u7ee7\u7eed\u60a8\u7684\u8bf7\u6c42",cookiesRequired:"\u5fc5\u586bCookie",enableCookies:"\u8bf7\u5728\u60a8\u7684\u6d4f\u89c8\u5668\u9996\u9009\u9879\u4e2d\u542f\u7528cookie\u4ee5\u8bbf\u95eeTorus\u3002",clickHere:"\u66f4\u591a\u4fe1\u606f"}}},prodTorusUrl:"",localStorageKey:"torus-".concat(window.location.hostname)},R=function(e){return new Promise(function(t,r){null!=window.document.body?Promise.resolve(e()).then(t).catch(r):window.document.addEventListener("DOMContentLoaded",function(){Promise.resolve(e()).then(t).catch(r)})})},P=function(e){var t=window.document.createElement("template"),r=e.trim();return t.innerHTML=r,t.content.firstChild},T=function(e,t,r){e.on(t,function n(i){r(i),e.removeListener(t,n)})},I=r(61),C=r.n(I),B=r(7),N=r.n(B),L=r(50),D=r.n(L),q=r(30),U=r.n(q),F=r(31),H=r.n(F),z=r(16),W=r.n(z),K=r(104),V=r(57),J=r.n(V),G=r(32),X=r(191),Y=r.n(X),$=r(192),Z=r(105),Q=r(193),ee=r(49),te=r.n(ee),re=r(60),ne=r.n(re),ie=ne.a.getLogger("torus-embed"),oe={errors:{disconnected:function(){return"Torus: Lost connection to Torus."},permanentlyDisconnected:function(){return"Torus: Disconnected from iframe. Page reload required."},sendSiteMetadata:function(){return"Torus: Failed to send site metadata. This is an internal error, please report this bug."},unsupportedSync:function(e){return"Torus: The Torus Ethereum provider does not support synchronous methods like ".concat(e," without a callback parameter.")},invalidDuplexStream:function(){return"Must provide a Node.js-style duplex stream."},invalidOptions:function(e,t){return"Invalid options. Received: { maxEventListeners: ".concat(e,", shouldSendMetadata: ").concat(t," }")},invalidRequestArgs:function(){return"Expected a single, non-array, object argument."},invalidRequestMethod:function(){return"'args.method' must be a non-empty string."},invalidRequestParams:function(){return"'args.params' must be an object or array if provided."},invalidLoggerObject:function(){return"'args.logger' must be an object if provided."},invalidLoggerMethod:function(e){return"'args.logger' must include required method '".concat(e,"'.")}},info:{connected:function(e){return'Torus: Connected to chain with ID "'.concat(e,'".')}},warnings:{enableDeprecation:'Torus: ""ethereum.enable()" is deprecated and may be removed in the future. Please use "ethereum.send("eth_requestAccounts")" instead. For more information, see: https://eips.ethereum.org/EIPS/eip-1102',sendDeprecation:'Torus: "ethereum.send(...)" is deprecated and may be removed in the future. Please use "ethereum.sendAsync(...)" or "ethereum.request(...)" instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193',events:{close:'Torus: The event "close" is deprecated and may be removed in the future. Please use "disconnect" instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193',data:'Torus: The event "data" is deprecated and will be removed in the future.Use "message" instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193#message',networkChanged:'Torus: The event "networkChanged" is deprecated and may be removed in the future. Please use "chainChanged" instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193',notification:'Torus: The event "notification" is deprecated and may be removed in the future. Please use "message" instead.\nFor more information, see: https://eips.ethereum.org/EIPS/eip-1193'},publicConfigStore:'Torus: The property "publicConfigStore" is deprecated and WILL be removed in the future.'}},ae=r(68),se=r.n(ae),ue=r(14),ce=r(67),fe=r.n(ce),de=r(59),he=function(e){U()(r,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var r,n=W()(e);if(t){var i=W()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return H()(this,r)}}(r);function r(e){var n,i=e.parent,o=e.name;return s()(this,r),n=t.call(this,{objectMode:!0}),l()(N()(n),"_parent",void 0),l()(N()(n),"_name",void 0),n._parent=i,n._name=o,n}return c()(r,[{key:"_read",value:function(){}},{key:"_write",value:function(e,t,r){this._parent.push({name:this._name,data:e}),r()}}]),r}(de.Duplex);function le(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function pe(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?le(Object(r),!0).forEach(function(t){l()(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):le(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}ue.EventEmitter.defaultMaxListeners=100;var be=Symbol("IGNORE_SUBSTREAM"),me=function(e){U()(r,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var r,n=W()(e);if(t){var i=W()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return H()(this,r)}}(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return s()(this,r),e=t.call(this,pe(pe({},n),{},{objectMode:!0})),l()(N()(e),"_substreams",void 0),e._substreams={},e}return c()(r,[{key:"createStream",value:function(e){if(this.destroyed)throw new Error('ObjectMultiplex - parent stream for name "'.concat(e,'" already destroyed'));if(this._readableState.ended||this._writableState.ended)throw new Error('ObjectMultiplex - parent stream for name "'.concat(e,'" already ended'));if(!e)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[e])throw new Error('ObjectMultiplex - Substream for name "'.concat(e,'" already exists'));var t,r,n=new he({parent:this,name:e});return this._substreams[e]=n,t=function(e){return n.destroy(e||void 0)},r=fe()(t),se()(this,{readable:!1},r),se()(this,{writable:!1},r),n}},{key:"ignoreStream",value:function(e){if(!e)throw new Error("ObjectMultiplex - name must not be empty");if(this._substreams[e])throw new Error('ObjectMultiplex - Substream for name "'.concat(e,'" already exists'));this._substreams[e]=be}},{key:"_read",value:function(){}},{key:"_write",value:function(e,t,r){var n=e.name,i=e.data;if(!n)return ie.warn('ObjectMultiplex - malformed chunk without name "'.concat(e,'"')),r();var o=this._substreams[n];return o?(o!==be&&o.push(i),r()):(ie.warn('ObjectMultiplex - orphaned data for stream "'.concat(n,'"')),r())}},{key:"getStream",value:function(e){return this._substreams[e]?this._substreams[e]:this.createStream(e)}}]),r}(de.Duplex),ge=r(194),ye=r.n(ge),ve=r(69),we=j.paymentProviders;function _e(){return function(e,t,r){"string"==typeof e.method&&e.method||(t.error=G.ethErrors.rpc.invalidRequest({message:"The request 'method' must be a non-empty string.",data:e})),r(function(e){var r=t.error;return r?(ie.error("MetaMask - RPC Error: ".concat(r.message),r),e()):e()})}}function Se(e,t,r){var n='MetaMask: Lost connection to "'.concat(e,'".');null!=t&&t.stack&&(n+="\n".concat(t.stack)),ie.warn(n),r&&r.listenerCount("error")>0&&r.emit("error",n)}var Ee=ye.a,ke=function(){var e=d()(b.a.mark(function e(t,r){var n,i,o,a;return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(o=r.version||ve.b,e.prev=1,"binance"!==t&&"production"!==t||r.version){e.next=12;break}if(j.prodTorusUrl){e.next=9;break}return e.next=6,Object(v.get)("".concat(j.api,"/latestversion?name=").concat(ve.a,"&version=").concat(ve.b),{},{useAPIKey:!0});case 6:a=e.sent,e.next=10;break;case 9:a={data:j.prodTorusUrl};case 10:o=a.data,j.prodTorusUrl=a.data;case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(1),ie.error(e.t0,"unable to fetch latest version");case 17:ie.info("version used: ",o),e.t1=t,e.next="binance"===e.t1?21:"testing"===e.t1?24:"lrc"===e.t1?27:"beta"===e.t1?30:"development"===e.t1?33:36;break;case 21:return n="https://binance.tor.us/v".concat(o),i="info",e.abrupt("break",39);case 24:return n="https://testing.tor.us",i="debug",e.abrupt("break",39);case 27:return n="https://lrc.tor.us",i="debug",e.abrupt("break",39);case 30:return n="https://beta.tor.us",i="debug",e.abrupt("break",39);case 33:return n="http://localhost:4050",i="debug",e.abrupt("break",39);case 36:return n="https://app.tor.us/v".concat(o),i="error",e.abrupt("break",39);case 39:return e.abrupt("return",{torusUrl:n,logLevel:i});case 40:case"end":return e.stop()}},e,null,[[1,14]])}));return function(t,r){return e.apply(this,arguments)}}(),xe=function(){var e=(window.navigator.language||"en-US").split("-");return Object.prototype.hasOwnProperty.call(j.translations,e[0])?e[0]:"en"},Ae=["eth_subscription"],Oe=function(){},Me="directories=0,titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=660,width=375",je="directories=0,titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=700,width=450";function Re(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Pe(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Pe(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function Pe(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Te(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Ie(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Te(Object(r),!0).forEach(function(t){l()(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Te(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var Ce=function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return function(n,i){return n||i.error?t(n||i.error):!r||Array.isArray(i)?e(i):e(i.result)}},Be=function(e){U()(n,e);var t,r=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var r,n=W()(e);if(t){var i=W()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return H()(this,r)}}(n);function n(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=i.maxEventListeners,a=void 0===o?100:o,u=i.shouldSendMetadata,c=void 0===u||u,f=i.jsonRpcStreamName,d=void 0===f?"provider":f;if(s()(this,n),t=r.call(this),l()(N()(t),"chainId",void 0),l()(N()(t),"selectedAddress",void 0),l()(N()(t),"_state",void 0),l()(N()(t),"_rpcEngine",void 0),l()(N()(t),"_jsonRpcConnection",void 0),l()(N()(t),"networkVersion",void 0),l()(N()(t),"shouldSendMetadata",void 0),l()(N()(t),"isTorus",void 0),l()(N()(t),"_sentWarnings",{enable:!1,experimentalMethods:!1,send:!1,publicConfigStore:!1,events:{close:!1,data:!1,networkChanged:!1,notification:!1}}),l()(N()(t),"_publicConfigStore",void 0),l()(N()(t),"tryPreopenHandle",void 0),l()(N()(t),"enable",void 0),!Object($.duplex)(e))throw new Error(oe.errors.invalidDuplexStream());t.isTorus=!0,t.setMaxListeners(a),t._state=Ie({},n._defaultState),t.selectedAddress=null,t.networkVersion=null,t.chainId=null,t.shouldSendMetadata=c,t._handleAccountsChanged=t._handleAccountsChanged.bind(N()(t)),t._handleConnect=t._handleConnect.bind(N()(t)),t._handleDisconnect=t._handleDisconnect.bind(N()(t)),t._handleStreamDisconnect=t._handleStreamDisconnect.bind(N()(t)),t._sendSync=t._sendSync.bind(N()(t)),t._rpcRequest=t._rpcRequest.bind(N()(t)),t._warnOfDeprecation=t._warnOfDeprecation.bind(N()(t)),t.request=t.request.bind(N()(t)),t.send=t.send.bind(N()(t)),t.sendAsync=t.sendAsync.bind(N()(t));var h=new me;te()(e,h,e,t._handleStreamDisconnect.bind(N()(t),"MetaMask")),t._publicConfigStore=new K.ObservableStore({storageKey:"Metamask-Config"}),t._publicConfigStore.subscribe(function(e){var r=JSON.parse(e);if("isUnlocked"in r&&r.isUnlocked!==t._state.isUnlocked)if(t._state.isUnlocked=r.isUnlocked,t._state.isUnlocked)try{t._rpcRequest({method:"eth_accounts",params:[]},Oe,!0)}catch(e){}else t._handleAccountsChanged([]);if("selectedAddress"in r&&t.selectedAddress!==r.selectedAddress)try{t._rpcRequest({method:"eth_accounts",params:[]},Oe,!0)}catch(e){}"chainId"in r&&r.chainId!==t.chainId&&(t.chainId=r.chainId||null,t.emit("chainChanged",t.chainId),t._state.hasEmittedConnection||(t._handleConnect(t.chainId),t._state.hasEmittedConnection=!0)),"networkVersion"in r&&r.networkVersion!==t.networkVersion&&(t.networkVersion=r.networkVersion||null,t.emit("networkChanged",t.networkVersion))}),te()(h.createStream("publicConfig"),Object(K.storeAsStream)(t._publicConfigStore),Se.bind(N()(t),"MetaMask PublicConfigStore")),h.ignoreStream("phishing"),t.on("connect",function(){t._state.isConnected=!0});var p=Object(Q.createStreamMiddleware)();te()(p.stream,h.createStream(d),p.stream,t._handleStreamDisconnect.bind(N()(t),"MetaMask RpcProvider"));var b=new Z.JsonRpcEngine;return b.push(Object(Z.createIdRemapMiddleware)()),b.push(_e()),b.push(p.middleware),t._rpcEngine=b,p.events.on("notification",function(e){var r=e.method,n=e.params;"wallet_accountsChanged"===r?t._handleAccountsChanged(e.result):Ae.includes(e.method)&&(t.emit("data",e),t.emit("notification",n.result),t.emit("message",{type:r,data:n}))}),t}return c()(n,[{key:"publicConfigStore",get:function(){return this._sentWarnings.publicConfigStore||(ie.warn(oe.warnings.publicConfigStore),this._sentWarnings.publicConfigStore=!0),this._publicConfigStore}},{key:"isConnected",value:function(){return this._state.isConnected}},{key:"request",value:(t=d()(b.a.mark(function e(t){var r,n,i=this;return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t&&"object"===C()(t)&&!Array.isArray(t)){e.next=2;break}throw G.ethErrors.rpc.invalidRequest({message:oe.errors.invalidRequestArgs(),data:t});case 2:if(n=t.params,"string"==typeof(r=t.method)&&0!==r.length){e.next=5;break}throw G.ethErrors.rpc.invalidRequest({message:oe.errors.invalidRequestMethod(),data:t});case 5:if(void 0===n||Array.isArray(n)||"object"===C()(n)&&null!==n){e.next=7;break}throw G.ethErrors.rpc.invalidRequest({message:oe.errors.invalidRequestParams(),data:t});case 7:return e.abrupt("return",new Promise(function(e,t){i._rpcRequest({method:r,params:n},Ce(e,t))}));case 8:case"end":return e.stop()}},e)})),function(e){return t.apply(this,arguments)})},{key:"sendAsync",value:function(e,t){this._rpcRequest(e,t)}},{key:"addListener",value:function(e,t){return this._warnOfDeprecation(e),D()(W()(n.prototype),"addListener",this).call(this,e,t)}},{key:"on",value:function(e,t){return this._warnOfDeprecation(e),D()(W()(n.prototype),"on",this).call(this,e,t)}},{key:"once",value:function(e,t){return this._warnOfDeprecation(e),D()(W()(n.prototype),"once",this).call(this,e,t)}},{key:"prependListener",value:function(e,t){return this._warnOfDeprecation(e),D()(W()(n.prototype),"prependListener",this).call(this,e,t)}},{key:"prependOnceListener",value:function(e,t){return this._warnOfDeprecation(e),D()(W()(n.prototype),"prependOnceListener",this).call(this,e,t)}},{key:"_rpcRequest",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=t,o=e;Array.isArray(o)||(o.jsonrpc||(o.jsonrpc="2.0"),"eth_accounts"!==o.method&&"eth_requestAccounts"!==o.method||(i=function(e,i){r._handleAccountsChanged(i.result||[],"eth_accounts"===o.method,n),t(e,i)})),this.tryPreopenHandle(o,i)}},{key:"_handleConnect",value:function(e){this._state.isConnected||(this._state.isConnected=!0,this.emit("connect",{chainId:e}),ie.debug(oe.info.connected(e)))}},{key:"_handleDisconnect",value:function(e,t){var r;(this._state.isConnected||!this._state.isPermanentlyDisconnected&&!e)&&(this._state.isConnected=!1,e?(r=new G.EthereumRpcError(1013,t||oe.errors.disconnected()),ie.debug(r)):(r=new G.EthereumRpcError(1011,t||oe.errors.permanentlyDisconnected()),ie.error(r),this.chainId=null,this._state.accounts=null,this.selectedAddress=null,this._state.isUnlocked=!1,this._state.isPermanentlyDisconnected=!0),this.emit("disconnect",r))}},{key:"_handleStreamDisconnect",value:function(e,t){Se(e,t,this),this._handleDisconnect(!1,t?t.message:void 0)}},{key:"_handleAccountsChanged",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e;Array.isArray(n)||(ie.error("MetaMask: Received non-array accounts parameter. Please report this bug.",n),n=[]);var i,o=Re(e);try{for(o.s();!(i=o.n()).done;){var a=i.value;if("string"!=typeof a){ie.error("MetaMask: Received non-string account. Please report this bug.",e),n=[];break}}}catch(e){o.e(e)}finally{o.f()}Y()(this._state.accounts,n)||(t&&!r&&ie.error('MetaMask: "eth_accounts" unexpectedly updated accounts. Please report this bug.',n),this._state.accounts=n,this.emit("accountsChanged",n)),this.selectedAddress!==n[0]&&(this.selectedAddress=n[0]||null)}},{key:"_warnOfDeprecation",value:function(e){!1===this._sentWarnings.events[e]&&(ie.warn(oe.warnings.events[e]),this._sentWarnings.events[e]=!0)}},{key:"send",value:function(e,t){var r=this;return this._sentWarnings.send||(ie.warn(oe.warnings.sendDeprecation),this._sentWarnings.send=!0),"string"!=typeof e||t&&!Array.isArray(t)?e&&"object"===C()(e)&&"function"==typeof t?this._rpcRequest(e,t):this._sendSync(e):new Promise(function(n,i){try{r._rpcRequest({method:e,params:t},Ce(n,i,!1))}catch(e){i(e)}})}},{key:"_sendSync",value:function(e){var t;switch(e.method){case"eth_accounts":t=this.selectedAddress?[this.selectedAddress]:[];break;case"eth_coinbase":t=this.selectedAddress||null;break;case"eth_uninstallFilter":this._rpcRequest(e,Oe),t=!0;break;case"net_version":t=this.networkVersion||null;break;default:throw new Error(oe.errors.unsupportedSync(e.method))}return{id:e.id,jsonrpc:e.jsonrpc,result:t}}}]),n}(J.a);l()(Be,"_defaultState",{accounts:null,isConnected:!1,isUnlocked:!1,initialized:!1,isPermanentlyDisconnected:!1,hasEmittedConnection:!1});var Ne=Be,Le=r(38),De=r.n(Le),qe=function(e,t){var r={};return e.algorithms.forEach(function(e){r[e]=De()(e).update(t,"utf8").digest("base64")}),r},Ue=function(e,t){var r=function(e){return{algorithms:e.algorithms||["sha256"],delimiter:e.delimiter||" ",full:e.full||!1}}(e),n={hashes:qe(r,t),integrity:void 0};return n.integrity=function(e,t){return""+Object.keys(t.hashes).map(function(e){return"".concat(e,"-").concat(t.hashes[e])}).join(e.delimiter)}(r,n),r.full?n:n.integrity},Fe=function(e){U()(r,e);var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var r,n=W()(e);if(t){var i=W()(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return H()(this,r)}}(r);function r(e){var n,i,o,a,u,c,f,d=e.url,h=e.target,p=e.features;return s()(this,r),n=t.call(this),l()(N()(n),"url",void 0),l()(N()(n),"target",void 0),l()(N()(n),"features",void 0),l()(N()(n),"window",void 0),l()(N()(n),"windowTimer",void 0),l()(N()(n),"iClosedWindow",void 0),n.url=d,n.target=h||"_blank",n.features=p||(i=void 0!==window.screenLeft?window.screenLeft:window.screenX,o=void 0!==window.screenTop?window.screenTop:window.screenY,a=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:window.screen.width,u=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:window.screen.height,c=Math.abs((a-1200)/2/1+i),f=Math.abs((u-700)/2/1+o),"titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=".concat(700,",width=").concat(1200,",top=").concat(f,",left=").concat(c)),n.window=void 0,n.windowTimer=void 0,n.iClosedWindow=!1,n._setupTimer(),n}return c()(r,[{key:"_setupTimer",value:function(){var e=this;this.windowTimer=Number(setInterval(function(){e.window&&e.window.closed&&(clearInterval(e.windowTimer),e.iClosedWindow||e.emit("close"),e.iClosedWindow=!1,e.window=void 0),void 0===e.window&&clearInterval(e.windowTimer)},500))}},{key:"open",value:function(){var e;return this.window=window.open(this.url.href,this.target,this.features),null!==(e=this.window)&&void 0!==e&&e.focus&&this.window.focus(),Promise.resolve()}},{key:"close",value:function(){this.iClosedWindow=!0,this.window&&this.window.close()}},{key:"redirect",value:function(e){e?window.location.replace(this.url.href):window.location.href=this.url.href}}]),r}(ue.EventEmitter);function He(e){return new Promise(function(t,r){try{var n=document.createElement("img");n.onload=function(){return t(!0)},n.onerror=function(){return t(!1)},n.src=e}catch(e){r(e)}})}var ze=function(e){var t=e.document,r=t.querySelector('head > meta[property="og:site_name"]');if(r)return r.content;var n=t.querySelector('head > meta[name="title"]');return n?n.content:t.title&&t.title.length>0?t.title:e.location.hostname};function We(e){return Ke.apply(this,arguments)}function Ke(){return(Ke=d()(b.a.mark(function e(t){var r,n;return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(r=t.document).querySelector('head > link[rel="shortcut icon"]'),e.t0=n,!e.t0){e.next=7;break}return e.next=6,He(n.href);case 6:e.t0=e.sent;case 7:if(!e.t0){e.next=9;break}return e.abrupt("return",n.href);case 9:if(n=Array.from(r.querySelectorAll('head > link[rel="icon"]')).find(function(e){return Boolean(e.href)}),e.t1=n,!e.t1){e.next=15;break}return e.next=14,He(n.href);case 14:e.t1=e.sent;case 15:if(!e.t1){e.next=17;break}return e.abrupt("return",n.href);case 17:return e.abrupt("return",null);case 18:case"end":return e.stop()}},e)}))).apply(this,arguments)}var Ve=function(){var e=d()(b.a.mark(function e(){return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=ze(window),e.next=3,We(window);case 3:return e.t1=e.sent,e.abrupt("return",{name:e.t0,icon:e.t1});case 5:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}();function Je(){return(Je=d()(b.a.mark(function e(t){var r;return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Ve();case 3:r=e.sent,t.handle({jsonrpc:"2.0",id:Ee(),method:"wallet_sendDomainMetadata",params:r},Oe),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),ie.error({message:oe.errors.sendSiteMetadata(),originalError:e.t0});case 10:case"end":return e.stop()}},e,null,[[0,7]])}))).apply(this,arguments)}var Ge,Xe=["host","chainId","networkName"],Ye=["host","chainId","networkName"];function $e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Ze(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?$e(Object(r),!0).forEach(function(t){l()(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):$e(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var Qe,et=(Ge={},l()(Ge,k.GOOGLE,!0),l()(Ge,k.FACEBOOK,!0),l()(Ge,k.REDDIT,!0),l()(Ge,k.TWITCH,!0),l()(Ge,k.DISCORD,!0),Ge),tt="sha384-LCE8WzUv/xXZg9ngpTnLzmflSLpokk6tnHPhVtaoDooNWFZNWgh7b4KFMhc++M5F",rt=["eth_sendTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","personal_sign"],nt=function(e){var t;try{t=window.localStorage;var r="__storage_test__";return t.setItem(r,r),t.removeItem(r),!0}catch(e){return e&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&t&&0!==t.length}}("localStorage");(Qe=d()(b.a.mark(function e(){var t;return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,"undefined"!=typeof document){e.next=3;break}return e.abrupt("return");case 3:return t=document.createElement("link"),e.next=6,ke("production",{check:!1,hash:tt,version:""});case 6:t.href="".concat(e.sent.torusUrl,"/popup"),t.crossOrigin="anonymous",t.type="text/html",t.rel="prefetch",t.relList&&t.relList.supports&&t.relList.supports("prefetch")&&document.head.appendChild(t),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),ie.warn(e.t0);case 18:case"end":return e.stop()}},e,null,[[0,15]])})),function(){return Qe.apply(this,arguments)})();var it=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.buttonPosition,n=void 0===r?O.BOTTOM_LEFT:r,i=t.modalZIndex,o=void 0===i?99999:i,a=t.apiKey,u=void 0===a?"torus-default":a;s()(this,e),l()(this,"buttonPosition",O.BOTTOM_LEFT),l()(this,"torusUrl",void 0),l()(this,"torusIframe",void 0),l()(this,"styleLink",void 0),l()(this,"isLoggedIn",void 0),l()(this,"isInitialized",void 0),l()(this,"torusWidgetVisibility",void 0),l()(this,"torusAlert",void 0),l()(this,"nodeDetailManager",void 0),l()(this,"torusJs",void 0),l()(this,"apiKey",void 0),l()(this,"modalZIndex",void 0),l()(this,"alertZIndex",void 0),l()(this,"torusAlertContainer",void 0),l()(this,"isIframeFullScreen",void 0),l()(this,"whiteLabel",void 0),l()(this,"requestedVerifier",void 0),l()(this,"currentVerifier",void 0),l()(this,"embedTranslations",void 0),l()(this,"ethereum",void 0),l()(this,"provider",void 0),l()(this,"communicationMux",void 0),l()(this,"isLoginCallback",void 0),l()(this,"dappStorageKey",void 0),l()(this,"paymentProviders",j.paymentProviders),this.buttonPosition=n,this.torusUrl="",this.isLoggedIn=!1,this.isInitialized=!1,this.torusWidgetVisibility=!0,this.requestedVerifier="",this.currentVerifier="",this.nodeDetailManager=new y.a,this.torusJs=new _.a({metadataHost:"https://metadata.tor.us",allowHost:"https://signer.tor.us/api/allow"}),this.apiKey=u,_.a.setAPIKey(u),Object(v.setAPIKey)(u),this.modalZIndex=o,this.alertZIndex=o+1e3,this.isIframeFullScreen=!1,this.dappStorageKey=""}var t,r,n;return c()(e,[{key:"init",value:(n=d()(b.a.mark(function e(){var t,r,n,i,o,a,s,u,c,f,h,l,p,m,g,y,v,w,_,S,k,x,O,M,T,I,C,B,N,L,D,q,U,F,H,z,W,K,V,J,G=this,X=arguments;return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=void 0===(r=(t=X.length>0&&void 0!==X[0]?X[0]:{}).buildEnv)?A.PRODUCTION:r,o=void 0!==(i=t.enableLogging)&&i,s=void 0===(a=t.enabledVerifiers)?et:a,c=void 0===(u=t.network)?{host:"mainnet",chainId:null,networkName:"",blockExplorer:"",ticker:"",tickerName:""}:u,h=void 0===(f=t.loginConfig)?{}:f,p=void 0===(l=t.showTorusButton)||l,g=void 0===(m=t.integrity)?{check:!1,hash:tt,version:""}:m,y=t.whiteLabel,w=void 0!==(v=t.skipTKey)&&v,S=void 0!==(_=t.useLocalStorage)&&_,!this.isInitialized){e.next=3;break}throw new Error("Already initialized");case 3:return e.next=5,ke(n,g);case 5:if(O=(k=e.sent).logLevel,ie.info(x=k.torusUrl,"url loaded"),this.torusUrl=x,this.whiteLabel=y,ie.setDefaultLevel(O),o?ie.enableAll():ie.disableAll(),this.torusWidgetVisibility=p,M="",nt&&S&&((T=window.localStorage.getItem(j.localStorageKey))?M=T:(I="torus-app-".concat(Ee()),window.localStorage.setItem(j.localStorageKey,I),M=I)),this.dappStorageKey=M,(C=new URL(x)).pathname.endsWith("/")?C.pathname+="popup":C.pathname+="/popup",M&&(C.hash="#dappStorageKey=".concat(M)),this.torusIframe=P('<iframe\n id="torusIframe"\n class="torusIframe"\n src="'.concat(C.href,'"\n style="display: none; position: fixed; top: 0; right: 0; width: 100%;\n height: 100%; border: none; border-radius: 0; z-index: ').concat(this.modalZIndex,'"\n ></iframe>')),this.torusAlertContainer=P('<div id="torusAlertContainer"></div>'),this.torusAlertContainer.style.display="none",this.torusAlertContainer.style.setProperty("z-index",this.alertZIndex.toString()),(B=window.document.createElement("link")).setAttribute("rel","stylesheet"),B.setAttribute("type","text/css"),B.setAttribute("href","".concat(x,"/css/widget.css")),this.styleLink=B,D=void 0===(L=(N=this.whiteLabel||{}).defaultLanguage)?xe():L,U=void 0===(q=N.customTranslations)?{}:q,F=E()(j.translations,U),H=F[D]||j.translations[xe()],this.embedTranslations=H.embed,z=function(){window.document.head.appendChild(G.styleLink),window.document.body.appendChild(G.torusIframe),window.document.body.appendChild(G.torusAlertContainer),G.torusIframe.onload=function(){G.isIframeFullScreen||G._displayIframe()}},W=function(){var e=d()(b.a.mark(function e(){var t,r;return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,R(z);case 2:return e.next=4,R(G._setupWeb3.bind(G));case 4:return t=G.communicationMux.getStream("init_stream"),r=new Promise(function(e,r){t.on("data",function(t){var n=t.error;"init_complete"===t.name&&t.data.success?e(void 0):n&&r(new Error(n))})}),e.next=8,R(d()(b.a.mark(function e(){return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t.write({name:"init_stream",data:{enabledVerifiers:s,loginConfig:h,whiteLabel:G.whiteLabel,buttonPosition:G.buttonPosition,torusWidgetVisibility:G.torusWidgetVisibility,apiKey:G.apiKey,skipTKey:w}}),e.next=3,G._setProvider(c);case 3:return e.next=5,r;case 5:G.isInitialized=!0;case 6:case"end":return e.stop()}},e)})));case 8:case"end":return e.stop()}},e)}));return function(){return e.apply(this,arguments)}}(),"production"!==n||!g.check){e.next=56;break}return K="".concat(x,"/popup"),e.next=39,fetch(K,{cache:"reload"});case 39:if("max-age=3600"===(V=e.sent).headers.get("Cache-Control")){e.next=42;break}throw new Error("Unexpected Cache-Control headers, got ".concat(V.headers.get("Cache-Control")));case 42:return e.next=44,V.text();case 44:if(J=Ue({algorithms:["sha384"]},e.sent),ie.info(J,"integrity"),J!==g.hash){e.next=52;break}return e.next=50,W();case 50:e.next=54;break;case 52:throw this.clearInit(),new Error("Integrity check failed");case 54:e.next=58;break;case 56:return e.next=58,W();case 58:return e.abrupt("return",void 0);case 59:case"end":return e.stop()}},e,this)})),function(){return n.apply(this,arguments)})},{key:"login",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.verifier,r=void 0===t?"":t;if(!this.isInitialized)throw new Error("Call init() first");return this.requestedVerifier=r,this.ethereum.enable()}},{key:"logout",value:function(){var e=this;return new Promise(function(t,r){if(e.isLoggedIn){e.communicationMux.getStream("logout").write({name:"logOut"});var n=e.communicationMux.getStream("status");T(n,"data",function(n){n.loggedIn?r(new Error("Some Error Occured")):(e.isLoggedIn=!1,e.currentVerifier="",e.requestedVerifier="",t())})}else r(new Error("User has not logged in yet"))})}},{key:"cleanUp",value:(r=d()(b.a.mark(function e(){return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isLoggedIn){e.next=3;break}return e.next=3,this.logout();case 3:this.clearInit();case 4:case"end":return e.stop()}},e,this)})),function(){return r.apply(this,arguments)})},{key:"clearInit",value:function(){function e(e){return e instanceof Element||e instanceof HTMLDocument}e(this.styleLink)&&window.document.body.contains(this.styleLink)&&(this.styleLink.remove(),this.styleLink=void 0),e(this.torusIframe)&&window.document.body.contains(this.torusIframe)&&(this.torusIframe.remove(),this.torusIframe=void 0),e(this.torusAlertContainer)&&window.document.body.contains(this.torusAlertContainer)&&(this.torusAlert=void 0,this.torusAlertContainer.remove(),this.torusAlertContainer=void 0),this.isInitialized=!1}},{key:"_createPopupBlockAlert",value:function(e,t){var r=this,n=this._getLogoUrl(),i=P('<div id="torusAlert" class="torus-alert--v2">'+'<div id="torusAlert__logo"><img src="'.concat(n,'" /></div>')+"<div>"+'<h1 id="torusAlert__title">'.concat(this.embedTranslations.actionRequired,"</h1>")+'<p id="torusAlert__desc">'.concat(this.embedTranslations.pendingAction,"</p>")+"</div></div>"),o=P('<div><a id="torusAlert__btn">'.concat(this.embedTranslations.continue,"</a></div>")),a=P('<div id="torusAlert__btn-container"></div>');a.appendChild(o),i.appendChild(a),this._setEmbedWhiteLabel(i),R(function(){r.torusAlertContainer.style.display="block",r.torusAlertContainer.appendChild(i)}),R(function(){o.addEventListener("click",function(){r._handleWindow(e,{url:t,target:"_blank",features:je}),i.remove(),0===r.torusAlertContainer.children.length&&(r.torusAlertContainer.style.display="none")})})}},{key:"_sendWidgetVisibilityStatus",value:function(e){this.communicationMux.getStream("torus-widget-visibility").write({data:e})}},{key:"hideTorusButton",value:function(){this.torusWidgetVisibility=!1,this._sendWidgetVisibilityStatus(!1),this._displayIframe()}},{key:"showTorusButton",value:function(){this.torusWidgetVisibility=!0,this._sendWidgetVisibilityStatus(!0),this._displayIframe()}},{key:"_displayIframe",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t={};if(e)t.display="block",t.width="100%",t.height="100%",t.top="0px",t.right="0px",t.left="0px",t.bottom="0px";else switch(t.display=this.torusWidgetVisibility?"block":"none",t.height="70px",t.width="70px",this.buttonPosition){case O.TOP_LEFT:t.top="0px",t.left="0px",t.right="auto",t.bottom="auto";break;case O.TOP_RIGHT:t.top="0px",t.right="0px",t.left="auto",t.bottom="auto";break;case O.BOTTOM_RIGHT:t.bottom="0px",t.right="0px",t.top="auto",t.left="auto";break;case O.BOTTOM_LEFT:default:t.bottom="0px",t.left="0px",t.top="auto",t.right="auto"}Object.assign(this.torusIframe.style,t),this.isIframeFullScreen=e}},{key:"_setupWeb3",value:function(){var e=this;ie.info("setupWeb3 running");var t=new m.WindowPostMessageStream({name:"embed_metamask",target:"iframe_metamask",targetWindow:this.torusIframe.contentWindow}),r=new m.WindowPostMessageStream({name:"embed_comm",target:"iframe_comm",targetWindow:this.torusIframe.contentWindow}),n=new Ne(t),i=function(e){var t=n[e];n[e]=function(e){if(e&&"eth_requestAccounts"===e)return n.enable();for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return t.apply(this,[e].concat(i))}};i("send"),i("sendAsync"),n.enable=function(){return new Promise(function(t,r){n.sendAsync({jsonrpc:"2.0",id:Ee(),method:"eth_requestAccounts",params:[]},function(n,i){var o=(i||{}).result;if(n)setTimeout(function(){r(n)},50);else if(Array.isArray(o)&&o.length>0){var a=function(){if(""!==e.requestedVerifier&&e.currentVerifier!==e.requestedVerifier){var n=e.requestedVerifier;e.logout().then(function(i){e.requestedVerifier=n,e._showLoginPopup(!0,t,r)}).catch(function(e){return r(e)})}else t(o)};e.isLoggedIn?a():e.isLoginCallback=a}else e._showLoginPopup(!0,t,r)})})},n.tryPreopenHandle=function(t,r){var i=t;if(!Array.isArray(i)&&rt.includes(i.method)){var o=Ee();e._handleWindow(o,{target:"_blank",features:je}),i.preopenInstanceId=o}n._rpcEngine.handle(i,r)};var o=new Proxy(n,{deleteProperty:function(){return!0}});this.ethereum=o;var a,s,u=(a=r,s=new me,te()(a,s,a,function(e){e&&ne.a.error(e)}),s);this.communicationMux=u,u.getStream("window").on("data",function(t){"create_window"===t.name&&e._createPopupBlockAlert(t.data.preopenInstanceId,t.data.url)}),u.getStream("widget").on("data",function(t){e._displayIframe(t.data)}),u.getStream("status").on("data",function(t){t.loggedIn?(e.isLoggedIn=t.loggedIn,e.currentVerifier=t.verifier):e._displayIframe(),e.isLoginCallback&&(e.isLoginCallback(),delete e.isLoginCallback)}),this.provider=o,this.provider.shouldSendMetadata&&function(e){Je.apply(this,arguments)}(this.provider._rpcEngine),ie.debug("Torus - injected provider")}},{key:"_showLoginPopup",value:function(e,t,r){var n=this,i=function(e){var i=e.err,o=e.selectedAddress;i?(ie.error(i),r&&r(i)):t&&t([o]),n.isIframeFullScreen&&n._displayIframe()},o=this.communicationMux.getStream("oauth");if(this.requestedVerifier){T(o,"data",i);var a=Ee();this._handleWindow(a),o.write({name:"oauth",data:{calledFromEmbed:e,verifier:this.requestedVerifier,preopenInstanceId:a}})}else this._displayIframe(!0),T(o,"data",i),o.write({name:"oauth_modal",data:{calledFromEmbed:e}})}},{key:"setProvider",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.host,n=void 0===r?"mainnet":r,i=t.chainId,a=void 0===i?null:i,s=t.networkName,u=void 0===s?"":s,c=o()(t,Xe);return new Promise(function(t,r){var i=e.communicationMux.getStream("provider_change");T(i,"data",function(e){var n=e.data,i=n.err,o=n.success;ie.info(e),i?r(i):o?t():r(new Error("some error occured"))});var o=Ee();e._handleWindow(o,{target:"_blank",features:Me}),i.write({name:"show_provider_change",data:{network:Ze({host:n,chainId:a,networkName:u},c),preopenInstanceId:o,override:!1}})})}},{key:"_setProvider",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.host,n=void 0===r?"mainnet":r,i=t.chainId,a=void 0===i?null:i,s=t.networkName,u=void 0===s?"":s,c=o()(t,Ye);return new Promise(function(t,r){if(e.isInitialized)r(new Error("Already initialized"));else{var i=e.communicationMux.getStream("provider_change");T(i,"data",function(e){ie.info(e);var n=e.data,i=n.err,o=n.success;i?r(i):o?t():r(new Error("some error occured"))}),i.write({name:"show_provider_change",data:{network:Ze({host:n,chainId:a,networkName:u},c),override:!0}})}})}},{key:"showWallet",value:function(e){var t=this,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=this.communicationMux.getStream("show_wallet"),i=e?"/".concat(e):"";n.write({name:"show_wallet",data:{path:i}});var o=function(e){if("show_wallet_instance"===e.name){var n=e.data.instanceId,o=new URL("".concat(t.torusUrl,"/wallet").concat(i));o.searchParams.append("integrity","true"),o.searchParams.append("instanceId",n),Object.keys(r).forEach(function(e){o.searchParams.append(e,r[e])}),t.dappStorageKey&&(o.hash="#dappStorageKey=".concat(t.dappStorageKey)),new Fe({url:o,features:"directories=0,titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=740,width=1315"}).open()}};T(n,"data",o)}},{key:"getPublicAddress",value:(t=d()(b.a.mark(function e(t){var r,n,i,o,a;return b.a.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=t.verifierId,o=void 0!==(i=t.isExtended)&&i,j.supportedVerifierList.includes(r=t.verifier)){e.next=3;break}throw new Error("Unsupported verifier");case 3:return e.next=5,this.nodeDetailManager.getNodeDetails(!1,!0);case 5:return e.abrupt("return",this.torusJs.getPublicAddress((a=e.sent).torusNodeEndpoints,a.torusNodePub,{verifier:r,verifierId:n},o));case 7:case"end":return e.stop()}},e,this)})),function(e){return t.apply(this,arguments)})},{key:"getUserInfo",value:function(e){var t=this;return new Promise(function(r,n){if(t.isLoggedIn){var i=t.communicationMux.getStream("user_info_access");i.write({name:"user_info_access_request"}),T(i,"data",function(i){var o=i.data,a=o.rejected,s=o.newRequest;if("user_info_access_response"===i.name)if(o.approved)r(o.payload);else if(a)n(new Error("User rejected the request"));else if(s){var u=t.communicationMux.getStream("user_info");T(u,"data",function(e){"user_info_response"===e.name&&(e.data.approved?r(e.data.payload):n(new Error("User rejected the request")))});var c=Ee();t._handleWindow(c,{target:"_blank",features:Me}),u.write({name:"user_info_request",data:{message:e,preopenInstanceId:c}})}})}else n(new Error("User has not logged in yet"))})}},{key:"_handleWindow",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.url,n=t.target,i=t.features;if(e){var o=this.communicationMux.getStream("window"),a=new URL(r||"".concat(this.torusUrl,"/redirect?preopenInstanceId=").concat(e));this.dappStorageKey&&(a.hash?a.hash+="&dappStorageKey=".concat(this.dappStorageKey):a.hash="#dappStorageKey=".concat(this.dappStorageKey));var s=new Fe({url:a,target:n,features:i});if(s.open(),!s.window)return void this._createPopupBlockAlert(e,a.href);o.write({name:"opened_window",data:{preopenInstanceId:e}});var u=function t(r){r.preopenInstanceId===e&&r.close&&(s.close(),o.removeListener("data",t))};o.on("data",u),s.once("close",function(){o.write({data:{preopenInstanceId:e,closed:!0}}),o.removeListener("data",u)})}}},{key:"initiateTopup",value:function(e,t){var r=this;return new Promise(function(n,i){if(r.isInitialized){var o=function(e,t){var r={};if(!e)return{errors:r,isValid:!0};if(e&&!we[e])return r.provider="Invalid Provider",{errors:r,isValid:0===Object.keys(r).length};var n=we[e],i=t||{};if(i.fiatValue){var o=+parseFloat(i.fiatValue.toString())||0;o<n.minOrderValue&&(r.fiatValue="Requested amount is lower than supported"),o>n.maxOrderValue&&n.enforceMax&&(r.fiatValue="Requested amount is higher than supported")}return i.selectedCurrency&&!n.validCurrencies.includes(i.selectedCurrency)&&(r.selectedCurrency="Unsupported currency"),i.selectedCryptoCurrency&&!n.validCryptoCurrencies.includes(i.selectedCryptoCurrency)&&(r.selectedCryptoCurrency="Unsupported cryptoCurrency"),{errors:r,isValid:0===Object.keys(r).length}}(e,t);if(!o.isValid)return void i(new Error(JSON.stringify(o.errors)));var a=r.communicationMux.getStream("topup");T(a,"data",function(e){"topup_response"===e.name&&(e.data.success?n(e.data.success):i(new Error(e.data.error)))});var s=Ee();r._handleWindow(s),a.write({name:"topup_request",data:{provider:e,params:t,preopenInstanceId:s}})}else i(new Error("Torus is not initialized yet"))})}},{key:"_setEmbedWhiteLabel",value:function(e){var t=(this.whiteLabel||{}).theme;if(t){var r=t.isDark,n=t.colors,i=void 0===n?{}:n;void 0!==r&&r&&e.classList.add("torus-dark"),i.torusBrand1&&e.style.setProperty("--torus-brand-1",i.torusBrand1),i.torusGray2&&e.style.setProperty("--torus-gray-2",i.torusGray2)}}},{key:"_getLogoUrl",value:function(){var e,t,r,n,i="".concat(this.torusUrl,"/images/torus_icon-blue.svg");return null!==(e=this.whiteLabel)&&void 0!==e&&null!==(t=e.theme)&&void 0!==t&&t.isDark?(null===(r=this.whiteLabel)||void 0===r?void 0:r.logoLight)||i:(null===(n=this.whiteLabel)||void 0===n?void 0:n.logoDark)||i}}]),e}()},function(e,t,r){"use strict";r.r(t),r.d(t,"TransactionTypes",function(){return y}),r.d(t,"computeAddress",function(){return E}),r.d(t,"recoverAddress",function(){return k}),r.d(t,"accessListify",function(){return O}),r.d(t,"serialize",function(){return P}),r.d(t,"parse",function(){return I});var n=r(26),i=r(35),o=r(0),a=r(371),s=r(18),u=r(8),c=r(27),f=r(190),d=r(5);const h=new d.a("signing-key/5.4.0");let l=null;function p(){return l||(l=new f.a("secp256k1")),l}class b{constructor(e){Object(u.c)(this,"curve","secp256k1"),Object(u.c)(this,"privateKey",Object(o.g)(e));const t=p().keyFromPrivate(Object(o.a)(this.privateKey));Object(u.c)(this,"publicKey","0x"+t.getPublic(!1,"hex")),Object(u.c)(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),Object(u.c)(this,"_isSigningKey",!0)}_addPoint(e){const t=p().keyFromPublic(Object(o.a)(this.publicKey)),r=p().keyFromPublic(Object(o.a)(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){const t=p().keyFromPrivate(Object(o.a)(this.privateKey)),r=Object(o.a)(e);32!==r.length&&h.throwArgumentError("bad digest length","digest",e);const n=t.sign(r,{canonical:!0});return Object(o.k)({recoveryParam:n.recoveryParam,r:Object(o.f)("0x"+n.r.toString(16),32),s:Object(o.f)("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const t=p().keyFromPrivate(Object(o.a)(this.privateKey)),r=p().keyFromPublic(Object(o.a)(m(e)));return Object(o.f)("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function m(e,t){const r=Object(o.a)(e);if(32===r.length){const e=new b(r);return t?"0x"+p().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?Object(o.g)(r):"0x"+p().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+p().keyFromPublic(r).getPublic(!0,"hex"):Object(o.g)(r):h.throwArgumentError("invalid public or private key","key","[REDACTED]")}const g=new d.a("transactions/5.4.0");var y;function v(e){return"0x"===e?null:Object(n.a)(e)}function w(e){return"0x"===e?a.d:i.a.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(y||(y={}));const _=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],S={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function E(e){const t=m(e);return Object(n.a)(Object(o.e)(Object(s.a)(Object(o.e)(t,1)),12))}function k(e,t){return E(function(e,t){const r=Object(o.k)(t),n={r:Object(o.a)(r.r),s:Object(o.a)(r.s)};return"0x"+p().recoverPubKey(Object(o.a)(e),n,r.recoveryParam).encode("hex",!1)}(Object(o.a)(e),t))}function x(e,t){const r=Object(o.l)(i.a.from(e).toHexString());return r.length>32&&g.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function A(e,t){return{address:Object(n.a)(e),storageKeys:(t||[]).map((t,r)=>(32!==Object(o.d)(t)&&g.throwArgumentError("invalid access list storageKey",`accessList[${e}:${r}]`,t),t.toLowerCase()))}}function O(e){if(Array.isArray(e))return e.map((e,t)=>Array.isArray(e)?(e.length>2&&g.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),A(e[0],e[1])):A(e.address,e.storageKeys));const t=Object.keys(e).map(t=>{const r=e[t].reduce((e,t)=>(e[t]=!0,e),{});return A(t,Object.keys(r).sort())});return t.sort((e,t)=>e.address.localeCompare(t.address)),t}function M(e){return O(e).map(e=>[e.address,e.storageKeys])}function j(e,t){if(null!=e.gasPrice){const t=i.a.from(e.gasPrice),r=i.a.from(e.maxFeePerGas||0);t.eq(r)||g.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:r})}const r=[x(e.chainId||0,"chainId"),x(e.nonce||0,"nonce"),x(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),x(e.maxFeePerGas||0,"maxFeePerGas"),x(e.gasLimit||0,"gasLimit"),null!=e.to?Object(n.a)(e.to):"0x",x(e.value||0,"value"),e.data||"0x",M(e.accessList||[])];if(t){const e=Object(o.k)(t);r.push(x(e.recoveryParam,"recoveryParam")),r.push(Object(o.l)(e.r)),r.push(Object(o.l)(e.s))}return Object(o.c)(["0x02",c.b(r)])}function R(e,t){const r=[x(e.chainId||0,"chainId"),x(e.nonce||0,"nonce"),x(e.gasPrice||0,"gasPrice"),x(e.gasLimit||0,"gasLimit"),null!=e.to?Object(n.a)(e.to):"0x",x(e.value||0,"value"),e.data||"0x",M(e.accessList||[])];if(t){const e=Object(o.k)(t);r.push(x(e.recoveryParam,"recoveryParam")),r.push(Object(o.l)(e.r)),r.push(Object(o.l)(e.s))}return Object(o.c)(["0x01",c.b(r)])}function P(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&g.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){Object(u.b)(e,S);const r=[];_.forEach(function(t){let n=e[t.name]||[];const i={};t.numeric&&(i.hexPad="left"),n=Object(o.a)(Object(o.g)(n,i)),t.length&&n.length!==t.length&&n.length>0&&g.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=Object(o.l)(n),n.length>t.maxLength&&g.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n)),r.push(Object(o.g)(n))});let n=0;if(null!=e.chainId?(n=e.chainId,"number"!=typeof n&&g.throwArgumentError("invalid transaction.chainId","transaction",e)):t&&!Object(o.i)(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push(Object(o.g)(n)),r.push("0x"),r.push("0x")),!t)return c.b(r);const i=Object(o.k)(t);let a=27+i.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),a+=2*n+8,i.v>28&&i.v!==a&&g.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):i.v!==a&&g.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push(Object(o.g)(a)),r.push(Object(o.l)(Object(o.a)(i.r))),r.push(Object(o.l)(Object(o.a)(i.s))),c.b(r)}(e,t);switch(e.type){case 1:return R(e,t);case 2:return j(e,t)}return g.throwError("unsupported transaction type: "+e.type,d.a.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function T(e,t,r){try{const r=w(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r}catch(e){g.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=Object(o.f)(t[1],32),e.s=Object(o.f)(t[2],32);try{const t=Object(s.a)(r(e));e.from=k(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){console.log(e)}}function I(e){const t=Object(o.a)(e);if(t[0]>127)return function(e){const t=c.a(e);9!==t.length&&6!==t.length&&g.throwArgumentError("invalid raw transaction","rawTransaction",e);const r={nonce:w(t[0]).toNumber(),gasPrice:w(t[1]),gasLimit:w(t[2]),to:v(t[3]),value:w(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=i.a.from(t[6]).toNumber()}catch(e){return console.log(e),r}if(r.r=Object(o.f)(t[7],32),r.s=Object(o.f)(t[8],32),i.a.from(r.r).isZero()&&i.a.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27;const i=t.slice(0,6);0!==r.chainId&&(i.push(Object(o.g)(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);const a=Object(s.a)(c.b(i));try{r.from=k(a,{r:Object(o.g)(r.r),s:Object(o.g)(r.s),recoveryParam:n})}catch(e){console.log(e)}r.hash=Object(s.a)(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){const t=c.a(e.slice(1));8!==t.length&&11!==t.length&&g.throwArgumentError("invalid component count for transaction type: 1","payload",Object(o.g)(e));const r={type:1,chainId:w(t[0]).toNumber(),nonce:w(t[1]).toNumber(),gasPrice:w(t[2]),gasLimit:w(t[3]),to:v(t[4]),value:w(t[5]),data:t[6],accessList:O(t[7])};return 8===t.length||(r.hash=Object(s.a)(e),T(r,t.slice(8),R)),r}(t);case 2:return function(e){const t=c.a(e.slice(1));9!==t.length&&12!==t.length&&g.throwArgumentError("invalid component count for transaction type: 2","payload",Object(o.g)(e));const r=w(t[2]),n=w(t[3]),i={type:2,chainId:w(t[0]).toNumber(),nonce:w(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:w(t[4]),to:v(t[5]),value:w(t[6]),data:t[7],accessList:O(t[8])};return 9===t.length||(i.hash=Object(s.a)(e),T(i,t.slice(9),j)),i}(t)}return g.throwError("unsupported transaction type: "+t[0],d.a.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}},,function(e,t,r){"use strict";r.d(t,"b",function(){return i}),r.d(t,"d",function(){return o}),r.d(t,"c",function(){return a}),r.d(t,"a",function(){return s});var n=r(35);const i=n.a.from(-1),o=n.a.from(0),a=n.a.from(1),s=n.a.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")}]).default},xfeJ:function(e,t){e.exports=function(e){return-1!==Function.toString.call(e).indexOf("[native code]")}}}]);