>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(g[t])return g[t];var e;if("k256"===t)e=new v;else if("p224"===t)e=new y;else if("p192"===t)e=new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return g[t]=e,e},M.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){i(0===(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),a=0;!n.isZero()&&0===n.andln(1);)a++,n.iushrn(1);i(!n.isZero());var s=new o(1).toRed(this),u=s.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);for(var c=this.pow(f,n),l=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=a;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();i(g=0;i--){for(var h=e.words[i],f=u-1;f>=0;f--){var c=h>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==c||0!==a?(a<<=1,a|=c,(4===++s||0===i&&0===f)&&(n=this.mul(n,r[a]),s=0,a=0)):s=0}u=26}return n},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new A(t)},n(A,M),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(29)(t))},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var i=r(19),n=r(47),o=r(3),a=r(48),s=function(){function e(t){if(t instanceof e)this.n=t.n;else if(t instanceof i){var r=t;r.red?this.n=r:this.n=r.toRed(e.red)}else this.n=new i(t,"le").toRed(e.red)}return e.toFQ=function(t){return t instanceof e?t:new e(t)},e.prototype.add=function(t){return new e(this.n.redAdd(e.toFQ(t).n))},e.prototype.mul=function(t){return new e(this.n.redMul(e.toFQ(t).n))},e.prototype.sub=function(t){return new e(this.n.redSub(e.toFQ(t).n))},e.prototype.div=function(t){return new e(this.n.redMul(e.toFQ(t).n.redInvm()))},e.prototype.squared=function(){return new e(this.n.redSqr())},e.prototype.sqrt=function(){try{var t=this.n.redSqrt();return t?new e(t):void 0}catch(t){return}},e.prototype.pow=function(t){return new e(this.n.redPow(new i(t)))},e.prototype.nega=function(){return new e(this.n.redNeg())},e.prototype.inverse=function(){return new e(this.n.redInvm())},e.prototype.isOdd=function(){return this.n.fromRed().isOdd()},e.prototype.isZero=function(){return this.n.fromRed().isZero()},e.prototype.toBuffer=function(){return this.n.fromRed().toArrayLike(t,"le",32)},e.prototype.toBN=function(){return this.n.fromRed()},e.prototype.equal=function(t){return this.n.eq(t.n)},e.prototype.toString=function(t){return this.n.fromRed().toString(t)},e.red=i.mont(n.default.FQ_MODULUS),e.ONE=new e(1),e.ZERO=new e(0),e}();e.FQ=s;var u=function(){function e(t){if(t instanceof e)this.n=t.n;else if(t instanceof i){var r=t;r.red?this.n=r:this.n=r.toRed(e.red)}else this.n="number"==typeof t?new i(t).toRed(e.red):new i(t,"le").toRed(e.red)}return e.toFR=function(t){return t instanceof e?t:new e(t)},e.prototype.add=function(t){return new e(this.n.redAdd(e.toFR(t).n))},e.prototype.mul=function(t){return new e(this.n.redMul(e.toFR(t).n))},e.prototype.sub=function(t){return new e(this.n.redSub(e.toFR(t).n))},e.prototype.div=function(t){return new e(this.n.redMul(e.toFR(t).n.redInvm()))},e.prototype.squared=function(){return new e(this.n.redSqr())},e.prototype.sqrt=function(){try{var t=this.n.redSqrt();return t?new e(t):void 0}catch(t){return}},e.prototype.pow=function(t){return new e(this.n.redPow(new i(t)))},e.prototype.nega=function(){return new e(this.n.redNeg())},e.prototype.inverse=function(){return new e(this.n.redInvm())},e.prototype.isOdd=function(){return this.n.fromRed().isOdd()},e.prototype.isZero=function(){return this.n.fromRed().isZero()},e.prototype.toBuffer=function(){return this.n.fromRed().toArrayLike(t,"le",32)},e.prototype.toBN=function(){return this.n.fromRed()},e.prototype.equal=function(t){return this.n.eq(t.n)},e.prototype.toString=function(t){return this.n.fromRed().toString(t)},e.red=i.mont(n.default.FR_MODULUS),e.ONE=new e(1),e.ZERO=new e(0),e}();function h(t){if(t instanceof u)return t;var e=o.toBuffer(t);return new u(e)}e.FR=u,e.newFR=h,e.randomFR=function(){return h(a.randomBytes(32))}}).call(this,r(0).Buffer)},function(t,e,r){var i=r(0),n=i.Buffer;function o(t,e){for(var r in t)e[r]=t[r]}function a(t,e,r){return n(t,e,r)}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?t.exports=i:(o(i,e),e.Buffer=a),a.prototype=Object.create(n.prototype),o(n,a),a.from=function(t,e,r){if("number"===typeof t)throw new TypeError("Argument must not be a number");return n(t,e,r)},a.alloc=function(t,e,r){if("number"!==typeof t)throw new TypeError("Argument must be a number");var i=n(t);return void 0!==e?"string"===typeof r?i.fill(e,r):i.fill(e):i.fill(0),i},a.allocUnsafe=function(t){if("number"!==typeof t)throw new TypeError("Argument must be a number");return n(t)},a.allocUnsafeSlow=function(t){if("number"!==typeof t)throw new TypeError("Argument must be a number");return i.SlowBuffer(t)}},function(t,e){var r,i,n=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"===typeof setTimeout?setTimeout:o}catch(t){r=o}try{i="function"===typeof clearTimeout?clearTimeout:a}catch(t){i=a}}();var u,h=[],f=!1,c=-1;function l(){f&&u&&(f=!1,u.length?h=u.concat(h):c=-1,h.length&&d())}function d(){if(!f){var t=s(l);f=!0;for(var e=h.length;e;){for(u=h,h=[];++c1)for(var r=1;r>7&1,u=t.from(n);u[31]&=-129;var h=new i.FQ(u),f=h.mul(h),c=e.ECC_D.mul(f),l=f.sub(i.FQ.ONE).mul(c.sub(e.ECC_A).inverse()).sqrt();if(l){var d=l;return l.isOdd()!==(0!=s)&&(d=i.FQ.ZERO.sub(l)),new e(d,h)}},e.ECC_A=new i.FQ(n.default.ECC_A),e.ECC_D=new i.FQ(n.default.ECC_D),e.ZERO=new e(i.FQ.ZERO,i.FQ.ONE),e}(),u=function(){function t(t,e,r){this.x=new i.FQ(t),this.y=new i.FQ(e),this.z=new i.FQ(r)}return t.prototype.toOriPoint=function(){var t=this.z.inverse();return new s(this.x.mul(t),this.y.mul(t))},t.prototype.add=function(e){var r=this.x,n=this.y,o=this.z,a=e.x,u=e.y,h=e.z,f=r.mul(a),c=n.mul(u),l=s.ECC_D.mul(f).mul(c);if(o.equal(i.FQ.ONE)&&h.equal(i.FQ.ONE))return new t(i.FQ.ONE.sub(l).mul(r.add(n).mul(a.add(u)).sub(f).sub(c)),i.FQ.ONE.add(l).mul(c.sub(s.ECC_A.mul(f))),i.FQ.ONE.sub(l.squared()));if(h.equal(i.FQ.ONE)){var d=(m=o.squared()).sub(l),p=m.add(l);return new t(o.mul(d).mul(r.add(n).mul(a.add(u)).sub(f).sub(c)),o.mul(p).mul(c.sub(s.ECC_A.mul(f))),d.mul(p))}var m,g=o.mul(h);return d=(m=g.squared()).sub(l),p=m.add(l),new t(g.mul(d).mul(r.add(n).mul(a.add(u)).sub(f).sub(c)),g.mul(p).mul(c.sub(s.ECC_A.mul(f))),d.mul(p))},t.prototype.double=function(){var e=this.x.add(this.y).squared(),r=this.x.squared(),n=this.y.squared(),o=s.ECC_A.mul(r),a=o.add(n);if(this.z.equal(i.FQ.ONE))return new t(e.sub(r).sub(n).mul(a.sub(2)),a.mul(o.sub(n)),a.squared().sub(a.mul(2)));var u=this.z.squared(),h=a.sub(u.mul(2));return new t(e.sub(r).sub(n).mul(h),a.mul(o.sub(n)),a.mul(h))},t.prototype.mult=function(e){for(var r=e.toBN(),i=this,n=t.ZERO;!r.isZero()&&(r.testn(0)&&(n=n.add(i)),!(r=r.shrn(1)).isZero());)i=i.double();return n},t.prototype.isValid=function(){var t=this.x.mul(this.x),e=this.y.mul(this.y),r=this.z.mul(this.z),i=s.ECC_A.mul(t),n=r.mul(r),o=s.ECC_D.mul(t).mul(e),a=r.mul(i.add(e)),u=n.add(o);return!!a.equal(u)},t.prototype.isEqualTo=function(t){return!(!this.x.mul(t.z).equal(this.z.mul(t.x))||!this.y.mul(t.z).equal(this.z.mul(t.y)))},t.prototype.isZero=function(){return this.isEqualTo(s.ZERO.toPoint())},t.prototype.toBuffer=function(){return this.toOriPoint().toBuffer()},t.prototype.toHex=function(){return this.toBuffer().reverse().toString("hex")},t.prototype.toString=function(){return"0x"+this.toBuffer().toString("hex")},t.bufferTo=function(t){var e=s.bufferTo(t);return e?e.toPoint():void 0},t.ZERO=new t(new i.FQ(0),new i.FQ(1),new i.FQ(1)),t}();e.Point=u,e.newPoint=function(t){return t instanceof u?t:u.bufferTo(t)}}).call(this,r(0).Buffer)},function(t,e){function r(t,e){if(!t)throw new Error(e||"Assertion failed")}t.exports=r,r.equal=function(t,e,r){if(t!=e)throw new Error(r||"Assertion failed: "+t+" != "+e)}},function(t,e,r){"use strict";var i=e,n=r(5),o=r(13),a=r(103);i.assert=o,i.toArray=a.toArray,i.zero2=a.zero2,i.toHex=a.toHex,i.encode=a.encode,i.getNAF=function(t,e){for(var r=[],i=1<=0;){var o;if(n.isOdd()){var a=n.andln(i-1);o=a>(i>>1)-1?(i>>1)-a:a,n.isubn(o)}else o=0;r.push(o);for(var s=0!==n.cmpn(0)&&0===n.andln(i-1)?e+1:1,u=1;u0||e.cmpn(-n)>0;){var o,a,s,u=t.andln(3)+i&3,h=e.andln(3)+n&3;if(3===u&&(u=-1),3===h&&(h=-1),0===(1&u))o=0;else o=3!==(s=t.andln(7)+i&7)&&5!==s||2!==h?u:-u;if(r[0].push(o),0===(1&h))a=0;else a=3!==(s=e.andln(7)+n&7)&&5!==s||2!==u?h:-h;r[1].push(a),2*i===o+1&&(i=1-i),2*n===a+1&&(n=1-n),t.iushrn(1),e.iushrn(1)}return r},i.cachedProperty=function(t,e,r){var i="_"+e;t.prototype[e]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},i.parseBytes=function(t){return"string"===typeof t?i.toArray(t,"hex"):t},i.intFromLE=function(t){return new n(t,"hex","le")}},function(t,e,r){"use strict";var i=r(13),n=r(1);function o(t,e){return 55296===(64512&t.charCodeAt(e))&&(!(e<0||e+1>=t.length)&&56320===(64512&t.charCodeAt(e+1)))}function a(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function s(t){return 1===t.length?"0"+t:t}function u(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}e.inherits=n,e.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"===typeof t)if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!==0&&(t="0"+t),n=0;n>6|192,r[i++]=63&a|128):o(t,n)?(a=65536+((1023&a)<<10)+(1023&t.charCodeAt(++n)),r[i++]=a>>18|240,r[i++]=a>>12&63|128,r[i++]=a>>6&63|128,r[i++]=63&a|128):(r[i++]=a>>12|224,r[i++]=a>>6&63|128,r[i++]=63&a|128)}else for(n=0;n>>0}return a},e.split32=function(t,e){for(var r=new Array(4*t.length),i=0,n=0;i>>24,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=255&o):(r[n+3]=o>>>24,r[n+2]=o>>>16&255,r[n+1]=o>>>8&255,r[n]=255&o)}return r},e.rotr32=function(t,e){return t>>>e|t<<32-e},e.rotl32=function(t,e){return t<>>32-e},e.sum32=function(t,e){return t+e>>>0},e.sum32_3=function(t,e,r){return t+e+r>>>0},e.sum32_4=function(t,e,r,i){return t+e+r+i>>>0},e.sum32_5=function(t,e,r,i,n){return t+e+r+i+n>>>0},e.sum64=function(t,e,r,i){var n=t[e],o=i+t[e+1]>>>0,a=(o>>0,t[e+1]=o},e.sum64_hi=function(t,e,r,i){return(e+i>>>0>>0},e.sum64_lo=function(t,e,r,i){return e+i>>>0},e.sum64_4_hi=function(t,e,r,i,n,o,a,s){var u=0,h=e;return u+=(h=h+i>>>0)>>0)>>0)>>0},e.sum64_4_lo=function(t,e,r,i,n,o,a,s){return e+i+o+s>>>0},e.sum64_5_hi=function(t,e,r,i,n,o,a,s,u,h){var f=0,c=e;return f+=(c=c+i>>>0)>>0)>>0)>>0)>>0},e.sum64_5_lo=function(t,e,r,i,n,o,a,s,u,h){return e+i+o+s+h>>>0},e.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},e.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},e.shr64_hi=function(t,e,r){return t>>>r},e.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0}},function(t,e,r){var i=r(2).Buffer,n=r(22).Transform,o=r(23).StringDecoder;function a(t){n.call(this),this.hashMode="string"===typeof t,this.hashMode?this[t]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}r(1)(a,n),a.prototype.update=function(t,e,r){"string"===typeof t&&(t=i.from(t,e));var n=this._update(t);return this.hashMode?this:(r&&(n=this._toString(n,r)),n)},a.prototype.setAutoPadding=function(){},a.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},a.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},a.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},a.prototype._transform=function(t,e,r){var i;try{this.hashMode?this._update(t):this.push(this._update(t))}catch(n){i=n}finally{r(i)}},a.prototype._flush=function(t){var e;try{this.push(this.__final())}catch(r){e=r}t(e)},a.prototype._finalOrDigest=function(t){var e=this.__final()||i.alloc(0);return t&&(e=this._toString(e,t,!0)),e},a.prototype._toString=function(t,e,r){if(this._decoder||(this._decoder=new o(e),this._encoding=e),this._encoding!==e)throw new Error("can't switch encodings");var i=this._decoder.write(t);return r&&(i+=this._decoder.end()),i},t.exports=a},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var i=r(267);e.blake2b=function(e,r){var n=t.alloc(16,0);n.fill(e,0,e.length);var o=i(32,null,null,n).update(r).digest("binary");return t.from(o)}}).call(this,r(0).Buffer)},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var i=r(117),n=r(270),o=r(3),a=r(4);e.accountBase=new i.Group("$SROKEYSGEN",1,256,4),e.crBase=new i.Group("SZK$ASSET$CR",1,256,4),e.rootBase=new i.Group("SZK$ROOTCM",10,128,4),e.genTknBase=function(e){e=o.toBuffer(e),a(32==e.length);var r=t.alloc(64,0);r.set(e,0);var i=n.findPoint("SZK$TKN",r);if(!i)throw new Error("find point error");return i},e.genTktBase=function(e,r){e=o.toBuffer(e),r=o.toBuffer(r),a(32==e.length),a(32==r.length);var i=t.concat([e,r]),s=n.findPoint("SZK$TKT",i);if(!s)throw new Error("find point error");return s}}).call(this,r(0).Buffer)},function(t,e,r){(function(t){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"===typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a=r(151).Buffer}catch(k){}function s(t,e,r){for(var n=0,o=Math.min(t.length,r),a=0,s=e;s=49&&h<=54?h-49+10:h>=17&&h<=22?h-17+10:h,a|=u}return i(!(240&a),"Invalid character in "+t),n}function u(t,e,r,n){for(var o=0,a=0,s=Math.min(t.length,r),u=e;u=49?h-49+10:h>=17?h-17+10:h,i(h>=0&&a"}o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this._strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"===typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)a=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=s(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=s(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this._strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,a=o%i,s=Math.min(o,o-a)+r,h=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for?o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f:o.prototype.inspect=f;var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[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],d=[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];o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,a=0;a>>24-n&16777215)||a!==this.length-1?c[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=l[t],f=d[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(f).toString(t);r=(p=p.idivn(f)).isZero()?m+r:c[h-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(t,e){return this.toArrayLike(a,t,e)}),o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)};function p(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],a=n*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var h=1;h>>26,c=67108863&u,l=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=l;d++){var p=h-d|0;f+=(a=(n=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&a}r.words[h]=0|c,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r._strip()}o.prototype.toArrayLike=function(t,e,r){this._strip();var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0");var a=function(t,e){return t.allocUnsafe?t.allocUnsafe(e):new t(e)}(t,o);return this["_toArrayLike"+("le"===e?"LE":"BE")](a,n),a},o.prototype._toArrayLikeLE=function(t,e){for(var r=0,i=0,n=0,o=0;n>8&255),r>16&255),6===o?(r>24&255),i=0,o=0):(i=a>>>24,o+=2)}if(r=0&&(t[r--]=a>>8&255),r>=0&&(t[r--]=a>>16&255),6===o?(r>=0&&(t[r--]=a>>24&255),i=0,o=0):(i=a>>>24,o+=2)}if(r>=0)for(t[r--]=i;r>=0;)t[r--]=0},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"===typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,g=0|a[2],b=8191&g,v=g>>>13,y=0|a[3],w=8191&y,_=y>>>13,M=0|a[4],A=8191&M,I=M>>>13,S=0|a[5],E=8191&S,k=S>>>13,x=0|a[6],B=8191&x,C=x>>>13,T=0|a[7],P=8191&T,R=T>>>13,O=0|a[8],j=8191&O,D=O>>>13,N=0|a[9],z=8191&N,K=N>>>13,q=0|s[0],U=8191&q,F=q>>>13,L=0|s[1],Q=8191&L,H=L>>>13,V=0|s[2],Z=8191&V,G=V>>>13,Y=0|s[3],W=8191&Y,J=Y>>>13,X=0|s[4],$=8191&X,tt=X>>>13,et=0|s[5],rt=8191&et,it=et>>>13,nt=0|s[6],ot=8191&nt,at=nt>>>13,st=0|s[7],ut=8191&st,ht=st>>>13,ft=0|s[8],ct=8191&ft,lt=ft>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(h+(i=Math.imul(c,U))|0)+((8191&(n=(n=Math.imul(c,F))+Math.imul(l,U)|0))<<13)|0;h=((o=Math.imul(l,F))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(p,U),n=(n=Math.imul(p,F))+Math.imul(m,U)|0,o=Math.imul(m,F);var bt=(h+(i=i+Math.imul(c,Q)|0)|0)+((8191&(n=(n=n+Math.imul(c,H)|0)+Math.imul(l,Q)|0))<<13)|0;h=((o=o+Math.imul(l,H)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(b,U),n=(n=Math.imul(b,F))+Math.imul(v,U)|0,o=Math.imul(v,F),i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,H)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,H)|0;var vt=(h+(i=i+Math.imul(c,Z)|0)|0)+((8191&(n=(n=n+Math.imul(c,G)|0)+Math.imul(l,Z)|0))<<13)|0;h=((o=o+Math.imul(l,G)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(w,U),n=(n=Math.imul(w,F))+Math.imul(_,U)|0,o=Math.imul(_,F),i=i+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,H)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,H)|0,i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,G)|0;var yt=(h+(i=i+Math.imul(c,W)|0)|0)+((8191&(n=(n=n+Math.imul(c,J)|0)+Math.imul(l,W)|0))<<13)|0;h=((o=o+Math.imul(l,J)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(A,U),n=(n=Math.imul(A,F))+Math.imul(I,U)|0,o=Math.imul(I,F),i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,H)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,H)|0,i=i+Math.imul(b,Z)|0,n=(n=n+Math.imul(b,G)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,G)|0,i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,J)|0;var wt=(h+(i=i+Math.imul(c,$)|0)|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(l,$)|0))<<13)|0;h=((o=o+Math.imul(l,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(E,U),n=(n=Math.imul(E,F))+Math.imul(k,U)|0,o=Math.imul(k,F),i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,H)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,H)|0,i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,G)|0,i=i+Math.imul(b,W)|0,n=(n=n+Math.imul(b,J)|0)+Math.imul(v,W)|0,o=o+Math.imul(v,J)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,tt)|0;var _t=(h+(i=i+Math.imul(c,rt)|0)|0)+((8191&(n=(n=n+Math.imul(c,it)|0)+Math.imul(l,rt)|0))<<13)|0;h=((o=o+Math.imul(l,it)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(B,U),n=(n=Math.imul(B,F))+Math.imul(C,U)|0,o=Math.imul(C,F),i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,H)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,H)|0,i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,G)|0,i=i+Math.imul(w,W)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,J)|0,i=i+Math.imul(b,$)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var Mt=(h+(i=i+Math.imul(c,ot)|0)|0)+((8191&(n=(n=n+Math.imul(c,at)|0)+Math.imul(l,ot)|0))<<13)|0;h=((o=o+Math.imul(l,at)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(P,U),n=(n=Math.imul(P,F))+Math.imul(R,U)|0,o=Math.imul(R,F),i=i+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,H)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,H)|0,i=i+Math.imul(E,Z)|0,n=(n=n+Math.imul(E,G)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,G)|0,i=i+Math.imul(A,W)|0,n=(n=n+Math.imul(A,J)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,J)|0,i=i+Math.imul(w,$)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,tt)|0,i=i+Math.imul(b,rt)|0,n=(n=n+Math.imul(b,it)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var At=(h+(i=i+Math.imul(c,ut)|0)|0)+((8191&(n=(n=n+Math.imul(c,ht)|0)+Math.imul(l,ut)|0))<<13)|0;h=((o=o+Math.imul(l,ht)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(j,U),n=(n=Math.imul(j,F))+Math.imul(D,U)|0,o=Math.imul(D,F),i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,H)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,H)|0,i=i+Math.imul(B,Z)|0,n=(n=n+Math.imul(B,G)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,G)|0,i=i+Math.imul(E,W)|0,n=(n=n+Math.imul(E,J)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,J)|0,i=i+Math.imul(A,$)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,it)|0,i=i+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,i=i+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var It=(h+(i=i+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,lt)|0)+Math.imul(l,ct)|0))<<13)|0;h=((o=o+Math.imul(l,lt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(z,U),n=(n=Math.imul(z,F))+Math.imul(K,U)|0,o=Math.imul(K,F),i=i+Math.imul(j,Q)|0,n=(n=n+Math.imul(j,H)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,H)|0,i=i+Math.imul(P,Z)|0,n=(n=n+Math.imul(P,G)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(B,W)|0,n=(n=n+Math.imul(B,J)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,J)|0,i=i+Math.imul(E,$)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,at)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,at)|0,i=i+Math.imul(b,ut)|0,n=(n=n+Math.imul(b,ht)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ht)|0,i=i+Math.imul(p,ct)|0,n=(n=n+Math.imul(p,lt)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,lt)|0;var St=(h+(i=i+Math.imul(c,pt)|0)|0)+((8191&(n=(n=n+Math.imul(c,mt)|0)+Math.imul(l,pt)|0))<<13)|0;h=((o=o+Math.imul(l,mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(z,Q),n=(n=Math.imul(z,H))+Math.imul(K,Q)|0,o=Math.imul(K,H),i=i+Math.imul(j,Z)|0,n=(n=n+Math.imul(j,G)|0)+Math.imul(D,Z)|0,o=o+Math.imul(D,G)|0,i=i+Math.imul(P,W)|0,n=(n=n+Math.imul(P,J)|0)+Math.imul(R,W)|0,o=o+Math.imul(R,J)|0,i=i+Math.imul(B,$)|0,n=(n=n+Math.imul(B,tt)|0)+Math.imul(C,$)|0,o=o+Math.imul(C,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,at)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,at)|0,i=i+Math.imul(w,ut)|0,n=(n=n+Math.imul(w,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,i=i+Math.imul(b,ct)|0,n=(n=n+Math.imul(b,lt)|0)+Math.imul(v,ct)|0,o=o+Math.imul(v,lt)|0;var Et=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(z,Z),n=(n=Math.imul(z,G))+Math.imul(K,Z)|0,o=Math.imul(K,G),i=i+Math.imul(j,W)|0,n=(n=n+Math.imul(j,J)|0)+Math.imul(D,W)|0,o=o+Math.imul(D,J)|0,i=i+Math.imul(P,$)|0,n=(n=n+Math.imul(P,tt)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(B,rt)|0,n=(n=n+Math.imul(B,it)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,it)|0,i=i+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,i=i+Math.imul(A,ut)|0,n=(n=n+Math.imul(A,ht)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ht)|0,i=i+Math.imul(w,ct)|0,n=(n=n+Math.imul(w,lt)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,lt)|0;var kt=(h+(i=i+Math.imul(b,pt)|0)|0)+((8191&(n=(n=n+Math.imul(b,mt)|0)+Math.imul(v,pt)|0))<<13)|0;h=((o=o+Math.imul(v,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(z,W),n=(n=Math.imul(z,J))+Math.imul(K,W)|0,o=Math.imul(K,J),i=i+Math.imul(j,$)|0,n=(n=n+Math.imul(j,tt)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,tt)|0,i=i+Math.imul(P,rt)|0,n=(n=n+Math.imul(P,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(B,ot)|0,n=(n=n+Math.imul(B,at)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,at)|0,i=i+Math.imul(E,ut)|0,n=(n=n+Math.imul(E,ht)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ht)|0,i=i+Math.imul(A,ct)|0,n=(n=n+Math.imul(A,lt)|0)+Math.imul(I,ct)|0,o=o+Math.imul(I,lt)|0;var xt=(h+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(z,$),n=(n=Math.imul(z,tt))+Math.imul(K,$)|0,o=Math.imul(K,tt),i=i+Math.imul(j,rt)|0,n=(n=n+Math.imul(j,it)|0)+Math.imul(D,rt)|0,o=o+Math.imul(D,it)|0,i=i+Math.imul(P,ot)|0,n=(n=n+Math.imul(P,at)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,at)|0,i=i+Math.imul(B,ut)|0,n=(n=n+Math.imul(B,ht)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ht)|0,i=i+Math.imul(E,ct)|0,n=(n=n+Math.imul(E,lt)|0)+Math.imul(k,ct)|0,o=o+Math.imul(k,lt)|0;var Bt=(h+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(I,pt)|0))<<13)|0;h=((o=o+Math.imul(I,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(z,rt),n=(n=Math.imul(z,it))+Math.imul(K,rt)|0,o=Math.imul(K,it),i=i+Math.imul(j,ot)|0,n=(n=n+Math.imul(j,at)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,at)|0,i=i+Math.imul(P,ut)|0,n=(n=n+Math.imul(P,ht)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ht)|0,i=i+Math.imul(B,ct)|0,n=(n=n+Math.imul(B,lt)|0)+Math.imul(C,ct)|0,o=o+Math.imul(C,lt)|0;var Ct=(h+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,mt)|0)+Math.imul(k,pt)|0))<<13)|0;h=((o=o+Math.imul(k,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,i=Math.imul(z,ot),n=(n=Math.imul(z,at))+Math.imul(K,ot)|0,o=Math.imul(K,at),i=i+Math.imul(j,ut)|0,n=(n=n+Math.imul(j,ht)|0)+Math.imul(D,ut)|0,o=o+Math.imul(D,ht)|0,i=i+Math.imul(P,ct)|0,n=(n=n+Math.imul(P,lt)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,lt)|0;var Tt=(h+(i=i+Math.imul(B,pt)|0)|0)+((8191&(n=(n=n+Math.imul(B,mt)|0)+Math.imul(C,pt)|0))<<13)|0;h=((o=o+Math.imul(C,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(z,ut),n=(n=Math.imul(z,ht))+Math.imul(K,ut)|0,o=Math.imul(K,ht),i=i+Math.imul(j,ct)|0,n=(n=n+Math.imul(j,lt)|0)+Math.imul(D,ct)|0,o=o+Math.imul(D,lt)|0;var Pt=(h+(i=i+Math.imul(P,pt)|0)|0)+((8191&(n=(n=n+Math.imul(P,mt)|0)+Math.imul(R,pt)|0))<<13)|0;h=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(z,ct),n=(n=Math.imul(z,lt))+Math.imul(K,ct)|0,o=Math.imul(K,lt);var Rt=(h+(i=i+Math.imul(j,pt)|0)|0)+((8191&(n=(n=n+Math.imul(j,mt)|0)+Math.imul(D,pt)|0))<<13)|0;h=((o=o+Math.imul(D,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var Ot=(h+(i=Math.imul(z,pt))|0)+((8191&(n=(n=Math.imul(z,mt))+Math.imul(K,pt)|0))<<13)|0;return h=((o=Math.imul(K,mt))+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,u[0]=gt,u[1]=bt,u[2]=vt,u[3]=yt,u[4]=wt,u[5]=_t,u[6]=Mt,u[7]=At,u[8]=It,u[9]=St,u[10]=Et,u[11]=kt,u[12]=xt,u[13]=Bt,u[14]=Ct,u[15]=Tt,u[16]=Pt,u[17]=Rt,u[18]=Ot,0!==h&&(u[19]=h,r.length++),r};function g(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,i=a,a=n}return 0!==i?r.words[o]=i:r.length--,r._strip()}function b(t,e,r){return g(t,e,r)}function v(t,e){this.x=t,this.y=e}Math.imul||(m=p),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?m(this,t,e):r<63?p(this,t,e):r<1024?g(this,t,e):b(this,t,e)},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},v.prototype.permute=function(t,e,r,i,n,o){for(var a=0;a>>=1)n++;return 1<>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*e;a>=26,r+=o/67108864|0,r+=a>>>26,this.words[n]=67108863&a}return 0!==r&&(this.words[n]=r,this.length++),e?this.ineg():this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n&1}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(e=0;e>>26-r}a&&(this.words[e]=a,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,a=Math.min((t-o)/26,this.length),s=67108863^67108863>>>o<a)for(this.length-=a,h=0;h=0&&(0!==f||h>=n);h--){var c=0|this.words[h];this.words[h]=f<<26-o|c>>>o,f=c&s}return u&&0!==f&&(u.words[u.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"===typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"===typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===s)return this._strip();for(i(-1===s),s=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,a=0|n.words[n.length-1];0!==(r=26-this._countBits(a))&&(n=n.ushln(r),i.iushln(r),a=0|n.words[n.length-1]);var s,u=i.length-n.length;if("mod"!==e){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var h=0;h=0;c--){var l=67108864*(0|i.words[n.length+c])+(0|i.words[n.length+c-1]);for(l=Math.min(l/a|0,67108863),i._ishlnsubmul(n,l,c);0!==i.negative;)l--,i.negative=0,i._ishlnsubmul(n,1,c),i.isZero()||(i.negative^=1);s&&(s.words[c]=l)}return s&&s._strip(),i._strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:s||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(n=s.div.neg()),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(t)),{div:n,mod:a}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(n=s.div.neg()),{div:n,mod:s.mod}):0!==(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(t)),{div:s.div,mod:a}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modrn(t.words[0]))}:this._wordDiv(t,e);var n,a,s},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modrn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var r=(1<<26)%t,n=0,o=this.length-1;o>=0;o--)n=(r*n+(0|this.words[o]))%t;return e?-n:n},o.prototype.modn=function(t){return this.modrn(t)},o.prototype.idivn=function(t){var e=t<0;e&&(t=-t),i(t<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*r;this.words[n]=o/t|0,r=o%t}return this._strip(),e?this.ineg():this},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),a=new o(0),s=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var f=r.clone(),c=e.clone();!e.isZero();){for(var l=0,d=1;0===(e.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(n.isOdd()||a.isOdd())&&(n.iadd(f),a.isub(c)),n.iushrn(1),a.iushrn(1);for(var p=0,m=1;0===(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(f),u.isub(c)),s.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(s),a.isub(u)):(r.isub(e),s.isub(n),u.isub(a))}return{a:s,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,a=new o(1),s=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,f=1;0===(e.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(e.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var c=0,l=1;0===(r.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(r.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),a.isub(s)):(r.isub(e),s.isub(a))}return(n=0===e.cmpn(1)?a:s).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"===typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new S(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function w(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function I(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"===typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function E(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},w.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(t,e){t.iushrn(this.n,0,e)},w.prototype.imulK=function(t){return t.imul(this.k)},n(_,w),_.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},_.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(y[t])return y[t];var e;if("k256"===t)e=new _;else if("p224"===t)e=new M;else if("p192"===t)e=new A;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new I}return y[t]=e,e},S.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,e){i(0===(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(h(t,t.umod(this.m)._forceRed(this)),t)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},S.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},S.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2===1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),a=0;!n.isZero()&&0===n.andln(1);)a++,n.iushrn(1);i(!n.isZero());var s=new o(1).toRed(this),u=s.redNeg(),h=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new o(2*f*f).toRed(this);0!==this.pow(f,h).cmp(u);)f.redIAdd(u);for(var c=this.pow(f,n),l=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=a;0!==d.cmp(s);){for(var m=d,g=0;0!==m.cmp(s);g++)m=m.redSqr();i(g=0;i--){for(var h=e.words[i],f=u-1;f>=0;f--){var c=h>>f&1;n!==r[0]&&(n=this.sqr(n)),0!==c||0!==a?(a<<=1,a|=c,(4===++s||0===i&&0===f)&&(n=this.mul(n,r[a]),s=0,a=0)):s=0}u=26}return n},S.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},S.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new E(t)},n(E,S),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):n.cmpn(0)<0&&(a=n.iadd(this.m)),a._forceRed(this)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(29)(t))},function(t,e,r){"use strict";var i=r(38),n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=c;var o=r(32);o.inherits=r(1);var a=r(83),s=r(51);o.inherits(c,a);for(var u=n(s.prototype),h=0;ho)throw new RangeError("requested too many random bytes");var r=a.allocUnsafe(t);if(t>0)if(t>n)for(var u=0;u>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,r=function(t,e,r){if(128!==(192&e[0]))return t.lastNeed=0,"\ufffd";if(t.lastNeed>1&&e.length>1){if(128!==(192&e[1]))return t.lastNeed=1,"\ufffd";if(t.lastNeed>2&&e.length>2&&128!==(192&e[2]))return t.lastNeed=2,"\ufffd"}}(this,t);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function h(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function f(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function c(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function l(t){return t.toString(this.encoding)}function d(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return n>0&&(t.lastNeed=n-1),n;if(--i=0)return n>0&&(t.lastNeed=n-2),n;if(--i=0)return n>0&&(2===n?n=0:t.lastNeed=n-3),n;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,r){var i=r(2).Buffer;function n(t,e){this._block=i.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}n.prototype.update=function(t,e){"string"===typeof t&&(e=e||"utf8",t=i.from(t,e));for(var r=this._block,n=this._blockSize,o=t.length,a=this._len,s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(4294967295&r)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},n.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=n},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var i=r(12),n=r(62),o=r(18),a=r(4),s=r(3),u=r(3);function h(t){t[t.length-1]|=64}function f(e){var r=t.from(e);return r[e.length-1]&=-65,r}function c(t){return 0!=(64&t[t.length-1])}e.SetFlag=h,e.ClearFlag=f,e.IsFlagSet=c;var l=function(){function e(t,e){this.ZPK=i.newPoint(t),this.VPK=i.newPoint(e)}return e.prototype.toBuffer=function(){var e=t.alloc(64);return e.fill(this.ZPK.toBuffer(),0),e.fill(this.VPK.toBuffer(),32),h(e),e},e.prototype.toHex=function(){return"0x"+this.toBuffer().toString("hex")},e.prototype.toString=function(){return u.default.bufferToBs58(this.toBuffer())},e}();function d(t){if(t instanceof l)return t;var e=f(s.toBuffer(t));a(64==e.length);var r=i.Point.bufferTo(e.slice(0,32));if(r){var n=i.Point.bufferTo(e.slice(32));if(n)return new l(r,n)}}e.PK=l,e.newPK=d,e.tk2PK=function(t){t=n.newTK(t);var e=o.accountBase.mult(t.vsk);return new l(t.ZPK,e)},e.isPKValid=function(t){var e=s.toBuffer(t);return!!c(e)&&!!d(e)}}).call(this,r(0).Buffer)},function(t,e,r){"use strict";var i={};function n(t,e,r){r||(r=Error);var n=function(t){var r,i;function n(r,i,n){return t.call(this,function(t,r,i){return"string"===typeof e?e:e(t,r,i)}(r,i,n))||this}return i=t,(r=n).prototype=Object.create(i.prototype),r.prototype.constructor=r,r.__proto__=i,n}(r);n.prototype.name=r.name,n.prototype.code=t,i[t]=n}function o(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map((function(t){return String(t)})),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}n("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),n("ERR_INVALID_ARG_TYPE",(function(t,e,r){var i,n,a,s;if("string"===typeof e&&(n="not ",e.substr(!a||a<0?0:+a,n.length)===n)?(i="must not be",e=e.replace(/^not /,"")):i="must be",function(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}(t," argument"))s="The ".concat(t," ").concat(i," ").concat(o(e,"type"));else{var u=function(t,e,r){return"number"!==typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}(t,".")?"property":"argument";s='The "'.concat(t,'" ').concat(u," ").concat(i," ").concat(o(e,"type"))}return s+=". Received type ".concat(typeof r)}),TypeError),n("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),n("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),n("ERR_STREAM_PREMATURE_CLOSE","Premature close"),n("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),n("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),n("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),n("ERR_STREAM_WRITE_AFTER_END","write after end"),n("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),n("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),n("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=i},function(t,e,r){"use strict";(function(e){var i=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};t.exports=h;var n=r(130),o=r(134);r(9)(h,n);for(var a=i(o.prototype),s=0;s=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(4294967295&r)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o},n.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=n},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){"use strict";var i=r(1),n=r(49),o=r(52),a=r(53),s=r(16);function u(t){s.call(this,"digest"),this._hash=t}i(u,s),u.prototype._update=function(t){this._hash.update(t)},u.prototype._final=function(){return this._hash.digest()},t.exports=function(t){return"md5"===(t=t.toLowerCase())?new n:"rmd160"===t||"ripemd160"===t?new o:new u(a(t))}},function(t,e,r){"use strict";var i,n="object"===typeof Reflect?Reflect:null,o=n&&"function"===typeof n.apply?n.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};i=n&&"function"===typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var a=Number.isNaN||function(t){return t!==t};function s(){s.init.call(this)}t.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function h(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function f(t,e,r,i){var n,o,a,s;if("function"!==typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r);if(void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),a=o[e]),void 0===a)a=o[e]=r,++t._eventsCount;else if("function"===typeof a?a=o[e]=i?[r,a]:[a,r]:i?a.unshift(r):a.push(r),(n=h(t))>0&&a.length>n&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=a.length,s=u,console&&console.warn&&console.warn(s)}return t}function c(){for(var t=[],e=0;e0&&(a=e[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=n[t];if(void 0===u)return!1;if("function"===typeof u)o(u,this,e);else{var h=u.length,f=m(u,h);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){a=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},s.prototype.listeners=function(t){return d(this,t,!0)},s.prototype.rawListeners=function(t){return d(this,t,!1)},s.listenerCount=function(t,e){return"function"===typeof t.listenerCount?t.listenerCount(e):p.call(t,e)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},function(t,e,r){(function(t){function r(t){return Object.prototype.toString.call(t)}e.isArray=function(t){return Array.isArray?Array.isArray(t):"[object Array]"===r(t)},e.isBoolean=function(t){return"boolean"===typeof t},e.isNull=function(t){return null===t},e.isNullOrUndefined=function(t){return null==t},e.isNumber=function(t){return"number"===typeof t},e.isString=function(t){return"string"===typeof t},e.isSymbol=function(t){return"symbol"===typeof t},e.isUndefined=function(t){return void 0===t},e.isRegExp=function(t){return"[object RegExp]"===r(t)},e.isObject=function(t){return"object"===typeof t&&null!==t},e.isDate=function(t){return"[object Date]"===r(t)},e.isError=function(t){return"[object Error]"===r(t)||t instanceof Error},e.isFunction=function(t){return"function"===typeof t},e.isPrimitive=function(t){return null===t||"boolean"===typeof t||"number"===typeof t||"string"===typeof t||"symbol"===typeof t||"undefined"===typeof t},e.isBuffer=t.isBuffer}).call(this,r(0).Buffer)},function(t,e,r){(function(e){t.exports=function(t,r){for(var i=Math.min(t.length,r.length),n=new e(i),o=0;o=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=i.join32(t,0,t.length-r,this.endian);for(var n=0;n>>24&255,i[n++]=t>>>16&255,i[n++]=t>>>8&255,i[n++]=255&t}else for(i[n++]=255&t,i[n++]=t>>>8&255,i[n++]=t>>>16&255,i[n++]=t>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,o=8;o>>24]^f[p>>>16&255]^c[m>>>8&255]^l[255&g]^e[b++],a=h[p>>>24]^f[m>>>16&255]^c[g>>>8&255]^l[255&d]^e[b++],s=h[m>>>24]^f[g>>>16&255]^c[d>>>8&255]^l[255&p]^e[b++],u=h[g>>>24]^f[d>>>16&255]^c[p>>>8&255]^l[255&m]^e[b++],d=o,p=a,m=s,g=u;return o=(i[d>>>24]<<24|i[p>>>16&255]<<16|i[m>>>8&255]<<8|i[255&g])^e[b++],a=(i[p>>>24]<<24|i[m>>>16&255]<<16|i[g>>>8&255]<<8|i[255&d])^e[b++],s=(i[m>>>24]<<24|i[g>>>16&255]<<16|i[d>>>8&255]<<8|i[255&p])^e[b++],u=(i[g>>>24]<<24|i[d>>>16&255]<<16|i[p>>>8&255]<<8|i[255&m])^e[b++],[o>>>=0,a>>>=0,s>>>=0,u>>>=0]}var s=[0,1,2,4,8,16,32,64,128,27,54],u=function(){for(var t=new Array(256),e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;for(var r=[],i=[],n=[[],[],[],[]],o=[[],[],[],[]],a=0,s=0,u=0;u<256;++u){var h=s^s<<1^s<<2^s<<3^s<<4;h=h>>>8^255&h^99,r[a]=h,i[h]=a;var f=t[a],c=t[f],l=t[c],d=257*t[h]^16843008*h;n[0][a]=d<<24|d>>>8,n[1][a]=d<<16|d>>>16,n[2][a]=d<<8|d>>>24,n[3][a]=d,d=16843009*l^65537*c^257*f^16843008*a,o[0][h]=d<<24|d>>>8,o[1][h]=d<<16|d>>>16,o[2][h]=d<<8|d>>>24,o[3][h]=d,0===a?a=s=1:(a=f^t[t[t[l^f]]],s^=t[t[s]])}return{SBOX:r,INV_SBOX:i,SUB_MIX:n,INV_SUB_MIX:o}}();function h(t){this._key=n(t),this._reset()}h.blockSize=16,h.keySize=32,h.prototype.blockSize=h.blockSize,h.prototype.keySize=h.keySize,h.prototype._reset=function(){for(var t=this._key,e=t.length,r=e+6,i=4*(r+1),n=[],o=0;o>>24,a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a],a^=s[o/e|0]<<24):e>6&&o%e===4&&(a=u.SBOX[a>>>24]<<24|u.SBOX[a>>>16&255]<<16|u.SBOX[a>>>8&255]<<8|u.SBOX[255&a]),n[o]=n[o-e]^a}for(var h=[],f=0;f>>24]]^u.INV_SUB_MIX[1][u.SBOX[l>>>16&255]]^u.INV_SUB_MIX[2][u.SBOX[l>>>8&255]]^u.INV_SUB_MIX[3][u.SBOX[255&l]]}this._nRounds=r,this._keySchedule=n,this._invKeySchedule=h},h.prototype.encryptBlockRaw=function(t){return a(t=n(t),this._keySchedule,u.SUB_MIX,u.SBOX,this._nRounds)},h.prototype.encryptBlock=function(t){var e=this.encryptBlockRaw(t),r=i.allocUnsafe(16);return r.writeUInt32BE(e[0],0),r.writeUInt32BE(e[1],4),r.writeUInt32BE(e[2],8),r.writeUInt32BE(e[3],12),r},h.prototype.decryptBlock=function(t){var e=(t=n(t))[1];t[1]=t[3],t[3]=e;var r=a(t,this._invKeySchedule,u.INV_SUB_MIX,u.INV_SBOX,this._nRounds),o=i.allocUnsafe(16);return o.writeUInt32BE(r[0],0),o.writeUInt32BE(r[3],4),o.writeUInt32BE(r[2],8),o.writeUInt32BE(r[1],12),o},h.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},t.exports.AES=h},function(t,e,r){var i=r(2).Buffer,n=r(49);t.exports=function(t,e,r,o){if(i.isBuffer(t)||(t=i.from(t,"binary")),e&&(i.isBuffer(e)||(e=i.from(e,"binary")),8!==e.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var a=r/8,s=i.alloc(a),u=i.alloc(o||0),h=i.alloc(0);a>0||o>0;){var f=new n;f.update(h),f.update(t),e&&f.update(e),h=f.digest();var c=0;if(a>0){var l=s.length-a;c=Math.min(a,h.length),h.copy(s,l,0,c),a-=c}if(c0){var d=u.length-o,p=Math.min(o,h.length-c);h.copy(u,d,c,c+p),o-=p}}return h.fill(0),{key:s,iv:u}}},function(t,e,r){"use strict";var i=r(5),n=r(14),o=n.getNAF,a=n.getJSF,s=n.assert;function u(t,e){this.type=t,this.p=new i(e.p,16),this.red=e.prime?i.red(e.prime):i.mont(this.p),this.zero=new i(0).toRed(this.red),this.one=new i(1).toRed(this.red),this.two=new i(2).toRed(this.red),this.n=e.n&&new i(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);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 h(t,e){this.curve=t,this.type=e,this.precomputed=null}t.exports=u,u.prototype.point=function(){throw new Error("Not implemented")},u.prototype.validate=function(){throw new Error("Not implemented")},u.prototype._fixedNafMul=function(t,e){s(t.precomputed);var r=t._getDoubles(),i=o(e,1),n=(1<=u;e--)h=(h<<1)+i[e];a.push(h)}for(var f=this.jpoint(null,null,null),c=this.jpoint(null,null,null),l=n;l>0;l--){for(u=0;u=0;h--){for(e=0;h>=0&&0===a[h];h--)e++;if(h>=0&&e++,u=u.dblp(e),h<0)break;var f=a[h];s(0!==f),u="affine"===t.type?f>0?u.mixedAdd(n[f-1>>1]):u.mixedAdd(n[-f-1>>1].neg()):f>0?u.add(n[f-1>>1]):u.add(n[-f-1>>1].neg())}return"affine"===t.type?u.toP():u},u.prototype._wnafMulAdd=function(t,e,r,i,n){for(var s=this._wnafT1,u=this._wnafT2,h=this._wnafT3,f=0,c=0;c=1;c-=2){var d=c-1,p=c;if(1===s[d]&&1===s[p]){var m=[e[d],null,null,e[p]];0===e[d].y.cmp(e[p].y)?(m[1]=e[d].add(e[p]),m[2]=e[d].toJ().mixedAdd(e[p].neg())):0===e[d].y.cmp(e[p].y.redNeg())?(m[1]=e[d].toJ().mixedAdd(e[p]),m[2]=e[d].add(e[p].neg())):(m[1]=e[d].toJ().mixedAdd(e[p]),m[2]=e[d].toJ().mixedAdd(e[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],b=a(r[d],r[p]);f=Math.max(b[0].length,f),h[d]=new Array(f),h[p]=new Array(f);for(var v=0;v=0;c--){for(var A=0;c>=0;){var I=!0;for(v=0;v=0&&A++,_=_.dblp(A),c<0)break;for(v=0;v0?S=u[v][E-1>>1]:E<0&&(S=u[v][-E-1>>1].neg()),_="affine"===S.type?_.mixedAdd(S):_.add(S))}}for(c=0;c=Math.ceil((t.bitLength()+1)/e.step)},h.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;no)throw new RangeError("requested too many random bytes");var r=a.allocUnsafe(t);if(t>0)if(t>n)for(var u=0;u>>32-e}function h(t,e,r,i,n,o,a){return u(t+(e&r|~e&i)+n+o|0,a)+e|0}function f(t,e,r,i,n,o,a){return u(t+(e&i|r&~i)+n+o|0,a)+e|0}function c(t,e,r,i,n,o,a){return u(t+(e^r^i)+n+o|0,a)+e|0}function l(t,e,r,i,n,o,a){return u(t+(r^(e|~i))+n+o|0,a)+e|0}i(s,n),s.prototype._update=function(){for(var t=a,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,i=this._b,n=this._c,o=this._d;r=h(r,i,n,o,t[0],3614090360,7),o=h(o,r,i,n,t[1],3905402710,12),n=h(n,o,r,i,t[2],606105819,17),i=h(i,n,o,r,t[3],3250441966,22),r=h(r,i,n,o,t[4],4118548399,7),o=h(o,r,i,n,t[5],1200080426,12),n=h(n,o,r,i,t[6],2821735955,17),i=h(i,n,o,r,t[7],4249261313,22),r=h(r,i,n,o,t[8],1770035416,7),o=h(o,r,i,n,t[9],2336552879,12),n=h(n,o,r,i,t[10],4294925233,17),i=h(i,n,o,r,t[11],2304563134,22),r=h(r,i,n,o,t[12],1804603682,7),o=h(o,r,i,n,t[13],4254626195,12),n=h(n,o,r,i,t[14],2792965006,17),r=f(r,i=h(i,n,o,r,t[15],1236535329,22),n,o,t[1],4129170786,5),o=f(o,r,i,n,t[6],3225465664,9),n=f(n,o,r,i,t[11],643717713,14),i=f(i,n,o,r,t[0],3921069994,20),r=f(r,i,n,o,t[5],3593408605,5),o=f(o,r,i,n,t[10],38016083,9),n=f(n,o,r,i,t[15],3634488961,14),i=f(i,n,o,r,t[4],3889429448,20),r=f(r,i,n,o,t[9],568446438,5),o=f(o,r,i,n,t[14],3275163606,9),n=f(n,o,r,i,t[3],4107603335,14),i=f(i,n,o,r,t[8],1163531501,20),r=f(r,i,n,o,t[13],2850285829,5),o=f(o,r,i,n,t[2],4243563512,9),n=f(n,o,r,i,t[7],1735328473,14),r=c(r,i=f(i,n,o,r,t[12],2368359562,20),n,o,t[5],4294588738,4),o=c(o,r,i,n,t[8],2272392833,11),n=c(n,o,r,i,t[11],1839030562,16),i=c(i,n,o,r,t[14],4259657740,23),r=c(r,i,n,o,t[1],2763975236,4),o=c(o,r,i,n,t[4],1272893353,11),n=c(n,o,r,i,t[7],4139469664,16),i=c(i,n,o,r,t[10],3200236656,23),r=c(r,i,n,o,t[13],681279174,4),o=c(o,r,i,n,t[0],3936430074,11),n=c(n,o,r,i,t[3],3572445317,16),i=c(i,n,o,r,t[6],76029189,23),r=c(r,i,n,o,t[9],3654602809,4),o=c(o,r,i,n,t[12],3873151461,11),n=c(n,o,r,i,t[15],530742520,16),r=l(r,i=c(i,n,o,r,t[2],3299628645,23),n,o,t[0],4096336452,6),o=l(o,r,i,n,t[7],1126891415,10),n=l(n,o,r,i,t[14],2878612391,15),i=l(i,n,o,r,t[5],4237533241,21),r=l(r,i,n,o,t[12],1700485571,6),o=l(o,r,i,n,t[3],2399980690,10),n=l(n,o,r,i,t[10],4293915773,15),i=l(i,n,o,r,t[1],2240044497,21),r=l(r,i,n,o,t[8],1873313359,6),o=l(o,r,i,n,t[15],4264355552,10),n=l(n,o,r,i,t[6],2734768916,15),i=l(i,n,o,r,t[13],1309151649,21),r=l(r,i,n,o,t[4],4149444226,6),o=l(o,r,i,n,t[11],3174756917,10),n=l(n,o,r,i,t[2],718787259,15),i=l(i,n,o,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+n|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 t=o.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=s},function(t,e,r){(e=t.exports=r(83)).Stream=e,e.Readable=e,e.Writable=r(51),e.Duplex=r(20),e.Transform=r(86),e.PassThrough=r(194)},function(t,e,r){"use strict";(function(e,i,n){var o=r(38);function a(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,r){var i=t.entry;t.entry=null;for(;i;){var n=i.callback;e.pendingcb--,n(r),i=i.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}t.exports=v;var s,u=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?i:o.nextTick;v.WritableState=b;var h=r(32);h.inherits=r(1);var f={deprecate:r(192)},c=r(84),l=r(2).Buffer,d=n.Uint8Array||function(){};var p,m=r(85);function g(){}function b(t,e){s=s||r(20),t=t||{};var i=e instanceof s;this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var n=t.highWaterMark,h=t.writableHighWaterMark,f=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i&&(h||0===h)?h:f,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var c=!1===t.decodeStrings;this.decodeStrings=!c,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var r=t._writableState,i=r.sync,n=r.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(r),e)!function(t,e,r,i,n){--e.pendingcb,r?(o.nextTick(n,i),o.nextTick(I,t,e),t._writableState.errorEmitted=!0,t.emit("error",i)):(n(i),t._writableState.errorEmitted=!0,t.emit("error",i),I(t,e))}(t,r,i,e,n);else{var a=M(r);a||r.corked||r.bufferProcessing||!r.bufferedRequest||_(t,r),i?u(w,t,r,a,n):w(t,r,a,n)}}(e,t)},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 v(t){if(s=s||r(20),!p.call(v,this)&&!(this instanceof s))return new v(t);this._writableState=new b(t,this),this.writable=!0,t&&("function"===typeof t.write&&(this._write=t.write),"function"===typeof t.writev&&(this._writev=t.writev),"function"===typeof t.destroy&&(this._destroy=t.destroy),"function"===typeof t.final&&(this._final=t.final)),c.call(this)}function y(t,e,r,i,n,o,a){e.writelen=i,e.writecb=a,e.writing=!0,e.sync=!0,r?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}function w(t,e,r,i){r||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,i(),I(t,e)}function _(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=e.bufferedRequestCount,n=new Array(i),o=e.corkedRequestsFree;o.entry=r;for(var s=0,u=!0;r;)n[s]=r,r.isBuf||(u=!1),r=r.next,s+=1;n.allBuffers=u,y(t,e,!0,e.length,n,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new a(e),e.bufferedRequestCount=0}else{for(;r;){var h=r.chunk,f=r.encoding,c=r.callback;if(y(t,e,!1,e.objectMode?1:h.length,h,f,c),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function M(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function A(t,e){t._final((function(r){e.pendingcb--,r&&t.emit("error",r),e.prefinished=!0,t.emit("prefinish"),I(t,e)}))}function I(t,e){var r=M(e);return r&&(!function(t,e){e.prefinished||e.finalCalled||("function"===typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(A,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),r}h.inherits(v,c),b.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(b.prototype,"buffer",{get:f.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"===typeof Symbol&&Symbol.hasInstance&&"function"===typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(t){return!!p.call(this,t)||this===v&&(t&&t._writableState instanceof b)}})):p=function(t){return t instanceof this},v.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},v.prototype.write=function(t,e,r){var i,n=this._writableState,a=!1,s=!n.objectMode&&(i=t,l.isBuffer(i)||i instanceof d);return s&&!l.isBuffer(t)&&(t=function(t){return l.from(t)}(t)),"function"===typeof e&&(r=e,e=null),s?e="buffer":e||(e=n.defaultEncoding),"function"!==typeof r&&(r=g),n.ended?function(t,e){var r=new Error("write after end");t.emit("error",r),o.nextTick(e,r)}(this,r):(s||function(t,e,r,i){var n=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"===typeof r||void 0===r||e.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(t.emit("error",a),o.nextTick(i,a),n=!1),n}(this,n,t,r))&&(n.pendingcb++,a=function(t,e,r,i,n,o){if(!r){var a=function(t,e,r){t.objectMode||!1===t.decodeStrings||"string"!==typeof e||(e=l.from(e,r));return e}(e,i,n);i!==a&&(r=!0,n="buffer",i=a)}var s=e.objectMode?1:i.length;e.length+=s;var u=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),v.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},v.prototype._writev=null,v.prototype.end=function(t,e,r){var i=this._writableState;"function"===typeof t?(r=t,t=null,e=null):"function"===typeof e&&(r=e,e=null),null!==t&&void 0!==t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||function(t,e,r){e.ending=!0,I(t,e),r&&(e.finished?o.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,i,r)},Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),v.prototype.destroy=m.destroy,v.prototype._undestroy=m.undestroy,v.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,r(8),r(190).setImmediate,r(10))},function(t,e,r){"use strict";var i=r(0).Buffer,n=r(1),o=r(82),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],h=[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],c=[0,1518500249,1859775393,2400959708,2840853838],l=[1352829926,1548603684,1836072691,2053994217,0];function d(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(t,e){return t<>>32-e}function m(t,e,r,i,n,o,a,s){return p(t+(e^r^i)+o+a|0,s)+n|0}function g(t,e,r,i,n,o,a,s){return p(t+(e&r|~e&i)+o+a|0,s)+n|0}function b(t,e,r,i,n,o,a,s){return p(t+((e|~r)^i)+o+a|0,s)+n|0}function v(t,e,r,i,n,o,a,s){return p(t+(e&i|r&~i)+o+a|0,s)+n|0}function y(t,e,r,i,n,o,a,s){return p(t+(e^(r|~i))+o+a|0,s)+n|0}n(d,o),d.prototype._update=function(){for(var t=a,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,i=0|this._b,n=0|this._c,o=0|this._d,d=0|this._e,w=0|this._a,_=0|this._b,M=0|this._c,A=0|this._d,I=0|this._e,S=0;S<80;S+=1){var E,k;S<16?(E=m(r,i,n,o,d,t[s[S]],c[0],h[S]),k=y(w,_,M,A,I,t[u[S]],l[0],f[S])):S<32?(E=g(r,i,n,o,d,t[s[S]],c[1],h[S]),k=v(w,_,M,A,I,t[u[S]],l[1],f[S])):S<48?(E=b(r,i,n,o,d,t[s[S]],c[2],h[S]),k=b(w,_,M,A,I,t[u[S]],l[2],f[S])):S<64?(E=v(r,i,n,o,d,t[s[S]],c[3],h[S]),k=g(w,_,M,A,I,t[u[S]],l[3],f[S])):(E=y(r,i,n,o,d,t[s[S]],c[4],h[S]),k=m(w,_,M,A,I,t[u[S]],l[4],f[S])),r=d,d=o,o=p(n,10),n=i,i=E,w=I,I=A,A=p(M,10),M=_,_=k}var x=this._b+n+A|0;this._b=this._c+o+I|0,this._c=this._d+d+w|0,this._d=this._e+r+_|0,this._e=this._a+i+M|0,this._a=x},d.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 t=i.alloc?i.alloc(20):new i(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=d},function(t,e,r){(e=t.exports=function(t){t=t.toLowerCase();var r=e[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r}).sha=r(199),e.sha1=r(200),e.sha224=r(201),e.sha256=r(87),e.sha384=r(202),e.sha512=r(88)},function(t,e,r){"use strict";e.utils=r(208),e.Cipher=r(209),e.DES=r(210),e.CBC=r(211),e.EDE=r(212)},function(t,e,r){var i=r(213),n=r(221),o=r(98);e.createCipher=e.Cipher=i.createCipher,e.createCipheriv=e.Cipheriv=i.createCipheriv,e.createDecipher=e.Decipher=n.createDecipher,e.createDecipheriv=e.Decipheriv=n.createDecipheriv,e.listCiphers=e.getCiphers=function(){return Object.keys(o)}},function(t,e,r){var i={ECB:r(214),CBC:r(215),CFB:r(216),CFB8:r(217),CFB1:r(218),OFB:r(219),CTR:r(96),GCM:r(96)},n=r(98);for(var o in n)n[o].module=i[n[o].mode];t.exports=n},function(t,e,r){var i;function n(t){this.rand=t}if(t.exports=function(t){return i||(i=new n(null)),i.generate(t)},t.exports.Rand=n,n.prototype.generate=function(t){return this._rand(t)},n.prototype._rand=function(t){if(this.rand.getBytes)return this.rand.getBytes(t);for(var e=new Uint8Array(t),r=0;r=0||!r.umod(t.prime1)||!r.umod(t.prime2);)r=new i(n(e));return r}t.exports=o,o.getr=a}).call(this,r(0).Buffer)},function(t,e,r){"use strict";var i=e;i.version=r(230).version,i.utils=r(14),i.rand=r(57),i.curve=r(104),i.curves=r(60),i.ec=r(241),i.eddsa=r(245)},function(t,e,r){"use strict";var i,n=e,o=r(61),a=r(104),s=r(14).assert;function u(t){"short"===t.type?this.curve=new a.short(t):"edwards"===t.type?this.curve=new a.edwards(t):this.curve=new a.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,s(this.g.validate(),"Invalid curve"),s(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function h(t,e){Object.defineProperty(n,t,{configurable:!0,enumerable:!0,get:function(){var r=new u(e);return Object.defineProperty(n,t,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=u,h("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"]}),h("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"]}),h("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"]}),h("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"]}),h("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"]}),h("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"]}),h("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{i=r(240)}catch(f){i=void 0}h("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",i]})},function(t,e,r){var i=e;i.utils=r(15),i.common=r(34),i.sha=r(234),i.ripemd=r(238),i.hmac=r(239),i.sha1=i.sha.sha1,i.sha256=i.sha.sha256,i.sha224=i.sha.sha224,i.sha384=i.sha.sha384,i.sha512=i.sha.sha512,i.ripemd160=i.ripemd.ripemd160},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var i=r(17),n=r(6),o=r(12),a=r(18),s=r(3),u=r(4),h=r(25),f=function(){function e(t,e){this.zsk=n.newFR(t),this.vsk=n.newFR(e)}return e.prototype.isValid=function(){return!this.zsk.isZero()&&!this.vsk.isZero()},e.prototype.toBuffer=function(){var e=t.alloc(64);return e.fill(this.zsk.toBuffer(),0),e.fill(this.vsk.toBuffer(),32),h.SetFlag(e),e},e.prototype.toString=function(){return"0x"+this.toBuffer().toString("hex")},e}();function c(t){if(t instanceof f)return t;var e=s.toBuffer(t);return 64>>=8,t[e+1]=r,r>>>=8,t[e+2]=r,r>>>=8,t[e+3]=r},t.ROTATE=function(t,e){return t<>>32-e},t}(),i=t.alloc(16,0);i.fill(0),e.default=function(e,n){var o=new r(n,i,0),a=t.alloc(e.length);return o.encrypt(a,e),a}}).call(this,r(0).Buffer)},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var i=r(12),n=r(6),o=r(18),a=r(17),s=r(120),u=r(63),h=r(44),f=r(3),c=r(4),l=r(66);e.fetchKey=function(e,r){e=l.newTK(e),r=t.from(f.toBuffer(r)),c(32==r.length),64&r[31]&&(r[31]&=-65);var n=i.newPoint(r);if(n){var o=n.mult(e.vsk);return a.blake2b("CZERO.KEYS.KDF",o.toBuffer())}},e.genPKrKey=function(t,e){t=h.newPKr(t),e=n.newFR(e);var r=t.ZPK.mult(e),i=t.VPK.mult(e),o=r.toBuffer(),s=a.blake2b("CZERO.KEYS.KDF",i.toBuffer());return o[31]|=64,{key:s,rpk:o}},e.signByPKr=function(t,e,r){if(e=f.toBuffer(e),t=l.newSK(t),r=h.newPKr(r),c(32==e.length),e&&0!=e.length&&t.isValid()&&r.isValid()){var i=r.BASE.add(o.accountBase.points.get(0));return u.sign(e,t.vsk.mul(t.zsk),i)}},e.verifyByPKr=function(t,e,r){if(t=f.toBuffer(t),e=f.toBuffer(e),r=h.newPKr(r),c(32==t.length),!t||0==t.length||!e||0==e.length||!r.isValid())return!1;var i=r.BASE.add(o.accountBase.points.get(0));return u.verify(t,e,r.VPK,i)},e.genNil=function(t,e){if(t=l.newSK(t),e=i.newPoint(e),t.isValid()&&e.isValid())return e.mult(t.vsk.mul(t.zsk))},e.signNil=function(t,e,r,n){if(t=f.toBuffer(t),e=l.newSK(e),r=h.newPKr(r),n=i.newPoint(n),c(32==t.length),t&&0!=t.length&&e.isValid()&&r.isValid()&&n.isValid()){var a=r.BASE.add(o.accountBase.points.get(0));return s.sign(t,e.vsk.mul(e.zsk),a,n)}},e.verifyNil=function(t,e,r,n,a){if(t=f.toBuffer(t),e=f.toBuffer(e),r=i.newPoint(r),n=h.newPKr(n),a=i.newPoint(a),c(32==t.length),c(96==e.length),!(t&&0!=t.length&&e&&0!=e.length&&n.isValid()&&a.isValid()))return!1;var u=n.BASE.add(o.accountBase.points.get(0));return s.verify(t,e,n.VPK,r,u,a)},e.genTrace=function(t,e){if(t=l.newTK(t),e=i.newPoint(e),t.isValid()&&e.isValid())return e.mult(t.vsk)},e.isMyPKr=function(t,e){if(t=l.newTK(t),e=h.newPKr(e),!t.isValid()||!e.isValid())return!1;var r=e.ZPK.add(t.ZPK.mult(n.FR.ONE.nega())).mult(t.vsk),i=e.VPK.add(t.ZPK.mult(t.vsk.mul(n.FR.ONE.nega())));return r.isEqualTo(i)}}).call(this,r(0).Buffer)},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var i=r(17),n=r(6),o=r(12),a=r(18),s=r(3),u=r(4),h=function(){function e(t,e){this.zsk=n.newFR(t),this.vsk=n.newFR(e)}return e.prototype.isValid=function(){return!this.zsk.isZero()&&!this.vsk.isZero()},e.prototype.toBuffer=function(){var e=t.alloc(64);return e.fill(this.zsk.toBuffer(),0),e.fill(this.vsk.toBuffer(),32),e},e.prototype.toString=function(){return"0x"+this.toBuffer().toString("hex")},e}();function f(t){if(t instanceof h)return t;var e=s.toBuffer(t);return 64=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};i.forEach(["delete","get","head"],(function(t){s.headers[t]={}})),i.forEach(["post","put","patch"],(function(t){s.headers[t]=i.merge(o)})),t.exports=s}).call(this,r(8))},function(t,e,r){"use strict";var i=r(11),n=r(176),o=r(74),a=r(178),s=r(179),u=r(78);t.exports=function(t){return new Promise((function(e,h){var f=t.data,c=t.headers;i.isFormData(f)&&delete c["Content-Type"];var l=new XMLHttpRequest;if(t.auth){var d=t.auth.username||"",p=t.auth.password||"";c.Authorization="Basic "+btoa(d+":"+p)}if(l.open(t.method.toUpperCase(),o(t.url,t.params,t.paramsSerializer),!0),l.timeout=t.timeout,l.onreadystatechange=function(){if(l&&4===l.readyState&&(0!==l.status||l.responseURL&&0===l.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in l?a(l.getAllResponseHeaders()):null,i={data:t.responseType&&"text"!==t.responseType?l.response:l.responseText,status:l.status,statusText:l.statusText,headers:r,config:t,request:l};n(e,h,i),l=null}},l.onabort=function(){l&&(h(u("Request aborted",t,"ECONNABORTED",l)),l=null)},l.onerror=function(){h(u("Network Error",t,null,l)),l=null},l.ontimeout=function(){h(u("timeout of "+t.timeout+"ms exceeded",t,"ECONNABORTED",l)),l=null},i.isStandardBrowserEnv()){var m=r(180),g=(t.withCredentials||s(t.url))&&t.xsrfCookieName?m.read(t.xsrfCookieName):void 0;g&&(c[t.xsrfHeaderName]=g)}if("setRequestHeader"in l&&i.forEach(c,(function(t,e){"undefined"===typeof f&&"content-type"===e.toLowerCase()?delete c[e]:l.setRequestHeader(e,t)})),t.withCredentials&&(l.withCredentials=!0),t.responseType)try{l.responseType=t.responseType}catch(b){if("json"!==t.responseType)throw b}"function"===typeof t.onDownloadProgress&&l.addEventListener("progress",t.onDownloadProgress),"function"===typeof t.onUploadProgress&&l.upload&&l.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then((function(t){l&&(l.abort(),h(t),l=null)})),void 0===f&&(f=null),l.send(f)}))}},function(t,e,r){"use strict";var i=r(177);t.exports=function(t,e,r,n,o){var a=new Error(t);return i(a,e,r,n,o)}},function(t,e,r){"use strict";var i=r(11);t.exports=function(t,e){e=e||{};var r={};return i.forEach(["url","method","params","data"],(function(t){"undefined"!==typeof e[t]&&(r[t]=e[t])})),i.forEach(["headers","auth","proxy"],(function(n){i.isObject(e[n])?r[n]=i.deepMerge(t[n],e[n]):"undefined"!==typeof e[n]?r[n]=e[n]:i.isObject(t[n])?r[n]=i.deepMerge(t[n]):"undefined"!==typeof t[n]&&(r[n]=t[n])})),i.forEach(["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"],(function(i){"undefined"!==typeof e[i]?r[i]=e[i]:"undefined"!==typeof t[i]&&(r[i]=t[i])})),r}},function(t,e,r){"use strict";function i(t){this.message=t}i.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},i.prototype.__CANCEL__=!0,t.exports=i},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var i=r(3),n=r(46),o=r(37),a=r(65),s=r(273),u=r(275),h=r(122),f=r(44);e.decOut=function(t,e){var r=new Array;return e.forEach((function(e){var o,s={},u=!1;s.Nils=new Array;var h=e.State.OS;if(h.Out_O)s.Asset=l(h.Out_O.Asset),s.Memo=h.Out_O.Memo,s.Nils.push(e.Root),s.Nils.push(i.toString(a.genTrace(t,h.RootCM))),o=h.Out_O.Addr;else if(h.Out_Z)null!==(c=d(i.toString(a.fetchKey(t,h.Out_Z.RPK)),h.Out_Z.EInfo,h.Out_Z.PKr,h.Out_Z.OutCM))&&(s.Asset=c.Asset,s.Memo=c.Memo,s.Nils.push(i.toString(a.genTrace(t,h.RootCM))),o=h.Out_Z.PKr,u=!0);else if(h.Out_P){var f=i.toString(n.genNil(t,h.RootCM,h.Out_P.PKr));s.Asset=l(h.Out_P.Asset),s.Memo=h.Out_P.Memo,s.Nils.push(f),o=h.Out_P.PKr}else{if(!h.Out_C)throw new Error("invalid out type");var c;null!==(c=p(i.toString(n.fetchRPKKey(h.Out_C.PKr,t,h.Out_C.RPK)),h.Out_C.EInfo,h.Out_C.AssetCM))&&(s.Asset=c.Asset,s.Memo=c.Memo,s.Nils.push(i.toString(n.genNil(t,h.RootCM,h.Out_C.PKr))),o=h.Out_C.PKr,u=!0)}if(o){var m={};m.Root=e.Root,m.State=e.State,m.Pkr=i.default.addrToString(o),m.Asset=s.Asset,m.Num=e.State.Num,m.Memo=s.Memo,m.Nils=s.Nils,m.IsZ=u,m.TxHash=e.State.TxHash,r.push(m)}})),r};var c=t.alloc(32,0);function l(e){var r={};return e instanceof o.Asset?(0!=t.compare(e.tkn_currency,c)&&(r.Tkn={Currency:i.toString(e.tkn_currency),Value:i.default.bufferToBN(e.tkn_value.toBuffer()).toString()}),0!=t.compare(e.tkt_value,c)&&(r.Tkt={Category:i.toString(e.tkt_category),Value:i.toString(e.tkt_value)})):(e.Tkn&&0!==t.compare(i.toBuffer(e.Tkn.Currency),c)&&(r.Tkn={Currency:e.Tkn.Currency,Value:i.default.toBN(e.Tkn.Value).toString(10)}),e.Tkt&&0!=t.compare(i.toBuffer(e.Tkt.Value),c)&&(r.Tkt={Category:e.Tkt.Category,Value:e.Tkt.Value})),r}function d(t,e,r,n){t=i.toBuffer(t),e=i.toBuffer(e),r=f.newPKr(r),n=i.toBuffer(n);var o=u.decEInfo(e,t,!0),a=s.genOutCm(o.asset,o.memo,o.rsk,r);return a?0!=a.toBuffer().compare(n)?null:{Asset:l(o.asset),Memo:i.toString(o.memo),Nils:new Array}:null}function p(t,e,r){t=i.toBuffer(t),e=i.toBuffer(e),r=i.toBuffer(r);var n=h.decEInfo(t,e),a=i.toString(n.ar);return 0!=o.genAssetCM(n.asset,a).toBuffer().compare(r)?null:{Asset:l(n.asset),Memo:i.toString(n.memo),Nils:new Array}}e.confirmOutZ=d,e.confirmOutC=p}).call(this,r(0).Buffer)},function(t,e,r){"use strict";var i=r(2).Buffer,n=r(22).Transform;function o(t){n.call(this),this._block=i.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(1)(o,n),o.prototype._transform=function(t,e,r){var i=null;try{this.update(t,e)}catch(n){i=n}r(i)},o.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(r){e=r}t(e)},o.prototype.update=function(t,e){if(function(t,e){if(!i.isBuffer(t)&&"string"!==typeof t)throw new TypeError(e+" must be a string or a buffer")}(t,"Data"),this._finalized)throw new Error("Digest already called");i.isBuffer(t)||(t=i.from(t,e));for(var r=this._block,n=0;this._blockOffset+t.length-n>=this._blockSize;){for(var o=this._blockOffset;o0;++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(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},o.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=o},function(t,e,r){"use strict";(function(e,i){var n=r(38);t.exports=y;var o,a=r(68);y.ReadableState=v;r(31).EventEmitter;var s=function(t,e){return t.listeners(e).length},u=r(84),h=r(2).Buffer,f=e.Uint8Array||function(){};var c=r(32);c.inherits=r(1);var l=r(187),d=void 0;d=l&&l.debuglog?l.debuglog("stream"):function(){};var p,m=r(188),g=r(85);c.inherits(y,u);var b=["error","close","destroy","pause","resume"];function v(t,e){t=t||{};var i=e instanceof(o=o||r(20));this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var n=t.highWaterMark,a=t.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=n||0===n?n:i&&(a||0===a)?a:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,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=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(p||(p=r(23).StringDecoder),this.decoder=new p(t.encoding),this.encoding=t.encoding)}function y(t){if(o=o||r(20),!(this instanceof y))return new y(t);this._readableState=new v(t,this),this.readable=!0,t&&("function"===typeof t.read&&(this._read=t.read),"function"===typeof t.destroy&&(this._destroy=t.destroy)),u.call(this)}function w(t,e,r,i,n){var o,a=t._readableState;null===e?(a.reading=!1,function(t,e){if(e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,I(t)}(t,a)):(n||(o=function(t,e){var r;i=e,h.isBuffer(i)||i instanceof f||"string"===typeof e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));var i;return r}(a,e)),o?t.emit("error",o):a.objectMode||e&&e.length>0?("string"===typeof e||a.objectMode||Object.getPrototypeOf(e)===h.prototype||(e=function(t){return h.from(t)}(e)),i?a.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):_(t,a,e,!0):a.ended?t.emit("error",new Error("stream.push() after EOF")):(a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?_(t,a,e,!1):E(t,a)):_(t,a,e,!1))):i||(a.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=M?t=M:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function I(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(d("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?n.nextTick(S,t):S(t))}function S(t){d("emit readable"),t.emit("readable"),C(t)}function E(t,e){e.readingMore||(e.readingMore=!0,n.nextTick(k,t,e))}function k(t,e){for(var r=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=function(t,e,r){var i;to.length?o.length:t;if(a===o.length?n+=o:n+=o.slice(0,t),0===(t-=a)){a===o.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(a));break}++i}return e.length-=i,n}(t,e):function(t,e){var r=h.allocUnsafe(t),i=e.head,n=1;i.data.copy(r),t-=i.data.length;for(;i=i.next;){var o=i.data,a=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,a),0===(t-=a)){a===o.length?(++n,i.next?e.head=i.next:e.head=e.tail=null):(e.head=i,i.data=o.slice(a));break}++n}return e.length-=n,r}(t,e);return i}(t,e.buffer,e.decoder),r);var r}function P(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,n.nextTick(R,e,t))}function R(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function O(t,e){for(var r=0,i=t.length;r=e.highWaterMark||e.ended))return d("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?P(this):I(this),null;if(0===(t=A(t,e))&&e.ended)return 0===e.length&&P(this),null;var i,n=e.needReadable;return d("need readable",n),(0===e.length||e.length-t0?T(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&P(this)),null!==i&&this.emit("data",i),i},y.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},y.prototype.pipe=function(t,e){var r=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,d("pipe count=%d opts=%j",o.pipesCount,e);var u=(!e||!1!==e.end)&&t!==i.stdout&&t!==i.stderr?f:y;function h(e,i){d("onunpipe"),e===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,d("cleanup"),t.removeListener("close",b),t.removeListener("finish",v),t.removeListener("drain",c),t.removeListener("error",g),t.removeListener("unpipe",h),r.removeListener("end",f),r.removeListener("end",y),r.removeListener("data",m),l=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||c())}function f(){d("onend"),t.end()}o.endEmitted?n.nextTick(u):r.once("end",u),t.on("unpipe",h);var c=function(t){return function(){var e=t._readableState;d("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&s(t,"data")&&(e.flowing=!0,C(t))}}(r);t.on("drain",c);var l=!1;var p=!1;function m(e){d("ondata"),p=!1,!1!==t.write(e)||p||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==O(o.pipes,t))&&!l&&(d("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,p=!0),r.pause())}function g(e){d("onerror",e),y(),t.removeListener("error",g),0===s(t,"error")&&t.emit("error",e)}function b(){t.removeListener("finish",v),y()}function v(){d("onfinish"),t.removeListener("close",b),y()}function y(){d("unpipe"),r.unpipe(t)}return r.on("data",m),function(t,e,r){if("function"===typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?a(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",g),t.once("close",b),t.once("finish",v),t.emit("pipe",r),o.flowing||(d("pipe resume"),r.resume()),t},y.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function l(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function d(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}i(u,n),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(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,p=0|this._f,m=0|this._g,g=0|this._h,b=0;b<16;++b)r[b]=t.readInt32BE(4*b);for(;b<64;++b)r[b]=0|(((e=r[b-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[b-7]+d(r[b-15])+r[b-16];for(var v=0;v<64;++v){var y=g+l(u)+h(u,p,m)+a[v]+r[v]|0,w=c(i)+f(i,n,o)|0;g=m,m=p,p=u,u=s+y|0,s=o,o=n,n=i,i=y+w|0}this._a=i+this._a|0,this._b=n+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=m+this._g|0,this._h=g+this._h|0},u.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=u},function(t,e,r){var i=r(1),n=r(24),o=r(2).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,n.call(this,128,112)}function h(t,e,r){return r^t&(e^r)}function f(t,e,r){return t&e|r&(t|e)}function c(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function l(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function d(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function m(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function g(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function b(t,e){return t>>>0>>0?1:0}i(u,n),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(t){for(var e=this._w,r=0|this._ah,i=0|this._bh,n=0|this._ch,o=0|this._dh,s=0|this._eh,u=0|this._fh,v=0|this._gh,y=0|this._hh,w=0|this._al,_=0|this._bl,M=0|this._cl,A=0|this._dl,I=0|this._el,S=0|this._fl,E=0|this._gl,k=0|this._hl,x=0;x<32;x+=2)e[x]=t.readInt32BE(4*x),e[x+1]=t.readInt32BE(4*x+4);for(;x<160;x+=2){var B=e[x-30],C=e[x-30+1],T=d(B,C),P=p(C,B),R=m(B=e[x-4],C=e[x-4+1]),O=g(C,B),j=e[x-14],D=e[x-14+1],N=e[x-32],z=e[x-32+1],K=P+D|0,q=T+j+b(K,P)|0;q=(q=q+R+b(K=K+O|0,O)|0)+N+b(K=K+z|0,z)|0,e[x]=q,e[x+1]=K}for(var U=0;U<160;U+=2){q=e[U],K=e[U+1];var F=f(r,i,n),L=f(w,_,M),Q=c(r,w),H=c(w,r),V=l(s,I),Z=l(I,s),G=a[U],Y=a[U+1],W=h(s,u,v),J=h(I,S,E),X=k+Z|0,$=y+V+b(X,k)|0;$=($=($=$+W+b(X=X+J|0,J)|0)+G+b(X=X+Y|0,Y)|0)+q+b(X=X+K|0,K)|0;var tt=H+L|0,et=Q+F+b(tt,H)|0;y=v,k=E,v=u,E=S,u=s,S=I,s=o+$+b(I=A+X|0,A)|0,o=n,A=M,n=i,M=_,i=r,_=w,r=$+et+b(w=X+tt|0,X)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+M|0,this._dl=this._dl+A|0,this._el=this._el+I|0,this._fl=this._fl+S|0,this._gl=this._gl+E|0,this._hl=this._hl+k|0,this._ah=this._ah+r+b(this._al,w)|0,this._bh=this._bh+i+b(this._bl,_)|0,this._ch=this._ch+n+b(this._cl,M)|0,this._dh=this._dh+o+b(this._dl,A)|0,this._eh=this._eh+s+b(this._el,I)|0,this._fh=this._fh+u+b(this._fl,S)|0,this._gh=this._gh+v+b(this._gl,E)|0,this._hh=this._hh+y+b(this._hl,k)|0},u.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,r,i){t.writeInt32BE(e,i),t.writeInt32BE(r,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=u},function(t,e,r){"use strict";var i=r(1),n=r(203),o=r(16),a=r(2).Buffer,s=r(90),u=r(52),h=r(53),f=a.alloc(128);function c(t,e){o.call(this,"digest"),"string"===typeof e&&(e=a.from(e));var r="sha512"===t||"sha384"===t?128:64;(this._alg=t,this._key=e,e.length>r)?e=("rmd160"===t?new u:h(t)).update(e).digest():e.lengthr||o!==o)throw new TypeError("Bad key length")}}).call(this,r(0).Buffer)},function(t,e,r){(function(e){var r;e.browser?r="utf-8":r=parseInt(e.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary";t.exports=r}).call(this,r(8))},function(t,e,r){var i=r(90),n=r(52),o=r(53),a=r(93),s=r(94),u=r(2).Buffer,h=u.alloc(128),f={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function c(t,e,r){var a=function(t){return"rmd160"===t||"ripemd160"===t?function(t){return(new n).update(t).digest()}:"md5"===t?i:function(e){return o(t).update(e).digest()}}(t),s="sha512"===t||"sha384"===t?128:64;e.length>s?e=a(e):e.lengtht;)r.ishrn(1);if(r.isEven()&&r.iadd(s),r.testn(1)||r.iadd(u),e.cmp(u)){if(!e.cmp(h))for(;r.mod(f).cmp(c);)r.iadd(d)}else for(;r.mod(o).cmp(l);)r.iadd(d);if(g(p=r.shrn(1))&&g(r)&&b(p)&&b(r)&&a.test(p)&&a.test(r))return r}}},function(t,e,r){var i=r(5),n=r(57);function o(t){this.rand=t||new n.Rand}t.exports=o,o.create=function(t){return new o(t)},o.prototype._randbelow=function(t){var e=t.bitLength(),r=Math.ceil(e/8);do{var n=new i(this.rand.generate(r))}while(n.cmp(t)>=0);return n},o.prototype._randrange=function(t,e){var r=e.sub(t);return t.add(this._randbelow(r))},o.prototype.test=function(t,e,r){var n=t.bitLength(),o=i.mont(t),a=new i(1).toRed(o);e||(e=Math.max(1,n/48|0));for(var s=t.subn(1),u=0;!s.testn(u);u++);for(var h=t.shrn(u),f=s.toRed(o);e>0;e--){var c=this._randrange(new i(2),s);r&&r(c);var l=c.toRed(o).redPow(h);if(0!==l.cmp(a)&&0!==l.cmp(f)){for(var d=1;d0;e--){var f=this._randrange(new i(2),a),c=t.gcd(f);if(0!==c.cmpn(1))return c;var l=f.toRed(n).redPow(u);if(0!==l.cmp(o)&&0!==l.cmp(h)){for(var d=1;d>8,a=255&n;o?r.push(o,a):r.push(a)}return r},i.zero2=n,i.toHex=o,i.encode=function(t,e){return"hex"===e?o(t):t}},function(t,e,r){"use strict";var i=e;i.base=r(41),i.short=r(231),i.mont=r(232),i.edwards=r(233)},function(t,e,r){"use strict";var i=r(15).rotr32;function n(t,e,r){return t&e^~t&r}function o(t,e,r){return t&e^t&r^e&r}function a(t,e,r){return t^e^r}e.ft_1=function(t,e,r,i){return 0===t?n(e,r,i):1===t||3===t?a(e,r,i):2===t?o(e,r,i):void 0},e.ch32=n,e.maj32=o,e.p32=a,e.s0_256=function(t){return i(t,2)^i(t,13)^i(t,22)},e.s1_256=function(t){return i(t,6)^i(t,11)^i(t,25)},e.g0_256=function(t){return i(t,7)^i(t,18)^t>>>3},e.g1_256=function(t){return i(t,17)^i(t,19)^t>>>10}},function(t,e,r){"use strict";var i=r(15),n=r(34),o=r(105),a=r(13),s=i.sum32,u=i.sum32_4,h=i.sum32_5,f=o.ch32,c=o.maj32,l=o.s0_256,d=o.s1_256,p=o.g0_256,m=o.g1_256,g=n.BlockHash,b=[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 v(){if(!(this instanceof v))return new v;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=b,this.W=new Array(64)}i.inherits(v,g),t.exports=v,v.blockSize=512,v.outSize=256,v.hmacStrength=192,v.padLength=64,v.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;i>6],n=0===(32&r);if(31===(31&r)){var o=r;for(r=0;128===(128&o);){if(o=t.readUInt8(e),t.isError(o))return o;r<<=7,r|=127&o}}else r&=31;return{cls:i,primitive:n,tag:r,tagStr:s.tag[r]}}function c(t,e,r){var i=t.readUInt8(r);if(t.isError(i))return i;if(!e&&128===i)return null;if(0===(128&i))return i;var n=127&i;if(n>4)return t.error("length octect is too long");i=0;for(var o=0;o=31)return i.error("Multi-octet tag encoding unsupported");e||(n|=32);return n|=s.tagClassByName[r||"universal"]<<6}(t,e,r,this.reporter);if(i.length<128)return(o=new n(2))[0]=a,o[1]=i.length,this._createEncoderBuffer([o,i]);for(var u=1,h=i.length;h>=256;h>>=8)u++;(o=new n(2+u))[0]=a,o[1]=128|u;h=1+u;for(var f=i.length;f>0;h--,f>>=8)o[h]=255&f;return this._createEncoderBuffer([o,i])},h.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){for(var r=new n(2*t.length),i=0;i=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}var o=0;for(i=0;i=128;a>>=7)o++}var s=new n(o),u=s.length-1;for(i=t.length-1;i>=0;i--){a=t[i];for(s[u--]=127&a;(a>>=7)>0;)s[u--]=128|127&a}return this._createEncoderBuffer(s)},h.prototype._encodeTime=function(t,e){var r,i=new Date(t);return"gentime"===e?r=[f(i.getFullYear()),f(i.getUTCMonth()+1),f(i.getUTCDate()),f(i.getUTCHours()),f(i.getUTCMinutes()),f(i.getUTCSeconds()),"Z"].join(""):"utctime"===e?r=[f(i.getFullYear()%100),f(i.getUTCMonth()+1),f(i.getUTCDate()),f(i.getUTCHours()),f(i.getUTCMinutes()),f(i.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(r,"octstr")},h.prototype._encodeNull=function(){return this._createEncoderBuffer("")},h.prototype._encodeInt=function(t,e){if("string"===typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!==typeof t&&!n.isBuffer(t)){var r=t.toArray();!t.sign&&128&r[0]&&r.unshift(0),t=new n(r)}if(n.isBuffer(t)){var i=t.length;0===t.length&&i++;var o=new n(i);return t.copy(o),0===t.length&&(o[0]=0),this._createEncoderBuffer(o)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);i=1;for(var a=t;a>=256;a>>=8)i++;for(a=(o=new Array(i)).length-1;a>=0;a--)o[a]=255&t,t>>=8;return 128&o[0]&&o.unshift(0),this._createEncoderBuffer(new n(o))},h.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},h.prototype._use=function(t,e){return"function"===typeof t&&(t=t(e)),t._getEncoder("der").tree},h.prototype._skipDefault=function(t,e,r){var i,n=this._baseState;if(null===n.default)return!1;var o=t.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,e,r).join()),o.length!==n.defaultBuffer.length)return!1;for(i=0;ithis.SegNum*this.SegBitsNum&&s(!1,"bigBuffer.length > SegNum * SegBitsNum");for(var i=Math.ceil(this.SegBitsNum/this.Bits),a=Math.ceil(r.bitsLength()/this.SegBitsNum),h=u.Point.ZERO,f=0;f=s),this.bitsLen=n,this.rightBits=r%8,this.buf=t.from(e.slice(Math.floor(r/8),Math.floor((a-1)/8)+1)),this.buf[this.buf.length-1]&=o.get(a%8)}return e.prototype.toBigNumber=function(){return new n(this.buf,"le").shrn(this.rightBits)},e.prototype.bitsLength=function(){return this.bitsLen},e.from=function(t,r,i){return new e(t.buf,r+t.rightBits,i)},e}();e.BitBuffer=a}).call(this,r(0).Buffer)},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var i=r(12),n=r(6),o=r(4),a=r(17),s=r(43);function u(t){return a.blake2b("SZK$DSAN$HASH2",t)}function h(t){return new s(t)}e.sign=function(e,r,i,o){var s=t.concat([h(32),r.toBuffer(),e]),f=new n.FR(function(t){return a.blake2b("SZK$DSAN$HASH1",t)}(s)),c=i.mult(f);if(c&&!c.isZero()&&c.isValid()){var l=o.mult(f);if(l&&!l.isZero()&&l.isValid()){var d=i.mult(r);if(d&&!d.isZero()&&d.isValid()){var p=o.mult(r);if(p&&!p.isZero()&&p.isValid()){var m=t.concat([c.toBuffer(),l.toBuffer(),d.toBuffer(),p.toBuffer(),e]),g=new n.FR(u(m)),b=f.add(r.mul(g));return t.concat([b.toBuffer(),c.toBuffer(),l.toBuffer()])}}}}},e.verify=function(e,r,a,s,h,f){if(o(96==r.length,"sign.length != 96"),!a||a.isZero()||!a.isValid())return!1;if(!s||s.isZero()||!s.isValid())return!1;var c=new n.FR(r.slice(0,32)),l=i.Point.bufferTo(r.slice(32,64)),d=i.Point.bufferTo(r.slice(64,96));if(!c||c.isZero())return!1;if(!l||l.isZero()||!l.isValid())return!1;if(!d||d.isZero()||!d.isValid())return!1;var p=h.mult(c);if(!p||p.isZero()||!p.isValid())return!1;var m=f.mult(c);if(!m||m.isZero()||!m.isValid())return!1;var g=t.concat([l.toBuffer(),d.toBuffer(),a.toBuffer(),s.toBuffer(),e]),b=new n.FR(u(g)),v=a.mult(b),y=l.add(v);if(!p.isEqualTo(y))return!1;var w=s.mult(b),_=d.add(w);return!!m.isEqualTo(_)}}).call(this,r(0).Buffer)},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var i=r(12),n=r(3),o=r(4),a=r(66),s=function(){function e(t,e){this.ZPK=i.newPoint(t),this.VPK=i.newPoint(e)}return e.prototype.toBuffer=function(){return t.concat([this.ZPK.toBuffer(),this.VPK.toBuffer()])},e.prototype.toString=function(){return n.default.bufferToBs58(this.toBuffer())},e}();e.PK=s,e.newPK=function(t){if(t instanceof s)return t;var e=n.toBuffer(t);o(64==e.length);var r=i.Point.bufferTo(e.slice(0,32)),a=i.Point.bufferTo(e.slice(32,64));return new s(r,a)},e.tk2PK=function(t){var e=(t=a.newTK(t)).ZPK,r=t.ZPK.mult(t.vsk);return new s(e,r)}}).call(this,r(0).Buffer)},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var i=r(37),n=r(6),o=r(3),a=r(64),s=r(4),u=function(){function e(t,e,r){this.asset=i.newAsset(t),this.memo=o.toBuffer(e),this.ar=n.newFR(r)}return e.prototype.isValid=function(){return!!this.asset.isValid()&&!this.ar.isZero()},e.prototype.toBuffer=function(){return t.concat([this.asset.toBuffer(),this.memo,this.ar.toBuffer()])},e.prototype.toString=function(){return"0x"+this.toBuffer().toString("hex")},e}();function h(t){if(t instanceof u)return t;var e=o.toBuffer(t);s(224==e.length);var r=0,a=128,h=i.newAsset(e.slice(r,r+a));r+=a,a=64;var f=e.slice(r,r+a);r+=a,a=32;var c=n.newFR(e.slice(r,r+a));return new u(h,f,c)}e.Info=u,e.newInfo=h,e.encInfo=function(t,e){t=o.toBuffer(t);var r=(e=h(e)).toBuffer();return a.default(r,t)},e.decEInfo=function(t,e){return t=o.toBuffer(t),e=o.toBuffer(e),h(a.default(e,t))}}).call(this,r(0).Buffer)},function(t,e,r){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0});var i=r(48),n=r(43),o=r(276),a=r(293),s=r(296),u=r(142),h=r(3),f=r(6),c=r(45),l=function(){function t(t,e){if(this.version=2,void 0!==t){void 0===e&&(e=g());var r=h.toBuffer(e);this.keystore=p(r,t,2);var i=c.seed2Sk(r,2),n=c.sk2Tk(i);return this.tk=n,this.pk=c.tk2PK(n),this.version=2,this}}return t.prototype.fromKeystore=function(t){var e="object"==typeof t?t:JSON.parse(t);this.keystore=e,this.tk=e.tk,this.version=this.keystore.version;var r=h.toBuffer(this.tk);if(h.isNewVersion(r)){if(2!==this.version)throw new Error("keystore version not match tk")}else if(1!==this.version)throw new Error("keystore version not match tk");var i=c.tk2PK(this.tk);return this.pk=i,this},t.prototype.fromMnemonic=function(t,e){var r=t.split(" "),i=1;if(25===r.length){if("v2"!==r[0])throw new Error("invalid mnemoic!");i=2,t=r.slice(1).join(" ")}if(s.validateMnemonic(t)){var n=s.mnemonicToEntropy(t),o=h.toBuffer(n);this.keystore=p(o,e,i);var a=c.seed2Sk(o,i),u=c.sk2Tk(a);return this.tk=u,this.pk=this.keystore.address,this.version=i,this}throw new Error("invald mnemonic!")},t.prototype.fromTk=function(t){var e=h.toBuffer(t),r=1;return h.isNewVersion(e)&&(r=2),this.tk=t,this.pk=c.tk2PK(e),this.keystore=function(t,e){var r=c.tk2PK(t);return{version:e,id:a({random:n(16)}),address:r,tk:t.toString(),at:0}}(this.tk,r),this.version=r,this},t.prototype.getSk=function(t){if(this.keystore.crypto){var e=d(this.keystore,t);return c.seed2Sk(e,this.keystore.version)}return""},t.prototype.getTk=function(){return this.tk.toString()},t.prototype.getPk=function(){return this.pk},t.prototype.getVersion=function(){return this.version},t.prototype.getKeystore=function(){return this.keystore},t.prototype.exportMnemonic=function(t){var e=d(this.keystore,t),r=this.keystore.version,i=s.entropyToMnemonic(e);return 2===r&&(i="v2 "+i),i},t}();function d(e,r){var n,a,s="object"==typeof e?e:JSON.parse(e);if("scrypt"!==s.crypto.kdf)throw new Error("Unsupported key derivation scheme");a=s.crypto.kdfparams,n=o(t.from(r),h.toBuffer(a.salt),a.n,a.r,a.p,a.dklen);var f=t.from(s.crypto.ciphertext,"hex");if(u(t.concat([n.slice(16,32),f])).toString("hex")!==s.crypto.mac)throw new Error("Key derivation failed - possibly wrong passphrase");return m(i.createDecipheriv(s.crypto.cipher,n.slice(0,16),t.from(s.crypto.cipherparams.iv,"hex")),f)}function p(e,r,s){if(!function(t){return null!=t}(e))throw new Error("This is a public key only wallet");var f={cipher:"aes-128-ctr",kdf:"scrypt",salt:n(32),iv:n(16),uuid:n(16),dklen:32,c:262144,n:262144,r:8,p:1},l=function(t){return{dklen:t.dklen,salt:t.salt.toString("hex"),n:t.n,r:t.r,p:t.p}}(f),d=o(t.from(r),h.toBuffer(l.salt),l.n,l.r,l.p,l.dklen),p=i.createCipheriv(f.cipher,d.slice(0,16),f.iv);if(!p)throw new Error("Unsupported cipher");var g=m(p,e),b=u(t.concat([d.slice(16,32),t.from(g)])),v=c.seed2Sk(e,s),y=c.sk2Tk(v),w=c.tk2PK(y);return l.salt=l.salt,{version:s,id:a({random:f.uuid}),address:w,tk:y.toString(),crypto:{ciphertext:g.toString("hex"),cipherparams:{iv:f.iv.toString("hex")},cipher:f.cipher,kdf:f.kdf,kdfparams:l,mac:b.toString("hex")},at:0}}function m(e,r){return t.concat([e.update(r),e.final()])}function g(){return f.randomFR().toBuffer().toString("hex")}e.default=l,e.createPkrHash=function(e,r,i){if(2!==i&&1!==i)throw new Error("ivalid version");e=h.toBuffer(e);var n=h.toBN(r).toArrayLike(t,"be");if(8r||e!==e)throw new TypeError("Bad key length")}},function(t,e,r){(function(e){var r;if(e.browser)r="utf-8";else if(e.version){r=parseInt(e.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}else r="utf-8";t.exports=r}).call(this,r(8))},function(t,e,r){var i=r(279),n=r(136),o=r(137),a=r(7).Buffer,s=r(125),u=r(126),h=r(140),f=a.alloc(128),c={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function l(t,e,r){var s=function(t){return"rmd160"===t||"ripemd160"===t?function(t){return(new n).update(t).digest()}:"md5"===t?i:function(e){return o(t).update(e).digest()}}(t),u="sha512"===t||"sha384"===t?128:64;e.length>u?e=s(e):e.length>>32-e}function h(t,e,r,i,n,o,a){return u(t+(e&r|~e&i)+n+o|0,a)+e|0}function f(t,e,r,i,n,o,a){return u(t+(e&i|r&~i)+n+o|0,a)+e|0}function c(t,e,r,i,n,o,a){return u(t+(e^r^i)+n+o|0,a)+e|0}function l(t,e,r,i,n,o,a){return u(t+(r^(e|~i))+n+o|0,a)+e|0}i(s,n),s.prototype._update=function(){for(var t=a,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);var r=this._a,i=this._b,n=this._c,o=this._d;r=h(r,i,n,o,t[0],3614090360,7),o=h(o,r,i,n,t[1],3905402710,12),n=h(n,o,r,i,t[2],606105819,17),i=h(i,n,o,r,t[3],3250441966,22),r=h(r,i,n,o,t[4],4118548399,7),o=h(o,r,i,n,t[5],1200080426,12),n=h(n,o,r,i,t[6],2821735955,17),i=h(i,n,o,r,t[7],4249261313,22),r=h(r,i,n,o,t[8],1770035416,7),o=h(o,r,i,n,t[9],2336552879,12),n=h(n,o,r,i,t[10],4294925233,17),i=h(i,n,o,r,t[11],2304563134,22),r=h(r,i,n,o,t[12],1804603682,7),o=h(o,r,i,n,t[13],4254626195,12),n=h(n,o,r,i,t[14],2792965006,17),r=f(r,i=h(i,n,o,r,t[15],1236535329,22),n,o,t[1],4129170786,5),o=f(o,r,i,n,t[6],3225465664,9),n=f(n,o,r,i,t[11],643717713,14),i=f(i,n,o,r,t[0],3921069994,20),r=f(r,i,n,o,t[5],3593408605,5),o=f(o,r,i,n,t[10],38016083,9),n=f(n,o,r,i,t[15],3634488961,14),i=f(i,n,o,r,t[4],3889429448,20),r=f(r,i,n,o,t[9],568446438,5),o=f(o,r,i,n,t[14],3275163606,9),n=f(n,o,r,i,t[3],4107603335,14),i=f(i,n,o,r,t[8],1163531501,20),r=f(r,i,n,o,t[13],2850285829,5),o=f(o,r,i,n,t[2],4243563512,9),n=f(n,o,r,i,t[7],1735328473,14),r=c(r,i=f(i,n,o,r,t[12],2368359562,20),n,o,t[5],4294588738,4),o=c(o,r,i,n,t[8],2272392833,11),n=c(n,o,r,i,t[11],1839030562,16),i=c(i,n,o,r,t[14],4259657740,23),r=c(r,i,n,o,t[1],2763975236,4),o=c(o,r,i,n,t[4],1272893353,11),n=c(n,o,r,i,t[7],4139469664,16),i=c(i,n,o,r,t[10],3200236656,23),r=c(r,i,n,o,t[13],681279174,4),o=c(o,r,i,n,t[0],3936430074,11),n=c(n,o,r,i,t[3],3572445317,16),i=c(i,n,o,r,t[6],76029189,23),r=c(r,i,n,o,t[9],3654602809,4),o=c(o,r,i,n,t[12],3873151461,11),n=c(n,o,r,i,t[15],530742520,16),r=l(r,i=c(i,n,o,r,t[2],3299628645,23),n,o,t[0],4096336452,6),o=l(o,r,i,n,t[7],1126891415,10),n=l(n,o,r,i,t[14],2878612391,15),i=l(i,n,o,r,t[5],4237533241,21),r=l(r,i,n,o,t[12],1700485571,6),o=l(o,r,i,n,t[3],2399980690,10),n=l(n,o,r,i,t[10],4293915773,15),i=l(i,n,o,r,t[1],2240044497,21),r=l(r,i,n,o,t[8],1873313359,6),o=l(o,r,i,n,t[15],4264355552,10),n=l(n,o,r,i,t[6],2734768916,15),i=l(i,n,o,r,t[13],1309151649,21),r=l(r,i,n,o,t[4],4149444226,6),o=l(o,r,i,n,t[11],3174756917,10),n=l(n,o,r,i,t[2],718787259,15),i=l(i,n,o,r,t[9],3951481745,21),this._a=this._a+r|0,this._b=this._b+i|0,this._c=this._c+n|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 t=o.allocUnsafe(16);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t},t.exports=s},function(t,e,r){"use strict";var i=r(7).Buffer,n=r(280).Transform;function o(t){n.call(this),this._block=i.allocUnsafe(t),this._blockSize=t,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}r(9)(o,n),o.prototype._transform=function(t,e,r){var i=null;try{this.update(t,e)}catch(n){i=n}r(i)},o.prototype._flush=function(t){var e=null;try{this.push(this.digest())}catch(r){e=r}t(e)},o.prototype.update=function(t,e){if(function(t,e){if(!i.isBuffer(t)&&"string"!==typeof t)throw new TypeError(e+" must be a string or a buffer")}(t,"Data"),this._finalized)throw new Error("Digest already called");i.isBuffer(t)||(t=i.from(t,e));for(var r=this._block,n=0;this._blockOffset+t.length-n>=this._blockSize;){for(var o=this._blockOffset;o0;++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(t){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var e=this._digest();void 0!==t&&(e=e.toString(t)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return e},o.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=o},function(t,e,r){"use strict";(function(e,i){var n;t.exports=S,S.ReadableState=I;r(31).EventEmitter;var o=function(t,e){return t.listeners(e).length},a=r(131),s=r(0).Buffer,u=e.Uint8Array||function(){};var h,f=r(281);h=f&&f.debuglog?f.debuglog("stream"):function(){};var c,l,d,p=r(282),m=r(132),g=r(133).getHighWaterMark,b=r(26).codes,v=b.ERR_INVALID_ARG_TYPE,y=b.ERR_STREAM_PUSH_AFTER_EOF,w=b.ERR_METHOD_NOT_IMPLEMENTED,_=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(9)(S,a);var M=m.errorOrDestroy,A=["error","close","destroy","pause","resume"];function I(t,e,i){n=n||r(27),t=t||{},"boolean"!==typeof i&&(i=e instanceof n),this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",i),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!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(c||(c=r(23).StringDecoder),this.decoder=new c(t.encoding),this.encoding=t.encoding)}function S(t){if(n=n||r(27),!(this instanceof S))return new S(t);var e=this instanceof n;this._readableState=new I(t,this,e),this.readable=!0,t&&("function"===typeof t.read&&(this._read=t.read),"function"===typeof t.destroy&&(this._destroy=t.destroy)),a.call(this)}function E(t,e,r,i,n){h("readableAddChunk",e);var o,a=t._readableState;if(null===e)a.reading=!1,function(t,e){if(h("onEofChunk"),e.ended)return;if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?C(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,T(t)))}(t,a);else if(n||(o=function(t,e){var r;i=e,s.isBuffer(i)||i instanceof u||"string"===typeof e||void 0===e||t.objectMode||(r=new v("chunk",["string","Buffer","Uint8Array"],e));var i;return r}(a,e)),o)M(t,o);else if(a.objectMode||e&&e.length>0)if("string"===typeof e||a.objectMode||Object.getPrototypeOf(e)===s.prototype||(e=function(t){return s.from(t)}(e)),i)a.endEmitted?M(t,new _):k(t,a,e,!0);else if(a.ended)M(t,new y);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(e=a.decoder.write(e),a.objectMode||0!==e.length?k(t,a,e,!1):P(t,a)):k(t,a,e,!1)}else i||(a.reading=!1,P(t,a));return!a.ended&&(a.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=x?t=x:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function C(t){var e=t._readableState;h("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(h("emitReadable",e.flowing),e.emittedReadable=!0,i.nextTick(T,t))}function T(t){var e=t._readableState;h("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,N(t)}function P(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(R,t,e))}function R(t,e){for(;!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function j(t){h("readable nexttick read 0"),t.read(0)}function D(t,e){h("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),N(t),e.flowing&&!e.reading&&t.read(0)}function N(t){var e=t._readableState;for(h("flow",e.flowing);e.flowing&&null!==t.read(););}function z(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function K(t){var e=t._readableState;h("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,i.nextTick(q,e,t))}function q(t,e){if(h("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function U(t,e){for(var r=0,i=t.length;r=e.highWaterMark:e.length>0)||e.ended))return h("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?K(this):C(this),null;if(0===(t=B(t,e))&&e.ended)return 0===e.length&&K(this),null;var i,n=e.needReadable;return h("need readable",n),(0===e.length||e.length-t0?z(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&K(this)),null!==i&&this.emit("data",i),i},S.prototype._read=function(t){M(this,new w("_read()"))},S.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t)}n.pipesCount+=1,h("pipe count=%d opts=%j",n.pipesCount,e);var a=(!e||!1!==e.end)&&t!==i.stdout&&t!==i.stderr?u:g;function s(e,i){h("onunpipe"),e===r&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,h("cleanup"),t.removeListener("close",p),t.removeListener("finish",m),t.removeListener("drain",f),t.removeListener("error",d),t.removeListener("unpipe",s),r.removeListener("end",u),r.removeListener("end",g),r.removeListener("data",l),c=!0,!n.awaitDrain||t._writableState&&!t._writableState.needDrain||f())}function u(){h("onend"),t.end()}n.endEmitted?i.nextTick(a):r.once("end",a),t.on("unpipe",s);var f=function(t){return function(){var e=t._readableState;h("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&o(t,"data")&&(e.flowing=!0,N(t))}}(r);t.on("drain",f);var c=!1;function l(e){h("ondata");var i=t.write(e);h("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===t||n.pipesCount>1&&-1!==U(n.pipes,t))&&!c&&(h("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function d(e){h("onerror",e),g(),t.removeListener("error",d),0===o(t,"error")&&M(t,e)}function p(){t.removeListener("finish",m),g()}function m(){h("onfinish"),t.removeListener("close",p),g()}function g(){h("unpipe"),r.unpipe(t)}return r.on("data",l),function(t,e,r){if("function"===typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}(t,"error",d),t.once("close",p),t.once("finish",m),t.emit("pipe",r),n.flowing||(h("pipe resume"),r.resume()),t},S.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==n.flowing&&this.resume()):"readable"===t&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,h("on readable",n.length,n.reading),n.length?C(this):n.reading||i.nextTick(j,this))),r},S.prototype.addListener=S.prototype.on,S.prototype.removeListener=function(t,e){var r=a.prototype.removeListener.call(this,t,e);return"readable"===t&&i.nextTick(O,this),r},S.prototype.removeAllListeners=function(t){var e=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||i.nextTick(O,this),e},S.prototype.resume=function(){var t=this._readableState;return t.flowing||(h("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,i.nextTick(D,t,e))}(this,t)),t.paused=!1,this},S.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},S.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;for(var n in t.on("end",(function(){if(h("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(n){(h("wrapped data"),r.decoder&&(n=r.decoder.write(n)),!r.objectMode||null!==n&&void 0!==n)&&((r.objectMode||n&&n.length)&&(e.push(n)||(i=!0,t.pause())))})),t)void 0===this[n]&&"function"===typeof t[n]&&(this[n]=function(e){return function(){return t[e].apply(t,arguments)}}(n));for(var o=0;o-1))throw new _(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(S.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(S.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),S.prototype._write=function(t,e,r){r(new m("_write()"))},S.prototype._writev=null,S.prototype.end=function(t,e,r){var n=this._writableState;return"function"===typeof t?(r=t,t=null,e=null):"function"===typeof e&&(r=e,e=null),null!==t&&void 0!==t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||function(t,e,r){e.ending=!0,T(t,e),r&&(e.finished?i.nextTick(r):t.once("finish",r));e.ended=!0,t.writable=!1}(this,n,r),this},Object.defineProperty(S.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(S.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),S.prototype.destroy=c.destroy,S.prototype._undestroy=c.undestroy,S.prototype._destroy=function(t,e){e(t)}}).call(this,r(10),r(8))},function(t,e,r){"use strict";t.exports=f;var i=r(26).codes,n=i.ERR_METHOD_NOT_IMPLEMENTED,o=i.ERR_MULTIPLE_CALLBACK,a=i.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=i.ERR_TRANSFORM_WITH_LENGTH_0,u=r(27);function h(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(null===i)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length>>32-e}function m(t,e,r,i,n,o,a,s){return p(t+(e^r^i)+o+a|0,s)+n|0}function g(t,e,r,i,n,o,a,s){return p(t+(e&r|~e&i)+o+a|0,s)+n|0}function b(t,e,r,i,n,o,a,s){return p(t+((e|~r)^i)+o+a|0,s)+n|0}function v(t,e,r,i,n,o,a,s){return p(t+(e&i|r&~i)+o+a|0,s)+n|0}function y(t,e,r,i,n,o,a,s){return p(t+(e^(r|~i))+o+a|0,s)+n|0}n(d,o),d.prototype._update=function(){for(var t=a,e=0;e<16;++e)t[e]=this._block.readInt32LE(4*e);for(var r=0|this._a,i=0|this._b,n=0|this._c,o=0|this._d,d=0|this._e,w=0|this._a,_=0|this._b,M=0|this._c,A=0|this._d,I=0|this._e,S=0;S<80;S+=1){var E,k;S<16?(E=m(r,i,n,o,d,t[s[S]],c[0],h[S]),k=y(w,_,M,A,I,t[u[S]],l[0],f[S])):S<32?(E=g(r,i,n,o,d,t[s[S]],c[1],h[S]),k=v(w,_,M,A,I,t[u[S]],l[1],f[S])):S<48?(E=b(r,i,n,o,d,t[s[S]],c[2],h[S]),k=b(w,_,M,A,I,t[u[S]],l[2],f[S])):S<64?(E=v(r,i,n,o,d,t[s[S]],c[3],h[S]),k=g(w,_,M,A,I,t[u[S]],l[3],f[S])):(E=y(r,i,n,o,d,t[s[S]],c[4],h[S]),k=m(w,_,M,A,I,t[u[S]],l[4],f[S])),r=d,d=o,o=p(n,10),n=i,i=E,w=I,I=A,A=p(M,10),M=_,_=k}var x=this._b+n+A|0;this._b=this._c+o+I|0,this._c=this._d+d+w|0,this._d=this._e+r+_|0,this._e=this._a+i+M|0,this._a=x},d.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 t=i.alloc?i.alloc(20):new i(20);return t.writeInt32LE(this._a,0),t.writeInt32LE(this._b,4),t.writeInt32LE(this._c,8),t.writeInt32LE(this._d,12),t.writeInt32LE(this._e,16),t},t.exports=d},function(t,e,r){(e=t.exports=function(t){t=t.toLowerCase();var r=e[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r}).sha=r(289),e.sha1=r(290),e.sha224=r(291),e.sha256=r(138),e.sha384=r(292),e.sha512=r(139)},function(t,e,r){var i=r(9),n=r(28),o=r(7).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,n.call(this,64,56)}function h(t,e,r){return r^t&(e^r)}function f(t,e,r){return t&e|r&(t|e)}function c(t){return(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10)}function l(t){return(t>>>6|t<<26)^(t>>>11|t<<21)^(t>>>25|t<<7)}function d(t){return(t>>>7|t<<25)^(t>>>18|t<<14)^t>>>3}i(u,n),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(t){for(var e,r=this._w,i=0|this._a,n=0|this._b,o=0|this._c,s=0|this._d,u=0|this._e,p=0|this._f,m=0|this._g,g=0|this._h,b=0;b<16;++b)r[b]=t.readInt32BE(4*b);for(;b<64;++b)r[b]=0|(((e=r[b-2])>>>17|e<<15)^(e>>>19|e<<13)^e>>>10)+r[b-7]+d(r[b-15])+r[b-16];for(var v=0;v<64;++v){var y=g+l(u)+h(u,p,m)+a[v]+r[v]|0,w=c(i)+f(i,n,o)|0;g=m,m=p,p=u,u=s+y|0,s=o,o=n,n=i,i=y+w|0}this._a=i+this._a|0,this._b=n+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=m+this._g|0,this._h=g+this._h|0},u.prototype._hash=function(){var t=o.allocUnsafe(32);return t.writeInt32BE(this._a,0),t.writeInt32BE(this._b,4),t.writeInt32BE(this._c,8),t.writeInt32BE(this._d,12),t.writeInt32BE(this._e,16),t.writeInt32BE(this._f,20),t.writeInt32BE(this._g,24),t.writeInt32BE(this._h,28),t},t.exports=u},function(t,e,r){var i=r(9),n=r(28),o=r(7).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,n.call(this,128,112)}function h(t,e,r){return r^t&(e^r)}function f(t,e,r){return t&e|r&(t|e)}function c(t,e){return(t>>>28|e<<4)^(e>>>2|t<<30)^(e>>>7|t<<25)}function l(t,e){return(t>>>14|e<<18)^(t>>>18|e<<14)^(e>>>9|t<<23)}function d(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^t>>>7}function p(t,e){return(t>>>1|e<<31)^(t>>>8|e<<24)^(t>>>7|e<<25)}function m(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^t>>>6}function g(t,e){return(t>>>19|e<<13)^(e>>>29|t<<3)^(t>>>6|e<<26)}function b(t,e){return t>>>0>>0?1:0}i(u,n),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(t){for(var e=this._w,r=0|this._ah,i=0|this._bh,n=0|this._ch,o=0|this._dh,s=0|this._eh,u=0|this._fh,v=0|this._gh,y=0|this._hh,w=0|this._al,_=0|this._bl,M=0|this._cl,A=0|this._dl,I=0|this._el,S=0|this._fl,E=0|this._gl,k=0|this._hl,x=0;x<32;x+=2)e[x]=t.readInt32BE(4*x),e[x+1]=t.readInt32BE(4*x+4);for(;x<160;x+=2){var B=e[x-30],C=e[x-30+1],T=d(B,C),P=p(C,B),R=m(B=e[x-4],C=e[x-4+1]),O=g(C,B),j=e[x-14],D=e[x-14+1],N=e[x-32],z=e[x-32+1],K=P+D|0,q=T+j+b(K,P)|0;q=(q=q+R+b(K=K+O|0,O)|0)+N+b(K=K+z|0,z)|0,e[x]=q,e[x+1]=K}for(var U=0;U<160;U+=2){q=e[U],K=e[U+1];var F=f(r,i,n),L=f(w,_,M),Q=c(r,w),H=c(w,r),V=l(s,I),Z=l(I,s),G=a[U],Y=a[U+1],W=h(s,u,v),J=h(I,S,E),X=k+Z|0,$=y+V+b(X,k)|0;$=($=($=$+W+b(X=X+J|0,J)|0)+G+b(X=X+Y|0,Y)|0)+q+b(X=X+K|0,K)|0;var tt=H+L|0,et=Q+F+b(tt,H)|0;y=v,k=E,v=u,E=S,u=s,S=I,s=o+$+b(I=A+X|0,A)|0,o=n,A=M,n=i,M=_,i=r,_=w,r=$+et+b(w=X+tt|0,X)|0}this._al=this._al+w|0,this._bl=this._bl+_|0,this._cl=this._cl+M|0,this._dl=this._dl+A|0,this._el=this._el+I|0,this._fl=this._fl+S|0,this._gl=this._gl+E|0,this._hl=this._hl+k|0,this._ah=this._ah+r+b(this._al,w)|0,this._bh=this._bh+i+b(this._bl,_)|0,this._ch=this._ch+n+b(this._cl,M)|0,this._dh=this._dh+o+b(this._dl,A)|0,this._eh=this._eh+s+b(this._el,I)|0,this._fh=this._fh+u+b(this._fl,S)|0,this._gh=this._gh+v+b(this._gl,E)|0,this._hh=this._hh+y+b(this._hl,k)|0},u.prototype._hash=function(){var t=o.allocUnsafe(64);function e(e,r,i){t.writeInt32BE(e,i),t.writeInt32BE(r,i+4)}return e(this._ah,this._al,0),e(this._bh,this._bl,8),e(this._ch,this._cl,16),e(this._dh,this._dl,24),e(this._eh,this._el,32),e(this._fh,this._fl,40),e(this._gh,this._gl,48),e(this._hh,this._hl,56),t},t.exports=u},function(t,e,r){var i=r(7).Buffer;t.exports=function(t,e,r){if(i.isBuffer(t))return t;if("string"===typeof t)return i.from(t,e);if(ArrayBuffer.isView(t))return i.from(t.buffer);throw new TypeError(r+" must be a string, a Buffer, a typed array or a DataView")}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,n={};e.wordlists=n,e._default=i;try{e._default=i=r(303),n.chinese_simplified=i}catch(o){}try{e._default=i=r(304),n.chinese_traditional=i}catch(o){}try{e._default=i=r(305),n.korean=i}catch(o){}try{e._default=i=r(306),n.french=i}catch(o){}try{e._default=i=r(307),n.italian=i}catch(o){}try{e._default=i=r(308),n.spanish=i}catch(o){}try{e._default=i=r(309),n.japanese=i,n.JA=i}catch(o){}try{e._default=i=r(310),n.english=i,n.EN=i}catch(o){}},function(t,e,r){"use strict";(function(e){var i="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n=r(311),o=r(317);function a(t){var e=t;if("string"!==typeof e)throw new Error("while padding to even, value must be string, is currently "+("undefined"===typeof e?"undefined":i(e))+", while padToEven.");return e.length%2&&(e="0"+e),e}t.exports=function(t){return t=function(t){if(!e.isBuffer(t))if(Array.isArray(t))t=e.from(t);else if("string"===typeof t)t=function(t,e){if("string"!==typeof t||!t.match(/^0x[0-9A-Fa-f]*$/))return!1;if(e&&t.length!==2+2*e)return!1;return!0}(t)?e.from(a(function(t){if("string"!==typeof t)return t;return function(t){if("string"!==typeof t)throw new Error("value must be type 'string', is currently type "+("undefined"===typeof t?"undefined":i(t))+", while checking isHexPrefixed.");return"0x"===t.slice(0,2)}(t)?t.slice(2):t}(t)),"hex"):e.from(t);else if("number"===typeof t)t=function(t){var r=function(t){return"0x"+t.toString(16)}(t);return e.from(a(r.slice(2)),"hex")}(t);else if(null===t||void 0===t)t=e.allocUnsafe(0);else if(o.isBN(t))t=t.toArrayLike(e);else{if(!t.toArray)throw new Error("invalid type");t=e.from(t.toArray())}return t}(t),n("keccak256").update(t).digest()}}).call(this,r(0).Buffer)},function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r=r||Promise)((function(n,o){function a(t){try{u(i.next(t))}catch(t){o(t)}}function s(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):((e=t.value)instanceof r?e:new r((function(t){t(e)}))).then(a,s)}u((i=i.apply(t,e||[])).next())}))},n=this&&this.__generator||function(t,e){var r,i,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,i&&(n=2&o[0]?i.return:o[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,o[1])).done)return n;switch(i=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(n=0<(n=a.trys).length&&n[n.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]n[0]&&o[1]>>> ",l,d),[4,e.findRoots(t.From,a.default.hexToCy(l),d)]);case 4:return p=n.sent(),console.log("result >>>> ",p),p&&(p.remain.isNeg()||p.remain.isZero())?(o.push.apply(o,p.utxos),[3,3]):[2,new Promise((function(t,e){e("no enough unlocked utxos")}))];case 5:return[2,new Promise((function(t){t(o)}))]}}))}))},e.buildTxParam=function(e,r){return i(this,void 0,void 0,(function(){var i,o,u,f,c,l,d,p,m,g,b,v,y;return n(this,(function(n){switch(n.label){case 0:return i=new Array,r.Utxos.forEach((function(t){i.push(t.Root)})),[4,e.getAnchor(i)];case 1:if(null===(o=n.sent()))throw new Error("can not find Anchor by root");if(u=new Array,f=0,c=new h(!1,r.Fee),r.Utxos.forEach((function(e,r){if(null===e.State)throw new Error("can not find out by root");c.AddIn(e.Asset),u.push({SKr:a.toString(t.alloc(96)),Out:{Root:e.Root,State:e.State},Witness:o[r]}),a.default.isNotNull(e.State.OS.Out_O)&&f++})),2500 2500");for(l=new Array,r.Receptions.forEach((function(e){c.AddOut(e.Asset),l.push({PKr:a.toHex(e.Addr),Asset:e.Asset,Memo:a.toString(t.alloc(64))})})),null!==r.Cmds&&null!==(d=new s(r.Cmds).OutAsset())&&c.AddOut(d),p=c.GetTknList(),m=c.GetTktList(),g=Math.max(p.length,m.length),b=0;bn[0]&&a[1]>> ",r.value[0],!1),m.set(r.value[0],!1)),r=e.next();console.error("======= fetchHandler error>>> ",t),z("Fetch Error:","string"==typeof t?t:t.message)})),w=(new Date).getTime()}t(),_=setInterval((function(){t()}),M)}(),t.data="success",R(t)},healthyCheck:function(t){var e=!1;w&&(e=(new Date).getTime()-w<6e4);var r=t.data;d.get(r).selectId(a.tables.syncInfo.name,1).then((function(i){t.data={health:e,latestSyncTime:w,isSyncing:m.get(r),latestBlock:i.CurrentBlock,currentBlock:b.get(r),pkrIndex:i.PkrIndex,startBlock:v.get(r),checkNilPercent:y.get(r)},R(t)})).catch((function(i){t.data={health:e,latestSyncTime:w,isSyncing:m.get(r),latestBlock:0,pkrIndex:1,currentBlock:0,startBlock:0,checkNilPercent:0},R(t)}))},initAccount:function(t){var e,r,i,n=t.data;n&&d&&!d.get(n)&&(e=1,s.isNewVersion(s.default.toBuffer(n))&&(e=2),r=f.createPkrHash(n,1,e),a.dbConfig.databaseName="popup_"+n,i=new o.PopDB(a.dbConfig),d.set(n,i),i.select(a.tables.syncInfo.name,{TK:n}).then((function(e){var o;e&&0!==e.length?(b.set(n,e[0].CurrentBlock),v.set(n,e[0].CurrentBlock)):(o={TK:n,PkrIndex:1,CurrentBlock:0,LastCombineBlock:0,UseHashPKr:!1,MainPKr:r,PKr:r},i.insert(a.tables.syncInfo.name,o).then((function(e){t.data="success"})).catch((function(e){console.log(e),t.error=e.message})),b.set(n,0),v.set(n,0)),y.set(n,0),R(t)})).catch((function(e){var o={TK:n,PkrIndex:1,CurrentBlock:0,LastCombineBlock:0,UseHashPKr:!1,MainPKr:r,PKr:r};i.insert(a.tables.syncInfo.name,o).then((function(e){t.data="success"})).catch((function(e){console.log(e),t.error=e.message})),b.set(n,0),v.set(n,0),R(t)})))},clearData:function(t){(function(t){return i(this,void 0,void 0,(function(){function e(e){return i(this,void 0,void 0,(function(){var r;return n(this,(function(i){switch(i.label){case 0:return[4,e.selectId(a.tables.syncInfo.name,1)];case 1:return r=i.sent(),!0!==m.get(r.TK)?[3,3]:[4,new Promise((function(t,e){e("Data synchronization ...")}))];case 2:return i.sent(),[3,15];case 3:return m.set(t,!0),p.delete(t),r.CurrentBlock=0,r.PKr=r.MainPKr,r.PkrIndex=1,r.UseHashPKr=!1,[4,e.update(a.tables.syncInfo.name,r)];case 4:return i.sent(),[4,e.clearTable(a.tables.utxo.name)];case 5:return i.sent(),[4,e.clearTable(a.tables.txBase.name)];case 6:return i.sent(),[4,e.clearTable(a.tables.assets.name)];case 7:return i.sent(),[4,e.clearTable(a.tables.assetUtxo.name)];case 8:return i.sent(),[4,e.clearTable(a.tables.tx.name)];case 9:return i.sent(),[4,e.clearTable(a.tables.nils.name)];case 10:return i.sent(),[4,e.clearTable(a.tables.txCurrency.name)];case 11:return i.sent(),[4,e.clearTable(a.tables.utxoTkt.name)];case 12:return i.sent(),[4,e.clearTable(a.tables.tickets.name)];case 13:return i.sent(),b.set(t,0),v.set(t,0),[4,new Promise((function(t){t("Clear Data Success !")}))];case 14:i.sent(),i.label=15;case 15:return[2]}}))}))}var r,o;return n(this,(function(i){switch(i.label){case 0:return t?[4,e(d.get(t))]:[3,2];case 1:return i.sent(),[3,5];case 2:r=d.entries(),o=r.next(),i.label=3;case 3:return o.done?[3,5]:[4,e(o.value[1])];case 4:return i.sent(),o=r.next(),[3,3];case 5:return[2]}}))}))})(t.data).then((function(e){console.log("data>>> ",e),m.clear(),t.data="Success",R(t)})).catch((function(e){console.log("data e>>> ",e),m.clear(),t.error=e,R(t)}))},findUtxos:function(t,e,r){},balanceOf:function(t){var e=t.data;function r(){d.get(e).selectAll(a.tables.assets.name).then((function(r){var i=new Map;r&&0> ",t)})).catch((function(t){console.error(t)})),u(c.Hash))}))]}}))}))})(e).then((function(e){console.log("_commitTx hash:",e),t.data=e,R(t)})).catch((function(e){console.error("_commitTx err:",e),t.error=e,R(t)}))}catch(e){t.error=e.message,R(t)}},getSeroPrice:function(t){var e=t.data;u.default.get("https://data.gateio.co/api2/1/ticker/"+e).then((function(e){var r;e&&e.data&&(r=e.data,t.data=r,R(t))})).catch((function(t){}))},getPendingAndConfirming:function(t){return i(this,void 0,void 0,(function(){var e;return n(this,(function(r){return e=t.data,g.has(e)?t.data=g.get(e):t.data=[],R(t),[2]}))}))}};function E(t){return i(this,void 0,void 0,(function(){var e,r,i,o,u,f,c,l,d,p,m,g,b,v,y;return n(this,(function(n){switch(n.label){case 0:return[4,t.selectAll(a.tables.utxo.name)];case 1:if(!((e=n.sent())&&0> ",{Root:l.Root,Value:s.Asset.Tkt.Value,Category:s.Asset.Tkt.Category}),[4,r.update(a.tables.tickets.name,{Root:l.Root,Value:s.Asset.Tkt.Value,Category:s.Asset.Tkt.Category})];case 9:n.sent(),n.label=10;case 10:return i++,[3,1];case 11:if(!(t.txInfos&&0b.get(t))&&b.set(t,j.Num),v.has(t)&&0!=v.get(t)||v.set(t,j.Num),z("("+i.pkrMain+") AddTx",JSON.stringify({Block:j.Num,TxHash:j.TxHash})),n.label=9;case 9:return[4,d.get(t).update(a.tables.txBase.name,R)];case 10:n.sent(),M=M.concat(P),n.label=11;case 11:return k++,[3,3];case 12:return A++,[3,2];case 13:for(N=0,U=M;Nn[0]&&a[1]n[0]&&a[1]0?a-4:a;for(r=0;r>16&255,u[f++]=e>>8&255,u[f++]=255&e;2===s&&(e=n[t.charCodeAt(r)]<<2|n[t.charCodeAt(r+1)]>>4,u[f++]=255&e);1===s&&(e=n[t.charCodeAt(r)]<<10|n[t.charCodeAt(r+1)]<<4|n[t.charCodeAt(r+2)]>>2,u[f++]=e>>8&255,u[f++]=255&e);return u},e.fromByteArray=function(t){for(var e,r=t.length,n=r%3,o=[],a=0,s=r-n;as?s:a+16383));1===n?(e=t[r-1],o.push(i[e>>2]+i[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],o.push(i[e>>10]+i[e>>4&63]+i[e<<2&63]+"="));return o.join("")};for(var i=[],n=[],o="undefined"!==typeof Uint8Array?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,u=a.length;s0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function f(t,e,r){for(var n,o,a=[],s=e;s>18&63]+i[o>>12&63]+i[o>>6&63]+i[63&o]);return a.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,i,n){var o,a,s=8*n-i-1,u=(1<>1,f=-7,c=r?n-1:0,l=r?-1:1,d=t[e+c];for(c+=l,o=d&(1<<-f)-1,d>>=-f,f+=s;f>0;o=256*o+t[e+c],c+=l,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=i;f>0;a=256*a+t[e+c],c+=l,f-=8);if(0===o)o=1-h;else{if(o===u)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,i),o-=h}return(d?-1:1)*a*Math.pow(2,o-i)},e.write=function(t,e,r,i,n,o){var a,s,u,h=8*o-n-1,f=(1<>1,l=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,p=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=f):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),(e+=a+c>=1?l/u:l*Math.pow(2,1-c))*u>=2&&(a++,u/=2),a+c>=f?(s=0,a=f):a+c>=1?(s=(e*u-1)*Math.pow(2,n),a+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,n),a=0));n>=8;t[r+d]=255&s,d+=p,s/=256,n-=8);for(a=a<0;t[r+d]=255&a,d+=p,a/=256,h-=8);t[r+d-p]|=128*m}},function(t,e){},function(t,e,r){"use strict";var i=r(7).Buffer;t.exports=function(t){if(t.length>=255)throw new TypeError("Alphabet too long");var e=new Uint8Array(256);e.fill(255);for(var r=0;r>>0,f=new Uint8Array(h);t[r];){var c=e[t.charCodeAt(r)];if(255===c)return;for(var l=0,d=h-1;(0!==c||l>>0,f[d]=c%256>>>0,c=c/256>>>0;if(0!==c)throw new Error("Non-zero carry");o=l,r++}if(" "!==t[r]){for(var p=h-o;p!==h&&0===f[p];)p++;var m=i.allocUnsafe(n+(h-p));m.fill(0,0,n);for(var g=n;p!==h;)m[g++]=f[p++];return m}}}return{encode:function(e){if(!i.isBuffer(e))throw new TypeError("Expected Buffer");if(0===e.length)return"";for(var r=0,n=0,o=0,u=e.length;o!==u&&0===e[o];)o++,r++;for(var f=(u-o)*h+1>>>0,c=new Uint8Array(f);o!==u;){for(var l=e[o],d=0,p=f-1;(0!==l||d>>0,c[p]=l%a>>>0,l=l/a>>>0;if(0!==l)throw new Error("Non-zero carry");n=d,o++}for(var m=f-n;m!==f&&0===c[m];)m++;for(var g=s.repeat(r);m=55296&&e<=56319&&n=55296&&t<=57343)throw Error("Lone surrogate U+"+t.toString(16).toUpperCase()+" is not a scalar value")}function s(t,e){return n(t>>e&63|128)}function u(t){if(0==(4294967168&t))return n(t);var e="";return 0==(4294965248&t)?e=n(t>>6&31|192):0==(4294901760&t)?(a(t),e=n(t>>12&15|224),e+=s(t,6)):0==(4292870144&t)&&(e=n(t>>18&7|240),e+=s(t,12),e+=s(t,6)),e+=n(63&t|128)}function h(){if(i>=r)throw Error("Invalid byte index");var t=255&e[i];if(i++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function f(){var t,n;if(i>r)throw Error("Invalid byte index");if(i==r)return!1;if(t=255&e[i],i++,0==(128&t))return t;if(192==(224&t)){if((n=(31&t)<<6|h())>=128)return n;throw Error("Invalid continuation byte")}if(224==(240&t)){if((n=(15&t)<<12|h()<<6|h())>=2048)return a(n),n;throw Error("Invalid continuation byte")}if(240==(248&t)&&(n=(7&t)<<18|h()<<12|h()<<6|h())>=65536&&n<=1114111)return n;throw Error("Invalid UTF-8 detected")}t.version="3.0.0",t.encode=function(t){for(var e=o(t),r=e.length,i=-1,n="";++i65535&&(o+=n((e-=65536)>>>10&1023|55296),e=56320|1023&e),o+=n(e);return o}(s)}}(e)},function(t,e,r){var i=r(156),n=r(69);t.exports=function(t){if("string"===typeof t||"number"===typeof t){var e=new i(1),r=String(t).toLowerCase().trim(),o="0x"===r.substr(0,2)||"-0x"===r.substr(0,3),a=n(r);if("-"===a.substr(0,1)&&(a=n(a.slice(1)),e=new i(-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 i(a,16).mul(e);if((a.match(/^-?[0-9]+$/)||""===a)&&!1===o)return new i(a,10).mul(e)}else if("object"===typeof t&&t.toString&&!t.pop&&!t.push&&t.toString(10).match(/^-?[0-9]+$/)&&(t.mul||t.dividedToIntegerBy))return new i(t.toString(10),10);throw new Error("[number-to-bn] while converting number "+JSON.stringify(t)+" 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(t,e,r){(function(t){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var a;"object"===typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{a=r(0).Buffer}catch(I){}function s(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o=49&&a<=54?a-49+10:a>=17&&a<=22?a-17+10:15&a}return i}function u(t,e,r,i){for(var n=0,o=Math.min(t.length,r),a=e;a=49?s-49+10:s>=17?s-17+10:s}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"===typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"===typeof t)return this._initNumber(t,e,r);if("object"===typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"===typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)a=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=a<>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)n=s(t,r,r+6),this.words[i]|=n<>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=s(t,e,r+6),this.words[i]|=n<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,a=o%i,s=Math.min(o,o-a)+r,h=0,f=r;f1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[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(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],a=n*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var h=1;h>>26,c=67108863&u,l=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=l;d++){var p=h-d|0;f+=(a=(n=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&a}r.words[h]=0|c,u=0|f}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,a=0;a>>24-n&16777215)||a!==this.length-1?h[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,a--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var l=f[t],d=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:h[l-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i("undefined"!==typeof a),this.toArrayLike(a,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var a,s,u="le"===e,h=new t(o),f=this.clone();if(u){for(s=0;!f.isZero();s++)a=f.andln(255),f.iushrn(8),h[s]=a;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0===(8191&e)&&(r+=13,e>>>=13),0===(127&e)&&(r+=7,e>>>=7),0===(15&e)&&(r+=4,e>>>=4),0===(3&e)&&(r+=2,e>>>=2),0===(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"===typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"===typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,a=0;a>26,this.words[a]=67108863&e;for(;0!==o&&a>26,this.words[a]=67108863&e;if(0===o&&a>>13,d=0|a[1],p=8191&d,m=d>>>13,g=0|a[2],b=8191&g,v=g>>>13,y=0|a[3],w=8191&y,_=y>>>13,M=0|a[4],A=8191&M,I=M>>>13,S=0|a[5],E=8191&S,k=S>>>13,x=0|a[6],B=8191&x,C=x>>>13,T=0|a[7],P=8191&T,R=T>>>13,O=0|a[8],j=8191&O,D=O>>>13,N=0|a[9],z=8191&N,K=N>>>13,q=0|s[0],U=8191&q,F=q>>>13,L=0|s[1],Q=8191&L,H=L>>>13,V=0|s[2],Z=8191&V,G=V>>>13,Y=0|s[3],W=8191&Y,J=Y>>>13,X=0|s[4],$=8191&X,tt=X>>>13,et=0|s[5],rt=8191&et,it=et>>>13,nt=0|s[6],ot=8191&nt,at=nt>>>13,st=0|s[7],ut=8191&st,ht=st>>>13,ft=0|s[8],ct=8191&ft,lt=ft>>>13,dt=0|s[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(h+(i=Math.imul(c,U))|0)+((8191&(n=(n=Math.imul(c,F))+Math.imul(l,U)|0))<<13)|0;h=((o=Math.imul(l,F))+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(p,U),n=(n=Math.imul(p,F))+Math.imul(m,U)|0,o=Math.imul(m,F);var bt=(h+(i=i+Math.imul(c,Q)|0)|0)+((8191&(n=(n=n+Math.imul(c,H)|0)+Math.imul(l,Q)|0))<<13)|0;h=((o=o+Math.imul(l,H)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(b,U),n=(n=Math.imul(b,F))+Math.imul(v,U)|0,o=Math.imul(v,F),i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,H)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,H)|0;var vt=(h+(i=i+Math.imul(c,Z)|0)|0)+((8191&(n=(n=n+Math.imul(c,G)|0)+Math.imul(l,Z)|0))<<13)|0;h=((o=o+Math.imul(l,G)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(w,U),n=(n=Math.imul(w,F))+Math.imul(_,U)|0,o=Math.imul(_,F),i=i+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,H)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,H)|0,i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,G)|0;var yt=(h+(i=i+Math.imul(c,W)|0)|0)+((8191&(n=(n=n+Math.imul(c,J)|0)+Math.imul(l,W)|0))<<13)|0;h=((o=o+Math.imul(l,J)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(A,U),n=(n=Math.imul(A,F))+Math.imul(I,U)|0,o=Math.imul(I,F),i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,H)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,H)|0,i=i+Math.imul(b,Z)|0,n=(n=n+Math.imul(b,G)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,G)|0,i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,J)|0;var wt=(h+(i=i+Math.imul(c,$)|0)|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(l,$)|0))<<13)|0;h=((o=o+Math.imul(l,tt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(E,U),n=(n=Math.imul(E,F))+Math.imul(k,U)|0,o=Math.imul(k,F),i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,H)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,H)|0,i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,G)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,G)|0,i=i+Math.imul(b,W)|0,n=(n=n+Math.imul(b,J)|0)+Math.imul(v,W)|0,o=o+Math.imul(v,J)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,tt)|0;var _t=(h+(i=i+Math.imul(c,rt)|0)|0)+((8191&(n=(n=n+Math.imul(c,it)|0)+Math.imul(l,rt)|0))<<13)|0;h=((o=o+Math.imul(l,it)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(B,U),n=(n=Math.imul(B,F))+Math.imul(C,U)|0,o=Math.imul(C,F),i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,H)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,H)|0,i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,G)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,G)|0,i=i+Math.imul(w,W)|0,n=(n=n+Math.imul(w,J)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,J)|0,i=i+Math.imul(b,$)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0;var Mt=(h+(i=i+Math.imul(c,ot)|0)|0)+((8191&(n=(n=n+Math.imul(c,at)|0)+Math.imul(l,ot)|0))<<13)|0;h=((o=o+Math.imul(l,at)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(P,U),n=(n=Math.imul(P,F))+Math.imul(R,U)|0,o=Math.imul(R,F),i=i+Math.imul(B,Q)|0,n=(n=n+Math.imul(B,H)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,H)|0,i=i+Math.imul(E,Z)|0,n=(n=n+Math.imul(E,G)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,G)|0,i=i+Math.imul(A,W)|0,n=(n=n+Math.imul(A,J)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,J)|0,i=i+Math.imul(w,$)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,tt)|0,i=i+Math.imul(b,rt)|0,n=(n=n+Math.imul(b,it)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,at)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,at)|0;var At=(h+(i=i+Math.imul(c,ut)|0)|0)+((8191&(n=(n=n+Math.imul(c,ht)|0)+Math.imul(l,ut)|0))<<13)|0;h=((o=o+Math.imul(l,ht)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(j,U),n=(n=Math.imul(j,F))+Math.imul(D,U)|0,o=Math.imul(D,F),i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,H)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,H)|0,i=i+Math.imul(B,Z)|0,n=(n=n+Math.imul(B,G)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,G)|0,i=i+Math.imul(E,W)|0,n=(n=n+Math.imul(E,J)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,J)|0,i=i+Math.imul(A,$)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,it)|0,i=i+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,at)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,at)|0,i=i+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0;var It=(h+(i=i+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,lt)|0)+Math.imul(l,ct)|0))<<13)|0;h=((o=o+Math.imul(l,lt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(z,U),n=(n=Math.imul(z,F))+Math.imul(K,U)|0,o=Math.imul(K,F),i=i+Math.imul(j,Q)|0,n=(n=n+Math.imul(j,H)|0)+Math.imul(D,Q)|0,o=o+Math.imul(D,H)|0,i=i+Math.imul(P,Z)|0,n=(n=n+Math.imul(P,G)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,G)|0,i=i+Math.imul(B,W)|0,n=(n=n+Math.imul(B,J)|0)+Math.imul(C,W)|0,o=o+Math.imul(C,J)|0,i=i+Math.imul(E,$)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,at)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,at)|0,i=i+Math.imul(b,ut)|0,n=(n=n+Math.imul(b,ht)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ht)|0,i=i+Math.imul(p,ct)|0,n=(n=n+Math.imul(p,lt)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,lt)|0;var St=(h+(i=i+Math.imul(c,pt)|0)|0)+((8191&(n=(n=n+Math.imul(c,mt)|0)+Math.imul(l,pt)|0))<<13)|0;h=((o=o+Math.imul(l,mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(z,Q),n=(n=Math.imul(z,H))+Math.imul(K,Q)|0,o=Math.imul(K,H),i=i+Math.imul(j,Z)|0,n=(n=n+Math.imul(j,G)|0)+Math.imul(D,Z)|0,o=o+Math.imul(D,G)|0,i=i+Math.imul(P,W)|0,n=(n=n+Math.imul(P,J)|0)+Math.imul(R,W)|0,o=o+Math.imul(R,J)|0,i=i+Math.imul(B,$)|0,n=(n=n+Math.imul(B,tt)|0)+Math.imul(C,$)|0,o=o+Math.imul(C,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,at)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,at)|0,i=i+Math.imul(w,ut)|0,n=(n=n+Math.imul(w,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0,i=i+Math.imul(b,ct)|0,n=(n=n+Math.imul(b,lt)|0)+Math.imul(v,ct)|0,o=o+Math.imul(v,lt)|0;var Et=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(z,Z),n=(n=Math.imul(z,G))+Math.imul(K,Z)|0,o=Math.imul(K,G),i=i+Math.imul(j,W)|0,n=(n=n+Math.imul(j,J)|0)+Math.imul(D,W)|0,o=o+Math.imul(D,J)|0,i=i+Math.imul(P,$)|0,n=(n=n+Math.imul(P,tt)|0)+Math.imul(R,$)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(B,rt)|0,n=(n=n+Math.imul(B,it)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,it)|0,i=i+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,at)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,at)|0,i=i+Math.imul(A,ut)|0,n=(n=n+Math.imul(A,ht)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ht)|0,i=i+Math.imul(w,ct)|0,n=(n=n+Math.imul(w,lt)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,lt)|0;var kt=(h+(i=i+Math.imul(b,pt)|0)|0)+((8191&(n=(n=n+Math.imul(b,mt)|0)+Math.imul(v,pt)|0))<<13)|0;h=((o=o+Math.imul(v,mt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,i=Math.imul(z,W),n=(n=Math.imul(z,J))+Math.imul(K,W)|0,o=Math.imul(K,J),i=i+Math.imul(j,$)|0,n=(n=n+Math.imul(j,tt)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,tt)|0,i=i+Math.imul(P,rt)|0,n=(n=n+Math.imul(P,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(B,ot)|0,n=(n=n+Math.imul(B,at)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,at)|0,i=i+Math.imul(E,ut)|0,n=(n=n+Math.imul(E,ht)|0)+Math.imul(k,ut)|0,o=o+Math.imul(k,ht)|0,i=i+Math.imul(A,ct)|0,n=(n=n+Math.imul(A,lt)|0)+Math.imul(I,ct)|0,o=o+Math.imul(I,lt)|0;var xt=(h+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,i=Math.imul(z,$),n=(n=Math.imul(z,tt))+Math.imul(K,$)|0,o=Math.imul(K,tt),i=i+Math.imul(j,rt)|0,n=(n=n+Math.imul(j,it)|0)+Math.imul(D,rt)|0,o=o+Math.imul(D,it)|0,i=i+Math.imul(P,ot)|0,n=(n=n+Math.imul(P,at)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,at)|0,i=i+Math.imul(B,ut)|0,n=(n=n+Math.imul(B,ht)|0)+Math.imul(C,ut)|0,o=o+Math.imul(C,ht)|0,i=i+Math.imul(E,ct)|0,n=(n=n+Math.imul(E,lt)|0)+Math.imul(k,ct)|0,o=o+Math.imul(k,lt)|0;var Bt=(h+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,mt)|0)+Math.imul(I,pt)|0))<<13)|0;h=((o=o+Math.imul(I,mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,i=Math.imul(z,rt),n=(n=Math.imul(z,it))+Math.imul(K,rt)|0,o=Math.imul(K,it),i=i+Math.imul(j,ot)|0,n=(n=n+Math.imul(j,at)|0)+Math.imul(D,ot)|0,o=o+Math.imul(D,at)|0,i=i+Math.imul(P,ut)|0,n=(n=n+Math.imul(P,ht)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ht)|0,i=i+Math.imul(B,ct)|0,n=(n=n+Math.imul(B,lt)|0)+Math.imul(C,ct)|0,o=o+Math.imul(C,lt)|0;var Ct=(h+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,mt)|0)+Math.imul(k,pt)|0))<<13)|0;h=((o=o+Math.imul(k,mt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,i=Math.imul(z,ot),n=(n=Math.imul(z,at))+Math.imul(K,ot)|0,o=Math.imul(K,at),i=i+Math.imul(j,ut)|0,n=(n=n+Math.imul(j,ht)|0)+Math.imul(D,ut)|0,o=o+Math.imul(D,ht)|0,i=i+Math.imul(P,ct)|0,n=(n=n+Math.imul(P,lt)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,lt)|0;var Tt=(h+(i=i+Math.imul(B,pt)|0)|0)+((8191&(n=(n=n+Math.imul(B,mt)|0)+Math.imul(C,pt)|0))<<13)|0;h=((o=o+Math.imul(C,mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(z,ut),n=(n=Math.imul(z,ht))+Math.imul(K,ut)|0,o=Math.imul(K,ht),i=i+Math.imul(j,ct)|0,n=(n=n+Math.imul(j,lt)|0)+Math.imul(D,ct)|0,o=o+Math.imul(D,lt)|0;var Pt=(h+(i=i+Math.imul(P,pt)|0)|0)+((8191&(n=(n=n+Math.imul(P,mt)|0)+Math.imul(R,pt)|0))<<13)|0;h=((o=o+Math.imul(R,mt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(z,ct),n=(n=Math.imul(z,lt))+Math.imul(K,ct)|0,o=Math.imul(K,lt);var Rt=(h+(i=i+Math.imul(j,pt)|0)|0)+((8191&(n=(n=n+Math.imul(j,mt)|0)+Math.imul(D,pt)|0))<<13)|0;h=((o=o+Math.imul(D,mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863;var Ot=(h+(i=Math.imul(z,pt))|0)+((8191&(n=(n=Math.imul(z,mt))+Math.imul(K,pt)|0))<<13)|0;return h=((o=Math.imul(K,mt))+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,u[0]=gt,u[1]=bt,u[2]=vt,u[3]=yt,u[4]=wt,u[5]=_t,u[6]=Mt,u[7]=At,u[8]=It,u[9]=St,u[10]=Et,u[11]=kt,u[12]=xt,u[13]=Bt,u[14]=Ct,u[15]=Tt,u[16]=Pt,u[17]=Rt,u[18]=Ot,0!==h&&(u[19]=h,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=l),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?l(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,a&=67108863}r.words[o]=s,i=a,a=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},m.prototype.permute=function(t,e,r,i,n,o){for(var a=0;a