Code Duplication    Length = 1-1 lines in 2 locations

build/blocktrail-sdk.min.js 2 locations

@@ 8-8 (lines=1) @@
5
}function h(a){a.b=i(a).concat(i(a)),a.F=new m.cipher.aes(a.b)}function i(a){for(var b=0;4>b&&(a.i[b]=a.i[b]+1|0,!a.i[b]);b++);return a.F.encrypt(a.i)}function j(a,b){return function(){b.apply(a,arguments)}}var k=void 0,l=!1,m={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(a){this.toString=function(){return"CORRUPT: "+this.message},this.message=a},invalid:function(a){this.toString=function(){return"INVALID: "+this.message},this.message=a},bug:function(a){this.toString=function(){return"BUG: "+this.message},this.message=a},notReady:function(a){this.toString=function(){return"NOT READY: "+this.message},this.message=a}}};"undefined"!=typeof b&&b.exports&&(b.exports=m),"function"==typeof define&&define([],function(){return m}),m.cipher.aes=function(a){this.o[0][0][0]||this.t();var b,c,e,f,g=this.o[0][4],h=this.o[1];b=a.length;var i=1;for(4!==b&&6!==b&&8!==b&&d(new m.exception.invalid("invalid aes key size")),this.b=[e=a.slice(0),f=[]],a=b;a<4*b+28;a++)c=e[a-1],(0===a%b||8===b&&4===a%b)&&(c=g[c>>>24]<<24^g[c>>16&255]<<16^g[c>>8&255]<<8^g[255&c],0===a%b&&(c=c<<8^c>>>24^i<<24,i=i<<1^283*(i>>7))),e[a]=e[a-b]^c;for(b=0;a;b++,a--)c=e[3&b?a:a-4],f[b]=4>=a||4>b?c:h[0][g[c>>>24]]^h[1][g[c>>16&255]]^h[2][g[c>>8&255]]^h[3][g[255&c]]},m.cipher.aes.prototype={encrypt:function(a){return e(this,a,0)},decrypt:function(a){return e(this,a,1)},o:[[[],[],[],[],[]],[[],[],[],[],[]]],t:function(){var a,b,c,d,e,f,g,h=this.o[0],i=this.o[1],j=h[4],k=i[4],l=[],m=[];for(a=0;256>a;a++)m[(l[a]=a<<1^283*(a>>7))^a]=a;for(b=c=0;!j[b];b^=d||1,c=m[c]||1)for(f=c^c<<1^c<<2^c<<3^c<<4,f=f>>8^255&f^99,j[b]=f,k[f]=b,e=l[a=l[d=l[b]]],g=16843009*e^65537*a^257*d^16843008*b,e=257*l[f]^16843008*f,a=0;4>a;a++)h[a][b]=e=e<<24^e>>>8,i[a][f]=g=g<<24^g>>>8;for(a=0;5>a;a++)h[a]=h[a].slice(0),i[a]=i[a].slice(0)}},m.bitArray={bitSlice:function(a,b,c){return a=m.bitArray.R(a.slice(b/32),32-(31&b)).slice(1),c===k?a:m.bitArray.clamp(a,c-b)},extract:function(a,b,c){var d=Math.floor(-b-c&31);return((b+c-1^b)&-32?a[b/32|0]<<32-d^a[b/32+1|0]>>>d:a[b/32|0]>>>d)&(1<<c)-1},concat:function(a,b){if(0===a.length||0===b.length)return a.concat(b);var c=a[a.length-1],d=m.bitArray.getPartial(c);return 32===d?a.concat(b):m.bitArray.R(b,d,0|c,a.slice(0,a.length-1))},bitLength:function(a){var b=a.length;return 0===b?0:32*(b-1)+m.bitArray.getPartial(a[b-1])},clamp:function(a,b){if(32*a.length<b)return a;a=a.slice(0,Math.ceil(b/32));var c=a.length;return b&=31,0<c&&b&&(a[c-1]=m.bitArray.partial(b,a[c-1]&2147483648>>b-1,1)),a},partial:function(a,b,c){return 32===a?b:(c?0|b:b<<32-a)+1099511627776*a},getPartial:function(a){return Math.round(a/1099511627776)||32},equal:function(a,b){if(m.bitArray.bitLength(a)!==m.bitArray.bitLength(b))return l;var c,d=0;for(c=0;c<a.length;c++)d|=a[c]^b[c];return 0===d},R:function(a,b,c,d){var e;for(e=0,d===k&&(d=[]);32<=b;b-=32)d.push(c),c=0;if(0===b)return d.concat(a);for(e=0;e<a.length;e++)d.push(c|a[e]>>>b),c=a[e]<<32-b;return e=a.length?a[a.length-1]:0,a=m.bitArray.getPartial(e),d.push(m.bitArray.partial(b+a&31,32<b+a?c:d.pop(),1)),d},j:function(a,b){return[a[0]^b[0],a[1]^b[1],a[2]^b[2],a[3]^b[3]]},byteswapM:function(a){var b,c;for(b=0;b<a.length;++b)c=a[b],a[b]=c>>>24|c>>>8&65280|(65280&c)<<8|c<<24;return a}},m.codec.utf8String={fromBits:function(a){var b,c,d="",e=m.bitArray.bitLength(a);for(b=0;b<e/8;b++)0===(3&b)&&(c=a[b/4]),d+=String.fromCharCode(c>>>24),c<<=8;return decodeURIComponent(escape(d))},toBits:function(a){a=unescape(encodeURIComponent(a));var b,c=[],d=0;for(b=0;b<a.length;b++)d=d<<8|a.charCodeAt(b),3===(3&b)&&(c.push(d),d=0);return 3&b&&c.push(m.bitArray.partial(8*(3&b),d)),c}},m.codec.hex={fromBits:function(a){var b,c="";for(b=0;b<a.length;b++)c+=((0|a[b])+0xf00000000000).toString(16).substr(4);return c.substr(0,m.bitArray.bitLength(a)/4)},toBits:function(a){var b,c,d=[];for(a=a.replace(/\s|0x/g,""),c=a.length,a+="00000000",b=0;b<a.length;b+=8)d.push(0^parseInt(a.substr(b,8),16));return m.bitArray.clamp(d,4*c)}},m.codec.base64={M:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fromBits:function(a,b,c){var d="",e=0,f=m.codec.base64.M,g=0,h=m.bitArray.bitLength(a);for(c&&(f=f.substr(0,62)+"-_"),c=0;6*d.length<h;)d+=f.charAt((g^a[c]>>>e)>>>26),6>e?(g=a[c]<<6-e,e+=26,c++):(g<<=6,e-=6);for(;3&d.length&&!b;)d+="=";return d},toBits:function(a,b){a=a.replace(/\s|=/g,"");var c,e,f=[],g=0,h=m.codec.base64.M,i=0;for(b&&(h=h.substr(0,62)+"-_"),c=0;c<a.length;c++)e=h.indexOf(a.charAt(c)),0>e&&d(new m.exception.invalid("this isn't base64!")),26<g?(g-=26,f.push(i^e>>>g),i=e<<32-g):(g+=6,i^=e<<32-g);return 56&g&&f.push(m.bitArray.partial(56&g,i,1)),f}},m.codec.base64url={fromBits:function(a){return m.codec.base64.fromBits(a,1,1)},toBits:function(a){return m.codec.base64.toBits(a,1)}},m.hash.sha256=function(a){this.b[0]||this.t(),a?(this.e=a.e.slice(0),this.d=a.d.slice(0),this.c=a.c):this.reset()},m.hash.sha256.hash=function(a){return(new m.hash.sha256).update(a).finalize()},m.hash.sha256.prototype={blockSize:512,reset:function(){return this.e=this.l.slice(0),this.d=[],this.c=0,this},update:function(a){"string"==typeof a&&(a=m.codec.utf8String.toBits(a));var b,c=this.d=m.bitArray.concat(this.d,a);for(b=this.c,a=this.c=b+m.bitArray.bitLength(a),b=512+b&-512;b<=a;b+=512)this.r(c.splice(0,16));return this},finalize:function(){var a,b=this.d,c=this.e,b=m.bitArray.concat(b,[m.bitArray.partial(1,1)]);for(a=b.length+2;15&a;a++)b.push(0);for(b.push(Math.floor(this.c/4294967296)),b.push(0|this.c);b.length;)this.r(b.splice(0,16));return this.reset(),c},l:[],b:[],t:function(){function a(a){return 4294967296*(a-Math.floor(a))|0}var b,c=0,d=2;a:for(;64>c;d++){for(b=2;b*b<=d;b++)if(0===d%b)continue a;8>c&&(this.l[c]=a(Math.pow(d,.5))),this.b[c]=a(Math.pow(d,1/3)),c++}},r:function(a){var b,c,d=a.slice(0),e=this.e,f=this.b,g=e[0],h=e[1],i=e[2],j=e[3],k=e[4],l=e[5],m=e[6],n=e[7];for(a=0;64>a;a++)16>a?b=d[a]:(b=d[a+1&15],c=d[a+14&15],b=d[15&a]=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(c>>>17^c>>>19^c>>>10^c<<15^c<<13)+d[15&a]+d[a+9&15]|0),b=b+n+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(m^k&(l^m))+f[a],n=m,m=l,l=k,k=j+b|0,j=i,i=h,h=g,g=b+(h&i^j&(h^i))+(h>>>2^h>>>13^h>>>22^h<<30^h<<19^h<<10)|0;e[0]=e[0]+g|0,e[1]=e[1]+h|0,e[2]=e[2]+i|0,e[3]=e[3]+j|0,e[4]=e[4]+k|0,e[5]=e[5]+l|0,e[6]=e[6]+m|0,e[7]=e[7]+n|0}},m.hash.sha512=function(a){this.b[0]||this.t(),a?(this.e=a.e.slice(0),this.d=a.d.slice(0),this.c=a.c):this.reset()},m.hash.sha512.hash=function(a){return(new m.hash.sha512).update(a).finalize()},m.hash.sha512.prototype={blockSize:1024,reset:function(){return this.e=this.l.slice(0),this.d=[],this.c=0,this},update:function(a){"string"==typeof a&&(a=m.codec.utf8String.toBits(a));var b,c=this.d=m.bitArray.concat(this.d,a);for(b=this.c,a=this.c=b+m.bitArray.bitLength(a),b=1024+b&-1024;b<=a;b+=1024)this.r(c.splice(0,32));return this},finalize:function(){var a,b=this.d,c=this.e,b=m.bitArray.concat(b,[m.bitArray.partial(1,1)]);for(a=b.length+4;31&a;a++)b.push(0);for(b.push(0),b.push(0),b.push(Math.floor(this.c/4294967296)),b.push(0|this.c);b.length;)this.r(b.splice(0,32));return this.reset(),c},l:[],ca:[12372232,13281083,9762859,1914609,15106769,4090911,4308331,8266105],b:[],ea:[2666018,15689165,5061423,9034684,4764984,380953,1658779,7176472,197186,7368638,14987916,16757986,8096111,1480369,13046325,6891156,15813330,5187043,9229749,11312229,2818677,10937475,4324308,1135541,6741931,11809296,16458047,15666916,11046850,698149,229999,945776,13774844,2541862,12856045,9810911,11494366,7844520,15576806,8533307,15795044,4337665,16291729,5553712,15684120,6662416,7413802,12308920,13816008,4303699,9366425,10176680,13195875,4295371,6546291,11712675,15708924,1519456,15772530,6568428,6495784,8568297,13007125,7492395,2515356,12632583,14740254,7262584,1535930,13146278,16321966,1853211,294276,13051027,13221564,1051980,4080310,6651434,14088940,4675607],t:function(){function a(a){return 4294967296*(a-Math.floor(a))|0}function b(a){return 1099511627776*(a-Math.floor(a))&255}var c,d=0,e=2;a:for(;80>d;e++){for(c=2;c*c<=e;c++)if(0===e%c)continue a;8>d&&(this.l[2*d]=a(Math.pow(e,.5)),this.l[2*d+1]=b(Math.pow(e,.5))<<24|this.ca[d]),this.b[2*d]=a(Math.pow(e,1/3)),this.b[2*d+1]=b(Math.pow(e,1/3))<<24|this.ea[d],d++}},r:function(a){var b,c,d=a.slice(0),e=this.e,f=this.b,g=e[0],h=e[1],i=e[2],j=e[3],k=e[4],l=e[5],m=e[6],n=e[7],o=e[8],p=e[9],q=e[10],r=e[11],s=e[12],t=e[13],u=e[14],v=e[15],w=g,x=h,y=i,z=j,A=k,B=l,C=m,D=n,E=o,F=p,G=q,H=r,I=s,J=t,K=u,L=v;for(a=0;80>a;a++){if(16>a)b=d[2*a],c=d[2*a+1];else{c=d[2*(a-15)];var M=d[2*(a-15)+1];b=(M<<31|c>>>1)^(M<<24|c>>>8)^c>>>7;var N=(c<<31|M>>>1)^(c<<24|M>>>8)^(c<<25|M>>>7);c=d[2*(a-2)];var O=d[2*(a-2)+1],M=(O<<13|c>>>19)^(c<<3|O>>>29)^c>>>6,O=(c<<13|O>>>19)^(O<<3|c>>>29)^(c<<26|O>>>6),P=d[2*(a-7)],Q=d[2*(a-16)],R=d[2*(a-16)+1];c=N+d[2*(a-7)+1],b=b+P+(c>>>0<N>>>0?1:0),c+=O,b+=M+(c>>>0<O>>>0?1:0),c+=R,b+=Q+(c>>>0<R>>>0?1:0)}d[2*a]=b|=0,d[2*a+1]=c|=0;var P=E&G^~E&I,S=F&H^~F&J,O=w&y^w&A^y&A,T=x&z^x&B^z&B,Q=(x<<4|w>>>28)^(w<<30|x>>>2)^(w<<25|x>>>7),R=(w<<4|x>>>28)^(x<<30|w>>>2)^(x<<25|w>>>7),U=f[2*a],V=f[2*a+1],M=L+((E<<18|F>>>14)^(E<<14|F>>>18)^(F<<23|E>>>9)),N=K+((F<<18|E>>>14)^(F<<14|E>>>18)^(E<<23|F>>>9))+(M>>>0<L>>>0?1:0),M=M+S,N=N+(P+(M>>>0<S>>>0?1:0)),M=M+V,N=N+(U+(M>>>0<V>>>0?1:0)),M=M+c|0,N=N+(b+(M>>>0<c>>>0?1:0));c=R+T,b=Q+O+(c>>>0<R>>>0?1:0),K=I,L=J,I=G,J=H,G=E,H=F,F=D+M|0,E=C+N+(F>>>0<D>>>0?1:0)|0,C=A,D=B,A=y,B=z,y=w,z=x,x=M+c|0,w=N+b+(x>>>0<M>>>0?1:0)|0}h=e[1]=h+x|0,e[0]=g+w+(h>>>0<x>>>0?1:0)|0,j=e[3]=j+z|0,e[2]=i+y+(j>>>0<z>>>0?1:0)|0,l=e[5]=l+B|0,e[4]=k+A+(l>>>0<B>>>0?1:0)|0,n=e[7]=n+D|0,e[6]=m+C+(n>>>0<D>>>0?1:0)|0,p=e[9]=p+F|0,e[8]=o+E+(p>>>0<F>>>0?1:0)|0,r=e[11]=r+H|0,e[10]=q+G+(r>>>0<H>>>0?1:0)|0,t=e[13]=t+J|0,e[12]=s+I+(t>>>0<J>>>0?1:0)|0,v=e[15]=v+L|0,e[14]=u+K+(v>>>0<L>>>0?1:0)|0}},m.mode.ccm={name:"ccm",w:[],listenProgress:function(a){m.mode.ccm.w.push(a)},unListenProgress:function(a){a=m.mode.ccm.w.indexOf(a),-1<a&&m.mode.ccm.w.splice(a,1)},X:function(a){var b,c=m.mode.ccm.w.slice();for(b=0;b<c.length;b+=1)c[b](a)},encrypt:function(a,b,c,e,f){var g,h=b.slice(0),i=m.bitArray,j=i.bitLength(c)/8,k=i.bitLength(h)/8;for(f=f||64,e=e||[],7>j&&d(new m.exception.invalid("ccm: iv must be at least 7 bytes")),g=2;4>g&&k>>>8*g;g++);return g<15-j&&(g=15-j),c=i.clamp(c,8*(15-g)),b=m.mode.ccm.O(a,b,c,e,f,g),h=m.mode.ccm.s(a,h,c,b,f,g),i.concat(h.data,h.tag)},decrypt:function(a,b,c,e,f){f=f||64,e=e||[];var g=m.bitArray,h=g.bitLength(c)/8,i=g.bitLength(b),j=g.clamp(b,i-f),k=g.bitSlice(b,i-f),i=(i-f)/8;for(7>h&&d(new m.exception.invalid("ccm: iv must be at least 7 bytes")),b=2;4>b&&i>>>8*b;b++);return b<15-h&&(b=15-h),c=g.clamp(c,8*(15-b)),j=m.mode.ccm.s(a,j,c,k,f,b),a=m.mode.ccm.O(a,j.data,c,e,f,b),g.equal(j.tag,a)||d(new m.exception.corrupt("ccm: tag doesn't match")),j.data},ga:function(a,b,c,d,e,f){var g=[],h=m.bitArray,i=h.j;if(d=[h.partial(8,(b.length?64:0)|d-2<<2|f-1)],d=h.concat(d,c),d[3]|=e,d=a.encrypt(d),b.length)for(c=h.bitLength(b)/8,65279>=c?g=[h.partial(16,c)]:4294967295>=c&&(g=h.concat([h.partial(16,65534)],[c])),g=h.concat(g,b),b=0;b<g.length;b+=4)d=a.encrypt(i(d,g.slice(b,b+4).concat([0,0,0])));return d},O:function(a,b,c,e,f,g){var h=m.bitArray,i=h.j;for(f/=8,(f%2||4>f||16<f)&&d(new m.exception.invalid("ccm: invalid tag length")),(4294967295<e.length||4294967295<b.length)&&d(new m.exception.bug("ccm: can't deal with 4GiB or more data")),c=m.mode.ccm.ga(a,e,c,f,h.bitLength(b)/8,g),e=0;e<b.length;e+=4)c=a.encrypt(i(c,b.slice(e,e+4).concat([0,0,0])));return h.clamp(c,8*f)},s:function(a,b,c,d,e,f){var g,h=m.bitArray;g=h.j;var i=b.length,j=h.bitLength(b),k=i/50,l=k;if(c=h.concat([h.partial(8,f-1)],c).concat([0,0,0]).slice(0,4),d=h.bitSlice(g(d,a.encrypt(c)),0,e),!i)return{tag:d,data:[]};for(g=0;g<i;g+=4)g>k&&(m.mode.ccm.X(g/i),k+=l),c[3]++,e=a.encrypt(c),b[g]^=e[0],b[g+1]^=e[1],b[g+2]^=e[2],b[g+3]^=e[3];return{tag:d,data:h.clamp(b,j)}}},m.mode.ocb2={name:"ocb2",encrypt:function(a,b,c,e,f,g){128!==m.bitArray.bitLength(c)&&d(new m.exception.invalid("ocb iv must be 128 bits"));var h,i=m.mode.ocb2.K,j=m.bitArray,k=j.j,l=[0,0,0,0];c=i(a.encrypt(c));var n,o=[];for(e=e||[],f=f||64,h=0;h+4<b.length;h+=4)n=b.slice(h,h+4),l=k(l,n),o=o.concat(k(c,a.encrypt(k(c,n)))),c=i(c);return n=b.slice(h),b=j.bitLength(n),h=a.encrypt(k(c,[0,0,0,b])),n=j.clamp(k(n.concat([0,0,0]),h),b),l=k(l,k(n.concat([0,0,0]),h)),l=a.encrypt(k(l,k(c,i(c)))),e.length&&(l=k(l,g?e:m.mode.ocb2.pmac(a,e))),o.concat(j.concat(n,j.clamp(l,f)))},decrypt:function(a,b,c,e,f,g){128!==m.bitArray.bitLength(c)&&d(new m.exception.invalid("ocb iv must be 128 bits")),f=f||64;var h,i,j=m.mode.ocb2.K,k=m.bitArray,l=k.j,n=[0,0,0,0],o=j(a.encrypt(c)),p=m.bitArray.bitLength(b)-f,q=[];for(e=e||[],c=0;c+4<p/32;c+=4)h=l(o,a.decrypt(l(o,b.slice(c,c+4)))),n=l(n,h),q=q.concat(h),o=j(o);return i=p-32*c,h=a.encrypt(l(o,[0,0,0,i])),h=l(h,k.clamp(b.slice(c),i).concat([0,0,0])),n=l(n,h),n=a.encrypt(l(n,l(o,j(o)))),e.length&&(n=l(n,g?e:m.mode.ocb2.pmac(a,e))),k.equal(k.clamp(n,f),k.bitSlice(b,p))||d(new m.exception.corrupt("ocb: tag doesn't match")),q.concat(k.clamp(h,i))},pmac:function(a,b){var c,d=m.mode.ocb2.K,e=m.bitArray,f=e.j,g=[0,0,0,0],h=a.encrypt([0,0,0,0]),h=f(h,d(d(h)));for(c=0;c+4<b.length;c+=4)h=d(h),g=f(g,a.encrypt(f(h,b.slice(c,c+4))));return c=b.slice(c),128>e.bitLength(c)&&(h=f(h,d(h)),c=e.concat(c,[-2147483648,0,0,0])),g=f(g,c),a.encrypt(f(d(f(h,d(h))),g))},K:function(a){return[a[0]<<1^a[1]>>>31,a[1]<<1^a[2]>>>31,a[2]<<1^a[3]>>>31,a[3]<<1^135*(a[0]>>>31)]}},m.mode.gcm={name:"gcm",encrypt:function(a,b,c,d,e){var f=b.slice(0);return b=m.bitArray,d=d||[],a=m.mode.gcm.s(!0,a,f,d,c,e||128),b.concat(a.data,a.tag)},decrypt:function(a,b,c,e,f){var g=b.slice(0),h=m.bitArray,i=h.bitLength(g);return f=f||128,e=e||[],f<=i?(b=h.bitSlice(g,i-f),g=h.bitSlice(g,0,i-f)):(b=g,g=[]),a=m.mode.gcm.s(l,a,g,e,c,f),h.equal(a.tag,b)||d(new m.exception.corrupt("gcm: tag doesn't match")),a.data},ba:function(a,b){var c,d,e,f,g,h=m.bitArray.j;for(e=[0,0,0,0],f=b.slice(0),c=0;128>c;c++){for((d=0!==(a[Math.floor(c/32)]&1<<31-c%32))&&(e=h(e,f)),g=0!==(1&f[3]),d=3;0<d;d--)f[d]=f[d]>>>1|(1&f[d-1])<<31;f[0]>>>=1,g&&(f[0]^=-520093696)}return e},k:function(a,b,c){var d,e=c.length;for(b=b.slice(0),d=0;d<e;d+=4)b[0]^=4294967295&c[d],b[1]^=4294967295&c[d+1],b[2]^=4294967295&c[d+2],b[3]^=4294967295&c[d+3],b=m.mode.gcm.ba(b,a);return b},s:function(a,b,c,d,e,f){var g,h,i,j,k,l,n,o,p=m.bitArray;for(l=c.length,n=p.bitLength(c),o=p.bitLength(d),h=p.bitLength(e),g=b.encrypt([0,0,0,0]),96===h?(e=e.slice(0),e=p.concat(e,[1])):(e=m.mode.gcm.k(g,[0,0,0,0],e),e=m.mode.gcm.k(g,e,[0,0,Math.floor(h/4294967296),4294967295&h])),h=m.mode.gcm.k(g,[0,0,0,0],d),k=e.slice(0),d=h.slice(0),a||(d=m.mode.gcm.k(g,h,c)),j=0;j<l;j+=4)k[3]++,i=b.encrypt(k),c[j]^=i[0],c[j+1]^=i[1],c[j+2]^=i[2],c[j+3]^=i[3];return c=p.clamp(c,n),a&&(d=m.mode.gcm.k(g,h,c)),a=[Math.floor(o/4294967296),4294967295&o,Math.floor(n/4294967296),4294967295&n],d=m.mode.gcm.k(g,d,a),i=b.encrypt(e),d[0]^=i[0],d[1]^=i[1],d[2]^=i[2],d[3]^=i[3],{tag:p.bitSlice(d,0,f),data:c}}},m.misc.hmac=function(a,b){this.P=b=b||m.hash.sha256;var c,d=[[],[]],e=b.prototype.blockSize/32;for(this.q=[new b,new b],a.length>e&&(a=b.hash(a)),c=0;c<e;c++)d[0][c]=909522486^a[c],d[1][c]=1549556828^a[c];this.q[0].update(d[0]),this.q[1].update(d[1]),this.J=new b(this.q[0])},m.misc.hmac.prototype.encrypt=m.misc.hmac.prototype.mac=function(a){return this.S&&d(new m.exception.invalid("encrypt on already updated hmac called!")),this.update(a),this.digest(a)},m.misc.hmac.prototype.reset=function(){this.J=new this.P(this.q[0]),this.S=l},m.misc.hmac.prototype.update=function(a){this.S=!0,this.J.update(a)},m.misc.hmac.prototype.digest=function(){var a=this.J.finalize(),a=new this.P(this.q[1]).update(a).finalize();return this.reset(),a},m.misc.pbkdf2=function(a,b,c,e,f){c=c||1e3,(0>e||0>c)&&d(m.exception.invalid("invalid params to pbkdf2")),"string"==typeof a&&(a=m.codec.utf8String.toBits(a)),"string"==typeof b&&(b=m.codec.utf8String.toBits(b)),f=f||m.misc.hmac,a=new f(a);var g,h,i,j,k=[],l=m.bitArray;for(j=1;32*k.length<(e||1);j++){for(f=g=a.encrypt(l.concat(b,[j])),h=1;h<c;h++)for(g=a.encrypt(g),i=0;i<g.length;i++)f[i]^=g[i];k=k.concat(f)}return e&&(k=l.clamp(k,e)),k},m.prng=function(a){this.f=[new m.hash.sha256],this.m=[0],this.I=0,this.A={},this.H=0,this.N={},this.Q=this.g=this.n=this.Z=0,this.b=[0,0,0,0,0,0,0,0],this.i=[0,0,0,0],this.F=k,this.G=a,this.u=l,this.D={progress:{},seeded:{}},this.p=this.Y=0,this.B=1,this.C=2,this.U=65536,this.L=[0,48,64,96,128,192,256,384,512,768,1024],this.V=3e4,this.T=80},m.prng.prototype={randomWords:function(a,b){var c,e=[];c=this.isReady(b);var f;if(c===this.p&&d(new m.exception.notReady("generator isn't seeded")),c&this.C){c=!(c&this.B),f=[];var g,j=0;for(this.Q=f[0]=(new Date).valueOf()+this.V,g=0;16>g;g++)f.push(4294967296*Math.random()|0);for(g=0;g<this.f.length&&(f=f.concat(this.f[g].finalize()),j+=this.m[g],this.m[g]=0,!(!c&&this.I&1<<g));g++);for(this.I>=1<<this.f.length&&(this.f.push(new m.hash.sha256),this.m.push(0)),this.g-=j,j>this.n&&(this.n=j),this.I++,this.b=m.hash.sha256.hash(this.b.concat(f)),this.F=new m.cipher.aes(this.b),c=0;4>c&&(this.i[c]=this.i[c]+1|0,!this.i[c]);c++);}for(c=0;c<a;c+=4)0===(c+1)%this.U&&h(this),f=i(this),e.push(f[0],f[1],f[2],f[3]);return h(this),e.slice(0,a)},setDefaultParanoia:function(a,b){0===a&&"Setting paranoia=0 will ruin your security; use it only for testing"!==b&&d("Setting paranoia=0 will ruin your security; use it only for testing"),this.G=a},addEntropy:function(a,b,c){c=c||"user";var e,g,h=(new Date).valueOf(),i=this.A[c],j=this.isReady(),l=0;switch(e=this.N[c],e===k&&(e=this.N[c]=this.Z++),i===k&&(i=this.A[c]=0),this.A[c]=(this.A[c]+1)%this.f.length,typeof a){case"number":b===k&&(b=1),this.f[i].update([e,this.H++,1,b,h,1,0|a]);break;case"object":if(c=Object.prototype.toString.call(a),"[object Uint32Array]"===c){for(g=[],c=0;c<a.length;c++)g.push(a[c]);a=g}else for("[object Array]"!==c&&(l=1),c=0;c<a.length&&!l;c++)"number"!=typeof a[c]&&(l=1);if(!l){if(b===k)for(c=b=0;c<a.length;c++)for(g=a[c];0<g;)b++,g>>>=1;this.f[i].update([e,this.H++,2,b,h,a.length].concat(a))}break;case"string":b===k&&(b=a.length),this.f[i].update([e,this.H++,3,b,h,a.length]),this.f[i].update(a);break;default:l=1}l&&d(new m.exception.bug("random: addEntropy only supports number, array of numbers or string")),this.m[i]+=b,this.g+=b,j===this.p&&(this.isReady()!==this.p&&f("seeded",Math.max(this.n,this.g)),f("progress",this.getProgress()))},isReady:function(a){return a=this.L[a!==k?a:this.G],this.n&&this.n>=a?this.m[0]>this.T&&(new Date).valueOf()>this.Q?this.C|this.B:this.B:this.g>=a?this.C|this.p:this.p},getProgress:function(a){return a=this.L[a?a:this.G],this.n>=a?1:this.g>a?1:this.g/a},startCollectors:function(){this.u||(this.a={loadTimeCollector:j(this,this.fa),mouseCollector:j(this,this.ha),keyboardCollector:j(this,this.da),accelerometerCollector:j(this,this.W),touchCollector:j(this,this.ja)},window.addEventListener?(window.addEventListener("load",this.a.loadTimeCollector,l),window.addEventListener("mousemove",this.a.mouseCollector,l),window.addEventListener("keypress",this.a.keyboardCollector,l),window.addEventListener("devicemotion",this.a.accelerometerCollector,l),window.addEventListener("touchmove",this.a.touchCollector,l)):document.attachEvent?(document.attachEvent("onload",this.a.loadTimeCollector),document.attachEvent("onmousemove",this.a.mouseCollector),document.attachEvent("keypress",this.a.keyboardCollector)):d(new m.exception.bug("can't attach event")),this.u=!0)},stopCollectors:function(){this.u&&(window.removeEventListener?(window.removeEventListener("load",this.a.loadTimeCollector,l),window.removeEventListener("mousemove",this.a.mouseCollector,l),window.removeEventListener("keypress",this.a.keyboardCollector,l),window.removeEventListener("devicemotion",this.a.accelerometerCollector,l),window.removeEventListener("touchmove",this.a.touchCollector,l)):document.detachEvent&&(document.detachEvent("onload",this.a.loadTimeCollector),document.detachEvent("onmousemove",this.a.mouseCollector),document.detachEvent("keypress",this.a.keyboardCollector)),this.u=l)},addEventListener:function(a,b){this.D[a][this.Y++]=b},removeEventListener:function(a,b){var c,d,e=this.D[a],f=[];for(d in e)e.hasOwnProperty(d)&&e[d]===b&&f.push(d);for(c=0;c<f.length;c++)d=f[c],delete e[d]},da:function(){g(1)},ha:function(a){var b,c;try{b=a.x||a.clientX||a.offsetX||0,c=a.y||a.clientY||a.offsetY||0}catch(a){c=b=0}0!=b&&0!=c&&m.random.addEntropy([b,c],2,"mouse"),g(0)},ja:function(a){a=a.touches[0]||a.changedTouches[0],m.random.addEntropy([a.pageX||a.clientX,a.pageY||a.clientY],1,"touch"),g(0)},fa:function(){g(2)},W:function(a){if(a=a.accelerationIncludingGravity.x||a.accelerationIncludingGravity.y||a.accelerationIncludingGravity.z,window.orientation){var b=window.orientation;"number"==typeof b&&m.random.addEntropy(b,1,"accelerometer")}a&&m.random.addEntropy(a,2,"accelerometer"),g(0)}},m.random=new m.prng(6);a:try{var n,o,p,q;if(q="undefined"!=typeof b){var r;if(r=b.exports){var s;try{s=a("crypto")}catch(a){s=null}r=(o=s)&&o.randomBytes}q=r}if(q)n=o.randomBytes(128),n=new Uint32Array(new Uint8Array(n).buffer),m.random.addEntropy(n,1024,"crypto['randomBytes']");else if("undefined"!=typeof window&&"undefined"!=typeof Uint32Array){if(p=new Uint32Array(32),window.crypto&&window.crypto.getRandomValues)window.crypto.getRandomValues(p);else{if(!window.msCrypto||!window.msCrypto.getRandomValues)break a;window.msCrypto.getRandomValues(p)}m.random.addEntropy(p,1024,"crypto['getRandomValues']")}}catch(a){"undefined"!=typeof window&&window.console&&(console.log("There was an error collecting entropy from the browser:"),console.log(a))}m.json={defaults:{v:1,iter:1e3,ks:128,ts:64,mode:"ccm",adata:"",cipher:"aes"},aa:function(a,b,c,e){c=c||{},e=e||{};var f,g=m.json,h=g.h({iv:m.random.randomWords(4,0)},g.defaults);return g.h(h,c),c=h.adata,"string"==typeof h.salt&&(h.salt=m.codec.base64.toBits(h.salt)),"string"==typeof h.iv&&(h.iv=m.codec.base64.toBits(h.iv)),(!m.mode[h.mode]||!m.cipher[h.cipher]||"string"==typeof a&&100>=h.iter||64!==h.ts&&96!==h.ts&&128!==h.ts||128!==h.ks&&192!==h.ks&&256!==h.ks||2>h.iv.length||4<h.iv.length)&&d(new m.exception.invalid("json encrypt: invalid parameters")),"string"==typeof a?(f=m.misc.cachedPbkdf2(a,h),a=f.key.slice(0,h.ks/32),h.salt=f.salt):m.ecc&&a instanceof m.ecc.elGamal.publicKey&&(f=a.kem(),h.kemtag=f.tag,a=f.key.slice(0,h.ks/32)),"string"==typeof b&&(b=m.codec.utf8String.toBits(b)),"string"==typeof c&&(h.adata=c=m.codec.utf8String.toBits(c)),f=new m.cipher[h.cipher](a),g.h(e,h),e.key=a,h.ct="ccm"===h.mode&&m.arrayBuffer&&m.arrayBuffer.ccm&&b instanceof ArrayBuffer?m.arrayBuffer.ccm.encrypt(f,b,h.iv,c,h.ts):m.mode[h.mode].encrypt(f,b,h.iv,c,h.ts),h},encrypt:function(a,b,c,d){var e=m.json,f=e.aa.apply(e,arguments);return e.encode(f)},$:function(a,b,c,e){c=c||{},e=e||{};var f=m.json;b=f.h(f.h(f.h({},f.defaults),b),c,!0);var g,h;return g=b.adata,"string"==typeof b.salt&&(b.salt=m.codec.base64.toBits(b.salt)),"string"==typeof b.iv&&(b.iv=m.codec.base64.toBits(b.iv)),(!m.mode[b.mode]||!m.cipher[b.cipher]||"string"==typeof a&&100>=b.iter||64!==b.ts&&96!==b.ts&&128!==b.ts||128!==b.ks&&192!==b.ks&&256!==b.ks||!b.iv||2>b.iv.length||4<b.iv.length)&&d(new m.exception.invalid("json decrypt: invalid parameters")),"string"==typeof a?(h=m.misc.cachedPbkdf2(a,b),a=h.key.slice(0,b.ks/32),b.salt=h.salt):m.ecc&&a instanceof m.ecc.elGamal.secretKey&&(a=a.unkem(m.codec.base64.toBits(b.kemtag)).slice(0,b.ks/32)),"string"==typeof g&&(g=m.codec.utf8String.toBits(g)),h=new m.cipher[b.cipher](a),g="ccm"===b.mode&&m.arrayBuffer&&m.arrayBuffer.ccm&&b.ct instanceof ArrayBuffer?m.arrayBuffer.ccm.decrypt(h,b.ct,b.iv,b.tag,g,b.ts):m.mode[b.mode].decrypt(h,b.ct,b.iv,g,b.ts),f.h(e,b),e.key=a,1===c.raw?g:m.codec.utf8String.fromBits(g)},decrypt:function(a,b,c,d){var e=m.json;return e.$(a,e.decode(b),c,d)},encode:function(a){var b,c="{",e="";for(b in a)if(a.hasOwnProperty(b))switch(b.match(/^[a-z0-9]+$/i)||d(new m.exception.invalid("json encode: invalid property name")),c+=e+'"'+b+'":',e=",",typeof a[b]){case"number":case"boolean":c+=a[b];break;case"string":c+='"'+escape(a[b])+'"';break;case"object":c+='"'+m.codec.base64.fromBits(a[b],0)+'"';break;default:d(new m.exception.bug("json encode: unsupported type"))}return c+"}"},decode:function(a){a=a.replace(/\s/g,""),a.match(/^\{.*\}$/)||d(new m.exception.invalid("json decode: this isn't json!")),a=a.replace(/^\{|\}$/g,"").split(/,/);var b,c,e={};for(b=0;b<a.length;b++)(c=a[b].match(/^\s*(?:(["']?)([a-z][a-z0-9]*)\1)\s*:\s*(?:(-?\d+)|"([a-z0-9+\/%*_.@=\-]*)"|(true|false))$/i))||d(new m.exception.invalid("json decode: this isn't json!")),null!=c[3]?e[c[2]]=parseInt(c[3],10):null!=c[4]?e[c[2]]=c[2].match(/^(ct|adata|salt|iv)$/)?m.codec.base64.toBits(c[4]):unescape(c[4]):null!=c[5]&&(e[c[2]]="true"===c[5]);return e},h:function(a,b,c){if(a===k&&(a={}),b===k)return a;for(var e in b)b.hasOwnProperty(e)&&(c&&a[e]!==k&&a[e]!==b[e]&&d(new m.exception.invalid("required parameter overridden")),a[e]=b[e]);return a},la:function(a,b){var c,d={};for(c in a)a.hasOwnProperty(c)&&a[c]!==b[c]&&(d[c]=a[c]);return d},ka:function(a,b){var c,d={};for(c=0;c<b.length;c++)a[b[c]]!==k&&(d[b[c]]=a[b[c]]);return d}},m.encrypt=m.json.encrypt,m.decrypt=m.json.decrypt,m.misc.ia={},m.misc.cachedPbkdf2=function(a,b){var c,d=m.misc.ia;return b=b||{},c=b.iter||1e3,d=d[a]=d[a]||{},c=d[c]=d[c]||{firstSalt:b.salt&&b.salt.length?b.salt.slice(0):m.random.randomWords(2,0)},d=b.salt===k?c.firstSalt:b.salt,c[d]=c[d]||m.misc.pbkdf2(a,d,b.iter),{key:c[d].slice(0),salt:d.slice(0)}}},{crypto:133}],31:[function(a,b,c){b.exports=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"];
6
},{}],32:[function(a,b,c){function d(a){if(a.length<8)return!1;if(a.length>72)return!1;if(48!==a[0])return!1;if(a[1]!==a.length-2)return!1;if(2!==a[2])return!1;var b=a[3];if(0===b)return!1;if(5+b>=a.length)return!1;if(2!==a[4+b])return!1;var c=a[5+b];return 0!==c&&(6+b+c===a.length&&(!(128&a[4])&&(!(b>1&&0===a[4]&&!(128&a[5]))&&(!(128&a[b+6])&&!(c>1&&0===a[b+6]&&!(128&a[b+7]))))))}function e(a){if(a.length<8)throw new Error("DER sequence length is too short");if(a.length>72)throw new Error("DER sequence length is too long");if(48!==a[0])throw new Error("Expected DER sequence");if(a[1]!==a.length-2)throw new Error("DER sequence length is invalid");if(2!==a[2])throw new Error("Expected DER integer");var b=a[3];if(0===b)throw new Error("R length is zero");if(5+b>=a.length)throw new Error("R length is too long");if(2!==a[4+b])throw new Error("Expected DER integer (2)");var c=a[5+b];if(0===c)throw new Error("S length is zero");if(6+b+c!==a.length)throw new Error("S length is invalid");if(128&a[4])throw new Error("R value is negative");if(b>1&&0===a[4]&&!(128&a[5]))throw new Error("R value excessively padded");if(128&a[b+6])throw new Error("S value is negative");if(c>1&&0===a[b+6]&&!(128&a[b+7]))throw new Error("S value excessively padded");return{r:a.slice(4,4+b),s:a.slice(6+b)}}function f(a,b){var c=a.length,d=b.length;if(0===c)throw new Error("R length is zero");if(0===d)throw new Error("S length is zero");if(c>33)throw new Error("R length is too long");if(d>33)throw new Error("S length is too long");if(128&a[0])throw new Error("R value is negative");if(128&b[0])throw new Error("S value is negative");if(c>1&&0===a[0]&&!(128&a[1]))throw new Error("R value excessively padded");if(d>1&&0===b[0]&&!(128&b[1]))throw new Error("S value excessively padded");var e=Buffer.allocUnsafe(6+c+d);return e[0]=48,e[1]=e.length-2,e[2]=2,e[3]=a.length,a.copy(e,4),e[4+c]=2,e[5+c]=b.length,b.copy(e,6+c),e}var Buffer=a("safe-buffer").Buffer;b.exports={check:d,decode:e,encode:f}},{"safe-buffer":311}],33:[function(a,b,c){b.exports={OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_1:81,OP_TRUE:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SUBSTR:127,OP_LEFT:128,OP_RIGHT:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_NOP1:176,OP_NOP2:177,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP3:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255}},{}],34:[function(a,b,c){var d=a("./index.json"),e={};for(var f in d){var g=d[f];e[g]=f}b.exports=e},{"./index.json":33}],35:[function(a,b,c){function d(a){var b=k.decode(a);if(b.length<21)throw new TypeError(a+" is too short");if(b.length>21)throw new TypeError(a+" is too long");var c=b.readUInt8(0),d=b.slice(1);return{version:c,hash:d}}function e(a){var b=j.decode(a),c=j.fromWords(b.words.slice(1));return{version:b.words[0],prefix:b.prefix,data:Buffer.from(c)}}function f(a,b){n(o.tuple(o.Hash160bit,o.UInt8),arguments);var c=Buffer.allocUnsafe(21);return c.writeUInt8(b,0),a.copy(c,1),k.encode(c)}function g(a,b,c){var d=j.toWords(a);return d.unshift(b),j.encode(c,d)}function h(a,b){if(b=b||m.bitcoin,l.pubKeyHash.output.check(a))return f(l.compile(a).slice(3,23),b.pubKeyHash);if(l.scriptHash.output.check(a))return f(l.compile(a).slice(2,22),b.scriptHash);if(l.witnessPubKeyHash.output.check(a))return g(l.compile(a).slice(2,22),0,b.bech32);if(l.witnessScriptHash.output.check(a))return g(l.compile(a).slice(2,34),0,b.bech32);throw new Error(l.toASM(a)+" has no matching Address")}function i(a,b){b=b||m.bitcoin;var c;try{c=d(a)}catch(a){}if(c){if(c.version===b.pubKeyHash)return l.pubKeyHash.output.encode(c.hash);if(c.version===b.scriptHash)return l.scriptHash.output.encode(c.hash)}else{try{c=e(a)}catch(a){}if(c){if(c.prefix!==b.bech32)throw new Error(a+" has an invalid prefix");if(0===c.version){if(20===c.data.length)return l.witnessPubKeyHash.output.encode(c.data);if(32===c.data.length)return l.witnessScriptHash.output.encode(c.data)}}}throw new Error(a+" has no matching Script")}var Buffer=a("safe-buffer").Buffer,j=a("bech32"),k=a("bs58check"),l=a("./script"),m=a("./networks"),n=a("typeforce"),o=a("./types");b.exports={fromBase58Check:d,fromBech32:e,fromOutputScript:h,toBase58Check:f,toBech32:g,toOutputScript:i}},{"./networks":44,"./script":45,"./types":71,bech32:23,bs58check:101,"safe-buffer":311,typeforce:352}],36:[function(a,b,c){function d(){this.version=1,this.prevHash=null,this.merkleRoot=null,this.timestamp=0,this.bits=0,this.nonce=0}var Buffer=a("safe-buffer").Buffer,e=a("buffer-reverse"),f=a("./crypto"),g=a("merkle-lib/fastRoot"),h=a("typeforce"),i=a("./types"),j=a("varuint-bitcoin"),k=a("./transaction");d.fromBuffer=function(a){function b(b){return h+=b,a.slice(h-b,h)}function c(){var b=a.readUInt32LE(h);return h+=4,b}function e(){var b=a.readInt32LE(h);return h+=4,b}function f(){var b=j.decode(a,h);return h+=j.decode.bytes,b}function g(){var b=k.fromBuffer(a.slice(h),!0);return h+=b.byteLength(),b}if(a.length<80)throw new Error("Buffer too small (< 80 bytes)");var h=0,i=new d;if(i.version=e(),i.prevHash=b(32),i.merkleRoot=b(32),i.timestamp=c(),i.bits=c(),i.nonce=c(),80===a.length)return i;var l=f();i.transactions=[];for(var m=0;m<l;++m){var n=g();i.transactions.push(n)}return i},d.prototype.byteLength=function(a){return a||!this.transactions?80:80+j.encodingLength(this.transactions.length)+this.transactions.reduce(function(a,b){return a+b.byteLength()},0)},d.fromHex=function(a){return d.fromBuffer(Buffer.from(a,"hex"))},d.prototype.getHash=function(){return f.hash256(this.toBuffer(!0))},d.prototype.getId=function(){return e(this.getHash()).toString("hex")},d.prototype.getUTCDate=function(){var a=new Date(0);return a.setUTCSeconds(this.timestamp),a},d.prototype.toBuffer=function(a){function b(a){a.copy(e,f),f+=a.length}function c(a){e.writeInt32LE(a,f),f+=4}function d(a){e.writeUInt32LE(a,f),f+=4}var e=Buffer.allocUnsafe(this.byteLength(a)),f=0;return c(this.version),b(this.prevHash),b(this.merkleRoot),d(this.timestamp),d(this.bits),d(this.nonce),a||!this.transactions?e:(j.encode(this.transactions.length,e,f),f+=j.encode.bytes,this.transactions.forEach(function(a){var b=a.byteLength();a.toBuffer(e,f),f+=b}),e)},d.prototype.toHex=function(a){return this.toBuffer(a).toString("hex")},d.calculateTarget=function(a){var b=((4278190080&a)>>24)-3,c=8388607&a,d=Buffer.alloc(32,0);return d.writeUInt32BE(c,28-b),d},d.calculateMerkleRoot=function(a){if(h([{getHash:i.Function}],a),0===a.length)throw TypeError("Cannot compute merkle root for zero transactions");var b=a.map(function(a){return a.getHash()});return g(b,f.hash256)},d.prototype.checkMerkleRoot=function(){if(!this.transactions)return!1;var a=d.calculateMerkleRoot(this.transactions);return 0===this.merkleRoot.compare(a)},d.prototype.checkProofOfWork=function(){var a=e(this.getHash()),b=d.calculateTarget(this.bits);return a.compare(b)<=0},b.exports=d},{"./crypto":38,"./transaction":69,"./types":71,"buffer-reverse":103,"merkle-lib/fastRoot":252,"safe-buffer":311,typeforce:352,"varuint-bitcoin":361}],37:[function(a,b,c){function d(a,b){if("number"!=typeof a)throw new Error("cannot write a non-number as a number");if(a<0)throw new Error("specified a negative value for writing an unsigned value");if(a>b)throw new Error("RangeError: value out of range");if(Math.floor(a)!==a)throw new Error("value has a fractional component")}function e(a,b){var c=a.readUInt32LE(b),e=a.readUInt32LE(b+4);return e*=4294967296,d(e+c,9007199254740991),e+c}function f(a,b,c){return d(b,9007199254740991),a.writeInt32LE(b&-1,c),a.writeUInt32LE(Math.floor(b/4294967296),c+4),c+8}function g(a,b){var c=j.decode(a,b);return{number:c,size:j.decode.bytes}}function h(a,b,c){return j.encode(b,a,c),j.encode.bytes}var i=a("pushdata-bitcoin"),j=a("varuint-bitcoin");b.exports={pushDataSize:i.encodingLength,readPushDataInt:i.decode,readUInt64LE:e,readVarInt:g,varIntBuffer:j.encode,varIntSize:j.encodingLength,writePushDataInt:i.encode,writeUInt64LE:f,writeVarInt:h}},{"pushdata-bitcoin":292,"varuint-bitcoin":361}],38:[function(a,b,c){function d(a){return i("rmd160").update(a).digest()}function e(a){return i("sha1").update(a).digest()}function f(a){return i("sha256").update(a).digest()}function g(a){return d(f(a))}function h(a){return f(f(a))}var i=a("create-hash");b.exports={hash160:g,hash256:h,ripemd160:d,sha1:e,sha256:f}},{"create-hash":128}],39:[function(a,b,c){function d(a,b,c){h(i.tuple(i.Hash256bit,i.Buffer256bit,i.Function),arguments);var d=Buffer.alloc(32,0),e=Buffer.alloc(32,1);d=g("sha256",d).update(e).update(k).update(b).update(a).digest(),e=g("sha256",d).update(e).digest(),d=g("sha256",d).update(e).update(l).update(b).update(a).digest(),e=g("sha256",d).update(e).digest(),e=g("sha256",d).update(e).digest();for(var f=BigInteger.fromBuffer(e);f.signum()<=0||f.compareTo(n.n)>=0||!c(f);)d=g("sha256",d).update(e).update(k).digest(),e=g("sha256",d).update(e).digest(),e=g("sha256",d).update(e).digest(),f=BigInteger.fromBuffer(e);return f}function e(a,b){h(i.tuple(i.Hash256bit,i.BigInt),arguments);var c,e,f=b.toBuffer(32),g=BigInteger.fromBuffer(a),k=n.n,l=n.G;return d(a,f,function(a){var d=l.multiply(a);return!n.isInfinity(d)&&(c=d.affineX.mod(k),0!==c.signum()&&(e=a.modInverse(k).multiply(g.add(b.multiply(c))).mod(k),0!==e.signum()))}),e.compareTo(o)>0&&(e=k.subtract(e)),new j(c,e)}function f(a,b,c){h(i.tuple(i.Hash256bit,i.ECSignature,i.ECPoint),arguments);var d=n.n,e=n.G,f=b.r,g=b.s;if(f.signum()<=0||f.compareTo(d)>=0)return!1;if(g.signum()<=0||g.compareTo(d)>=0)return!1;var j=BigInteger.fromBuffer(a),k=g.modInverse(d),l=j.multiply(k).mod(d),m=f.multiply(k).mod(d),o=e.multiplyTwo(l,c,m);if(n.isInfinity(o))return!1;var p=o.affineX,q=p.mod(d);return q.equals(f)}var Buffer=a("safe-buffer").Buffer,g=a("create-hmac"),h=a("typeforce"),i=a("./types"),BigInteger=a("bigi"),j=a("./ecsignature"),k=Buffer.alloc(1,0),l=Buffer.alloc(1,1),m=a("ecurve"),n=m.getCurveByName("secp256k1"),o=n.n.shiftRight(1);b.exports={deterministicGenerateK:d,sign:e,verify:f,__curve:n}},{"./ecsignature":41,"./types":71,bigi:26,"create-hmac":131,ecurve:225,"safe-buffer":311,typeforce:352}],40:[function(a,b,c){function ECPair(a,b,c){if(c&&h({compressed:i.maybe(i.Boolean),network:i.maybe(i.Network)},c),c=c||{},a){if(a.signum()<=0)throw new Error("Private key must be greater than 0");if(a.compareTo(m.n)>=0)throw new Error("Private key must be less than the curve order");if(b)throw new TypeError("Unexpected publicKey parameter");this.d=a}else h(i.ECPoint,b),this.__Q=b;this.compressed=void 0===c.compressed||c.compressed,this.network=c.network||k.bitcoin}var d=a("./address"),e=a("./crypto"),f=a("./ecdsa"),g=a("randombytes"),h=a("typeforce"),i=a("./types"),j=a("wif"),k=a("./networks"),BigInteger=a("bigi"),l=a("ecurve"),m=f.__curve;Object.defineProperty(ECPair.prototype,"Q",{get:function(){return!this.__Q&&this.d&&(this.__Q=m.G.multiply(this.d)),this.__Q}}),ECPair.fromPublicKeyBuffer=function(a,b){var c=l.Point.decodeFrom(m,a);return new ECPair(null,c,{compressed:c.compressed,network:b})},ECPair.fromWIF=function(a,b){var c=j.decode(a),d=c.version;if(i.Array(b)){if(b=b.filter(function(a){return d===a.wif}).pop(),!b)throw new Error("Unknown network version")}else if(b=b||k.bitcoin,d!==b.wif)throw new Error("Invalid network version");var e=BigInteger.fromBuffer(c.privateKey);return new ECPair(e,null,{compressed:c.compressed,network:b})},ECPair.makeRandom=function(a){a=a||{};var b,c=a.rng||g;do{var d=c(32);h(i.Buffer256bit,d),b=BigInteger.fromBuffer(d)}while(b.signum()<=0||b.compareTo(m.n)>=0);return new ECPair(b,null,a)},ECPair.prototype.getAddress=function(){return d.toBase58Check(e.hash160(this.getPublicKeyBuffer()),this.getNetwork().pubKeyHash)},ECPair.prototype.getNetwork=function(){return this.network},ECPair.prototype.getPublicKeyBuffer=function(){return this.Q.getEncoded(this.compressed)},ECPair.prototype.sign=function(a){if(!this.d)throw new Error("Missing private key");return f.sign(a,this.d)},ECPair.prototype.toWIF=function(){if(!this.d)throw new Error("Missing private key");return j.encode(this.network.wif,this.d.toBuffer(32),this.compressed)},ECPair.prototype.verify=function(a,b){return f.verify(a,b,this.Q)},b.exports=ECPair},{"./address":35,"./crypto":38,"./ecdsa":39,"./networks":44,"./types":71,bigi:26,ecurve:225,randombytes:297,typeforce:352,wif:364}],41:[function(a,b,c){(function(Buffer){function c(a,b){e(f.tuple(f.BigInt,f.BigInt),arguments),this.r=a,this.s=b}var d=a("bip66"),e=a("typeforce"),f=a("./types"),BigInteger=a("bigi");c.parseCompact=function(a){if(65!==a.length)throw new Error("Invalid signature length");var b=a.readUInt8(0)-27;if(b!==(7&b))throw new Error("Invalid signature parameter");var d=!!(4&b),e=3&b,f=BigInteger.fromBuffer(a.slice(1,33)),g=BigInteger.fromBuffer(a.slice(33));return{compressed:d,i:e,signature:new c(f,g)}},c.fromDER=function(a){var b=d.decode(a),e=BigInteger.fromDERInteger(b.r),f=BigInteger.fromDERInteger(b.s);return new c(e,f)},c.parseScriptSignature=function(a){var b=a.readUInt8(a.length-1),d=b&-193;if(d<=0||d>=4)throw new Error("Invalid hashType "+b);return{signature:c.fromDER(a.slice(0,-1)),hashType:b}},c.prototype.toCompact=function(a,b){b&&(a+=4),a+=27;var c=Buffer.alloc(65);return c.writeUInt8(a,0),this.r.toBuffer(32).copy(c,1),this.s.toBuffer(32).copy(c,33),c},c.prototype.toDER=function(){var a=Buffer.from(this.r.toDERInteger()),b=Buffer.from(this.s.toDERInteger());return d.encode(a,b)},c.prototype.toScriptSignature=function(a){var b=a&-193;if(b<=0||b>=4)throw new Error("Invalid hashType "+a);var c=Buffer.alloc(1);return c.writeUInt8(a,0),Buffer.concat([this.toDER(),c])},b.exports=c}).call(this,a("buffer").Buffer)},{"./types":71,bigi:26,bip66:32,buffer:105,typeforce:352}],42:[function(a,b,c){function HDNode(a,b){if(g(h.tuple("ECPair",h.Buffer256bit),arguments),!a.compressed)throw new TypeError("BIP32 only allows compressed keyPairs");this.keyPair=a,this.chainCode=b,this.depth=0,this.index=0,this.parentFingerprint=0}var Buffer=a("safe-buffer").Buffer,d=a("bs58check"),e=a("./crypto"),f=a("create-hmac"),g=a("typeforce"),h=a("./types"),i=a("./networks"),BigInteger=a("bigi"),ECPair=a("./ecpair"),j=a("ecurve"),k=j.getCurveByName("secp256k1");HDNode.HIGHEST_BIT=2147483648,HDNode.LENGTH=78,HDNode.MASTER_SECRET=Buffer.from("Bitcoin seed","utf8"),HDNode.fromSeedBuffer=function(a,b){if(g(h.tuple(h.Buffer,h.maybe(h.Network)),arguments),a.length<16)throw new TypeError("Seed should be at least 128 bits");if(a.length>64)throw new TypeError("Seed should be at most 512 bits");var c=f("sha512",HDNode.MASTER_SECRET).update(a).digest(),d=c.slice(0,32),e=c.slice(32),i=BigInteger.fromBuffer(d),j=new ECPair(i,null,{network:b});return new HDNode(j,e)},HDNode.fromSeedHex=function(a,b){return HDNode.fromSeedBuffer(Buffer.from(a,"hex"),b)},HDNode.fromBase58=function(a,b){var c=d.decode(a);if(78!==c.length)throw new Error("Invalid buffer length");var e,f=c.readUInt32BE(0);if(Array.isArray(b)){if(e=b.filter(function(a){return f===a.bip32.private||f===a.bip32.public}).pop(),!e)throw new Error("Unknown network version")}else e=b||i.bitcoin;if(f!==e.bip32.private&&f!==e.bip32.public)throw new Error("Invalid network version");var g=c[4],h=c.readUInt32BE(5);if(0===g&&0!==h)throw new Error("Invalid parent fingerprint");var l=c.readUInt32BE(9);if(0===g&&0!==l)throw new Error("Invalid index");var m,n=c.slice(13,45);if(f===e.bip32.private){if(0!==c.readUInt8(45))throw new Error("Invalid private key");var o=BigInteger.fromBuffer(c.slice(46,78));m=new ECPair(o,null,{network:e})}else{var p=j.Point.decodeFrom(k,c.slice(45,78));k.validate(p),m=new ECPair(null,p,{network:e})}var q=new HDNode(m,n);return q.depth=g,q.index=l,q.parentFingerprint=h,q},HDNode.prototype.getAddress=function(){return this.keyPair.getAddress()},HDNode.prototype.getIdentifier=function(){return e.hash160(this.keyPair.getPublicKeyBuffer())},HDNode.prototype.getFingerprint=function(){return this.getIdentifier().slice(0,4)},HDNode.prototype.getNetwork=function(){return this.keyPair.getNetwork()},HDNode.prototype.getPublicKeyBuffer=function(){return this.keyPair.getPublicKeyBuffer()},HDNode.prototype.neutered=function(){var a=new ECPair(null,this.keyPair.Q,{network:this.keyPair.network}),b=new HDNode(a,this.chainCode);return b.depth=this.depth,b.index=this.index,b.parentFingerprint=this.parentFingerprint,b},HDNode.prototype.sign=function(a){return this.keyPair.sign(a)},HDNode.prototype.verify=function(a,b){return this.keyPair.verify(a,b)},HDNode.prototype.toBase58=function(a){if(void 0!==a)throw new TypeError("Unsupported argument in 2.0.0");var b=this.keyPair.network,c=this.isNeutered()?b.bip32.public:b.bip32.private,e=Buffer.allocUnsafe(78);return e.writeUInt32BE(c,0),e.writeUInt8(this.depth,4),e.writeUInt32BE(this.parentFingerprint,5),e.writeUInt32BE(this.index,9),this.chainCode.copy(e,13),this.isNeutered()?this.keyPair.getPublicKeyBuffer().copy(e,45):(e.writeUInt8(0,45),this.keyPair.d.toBuffer(32).copy(e,46)),d.encode(e)},HDNode.prototype.derive=function(a){g(h.UInt32,a);var b=a>=HDNode.HIGHEST_BIT,c=Buffer.allocUnsafe(37);if(b){if(this.isNeutered())throw new TypeError("Could not derive hardened child key");c[0]=0,this.keyPair.d.toBuffer(32).copy(c,1),c.writeUInt32BE(a,33)}else this.keyPair.getPublicKeyBuffer().copy(c,0),c.writeUInt32BE(a,33);var d=f("sha512",this.chainCode).update(c).digest(),e=d.slice(0,32),i=d.slice(32),j=BigInteger.fromBuffer(e);if(j.compareTo(k.n)>=0)return this.derive(a+1);var l;if(this.isNeutered()){var m=k.G.multiply(j).add(this.keyPair.Q);if(k.isInfinity(m))return this.derive(a+1);l=new ECPair(null,m,{network:this.keyPair.network})}else{var n=j.add(this.keyPair.d).mod(k.n);if(0===n.signum())return this.derive(a+1);l=new ECPair(n,null,{network:this.keyPair.network})}var o=new HDNode(l,i);return o.depth=this.depth+1,o.index=a,o.parentFingerprint=this.getFingerprint().readUInt32BE(0),o},HDNode.prototype.deriveHardened=function(a){return g(h.UInt31,a),this.derive(a+HDNode.HIGHEST_BIT)},HDNode.prototype.isNeutered=function(){return!this.keyPair.d},HDNode.prototype.derivePath=function(a){g(h.BIP32Path,a);var b=a.split("/");if("m"===b[0]){if(this.parentFingerprint)throw new Error("Not a master node");b=b.slice(1)}return b.reduce(function(a,b){var c;return"'"===b.slice(-1)?(c=parseInt(b.slice(0,-1),10),a.deriveHardened(c)):(c=parseInt(b,10),a.derive(c))},this)},b.exports=HDNode},{"./crypto":38,"./ecpair":40,"./networks":44,"./types":71,bigi:26,bs58check:101,"create-hmac":131,ecurve:225,"safe-buffer":311,typeforce:352}],43:[function(a,b,c){b.exports={Block:a("./block"),ECPair:a("./ecpair"),ECSignature:a("./ecsignature"),HDNode:a("./hdnode"),Transaction:a("./transaction"),TransactionBuilder:a("./transaction_builder"),address:a("./address"),bufferutils:a("./bufferutils"),crypto:a("./crypto"),networks:a("./networks"),opcodes:a("bitcoin-ops"),script:a("./script")}},{"./address":35,"./block":36,"./bufferutils":37,"./crypto":38,"./ecpair":40,"./ecsignature":41,"./hdnode":42,"./networks":44,"./script":45,"./transaction":69,"./transaction_builder":70,"bitcoin-ops":33}],44:[function(a,b,c){b.exports={bitcoincash:{messagePrefix:"Bitcoin Signed Message:\n",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},bitcoincashtestnet:{messagePrefix:"Bitcoin Signed Message:\n",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239},bitcoin:{messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},testnet:{messagePrefix:"Bitcoin Signed Message:\n",bech32:"tb",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239},litecoin:{messagePrefix:"Litecoin Signed Message:\n",bip32:{public:27108450,private:27106558},pubKeyHash:48,scriptHash:50,wif:176}}},{}],45:[function(a,b,c){function d(a){return s.Number(a)&&(a===u.OP_0||a>=u.OP_1&&a<=u.OP_16||a===u.OP_1NEGATE)}function e(a){return s.Buffer(a)||d(a)}function f(a){return s.Array(a)&&a.every(e)}function g(a){if(0===a.length)return u.OP_0;if(1===a.length)return a[0]>=1&&a[0]<=16?w+a[0]:129===a[0]?u.OP_1NEGATE:void 0}function h(a){if(Buffer.isBuffer(a))return a;r(s.Array,a);var b=a.reduce(function(a,b){return Buffer.isBuffer(b)?1===b.length&&void 0!==g(b)?a+1:a+q.encodingLength(b.length)+b.length:a+1},0),c=Buffer.allocUnsafe(b),d=0;if(a.forEach(function(a){if(Buffer.isBuffer(a)){var b=g(a);if(void 0!==b)return c.writeUInt8(b,d),void(d+=1);d+=q.encode(c,a.length,d),a.copy(c,d),d+=a.length}else c.writeUInt8(a,d),d+=1}),d!==c.length)throw new Error("Could not decode chunks");return c}function i(a){if(s.Array(a))return a;r(s.Buffer,a);for(var b=[],c=0;c<a.length;){var d=a[c];if(d>u.OP_0&&d<=u.OP_PUSHDATA4){var e=q.decode(a,c);if(null===e)return[];if(c+=e.size,c+e.number>a.length)return[];var f=a.slice(c,c+e.number);c+=e.number;var h=g(f);void 0!==h?b.push(h):b.push(f)}else b.push(d),c+=1}return b}function j(a){return Buffer.isBuffer(a)&&(a=i(a)),a.map(function(a){if(Buffer.isBuffer(a)){var b=g(a);if(void 0===b)return a.toString("hex");a=b}return v[a]}).join(" ")}function k(asm){return r(s.String,asm),h(asm.split(" ").map(function(a){return void 0!==u[a]?u[a]:(r(s.Hex,a),Buffer.from(a,"hex"))}))}function l(a){return a=i(a),r(f,a),a.map(function(a){return Buffer.isBuffer(a)?a:a===u.OP_0?Buffer.allocUnsafe(0):t.encode(a-w)})}function m(a){if(!Buffer.isBuffer(a))return!1;if(a.length<33)return!1;switch(a[0]){case 2:case 3:return 33===a.length;case 4:return 65===a.length}return!1}function n(a){var b=a&-193;return b>0&&b<4}function o(a){return!!Buffer.isBuffer(a)&&(!!n(a[a.length-1])&&p.check(a.slice(0,-1)))}var Buffer=a("safe-buffer").Buffer,p=a("bip66"),q=a("pushdata-bitcoin"),r=a("typeforce"),s=a("./types"),t=a("./script_number"),u=a("bitcoin-ops"),v=a("bitcoin-ops/map"),w=u.OP_RESERVED;b.exports={compile:h,decompile:i,fromASM:k,toASM:j,toStack:l,number:a("./script_number"),isCanonicalPubKey:m,isCanonicalSignature:o,isPushOnly:f,isDefinedHashType:n};var x=a("./templates");for(var y in x)b.exports[y]=x[y]},{"./script_number":46,"./templates":47,"./types":71,bip66:32,"bitcoin-ops":33,"bitcoin-ops/map":34,"pushdata-bitcoin":292,"safe-buffer":311,typeforce:352}],46:[function(a,b,c){function d(a,b,c){b=b||4,c=void 0===c||c;var d=a.length;if(0===d)return 0;if(d>b)throw new TypeError("Script number overflow");if(c&&0===(127&a[d-1])&&(d<=1||0===(128&a[d-2])))throw new Error("Non-minimally encoded script number");if(5===d){var e=a.readUInt32LE(0),f=a.readUInt8(4);return 128&f?-(4294967296*(f&-129)+e):4294967296*f+e}for(var g=0,h=0;h<d;++h)g|=a[h]<<8*h;return 128&a[d-1]?-(g&~(128<<8*(d-1))):g}function e(a){return a>2147483647?5:a>8388607?4:a>32767?3:a>127?2:a>0?1:0}function f(a){for(var b=Math.abs(a),c=e(b),d=Buffer.allocUnsafe(c),f=a<0,g=0;g<c;++g)d.writeUInt8(255&b,g),b>>=8;return 128&d[c-1]?d.writeUInt8(f?128:0,c-1):f&&(d[c-1]|=128),d}var Buffer=a("safe-buffer").Buffer;b.exports={decode:d,encode:f}},{"safe-buffer":311}],47:[function(a,b,c){function d(a){if(m.output.check(a))return p.P2WPKH;if(n.output.check(a))return p.P2WSH;if(k.output.check(a))return p.P2PKH;if(l.output.check(a))return p.P2SH;var b=g(a);return h.output.check(b)?p.MULTISIG:j.output.check(b)?p.P2PK:o.output.check(b)?p.WITNESS_COMMITMENT:i.output.check(b)?p.NULLDATA:p.NONSTANDARD}function e(a,b){var c=g(a);return k.input.check(c)?p.P2PKH:h.input.check(c,b)?p.MULTISIG:l.input.check(c,b)?p.P2SH:j.input.check(c)?p.P2PK:p.NONSTANDARD}function f(a,b){var c=g(a);return m.input.check(c)?p.P2WPKH:n.input.check(c,b)?p.P2WSH:p.NONSTANDARD}var g=a("../script").decompile,h=a("./multisig"),i=a("./nulldata"),j=a("./pubkey"),k=a("./pubkeyhash"),l=a("./scripthash"),m=a("./witnesspubkeyhash"),n=a("./witnessscripthash"),o=a("./witnesscommitment"),p={MULTISIG:"multisig",NONSTANDARD:"nonstandard",NULLDATA:"nulldata",P2PK:"pubkey",P2PKH:"pubkeyhash",P2SH:"scripthash",P2WPKH:"witnesspubkeyhash",P2WSH:"witnessscripthash",WITNESS_COMMITMENT:"witnesscommitment"};b.exports={classifyInput:e,classifyOutput:d,classifyWitness:f,multisig:h,nullData:i,pubKey:j,pubKeyHash:k,scriptHash:l,witnessPubKeyHash:m,witnessScriptHash:n,witnessCommitment:o,types:p}},{"../script":45,"./multisig":48,"./nulldata":51,"./pubkey":52,"./pubkeyhash":55,"./scripthash":58,"./witnesscommitment":61,"./witnesspubkeyhash":63,"./witnessscripthash":66}],48:[function(a,b,c){b.exports={input:a("./input"),output:a("./output")}},{"./input":49,"./output":50}],49:[function(a,b,c){function d(a){return a===l.OP_0||j.isCanonicalSignature(a)}function e(a,b){var c=j.decompile(a);return!(c.length<2)&&(c[0]===l.OP_0&&(b?c.slice(1).every(d):c.slice(1).every(j.isCanonicalSignature)))}function f(a,b){if(k([d],a),b){var c=j.multisig.output.decode(b);if(a.length<c.m)throw new TypeError("Not enough signatures provided");if(a.length>c.pubKeys.length)throw new TypeError("Too many signatures provided")}return[].concat(m,a.map(function(a){return a===l.OP_0?m:a}))}function g(a,b){return j.compile(f(a,b))}function h(a,b){return k(e,a,b),a.slice(1)}function i(a,b){var c=j.decompile(a);return h(c,b)}var Buffer=a("safe-buffer").Buffer,j=a("../../script"),k=a("typeforce"),l=a("bitcoin-ops");e.toJSON=function(){return"multisig input"};var m=Buffer.allocUnsafe(0);b.exports={check:e,decode:i,decodeStack:h,encode:g,encodeStack:f}},{"../../script":45,"bitcoin-ops":33,"safe-buffer":311,typeforce:352}],50:[function(a,b,c){function d(a,b){var c=g.decompile(a);if(c.length<4)return!1;if(c[c.length-1]!==j.OP_CHECKMULTISIG)return!1;if(!h.Number(c[0]))return!1;if(!h.Number(c[c.length-2]))return!1;var d=c[0]-k,e=c[c.length-2]-k;if(d<=0)return!1;if(e>16)return!1;if(d>e)return!1;if(e!==c.length-3)return!1;if(b)return!0;var f=c.slice(1,-2);return f.every(g.isCanonicalPubKey)}function e(a,b){i({m:h.Number,pubKeys:[g.isCanonicalPubKey]},{m:a,pubKeys:b});var c=b.length;if(c<a)throw new TypeError("Not enough pubKeys provided");return g.compile([].concat(k+a,b,k+c,j.OP_CHECKMULTISIG))}function f(a,b){var c=g.decompile(a);return i(d,c,b),{m:c[0]-k,pubKeys:c.slice(1,-2)}}var g=a("../../script"),h=a("../../types"),i=a("typeforce"),j=a("bitcoin-ops"),k=j.OP_RESERVED;d.toJSON=function(){return"multi-sig output"},b.exports={check:d,decode:f,encode:e}},{"../../script":45,"../../types":71,"bitcoin-ops":33,typeforce:352}],51:[function(a,b,c){function d(a){var b=g.compile(a);return b.length>1&&b[0]===j.OP_RETURN}function e(a){return i(h.Buffer,a),g.compile([j.OP_RETURN,a])}function f(a){return i(d,a),a.slice(2)}var g=a("../script"),h=a("../types"),i=a("typeforce"),j=a("bitcoin-ops");d.toJSON=function(){return"null data output"},b.exports={output:{check:d,decode:f,encode:e}}},{"../script":45,"../types":71,"bitcoin-ops":33,typeforce:352}],52:[function(a,b,c){arguments[4][48][0].apply(c,arguments)},{"./input":53,"./output":54,dup:48}],53:[function(a,b,c){function d(a){var b=i.decompile(a);return 1===b.length&&i.isCanonicalSignature(b[0])}function e(a){return j(i.isCanonicalSignature,a),[a]}function f(a){return i.compile(e(a))}function g(a){return j(d,a),a[0]}function h(a){var b=i.decompile(a);return g(b)}var i=a("../../script"),j=a("typeforce");d.toJSON=function(){return"pubKey input"},b.exports={check:d,decode:h,decodeStack:g,encode:f,encodeStack:e}},{"../../script":45,typeforce:352}],54:[function(a,b,c){function d(a){var b=g.decompile(a);return 2===b.length&&g.isCanonicalPubKey(b[0])&&b[1]===i.OP_CHECKSIG}function e(a){return h(g.isCanonicalPubKey,a),g.compile([a,i.OP_CHECKSIG])}function f(a){var b=g.decompile(a);return h(d,b),b[0]}var g=a("../../script"),h=a("typeforce"),i=a("bitcoin-ops");d.toJSON=function(){return"pubKey output"},b.exports={check:d,decode:f,encode:e}},{"../../script":45,"bitcoin-ops":33,typeforce:352}],55:[function(a,b,c){arguments[4][48][0].apply(c,arguments)},{"./input":56,"./output":57,dup:48}],56:[function(a,b,c){function d(a){var b=i.decompile(a);return 2===b.length&&i.isCanonicalSignature(b[0])&&i.isCanonicalPubKey(b[1])}function e(a,b){return j({signature:i.isCanonicalSignature,pubKey:i.isCanonicalPubKey},{signature:a,pubKey:b}),[a,b]}function f(a,b){return i.compile(e(a,b))}function g(a){return j(d,a),{signature:a[0],pubKey:a[1]}}function h(a){var b=i.decompile(a);return g(b)}var i=a("../../script"),j=a("typeforce");d.toJSON=function(){return"pubKeyHash input"},b.exports={check:d,decode:h,decodeStack:g,encode:f,encodeStack:e}},{"../../script":45,typeforce:352}],57:[function(a,b,c){function d(a){var b=g.compile(a);return 25===b.length&&b[0]===j.OP_DUP&&b[1]===j.OP_HASH160&&20===b[2]&&b[23]===j.OP_EQUALVERIFY&&b[24]===j.OP_CHECKSIG}function e(a){return i(h.Hash160bit,a),g.compile([j.OP_DUP,j.OP_HASH160,a,j.OP_EQUALVERIFY,j.OP_CHECKSIG])}function f(a){return i(d,a),a.slice(3,23)}var g=a("../../script"),h=a("../../types"),i=a("typeforce"),j=a("bitcoin-ops");d.toJSON=function(){return"pubKeyHash output"},b.exports={check:d,decode:f,encode:e}},{"../../script":45,"../../types":71,"bitcoin-ops":33,typeforce:352}],58:[function(a,b,c){arguments[4][48][0].apply(c,arguments)},{"./input":59,"./output":60,dup:48}],59:[function(a,b,c){function d(a,b){var c=i.decompile(a);if(c.length<1)return!1;var d=c[c.length-1];if(!Buffer.isBuffer(d))return!1;var e=i.decompile(i.compile(c.slice(0,-1))),f=i.decompile(d);if(0===f.length)return!1;if(!i.isPushOnly(e))return!1;var g=i.classifyInput(e,b),h=i.classifyOutput(f);return 1===c.length?h===i.types.P2WSH||h===i.types.P2WPKH:g===h}function e(a,b){var c=i.compile(b);return[].concat(a,c)}function f(a,b){var c=i.decompile(a);return i.compile(e(c,b))}function g(a){return j(d,a),{redeemScriptStack:a.slice(0,-1),redeemScript:a[a.length-1]}}function h(a){var b=i.decompile(a),c=g(b);return c.redeemScriptSig=i.compile(c.redeemScriptStack),delete c.redeemScriptStack,c}var Buffer=a("safe-buffer").Buffer,i=a("../../script"),j=a("typeforce");d.toJSON=function(){return"scriptHash input"},b.exports={check:d,decode:h,decodeStack:g,encode:f,encodeStack:e}},{"../../script":45,"safe-buffer":311,typeforce:352}],60:[function(a,b,c){function d(a){var b=g.compile(a);return 23===b.length&&b[0]===j.OP_HASH160&&20===b[1]&&b[22]===j.OP_EQUAL}function e(a){return i(h.Hash160bit,a),g.compile([j.OP_HASH160,a,j.OP_EQUAL])}function f(a){return i(d,a),a.slice(2,22)}var g=a("../../script"),h=a("../../types"),i=a("typeforce"),j=a("bitcoin-ops");d.toJSON=function(){return"scriptHash output"},b.exports={check:d,decode:f,encode:e}},{"../../script":45,"../../types":71,"bitcoin-ops":33,typeforce:352}],61:[function(a,b,c){b.exports={output:a("./output")}},{"./output":62}],62:[function(a,b,c){function d(a){var b=g.compile(a);return b.length>37&&b[0]===j.OP_RETURN&&36===b[1]&&b.slice(2,6).equals(k)}function e(a){i(h.Hash256bit,a);var b=Buffer.allocUnsafe(36);return k.copy(b,0),a.copy(b,4),g.compile([j.OP_RETURN,b])}function f(a){return i(d,a),g.decompile(a)[1].slice(4,36)}var Buffer=a("safe-buffer").Buffer,g=a("../../script"),h=a("../../types"),i=a("typeforce"),j=a("bitcoin-ops"),k=Buffer.from("aa21a9ed","hex");
7
d.toJSON=function(){return"Witness commitment output"},b.exports={check:d,decode:f,encode:e}},{"../../script":45,"../../types":71,"bitcoin-ops":33,"safe-buffer":311,typeforce:352}],63:[function(a,b,c){arguments[4][48][0].apply(c,arguments)},{"./input":64,"./output":65,dup:48}],64:[function(a,b,c){function d(a){return h.isCanonicalPubKey(a)&&33===a.length}function e(a){var b=h.decompile(a);return 2===b.length&&h.isCanonicalSignature(b[0])&&d(b[1])}function f(a,b){return i({signature:h.isCanonicalSignature,pubKey:d},{signature:a,pubKey:b}),[a,b]}function g(a){return i(e,a),{signature:a[0],pubKey:a[1]}}var h=a("../../script"),i=a("typeforce");e.toJSON=function(){return"witnessPubKeyHash input"},b.exports={check:e,decodeStack:g,encodeStack:f}},{"../../script":45,typeforce:352}],65:[function(a,b,c){function d(a){var b=g.compile(a);return 22===b.length&&b[0]===j.OP_0&&20===b[1]}function e(a){return i(h.Hash160bit,a),g.compile([j.OP_0,a])}function f(a){return i(d,a),a.slice(2)}var g=a("../../script"),h=a("../../types"),i=a("typeforce"),j=a("bitcoin-ops");d.toJSON=function(){return"Witness pubKeyHash output"},b.exports={check:d,decode:f,encode:e}},{"../../script":45,"../../types":71,"bitcoin-ops":33,typeforce:352}],66:[function(a,b,c){arguments[4][48][0].apply(c,arguments)},{"./input":67,"./output":68,dup:48}],67:[function(a,b,c){var d=a("../scripthash/input");b.exports={check:d.check,decodeStack:d.decodeStack,encodeStack:d.encodeStack}},{"../scripthash/input":59}],68:[function(a,b,c){function d(a){var b=g.compile(a);return 34===b.length&&b[0]===j.OP_0&&32===b[1]}function e(a){return i(h.Hash256bit,a),g.compile([j.OP_0,a])}function f(a){return i(d,a),a.slice(2)}var g=a("../../script"),h=a("../../types"),i=a("typeforce"),j=a("bitcoin-ops");d.toJSON=function(){return"Witness scriptHash output"},b.exports={check:d,decode:f,encode:e}},{"../../script":45,"../../types":71,"bitcoin-ops":33,typeforce:352}],69:[function(a,b,c){function d(a){var b=a.length;return n.encodingLength(b)+b}function e(a){var b=a.length;return n.encodingLength(b)+a.reduce(function(a,b){return a+d(b)},0)}function f(){this.version=1,this.locktime=0,this.ins=[],this.outs=[]}var Buffer=a("safe-buffer").Buffer,g=a("buffer-reverse"),h=a("./crypto"),i=a("./script"),j=a("./bufferutils"),k=a("bitcoin-ops"),l=a("typeforce"),m=a("./types"),n=a("varuint-bitcoin");f.DEFAULT_SEQUENCE=4294967295,f.SIGHASH_ALL=1,f.SIGHASH_NONE=2,f.SIGHASH_SINGLE=3,f.SIGHASH_ANYONECANPAY=128,f.SIGHASH_BITCOINCASHBIP143=64,f.ADVANCED_TRANSACTION_MARKER=0,f.ADVANCED_TRANSACTION_FLAG=1;var o=Buffer.allocUnsafe(0),p=[],q=Buffer.from("0000000000000000000000000000000000000000000000000000000000000000","hex"),r=Buffer.from("0000000000000000000000000000000000000000000000000000000000000001","hex"),s=Buffer.from("ffffffffffffffff","hex"),t={script:o,valueBuffer:s};f.fromBuffer=function(a,b){function c(b){return l+=b,a.slice(l-b,l)}function d(){var b=a.readUInt32LE(l);return l+=4,b}function e(){var b=a.readInt32LE(l);return l+=4,b}function g(){var b=j.readUInt64LE(a,l);return l+=8,b}function h(){var b=n.decode(a,l);return l+=n.decode.bytes,b}function i(){return c(h())}function k(){for(var a=h(),b=[],c=0;c<a;c++)b.push(i());return b}var l=0,m=new f;m.version=e();var o=a.readUInt8(l),q=a.readUInt8(l+1),r=!1;o===f.ADVANCED_TRANSACTION_MARKER&&q===f.ADVANCED_TRANSACTION_FLAG&&(l+=2,r=!0);for(var s=h(),t=0;t<s;++t)m.ins.push({hash:c(32),index:d(),script:i(),sequence:d(),witness:p});var u=h();for(t=0;t<u;++t)m.outs.push({value:g(),script:i()});if(r){for(t=0;t<s;++t)m.ins[t].witness=k();if(!m.hasWitnesses())throw new Error("Transaction has superfluous witness data")}if(m.locktime=d(),b)return m;if(l!==a.length)throw new Error("Transaction has unexpected data");return m},f.fromHex=function(a){return f.fromBuffer(Buffer.from(a,"hex"))},f.isCoinbaseHash=function(a){l(m.Hash256bit,a);for(var b=0;b<32;++b)if(0!==a[b])return!1;return!0},f.prototype.isCoinbase=function(){return 1===this.ins.length&&f.isCoinbaseHash(this.ins[0].hash)},f.prototype.addInput=function(a,b,c,d){return l(m.tuple(m.Hash256bit,m.UInt32,m.maybe(m.UInt32),m.maybe(m.Buffer)),arguments),m.Null(c)&&(c=f.DEFAULT_SEQUENCE),this.ins.push({hash:a,index:b,script:d||o,sequence:c,witness:p})-1},f.prototype.addOutput=function(a,b){return l(m.tuple(m.Buffer,m.Satoshi),arguments),this.outs.push({script:a,value:b})-1},f.prototype.hasWitnesses=function(){return this.ins.some(function(a){return 0!==a.witness.length})},f.prototype.weight=function(){var a=this.__byteLength(!1),b=this.__byteLength(!0);return 3*a+b},f.prototype.virtualSize=function(){return Math.ceil(this.weight()/4)},f.prototype.byteLength=function(){return this.__byteLength(!0)},f.prototype.__byteLength=function(a){var b=a&&this.hasWitnesses();return(b?10:8)+n.encodingLength(this.ins.length)+n.encodingLength(this.outs.length)+this.ins.reduce(function(a,b){return a+40+d(b.script)},0)+this.outs.reduce(function(a,b){return a+8+d(b.script)},0)+(b?this.ins.reduce(function(a,b){return a+e(b.witness)},0):0)},f.prototype.clone=function(){var a=new f;return a.version=this.version,a.locktime=this.locktime,a.ins=this.ins.map(function(a){return{hash:a.hash,index:a.index,script:a.script,sequence:a.sequence,witness:a.witness}}),a.outs=this.outs.map(function(a){return{script:a.script,value:a.value}}),a},f.prototype.hashForSignature=function(a,b,c){if(l(m.tuple(m.UInt32,m.Buffer,m.Number),arguments),a>=this.ins.length)return r;var d=i.compile(i.decompile(b).filter(function(a){return a!==k.OP_CODESEPARATOR})),e=this.clone();if((31&c)===f.SIGHASH_NONE)e.outs=[],e.ins.forEach(function(b,c){c!==a&&(b.sequence=0)});else if((31&c)===f.SIGHASH_SINGLE){if(a>=this.outs.length)return r;e.outs.length=a+1;for(var g=0;g<a;g++)e.outs[g]=t;e.ins.forEach(function(b,c){c!==a&&(b.sequence=0)})}c&f.SIGHASH_ANYONECANPAY?(e.ins=[e.ins[a]],e.ins[0].script=d):(e.ins.forEach(function(a){a.script=o}),e.ins[a].script=d);var j=Buffer.allocUnsafe(e.__byteLength(!1)+4);return j.writeInt32LE(c,j.length-4),e.__toBuffer(j,0,!1),h.hash256(j)},f.prototype.hashForWitnessV0=function(a,b,c,e){function g(a){s+=a.copy(r,s)}function i(a){s=r.writeUInt32LE(a,s)}function k(a){s=j.writeUInt64LE(r,a,s)}function o(a){n.encode(a,r,s),s+=n.encode.bytes}function p(a){o(a.length),g(a)}l(m.tuple(m.UInt32,m.Buffer,m.Satoshi,m.UInt32),arguments);var r,s,t=q,u=q,v=q;if(e&f.SIGHASH_ANYONECANPAY||(r=Buffer.allocUnsafe(36*this.ins.length),s=0,this.ins.forEach(function(a){g(a.hash),i(a.index)}),u=h.hash256(r)),e&f.SIGHASH_ANYONECANPAY||(31&e)===f.SIGHASH_SINGLE||(31&e)===f.SIGHASH_NONE||(r=Buffer.allocUnsafe(4*this.ins.length),s=0,this.ins.forEach(function(a){i(a.sequence)}),v=h.hash256(r)),(31&e)!==f.SIGHASH_SINGLE&&(31&e)!==f.SIGHASH_NONE){var w=this.outs.reduce(function(a,b){return a+8+d(b.script)},0);r=Buffer.allocUnsafe(w),s=0,this.outs.forEach(function(a){k(a.value),p(a.script)}),t=h.hash256(r)}else if((31&e)===f.SIGHASH_SINGLE&&a<this.outs.length){var x=this.outs[a];r=Buffer.allocUnsafe(8+d(x.script)),s=0,k(x.value),p(x.script),t=h.hash256(r)}r=Buffer.allocUnsafe(156+d(b)),s=0;var y=this.ins[a];return i(this.version),g(u),g(v),g(y.hash),i(y.index),p(b),k(c),i(y.sequence),g(t),i(this.locktime),i(e),h.hash256(r)},f.prototype.hashForCashSignature=function(a,b,c,d){if(l(m.tuple(m.UInt32,m.Buffer,m.Number,m.maybe(m.UInt53)),arguments),d&f.SIGHASH_BITCOINCASHBIP143){if(m.Null(c))throw new Error("Bitcoin Cash sighash requires value of input to be signed.");return this.hashForWitnessV0(a,b,c,d)}return this.hashForSignature(a,b,d)},f.prototype.getHash=function(){return h.hash256(this.__toBuffer(void 0,void 0,!1))},f.prototype.getId=function(){return g(this.getHash()).toString("hex")},f.prototype.toBuffer=function(a,b){return this.__toBuffer(a,b,!0)},f.prototype.__toBuffer=function(a,b,c){function d(b){o+=b.copy(a,o)}function e(b){o=a.writeUInt8(b,o)}function g(b){o=a.writeUInt32LE(b,o)}function h(b){o=a.writeInt32LE(b,o)}function i(b){o=j.writeUInt64LE(a,b,o)}function k(b){n.encode(b,a,o),o+=n.encode.bytes}function l(a){k(a.length),d(a)}function m(a){k(a.length),a.forEach(l)}a||(a=Buffer.allocUnsafe(this.__byteLength(c)));var o=b||0;h(this.version);var p=c&&this.hasWitnesses();return p&&(e(f.ADVANCED_TRANSACTION_MARKER),e(f.ADVANCED_TRANSACTION_FLAG)),k(this.ins.length),this.ins.forEach(function(a){d(a.hash),g(a.index),l(a.script),g(a.sequence)}),k(this.outs.length),this.outs.forEach(function(a){a.valueBuffer?d(a.valueBuffer):i(a.value),l(a.script)}),p&&this.ins.forEach(function(a){m(a.witness)}),g(this.locktime),void 0!==b?a.slice(b,o):a},f.prototype.toHex=function(){return this.toBuffer().toString("hex")},f.prototype.setInputScript=function(a,b){l(m.tuple(m.Number,m.Buffer),arguments),this.ins[a].script=b},f.prototype.setWitness=function(a,b){l(m.tuple(m.Number,[m.Buffer]),arguments),this.ins[a].witness=b},b.exports=f},{"./bufferutils":37,"./crypto":38,"./script":45,"./types":71,"bitcoin-ops":33,"buffer-reverse":103,"safe-buffer":311,typeforce:352,"varuint-bitcoin":361}],70:[function(a,b,c){function d(a){return A.indexOf(a)!==-1}function e(a){return B.indexOf(a)!==-1}function f(a,b,c){var d=[],e=[];switch(a){case z.P2PKH:d=b.slice(1),e=b.slice(0,1);break;case z.P2PK:d[0]=c?u.pubKey.output.decode(c):void 0,e=b.slice(0,1);break;case z.MULTISIG:if(c){var f=u.multisig.output.decode(c);d=f.pubKeys}e=b.slice(1).map(function(a){return 0===a.length?void 0:a})}return{pubKeys:d,signatures:e}}function g(a,b){if(0===a.length&&0===b.length)return{};var c,g,h,i,j,k,l,m,n,o,p=!1,q=!1,r=!1,s=u.decompile(a),v=u.classifyInput(s,!0);v===z.P2SH&&(r=!0,j=s[s.length-1],m=u.classifyOutput(j),c=u.scriptHash.output.encode(t.hash160(j)),g=z.P2SH,i=j);var w=u.classifyWitness(b,!0);if(w===z.P2WSH){if(k=b[b.length-1],l=u.classifyOutput(k),q=!0,p=!0,0===a.length){if(c=u.witnessScriptHash.output.encode(t.sha256(k)),g=z.P2WSH,void 0!==j)throw new Error("Redeem script given when unnecessary")}else{if(!j)throw new Error("No redeemScript provided for P2WSH, but scriptSig non-empty");if(n=u.witnessScriptHash.output.encode(t.sha256(k)),!j.equals(n))throw new Error("Redeem script didn't match witnessScript")}if(!d(u.classifyOutput(k)))throw new Error("unsupported witness script");i=k,h=l,o=b.slice(0,-1)}else if(w===z.P2WPKH){p=!0;var x=b[b.length-1],y=t.hash160(x);if(0===a.length){if(c=u.witnessPubKeyHash.output.encode(y),g=z.P2WPKH,"undefined"!=typeof j)throw new Error("Redeem script given when unnecessary")}else{if(!j)throw new Error("No redeemScript provided for P2WPKH, but scriptSig wasn't empty");if(n=u.witnessPubKeyHash.output.encode(y),!j.equals(n))throw new Error("Redeem script did not have the right witness program")}h=z.P2PKH,o=b}else if(j){if(!e(m))throw new Error("Bad redeemscript!");i=j,h=m,o=s.slice(0,-1)}else g=h=u.classifyInput(a),o=s;var A=f(h,o,i),B={pubKeys:A.pubKeys,signatures:A.signatures,prevOutScript:c,prevOutType:g,signType:h,signScript:i,witness:Boolean(p)};return r&&(B.redeemScript=j,B.redeemScriptType=m),q&&(B.witnessScript=k,B.witnessScriptType=l),B}function h(a,b,c,d){if(a.signType===z.MULTISIG&&a.signScript&&a.pubKeys.length!==a.signatures.length){var e=a.signatures.concat();a.signatures=a.pubKeys.map(function(f){var g,h=ECPair.fromPublicKeyBuffer(f);return e.some(function(f,i){if(!f)return!1;var j,k=C.parseScriptSignature(f);return j=d?b.hashForCashSignature(c,a.signScript,a.value,k.hashType):a.witness?b.hashForWitnessV0(c,a.signScript,a.value,k.hashType):b.hashForSignature(c,a.signScript,k.hashType),!!h.verify(j,k.signature)&&(e[i]=void 0,g=f,!0)}),g})}}function i(a,b,c){x(y.Buffer,a);var d=u.decompile(a);b||(b=u.classifyOutput(a));var e=[];switch(b){case z.P2PKH:if(!c)break;var f=d[2],g=t.hash160(c);f.equals(g)&&(e=[c]);break;case z.P2WPKH:if(!c)break;var h=d[1],i=t.hash160(c);h.equals(i)&&(e=[c]);break;case z.P2PK:e=d.slice(0,1);break;case z.MULTISIG:e=d.slice(1,-2);break;default:return{scriptType:b}}return{pubKeys:e,scriptType:b,signatures:e.map(function(){})}}function j(a,b){if(a.prevOutType){if(a.prevOutType!==z.P2SH)throw new Error("PrevOutScript must be P2SH");var c=u.decompile(a.prevOutScript)[1];if(!c.equals(b))throw new Error("Inconsistent hash160(RedeemScript)")}}function k(a,b){if(a.prevOutType){if(a.prevOutType!==z.P2WSH)throw new Error("PrevOutScript must be P2WSH");var c=u.decompile(a.prevOutScript)[1];if(!c.equals(b))throw new Error("Inconsistent sha25(WitnessScript)")}}function l(a,b,c,d,e){var f,g,h,l,m,n,o,p,q,r=!1,s=!1,v=!1;if(c&&e){if(m=t.hash160(c),o=t.sha256(e),j(a,m),!c.equals(u.witnessScriptHash.output.encode(o)))throw new Error("Witness script inconsistent with redeem script");if(f=i(e,void 0,b),!f.pubKeys)throw new Error('WitnessScript not supported "'+u.toASM(c)+'"');g=u.types.P2SH,h=u.scriptHash.output.encode(m),r=s=v=!0,l=u.types.P2WSH,p=n=f.scriptType,q=e}else if(c){if(m=t.hash160(c),j(a,m),f=i(c,void 0,b),!f.pubKeys)throw new Error('RedeemScript not supported "'+u.toASM(c)+'"');g=u.types.P2SH,h=u.scriptHash.output.encode(m),r=!0,p=l=f.scriptType,q=c,s=p===u.types.P2WPKH}else if(e){if(o=t.sha256(e),k(a,o),f=i(e,void 0,b),!f.pubKeys)throw new Error('WitnessScript not supported "'+u.toASM(c)+'"');g=u.types.P2WSH,h=u.witnessScriptHash.output.encode(o),s=v=!0,p=n=f.scriptType,q=e}else if(a.prevOutType){if(a.prevOutType===z.P2SH||a.prevOutType===z.P2WSH)throw new Error("PrevOutScript is "+a.prevOutType+", requires redeemScript");if(g=a.prevOutType,h=a.prevOutScript,f=i(a.prevOutScript,a.prevOutType,b),!f.pubKeys)return;s=a.prevOutType===z.P2WPKH,p=g,q=h}else h=u.pubKeyHash.output.encode(t.hash160(b)),f=i(h,z.P2PKH,b),g=z.P2PKH,s=!1,p=g,q=h;if(void 0!==d||s){if(x(y.Satoshi,d),void 0!==a.value&&a.value!==d)throw new Error("Input didn't match witnessValue");a.value=d}p===z.P2WPKH&&(q=u.pubKeyHash.output.encode(u.witnessPubKeyHash.output.decode(q))),r&&(a.redeemScript=c,a.redeemScriptType=l),v&&(a.witnessScript=e,a.witnessScriptType=n),a.pubKeys=f.pubKeys,a.signatures=f.signatures,a.signScript=q,a.signType=p,a.prevOutScript=h,a.prevOutType=g,a.witness=s}function m(a,b,c,d){if(a===z.P2PKH){if(1===b.length&&Buffer.isBuffer(b[0])&&1===c.length)return u.pubKeyHash.input.encodeStack(b[0],c[0])}else if(a===z.P2PK){if(1===b.length&&Buffer.isBuffer(b[0]))return u.pubKey.input.encodeStack(b[0])}else{if(a!==z.MULTISIG)throw new Error("Not yet supported");if(b.length>0)return b=b.map(function(a){return a||w.OP_0}),d||(b=b.filter(function(a){return a!==w.OP_0})),u.multisig.input.encodeStack(b)}if(!d)throw new Error("Not enough signatures provided");return[]}function n(a,b){var c=a.prevOutType,f=[],g=[];d(c)&&(f=m(c,a.signatures,a.pubKeys,b));var h=!1;if(c===u.types.P2SH){if(!b&&!e(a.redeemScriptType))throw new Error("Impossible to sign this type");d(a.redeemScriptType)&&(f=m(a.redeemScriptType,a.signatures,a.pubKeys,b)),a.redeemScriptType&&(h=!0,c=a.redeemScriptType)}switch(c){case u.types.P2WPKH:g=m(u.types.P2PKH,a.signatures,a.pubKeys,b);break;case u.types.P2WSH:if(!b&&!d(a.witnessScriptType))throw new Error("Impossible to sign this type");d(a.witnessScriptType)&&(g=m(a.witnessScriptType,a.signatures,a.pubKeys,b),g.push(a.witnessScript),c=a.witnessScriptType)}return h&&f.push(a.redeemScript),{type:c,script:u.compile(f),witness:g}}function o(a,b){this.prevTxMap={},this.network=a||v.bitcoin,this.maximumFeeRate=b||1e3,this.inputs=[],this.bitcoinCash=!1,this.tx=new D}function p(a){return void 0!==a.prevOutScript&&void 0!==a.signScript&&void 0!==a.pubKeys&&void 0!==a.signatures&&a.signatures.length===a.pubKeys.length&&a.pubKeys.length>0&&void 0!==a.witness}function q(a){return a.readUInt8(a.length-1)}var Buffer=a("safe-buffer").Buffer,r=a("buffer-reverse"),s=a("./address"),t=a("./crypto"),u=a("./script"),v=a("./networks"),w=a("bitcoin-ops"),x=a("typeforce"),y=a("./types"),z=u.types,A=[u.types.P2PKH,u.types.P2PK,u.types.MULTISIG],B=A.concat([u.types.P2WPKH,u.types.P2WSH]),ECPair=a("./ecpair"),C=a("./ecsignature"),D=a("./transaction");o.prototype.enableBitcoinCash=function(a){"undefined"==typeof a&&(a=!0),this.bitcoinCash=a},o.prototype.setLockTime=function(a){if(x(y.UInt32,a),this.inputs.some(function(a){return!!a.signatures&&a.signatures.some(function(a){return a})}))throw new Error("No, this would invalidate signatures");this.tx.locktime=a},o.prototype.setVersion=function(a){x(y.UInt32,a),this.tx.version=a},o.fromTransaction=function(a,b,c){var d=new o(b);return d.enableBitcoinCash(Boolean(c)),d.setVersion(a.version),d.setLockTime(a.locktime),a.outs.forEach(function(a){d.addOutput(a.script,a.value)}),a.ins.forEach(function(a){d.__addInputUnsafe(a.hash,a.index,{sequence:a.sequence,script:a.script,value:a.value,witness:a.witness})}),d.inputs.forEach(function(b,d){h(b,a,d,c)}),d},o.prototype.addInput=function(a,b,c,d){if(!this.__canModifyInputs())throw new Error("No, this would invalidate signatures");var e;if("string"==typeof a)a=r(Buffer.from(a,"hex"));else if(a instanceof D){var f=a.outs[b];d=f.script,e=f.value,a=a.getHash()}return this.__addInputUnsafe(a,b,{sequence:c,prevOutScript:d,value:e})},o.prototype.__addInputUnsafe=function(a,b,c){if(D.isCoinbaseHash(a))throw new Error("coinbase inputs not supported");var d=a.toString("hex")+":"+b;if(void 0!==this.prevTxMap[d])throw new Error("Duplicate TxOut: "+d);var e={};if(void 0!==c.script&&(e=g(c.script,c.witness||[])),void 0!==c.value&&(e.value=c.value),!e.prevOutScript&&c.prevOutScript){var f;if(!e.pubKeys&&!e.signatures){var h=i(c.prevOutScript);h.pubKeys&&(e.pubKeys=h.pubKeys,e.signatures=h.signatures),f=h.scriptType}e.prevOutScript=c.prevOutScript,e.prevOutType=f||u.classifyOutput(c.prevOutScript)}var j=this.tx.addInput(a,b,c.sequence,c.scriptSig);return this.inputs[j]=e,this.prevTxMap[d]=j,j},o.prototype.addOutput=function(a,b){if(!this.__canModifyOutputs())throw new Error("No, this would invalidate signatures");return"string"==typeof a&&(a=s.toOutputScript(a,this.network)),this.tx.addOutput(a,b)},o.prototype.build=function(){return this.__build(!1)},o.prototype.buildIncomplete=function(){return this.__build(!0)},o.prototype.__build=function(a){if(!a){if(!this.tx.ins.length)throw new Error("Transaction has no inputs");if(!this.tx.outs.length)throw new Error("Transaction has no outputs")}var b=this.tx.clone();if(this.inputs.forEach(function(c,e){var f=c.witnessScriptType||c.redeemScriptType||c.prevOutType;if(!f&&!a)throw new Error("Transaction is not complete");var g=n(c,a);if(!a&&!d(g.type)&&g.type!==u.types.P2WPKH)throw new Error(g.type+" not supported");b.setInputScript(e,g.script),b.setWitness(e,g.witness)}),!a&&this.__overMaximumFees(b.virtualSize()))throw new Error("Transaction has absurd fees");return b},o.prototype.sign=function(a,b,c,d,e,f){if(b.network!==this.network)throw new Error("Inconsistent network");if(!this.inputs[a])throw new Error("No input at index: "+a);d=d||D.SIGHASH_ALL;var g=this.inputs[a];if(void 0!==g.redeemScript&&c&&!g.redeemScript.equals(c))throw new Error("Inconsistent redeemScript");var h=b.getPublicKeyBuffer();if(!p(g)&&(l(g,h,c,e,f),!p(g)))throw Error(g.prevOutType+" not supported");var i;i=this.bitcoinCash?this.tx.hashForCashSignature(a,g.signScript,e,d):g.witness?this.tx.hashForWitnessV0(a,g.signScript,e,d):this.tx.hashForSignature(a,g.signScript,d);var j=g.pubKeys.some(function(a,c){if(!h.equals(a))return!1;if(g.signatures[c])throw new Error("Signature already exists");if(!b.compressed&&g.signType===z.P2WPKH)throw new Error("BIP143 rejects uncompressed public keys in P2WPKH or P2WSH");return g.signatures[c]=b.sign(i).toScriptSignature(d),!0});if(!j)throw new Error("Key pair cannot sign for this input")},o.prototype.__canModifyInputs=function(){return this.inputs.every(function(a){return void 0===a.signatures||a.signatures.every(function(a){if(!a)return!0;var b=q(a);return b&D.SIGHASH_ANYONECANPAY})})},o.prototype.__canModifyOutputs=function(){var a=this.tx.ins.length,b=this.tx.outs.length;return this.inputs.every(function(c){return void 0===c.signatures||c.signatures.every(function(c){if(!c)return!0;var d=q(c),e=31&d;return e===D.SIGHASH_NONE||(e===D.SIGHASH_SINGLE?a<=b:void 0)})})},o.prototype.__overMaximumFees=function(a){var b=this.inputs.reduce(function(a,b){return a+(b.value>>>0)},0),c=this.tx.outs.reduce(function(a,b){return a+b.value},0),d=b-c,e=d/a;return e>this.maximumFeeRate},b.exports=o},{"./address":35,"./crypto":38,"./ecpair":40,"./ecsignature":41,"./networks":44,"./script":45,"./transaction":69,"./types":71,"bitcoin-ops":33,"buffer-reverse":103,"safe-buffer":311,typeforce:352}],71:[function(a,b,c){function d(a){return g.UInt32(a)&&a<=h}function e(a){return g.String(a)&&a.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}function f(a){return g.UInt53(a)&&a<=i}var g=a("typeforce"),h=Math.pow(2,31)-1;e.toJSON=function(){return"BIP32 derivation path"};var i=21e14,j=g.quacksLike("BigInteger"),k=g.quacksLike("Point"),l=g.compile({r:j,s:j}),m=g.compile({messagePrefix:g.oneOf(g.Buffer,g.String),bip32:{public:g.UInt32,private:g.UInt32},pubKeyHash:g.UInt8,scriptHash:g.UInt8,wif:g.UInt8}),n={BigInt:j,BIP32Path:e,Buffer256bit:g.BufferN(32),ECPoint:k,ECSignature:l,Hash160bit:g.BufferN(20),Hash256bit:g.BufferN(32),Network:m,Satoshi:f,UInt31:d};for(var o in g)n[o]=g[o];b.exports=n},{typeforce:352}],72:[function(a,b,c){(function(Buffer){function c(a){var b=l("sha256").update(a).digest();return l("sha256").update(b).digest()}function d(a){var b=l("sha256").update(a).digest();return l("ripemd160").update(b).digest()}function e(a,b,c){return c&&(b+=4),Buffer.concat([new Buffer([b+27]),a])}function f(a){if(65!==a.length)throw new Error("Invalid signature length");var b=a.readUInt8(0)-27;if(b>7)throw new Error("Invalid signature parameter");return{compressed:!!(4&b),recovery:3&b,signature:a.slice(1)}}function g(a,b){var d=n.encodingLength(a.length),e=new Buffer(b.length+d+a.length);return e.write(b,0),n.encode(a.length,e,b.length),e.write(a,b.length+d),c(e)}function h(a,b,c,d){var f=g(a,b),h=m.sign(f,c);return e(h.signature,h.recovery,d)}function i(a,b,c,e){Buffer.isBuffer(e)||(e=new Buffer(e,"base64"));var h=f(e),i=g(a,b),l=m.recover(i,h.signature,h.recovery,h.compressed),n=d(l),o=j.decode(c).slice(1);return k(n,o)}var j=a("bs58check"),k=a("buffer-equals"),l=a("create-hash"),m=a("secp256k1"),n=a("varuint-bitcoin");b.exports={magicHash:g,sign:h,verify:i}}).call(this,a("buffer").Buffer)},{bs58check:75,buffer:105,"buffer-equals":102,"create-hash":128,secp256k1:312,"varuint-bitcoin":361}],73:[function(a,b,c){b.exports=function(a){function b(b){if(0===b.length)return"";for(var c=[0],d=0;d<b.length;++d){for(var e=0,g=b[d];e<c.length;++e)g+=c[e]<<8,c[e]=g%f,g=g/f|0;for(;g>0;)c.push(g%f),g=g/f|0}for(var h="",i=0;0===b[i]&&i<b.length-1;++i)h+=a[0];for(var j=c.length-1;j>=0;--j)h+=a[c[j]];return h}function c(a){if(0===a.length)return[];for(var b=[0],c=0;c<a.length;c++){var d=e[a[c]];if(void 0===d)return;for(var h=0,i=d;h<b.length;++h)i+=b[h]*f,b[h]=255&i,i>>=8;for(;i>0;)b.push(255&i),i>>=8}for(var j=0;a[j]===g&&j<a.length-1;++j)b.push(0);return b.reverse()}function d(a){var b=c(a);if(b)return b;throw new Error("Non-base"+f+" character")}for(var e={},f=a.length,g=a.charAt(0),h=0;h<a.length;h++)e[a.charAt(h)]=h;return{encode:b,decodeUnsafe:c,decode:d}}},{}],74:[function(a,b,c){var d=a("base-x"),e="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";b.exports=d(e)},{"base-x":73}],75:[function(a,b,c){(function(Buffer){"use strict";function c(a){var b=i("sha256").update(a).digest();return i("sha256").update(b).digest()}function d(a){var b=c(a);return h.encode(Buffer.concat([a,b],a.length+4))}function e(a){var b=a.slice(0,-4),d=a.slice(-4),e=c(b);if(!(d[0]^e[0]|d[1]^e[1]|d[2]^e[2]|d[3]^e[3]))return b}function f(a){var b=h.decodeUnsafe(a);if(b){var c=new Buffer(b);return e(c)}}function g(a){var b=h.decode(a),c=new Buffer(b),d=e(c);if(!d)throw new Error("Invalid checksum");return d}var h=a("bs58"),i=a("create-hash");b.exports={encode:d,decode:g,decodeUnsafe:f,decodeRaw:f}}).call(this,a("buffer").Buffer)},{bs58:74,buffer:105,"create-hash":128}],76:[function(a,b,c){function d(a){this.rand=a}var e;if(b.exports=function(a){return e||(e=new d(null)),e.generate(a)},b.exports.Rand=d,d.prototype.generate=function(a){return this._rand(a)},d.prototype._rand=function(a){if(this.rand.getBytes)return this.rand.getBytes(a);for(var b=new Uint8Array(a),c=0;c<b.length;c++)b[c]=this.rand.getByte();return b},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?d.prototype._rand=function(a){var b=new Uint8Array(a);return self.crypto.getRandomValues(b),b}:self.msCrypto&&self.msCrypto.getRandomValues?d.prototype._rand=function(a){var b=new Uint8Array(a);return self.msCrypto.getRandomValues(b),b}:"object"==typeof window&&(d.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var f=a("crypto");if("function"!=typeof f.randomBytes)throw new Error("Not supported");d.prototype._rand=function(a){return f.randomBytes(a)}}catch(a){}},{crypto:77}],77:[function(a,b,c){},{}],78:[function(a,b,c){function d(a){Buffer.isBuffer(a)||(a=Buffer.from(a));for(var b=a.length/4|0,c=new Array(b),d=0;d<b;d++)c[d]=a.readUInt32BE(4*d);return c}function e(a){for(var b=0;b<a.length;a++)a[b]=0}function f(a,b,c,d,e){for(var f,g,h,i,j=c[0],k=c[1],l=c[2],m=c[3],n=a[0]^b[0],o=a[1]^b[1],p=a[2]^b[2],q=a[3]^b[3],r=4,s=1;s<e;s++)f=j[n>>>24]^k[o>>>16&255]^l[p>>>8&255]^m[255&q]^b[r++],g=j[o>>>24]^k[p>>>16&255]^l[q>>>8&255]^m[255&n]^b[r++],h=j[p>>>24]^k[q>>>16&255]^l[n>>>8&255]^m[255&o]^b[r++],i=j[q>>>24]^k[n>>>16&255]^l[o>>>8&255]^m[255&p]^b[r++],n=f,o=g,p=h,q=i;return f=(d[n>>>24]<<24|d[o>>>16&255]<<16|d[p>>>8&255]<<8|d[255&q])^b[r++],g=(d[o>>>24]<<24|d[p>>>16&255]<<16|d[q>>>8&255]<<8|d[255&n])^b[r++],h=(d[p>>>24]<<24|d[q>>>16&255]<<16|d[n>>>8&255]<<8|d[255&o])^b[r++],i=(d[q>>>24]<<24|d[n>>>16&255]<<16|d[o>>>8&255]<<8|d[255&p])^b[r++],f>>>=0,g>>>=0,h>>>=0,i>>>=0,[f,g,h,i]}function g(a){this._key=d(a),this._reset()}var Buffer=a("safe-buffer").Buffer,h=[0,1,2,4,8,16,32,64,128,27,54],i=function(){for(var a=new Array(256),b=0;b<256;b++)b<128?a[b]=b<<1:a[b]=b<<1^283;for(var c=[],d=[],e=[[],[],[],[]],f=[[],[],[],[]],g=0,h=0,i=0;i<256;++i){var j=h^h<<1^h<<2^h<<3^h<<4;j=j>>>8^255&j^99,c[g]=j,d[j]=g;var k=a[g],l=a[k],m=a[l],n=257*a[j]^16843008*j;e[0][g]=n<<24|n>>>8,e[1][g]=n<<16|n>>>16,e[2][g]=n<<8|n>>>24,e[3][g]=n,n=16843009*m^65537*l^257*k^16843008*g,f[0][j]=n<<24|n>>>8,f[1][j]=n<<16|n>>>16,f[2][j]=n<<8|n>>>24,f[3][j]=n,0===g?g=h=1:(g=k^a[a[a[m^k]]],h^=a[a[h]])}return{SBOX:c,INV_SBOX:d,SUB_MIX:e,INV_SUB_MIX:f}}();g.blockSize=16,g.keySize=32,g.prototype.blockSize=g.blockSize,g.prototype.keySize=g.keySize,g.prototype._reset=function(){for(var a=this._key,b=a.length,c=b+6,d=4*(c+1),e=[],f=0;f<b;f++)e[f]=a[f];for(f=b;f<d;f++){var g=e[f-1];f%b===0?(g=g<<8|g>>>24,g=i.SBOX[g>>>24]<<24|i.SBOX[g>>>16&255]<<16|i.SBOX[g>>>8&255]<<8|i.SBOX[255&g],g^=h[f/b|0]<<24):b>6&&f%b===4&&(g=i.SBOX[g>>>24]<<24|i.SBOX[g>>>16&255]<<16|i.SBOX[g>>>8&255]<<8|i.SBOX[255&g]),e[f]=e[f-b]^g}for(var j=[],k=0;k<d;k++){var l=d-k,m=e[l-(k%4?0:4)];k<4||l<=4?j[k]=m:j[k]=i.INV_SUB_MIX[0][i.SBOX[m>>>24]]^i.INV_SUB_MIX[1][i.SBOX[m>>>16&255]]^i.INV_SUB_MIX[2][i.SBOX[m>>>8&255]]^i.INV_SUB_MIX[3][i.SBOX[255&m]]}this._nRounds=c,this._keySchedule=e,this._invKeySchedule=j},g.prototype.encryptBlockRaw=function(a){return a=d(a),f(a,this._keySchedule,i.SUB_MIX,i.SBOX,this._nRounds)},g.prototype.encryptBlock=function(a){var b=this.encryptBlockRaw(a),c=Buffer.allocUnsafe(16);return c.writeUInt32BE(b[0],0),c.writeUInt32BE(b[1],4),c.writeUInt32BE(b[2],8),c.writeUInt32BE(b[3],12),c},g.prototype.decryptBlock=function(a){a=d(a);var b=a[1];a[1]=a[3],a[3]=b;var c=f(a,this._invKeySchedule,i.INV_SUB_MIX,i.INV_SBOX,this._nRounds),e=Buffer.allocUnsafe(16);return e.writeUInt32BE(c[0],0),e.writeUInt32BE(c[3],4),e.writeUInt32BE(c[2],8),e.writeUInt32BE(c[1],12),e},g.prototype.scrub=function(){e(this._keySchedule),e(this._invKeySchedule),e(this._key)},b.exports.AES=g},{"safe-buffer":311}],79:[function(a,b,c){function d(a,b){var c=0;a.length!==b.length&&c++;for(var d=Math.min(a.length,b.length),e=0;e<d;++e)c+=a[e]^b[e];return c}function e(a,b,c){if(12===b.length)return a._finID=Buffer.concat([b,Buffer.from([0,0,0,1])]),Buffer.concat([b,Buffer.from([0,0,0,2])]);var d=new j(c),e=b.length,f=e%16;d.update(b),f&&(f=16-f,d.update(Buffer.alloc(f,0))),d.update(Buffer.alloc(8,0));var g=8*e,h=Buffer.alloc(8);h.writeUIntBE(g,0,8),d.update(h),a._finID=d.state;var i=Buffer.from(a._finID);return l(i),i}function f(a,b,c,d){h.call(this);var f=Buffer.alloc(4,0);this._cipher=new g.AES(b);var i=this._cipher.encryptBlock(f);this._ghash=new j(i),c=e(this,c,i),this._prev=Buffer.from(c),this._cache=Buffer.allocUnsafe(0),this._secCache=Buffer.allocUnsafe(0),this._decrypt=d,this._alen=0,this._len=0,this._mode=a,this._authTag=null,this._called=!1}var g=a("./aes"),Buffer=a("safe-buffer").Buffer,h=a("cipher-base"),i=a("inherits"),j=a("./ghash"),k=a("buffer-xor"),l=a("./incr32");i(f,h),f.prototype._update=function(a){if(!this._called&&this._alen){var b=16-this._alen%16;b<16&&(b=Buffer.alloc(b,0),this._ghash.update(b))}this._called=!0;var c=this._mode.encrypt(this,a);return this._decrypt?this._ghash.update(a):this._ghash.update(c),this._len+=a.length,c},f.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var a=k(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&d(a,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=a,this._cipher.scrub()},f.prototype.getAuthTag=function(){if(this._decrypt||!Buffer.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},f.prototype.setAuthTag=function(a){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=a},f.prototype.setAAD=function(a){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(a),this._alen+=a.length},b.exports=f},{"./aes":78,"./ghash":83,"./incr32":84,"buffer-xor":104,"cipher-base":107,inherits:246,"safe-buffer":311}],80:[function(a,b,c){function d(){return Object.keys(g)}var e=a("./encrypter"),f=a("./decrypter"),g=a("./modes/list.json");c.createCipher=c.Cipher=e.createCipher,c.createCipheriv=c.Cipheriv=e.createCipheriv,c.createDecipher=c.Decipher=f.createDecipher,c.createDecipheriv=c.Decipheriv=f.createDecipheriv,c.listCiphers=c.getCiphers=d},{"./decrypter":81,"./encrypter":82,"./modes/list.json":92}],81:[function(a,b,c){function d(a,b,c){l.call(this),this._cache=new e,this._last=void 0,this._cipher=new m.AES(b),this._prev=Buffer.from(c),this._mode=a,this._autopadding=!0}function e(){this.cache=Buffer.allocUnsafe(0)}function f(a){for(var b=a[15],c=-1;++c<b;)if(a[c+(16-b)]!==b)throw new Error("unable to decrypt data");if(16!==b)return a.slice(0,16-b)}function g(a,b,c){var e=j[a.toLowerCase()];if(!e)throw new TypeError("invalid suite type");if("string"==typeof c&&(c=Buffer.from(c)),"GCM"!==e.mode&&c.length!==e.iv)throw new TypeError("invalid iv length "+c.length);if("string"==typeof b&&(b=Buffer.from(b)),b.length!==e.key/8)throw new TypeError("invalid key length "+b.length);return"stream"===e.type?new k(e.module,b,c,!0):"auth"===e.type?new i(e.module,b,c,!0):new d(e.module,b,c)}function h(a,b){var c=j[a.toLowerCase()];if(!c)throw new TypeError("invalid suite type");var d=n(b,!1,c.key,c.iv);return g(a,d.key,d.iv)}var i=a("./authCipher"),Buffer=a("safe-buffer").Buffer,j=a("./modes"),k=a("./streamCipher"),l=a("cipher-base"),m=a("./aes"),n=a("evp_bytestokey"),o=a("inherits");o(d,l),d.prototype._update=function(a){this._cache.add(a);for(var b,c,d=[];b=this._cache.get(this._autopadding);)c=this._mode.decrypt(this,b),d.push(c);return Buffer.concat(d)},d.prototype._final=function(){var a=this._cache.flush();if(this._autopadding)return f(this._mode.decrypt(this,a));if(a)throw new Error("data not multiple of block length")},d.prototype.setAutoPadding=function(a){return this._autopadding=!!a,this},e.prototype.add=function(a){this.cache=Buffer.concat([this.cache,a]);
8
},e.prototype.get=function(a){var b;if(a){if(this.cache.length>16)return b=this.cache.slice(0,16),this.cache=this.cache.slice(16),b}else if(this.cache.length>=16)return b=this.cache.slice(0,16),this.cache=this.cache.slice(16),b;return null},e.prototype.flush=function(){if(this.cache.length)return this.cache},c.createDecipher=h,c.createDecipheriv=g},{"./aes":78,"./authCipher":79,"./modes":91,"./streamCipher":94,"cipher-base":107,evp_bytestokey:229,inherits:246,"safe-buffer":311}],82:[function(a,b,c){function d(a,b,c){k.call(this),this._cache=new e,this._cipher=new l.AES(b),this._prev=Buffer.from(c),this._mode=a,this._autopadding=!0}function e(){this.cache=Buffer.allocUnsafe(0)}function f(a,b,c){var e=h[a.toLowerCase()];if(!e)throw new TypeError("invalid suite type");if("string"==typeof b&&(b=Buffer.from(b)),b.length!==e.key/8)throw new TypeError("invalid key length "+b.length);if("string"==typeof c&&(c=Buffer.from(c)),"GCM"!==e.mode&&c.length!==e.iv)throw new TypeError("invalid iv length "+c.length);return"stream"===e.type?new j(e.module,b,c):"auth"===e.type?new i(e.module,b,c):new d(e.module,b,c)}function g(a,b){var c=h[a.toLowerCase()];if(!c)throw new TypeError("invalid suite type");var d=m(b,!1,c.key,c.iv);return f(a,d.key,d.iv)}var h=a("./modes"),i=a("./authCipher"),Buffer=a("safe-buffer").Buffer,j=a("./streamCipher"),k=a("cipher-base"),l=a("./aes"),m=a("evp_bytestokey"),n=a("inherits");n(d,k),d.prototype._update=function(a){this._cache.add(a);for(var b,c,d=[];b=this._cache.get();)c=this._mode.encrypt(this,b),d.push(c);return Buffer.concat(d)};var o=Buffer.alloc(16,16);d.prototype._final=function(){var a=this._cache.flush();if(this._autopadding)return a=this._mode.encrypt(this,a),this._cipher.scrub(),a;if(!a.equals(o))throw this._cipher.scrub(),new Error("data not multiple of block length")},d.prototype.setAutoPadding=function(a){return this._autopadding=!!a,this},e.prototype.add=function(a){this.cache=Buffer.concat([this.cache,a])},e.prototype.get=function(){if(this.cache.length>15){var a=this.cache.slice(0,16);return this.cache=this.cache.slice(16),a}return null},e.prototype.flush=function(){for(var a=16-this.cache.length,b=Buffer.allocUnsafe(a),c=-1;++c<a;)b.writeUInt8(a,c);return Buffer.concat([this.cache,b])},c.createCipheriv=f,c.createCipher=g},{"./aes":78,"./authCipher":79,"./modes":91,"./streamCipher":94,"cipher-base":107,evp_bytestokey:229,inherits:246,"safe-buffer":311}],83:[function(a,b,c){function d(a){return[a.readUInt32BE(0),a.readUInt32BE(4),a.readUInt32BE(8),a.readUInt32BE(12)]}function e(a){var b=Buffer.allocUnsafe(16);return b.writeUInt32BE(a[0]>>>0,0),b.writeUInt32BE(a[1]>>>0,4),b.writeUInt32BE(a[2]>>>0,8),b.writeUInt32BE(a[3]>>>0,12),b}function f(a){this.h=a,this.state=Buffer.alloc(16,0),this.cache=Buffer.allocUnsafe(0)}var Buffer=a("safe-buffer").Buffer,g=Buffer.alloc(16,0);f.prototype.ghash=function(a){for(var b=-1;++b<a.length;)this.state[b]^=a[b];this._multiply()},f.prototype._multiply=function(){for(var a,b,c,f=d(this.h),g=[0,0,0,0],h=-1;++h<128;){for(b=0!==(this.state[~~(h/8)]&1<<7-h%8),b&&(g[0]^=f[0],g[1]^=f[1],g[2]^=f[2],g[3]^=f[3]),c=0!==(1&f[3]),a=3;a>0;a--)f[a]=f[a]>>>1|(1&f[a-1])<<31;f[0]=f[0]>>>1,c&&(f[0]=f[0]^225<<24)}this.state=e(g)},f.prototype.update=function(a){this.cache=Buffer.concat([this.cache,a]);for(var b;this.cache.length>=16;)b=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(b)},f.prototype.final=function(a,b){return this.cache.length&&this.ghash(Buffer.concat([this.cache,g],16)),this.ghash(e([0,a,0,b])),this.state},b.exports=f},{"safe-buffer":311}],84:[function(a,b,c){function d(a){for(var b,c=a.length;c--;){if(b=a.readUInt8(c),255!==b){b++,a.writeUInt8(b,c);break}a.writeUInt8(0,c)}}b.exports=d},{}],85:[function(a,b,c){var d=a("buffer-xor");c.encrypt=function(a,b){var c=d(b,a._prev);return a._prev=a._cipher.encryptBlock(c),a._prev},c.decrypt=function(a,b){var c=a._prev;a._prev=b;var e=a._cipher.decryptBlock(b);return d(e,c)}},{"buffer-xor":104}],86:[function(a,b,c){function d(a,b,c){var d=b.length,f=e(b,a._cache);return a._cache=a._cache.slice(d),a._prev=Buffer.concat([a._prev,c?b:f]),f}var Buffer=a("safe-buffer").Buffer,e=a("buffer-xor");c.encrypt=function(a,b,c){for(var e,f=Buffer.allocUnsafe(0);b.length;){if(0===a._cache.length&&(a._cache=a._cipher.encryptBlock(a._prev),a._prev=Buffer.allocUnsafe(0)),!(a._cache.length<=b.length)){f=Buffer.concat([f,d(a,b,c)]);break}e=a._cache.length,f=Buffer.concat([f,d(a,b.slice(0,e),c)]),b=b.slice(e)}return f}},{"buffer-xor":104,"safe-buffer":311}],87:[function(a,b,c){function d(a,b,c){for(var d,f,g,h=-1,i=8,j=0;++h<i;)d=a._cipher.encryptBlock(a._prev),f=b&1<<7-h?128:0,g=d[0]^f,j+=(128&g)>>h%8,a._prev=e(a._prev,c?f:g);return j}function e(a,b){var c=a.length,d=-1,e=Buffer.allocUnsafe(a.length);for(a=Buffer.concat([a,Buffer.from([b])]);++d<c;)e[d]=a[d]<<1|a[d+1]>>7;return e}var Buffer=a("safe-buffer").Buffer;c.encrypt=function(a,b,c){for(var e=b.length,f=Buffer.allocUnsafe(e),g=-1;++g<e;)f[g]=d(a,b[g],c);return f}},{"safe-buffer":311}],88:[function(a,b,c){function d(a,b,c){var d=a._cipher.encryptBlock(a._prev),e=d[0]^b;return a._prev=Buffer.concat([a._prev.slice(1),Buffer.from([c?b:e])]),e}var Buffer=a("safe-buffer").Buffer;c.encrypt=function(a,b,c){for(var e=b.length,f=Buffer.allocUnsafe(e),g=-1;++g<e;)f[g]=d(a,b[g],c);return f}},{"safe-buffer":311}],89:[function(a,b,c){function d(a){var b=a._cipher.encryptBlockRaw(a._prev);return f(a._prev),b}var e=a("buffer-xor"),Buffer=a("safe-buffer").Buffer,f=a("../incr32"),g=16;c.encrypt=function(a,b){var c=Math.ceil(b.length/g),f=a._cache.length;a._cache=Buffer.concat([a._cache,Buffer.allocUnsafe(c*g)]);for(var h=0;h<c;h++){var i=d(a),j=f+h*g;a._cache.writeUInt32BE(i[0],j+0),a._cache.writeUInt32BE(i[1],j+4),a._cache.writeUInt32BE(i[2],j+8),a._cache.writeUInt32BE(i[3],j+12)}var k=a._cache.slice(0,b.length);return a._cache=a._cache.slice(b.length),e(b,k)}},{"../incr32":84,"buffer-xor":104,"safe-buffer":311}],90:[function(a,b,c){c.encrypt=function(a,b){return a._cipher.encryptBlock(b)},c.decrypt=function(a,b){return a._cipher.decryptBlock(b)}},{}],91:[function(a,b,c){var d={ECB:a("./ecb"),CBC:a("./cbc"),CFB:a("./cfb"),CFB8:a("./cfb8"),CFB1:a("./cfb1"),OFB:a("./ofb"),CTR:a("./ctr"),GCM:a("./ctr")},e=a("./list.json");for(var f in e)e[f].module=d[e[f].mode];b.exports=e},{"./cbc":85,"./cfb":86,"./cfb1":87,"./cfb8":88,"./ctr":89,"./ecb":90,"./list.json":92,"./ofb":93}],92:[function(a,b,c){b.exports={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192:{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256:{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}}},{}],93:[function(a,b,c){(function(Buffer){function b(a){return a._prev=a._cipher.encryptBlock(a._prev),a._prev}var d=a("buffer-xor");c.encrypt=function(a,c){for(;a._cache.length<c.length;)a._cache=Buffer.concat([a._cache,b(a)]);var e=a._cache.slice(0,c.length);return a._cache=a._cache.slice(c.length),d(c,e)}}).call(this,a("buffer").Buffer)},{buffer:105,"buffer-xor":104}],94:[function(a,b,c){function d(a,b,c,d){f.call(this),this._cipher=new e.AES(b),this._prev=Buffer.from(c),this._cache=Buffer.allocUnsafe(0),this._secCache=Buffer.allocUnsafe(0),this._decrypt=d,this._mode=a}var e=a("./aes"),Buffer=a("safe-buffer").Buffer,f=a("cipher-base"),g=a("inherits");g(d,f),d.prototype._update=function(a){return this._mode.encrypt(this,a,this._decrypt)},d.prototype._final=function(){this._cipher.scrub()},b.exports=d},{"./aes":78,"cipher-base":107,inherits:246,"safe-buffer":311}],95:[function(a,b,c){function d(a,b){var c,d;if(a=a.toLowerCase(),m[a])c=m[a].key,d=m[a].iv;else{if(!l[a])throw new TypeError("invalid suite type");c=8*l[a].key,d=l[a].iv}var e=i(b,!1,c,d);return f(a,e.key,e.iv)}function e(a,b){var c,d;if(a=a.toLowerCase(),m[a])c=m[a].key,d=m[a].iv;else{if(!l[a])throw new TypeError("invalid suite type");c=8*l[a].key,d=l[a].iv}var e=i(b,!1,c,d);return g(a,e.key,e.iv)}function f(a,b,c){if(a=a.toLowerCase(),m[a])return j.createCipheriv(a,b,c);if(l[a])return new k({key:b,iv:c,mode:a});throw new TypeError("invalid suite type")}function g(a,b,c){if(a=a.toLowerCase(),m[a])return j.createDecipheriv(a,b,c);if(l[a])return new k({key:b,iv:c,mode:a,decrypt:!0});throw new TypeError("invalid suite type")}function h(){return Object.keys(l).concat(j.getCiphers())}var i=a("evp_bytestokey"),j=a("browserify-aes/browser"),k=a("browserify-des"),l=a("browserify-des/modes"),m=a("browserify-aes/modes");c.createCipher=c.Cipher=d,c.createCipheriv=c.Cipheriv=f,c.createDecipher=c.Decipher=e,c.createDecipheriv=c.Decipheriv=g,c.listCiphers=c.getCiphers=h},{"browserify-aes/browser":80,"browserify-aes/modes":91,"browserify-des":96,"browserify-des/modes":97,evp_bytestokey:229}],96:[function(a,b,c){(function(Buffer){function c(a){d.call(this);var b,c=a.mode.toLowerCase(),e=g[c];b=a.decrypt?"decrypt":"encrypt";var f=a.key;"des-ede"!==c&&"des-ede-cbc"!==c||(f=Buffer.concat([f,f.slice(0,8)]));var h=a.iv;this._des=e.create({key:f,iv:h,type:b})}var d=a("cipher-base"),e=a("des.js"),f=a("inherits"),g={"des-ede3-cbc":e.CBC.instantiate(e.EDE),"des-ede3":e.EDE,"des-ede-cbc":e.CBC.instantiate(e.EDE),"des-ede":e.EDE,"des-cbc":e.CBC.instantiate(e.DES),"des-ecb":e.DES};g.des=g["des-cbc"],g.des3=g["des-ede3-cbc"],b.exports=c,f(c,d),c.prototype._update=function(a){return new Buffer(this._des.update(a))},c.prototype._final=function(){return new Buffer(this._des.final())}}).call(this,a("buffer").Buffer)},{buffer:105,"cipher-base":107,"des.js":212,inherits:246}],97:[function(a,b,c){c["des-ecb"]={key:8,iv:0},c["des-cbc"]=c.des={key:8,iv:8},c["des-ede3-cbc"]=c.des3={key:24,iv:8},c["des-ede3"]={key:24,iv:0},c["des-ede-cbc"]={key:16,iv:8},c["des-ede"]={key:16,iv:0}},{}],98:[function(a,b,c){"use strict";function d(a){if(!a)return"utf8";for(var b;;)switch(a){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return a;default:if(b)return;a=(""+a).toLowerCase(),b=!0}}function e(a){var b=d(a);if("string"!=typeof b&&(Buffer.isEncoding===s||!s(a)))throw new Error("Unknown encoding: "+a);return b||a}function f(a){this.encoding=e(a);var b;switch(this.encoding){case"utf16le":this.text=m,this.end=n,b=4;break;case"utf8":this.fillLast=j,b=4;break;case"base64":this.text=o,this.end=p,b=3;break;default:return this.write=q,void(this.end=r)}this.lastNeed=0,this.lastTotal=0,this.lastChar=Buffer.allocUnsafe(b)}function g(a){return a<=127?0:a>>5===6?2:a>>4===14?3:a>>3===30?4:-1}function h(a,b,c){var d=b.length-1;if(d<c)return 0;var e=g(b[d]);return e>=0?(e>0&&(a.lastNeed=e-1),e):--d<c?0:(e=g(b[d]),e>=0?(e>0&&(a.lastNeed=e-2),e):--d<c?0:(e=g(b[d]),e>=0?(e>0&&(2===e?e=0:a.lastNeed=e-3),e):0))}function i(a,b,c){if(128!==(192&b[0]))return a.lastNeed=0,"�".repeat(c);if(a.lastNeed>1&&b.length>1){if(128!==(192&b[1]))return a.lastNeed=1,"�".repeat(c+1);if(a.lastNeed>2&&b.length>2&&128!==(192&b[2]))return a.lastNeed=2,"�".repeat(c+2)}}function j(a){var b=this.lastTotal-this.lastNeed,c=i(this,a,b);return void 0!==c?c:this.lastNeed<=a.length?(a.copy(this.lastChar,b,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(a.copy(this.lastChar,b,0,a.length),void(this.lastNeed-=a.length))}function k(a,b){var c=h(this,a,b);if(!this.lastNeed)return a.toString("utf8",b);this.lastTotal=c;var d=a.length-(c-this.lastNeed);return a.copy(this.lastChar,0,d),a.toString("utf8",b,d)}function l(a){var b=a&&a.length?this.write(a):"";return this.lastNeed?b+"�".repeat(this.lastTotal-this.lastNeed):b}function m(a,b){if((a.length-b)%2===0){var c=a.toString("utf16le",b);if(c){var d=c.charCodeAt(c.length-1);if(d>=55296&&d<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=a[a.length-2],this.lastChar[1]=a[a.length-1],c.slice(0,-1)}return c}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=a[a.length-1],a.toString("utf16le",b,a.length-1)}function n(a){var b=a&&a.length?this.write(a):"";if(this.lastNeed){var c=this.lastTotal-this.lastNeed;return b+this.lastChar.toString("utf16le",0,c)}return b}function o(a,b){var c=(a.length-b)%3;return 0===c?a.toString("base64",b):(this.lastNeed=3-c,this.lastTotal=3,1===c?this.lastChar[0]=a[a.length-1]:(this.lastChar[0]=a[a.length-2],this.lastChar[1]=a[a.length-1]),a.toString("base64",b,a.length-c))}function p(a){var b=a&&a.length?this.write(a):"";return this.lastNeed?b+this.lastChar.toString("base64",0,3-this.lastNeed):b}function q(a){return a.toString(this.encoding)}function r(a){return a&&a.length?this.write(a):""}var Buffer=a("safe-buffer").Buffer,s=Buffer.isEncoding||function(a){switch(a=""+a,a&&a.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};c.StringDecoder=f,f.prototype.write=function(a){if(0===a.length)return"";var b,c;if(this.lastNeed){if(b=this.fillLast(a),void 0===b)return"";c=this.lastNeed,this.lastNeed=0}else c=0;return c<a.length?b?b+this.text(a,c):this.text(a,c):b||""},f.prototype.end=l,f.prototype.text=k,f.prototype.fillLast=function(a){return this.lastNeed<=a.length?(a.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(a.copy(this.lastChar,this.lastTotal-this.lastNeed,0,a.length),void(this.lastNeed-=a.length))}},{"safe-buffer":311}],99:[function(a,b,c){arguments[4][74][0].apply(c,arguments)},{"base-x":22,dup:74}],100:[function(a,b,c){(function(Buffer){"use strict";var c=a("bs58");b.exports=function(a){function b(b){var d=a(b);return c.encode(Buffer.concat([b,d],b.length+4))}function d(b){var c=b.slice(0,-4),d=b.slice(-4),e=a(c);if(!(d[0]^e[0]|d[1]^e[1]|d[2]^e[2]|d[3]^e[3]))return c}function e(a){var b=c.decodeUnsafe(a);if(b)return d(b)}function f(b){var e=c.decode(b),f=d(e,a);if(!f)throw new Error("Invalid checksum");return f}return{encode:b,decode:f,decodeUnsafe:e}}}).call(this,a("buffer").Buffer)},{bs58:99,buffer:105}],101:[function(a,b,c){"use strict";function d(a){var b=e("sha256").update(a).digest();return e("sha256").update(b).digest()}var e=a("create-hash"),f=a("./base");b.exports=f(d)},{"./base":100,"create-hash":128}],102:[function(a,b,c){(function(Buffer){"use strict";b.exports=function(a,b){if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return!0;if("function"==typeof a.equals)return a.equals(b);if(a.length!==b.length)return!1;for(var c=0;c<a.length;c++)if(a[c]!==b[c])return!1;return!0}}).call(this,{isBuffer:a("../is-buffer/index.js")})},{"../is-buffer/index.js":247}],103:[function(a,b,c){(function(Buffer){b.exports=function(a){for(var b=new Buffer(a.length),c=0,d=a.length-1;c<=d;++c,--d)b[c]=a[d],b[d]=a[c];return b}}).call(this,a("buffer").Buffer)},{buffer:105}],104:[function(a,b,c){(function(Buffer){b.exports=function(a,b){for(var c=Math.min(a.length,b.length),d=new Buffer(c),e=0;e<c;++e)d[e]=a[e]^b[e];return d}}).call(this,a("buffer").Buffer)},{buffer:105}],105:[function(a,b,c){"use strict";function d(){try{var a=new Uint8Array(1);return a.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===a.foo()}catch(a){return!1}}function e(a){if(a>Y)throw new RangeError("Invalid typed array length");var b=new Uint8Array(a);return b.__proto__=Buffer.prototype,b}function Buffer(a,b,c){if("number"==typeof a){if("string"==typeof b)throw new Error("If encoding is specified then the first argument must be a string");return i(a)}return f(a,b,c)}function f(a,b,c){if("number"==typeof a)throw new TypeError('"value" argument must not be a number');return T(a)?l(a,b,c):"string"==typeof a?j(a,b):m(a)}function g(a){if("number"!=typeof a)throw new TypeError('"size" argument must be a number');if(a<0)throw new RangeError('"size" argument must not be negative')}function h(a,b,c){return g(a),a<=0?e(a):void 0!==b?"string"==typeof c?e(a).fill(b,c):e(a).fill(b):e(a)}function i(a){return g(a),e(a<0?0:0|n(a))}function j(a,b){if("string"==typeof b&&""!==b||(b="utf8"),!Buffer.isEncoding(b))throw new TypeError('"encoding" must be a valid string encoding');var c=0|p(a,b),d=e(c),f=d.write(a,b);return f!==c&&(d=d.slice(0,f)),d}function k(a){for(var b=a.length<0?0:0|n(a.length),c=e(b),d=0;d<b;d+=1)c[d]=255&a[d];return c}function l(a,b,c){if(b<0||a.byteLength<b)throw new RangeError("'offset' is out of bounds");if(a.byteLength<b+(c||0))throw new RangeError("'length' is out of bounds");var d;return d=void 0===b&&void 0===c?new Uint8Array(a):void 0===c?new Uint8Array(a,b):new Uint8Array(a,b,c),d.__proto__=Buffer.prototype,d}function m(a){if(Buffer.isBuffer(a)){var b=0|n(a.length),c=e(b);return 0===c.length?c:(a.copy(c,0,0,b),c)}if(a){if(U(a)||"length"in a)return"number"!=typeof a.length||V(a.length)?e(0):k(a);if("Buffer"===a.type&&Array.isArray(a.data))return k(a.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function n(a){if(a>=Y)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Y.toString(16)+" bytes");return 0|a}function o(a){return+a!=a&&(a=0),Buffer.alloc(+a)}function p(a,b){if(Buffer.isBuffer(a))return a.length;if(U(a)||T(a))return a.byteLength;"string"!=typeof a&&(a=""+a);var c=a.length;if(0===c)return 0;for(var d=!1;;)switch(b){case"ascii":case"latin1":case"binary":return c;case"utf8":case"utf-8":case void 0:return O(a).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*c;case"hex":return c>>>1;case"base64":return R(a).length;default:if(d)return O(a).length;b=(""+b).toLowerCase(),d=!0}}function q(a,b,c){var d=!1;if((void 0===b||b<0)&&(b=0),b>this.length)return"";if((void 0===c||c>this.length)&&(c=this.length),c<=0)return"";if(c>>>=0,b>>>=0,c<=b)return"";for(a||(a="utf8");;)switch(a){case"hex":return F(this,b,c);case"utf8":case"utf-8":return B(this,b,c);case"ascii":return D(this,b,c);case"latin1":case"binary":return E(this,b,c);case"base64":return A(this,b,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G(this,b,c);default:if(d)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase(),d=!0}}function r(a,b,c){var d=a[b];a[b]=a[c],a[c]=d}function s(a,b,c,d,e){if(0===a.length)return-1;if("string"==typeof c?(d=c,c=0):c>2147483647?c=2147483647:c<-2147483648&&(c=-2147483648),c=+c,V(c)&&(c=e?0:a.length-1),c<0&&(c=a.length+c),c>=a.length){if(e)return-1;c=a.length-1}else if(c<0){if(!e)return-1;c=0}if("string"==typeof b&&(b=Buffer.from(b,d)),Buffer.isBuffer(b))return 0===b.length?-1:t(a,b,c,d,e);if("number"==typeof b)return b&=255,"function"==typeof Uint8Array.prototype.indexOf?e?Uint8Array.prototype.indexOf.call(a,b,c):Uint8Array.prototype.lastIndexOf.call(a,b,c):t(a,[b],c,d,e);throw new TypeError("val must be string, number or Buffer")}function t(a,b,c,d,e){function f(a,b){return 1===g?a[b]:a.readUInt16BE(b*g)}var g=1,h=a.length,i=b.length;if(void 0!==d&&(d=String(d).toLowerCase(),"ucs2"===d||"ucs-2"===d||"utf16le"===d||"utf-16le"===d)){if(a.length<2||b.length<2)return-1;g=2,h/=2,i/=2,c/=2}var j;if(e){var k=-1;for(j=c;j<h;j++)if(f(a,j)===f(b,k===-1?0:j-k)){if(k===-1&&(k=j),j-k+1===i)return k*g}else k!==-1&&(j-=j-k),k=-1}else for(c+i>h&&(c=h-i),j=c;j>=0;j--){for(var l=!0,m=0;m<i;m++)if(f(a,j+m)!==f(b,m)){l=!1;break}if(l)return j}return-1}function u(a,b,c,d){c=Number(c)||0;var e=a.length-c;d?(d=Number(d),d>e&&(d=e)):d=e;var f=b.length;if(f%2!==0)throw new TypeError("Invalid hex string");d>f/2&&(d=f/2);for(var g=0;g<d;++g){var h=parseInt(b.substr(2*g,2),16);if(V(h))return g;a[c+g]=h}return g}function v(a,b,c,d){return S(O(b,a.length-c),a,c,d)}function w(a,b,c,d){return S(P(b),a,c,d)}function x(a,b,c,d){return w(a,b,c,d)}function y(a,b,c,d){return S(R(b),a,c,d)}function z(a,b,c,d){return S(Q(b,a.length-c),a,c,d)}function A(a,b,c){return 0===b&&c===a.length?W.fromByteArray(a):W.fromByteArray(a.slice(b,c))}function B(a,b,c){c=Math.min(a.length,c);for(var d=[],e=b;e<c;){var f=a[e],g=null,h=f>239?4:f>223?3:f>191?2:1;if(e+h<=c){var i,j,k,l;switch(h){case 1:f<128&&(g=f);break;case 2:i=a[e+1],128===(192&i)&&(l=(31&f)<<6|63&i,l>127&&(g=l));break;case 3:i=a[e+1],j=a[e+2],128===(192&i)&&128===(192&j)&&(l=(15&f)<<12|(63&i)<<6|63&j,l>2047&&(l<55296||l>57343)&&(g=l));break;case 4:i=a[e+1],j=a[e+2],k=a[e+3],128===(192&i)&&128===(192&j)&&128===(192&k)&&(l=(15&f)<<18|(63&i)<<12|(63&j)<<6|63&k,l>65535&&l<1114112&&(g=l))}}null===g?(g=65533,h=1):g>65535&&(g-=65536,d.push(g>>>10&1023|55296),g=56320|1023&g),d.push(g),e+=h}return C(d)}function C(a){var b=a.length;if(b<=Z)return String.fromCharCode.apply(String,a);for(var c="",d=0;d<b;)c+=String.fromCharCode.apply(String,a.slice(d,d+=Z));return c}function D(a,b,c){var d="";c=Math.min(a.length,c);for(var e=b;e<c;++e)d+=String.fromCharCode(127&a[e]);return d}function E(a,b,c){var d="";c=Math.min(a.length,c);for(var e=b;e<c;++e)d+=String.fromCharCode(a[e]);return d}function F(a,b,c){var d=a.length;(!b||b<0)&&(b=0),(!c||c<0||c>d)&&(c=d);for(var e="",f=b;f<c;++f)e+=N(a[f]);return e}function G(a,b,c){for(var d=a.slice(b,c),e="",f=0;f<d.length;f+=2)e+=String.fromCharCode(d[f]+256*d[f+1]);return e}function H(a,b,c){if(a%1!==0||a<0)throw new RangeError("offset is not uint");if(a+b>c)throw new RangeError("Trying to access beyond buffer length")}function I(a,b,c,d,e,f){if(!Buffer.isBuffer(a))throw new TypeError('"buffer" argument must be a Buffer instance');if(b>e||b<f)throw new RangeError('"value" argument is out of bounds');if(c+d>a.length)throw new RangeError("Index out of range")}function J(a,b,c,d,e,f){if(c+d>a.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("Index out of range")}function K(a,b,c,d,e){return b=+b,c>>>=0,e||J(a,b,c,4,3.4028234663852886e38,-3.4028234663852886e38),X.write(a,b,c,d,23,4),c+4}function L(a,b,c,d,e){return b=+b,c>>>=0,e||J(a,b,c,8,1.7976931348623157e308,-1.7976931348623157e308),X.write(a,b,c,d,52,8),c+8}function M(a){if(a=a.trim().replace($,""),a.length<2)return"";for(;a.length%4!==0;)a+="=";return a}function N(a){return a<16?"0"+a.toString(16):a.toString(16)}function O(a,b){b=b||1/0;for(var c,d=a.length,e=null,f=[],g=0;g<d;++g){if(c=a.charCodeAt(g),c>55295&&c<57344){if(!e){if(c>56319){(b-=3)>-1&&f.push(239,191,189);continue}if(g+1===d){(b-=3)>-1&&f.push(239,191,189);continue}e=c;continue}if(c<56320){(b-=3)>-1&&f.push(239,191,189),e=c;continue}c=(e-55296<<10|c-56320)+65536}else e&&(b-=3)>-1&&f.push(239,191,189);if(e=null,c<128){if((b-=1)<0)break;f.push(c)}else if(c<2048){if((b-=2)<0)break;f.push(c>>6|192,63&c|128)}else if(c<65536){if((b-=3)<0)break;f.push(c>>12|224,c>>6&63|128,63&c|128)}else{if(!(c<1114112))throw new Error("Invalid code point");if((b-=4)<0)break;f.push(c>>18|240,c>>12&63|128,c>>6&63|128,63&c|128)}}return f}function P(a){for(var b=[],c=0;c<a.length;++c)b.push(255&a.charCodeAt(c));return b}function Q(a,b){for(var c,d,e,f=[],g=0;g<a.length&&!((b-=2)<0);++g)c=a.charCodeAt(g),d=c>>8,e=c%256,f.push(e),f.push(d);return f}function R(a){return W.toByteArray(M(a))}function S(a,b,c,d){for(var e=0;e<d&&!(e+c>=b.length||e>=a.length);++e)b[e+c]=a[e];return e}function T(a){return a instanceof ArrayBuffer||null!=a&&null!=a.constructor&&"ArrayBuffer"===a.constructor.name&&"number"==typeof a.byteLength}function U(a){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(a)}function V(a){return a!==a}var W=a("base64-js"),X=a("ieee754");c.Buffer=Buffer,c.SlowBuffer=o,c.INSPECT_MAX_BYTES=50;var Y=2147483647;c.kMaxLength=Y,Buffer.TYPED_ARRAY_SUPPORT=d(),Buffer.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&Buffer[Symbol.species]===Buffer&&Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),Buffer.poolSize=8192,Buffer.from=function(a,b,c){return f(a,b,c)},Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,Buffer.alloc=function(a,b,c){return h(a,b,c)},Buffer.allocUnsafe=function(a){return i(a)},Buffer.allocUnsafeSlow=function(a){return i(a)},Buffer.isBuffer=function(a){return null!=a&&a._isBuffer===!0},Buffer.compare=function(a,b){if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var c=a.length,d=b.length,e=0,f=Math.min(c,d);e<f;++e)if(a[e]!==b[e]){c=a[e],d=b[e];break}return c<d?-1:d<c?1:0},Buffer.isEncoding=function(a){switch(String(a).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer.concat=function(a,b){if(!Array.isArray(a))throw new TypeError('"list" argument must be an Array of Buffers');if(0===a.length)return Buffer.alloc(0);var c;if(void 0===b)for(b=0,c=0;c<a.length;++c)b+=a[c].length;var d=Buffer.allocUnsafe(b),e=0;for(c=0;c<a.length;++c){var f=a[c];if(!Buffer.isBuffer(f))throw new TypeError('"list" argument must be an Array of Buffers');f.copy(d,e),e+=f.length}return d},Buffer.byteLength=p,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function(){var a=this.length;if(a%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var b=0;b<a;b+=2)r(this,b,b+1);return this},Buffer.prototype.swap32=function(){var a=this.length;if(a%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var b=0;b<a;b+=4)r(this,b,b+3),r(this,b+1,b+2);return this},Buffer.prototype.swap64=function(){var a=this.length;if(a%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var b=0;b<a;b+=8)r(this,b,b+7),r(this,b+1,b+6),r(this,b+2,b+5),r(this,b+3,b+4);return this},Buffer.prototype.toString=function(){var a=this.length;return 0===a?"":0===arguments.length?B(this,0,a):q.apply(this,arguments)},Buffer.prototype.equals=function(a){if(!Buffer.isBuffer(a))throw new TypeError("Argument must be a Buffer");return this===a||0===Buffer.compare(this,a)},Buffer.prototype.inspect=function(){var a="",b=c.INSPECT_MAX_BYTES;return this.length>0&&(a=this.toString("hex",0,b).match(/.{2}/g).join(" "),this.length>b&&(a+=" ... ")),"<Buffer "+a+">"},Buffer.prototype.compare=function(a,b,c,d,e){if(!Buffer.isBuffer(a))throw new TypeError("Argument must be a Buffer");if(void 0===b&&(b=0),void 0===c&&(c=a?a.length:0),void 0===d&&(d=0),void 0===e&&(e=this.length),b<0||c>a.length||d<0||e>this.length)throw new RangeError("out of range index");if(d>=e&&b>=c)return 0;if(d>=e)return-1;if(b>=c)return 1;if(b>>>=0,c>>>=0,d>>>=0,e>>>=0,this===a)return 0;for(var f=e-d,g=c-b,h=Math.min(f,g),i=this.slice(d,e),j=a.slice(b,c),k=0;k<h;++k)if(i[k]!==j[k]){f=i[k],g=j[k];break}return f<g?-1:g<f?1:0},Buffer.prototype.includes=function(a,b,c){return this.indexOf(a,b,c)!==-1},Buffer.prototype.indexOf=function(a,b,c){return s(this,a,b,c,!0)},Buffer.prototype.lastIndexOf=function(a,b,c){return s(this,a,b,c,!1)},Buffer.prototype.write=function(a,b,c,d){if(void 0===b)d="utf8",c=this.length,b=0;else if(void 0===c&&"string"==typeof b)d=b,c=this.length,b=0;else{if(!isFinite(b))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");b>>>=0,isFinite(c)?(c>>>=0,void 0===d&&(d="utf8")):(d=c,c=void 0)}var e=this.length-b;if((void 0===c||c>e)&&(c=e),a.length>0&&(c<0||b<0)||b>this.length)throw new RangeError("Attempt to write outside buffer bounds");d||(d="utf8");for(var f=!1;;)switch(d){case"hex":return u(this,a,b,c);case"utf8":case"utf-8":return v(this,a,b,c);case"ascii":return w(this,a,b,c);case"latin1":case"binary":return x(this,a,b,c);case"base64":return y(this,a,b,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,a,b,c);default:if(f)throw new TypeError("Unknown encoding: "+d);d=(""+d).toLowerCase(),f=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Z=4096;Buffer.prototype.slice=function(a,b){var c=this.length;a=~~a,b=void 0===b?c:~~b,a<0?(a+=c,a<0&&(a=0)):a>c&&(a=c),b<0?(b+=c,b<0&&(b=0)):b>c&&(b=c),b<a&&(b=a);var d=this.subarray(a,b);return d.__proto__=Buffer.prototype,d},Buffer.prototype.readUIntLE=function(a,b,c){a>>>=0,b>>>=0,c||H(a,b,this.length);for(var d=this[a],e=1,f=0;++f<b&&(e*=256);)d+=this[a+f]*e;return d},Buffer.prototype.readUIntBE=function(a,b,c){a>>>=0,b>>>=0,c||H(a,b,this.length);for(var d=this[a+--b],e=1;b>0&&(e*=256);)d+=this[a+--b]*e;return d},Buffer.prototype.readUInt8=function(a,b){return a>>>=0,b||H(a,1,this.length),this[a]},Buffer.prototype.readUInt16LE=function(a,b){return a>>>=0,b||H(a,2,this.length),this[a]|this[a+1]<<8},Buffer.prototype.readUInt16BE=function(a,b){return a>>>=0,b||H(a,2,this.length),this[a]<<8|this[a+1]},Buffer.prototype.readUInt32LE=function(a,b){return a>>>=0,b||H(a,4,this.length),(this[a]|this[a+1]<<8|this[a+2]<<16)+16777216*this[a+3]},Buffer.prototype.readUInt32BE=function(a,b){return a>>>=0,b||H(a,4,this.length),16777216*this[a]+(this[a+1]<<16|this[a+2]<<8|this[a+3])},Buffer.prototype.readIntLE=function(a,b,c){a>>>=0,b>>>=0,c||H(a,b,this.length);for(var d=this[a],e=1,f=0;++f<b&&(e*=256);)d+=this[a+f]*e;return e*=128,d>=e&&(d-=Math.pow(2,8*b)),d},Buffer.prototype.readIntBE=function(a,b,c){a>>>=0,b>>>=0,c||H(a,b,this.length);for(var d=b,e=1,f=this[a+--d];d>0&&(e*=256);)f+=this[a+--d]*e;return e*=128,f>=e&&(f-=Math.pow(2,8*b)),f},Buffer.prototype.readInt8=function(a,b){return a>>>=0,b||H(a,1,this.length),128&this[a]?(255-this[a]+1)*-1:this[a]},Buffer.prototype.readInt16LE=function(a,b){a>>>=0,b||H(a,2,this.length);var c=this[a]|this[a+1]<<8;return 32768&c?4294901760|c:c},Buffer.prototype.readInt16BE=function(a,b){a>>>=0,b||H(a,2,this.length);var c=this[a+1]|this[a]<<8;return 32768&c?4294901760|c:c},Buffer.prototype.readInt32LE=function(a,b){return a>>>=0,b||H(a,4,this.length),this[a]|this[a+1]<<8|this[a+2]<<16|this[a+3]<<24},Buffer.prototype.readInt32BE=function(a,b){return a>>>=0,b||H(a,4,this.length),this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+3]},Buffer.prototype.readFloatLE=function(a,b){return a>>>=0,b||H(a,4,this.length),X.read(this,a,!0,23,4)},Buffer.prototype.readFloatBE=function(a,b){return a>>>=0,b||H(a,4,this.length),X.read(this,a,!1,23,4)},Buffer.prototype.readDoubleLE=function(a,b){return a>>>=0,b||H(a,8,this.length),X.read(this,a,!0,52,8)},Buffer.prototype.readDoubleBE=function(a,b){
9
return a>>>=0,b||H(a,8,this.length),X.read(this,a,!1,52,8)},Buffer.prototype.writeUIntLE=function(a,b,c,d){if(a=+a,b>>>=0,c>>>=0,!d){var e=Math.pow(2,8*c)-1;I(this,a,b,c,e,0)}var f=1,g=0;for(this[b]=255&a;++g<c&&(f*=256);)this[b+g]=a/f&255;return b+c},Buffer.prototype.writeUIntBE=function(a,b,c,d){if(a=+a,b>>>=0,c>>>=0,!d){var e=Math.pow(2,8*c)-1;I(this,a,b,c,e,0)}var f=c-1,g=1;for(this[b+f]=255&a;--f>=0&&(g*=256);)this[b+f]=a/g&255;return b+c},Buffer.prototype.writeUInt8=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,1,255,0),this[b]=255&a,b+1},Buffer.prototype.writeUInt16LE=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,2,65535,0),this[b]=255&a,this[b+1]=a>>>8,b+2},Buffer.prototype.writeUInt16BE=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,2,65535,0),this[b]=a>>>8,this[b+1]=255&a,b+2},Buffer.prototype.writeUInt32LE=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,4,4294967295,0),this[b+3]=a>>>24,this[b+2]=a>>>16,this[b+1]=a>>>8,this[b]=255&a,b+4},Buffer.prototype.writeUInt32BE=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,4,4294967295,0),this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=255&a,b+4},Buffer.prototype.writeIntLE=function(a,b,c,d){if(a=+a,b>>>=0,!d){var e=Math.pow(2,8*c-1);I(this,a,b,c,e-1,-e)}var f=0,g=1,h=0;for(this[b]=255&a;++f<c&&(g*=256);)a<0&&0===h&&0!==this[b+f-1]&&(h=1),this[b+f]=(a/g>>0)-h&255;return b+c},Buffer.prototype.writeIntBE=function(a,b,c,d){if(a=+a,b>>>=0,!d){var e=Math.pow(2,8*c-1);I(this,a,b,c,e-1,-e)}var f=c-1,g=1,h=0;for(this[b+f]=255&a;--f>=0&&(g*=256);)a<0&&0===h&&0!==this[b+f+1]&&(h=1),this[b+f]=(a/g>>0)-h&255;return b+c},Buffer.prototype.writeInt8=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,1,127,-128),a<0&&(a=255+a+1),this[b]=255&a,b+1},Buffer.prototype.writeInt16LE=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,2,32767,-32768),this[b]=255&a,this[b+1]=a>>>8,b+2},Buffer.prototype.writeInt16BE=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,2,32767,-32768),this[b]=a>>>8,this[b+1]=255&a,b+2},Buffer.prototype.writeInt32LE=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,4,2147483647,-2147483648),this[b]=255&a,this[b+1]=a>>>8,this[b+2]=a>>>16,this[b+3]=a>>>24,b+4},Buffer.prototype.writeInt32BE=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,4,2147483647,-2147483648),a<0&&(a=4294967295+a+1),this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=255&a,b+4},Buffer.prototype.writeFloatLE=function(a,b,c){return K(this,a,b,!0,c)},Buffer.prototype.writeFloatBE=function(a,b,c){return K(this,a,b,!1,c)},Buffer.prototype.writeDoubleLE=function(a,b,c){return L(this,a,b,!0,c)},Buffer.prototype.writeDoubleBE=function(a,b,c){return L(this,a,b,!1,c)},Buffer.prototype.copy=function(a,b,c,d){if(c||(c=0),d||0===d||(d=this.length),b>=a.length&&(b=a.length),b||(b=0),d>0&&d<c&&(d=c),d===c)return 0;if(0===a.length||0===this.length)return 0;if(b<0)throw new RangeError("targetStart out of bounds");if(c<0||c>=this.length)throw new RangeError("sourceStart out of bounds");if(d<0)throw new RangeError("sourceEnd out of bounds");d>this.length&&(d=this.length),a.length-b<d-c&&(d=a.length-b+c);var e,f=d-c;if(this===a&&c<b&&b<d)for(e=f-1;e>=0;--e)a[e+b]=this[e+c];else if(f<1e3)for(e=0;e<f;++e)a[e+b]=this[e+c];else Uint8Array.prototype.set.call(a,this.subarray(c,c+f),b);return f},Buffer.prototype.fill=function(a,b,c,d){if("string"==typeof a){if("string"==typeof b?(d=b,b=0,c=this.length):"string"==typeof c&&(d=c,c=this.length),1===a.length){var e=a.charCodeAt(0);e<256&&(a=e)}if(void 0!==d&&"string"!=typeof d)throw new TypeError("encoding must be a string");if("string"==typeof d&&!Buffer.isEncoding(d))throw new TypeError("Unknown encoding: "+d)}else"number"==typeof a&&(a&=255);if(b<0||this.length<b||this.length<c)throw new RangeError("Out of range index");if(c<=b)return this;b>>>=0,c=void 0===c?this.length:c>>>0,a||(a=0);var f;if("number"==typeof a)for(f=b;f<c;++f)this[f]=a;else{var g=Buffer.isBuffer(a)?a:new Buffer(a,d),h=g.length;for(f=0;f<c-b;++f)this[f+b]=g[f%h]}return this};var $=/[^+\/0-9A-Za-z-_]/g},{"base64-js":106,ieee754:244}],106:[function(a,b,c){"use strict";function d(a){var b=a.length;if(b%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===a[b-2]?2:"="===a[b-1]?1:0}function e(a){return 3*a.length/4-d(a)}function f(a){var b,c,e,f,g,h=a.length;f=d(a),g=new l(3*h/4-f),c=f>0?h-4:h;var i=0;for(b=0;b<c;b+=4)e=k[a.charCodeAt(b)]<<18|k[a.charCodeAt(b+1)]<<12|k[a.charCodeAt(b+2)]<<6|k[a.charCodeAt(b+3)],g[i++]=e>>16&255,g[i++]=e>>8&255,g[i++]=255&e;return 2===f?(e=k[a.charCodeAt(b)]<<2|k[a.charCodeAt(b+1)]>>4,g[i++]=255&e):1===f&&(e=k[a.charCodeAt(b)]<<10|k[a.charCodeAt(b+1)]<<4|k[a.charCodeAt(b+2)]>>2,g[i++]=e>>8&255,g[i++]=255&e),g}function g(a){return j[a>>18&63]+j[a>>12&63]+j[a>>6&63]+j[63&a]}function h(a,b,c){for(var d,e=[],f=b;f<c;f+=3)d=(a[f]<<16)+(a[f+1]<<8)+a[f+2],e.push(g(d));return e.join("")}function i(a){for(var b,c=a.length,d=c%3,e="",f=[],g=16383,i=0,k=c-d;i<k;i+=g)f.push(h(a,i,i+g>k?k:i+g));return 1===d?(b=a[c-1],e+=j[b>>2],e+=j[b<<4&63],e+="=="):2===d&&(b=(a[c-2]<<8)+a[c-1],e+=j[b>>10],e+=j[b>>4&63],e+=j[b<<2&63],e+="="),f.push(e),f.join("")}c.byteLength=e,c.toByteArray=f,c.fromByteArray=i;for(var j=[],k=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=m.length;n<o;++n)j[n]=m[n],k[m.charCodeAt(n)]=n;k["-".charCodeAt(0)]=62,k["_".charCodeAt(0)]=63},{}],107:[function(a,b,c){function d(a){e.call(this),this.hashMode="string"==typeof a,this.hashMode?this[a]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}var Buffer=a("safe-buffer").Buffer,e=a("stream").Transform,f=a("string_decoder").StringDecoder,g=a("inherits");g(d,e),d.prototype.update=function(a,b,c){"string"==typeof a&&(a=Buffer.from(a,b));var d=this._update(a);return this.hashMode?this:(c&&(d=this._toString(d,c)),d)},d.prototype.setAutoPadding=function(){},d.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},d.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},d.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},d.prototype._transform=function(a,b,c){var d;try{this.hashMode?this._update(a):this.push(this._update(a))}catch(a){d=a}finally{c(d)}},d.prototype._flush=function(a){var b;try{this.push(this.__final())}catch(a){b=a}a(b)},d.prototype._finalOrDigest=function(a){var b=this.__final()||Buffer.alloc(0);return a&&(b=this._toString(b,a,!0)),b},d.prototype._toString=function(a,b,c){if(this._decoder||(this._decoder=new f(b),this._encoding=b),this._encoding!==b)throw new Error("can't switch encodings");var d=this._decoder.write(a);return c&&(d+=this._decoder.end()),d},b.exports=d},{inherits:246,"safe-buffer":311,stream:344,string_decoder:98}],108:[function(a,b,c){function d(a){if(a)return e(a)}function e(a){for(var b in d.prototype)a[b]=d.prototype[b];return a}b.exports=d,d.prototype.on=d.prototype.addEventListener=function(a,b){return this._callbacks=this._callbacks||{},(this._callbacks[a]=this._callbacks[a]||[]).push(b),this},d.prototype.once=function(a,b){function c(){d.off(a,c),b.apply(this,arguments)}var d=this;return this._callbacks=this._callbacks||{},c.fn=b,this.on(a,c),this},d.prototype.off=d.prototype.removeListener=d.prototype.removeAllListeners=d.prototype.removeEventListener=function(a,b){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var c=this._callbacks[a];if(!c)return this;if(1==arguments.length)return delete this._callbacks[a],this;for(var d,e=0;e<c.length;e++)if(d=c[e],d===b||d.fn===b){c.splice(e,1);break}return this},d.prototype.emit=function(a){this._callbacks=this._callbacks||{};var b=[].slice.call(arguments,1),c=this._callbacks[a];if(c){c=c.slice(0);for(var d=0,e=c.length;d<e;++d)c[d].apply(this,b)}return this},d.prototype.listeners=function(a){return this._callbacks=this._callbacks||{},this._callbacks[a]||[]},d.prototype.hasListeners=function(a){return!!this.listeners(a).length}},{}],109:[function(a,b,c){(function(Buffer){function a(a){return Array.isArray?Array.isArray(a):"[object Array]"===p(a)}function b(a){return"boolean"==typeof a}function d(a){return null===a}function e(a){return null==a}function f(a){return"number"==typeof a}function g(a){return"string"==typeof a}function h(a){return"symbol"==typeof a}function i(a){return void 0===a}function j(a){return"[object RegExp]"===p(a)}function k(a){return"object"==typeof a&&null!==a}function l(a){return"[object Date]"===p(a)}function m(a){return"[object Error]"===p(a)||a instanceof Error}function n(a){return"function"==typeof a}function o(a){return null===a||"boolean"==typeof a||"number"==typeof a||"string"==typeof a||"symbol"==typeof a||"undefined"==typeof a}function p(a){return Object.prototype.toString.call(a)}c.isArray=a,c.isBoolean=b,c.isNull=d,c.isNullOrUndefined=e,c.isNumber=f,c.isString=g,c.isSymbol=h,c.isUndefined=i,c.isRegExp=j,c.isObject=k,c.isDate=l,c.isError=m,c.isFunction=n,c.isPrimitive=o,c.isBuffer=Buffer.isBuffer}).call(this,{isBuffer:a("../../is-buffer/index.js")})},{"../../is-buffer/index.js":247}],110:[function(a,b,c){(function(Buffer){function c(a){this.curveType=g[a],this.curveType||(this.curveType={name:a}),this.curve=new e.ec(this.curveType.name),this.keys=void 0}function d(a,b,c){Array.isArray(a)||(a=a.toArray());var d=new Buffer(a);if(c&&d.length<c){var e=new Buffer(c-d.length);e.fill(0),d=Buffer.concat([e,d])}return b?d.toString(b):d}var e=a("elliptic"),f=a("bn.js");b.exports=function(a){return new c(a)};var g={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};g.p224=g.secp224r1,g.p256=g.secp256r1=g.prime256v1,g.p192=g.secp192r1=g.prime192v1,g.p384=g.secp384r1,g.p521=g.secp521r1,c.prototype.generateKeys=function(a,b){return this.keys=this.curve.genKeyPair(),this.getPublicKey(a,b)},c.prototype.computeSecret=function(a,b,c){b=b||"utf8",Buffer.isBuffer(a)||(a=new Buffer(a,b));var e=this.curve.keyFromPublic(a).getPublic(),f=e.mul(this.keys.getPrivate()).getX();return d(f,c,this.curveType.byteLength)},c.prototype.getPublicKey=function(a,b){var c=this.keys.getPublic("compressed"===b,!0);return"hybrid"===b&&(c[c.length-1]%2?c[0]=7:c[0]=6),d(c,a)},c.prototype.getPrivateKey=function(a){return d(this.keys.getPrivate(),a)},c.prototype.setPublicKey=function(a,b){return b=b||"utf8",Buffer.isBuffer(a)||(a=new Buffer(a,b)),this.keys._importPublic(a),this},c.prototype.setPrivateKey=function(a,b){b=b||"utf8",Buffer.isBuffer(a)||(a=new Buffer(a,b));var c=new f(a);return c=c.toString(16),this.keys._importPrivate(c),this}}).call(this,a("buffer").Buffer)},{"bn.js":111,buffer:105,elliptic:112}],111:[function(a,b,c){!function(b,c){"use strict";function d(a,b){if(!a)throw new Error(b||"Assertion failed")}function e(a,b){a.super_=b;var c=function(){};c.prototype=b.prototype,a.prototype=new c,a.prototype.constructor=a}function f(a,b,c){return f.isBN(a)?a:(this.negative=0,this.words=null,this.length=0,this.red=null,void(null!==a&&("le"!==b&&"be"!==b||(c=b,b=10),this._init(a||0,b||10,c||"be"))))}function g(a,b,c){for(var d=0,e=Math.min(a.length,c),f=b;f<e;f++){var g=a.charCodeAt(f)-48;d<<=4,d|=g>=49&&g<=54?g-49+10:g>=17&&g<=22?g-17+10:15&g}return d}function h(a,b,c,d){for(var e=0,f=Math.min(a.length,c),g=b;g<f;g++){var h=a.charCodeAt(g)-48;e*=d,e+=h>=49?h-49+10:h>=17?h-17+10:h}return e}function i(a){for(var b=new Array(a.bitLength()),c=0;c<b.length;c++){var d=c/26|0,e=c%26;b[c]=(a.words[d]&1<<e)>>>e}return b}function j(a,b,c){c.negative=b.negative^a.negative;var d=a.length+b.length|0;c.length=d,d=d-1|0;var e=0|a.words[0],f=0|b.words[0],g=e*f,h=67108863&g,i=g/67108864|0;c.words[0]=h;for(var j=1;j<d;j++){for(var k=i>>>26,l=67108863&i,m=Math.min(j,b.length-1),n=Math.max(0,j-a.length+1);n<=m;n++){var o=j-n|0;e=0|a.words[o],f=0|b.words[n],g=e*f+l,k+=g/67108864|0,l=67108863&g}c.words[j]=0|l,i=0|k}return 0!==i?c.words[j]=0|i:c.length--,c.strip()}function k(a,b,c){c.negative=b.negative^a.negative,c.length=a.length+b.length;for(var d=0,e=0,f=0;f<c.length-1;f++){var g=e;e=0;for(var h=67108863&d,i=Math.min(f,b.length-1),j=Math.max(0,f-a.length+1);j<=i;j++){var k=f-j,l=0|a.words[k],m=0|b.words[j],n=l*m,o=67108863&n;g=g+(n/67108864|0)|0,o=o+h|0,h=67108863&o,g=g+(o>>>26)|0,e+=g>>>26,g&=67108863}c.words[f]=h,d=g,g=e}return 0!==d?c.words[f]=d:c.length--,c.strip()}function l(a,b,c){var d=new m;return d.mulp(a,b,c)}function m(a,b){this.x=a,this.y=b}function n(a,b){this.name=a,this.p=new f(b,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function o(){n.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function p(){n.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function q(){n.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function r(){n.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function s(a){if("string"==typeof a){var b=f._prime(a);this.m=b.p,this.prime=b}else d(a.gtn(1),"modulus must be greater than 1"),this.m=a,this.prime=null}function t(a){s.call(this,a),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(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)}"object"==typeof b?b.exports=f:c.BN=f,f.BN=f,f.wordSize=26;var Buffer;try{Buffer=a("buffer").Buffer}catch(a){}f.isBN=function(a){return a instanceof f||null!==a&&"object"==typeof a&&a.constructor.wordSize===f.wordSize&&Array.isArray(a.words)},f.max=function(a,b){return a.cmp(b)>0?a:b},f.min=function(a,b){return a.cmp(b)<0?a:b},f.prototype._init=function(a,b,c){if("number"==typeof a)return this._initNumber(a,b,c);if("object"==typeof a)return this._initArray(a,b,c);"hex"===b&&(b=16),d(b===(0|b)&&b>=2&&b<=36),a=a.toString().replace(/\s+/g,"");var e=0;"-"===a[0]&&e++,16===b?this._parseHex(a,e):this._parseBase(a,b,e),"-"===a[0]&&(this.negative=1),this.strip(),"le"===c&&this._initArray(this.toArray(),b,c)},f.prototype._initNumber=function(a,b,c){a<0&&(this.negative=1,a=-a),a<67108864?(this.words=[67108863&a],this.length=1):a<4503599627370496?(this.words=[67108863&a,a/67108864&67108863],this.length=2):(d(a<9007199254740992),this.words=[67108863&a,a/67108864&67108863,1],this.length=3),"le"===c&&this._initArray(this.toArray(),b,c)},f.prototype._initArray=function(a,b,c){if(d("number"==typeof a.length),a.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(a.length/3),this.words=new Array(this.length);for(var e=0;e<this.length;e++)this.words[e]=0;var f,g,h=0;if("be"===c)for(e=a.length-1,f=0;e>=0;e-=3)g=a[e]|a[e-1]<<8|a[e-2]<<16,this.words[f]|=g<<h&67108863,this.words[f+1]=g>>>26-h&67108863,h+=24,h>=26&&(h-=26,f++);else if("le"===c)for(e=0,f=0;e<a.length;e+=3)g=a[e]|a[e+1]<<8|a[e+2]<<16,this.words[f]|=g<<h&67108863,this.words[f+1]=g>>>26-h&67108863,h+=24,h>=26&&(h-=26,f++);return this.strip()},f.prototype._parseHex=function(a,b){this.length=Math.ceil((a.length-b)/6),this.words=new Array(this.length);for(var c=0;c<this.length;c++)this.words[c]=0;var d,e,f=0;for(c=a.length-6,d=0;c>=b;c-=6)e=g(a,c,c+6),this.words[d]|=e<<f&67108863,this.words[d+1]|=e>>>26-f&4194303,f+=24,f>=26&&(f-=26,d++);c+6!==b&&(e=g(a,b,c+6),this.words[d]|=e<<f&67108863,this.words[d+1]|=e>>>26-f&4194303),this.strip()},f.prototype._parseBase=function(a,b,c){this.words=[0],this.length=1;for(var d=0,e=1;e<=67108863;e*=b)d++;d--,e=e/b|0;for(var f=a.length-c,g=f%d,i=Math.min(f,f-g)+c,j=0,k=c;k<i;k+=d)j=h(a,k,k+d,b),this.imuln(e),this.words[0]+j<67108864?this.words[0]+=j:this._iaddn(j);if(0!==g){var l=1;for(j=h(a,k,a.length,b),k=0;k<g;k++)l*=b;this.imuln(l),this.words[0]+j<67108864?this.words[0]+=j:this._iaddn(j)}},f.prototype.copy=function(a){a.words=new Array(this.length);for(var b=0;b<this.length;b++)a.words[b]=this.words[b];a.length=this.length,a.negative=this.negative,a.red=this.red},f.prototype.clone=function(){var a=new f(null);return this.copy(a),a},f.prototype._expand=function(a){for(;this.length<a;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","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"],v=[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],w=[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];f.prototype.toString=function(a,b){a=a||10,b=0|b||1;var c;if(16===a||"hex"===a){c="";for(var e=0,f=0,g=0;g<this.length;g++){var h=this.words[g],i=(16777215&(h<<e|f)).toString(16);f=h>>>24-e&16777215,c=0!==f||g!==this.length-1?u[6-i.length]+i+c:i+c,e+=2,e>=26&&(e-=26,g--)}for(0!==f&&(c=f.toString(16)+c);c.length%b!==0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}if(a===(0|a)&&a>=2&&a<=36){var j=v[a],k=w[a];c="";var l=this.clone();for(l.negative=0;!l.isZero();){var m=l.modn(k).toString(a);l=l.idivn(k),c=l.isZero()?m+c:u[j-m.length]+m+c}for(this.isZero()&&(c="0"+c);c.length%b!==0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}d(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var a=this.words[0];return 2===this.length?a+=67108864*this.words[1]:3===this.length&&1===this.words[2]?a+=4503599627370496+67108864*this.words[1]:this.length>2&&d(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-a:a},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(a,b){return d("undefined"!=typeof Buffer),this.toArrayLike(Buffer,a,b)},f.prototype.toArray=function(a,b){return this.toArrayLike(Array,a,b)},f.prototype.toArrayLike=function(a,b,c){var e=this.byteLength(),f=c||Math.max(1,e);d(e<=f,"byte array longer than desired length"),d(f>0,"Requested array length <= 0"),this.strip();var g,h,i="le"===b,j=new a(f),k=this.clone();if(i){for(h=0;!k.isZero();h++)g=k.andln(255),k.iushrn(8),j[h]=g;for(;h<f;h++)j[h]=0}else{for(h=0;h<f-e;h++)j[h]=0;for(h=0;!k.isZero();h++)g=k.andln(255),k.iushrn(8),j[f-h-1]=g}return j},Math.clz32?f.prototype._countBits=function(a){return 32-Math.clz32(a)}:f.prototype._countBits=function(a){var b=a,c=0;return b>=4096&&(c+=13,b>>>=13),b>=64&&(c+=7,b>>>=7),b>=8&&(c+=4,b>>>=4),b>=2&&(c+=2,b>>>=2),c+b},f.prototype._zeroBits=function(a){if(0===a)return 26;var b=a,c=0;return 0===(8191&b)&&(c+=13,b>>>=13),0===(127&b)&&(c+=7,b>>>=7),0===(15&b)&&(c+=4,b>>>=4),0===(3&b)&&(c+=2,b>>>=2),0===(1&b)&&c++,c},f.prototype.bitLength=function(){var a=this.words[this.length-1],b=this._countBits(a);return 26*(this.length-1)+b},f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var a=0,b=0;b<this.length;b++){var c=this._zeroBits(this.words[b]);if(a+=c,26!==c)break}return a},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(a){return 0!==this.negative?this.abs().inotn(a).iaddn(1):this.clone()},f.prototype.fromTwos=function(a){return this.testn(a-1)?this.notn(a).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return 0!==this.negative},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(a){for(;this.length<a.length;)this.words[this.length++]=0;for(var b=0;b<a.length;b++)this.words[b]=this.words[b]|a.words[b];return this.strip()},f.prototype.ior=function(a){return d(0===(this.negative|a.negative)),this.iuor(a)},f.prototype.or=function(a){return this.length>a.length?this.clone().ior(a):a.clone().ior(this)},f.prototype.uor=function(a){return this.length>a.length?this.clone().iuor(a):a.clone().iuor(this)},f.prototype.iuand=function(a){var b;b=this.length>a.length?a:this;for(var c=0;c<b.length;c++)this.words[c]=this.words[c]&a.words[c];return this.length=b.length,this.strip()},f.prototype.iand=function(a){return d(0===(this.negative|a.negative)),this.iuand(a)},f.prototype.and=function(a){return this.length>a.length?this.clone().iand(a):a.clone().iand(this)},f.prototype.uand=function(a){return this.length>a.length?this.clone().iuand(a):a.clone().iuand(this)},f.prototype.iuxor=function(a){var b,c;this.length>a.length?(b=this,c=a):(b=a,c=this);for(var d=0;d<c.length;d++)this.words[d]=b.words[d]^c.words[d];if(this!==b)for(;d<b.length;d++)this.words[d]=b.words[d];return this.length=b.length,this.strip()},f.prototype.ixor=function(a){return d(0===(this.negative|a.negative)),this.iuxor(a)},f.prototype.xor=function(a){return this.length>a.length?this.clone().ixor(a):a.clone().ixor(this)},f.prototype.uxor=function(a){return this.length>a.length?this.clone().iuxor(a):a.clone().iuxor(this)},f.prototype.inotn=function(a){d("number"==typeof a&&a>=0);var b=0|Math.ceil(a/26),c=a%26;this._expand(b),c>0&&b--;for(var e=0;e<b;e++)this.words[e]=67108863&~this.words[e];return c>0&&(this.words[e]=~this.words[e]&67108863>>26-c),this.strip()},f.prototype.notn=function(a){return this.clone().inotn(a)},f.prototype.setn=function(a,b){d("number"==typeof a&&a>=0);var c=a/26|0,e=a%26;return this._expand(c+1),b?this.words[c]=this.words[c]|1<<e:this.words[c]=this.words[c]&~(1<<e),this.strip()},f.prototype.iadd=function(a){var b;if(0!==this.negative&&0===a.negative)return this.negative=0,b=this.isub(a),this.negative^=1,this._normSign();if(0===this.negative&&0!==a.negative)return a.negative=0,b=this.isub(a),a.negative=1,b._normSign();var c,d;this.length>a.length?(c=this,d=a):(c=a,d=this);for(var e=0,f=0;f<d.length;f++)b=(0|c.words[f])+(0|d.words[f])+e,this.words[f]=67108863&b,e=b>>>26;for(;0!==e&&f<c.length;f++)b=(0|c.words[f])+e,this.words[f]=67108863&b,e=b>>>26;if(this.length=c.length,0!==e)this.words[this.length]=e,this.length++;else if(c!==this)for(;f<c.length;f++)this.words[f]=c.words[f];return this},f.prototype.add=function(a){var b;return 0!==a.negative&&0===this.negative?(a.negative=0,b=this.sub(a),a.negative^=1,b):0===a.negative&&0!==this.negative?(this.negative=0,b=a.sub(this),this.negative=1,b):this.length>a.length?this.clone().iadd(a):a.clone().iadd(this)},f.prototype.isub=function(a){if(0!==a.negative){a.negative=0;var b=this.iadd(a);return a.negative=1,b._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(a),this.negative=1,this._normSign();var c=this.cmp(a);if(0===c)return this.negative=0,this.length=1,this.words[0]=0,this;var d,e;c>0?(d=this,e=a):(d=a,e=this);for(var f=0,g=0;g<e.length;g++)b=(0|d.words[g])-(0|e.words[g])+f,f=b>>26,this.words[g]=67108863&b;for(;0!==f&&g<d.length;g++)b=(0|d.words[g])+f,f=b>>26,this.words[g]=67108863&b;if(0===f&&g<d.length&&d!==this)for(;g<d.length;g++)this.words[g]=d.words[g];return this.length=Math.max(this.length,g),d!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(a){return this.clone().isub(a)};var x=function(a,b,c){var d,e,f,g=a.words,h=b.words,i=c.words,j=0,k=0|g[0],l=8191&k,m=k>>>13,n=0|g[1],o=8191&n,p=n>>>13,q=0|g[2],r=8191&q,s=q>>>13,t=0|g[3],u=8191&t,v=t>>>13,w=0|g[4],x=8191&w,y=w>>>13,z=0|g[5],A=8191&z,B=z>>>13,C=0|g[6],D=8191&C,E=C>>>13,F=0|g[7],G=8191&F,H=F>>>13,I=0|g[8],J=8191&I,K=I>>>13,L=0|g[9],M=8191&L,N=L>>>13,O=0|h[0],P=8191&O,Q=O>>>13,R=0|h[1],S=8191&R,T=R>>>13,U=0|h[2],V=8191&U,W=U>>>13,X=0|h[3],Y=8191&X,Z=X>>>13,$=0|h[4],_=8191&$,aa=$>>>13,ba=0|h[5],ca=8191&ba,da=ba>>>13,ea=0|h[6],fa=8191&ea,ga=ea>>>13,ha=0|h[7],ia=8191&ha,ja=ha>>>13,ka=0|h[8],la=8191&ka,ma=ka>>>13,na=0|h[9],oa=8191&na,pa=na>>>13;c.negative=a.negative^b.negative,c.length=19,d=Math.imul(l,P),e=Math.imul(l,Q),e=e+Math.imul(m,P)|0,f=Math.imul(m,Q);var qa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(qa>>>26)|0,qa&=67108863,d=Math.imul(o,P),e=Math.imul(o,Q),e=e+Math.imul(p,P)|0,f=Math.imul(p,Q),d=d+Math.imul(l,S)|0,e=e+Math.imul(l,T)|0,e=e+Math.imul(m,S)|0,f=f+Math.imul(m,T)|0;var ra=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(ra>>>26)|0,ra&=67108863,d=Math.imul(r,P),e=Math.imul(r,Q),e=e+Math.imul(s,P)|0,f=Math.imul(s,Q),d=d+Math.imul(o,S)|0,e=e+Math.imul(o,T)|0,e=e+Math.imul(p,S)|0,f=f+Math.imul(p,T)|0,d=d+Math.imul(l,V)|0,e=e+Math.imul(l,W)|0,e=e+Math.imul(m,V)|0,f=f+Math.imul(m,W)|0;var sa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(sa>>>26)|0,sa&=67108863,d=Math.imul(u,P),e=Math.imul(u,Q),e=e+Math.imul(v,P)|0,f=Math.imul(v,Q),d=d+Math.imul(r,S)|0,e=e+Math.imul(r,T)|0,e=e+Math.imul(s,S)|0,f=f+Math.imul(s,T)|0,d=d+Math.imul(o,V)|0,e=e+Math.imul(o,W)|0,e=e+Math.imul(p,V)|0,f=f+Math.imul(p,W)|0,d=d+Math.imul(l,Y)|0,e=e+Math.imul(l,Z)|0,e=e+Math.imul(m,Y)|0,f=f+Math.imul(m,Z)|0;var ta=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(ta>>>26)|0,ta&=67108863,d=Math.imul(x,P),e=Math.imul(x,Q),e=e+Math.imul(y,P)|0,f=Math.imul(y,Q),d=d+Math.imul(u,S)|0,e=e+Math.imul(u,T)|0,e=e+Math.imul(v,S)|0,f=f+Math.imul(v,T)|0,d=d+Math.imul(r,V)|0,e=e+Math.imul(r,W)|0,e=e+Math.imul(s,V)|0,f=f+Math.imul(s,W)|0,d=d+Math.imul(o,Y)|0,e=e+Math.imul(o,Z)|0,e=e+Math.imul(p,Y)|0,f=f+Math.imul(p,Z)|0,d=d+Math.imul(l,_)|0,e=e+Math.imul(l,aa)|0,e=e+Math.imul(m,_)|0,f=f+Math.imul(m,aa)|0;var ua=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(ua>>>26)|0,ua&=67108863,d=Math.imul(A,P),e=Math.imul(A,Q),e=e+Math.imul(B,P)|0,f=Math.imul(B,Q),d=d+Math.imul(x,S)|0,e=e+Math.imul(x,T)|0,e=e+Math.imul(y,S)|0,f=f+Math.imul(y,T)|0,d=d+Math.imul(u,V)|0,e=e+Math.imul(u,W)|0,e=e+Math.imul(v,V)|0,f=f+Math.imul(v,W)|0,d=d+Math.imul(r,Y)|0,e=e+Math.imul(r,Z)|0,e=e+Math.imul(s,Y)|0,f=f+Math.imul(s,Z)|0,d=d+Math.imul(o,_)|0,e=e+Math.imul(o,aa)|0,e=e+Math.imul(p,_)|0,f=f+Math.imul(p,aa)|0,d=d+Math.imul(l,ca)|0,e=e+Math.imul(l,da)|0,e=e+Math.imul(m,ca)|0,f=f+Math.imul(m,da)|0;var va=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(va>>>26)|0,va&=67108863,d=Math.imul(D,P),e=Math.imul(D,Q),e=e+Math.imul(E,P)|0,f=Math.imul(E,Q),d=d+Math.imul(A,S)|0,e=e+Math.imul(A,T)|0,e=e+Math.imul(B,S)|0,f=f+Math.imul(B,T)|0,d=d+Math.imul(x,V)|0,e=e+Math.imul(x,W)|0,e=e+Math.imul(y,V)|0,f=f+Math.imul(y,W)|0,d=d+Math.imul(u,Y)|0,e=e+Math.imul(u,Z)|0,e=e+Math.imul(v,Y)|0,f=f+Math.imul(v,Z)|0,d=d+Math.imul(r,_)|0,e=e+Math.imul(r,aa)|0,e=e+Math.imul(s,_)|0,f=f+Math.imul(s,aa)|0,d=d+Math.imul(o,ca)|0,e=e+Math.imul(o,da)|0,e=e+Math.imul(p,ca)|0,f=f+Math.imul(p,da)|0,d=d+Math.imul(l,fa)|0,e=e+Math.imul(l,ga)|0,e=e+Math.imul(m,fa)|0,f=f+Math.imul(m,ga)|0;var wa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(wa>>>26)|0,wa&=67108863,d=Math.imul(G,P),e=Math.imul(G,Q),e=e+Math.imul(H,P)|0,f=Math.imul(H,Q),d=d+Math.imul(D,S)|0,e=e+Math.imul(D,T)|0,e=e+Math.imul(E,S)|0,f=f+Math.imul(E,T)|0,d=d+Math.imul(A,V)|0,e=e+Math.imul(A,W)|0,e=e+Math.imul(B,V)|0,f=f+Math.imul(B,W)|0,d=d+Math.imul(x,Y)|0,e=e+Math.imul(x,Z)|0,e=e+Math.imul(y,Y)|0,f=f+Math.imul(y,Z)|0,d=d+Math.imul(u,_)|0,e=e+Math.imul(u,aa)|0,e=e+Math.imul(v,_)|0,f=f+Math.imul(v,aa)|0,d=d+Math.imul(r,ca)|0,e=e+Math.imul(r,da)|0,e=e+Math.imul(s,ca)|0,f=f+Math.imul(s,da)|0,d=d+Math.imul(o,fa)|0,e=e+Math.imul(o,ga)|0,e=e+Math.imul(p,fa)|0,f=f+Math.imul(p,ga)|0,d=d+Math.imul(l,ia)|0,e=e+Math.imul(l,ja)|0,e=e+Math.imul(m,ia)|0,f=f+Math.imul(m,ja)|0;var xa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(xa>>>26)|0,xa&=67108863,d=Math.imul(J,P),e=Math.imul(J,Q),e=e+Math.imul(K,P)|0,f=Math.imul(K,Q),d=d+Math.imul(G,S)|0,e=e+Math.imul(G,T)|0,e=e+Math.imul(H,S)|0,f=f+Math.imul(H,T)|0,d=d+Math.imul(D,V)|0,e=e+Math.imul(D,W)|0,e=e+Math.imul(E,V)|0,f=f+Math.imul(E,W)|0,d=d+Math.imul(A,Y)|0,e=e+Math.imul(A,Z)|0,e=e+Math.imul(B,Y)|0,f=f+Math.imul(B,Z)|0,d=d+Math.imul(x,_)|0,e=e+Math.imul(x,aa)|0,e=e+Math.imul(y,_)|0,f=f+Math.imul(y,aa)|0,d=d+Math.imul(u,ca)|0,e=e+Math.imul(u,da)|0,e=e+Math.imul(v,ca)|0,f=f+Math.imul(v,da)|0,d=d+Math.imul(r,fa)|0,e=e+Math.imul(r,ga)|0,e=e+Math.imul(s,fa)|0,f=f+Math.imul(s,ga)|0,d=d+Math.imul(o,ia)|0,e=e+Math.imul(o,ja)|0,e=e+Math.imul(p,ia)|0,f=f+Math.imul(p,ja)|0,d=d+Math.imul(l,la)|0,e=e+Math.imul(l,ma)|0,e=e+Math.imul(m,la)|0,f=f+Math.imul(m,ma)|0;var ya=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(ya>>>26)|0,ya&=67108863,d=Math.imul(M,P),e=Math.imul(M,Q),e=e+Math.imul(N,P)|0,f=Math.imul(N,Q),d=d+Math.imul(J,S)|0,e=e+Math.imul(J,T)|0,e=e+Math.imul(K,S)|0,f=f+Math.imul(K,T)|0,d=d+Math.imul(G,V)|0,e=e+Math.imul(G,W)|0,e=e+Math.imul(H,V)|0,f=f+Math.imul(H,W)|0,d=d+Math.imul(D,Y)|0,e=e+Math.imul(D,Z)|0,e=e+Math.imul(E,Y)|0,f=f+Math.imul(E,Z)|0,d=d+Math.imul(A,_)|0,e=e+Math.imul(A,aa)|0,e=e+Math.imul(B,_)|0,f=f+Math.imul(B,aa)|0,d=d+Math.imul(x,ca)|0,e=e+Math.imul(x,da)|0,e=e+Math.imul(y,ca)|0,f=f+Math.imul(y,da)|0,d=d+Math.imul(u,fa)|0,e=e+Math.imul(u,ga)|0,e=e+Math.imul(v,fa)|0,f=f+Math.imul(v,ga)|0,d=d+Math.imul(r,ia)|0,e=e+Math.imul(r,ja)|0,e=e+Math.imul(s,ia)|0,f=f+Math.imul(s,ja)|0,d=d+Math.imul(o,la)|0,e=e+Math.imul(o,ma)|0,e=e+Math.imul(p,la)|0,f=f+Math.imul(p,ma)|0,d=d+Math.imul(l,oa)|0,e=e+Math.imul(l,pa)|0,e=e+Math.imul(m,oa)|0,f=f+Math.imul(m,pa)|0;var za=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(za>>>26)|0,za&=67108863,d=Math.imul(M,S),e=Math.imul(M,T),e=e+Math.imul(N,S)|0,f=Math.imul(N,T),d=d+Math.imul(J,V)|0,e=e+Math.imul(J,W)|0,e=e+Math.imul(K,V)|0,f=f+Math.imul(K,W)|0,d=d+Math.imul(G,Y)|0,e=e+Math.imul(G,Z)|0,e=e+Math.imul(H,Y)|0,f=f+Math.imul(H,Z)|0,d=d+Math.imul(D,_)|0,e=e+Math.imul(D,aa)|0,e=e+Math.imul(E,_)|0,f=f+Math.imul(E,aa)|0,d=d+Math.imul(A,ca)|0,e=e+Math.imul(A,da)|0,e=e+Math.imul(B,ca)|0,f=f+Math.imul(B,da)|0,d=d+Math.imul(x,fa)|0,e=e+Math.imul(x,ga)|0,e=e+Math.imul(y,fa)|0,f=f+Math.imul(y,ga)|0,d=d+Math.imul(u,ia)|0,e=e+Math.imul(u,ja)|0,e=e+Math.imul(v,ia)|0,f=f+Math.imul(v,ja)|0,d=d+Math.imul(r,la)|0,e=e+Math.imul(r,ma)|0,e=e+Math.imul(s,la)|0,f=f+Math.imul(s,ma)|0,d=d+Math.imul(o,oa)|0,e=e+Math.imul(o,pa)|0,e=e+Math.imul(p,oa)|0,f=f+Math.imul(p,pa)|0;var Aa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Aa>>>26)|0,Aa&=67108863,d=Math.imul(M,V),e=Math.imul(M,W),e=e+Math.imul(N,V)|0,f=Math.imul(N,W),d=d+Math.imul(J,Y)|0,e=e+Math.imul(J,Z)|0,e=e+Math.imul(K,Y)|0,f=f+Math.imul(K,Z)|0,d=d+Math.imul(G,_)|0,e=e+Math.imul(G,aa)|0,e=e+Math.imul(H,_)|0,f=f+Math.imul(H,aa)|0,d=d+Math.imul(D,ca)|0,e=e+Math.imul(D,da)|0,e=e+Math.imul(E,ca)|0,f=f+Math.imul(E,da)|0,d=d+Math.imul(A,fa)|0,e=e+Math.imul(A,ga)|0,e=e+Math.imul(B,fa)|0,f=f+Math.imul(B,ga)|0,d=d+Math.imul(x,ia)|0,e=e+Math.imul(x,ja)|0,e=e+Math.imul(y,ia)|0,f=f+Math.imul(y,ja)|0,d=d+Math.imul(u,la)|0,e=e+Math.imul(u,ma)|0,e=e+Math.imul(v,la)|0,f=f+Math.imul(v,ma)|0,d=d+Math.imul(r,oa)|0,e=e+Math.imul(r,pa)|0,e=e+Math.imul(s,oa)|0,f=f+Math.imul(s,pa)|0;var Ba=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ba>>>26)|0,Ba&=67108863,d=Math.imul(M,Y),e=Math.imul(M,Z),e=e+Math.imul(N,Y)|0,f=Math.imul(N,Z),d=d+Math.imul(J,_)|0,e=e+Math.imul(J,aa)|0,e=e+Math.imul(K,_)|0,f=f+Math.imul(K,aa)|0,d=d+Math.imul(G,ca)|0,e=e+Math.imul(G,da)|0,e=e+Math.imul(H,ca)|0,f=f+Math.imul(H,da)|0,d=d+Math.imul(D,fa)|0,e=e+Math.imul(D,ga)|0,e=e+Math.imul(E,fa)|0,f=f+Math.imul(E,ga)|0,d=d+Math.imul(A,ia)|0,e=e+Math.imul(A,ja)|0,e=e+Math.imul(B,ia)|0,f=f+Math.imul(B,ja)|0,d=d+Math.imul(x,la)|0,e=e+Math.imul(x,ma)|0,e=e+Math.imul(y,la)|0,f=f+Math.imul(y,ma)|0,d=d+Math.imul(u,oa)|0,
10
e=e+Math.imul(u,pa)|0,e=e+Math.imul(v,oa)|0,f=f+Math.imul(v,pa)|0;var Ca=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ca>>>26)|0,Ca&=67108863,d=Math.imul(M,_),e=Math.imul(M,aa),e=e+Math.imul(N,_)|0,f=Math.imul(N,aa),d=d+Math.imul(J,ca)|0,e=e+Math.imul(J,da)|0,e=e+Math.imul(K,ca)|0,f=f+Math.imul(K,da)|0,d=d+Math.imul(G,fa)|0,e=e+Math.imul(G,ga)|0,e=e+Math.imul(H,fa)|0,f=f+Math.imul(H,ga)|0,d=d+Math.imul(D,ia)|0,e=e+Math.imul(D,ja)|0,e=e+Math.imul(E,ia)|0,f=f+Math.imul(E,ja)|0,d=d+Math.imul(A,la)|0,e=e+Math.imul(A,ma)|0,e=e+Math.imul(B,la)|0,f=f+Math.imul(B,ma)|0,d=d+Math.imul(x,oa)|0,e=e+Math.imul(x,pa)|0,e=e+Math.imul(y,oa)|0,f=f+Math.imul(y,pa)|0;var Da=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Da>>>26)|0,Da&=67108863,d=Math.imul(M,ca),e=Math.imul(M,da),e=e+Math.imul(N,ca)|0,f=Math.imul(N,da),d=d+Math.imul(J,fa)|0,e=e+Math.imul(J,ga)|0,e=e+Math.imul(K,fa)|0,f=f+Math.imul(K,ga)|0,d=d+Math.imul(G,ia)|0,e=e+Math.imul(G,ja)|0,e=e+Math.imul(H,ia)|0,f=f+Math.imul(H,ja)|0,d=d+Math.imul(D,la)|0,e=e+Math.imul(D,ma)|0,e=e+Math.imul(E,la)|0,f=f+Math.imul(E,ma)|0,d=d+Math.imul(A,oa)|0,e=e+Math.imul(A,pa)|0,e=e+Math.imul(B,oa)|0,f=f+Math.imul(B,pa)|0;var Ea=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ea>>>26)|0,Ea&=67108863,d=Math.imul(M,fa),e=Math.imul(M,ga),e=e+Math.imul(N,fa)|0,f=Math.imul(N,ga),d=d+Math.imul(J,ia)|0,e=e+Math.imul(J,ja)|0,e=e+Math.imul(K,ia)|0,f=f+Math.imul(K,ja)|0,d=d+Math.imul(G,la)|0,e=e+Math.imul(G,ma)|0,e=e+Math.imul(H,la)|0,f=f+Math.imul(H,ma)|0,d=d+Math.imul(D,oa)|0,e=e+Math.imul(D,pa)|0,e=e+Math.imul(E,oa)|0,f=f+Math.imul(E,pa)|0;var Fa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Fa>>>26)|0,Fa&=67108863,d=Math.imul(M,ia),e=Math.imul(M,ja),e=e+Math.imul(N,ia)|0,f=Math.imul(N,ja),d=d+Math.imul(J,la)|0,e=e+Math.imul(J,ma)|0,e=e+Math.imul(K,la)|0,f=f+Math.imul(K,ma)|0,d=d+Math.imul(G,oa)|0,e=e+Math.imul(G,pa)|0,e=e+Math.imul(H,oa)|0,f=f+Math.imul(H,pa)|0;var Ga=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ga>>>26)|0,Ga&=67108863,d=Math.imul(M,la),e=Math.imul(M,ma),e=e+Math.imul(N,la)|0,f=Math.imul(N,ma),d=d+Math.imul(J,oa)|0,e=e+Math.imul(J,pa)|0,e=e+Math.imul(K,oa)|0,f=f+Math.imul(K,pa)|0;var Ha=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ha>>>26)|0,Ha&=67108863,d=Math.imul(M,oa),e=Math.imul(M,pa),e=e+Math.imul(N,oa)|0,f=Math.imul(N,pa);var Ia=(j+d|0)+((8191&e)<<13)|0;return j=(f+(e>>>13)|0)+(Ia>>>26)|0,Ia&=67108863,i[0]=qa,i[1]=ra,i[2]=sa,i[3]=ta,i[4]=ua,i[5]=va,i[6]=wa,i[7]=xa,i[8]=ya,i[9]=za,i[10]=Aa,i[11]=Ba,i[12]=Ca,i[13]=Da,i[14]=Ea,i[15]=Fa,i[16]=Ga,i[17]=Ha,i[18]=Ia,0!==j&&(i[19]=j,c.length++),c};Math.imul||(x=j),f.prototype.mulTo=function(a,b){var c,d=this.length+a.length;return c=10===this.length&&10===a.length?x(this,a,b):d<63?j(this,a,b):d<1024?k(this,a,b):l(this,a,b)},m.prototype.makeRBT=function(a){for(var b=new Array(a),c=f.prototype._countBits(a)-1,d=0;d<a;d++)b[d]=this.revBin(d,c,a);return b},m.prototype.revBin=function(a,b,c){if(0===a||a===c-1)return a;for(var d=0,e=0;e<b;e++)d|=(1&a)<<b-e-1,a>>=1;return d},m.prototype.permute=function(a,b,c,d,e,f){for(var g=0;g<f;g++)d[g]=b[a[g]],e[g]=c[a[g]]},m.prototype.transform=function(a,b,c,d,e,f){this.permute(f,a,b,c,d,e);for(var g=1;g<e;g<<=1)for(var h=g<<1,i=Math.cos(2*Math.PI/h),j=Math.sin(2*Math.PI/h),k=0;k<e;k+=h)for(var l=i,m=j,n=0;n<g;n++){var o=c[k+n],p=d[k+n],q=c[k+n+g],r=d[k+n+g],s=l*q-m*r;r=l*r+m*q,q=s,c[k+n]=o+q,d[k+n]=p+r,c[k+n+g]=o-q,d[k+n+g]=p-r,n!==h&&(s=i*l-j*m,m=i*m+j*l,l=s)}},m.prototype.guessLen13b=function(a,b){var c=1|Math.max(b,a),d=1&c,e=0;for(c=c/2|0;c;c>>>=1)e++;return 1<<e+1+d},m.prototype.conjugate=function(a,b,c){if(!(c<=1))for(var d=0;d<c/2;d++){var e=a[d];a[d]=a[c-d-1],a[c-d-1]=e,e=b[d],b[d]=-b[c-d-1],b[c-d-1]=-e}},m.prototype.normalize13b=function(a,b){for(var c=0,d=0;d<b/2;d++){var e=8192*Math.round(a[2*d+1]/b)+Math.round(a[2*d]/b)+c;a[d]=67108863&e,c=e<67108864?0:e/67108864|0}return a},m.prototype.convert13b=function(a,b,c,e){for(var f=0,g=0;g<b;g++)f+=0|a[g],c[2*g]=8191&f,f>>>=13,c[2*g+1]=8191&f,f>>>=13;for(g=2*b;g<e;++g)c[g]=0;d(0===f),d(0===(f&-8192))},m.prototype.stub=function(a){for(var b=new Array(a),c=0;c<a;c++)b[c]=0;return b},m.prototype.mulp=function(a,b,c){var d=2*this.guessLen13b(a.length,b.length),e=this.makeRBT(d),f=this.stub(d),g=new Array(d),h=new Array(d),i=new Array(d),j=new Array(d),k=new Array(d),l=new Array(d),m=c.words;m.length=d,this.convert13b(a.words,a.length,g,d),this.convert13b(b.words,b.length,j,d),this.transform(g,f,h,i,d,e),this.transform(j,f,k,l,d,e);for(var n=0;n<d;n++){var o=h[n]*k[n]-i[n]*l[n];i[n]=h[n]*l[n]+i[n]*k[n],h[n]=o}return this.conjugate(h,i,d),this.transform(h,i,m,f,d,e),this.conjugate(m,f,d),this.normalize13b(m,d),c.negative=a.negative^b.negative,c.length=a.length+b.length,c.strip()},f.prototype.mul=function(a){var b=new f(null);return b.words=new Array(this.length+a.length),this.mulTo(a,b)},f.prototype.mulf=function(a){var b=new f(null);return b.words=new Array(this.length+a.length),l(this,a,b)},f.prototype.imul=function(a){return this.clone().mulTo(a,this)},f.prototype.imuln=function(a){d("number"==typeof a),d(a<67108864);for(var b=0,c=0;c<this.length;c++){var e=(0|this.words[c])*a,f=(67108863&e)+(67108863&b);b>>=26,b+=e/67108864|0,b+=f>>>26,this.words[c]=67108863&f}return 0!==b&&(this.words[c]=b,this.length++),this},f.prototype.muln=function(a){return this.clone().imuln(a)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(a){var b=i(a);if(0===b.length)return new f(1);for(var c=this,d=0;d<b.length&&0===b[d];d++,c=c.sqr());if(++d<b.length)for(var e=c.sqr();d<b.length;d++,e=e.sqr())0!==b[d]&&(c=c.mul(e));return c},f.prototype.iushln=function(a){d("number"==typeof a&&a>=0);var b,c=a%26,e=(a-c)/26,f=67108863>>>26-c<<26-c;if(0!==c){var g=0;for(b=0;b<this.length;b++){var h=this.words[b]&f,i=(0|this.words[b])-h<<c;this.words[b]=i|g,g=h>>>26-c}g&&(this.words[b]=g,this.length++)}if(0!==e){for(b=this.length-1;b>=0;b--)this.words[b+e]=this.words[b];for(b=0;b<e;b++)this.words[b]=0;this.length+=e}return this.strip()},f.prototype.ishln=function(a){return d(0===this.negative),this.iushln(a)},f.prototype.iushrn=function(a,b,c){d("number"==typeof a&&a>=0);var e;e=b?(b-b%26)/26:0;var f=a%26,g=Math.min((a-f)/26,this.length),h=67108863^67108863>>>f<<f,i=c;if(e-=g,e=Math.max(0,e),i){for(var j=0;j<g;j++)i.words[j]=this.words[j];i.length=g}if(0===g);else if(this.length>g)for(this.length-=g,j=0;j<this.length;j++)this.words[j]=this.words[j+g];else this.words[0]=0,this.length=1;var k=0;for(j=this.length-1;j>=0&&(0!==k||j>=e);j--){var l=0|this.words[j];this.words[j]=k<<26-f|l>>>f,k=l&h}return i&&0!==k&&(i.words[i.length++]=k),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(a,b,c){return d(0===this.negative),this.iushrn(a,b,c)},f.prototype.shln=function(a){return this.clone().ishln(a)},f.prototype.ushln=function(a){return this.clone().iushln(a)},f.prototype.shrn=function(a){return this.clone().ishrn(a)},f.prototype.ushrn=function(a){return this.clone().iushrn(a)},f.prototype.testn=function(a){d("number"==typeof a&&a>=0);var b=a%26,c=(a-b)/26,e=1<<b;if(this.length<=c)return!1;var f=this.words[c];return!!(f&e)},f.prototype.imaskn=function(a){d("number"==typeof a&&a>=0);var b=a%26,c=(a-b)/26;if(d(0===this.negative,"imaskn works only with positive numbers"),this.length<=c)return this;if(0!==b&&c++,this.length=Math.min(c,this.length),0!==b){var e=67108863^67108863>>>b<<b;this.words[this.length-1]&=e}return this.strip()},f.prototype.maskn=function(a){return this.clone().imaskn(a)},f.prototype.iaddn=function(a){return d("number"==typeof a),d(a<67108864),a<0?this.isubn(-a):0!==this.negative?1===this.length&&(0|this.words[0])<a?(this.words[0]=a-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(a),this.negative=1,this):this._iaddn(a)},f.prototype._iaddn=function(a){this.words[0]+=a;for(var b=0;b<this.length&&this.words[b]>=67108864;b++)this.words[b]-=67108864,b===this.length-1?this.words[b+1]=1:this.words[b+1]++;return this.length=Math.max(this.length,b+1),this},f.prototype.isubn=function(a){if(d("number"==typeof a),d(a<67108864),a<0)return this.iaddn(-a);if(0!==this.negative)return this.negative=0,this.iaddn(a),this.negative=1,this;if(this.words[0]-=a,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var b=0;b<this.length&&this.words[b]<0;b++)this.words[b]+=67108864,this.words[b+1]-=1;return this.strip()},f.prototype.addn=function(a){return this.clone().iaddn(a)},f.prototype.subn=function(a){return this.clone().isubn(a)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(a,b,c){var e,f=a.length+c;this._expand(f);var g,h=0;for(e=0;e<a.length;e++){g=(0|this.words[e+c])+h;var i=(0|a.words[e])*b;g-=67108863&i,h=(g>>26)-(i/67108864|0),this.words[e+c]=67108863&g}for(;e<this.length-c;e++)g=(0|this.words[e+c])+h,h=g>>26,this.words[e+c]=67108863&g;if(0===h)return this.strip();for(d(h===-1),h=0,e=0;e<this.length;e++)g=-(0|this.words[e])+h,h=g>>26,this.words[e]=67108863&g;return this.negative=1,this.strip()},f.prototype._wordDiv=function(a,b){var c=this.length-a.length,d=this.clone(),e=a,g=0|e.words[e.length-1],h=this._countBits(g);c=26-h,0!==c&&(e=e.ushln(c),d.iushln(c),g=0|e.words[e.length-1]);var i,j=d.length-e.length;if("mod"!==b){i=new f(null),i.length=j+1,i.words=new Array(i.length);for(var k=0;k<i.length;k++)i.words[k]=0}var l=d.clone()._ishlnsubmul(e,1,j);0===l.negative&&(d=l,i&&(i.words[j]=1));for(var m=j-1;m>=0;m--){var n=67108864*(0|d.words[e.length+m])+(0|d.words[e.length+m-1]);for(n=Math.min(n/g|0,67108863),d._ishlnsubmul(e,n,m);0!==d.negative;)n--,d.negative=0,d._ishlnsubmul(e,1,m),d.isZero()||(d.negative^=1);i&&(i.words[m]=n)}return i&&i.strip(),d.strip(),"div"!==b&&0!==c&&d.iushrn(c),{div:i||null,mod:d}},f.prototype.divmod=function(a,b,c){if(d(!a.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var e,g,h;return 0!==this.negative&&0===a.negative?(h=this.neg().divmod(a,b),"mod"!==b&&(e=h.div.neg()),"div"!==b&&(g=h.mod.neg(),c&&0!==g.negative&&g.iadd(a)),{div:e,mod:g}):0===this.negative&&0!==a.negative?(h=this.divmod(a.neg(),b),"mod"!==b&&(e=h.div.neg()),{div:e,mod:h.mod}):0!==(this.negative&a.negative)?(h=this.neg().divmod(a.neg(),b),"div"!==b&&(g=h.mod.neg(),c&&0!==g.negative&&g.isub(a)),{div:h.div,mod:g}):a.length>this.length||this.cmp(a)<0?{div:new f(0),mod:this}:1===a.length?"div"===b?{div:this.divn(a.words[0]),mod:null}:"mod"===b?{div:null,mod:new f(this.modn(a.words[0]))}:{div:this.divn(a.words[0]),mod:new f(this.modn(a.words[0]))}:this._wordDiv(a,b)},f.prototype.div=function(a){return this.divmod(a,"div",!1).div},f.prototype.mod=function(a){return this.divmod(a,"mod",!1).mod},f.prototype.umod=function(a){return this.divmod(a,"mod",!0).mod},f.prototype.divRound=function(a){var b=this.divmod(a);if(b.mod.isZero())return b.div;var c=0!==b.div.negative?b.mod.isub(a):b.mod,d=a.ushrn(1),e=a.andln(1),f=c.cmp(d);return f<0||1===e&&0===f?b.div:0!==b.div.negative?b.div.isubn(1):b.div.iaddn(1)},f.prototype.modn=function(a){d(a<=67108863);for(var b=(1<<26)%a,c=0,e=this.length-1;e>=0;e--)c=(b*c+(0|this.words[e]))%a;return c},f.prototype.idivn=function(a){d(a<=67108863);for(var b=0,c=this.length-1;c>=0;c--){var e=(0|this.words[c])+67108864*b;this.words[c]=e/a|0,b=e%a}return this.strip()},f.prototype.divn=function(a){return this.clone().idivn(a)},f.prototype.egcd=function(a){d(0===a.negative),d(!a.isZero());var b=this,c=a.clone();b=0!==b.negative?b.umod(a):b.clone();for(var e=new f(1),g=new f(0),h=new f(0),i=new f(1),j=0;b.isEven()&&c.isEven();)b.iushrn(1),c.iushrn(1),++j;for(var k=c.clone(),l=b.clone();!b.isZero();){for(var m=0,n=1;0===(b.words[0]&n)&&m<26;++m,n<<=1);if(m>0)for(b.iushrn(m);m-- >0;)(e.isOdd()||g.isOdd())&&(e.iadd(k),g.isub(l)),e.iushrn(1),g.iushrn(1);for(var o=0,p=1;0===(c.words[0]&p)&&o<26;++o,p<<=1);if(o>0)for(c.iushrn(o);o-- >0;)(h.isOdd()||i.isOdd())&&(h.iadd(k),i.isub(l)),h.iushrn(1),i.iushrn(1);b.cmp(c)>=0?(b.isub(c),e.isub(h),g.isub(i)):(c.isub(b),h.isub(e),i.isub(g))}return{a:h,b:i,gcd:c.iushln(j)}},f.prototype._invmp=function(a){d(0===a.negative),d(!a.isZero());var b=this,c=a.clone();b=0!==b.negative?b.umod(a):b.clone();for(var e=new f(1),g=new f(0),h=c.clone();b.cmpn(1)>0&&c.cmpn(1)>0;){for(var i=0,j=1;0===(b.words[0]&j)&&i<26;++i,j<<=1);if(i>0)for(b.iushrn(i);i-- >0;)e.isOdd()&&e.iadd(h),e.iushrn(1);for(var k=0,l=1;0===(c.words[0]&l)&&k<26;++k,l<<=1);if(k>0)for(c.iushrn(k);k-- >0;)g.isOdd()&&g.iadd(h),g.iushrn(1);b.cmp(c)>=0?(b.isub(c),e.isub(g)):(c.isub(b),g.isub(e))}var m;return m=0===b.cmpn(1)?e:g,m.cmpn(0)<0&&m.iadd(a),m},f.prototype.gcd=function(a){if(this.isZero())return a.abs();if(a.isZero())return this.abs();var b=this.clone(),c=a.clone();b.negative=0,c.negative=0;for(var d=0;b.isEven()&&c.isEven();d++)b.iushrn(1),c.iushrn(1);for(;;){for(;b.isEven();)b.iushrn(1);for(;c.isEven();)c.iushrn(1);var e=b.cmp(c);if(e<0){var f=b;b=c,c=f}else if(0===e||0===c.cmpn(1))break;b.isub(c)}return c.iushln(d)},f.prototype.invm=function(a){return this.egcd(a).a.umod(a)},f.prototype.isEven=function(){return 0===(1&this.words[0])},f.prototype.isOdd=function(){return 1===(1&this.words[0])},f.prototype.andln=function(a){return this.words[0]&a},f.prototype.bincn=function(a){d("number"==typeof a);var b=a%26,c=(a-b)/26,e=1<<b;if(this.length<=c)return this._expand(c+1),this.words[c]|=e,this;for(var f=e,g=c;0!==f&&g<this.length;g++){var h=0|this.words[g];h+=f,f=h>>>26,h&=67108863,this.words[g]=h}return 0!==f&&(this.words[g]=f,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.prototype.cmpn=function(a){var b=a<0;if(0!==this.negative&&!b)return-1;if(0===this.negative&&b)return 1;this.strip();var c;if(this.length>1)c=1;else{b&&(a=-a),d(a<=67108863,"Number is too big");var e=0|this.words[0];c=e===a?0:e<a?-1:1}return 0!==this.negative?0|-c:c},f.prototype.cmp=function(a){if(0!==this.negative&&0===a.negative)return-1;if(0===this.negative&&0!==a.negative)return 1;var b=this.ucmp(a);return 0!==this.negative?0|-b:b},f.prototype.ucmp=function(a){if(this.length>a.length)return 1;if(this.length<a.length)return-1;for(var b=0,c=this.length-1;c>=0;c--){var d=0|this.words[c],e=0|a.words[c];if(d!==e){d<e?b=-1:d>e&&(b=1);break}}return b},f.prototype.gtn=function(a){return 1===this.cmpn(a)},f.prototype.gt=function(a){return 1===this.cmp(a)},f.prototype.gten=function(a){return this.cmpn(a)>=0},f.prototype.gte=function(a){return this.cmp(a)>=0},f.prototype.ltn=function(a){return this.cmpn(a)===-1},f.prototype.lt=function(a){return this.cmp(a)===-1},f.prototype.lten=function(a){return this.cmpn(a)<=0},f.prototype.lte=function(a){return this.cmp(a)<=0},f.prototype.eqn=function(a){return 0===this.cmpn(a)},f.prototype.eq=function(a){return 0===this.cmp(a)},f.red=function(a){return new s(a)},f.prototype.toRed=function(a){return d(!this.red,"Already a number in reduction context"),d(0===this.negative,"red works only with positives"),a.convertTo(this)._forceRed(a)},f.prototype.fromRed=function(){return d(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(a){return this.red=a,this},f.prototype.forceRed=function(a){return d(!this.red,"Already a number in reduction context"),this._forceRed(a)},f.prototype.redAdd=function(a){return d(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},f.prototype.redIAdd=function(a){return d(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},f.prototype.redSub=function(a){return d(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},f.prototype.redISub=function(a){return d(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},f.prototype.redShl=function(a){return d(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},f.prototype.redMul=function(a){return d(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},f.prototype.redIMul=function(a){return d(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},f.prototype.redSqr=function(){return d(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return d(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return d(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return d(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return d(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(a){return d(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var y={k256:null,p224:null,p192:null,p25519:null};n.prototype._tmp=function(){var a=new f(null);return a.words=new Array(Math.ceil(this.n/13)),a},n.prototype.ireduce=function(a){var b,c=a;do this.split(c,this.tmp),c=this.imulK(c),c=c.iadd(this.tmp),b=c.bitLength();while(b>this.n);var d=b<this.n?-1:c.ucmp(this.p);return 0===d?(c.words[0]=0,c.length=1):d>0?c.isub(this.p):c.strip(),c},n.prototype.split=function(a,b){a.iushrn(this.n,0,b)},n.prototype.imulK=function(a){return a.imul(this.k)},e(o,n),o.prototype.split=function(a,b){for(var c=4194303,d=Math.min(a.length,9),e=0;e<d;e++)b.words[e]=a.words[e];if(b.length=d,a.length<=9)return a.words[0]=0,void(a.length=1);var f=a.words[9];for(b.words[b.length++]=f&c,e=10;e<a.length;e++){var g=0|a.words[e];a.words[e-10]=(g&c)<<4|f>>>22,f=g}f>>>=22,a.words[e-10]=f,0===f&&a.length>10?a.length-=10:a.length-=9},o.prototype.imulK=function(a){a.words[a.length]=0,a.words[a.length+1]=0,a.length+=2;for(var b=0,c=0;c<a.length;c++){var d=0|a.words[c];b+=977*d,a.words[c]=67108863&b,b=64*d+(b/67108864|0)}return 0===a.words[a.length-1]&&(a.length--,0===a.words[a.length-1]&&a.length--),a},e(p,n),e(q,n),e(r,n),r.prototype.imulK=function(a){for(var b=0,c=0;c<a.length;c++){var d=19*(0|a.words[c])+b,e=67108863&d;d>>>=26,a.words[c]=e,b=d}return 0!==b&&(a.words[a.length++]=b),a},f._prime=function a(b){if(y[b])return y[b];var a;if("k256"===b)a=new o;else if("p224"===b)a=new p;else if("p192"===b)a=new q;else{if("p25519"!==b)throw new Error("Unknown prime "+b);a=new r}return y[b]=a,a},s.prototype._verify1=function(a){d(0===a.negative,"red works only with positives"),d(a.red,"red works only with red numbers")},s.prototype._verify2=function(a,b){d(0===(a.negative|b.negative),"red works only with positives"),d(a.red&&a.red===b.red,"red works only with red numbers")},s.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):a.umod(this.m)._forceRed(this)},s.prototype.neg=function(a){return a.isZero()?a.clone():this.m.sub(a)._forceRed(this)},s.prototype.add=function(a,b){this._verify2(a,b);var c=a.add(b);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},s.prototype.iadd=function(a,b){this._verify2(a,b);var c=a.iadd(b);return c.cmp(this.m)>=0&&c.isub(this.m),c},s.prototype.sub=function(a,b){this._verify2(a,b);var c=a.sub(b);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},s.prototype.isub=function(a,b){this._verify2(a,b);var c=a.isub(b);return c.cmpn(0)<0&&c.iadd(this.m),c},s.prototype.shl=function(a,b){return this._verify1(a),this.imod(a.ushln(b))},s.prototype.imul=function(a,b){return this._verify2(a,b),this.imod(a.imul(b))},s.prototype.mul=function(a,b){return this._verify2(a,b),this.imod(a.mul(b))},s.prototype.isqr=function(a){return this.imul(a,a.clone())},s.prototype.sqr=function(a){return this.mul(a,a)},s.prototype.sqrt=function(a){if(a.isZero())return a.clone();var b=this.m.andln(3);if(d(b%2===1),3===b){var c=this.m.add(new f(1)).iushrn(2);return this.pow(a,c)}for(var e=this.m.subn(1),g=0;!e.isZero()&&0===e.andln(1);)g++,e.iushrn(1);d(!e.isZero());var h=new f(1).toRed(this),i=h.redNeg(),j=this.m.subn(1).iushrn(1),k=this.m.bitLength();for(k=new f(2*k*k).toRed(this);0!==this.pow(k,j).cmp(i);)k.redIAdd(i);for(var l=this.pow(k,e),m=this.pow(a,e.addn(1).iushrn(1)),n=this.pow(a,e),o=g;0!==n.cmp(h);){for(var p=n,q=0;0!==p.cmp(h);q++)p=p.redSqr();d(q<o);var r=this.pow(l,new f(1).iushln(o-q-1));m=m.redMul(r),l=r.redSqr(),n=n.redMul(l),o=q}return m},s.prototype.invm=function(a){var b=a._invmp(this.m);return 0!==b.negative?(b.negative=0,this.imod(b).redNeg()):this.imod(b)},s.prototype.pow=function(a,b){if(b.isZero())return new f(1).toRed(this);if(0===b.cmpn(1))return a.clone();var c=4,d=new Array(1<<c);d[0]=new f(1).toRed(this),d[1]=a;for(var e=2;e<d.length;e++)d[e]=this.mul(d[e-1],a);var g=d[0],h=0,i=0,j=b.bitLength()%26;for(0===j&&(j=26),e=b.length-1;e>=0;e--){for(var k=b.words[e],l=j-1;l>=0;l--){var m=k>>l&1;g!==d[0]&&(g=this.sqr(g)),0!==m||0!==h?(h<<=1,h|=m,i++,(i===c||0===e&&0===l)&&(g=this.mul(g,d[h]),i=0,h=0)):i=0}j=26}return g},s.prototype.convertTo=function(a){var b=a.umod(this.m);return b===a?b.clone():b},s.prototype.convertFrom=function(a){var b=a.clone();return b.red=null,b},f.mont=function(a){return new t(a)},e(t,s),t.prototype.convertTo=function(a){return this.imod(a.ushln(this.shift))},t.prototype.convertFrom=function(a){var b=this.imod(a.mul(this.rinv));return b.red=null,b},t.prototype.imul=function(a,b){if(a.isZero()||b.isZero())return a.words[0]=0,a.length=1,a;var c=a.imul(b),d=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=c.isub(d).iushrn(this.shift),f=e;return e.cmp(this.m)>=0?f=e.isub(this.m):e.cmpn(0)<0&&(f=e.iadd(this.m)),f._forceRed(this)},t.prototype.mul=function(a,b){if(a.isZero()||b.isZero())return new f(0)._forceRed(this);var c=a.mul(b),d=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=c.isub(d).iushrn(this.shift),g=e;return e.cmp(this.m)>=0?g=e.isub(this.m):e.cmpn(0)<0&&(g=e.iadd(this.m)),g._forceRed(this)},t.prototype.invm=function(a){var b=this.imod(a._invmp(this.m).mul(this.r2));return b._forceRed(this)}}("undefined"==typeof b||b,this)},{buffer:77}],112:[function(a,b,c){"use strict";var d=c;d.version=a("../package.json").version,d.utils=a("./elliptic/utils"),d.rand=a("brorand"),d.curve=a("./elliptic/curve"),d.curves=a("./elliptic/curves"),d.ec=a("./elliptic/ec"),d.eddsa=a("./elliptic/eddsa")},{"../package.json":127,"./elliptic/curve":115,"./elliptic/curves":118,"./elliptic/ec":119,"./elliptic/eddsa":122,"./elliptic/utils":126,brorand:76}],113:[function(a,b,c){"use strict";function d(a,b){this.type=a,this.p=new f(b.p,16),this.red=b.prime?f.red(b.prime):f.mont(this.p),this.zero=new f(0).toRed(this.red),this.one=new f(1).toRed(this.red),this.two=new f(2).toRed(this.red),this.n=b.n&&new f(b.n,16),this.g=b.g&&this.pointFromJSON(b.g,b.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var c=this.n&&this.p.div(this.n);!c||c.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function e(a,b){this.curve=a,this.type=b,this.precomputed=null}var f=a("bn.js"),g=a("../../elliptic"),h=g.utils,i=h.getNAF,j=h.getJSF,k=h.assert;b.exports=d,d.prototype.point=function(){throw new Error("Not implemented")},d.prototype.validate=function(){throw new Error("Not implemented")},d.prototype._fixedNafMul=function(a,b){k(a.precomputed);var c=a._getDoubles(),d=i(b,1),e=(1<<c.step+1)-(c.step%2===0?2:1);e/=3;for(var f=[],g=0;g<d.length;g+=c.step){for(var h=0,b=g+c.step-1;b>=g;b--)h=(h<<1)+d[b];f.push(h)}for(var j=this.jpoint(null,null,null),l=this.jpoint(null,null,null),m=e;m>0;m--){for(var g=0;g<f.length;g++){var h=f[g];h===m?l=l.mixedAdd(c.points[g]):h===-m&&(l=l.mixedAdd(c.points[g].neg()))}j=j.add(l)}return j.toP()},d.prototype._wnafMul=function(a,b){var c=4,d=a._getNAFPoints(c);c=d.wnd;for(var e=d.points,f=i(b,c),g=this.jpoint(null,null,null),h=f.length-1;h>=0;h--){for(var b=0;h>=0&&0===f[h];h--)b++;if(h>=0&&b++,g=g.dblp(b),h<0)break;var j=f[h];k(0!==j),g="affine"===a.type?j>0?g.mixedAdd(e[j-1>>1]):g.mixedAdd(e[-j-1>>1].neg()):j>0?g.add(e[j-1>>1]):g.add(e[-j-1>>1].neg())}return"affine"===a.type?g.toP():g},d.prototype._wnafMulAdd=function(a,b,c,d,e){for(var f=this._wnafT1,g=this._wnafT2,h=this._wnafT3,k=0,l=0;l<d;l++){var m=b[l],n=m._getNAFPoints(a);f[l]=n.wnd,g[l]=n.points}for(var l=d-1;l>=1;l-=2){var o=l-1,p=l;if(1===f[o]&&1===f[p]){var q=[b[o],null,null,b[p]];0===b[o].y.cmp(b[p].y)?(q[1]=b[o].add(b[p]),q[2]=b[o].toJ().mixedAdd(b[p].neg())):0===b[o].y.cmp(b[p].y.redNeg())?(q[1]=b[o].toJ().mixedAdd(b[p]),q[2]=b[o].add(b[p].neg())):(q[1]=b[o].toJ().mixedAdd(b[p]),q[2]=b[o].toJ().mixedAdd(b[p].neg()));var r=[-3,-1,-5,-7,0,7,5,1,3],s=j(c[o],c[p]);k=Math.max(s[0].length,k),h[o]=new Array(k),h[p]=new Array(k);for(var t=0;t<k;t++){var u=0|s[0][t],v=0|s[1][t];h[o][t]=r[3*(u+1)+(v+1)],h[p][t]=0,g[o]=q}}else h[o]=i(c[o],f[o]),h[p]=i(c[p],f[p]),k=Math.max(h[o].length,k),k=Math.max(h[p].length,k)}for(var w=this.jpoint(null,null,null),x=this._wnafT4,l=k;l>=0;l--){for(var y=0;l>=0;){for(var z=!0,t=0;t<d;t++)x[t]=0|h[t][l],0!==x[t]&&(z=!1);if(!z)break;y++,l--}if(l>=0&&y++,w=w.dblp(y),l<0)break;for(var t=0;t<d;t++){var m,A=x[t];0!==A&&(A>0?m=g[t][A-1>>1]:A<0&&(m=g[t][-A-1>>1].neg()),w="affine"===m.type?w.mixedAdd(m):w.add(m))}}for(var l=0;l<d;l++)g[l]=null;return e?w:w.toP()},d.BasePoint=e,e.prototype.eq=function(){throw new Error("Not implemented")},e.prototype.validate=function(){return this.curve.validate(this)},d.prototype.decodePoint=function(a,b){a=h.toArray(a,b);var c=this.p.byteLength();if((4===a[0]||6===a[0]||7===a[0])&&a.length-1===2*c){6===a[0]?k(a[a.length-1]%2===0):7===a[0]&&k(a[a.length-1]%2===1);var d=this.point(a.slice(1,1+c),a.slice(1+c,1+2*c));return d}if((2===a[0]||3===a[0])&&a.length-1===c)return this.pointFromX(a.slice(1,1+c),3===a[0]);throw new Error("Unknown point format")},e.prototype.encodeCompressed=function(a){return this.encode(a,!0)},e.prototype._encode=function(a){var b=this.curve.p.byteLength(),c=this.getX().toArray("be",b);return a?[this.getY().isEven()?2:3].concat(c):[4].concat(c,this.getY().toArray("be",b))},e.prototype.encode=function(a,b){return h.encode(this._encode(b),a)},e.prototype.precompute=function(a){if(this.precomputed)return this;var b={doubles:null,naf:null,beta:null};return b.naf=this._getNAFPoints(8),b.doubles=this._getDoubles(4,a),b.beta=this._getBeta(),this.precomputed=b,this},e.prototype._hasDoubles=function(a){if(!this.precomputed)return!1;var b=this.precomputed.doubles;return!!b&&b.points.length>=Math.ceil((a.bitLength()+1)/b.step)},e.prototype._getDoubles=function(a,b){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var c=[this],d=this,e=0;e<b;e+=a){for(var f=0;f<a;f++)d=d.dbl();c.push(d)}return{step:a,points:c}},e.prototype._getNAFPoints=function(a){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var b=[this],c=(1<<a)-1,d=1===c?null:this.dbl(),e=1;e<c;e++)b[e]=b[e-1].add(d);return{wnd:a,points:b}},e.prototype._getBeta=function(){return null},e.prototype.dblp=function(a){for(var b=this,c=0;c<a;c++)b=b.dbl();return b}},{"../../elliptic":112,"bn.js":111}],114:[function(a,b,c){"use strict";function d(a){this.twisted=1!==(0|a.a),this.mOneA=this.twisted&&(0|a.a)===-1,this.extended=this.mOneA,i.call(this,"edwards",a),this.a=new g(a.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new g(a.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new g(a.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),j(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1===(0|a.c)}function Point(a,b,c,d,e){i.BasePoint.call(this,a,"projective"),null===b&&null===c&&null===d?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new g(b,16),this.y=new g(c,16),this.z=d?new g(d,16):this.curve.one,this.t=e&&new g(e,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}var e=a("../curve"),f=a("../../elliptic"),g=a("bn.js"),h=a("inherits"),i=e.base,j=f.utils.assert;h(d,i),b.exports=d,d.prototype._mulA=function(a){return this.mOneA?a.redNeg():this.a.redMul(a)},d.prototype._mulC=function(a){return this.oneC?a:this.c.redMul(a)},d.prototype.jpoint=function(a,b,c,d){return this.point(a,b,c,d)},d.prototype.pointFromX=function(a,b){a=new g(a,16),a.red||(a=a.toRed(this.red));var c=a.redSqr(),d=this.c2.redSub(this.a.redMul(c)),e=this.one.redSub(this.c2.redMul(this.d).redMul(c)),f=d.redMul(e.redInvm()),h=f.redSqrt();if(0!==h.redSqr().redSub(f).cmp(this.zero))throw new Error("invalid point");var i=h.fromRed().isOdd();return(b&&!i||!b&&i)&&(h=h.redNeg()),this.point(a,h)},d.prototype.pointFromY=function(a,b){a=new g(a,16),a.red||(a=a.toRed(this.red));var c=a.redSqr(),d=c.redSub(this.one),e=c.redMul(this.d).redAdd(this.one),f=d.redMul(e.redInvm());if(0===f.cmp(this.zero)){if(b)throw new Error("invalid point");return this.point(this.zero,a)}var h=f.redSqrt();if(0!==h.redSqr().redSub(f).cmp(this.zero))throw new Error("invalid point");return h.isOdd()!==b&&(h=h.redNeg()),this.point(h,a)},d.prototype.validate=function(a){if(a.isInfinity())return!0;a.normalize();var b=a.x.redSqr(),c=a.y.redSqr(),d=b.redMul(this.a).redAdd(c),e=this.c2.redMul(this.one.redAdd(this.d.redMul(b).redMul(c)));return 0===d.cmp(e)},h(Point,i.BasePoint),d.prototype.pointFromJSON=function(a){return Point.fromJSON(this,a)},d.prototype.point=function(a,b,c,d){return new Point(this,a,b,c,d)},Point.fromJSON=function(a,b){return new Point(a,b[0],b[1],b[2])},Point.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Point.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},Point.prototype._extDbl=function(){var a=this.x.redSqr(),b=this.y.redSqr(),c=this.z.redSqr();c=c.redIAdd(c);var d=this.curve._mulA(a),e=this.x.redAdd(this.y).redSqr().redISub(a).redISub(b),f=d.redAdd(b),g=f.redSub(c),h=d.redSub(b),i=e.redMul(g),j=f.redMul(h),k=e.redMul(h),l=g.redMul(f);return this.curve.point(i,j,l,k)},Point.prototype._projDbl=function(){var a,b,c,d=this.x.redAdd(this.y).redSqr(),e=this.x.redSqr(),f=this.y.redSqr();if(this.curve.twisted){var g=this.curve._mulA(e),h=g.redAdd(f);if(this.zOne)a=d.redSub(e).redSub(f).redMul(h.redSub(this.curve.two)),b=h.redMul(g.redSub(f)),c=h.redSqr().redSub(h).redSub(h);else{var i=this.z.redSqr(),j=h.redSub(i).redISub(i);a=d.redSub(e).redISub(f).redMul(j),b=h.redMul(g.redSub(f)),c=h.redMul(j)}}else{var g=e.redAdd(f),i=this.curve._mulC(this.c.redMul(this.z)).redSqr(),j=g.redSub(i).redSub(i);a=this.curve._mulC(d.redISub(g)).redMul(j),b=this.curve._mulC(g).redMul(e.redISub(f)),c=g.redMul(j)}return this.curve.point(a,b,c)},Point.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},Point.prototype._extAdd=function(a){var b=this.y.redSub(this.x).redMul(a.y.redSub(a.x)),c=this.y.redAdd(this.x).redMul(a.y.redAdd(a.x)),d=this.t.redMul(this.curve.dd).redMul(a.t),e=this.z.redMul(a.z.redAdd(a.z)),f=c.redSub(b),g=e.redSub(d),h=e.redAdd(d),i=c.redAdd(b),j=f.redMul(g),k=h.redMul(i),l=f.redMul(i),m=g.redMul(h);return this.curve.point(j,k,m,l)},Point.prototype._projAdd=function(a){var b,c,d=this.z.redMul(a.z),e=d.redSqr(),f=this.x.redMul(a.x),g=this.y.redMul(a.y),h=this.curve.d.redMul(f).redMul(g),i=e.redSub(h),j=e.redAdd(h),k=this.x.redAdd(this.y).redMul(a.x.redAdd(a.y)).redISub(f).redISub(g),l=d.redMul(i).redMul(k);return this.curve.twisted?(b=d.redMul(j).redMul(g.redSub(this.curve._mulA(f))),c=i.redMul(j)):(b=d.redMul(j).redMul(g.redSub(f)),
11
c=this.curve._mulC(i).redMul(j)),this.curve.point(l,b,c)},Point.prototype.add=function(a){return this.isInfinity()?a:a.isInfinity()?this:this.curve.extended?this._extAdd(a):this._projAdd(a)},Point.prototype.mul=function(a){return this._hasDoubles(a)?this.curve._fixedNafMul(this,a):this.curve._wnafMul(this,a)},Point.prototype.mulAdd=function(a,b,c){return this.curve._wnafMulAdd(1,[this,b],[a,c],2,!1)},Point.prototype.jmulAdd=function(a,b,c){return this.curve._wnafMulAdd(1,[this,b],[a,c],2,!0)},Point.prototype.normalize=function(){if(this.zOne)return this;var a=this.z.redInvm();return this.x=this.x.redMul(a),this.y=this.y.redMul(a),this.t&&(this.t=this.t.redMul(a)),this.z=this.curve.one,this.zOne=!0,this},Point.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()},Point.prototype.getY=function(){return this.normalize(),this.y.fromRed()},Point.prototype.eq=function(a){return this===a||0===this.getX().cmp(a.getX())&&0===this.getY().cmp(a.getY())},Point.prototype.eqXToP=function(a){var b=a.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(b))return!0;for(var c=a.clone(),d=this.curve.redN.redMul(this.z);;){if(c.iadd(this.curve.n),c.cmp(this.curve.p)>=0)return!1;if(b.redIAdd(d),0===this.x.cmp(b))return!0}return!1},Point.prototype.toP=Point.prototype.normalize,Point.prototype.mixedAdd=Point.prototype.add},{"../../elliptic":112,"../curve":115,"bn.js":111,inherits:246}],115:[function(a,b,c){"use strict";var d=c;d.base=a("./base"),d.short=a("./short"),d.mont=a("./mont"),d.edwards=a("./edwards")},{"./base":113,"./edwards":114,"./mont":116,"./short":117}],116:[function(a,b,c){"use strict";function d(a){h.call(this,"mont",a),this.a=new f(a.a,16).toRed(this.red),this.b=new f(a.b,16).toRed(this.red),this.i4=new f(4).toRed(this.red).redInvm(),this.two=new f(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function Point(a,b,c){h.BasePoint.call(this,a,"projective"),null===b&&null===c?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new f(b,16),this.z=new f(c,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}var e=a("../curve"),f=a("bn.js"),g=a("inherits"),h=e.base,i=a("../../elliptic"),j=i.utils;g(d,h),b.exports=d,d.prototype.validate=function(a){var b=a.normalize().x,c=b.redSqr(),d=c.redMul(b).redAdd(c.redMul(this.a)).redAdd(b),e=d.redSqrt();return 0===e.redSqr().cmp(d)},g(Point,h.BasePoint),d.prototype.decodePoint=function(a,b){return this.point(j.toArray(a,b),1)},d.prototype.point=function(a,b){return new Point(this,a,b)},d.prototype.pointFromJSON=function(a){return Point.fromJSON(this,a)},Point.prototype.precompute=function(){},Point.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},Point.fromJSON=function(a,b){return new Point(a,b[0],b[1]||a.one)},Point.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Point.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Point.prototype.dbl=function(){var a=this.x.redAdd(this.z),b=a.redSqr(),c=this.x.redSub(this.z),d=c.redSqr(),e=b.redSub(d),f=b.redMul(d),g=e.redMul(d.redAdd(this.curve.a24.redMul(e)));return this.curve.point(f,g)},Point.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.diffAdd=function(a,b){var c=this.x.redAdd(this.z),d=this.x.redSub(this.z),e=a.x.redAdd(a.z),f=a.x.redSub(a.z),g=f.redMul(c),h=e.redMul(d),i=b.z.redMul(g.redAdd(h).redSqr()),j=b.x.redMul(g.redISub(h).redSqr());return this.curve.point(i,j)},Point.prototype.mul=function(a){for(var b=a.clone(),c=this,d=this.curve.point(null,null),e=this,f=[];0!==b.cmpn(0);b.iushrn(1))f.push(b.andln(1));for(var g=f.length-1;g>=0;g--)0===f[g]?(c=c.diffAdd(d,e),d=d.dbl()):(d=c.diffAdd(d,e),c=c.dbl());return d},Point.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.eq=function(a){return 0===this.getX().cmp(a.getX())},Point.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":112,"../curve":115,"bn.js":111,inherits:246}],117:[function(a,b,c){"use strict";function d(a){j.call(this,"short",a),this.a=new h(a.a,16).toRed(this.red),this.b=new h(a.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(a),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function Point(a,b,c,d){j.BasePoint.call(this,a,"affine"),null===b&&null===c?(this.x=null,this.y=null,this.inf=!0):(this.x=new h(b,16),this.y=new h(c,16),d&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function e(a,b,c,d){j.BasePoint.call(this,a,"jacobian"),null===b&&null===c&&null===d?(this.x=this.curve.one,this.y=this.curve.one,this.z=new h(0)):(this.x=new h(b,16),this.y=new h(c,16),this.z=new h(d,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}var f=a("../curve"),g=a("../../elliptic"),h=a("bn.js"),i=a("inherits"),j=f.base,k=g.utils.assert;i(d,j),b.exports=d,d.prototype._getEndomorphism=function(a){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var b,c;if(a.beta)b=new h(a.beta,16).toRed(this.red);else{var d=this._getEndoRoots(this.p);b=d[0].cmp(d[1])<0?d[0]:d[1],b=b.toRed(this.red)}if(a.lambda)c=new h(a.lambda,16);else{var e=this._getEndoRoots(this.n);0===this.g.mul(e[0]).x.cmp(this.g.x.redMul(b))?c=e[0]:(c=e[1],k(0===this.g.mul(c).x.cmp(this.g.x.redMul(b))))}var f;return f=a.basis?a.basis.map(function(a){return{a:new h(a.a,16),b:new h(a.b,16)}}):this._getEndoBasis(c),{beta:b,lambda:c,basis:f}}},d.prototype._getEndoRoots=function(a){var b=a===this.p?this.red:h.mont(a),c=new h(2).toRed(b).redInvm(),d=c.redNeg(),e=new h(3).toRed(b).redNeg().redSqrt().redMul(c),f=d.redAdd(e).fromRed(),g=d.redSub(e).fromRed();return[f,g]},d.prototype._getEndoBasis=function(a){for(var b,c,d,e,f,g,i,j,k,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),m=a,n=this.n.clone(),o=new h(1),p=new h(0),q=new h(0),r=new h(1),s=0;0!==m.cmpn(0);){var t=n.div(m);j=n.sub(t.mul(m)),k=q.sub(t.mul(o));var u=r.sub(t.mul(p));if(!d&&j.cmp(l)<0)b=i.neg(),c=o,d=j.neg(),e=k;else if(d&&2===++s)break;i=j,n=m,m=j,q=o,o=k,r=p,p=u}f=j.neg(),g=k;var v=d.sqr().add(e.sqr()),w=f.sqr().add(g.sqr());return w.cmp(v)>=0&&(f=b,g=c),d.negative&&(d=d.neg(),e=e.neg()),f.negative&&(f=f.neg(),g=g.neg()),[{a:d,b:e},{a:f,b:g}]},d.prototype._endoSplit=function(a){var b=this.endo.basis,c=b[0],d=b[1],e=d.b.mul(a).divRound(this.n),f=c.b.neg().mul(a).divRound(this.n),g=e.mul(c.a),h=f.mul(d.a),i=e.mul(c.b),j=f.mul(d.b),k=a.sub(g).sub(h),l=i.add(j).neg();return{k1:k,k2:l}},d.prototype.pointFromX=function(a,b){a=new h(a,16),a.red||(a=a.toRed(this.red));var c=a.redSqr().redMul(a).redIAdd(a.redMul(this.a)).redIAdd(this.b),d=c.redSqrt();if(0!==d.redSqr().redSub(c).cmp(this.zero))throw new Error("invalid point");var e=d.fromRed().isOdd();return(b&&!e||!b&&e)&&(d=d.redNeg()),this.point(a,d)},d.prototype.validate=function(a){if(a.inf)return!0;var b=a.x,c=a.y,d=this.a.redMul(b),e=b.redSqr().redMul(b).redIAdd(d).redIAdd(this.b);return 0===c.redSqr().redISub(e).cmpn(0)},d.prototype._endoWnafMulAdd=function(a,b,c){for(var d=this._endoWnafT1,e=this._endoWnafT2,f=0;f<a.length;f++){var g=this._endoSplit(b[f]),h=a[f],i=h._getBeta();g.k1.negative&&(g.k1.ineg(),h=h.neg(!0)),g.k2.negative&&(g.k2.ineg(),i=i.neg(!0)),d[2*f]=h,d[2*f+1]=i,e[2*f]=g.k1,e[2*f+1]=g.k2}for(var j=this._wnafMulAdd(1,d,e,2*f,c),k=0;k<2*f;k++)d[k]=null,e[k]=null;return j},i(Point,j.BasePoint),d.prototype.point=function(a,b,c){return new Point(this,a,b,c)},d.prototype.pointFromJSON=function(a,b){return Point.fromJSON(this,a,b)},Point.prototype._getBeta=function(){if(this.curve.endo){var a=this.precomputed;if(a&&a.beta)return a.beta;var b=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(a){var c=this.curve,d=function(a){return c.point(a.x.redMul(c.endo.beta),a.y)};a.beta=b,b.precomputed={beta:null,naf:a.naf&&{wnd:a.naf.wnd,points:a.naf.points.map(d)},doubles:a.doubles&&{step:a.doubles.step,points:a.doubles.points.map(d)}}}return b}},Point.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},Point.fromJSON=function(a,b,c){function d(b){return a.point(b[0],b[1],c)}"string"==typeof b&&(b=JSON.parse(b));var e=a.point(b[0],b[1],c);if(!b[2])return e;var f=b[2];return e.precomputed={beta:null,doubles:f.doubles&&{step:f.doubles.step,points:[e].concat(f.doubles.points.map(d))},naf:f.naf&&{wnd:f.naf.wnd,points:[e].concat(f.naf.points.map(d))}},e},Point.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},Point.prototype.isInfinity=function(){return this.inf},Point.prototype.add=function(a){if(this.inf)return a;if(a.inf)return this;if(this.eq(a))return this.dbl();if(this.neg().eq(a))return this.curve.point(null,null);if(0===this.x.cmp(a.x))return this.curve.point(null,null);var b=this.y.redSub(a.y);0!==b.cmpn(0)&&(b=b.redMul(this.x.redSub(a.x).redInvm()));var c=b.redSqr().redISub(this.x).redISub(a.x),d=b.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,d)},Point.prototype.dbl=function(){if(this.inf)return this;var a=this.y.redAdd(this.y);if(0===a.cmpn(0))return this.curve.point(null,null);var b=this.curve.a,c=this.x.redSqr(),d=a.redInvm(),e=c.redAdd(c).redIAdd(c).redIAdd(b).redMul(d),f=e.redSqr().redISub(this.x.redAdd(this.x)),g=e.redMul(this.x.redSub(f)).redISub(this.y);return this.curve.point(f,g)},Point.prototype.getX=function(){return this.x.fromRed()},Point.prototype.getY=function(){return this.y.fromRed()},Point.prototype.mul=function(a){return a=new h(a,16),this._hasDoubles(a)?this.curve._fixedNafMul(this,a):this.curve.endo?this.curve._endoWnafMulAdd([this],[a]):this.curve._wnafMul(this,a)},Point.prototype.mulAdd=function(a,b,c){var d=[this,b],e=[a,c];return this.curve.endo?this.curve._endoWnafMulAdd(d,e):this.curve._wnafMulAdd(1,d,e,2)},Point.prototype.jmulAdd=function(a,b,c){var d=[this,b],e=[a,c];return this.curve.endo?this.curve._endoWnafMulAdd(d,e,!0):this.curve._wnafMulAdd(1,d,e,2,!0)},Point.prototype.eq=function(a){return this===a||this.inf===a.inf&&(this.inf||0===this.x.cmp(a.x)&&0===this.y.cmp(a.y))},Point.prototype.neg=function(a){if(this.inf)return this;var b=this.curve.point(this.x,this.y.redNeg());if(a&&this.precomputed){var c=this.precomputed,d=function(a){return a.neg()};b.precomputed={naf:c.naf&&{wnd:c.naf.wnd,points:c.naf.points.map(d)},doubles:c.doubles&&{step:c.doubles.step,points:c.doubles.points.map(d)}}}return b},Point.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var a=this.curve.jpoint(this.x,this.y,this.curve.one);return a},i(e,j.BasePoint),d.prototype.jpoint=function(a,b,c){return new e(this,a,b,c)},e.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var a=this.z.redInvm(),b=a.redSqr(),c=this.x.redMul(b),d=this.y.redMul(b).redMul(a);return this.curve.point(c,d)},e.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},e.prototype.add=function(a){if(this.isInfinity())return a;if(a.isInfinity())return this;var b=a.z.redSqr(),c=this.z.redSqr(),d=this.x.redMul(b),e=a.x.redMul(c),f=this.y.redMul(b.redMul(a.z)),g=a.y.redMul(c.redMul(this.z)),h=d.redSub(e),i=f.redSub(g);if(0===h.cmpn(0))return 0!==i.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var j=h.redSqr(),k=j.redMul(h),l=d.redMul(j),m=i.redSqr().redIAdd(k).redISub(l).redISub(l),n=i.redMul(l.redISub(m)).redISub(f.redMul(k)),o=this.z.redMul(a.z).redMul(h);return this.curve.jpoint(m,n,o)},e.prototype.mixedAdd=function(a){if(this.isInfinity())return a.toJ();if(a.isInfinity())return this;var b=this.z.redSqr(),c=this.x,d=a.x.redMul(b),e=this.y,f=a.y.redMul(b).redMul(this.z),g=c.redSub(d),h=e.redSub(f);if(0===g.cmpn(0))return 0!==h.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var i=g.redSqr(),j=i.redMul(g),k=c.redMul(i),l=h.redSqr().redIAdd(j).redISub(k).redISub(k),m=h.redMul(k.redISub(l)).redISub(e.redMul(j)),n=this.z.redMul(g);return this.curve.jpoint(l,m,n)},e.prototype.dblp=function(a){if(0===a)return this;if(this.isInfinity())return this;if(!a)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var b=this,c=0;c<a;c++)b=b.dbl();return b}for(var d=this.curve.a,e=this.curve.tinv,f=this.x,g=this.y,h=this.z,i=h.redSqr().redSqr(),j=g.redAdd(g),c=0;c<a;c++){var k=f.redSqr(),l=j.redSqr(),m=l.redSqr(),n=k.redAdd(k).redIAdd(k).redIAdd(d.redMul(i)),o=f.redMul(l),p=n.redSqr().redISub(o.redAdd(o)),q=o.redISub(p),r=n.redMul(q);r=r.redIAdd(r).redISub(m);var s=j.redMul(h);c+1<a&&(i=i.redMul(m)),f=p,h=s,j=r}return this.curve.jpoint(f,j.redMul(e),h)},e.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},e.prototype._zeroDbl=function(){var a,b,c;if(this.zOne){var d=this.x.redSqr(),e=this.y.redSqr(),f=e.redSqr(),g=this.x.redAdd(e).redSqr().redISub(d).redISub(f);g=g.redIAdd(g);var h=d.redAdd(d).redIAdd(d),i=h.redSqr().redISub(g).redISub(g),j=f.redIAdd(f);j=j.redIAdd(j),j=j.redIAdd(j),a=i,b=h.redMul(g.redISub(i)).redISub(j),c=this.y.redAdd(this.y)}else{var k=this.x.redSqr(),l=this.y.redSqr(),m=l.redSqr(),n=this.x.redAdd(l).redSqr().redISub(k).redISub(m);n=n.redIAdd(n);var o=k.redAdd(k).redIAdd(k),p=o.redSqr(),q=m.redIAdd(m);q=q.redIAdd(q),q=q.redIAdd(q),a=p.redISub(n).redISub(n),b=o.redMul(n.redISub(a)).redISub(q),c=this.y.redMul(this.z),c=c.redIAdd(c)}return this.curve.jpoint(a,b,c)},e.prototype._threeDbl=function(){var a,b,c;if(this.zOne){var d=this.x.redSqr(),e=this.y.redSqr(),f=e.redSqr(),g=this.x.redAdd(e).redSqr().redISub(d).redISub(f);g=g.redIAdd(g);var h=d.redAdd(d).redIAdd(d).redIAdd(this.curve.a),i=h.redSqr().redISub(g).redISub(g);a=i;var j=f.redIAdd(f);j=j.redIAdd(j),j=j.redIAdd(j),b=h.redMul(g.redISub(i)).redISub(j),c=this.y.redAdd(this.y)}else{var k=this.z.redSqr(),l=this.y.redSqr(),m=this.x.redMul(l),n=this.x.redSub(k).redMul(this.x.redAdd(k));n=n.redAdd(n).redIAdd(n);var o=m.redIAdd(m);o=o.redIAdd(o);var p=o.redAdd(o);a=n.redSqr().redISub(p),c=this.y.redAdd(this.z).redSqr().redISub(l).redISub(k);var q=l.redSqr();q=q.redIAdd(q),q=q.redIAdd(q),q=q.redIAdd(q),b=n.redMul(o.redISub(a)).redISub(q)}return this.curve.jpoint(a,b,c)},e.prototype._dbl=function(){var a=this.curve.a,b=this.x,c=this.y,d=this.z,e=d.redSqr().redSqr(),f=b.redSqr(),g=c.redSqr(),h=f.redAdd(f).redIAdd(f).redIAdd(a.redMul(e)),i=b.redAdd(b);i=i.redIAdd(i);var j=i.redMul(g),k=h.redSqr().redISub(j.redAdd(j)),l=j.redISub(k),m=g.redSqr();m=m.redIAdd(m),m=m.redIAdd(m),m=m.redIAdd(m);var n=h.redMul(l).redISub(m),o=c.redAdd(c).redMul(d);return this.curve.jpoint(k,n,o)},e.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var a=this.x.redSqr(),b=this.y.redSqr(),c=this.z.redSqr(),d=b.redSqr(),e=a.redAdd(a).redIAdd(a),f=e.redSqr(),g=this.x.redAdd(b).redSqr().redISub(a).redISub(d);g=g.redIAdd(g),g=g.redAdd(g).redIAdd(g),g=g.redISub(f);var h=g.redSqr(),i=d.redIAdd(d);i=i.redIAdd(i),i=i.redIAdd(i),i=i.redIAdd(i);var j=e.redIAdd(g).redSqr().redISub(f).redISub(h).redISub(i),k=b.redMul(j);k=k.redIAdd(k),k=k.redIAdd(k);var l=this.x.redMul(h).redISub(k);l=l.redIAdd(l),l=l.redIAdd(l);var m=this.y.redMul(j.redMul(i.redISub(j)).redISub(g.redMul(h)));m=m.redIAdd(m),m=m.redIAdd(m),m=m.redIAdd(m);var n=this.z.redAdd(g).redSqr().redISub(c).redISub(h);return this.curve.jpoint(l,m,n)},e.prototype.mul=function(a,b){return a=new h(a,b),this.curve._wnafMul(this,a)},e.prototype.eq=function(a){if("affine"===a.type)return this.eq(a.toJ());if(this===a)return!0;var b=this.z.redSqr(),c=a.z.redSqr();if(0!==this.x.redMul(c).redISub(a.x.redMul(b)).cmpn(0))return!1;var d=b.redMul(this.z),e=c.redMul(a.z);return 0===this.y.redMul(e).redISub(a.y.redMul(d)).cmpn(0)},e.prototype.eqXToP=function(a){var b=this.z.redSqr(),c=a.toRed(this.curve.red).redMul(b);if(0===this.x.cmp(c))return!0;for(var d=a.clone(),e=this.curve.redN.redMul(b);;){if(d.iadd(this.curve.n),d.cmp(this.curve.p)>=0)return!1;if(c.redIAdd(e),0===this.x.cmp(c))return!0}return!1},e.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},e.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":112,"../curve":115,"bn.js":111,inherits:246}],118:[function(a,b,c){"use strict";function d(a){"short"===a.type?this.curve=new h.curve.short(a):"edwards"===a.type?this.curve=new h.curve.edwards(a):this.curve=new h.curve.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function e(a,b){Object.defineProperty(f,a,{configurable:!0,enumerable:!0,get:function(){var c=new d(b);return Object.defineProperty(f,a,{configurable:!0,enumerable:!0,value:c}),c}})}var f=c,g=a("hash.js"),h=a("../elliptic"),i=h.utils.assert;f.PresetCurve=d,e("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:g.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),e("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:g.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),e("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:g.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),e("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:g.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"]}),e("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:g.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"]}),e("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:g.sha256,gRed:!1,g:["9"]}),e("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:g.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var j;try{j=a("./precomputed/secp256k1")}catch(a){j=void 0}e("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:g.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",j]})},{"../elliptic":112,"./precomputed/secp256k1":125,"hash.js":231}],119:[function(a,b,c){"use strict";function d(a){return this instanceof d?("string"==typeof a&&(i(g.curves.hasOwnProperty(a),"Unknown curve "+a),a=g.curves[a]),a instanceof g.curves.PresetCurve&&(a={curve:a}),this.curve=a.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=a.curve.g,this.g.precompute(a.curve.n.bitLength()+1),void(this.hash=a.hash||a.curve.hash)):new d(a)}var e=a("bn.js"),f=a("hmac-drbg"),g=a("../../elliptic"),h=g.utils,i=h.assert,j=a("./key"),k=a("./signature");b.exports=d,d.prototype.keyPair=function(a){return new j(this,a)},d.prototype.keyFromPrivate=function(a,b){return j.fromPrivate(this,a,b)},d.prototype.keyFromPublic=function(a,b){return j.fromPublic(this,a,b)},d.prototype.genKeyPair=function(a){a||(a={});for(var b=new f({hash:this.hash,pers:a.pers,persEnc:a.persEnc||"utf8",entropy:a.entropy||g.rand(this.hash.hmacStrength),entropyEnc:a.entropy&&a.entropyEnc||"utf8",nonce:this.n.toArray()}),c=this.n.byteLength(),d=this.n.sub(new e(2));;){var h=new e(b.generate(c));if(!(h.cmp(d)>0))return h.iaddn(1),this.keyFromPrivate(h)}},d.prototype._truncateToN=function(a,b){var c=8*a.byteLength()-this.n.bitLength();return c>0&&(a=a.ushrn(c)),!b&&a.cmp(this.n)>=0?a.sub(this.n):a},d.prototype.sign=function(a,b,c,d){"object"==typeof c&&(d=c,c=null),d||(d={}),b=this.keyFromPrivate(b,c),a=this._truncateToN(new e(a,16));for(var g=this.n.byteLength(),h=b.getPrivate().toArray("be",g),i=a.toArray("be",g),j=new f({hash:this.hash,entropy:h,nonce:i,pers:d.pers,persEnc:d.persEnc||"utf8"}),l=this.n.sub(new e(1)),m=0;!0;m++){var n=d.k?d.k(m):new e(j.generate(this.n.byteLength()));if(n=this._truncateToN(n,!0),!(n.cmpn(1)<=0||n.cmp(l)>=0)){var o=this.g.mul(n);if(!o.isInfinity()){var p=o.getX(),q=p.umod(this.n);if(0!==q.cmpn(0)){var r=n.invm(this.n).mul(q.mul(b.getPrivate()).iadd(a));if(r=r.umod(this.n),0!==r.cmpn(0)){var s=(o.getY().isOdd()?1:0)|(0!==p.cmp(q)?2:0);return d.canonical&&r.cmp(this.nh)>0&&(r=this.n.sub(r),s^=1),new k({r:q,s:r,recoveryParam:s})}}}}}},d.prototype.verify=function(a,b,c,d){a=this._truncateToN(new e(a,16)),c=this.keyFromPublic(c,d),b=new k(b,"hex");var f=b.r,g=b.s;if(f.cmpn(1)<0||f.cmp(this.n)>=0)return!1;if(g.cmpn(1)<0||g.cmp(this.n)>=0)return!1;var h=g.invm(this.n),i=h.mul(a).umod(this.n),j=h.mul(f).umod(this.n);if(!this.curve._maxwellTrick){var l=this.g.mulAdd(i,c.getPublic(),j);return!l.isInfinity()&&0===l.getX().umod(this.n).cmp(f)}var l=this.g.jmulAdd(i,c.getPublic(),j);return!l.isInfinity()&&l.eqXToP(f)},d.prototype.recoverPubKey=function(a,b,c,d){i((3&c)===c,"The recovery param is more than two bits"),b=new k(b,d);var f=this.n,g=new e(a),h=b.r,j=b.s,l=1&c,m=c>>1;if(h.cmp(this.curve.p.umod(this.curve.n))>=0&&m)throw new Error("Unable to find sencond key candinate");h=m?this.curve.pointFromX(h.add(this.curve.n),l):this.curve.pointFromX(h,l);var n=b.r.invm(f),o=f.sub(g).mul(n).umod(f),p=j.mul(n).umod(f);return this.g.mulAdd(o,h,p)},d.prototype.getKeyRecoveryParam=function(a,b,c,d){if(b=new k(b,d),null!==b.recoveryParam)return b.recoveryParam;for(var e=0;e<4;e++){var f;try{f=this.recoverPubKey(a,b,e)}catch(a){continue}if(f.eq(c))return e}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":112,"./key":120,"./signature":121,"bn.js":111,"hmac-drbg":243}],120:[function(a,b,c){"use strict";function d(a,b){this.ec=a,this.priv=null,this.pub=null,b.priv&&this._importPrivate(b.priv,b.privEnc),b.pub&&this._importPublic(b.pub,b.pubEnc)}var e=a("bn.js"),f=a("../../elliptic"),g=f.utils,h=g.assert;b.exports=d,d.fromPublic=function(a,b,c){return b instanceof d?b:new d(a,{pub:b,pubEnc:c})},d.fromPrivate=function(a,b,c){return b instanceof d?b:new d(a,{priv:b,privEnc:c})},d.prototype.validate=function(){var a=this.getPublic();return a.isInfinity()?{result:!1,reason:"Invalid public key"}:a.validate()?a.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},d.prototype.getPublic=function(a,b){return"string"==typeof a&&(b=a,a=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),b?this.pub.encode(b,a):this.pub},d.prototype.getPrivate=function(a){return"hex"===a?this.priv.toString(16,2):this.priv},d.prototype._importPrivate=function(a,b){this.priv=new e(a,b||16),this.priv=this.priv.umod(this.ec.curve.n)},d.prototype._importPublic=function(a,b){return a.x||a.y?("mont"===this.ec.curve.type?h(a.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||h(a.x&&a.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(a.x,a.y))):void(this.pub=this.ec.curve.decodePoint(a,b))},d.prototype.derive=function(a){return a.mul(this.priv).getX()},d.prototype.sign=function(a,b,c){return this.ec.sign(a,this,b,c)},d.prototype.verify=function(a,b){return this.ec.verify(a,b,this)},d.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},{"../../elliptic":112,"bn.js":111}],121:[function(a,b,c){"use strict";function d(a,b){return a instanceof d?a:void(this._importDER(a,b)||(l(a.r&&a.s,"Signature without r or s"),this.r=new i(a.r,16),this.s=new i(a.s,16),void 0===a.recoveryParam?this.recoveryParam=null:this.recoveryParam=a.recoveryParam))}function e(){this.place=0}function f(a,b){var c=a[b.place++];if(!(128&c))return c;for(var d=15&c,e=0,f=0,g=b.place;f<d;f++,g++)e<<=8,e|=a[g];return b.place=g,e}function g(a){for(var b=0,c=a.length-1;!a[b]&&!(128&a[b+1])&&b<c;)b++;return 0===b?a:a.slice(b)}function h(a,b){if(b<128)return void a.push(b);var c=1+(Math.log(b)/Math.LN2>>>3);for(a.push(128|c);--c;)a.push(b>>>(c<<3)&255);a.push(b)}var i=a("bn.js"),j=a("../../elliptic"),k=j.utils,l=k.assert;b.exports=d,d.prototype._importDER=function(a,b){a=k.toArray(a,b);var c=new e;if(48!==a[c.place++])return!1;var d=f(a,c);if(d+c.place!==a.length)return!1;if(2!==a[c.place++])return!1;var g=f(a,c),h=a.slice(c.place,g+c.place);if(c.place+=g,2!==a[c.place++])return!1;var j=f(a,c);if(a.length!==j+c.place)return!1;var l=a.slice(c.place,j+c.place);return 0===h[0]&&128&h[1]&&(h=h.slice(1)),0===l[0]&&128&l[1]&&(l=l.slice(1)),this.r=new i(h),this.s=new i(l),this.recoveryParam=null,!0},d.prototype.toDER=function(a){var b=this.r.toArray(),c=this.s.toArray();for(128&b[0]&&(b=[0].concat(b)),128&c[0]&&(c=[0].concat(c)),b=g(b),c=g(c);!(c[0]||128&c[1]);)c=c.slice(1);var d=[2];h(d,b.length),d=d.concat(b),d.push(2),h(d,c.length);var e=d.concat(c),f=[48];return h(f,e.length),f=f.concat(e),k.encode(f,a)}},{"../../elliptic":112,"bn.js":111}],122:[function(a,b,c){"use strict";function d(a){if(h("ed25519"===a,"only tested with ed25519 so far"),!(this instanceof d))return new d(a);var a=f.curves[a].curve;this.curve=a,this.g=a.g,this.g.precompute(a.n.bitLength()+1),this.pointClass=a.point().constructor,this.encodingLength=Math.ceil(a.n.bitLength()/8),this.hash=e.sha512}var e=a("hash.js"),f=a("../../elliptic"),g=f.utils,h=g.assert,i=g.parseBytes,j=a("./key"),k=a("./signature");b.exports=d,d.prototype.sign=function(a,b){a=i(a);var c=this.keyFromSecret(b),d=this.hashInt(c.messagePrefix(),a),e=this.g.mul(d),f=this.encodePoint(e),g=this.hashInt(f,c.pubBytes(),a).mul(c.priv()),h=d.add(g).umod(this.curve.n);return this.makeSignature({R:e,S:h,Rencoded:f})},d.prototype.verify=function(a,b,c){a=i(a),b=this.makeSignature(b);var d=this.keyFromPublic(c),e=this.hashInt(b.Rencoded(),d.pubBytes(),a),f=this.g.mul(b.S()),g=b.R().add(d.pub().mul(e));return g.eq(f)},d.prototype.hashInt=function(){for(var a=this.hash(),b=0;b<arguments.length;b++)a.update(arguments[b]);return g.intFromLE(a.digest()).umod(this.curve.n)},d.prototype.keyFromPublic=function(a){return j.fromPublic(this,a)},d.prototype.keyFromSecret=function(a){return j.fromSecret(this,a)},d.prototype.makeSignature=function(a){return a instanceof k?a:new k(this,a)},d.prototype.encodePoint=function(a){var b=a.getY().toArray("le",this.encodingLength);return b[this.encodingLength-1]|=a.getX().isOdd()?128:0,b},d.prototype.decodePoint=function(a){a=g.parseBytes(a);var b=a.length-1,c=a.slice(0,b).concat(a[b]&-129),d=0!==(128&a[b]),e=g.intFromLE(c);return this.curve.pointFromY(e,d)},d.prototype.encodeInt=function(a){return a.toArray("le",this.encodingLength)},d.prototype.decodeInt=function(a){return g.intFromLE(a)},d.prototype.isPoint=function(a){return a instanceof this.pointClass}},{"../../elliptic":112,"./key":123,"./signature":124,"hash.js":231}],123:[function(a,b,c){"use strict";function d(a,b){this.eddsa=a,this._secret=h(b.secret),a.isPoint(b.pub)?this._pub=b.pub:this._pubBytes=h(b.pub)}var e=a("../../elliptic"),f=e.utils,g=f.assert,h=f.parseBytes,i=f.cachedProperty;d.fromPublic=function(a,b){return b instanceof d?b:new d(a,{pub:b})},d.fromSecret=function(a,b){return b instanceof d?b:new d(a,{secret:b})},d.prototype.secret=function(){return this._secret},i(d,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),i(d,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),i(d,"privBytes",function(){var a=this.eddsa,b=this.hash(),c=a.encodingLength-1,d=b.slice(0,a.encodingLength);return d[0]&=248,d[c]&=127,d[c]|=64,d}),i(d,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),i(d,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),i(d,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),d.prototype.sign=function(a){return g(this._secret,"KeyPair can only verify"),this.eddsa.sign(a,this)},d.prototype.verify=function(a,b){
@@ 8-8 (lines=1) @@
5
}function h(a){a.b=i(a).concat(i(a)),a.F=new m.cipher.aes(a.b)}function i(a){for(var b=0;4>b&&(a.i[b]=a.i[b]+1|0,!a.i[b]);b++);return a.F.encrypt(a.i)}function j(a,b){return function(){b.apply(a,arguments)}}var k=void 0,l=!1,m={cipher:{},hash:{},keyexchange:{},mode:{},misc:{},codec:{},exception:{corrupt:function(a){this.toString=function(){return"CORRUPT: "+this.message},this.message=a},invalid:function(a){this.toString=function(){return"INVALID: "+this.message},this.message=a},bug:function(a){this.toString=function(){return"BUG: "+this.message},this.message=a},notReady:function(a){this.toString=function(){return"NOT READY: "+this.message},this.message=a}}};"undefined"!=typeof b&&b.exports&&(b.exports=m),"function"==typeof define&&define([],function(){return m}),m.cipher.aes=function(a){this.o[0][0][0]||this.t();var b,c,e,f,g=this.o[0][4],h=this.o[1];b=a.length;var i=1;for(4!==b&&6!==b&&8!==b&&d(new m.exception.invalid("invalid aes key size")),this.b=[e=a.slice(0),f=[]],a=b;a<4*b+28;a++)c=e[a-1],(0===a%b||8===b&&4===a%b)&&(c=g[c>>>24]<<24^g[c>>16&255]<<16^g[c>>8&255]<<8^g[255&c],0===a%b&&(c=c<<8^c>>>24^i<<24,i=i<<1^283*(i>>7))),e[a]=e[a-b]^c;for(b=0;a;b++,a--)c=e[3&b?a:a-4],f[b]=4>=a||4>b?c:h[0][g[c>>>24]]^h[1][g[c>>16&255]]^h[2][g[c>>8&255]]^h[3][g[255&c]]},m.cipher.aes.prototype={encrypt:function(a){return e(this,a,0)},decrypt:function(a){return e(this,a,1)},o:[[[],[],[],[],[]],[[],[],[],[],[]]],t:function(){var a,b,c,d,e,f,g,h=this.o[0],i=this.o[1],j=h[4],k=i[4],l=[],m=[];for(a=0;256>a;a++)m[(l[a]=a<<1^283*(a>>7))^a]=a;for(b=c=0;!j[b];b^=d||1,c=m[c]||1)for(f=c^c<<1^c<<2^c<<3^c<<4,f=f>>8^255&f^99,j[b]=f,k[f]=b,e=l[a=l[d=l[b]]],g=16843009*e^65537*a^257*d^16843008*b,e=257*l[f]^16843008*f,a=0;4>a;a++)h[a][b]=e=e<<24^e>>>8,i[a][f]=g=g<<24^g>>>8;for(a=0;5>a;a++)h[a]=h[a].slice(0),i[a]=i[a].slice(0)}},m.bitArray={bitSlice:function(a,b,c){return a=m.bitArray.R(a.slice(b/32),32-(31&b)).slice(1),c===k?a:m.bitArray.clamp(a,c-b)},extract:function(a,b,c){var d=Math.floor(-b-c&31);return((b+c-1^b)&-32?a[b/32|0]<<32-d^a[b/32+1|0]>>>d:a[b/32|0]>>>d)&(1<<c)-1},concat:function(a,b){if(0===a.length||0===b.length)return a.concat(b);var c=a[a.length-1],d=m.bitArray.getPartial(c);return 32===d?a.concat(b):m.bitArray.R(b,d,0|c,a.slice(0,a.length-1))},bitLength:function(a){var b=a.length;return 0===b?0:32*(b-1)+m.bitArray.getPartial(a[b-1])},clamp:function(a,b){if(32*a.length<b)return a;a=a.slice(0,Math.ceil(b/32));var c=a.length;return b&=31,0<c&&b&&(a[c-1]=m.bitArray.partial(b,a[c-1]&2147483648>>b-1,1)),a},partial:function(a,b,c){return 32===a?b:(c?0|b:b<<32-a)+1099511627776*a},getPartial:function(a){return Math.round(a/1099511627776)||32},equal:function(a,b){if(m.bitArray.bitLength(a)!==m.bitArray.bitLength(b))return l;var c,d=0;for(c=0;c<a.length;c++)d|=a[c]^b[c];return 0===d},R:function(a,b,c,d){var e;for(e=0,d===k&&(d=[]);32<=b;b-=32)d.push(c),c=0;if(0===b)return d.concat(a);for(e=0;e<a.length;e++)d.push(c|a[e]>>>b),c=a[e]<<32-b;return e=a.length?a[a.length-1]:0,a=m.bitArray.getPartial(e),d.push(m.bitArray.partial(b+a&31,32<b+a?c:d.pop(),1)),d},j:function(a,b){return[a[0]^b[0],a[1]^b[1],a[2]^b[2],a[3]^b[3]]},byteswapM:function(a){var b,c;for(b=0;b<a.length;++b)c=a[b],a[b]=c>>>24|c>>>8&65280|(65280&c)<<8|c<<24;return a}},m.codec.utf8String={fromBits:function(a){var b,c,d="",e=m.bitArray.bitLength(a);for(b=0;b<e/8;b++)0===(3&b)&&(c=a[b/4]),d+=String.fromCharCode(c>>>24),c<<=8;return decodeURIComponent(escape(d))},toBits:function(a){a=unescape(encodeURIComponent(a));var b,c=[],d=0;for(b=0;b<a.length;b++)d=d<<8|a.charCodeAt(b),3===(3&b)&&(c.push(d),d=0);return 3&b&&c.push(m.bitArray.partial(8*(3&b),d)),c}},m.codec.hex={fromBits:function(a){var b,c="";for(b=0;b<a.length;b++)c+=((0|a[b])+0xf00000000000).toString(16).substr(4);return c.substr(0,m.bitArray.bitLength(a)/4)},toBits:function(a){var b,c,d=[];for(a=a.replace(/\s|0x/g,""),c=a.length,a+="00000000",b=0;b<a.length;b+=8)d.push(0^parseInt(a.substr(b,8),16));return m.bitArray.clamp(d,4*c)}},m.codec.base64={M:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",fromBits:function(a,b,c){var d="",e=0,f=m.codec.base64.M,g=0,h=m.bitArray.bitLength(a);for(c&&(f=f.substr(0,62)+"-_"),c=0;6*d.length<h;)d+=f.charAt((g^a[c]>>>e)>>>26),6>e?(g=a[c]<<6-e,e+=26,c++):(g<<=6,e-=6);for(;3&d.length&&!b;)d+="=";return d},toBits:function(a,b){a=a.replace(/\s|=/g,"");var c,e,f=[],g=0,h=m.codec.base64.M,i=0;for(b&&(h=h.substr(0,62)+"-_"),c=0;c<a.length;c++)e=h.indexOf(a.charAt(c)),0>e&&d(new m.exception.invalid("this isn't base64!")),26<g?(g-=26,f.push(i^e>>>g),i=e<<32-g):(g+=6,i^=e<<32-g);return 56&g&&f.push(m.bitArray.partial(56&g,i,1)),f}},m.codec.base64url={fromBits:function(a){return m.codec.base64.fromBits(a,1,1)},toBits:function(a){return m.codec.base64.toBits(a,1)}},m.hash.sha256=function(a){this.b[0]||this.t(),a?(this.e=a.e.slice(0),this.d=a.d.slice(0),this.c=a.c):this.reset()},m.hash.sha256.hash=function(a){return(new m.hash.sha256).update(a).finalize()},m.hash.sha256.prototype={blockSize:512,reset:function(){return this.e=this.l.slice(0),this.d=[],this.c=0,this},update:function(a){"string"==typeof a&&(a=m.codec.utf8String.toBits(a));var b,c=this.d=m.bitArray.concat(this.d,a);for(b=this.c,a=this.c=b+m.bitArray.bitLength(a),b=512+b&-512;b<=a;b+=512)this.r(c.splice(0,16));return this},finalize:function(){var a,b=this.d,c=this.e,b=m.bitArray.concat(b,[m.bitArray.partial(1,1)]);for(a=b.length+2;15&a;a++)b.push(0);for(b.push(Math.floor(this.c/4294967296)),b.push(0|this.c);b.length;)this.r(b.splice(0,16));return this.reset(),c},l:[],b:[],t:function(){function a(a){return 4294967296*(a-Math.floor(a))|0}var b,c=0,d=2;a:for(;64>c;d++){for(b=2;b*b<=d;b++)if(0===d%b)continue a;8>c&&(this.l[c]=a(Math.pow(d,.5))),this.b[c]=a(Math.pow(d,1/3)),c++}},r:function(a){var b,c,d=a.slice(0),e=this.e,f=this.b,g=e[0],h=e[1],i=e[2],j=e[3],k=e[4],l=e[5],m=e[6],n=e[7];for(a=0;64>a;a++)16>a?b=d[a]:(b=d[a+1&15],c=d[a+14&15],b=d[15&a]=(b>>>7^b>>>18^b>>>3^b<<25^b<<14)+(c>>>17^c>>>19^c>>>10^c<<15^c<<13)+d[15&a]+d[a+9&15]|0),b=b+n+(k>>>6^k>>>11^k>>>25^k<<26^k<<21^k<<7)+(m^k&(l^m))+f[a],n=m,m=l,l=k,k=j+b|0,j=i,i=h,h=g,g=b+(h&i^j&(h^i))+(h>>>2^h>>>13^h>>>22^h<<30^h<<19^h<<10)|0;e[0]=e[0]+g|0,e[1]=e[1]+h|0,e[2]=e[2]+i|0,e[3]=e[3]+j|0,e[4]=e[4]+k|0,e[5]=e[5]+l|0,e[6]=e[6]+m|0,e[7]=e[7]+n|0}},m.hash.sha512=function(a){this.b[0]||this.t(),a?(this.e=a.e.slice(0),this.d=a.d.slice(0),this.c=a.c):this.reset()},m.hash.sha512.hash=function(a){return(new m.hash.sha512).update(a).finalize()},m.hash.sha512.prototype={blockSize:1024,reset:function(){return this.e=this.l.slice(0),this.d=[],this.c=0,this},update:function(a){"string"==typeof a&&(a=m.codec.utf8String.toBits(a));var b,c=this.d=m.bitArray.concat(this.d,a);for(b=this.c,a=this.c=b+m.bitArray.bitLength(a),b=1024+b&-1024;b<=a;b+=1024)this.r(c.splice(0,32));return this},finalize:function(){var a,b=this.d,c=this.e,b=m.bitArray.concat(b,[m.bitArray.partial(1,1)]);for(a=b.length+4;31&a;a++)b.push(0);for(b.push(0),b.push(0),b.push(Math.floor(this.c/4294967296)),b.push(0|this.c);b.length;)this.r(b.splice(0,32));return this.reset(),c},l:[],ca:[12372232,13281083,9762859,1914609,15106769,4090911,4308331,8266105],b:[],ea:[2666018,15689165,5061423,9034684,4764984,380953,1658779,7176472,197186,7368638,14987916,16757986,8096111,1480369,13046325,6891156,15813330,5187043,9229749,11312229,2818677,10937475,4324308,1135541,6741931,11809296,16458047,15666916,11046850,698149,229999,945776,13774844,2541862,12856045,9810911,11494366,7844520,15576806,8533307,15795044,4337665,16291729,5553712,15684120,6662416,7413802,12308920,13816008,4303699,9366425,10176680,13195875,4295371,6546291,11712675,15708924,1519456,15772530,6568428,6495784,8568297,13007125,7492395,2515356,12632583,14740254,7262584,1535930,13146278,16321966,1853211,294276,13051027,13221564,1051980,4080310,6651434,14088940,4675607],t:function(){function a(a){return 4294967296*(a-Math.floor(a))|0}function b(a){return 1099511627776*(a-Math.floor(a))&255}var c,d=0,e=2;a:for(;80>d;e++){for(c=2;c*c<=e;c++)if(0===e%c)continue a;8>d&&(this.l[2*d]=a(Math.pow(e,.5)),this.l[2*d+1]=b(Math.pow(e,.5))<<24|this.ca[d]),this.b[2*d]=a(Math.pow(e,1/3)),this.b[2*d+1]=b(Math.pow(e,1/3))<<24|this.ea[d],d++}},r:function(a){var b,c,d=a.slice(0),e=this.e,f=this.b,g=e[0],h=e[1],i=e[2],j=e[3],k=e[4],l=e[5],m=e[6],n=e[7],o=e[8],p=e[9],q=e[10],r=e[11],s=e[12],t=e[13],u=e[14],v=e[15],w=g,x=h,y=i,z=j,A=k,B=l,C=m,D=n,E=o,F=p,G=q,H=r,I=s,J=t,K=u,L=v;for(a=0;80>a;a++){if(16>a)b=d[2*a],c=d[2*a+1];else{c=d[2*(a-15)];var M=d[2*(a-15)+1];b=(M<<31|c>>>1)^(M<<24|c>>>8)^c>>>7;var N=(c<<31|M>>>1)^(c<<24|M>>>8)^(c<<25|M>>>7);c=d[2*(a-2)];var O=d[2*(a-2)+1],M=(O<<13|c>>>19)^(c<<3|O>>>29)^c>>>6,O=(c<<13|O>>>19)^(O<<3|c>>>29)^(c<<26|O>>>6),P=d[2*(a-7)],Q=d[2*(a-16)],R=d[2*(a-16)+1];c=N+d[2*(a-7)+1],b=b+P+(c>>>0<N>>>0?1:0),c+=O,b+=M+(c>>>0<O>>>0?1:0),c+=R,b+=Q+(c>>>0<R>>>0?1:0)}d[2*a]=b|=0,d[2*a+1]=c|=0;var P=E&G^~E&I,S=F&H^~F&J,O=w&y^w&A^y&A,T=x&z^x&B^z&B,Q=(x<<4|w>>>28)^(w<<30|x>>>2)^(w<<25|x>>>7),R=(w<<4|x>>>28)^(x<<30|w>>>2)^(x<<25|w>>>7),U=f[2*a],V=f[2*a+1],M=L+((E<<18|F>>>14)^(E<<14|F>>>18)^(F<<23|E>>>9)),N=K+((F<<18|E>>>14)^(F<<14|E>>>18)^(E<<23|F>>>9))+(M>>>0<L>>>0?1:0),M=M+S,N=N+(P+(M>>>0<S>>>0?1:0)),M=M+V,N=N+(U+(M>>>0<V>>>0?1:0)),M=M+c|0,N=N+(b+(M>>>0<c>>>0?1:0));c=R+T,b=Q+O+(c>>>0<R>>>0?1:0),K=I,L=J,I=G,J=H,G=E,H=F,F=D+M|0,E=C+N+(F>>>0<D>>>0?1:0)|0,C=A,D=B,A=y,B=z,y=w,z=x,x=M+c|0,w=N+b+(x>>>0<M>>>0?1:0)|0}h=e[1]=h+x|0,e[0]=g+w+(h>>>0<x>>>0?1:0)|0,j=e[3]=j+z|0,e[2]=i+y+(j>>>0<z>>>0?1:0)|0,l=e[5]=l+B|0,e[4]=k+A+(l>>>0<B>>>0?1:0)|0,n=e[7]=n+D|0,e[6]=m+C+(n>>>0<D>>>0?1:0)|0,p=e[9]=p+F|0,e[8]=o+E+(p>>>0<F>>>0?1:0)|0,r=e[11]=r+H|0,e[10]=q+G+(r>>>0<H>>>0?1:0)|0,t=e[13]=t+J|0,e[12]=s+I+(t>>>0<J>>>0?1:0)|0,v=e[15]=v+L|0,e[14]=u+K+(v>>>0<L>>>0?1:0)|0}},m.mode.ccm={name:"ccm",w:[],listenProgress:function(a){m.mode.ccm.w.push(a)},unListenProgress:function(a){a=m.mode.ccm.w.indexOf(a),-1<a&&m.mode.ccm.w.splice(a,1)},X:function(a){var b,c=m.mode.ccm.w.slice();for(b=0;b<c.length;b+=1)c[b](a)},encrypt:function(a,b,c,e,f){var g,h=b.slice(0),i=m.bitArray,j=i.bitLength(c)/8,k=i.bitLength(h)/8;for(f=f||64,e=e||[],7>j&&d(new m.exception.invalid("ccm: iv must be at least 7 bytes")),g=2;4>g&&k>>>8*g;g++);return g<15-j&&(g=15-j),c=i.clamp(c,8*(15-g)),b=m.mode.ccm.O(a,b,c,e,f,g),h=m.mode.ccm.s(a,h,c,b,f,g),i.concat(h.data,h.tag)},decrypt:function(a,b,c,e,f){f=f||64,e=e||[];var g=m.bitArray,h=g.bitLength(c)/8,i=g.bitLength(b),j=g.clamp(b,i-f),k=g.bitSlice(b,i-f),i=(i-f)/8;for(7>h&&d(new m.exception.invalid("ccm: iv must be at least 7 bytes")),b=2;4>b&&i>>>8*b;b++);return b<15-h&&(b=15-h),c=g.clamp(c,8*(15-b)),j=m.mode.ccm.s(a,j,c,k,f,b),a=m.mode.ccm.O(a,j.data,c,e,f,b),g.equal(j.tag,a)||d(new m.exception.corrupt("ccm: tag doesn't match")),j.data},ga:function(a,b,c,d,e,f){var g=[],h=m.bitArray,i=h.j;if(d=[h.partial(8,(b.length?64:0)|d-2<<2|f-1)],d=h.concat(d,c),d[3]|=e,d=a.encrypt(d),b.length)for(c=h.bitLength(b)/8,65279>=c?g=[h.partial(16,c)]:4294967295>=c&&(g=h.concat([h.partial(16,65534)],[c])),g=h.concat(g,b),b=0;b<g.length;b+=4)d=a.encrypt(i(d,g.slice(b,b+4).concat([0,0,0])));return d},O:function(a,b,c,e,f,g){var h=m.bitArray,i=h.j;for(f/=8,(f%2||4>f||16<f)&&d(new m.exception.invalid("ccm: invalid tag length")),(4294967295<e.length||4294967295<b.length)&&d(new m.exception.bug("ccm: can't deal with 4GiB or more data")),c=m.mode.ccm.ga(a,e,c,f,h.bitLength(b)/8,g),e=0;e<b.length;e+=4)c=a.encrypt(i(c,b.slice(e,e+4).concat([0,0,0])));return h.clamp(c,8*f)},s:function(a,b,c,d,e,f){var g,h=m.bitArray;g=h.j;var i=b.length,j=h.bitLength(b),k=i/50,l=k;if(c=h.concat([h.partial(8,f-1)],c).concat([0,0,0]).slice(0,4),d=h.bitSlice(g(d,a.encrypt(c)),0,e),!i)return{tag:d,data:[]};for(g=0;g<i;g+=4)g>k&&(m.mode.ccm.X(g/i),k+=l),c[3]++,e=a.encrypt(c),b[g]^=e[0],b[g+1]^=e[1],b[g+2]^=e[2],b[g+3]^=e[3];return{tag:d,data:h.clamp(b,j)}}},m.mode.ocb2={name:"ocb2",encrypt:function(a,b,c,e,f,g){128!==m.bitArray.bitLength(c)&&d(new m.exception.invalid("ocb iv must be 128 bits"));var h,i=m.mode.ocb2.K,j=m.bitArray,k=j.j,l=[0,0,0,0];c=i(a.encrypt(c));var n,o=[];for(e=e||[],f=f||64,h=0;h+4<b.length;h+=4)n=b.slice(h,h+4),l=k(l,n),o=o.concat(k(c,a.encrypt(k(c,n)))),c=i(c);return n=b.slice(h),b=j.bitLength(n),h=a.encrypt(k(c,[0,0,0,b])),n=j.clamp(k(n.concat([0,0,0]),h),b),l=k(l,k(n.concat([0,0,0]),h)),l=a.encrypt(k(l,k(c,i(c)))),e.length&&(l=k(l,g?e:m.mode.ocb2.pmac(a,e))),o.concat(j.concat(n,j.clamp(l,f)))},decrypt:function(a,b,c,e,f,g){128!==m.bitArray.bitLength(c)&&d(new m.exception.invalid("ocb iv must be 128 bits")),f=f||64;var h,i,j=m.mode.ocb2.K,k=m.bitArray,l=k.j,n=[0,0,0,0],o=j(a.encrypt(c)),p=m.bitArray.bitLength(b)-f,q=[];for(e=e||[],c=0;c+4<p/32;c+=4)h=l(o,a.decrypt(l(o,b.slice(c,c+4)))),n=l(n,h),q=q.concat(h),o=j(o);return i=p-32*c,h=a.encrypt(l(o,[0,0,0,i])),h=l(h,k.clamp(b.slice(c),i).concat([0,0,0])),n=l(n,h),n=a.encrypt(l(n,l(o,j(o)))),e.length&&(n=l(n,g?e:m.mode.ocb2.pmac(a,e))),k.equal(k.clamp(n,f),k.bitSlice(b,p))||d(new m.exception.corrupt("ocb: tag doesn't match")),q.concat(k.clamp(h,i))},pmac:function(a,b){var c,d=m.mode.ocb2.K,e=m.bitArray,f=e.j,g=[0,0,0,0],h=a.encrypt([0,0,0,0]),h=f(h,d(d(h)));for(c=0;c+4<b.length;c+=4)h=d(h),g=f(g,a.encrypt(f(h,b.slice(c,c+4))));return c=b.slice(c),128>e.bitLength(c)&&(h=f(h,d(h)),c=e.concat(c,[-2147483648,0,0,0])),g=f(g,c),a.encrypt(f(d(f(h,d(h))),g))},K:function(a){return[a[0]<<1^a[1]>>>31,a[1]<<1^a[2]>>>31,a[2]<<1^a[3]>>>31,a[3]<<1^135*(a[0]>>>31)]}},m.mode.gcm={name:"gcm",encrypt:function(a,b,c,d,e){var f=b.slice(0);return b=m.bitArray,d=d||[],a=m.mode.gcm.s(!0,a,f,d,c,e||128),b.concat(a.data,a.tag)},decrypt:function(a,b,c,e,f){var g=b.slice(0),h=m.bitArray,i=h.bitLength(g);return f=f||128,e=e||[],f<=i?(b=h.bitSlice(g,i-f),g=h.bitSlice(g,0,i-f)):(b=g,g=[]),a=m.mode.gcm.s(l,a,g,e,c,f),h.equal(a.tag,b)||d(new m.exception.corrupt("gcm: tag doesn't match")),a.data},ba:function(a,b){var c,d,e,f,g,h=m.bitArray.j;for(e=[0,0,0,0],f=b.slice(0),c=0;128>c;c++){for((d=0!==(a[Math.floor(c/32)]&1<<31-c%32))&&(e=h(e,f)),g=0!==(1&f[3]),d=3;0<d;d--)f[d]=f[d]>>>1|(1&f[d-1])<<31;f[0]>>>=1,g&&(f[0]^=-520093696)}return e},k:function(a,b,c){var d,e=c.length;for(b=b.slice(0),d=0;d<e;d+=4)b[0]^=4294967295&c[d],b[1]^=4294967295&c[d+1],b[2]^=4294967295&c[d+2],b[3]^=4294967295&c[d+3],b=m.mode.gcm.ba(b,a);return b},s:function(a,b,c,d,e,f){var g,h,i,j,k,l,n,o,p=m.bitArray;for(l=c.length,n=p.bitLength(c),o=p.bitLength(d),h=p.bitLength(e),g=b.encrypt([0,0,0,0]),96===h?(e=e.slice(0),e=p.concat(e,[1])):(e=m.mode.gcm.k(g,[0,0,0,0],e),e=m.mode.gcm.k(g,e,[0,0,Math.floor(h/4294967296),4294967295&h])),h=m.mode.gcm.k(g,[0,0,0,0],d),k=e.slice(0),d=h.slice(0),a||(d=m.mode.gcm.k(g,h,c)),j=0;j<l;j+=4)k[3]++,i=b.encrypt(k),c[j]^=i[0],c[j+1]^=i[1],c[j+2]^=i[2],c[j+3]^=i[3];return c=p.clamp(c,n),a&&(d=m.mode.gcm.k(g,h,c)),a=[Math.floor(o/4294967296),4294967295&o,Math.floor(n/4294967296),4294967295&n],d=m.mode.gcm.k(g,d,a),i=b.encrypt(e),d[0]^=i[0],d[1]^=i[1],d[2]^=i[2],d[3]^=i[3],{tag:p.bitSlice(d,0,f),data:c}}},m.misc.hmac=function(a,b){this.P=b=b||m.hash.sha256;var c,d=[[],[]],e=b.prototype.blockSize/32;for(this.q=[new b,new b],a.length>e&&(a=b.hash(a)),c=0;c<e;c++)d[0][c]=909522486^a[c],d[1][c]=1549556828^a[c];this.q[0].update(d[0]),this.q[1].update(d[1]),this.J=new b(this.q[0])},m.misc.hmac.prototype.encrypt=m.misc.hmac.prototype.mac=function(a){return this.S&&d(new m.exception.invalid("encrypt on already updated hmac called!")),this.update(a),this.digest(a)},m.misc.hmac.prototype.reset=function(){this.J=new this.P(this.q[0]),this.S=l},m.misc.hmac.prototype.update=function(a){this.S=!0,this.J.update(a)},m.misc.hmac.prototype.digest=function(){var a=this.J.finalize(),a=new this.P(this.q[1]).update(a).finalize();return this.reset(),a},m.misc.pbkdf2=function(a,b,c,e,f){c=c||1e3,(0>e||0>c)&&d(m.exception.invalid("invalid params to pbkdf2")),"string"==typeof a&&(a=m.codec.utf8String.toBits(a)),"string"==typeof b&&(b=m.codec.utf8String.toBits(b)),f=f||m.misc.hmac,a=new f(a);var g,h,i,j,k=[],l=m.bitArray;for(j=1;32*k.length<(e||1);j++){for(f=g=a.encrypt(l.concat(b,[j])),h=1;h<c;h++)for(g=a.encrypt(g),i=0;i<g.length;i++)f[i]^=g[i];k=k.concat(f)}return e&&(k=l.clamp(k,e)),k},m.prng=function(a){this.f=[new m.hash.sha256],this.m=[0],this.I=0,this.A={},this.H=0,this.N={},this.Q=this.g=this.n=this.Z=0,this.b=[0,0,0,0,0,0,0,0],this.i=[0,0,0,0],this.F=k,this.G=a,this.u=l,this.D={progress:{},seeded:{}},this.p=this.Y=0,this.B=1,this.C=2,this.U=65536,this.L=[0,48,64,96,128,192,256,384,512,768,1024],this.V=3e4,this.T=80},m.prng.prototype={randomWords:function(a,b){var c,e=[];c=this.isReady(b);var f;if(c===this.p&&d(new m.exception.notReady("generator isn't seeded")),c&this.C){c=!(c&this.B),f=[];var g,j=0;for(this.Q=f[0]=(new Date).valueOf()+this.V,g=0;16>g;g++)f.push(4294967296*Math.random()|0);for(g=0;g<this.f.length&&(f=f.concat(this.f[g].finalize()),j+=this.m[g],this.m[g]=0,!(!c&&this.I&1<<g));g++);for(this.I>=1<<this.f.length&&(this.f.push(new m.hash.sha256),this.m.push(0)),this.g-=j,j>this.n&&(this.n=j),this.I++,this.b=m.hash.sha256.hash(this.b.concat(f)),this.F=new m.cipher.aes(this.b),c=0;4>c&&(this.i[c]=this.i[c]+1|0,!this.i[c]);c++);}for(c=0;c<a;c+=4)0===(c+1)%this.U&&h(this),f=i(this),e.push(f[0],f[1],f[2],f[3]);return h(this),e.slice(0,a)},setDefaultParanoia:function(a,b){0===a&&"Setting paranoia=0 will ruin your security; use it only for testing"!==b&&d("Setting paranoia=0 will ruin your security; use it only for testing"),this.G=a},addEntropy:function(a,b,c){c=c||"user";var e,g,h=(new Date).valueOf(),i=this.A[c],j=this.isReady(),l=0;switch(e=this.N[c],e===k&&(e=this.N[c]=this.Z++),i===k&&(i=this.A[c]=0),this.A[c]=(this.A[c]+1)%this.f.length,typeof a){case"number":b===k&&(b=1),this.f[i].update([e,this.H++,1,b,h,1,0|a]);break;case"object":if(c=Object.prototype.toString.call(a),"[object Uint32Array]"===c){for(g=[],c=0;c<a.length;c++)g.push(a[c]);a=g}else for("[object Array]"!==c&&(l=1),c=0;c<a.length&&!l;c++)"number"!=typeof a[c]&&(l=1);if(!l){if(b===k)for(c=b=0;c<a.length;c++)for(g=a[c];0<g;)b++,g>>>=1;this.f[i].update([e,this.H++,2,b,h,a.length].concat(a))}break;case"string":b===k&&(b=a.length),this.f[i].update([e,this.H++,3,b,h,a.length]),this.f[i].update(a);break;default:l=1}l&&d(new m.exception.bug("random: addEntropy only supports number, array of numbers or string")),this.m[i]+=b,this.g+=b,j===this.p&&(this.isReady()!==this.p&&f("seeded",Math.max(this.n,this.g)),f("progress",this.getProgress()))},isReady:function(a){return a=this.L[a!==k?a:this.G],this.n&&this.n>=a?this.m[0]>this.T&&(new Date).valueOf()>this.Q?this.C|this.B:this.B:this.g>=a?this.C|this.p:this.p},getProgress:function(a){return a=this.L[a?a:this.G],this.n>=a?1:this.g>a?1:this.g/a},startCollectors:function(){this.u||(this.a={loadTimeCollector:j(this,this.fa),mouseCollector:j(this,this.ha),keyboardCollector:j(this,this.da),accelerometerCollector:j(this,this.W),touchCollector:j(this,this.ja)},window.addEventListener?(window.addEventListener("load",this.a.loadTimeCollector,l),window.addEventListener("mousemove",this.a.mouseCollector,l),window.addEventListener("keypress",this.a.keyboardCollector,l),window.addEventListener("devicemotion",this.a.accelerometerCollector,l),window.addEventListener("touchmove",this.a.touchCollector,l)):document.attachEvent?(document.attachEvent("onload",this.a.loadTimeCollector),document.attachEvent("onmousemove",this.a.mouseCollector),document.attachEvent("keypress",this.a.keyboardCollector)):d(new m.exception.bug("can't attach event")),this.u=!0)},stopCollectors:function(){this.u&&(window.removeEventListener?(window.removeEventListener("load",this.a.loadTimeCollector,l),window.removeEventListener("mousemove",this.a.mouseCollector,l),window.removeEventListener("keypress",this.a.keyboardCollector,l),window.removeEventListener("devicemotion",this.a.accelerometerCollector,l),window.removeEventListener("touchmove",this.a.touchCollector,l)):document.detachEvent&&(document.detachEvent("onload",this.a.loadTimeCollector),document.detachEvent("onmousemove",this.a.mouseCollector),document.detachEvent("keypress",this.a.keyboardCollector)),this.u=l)},addEventListener:function(a,b){this.D[a][this.Y++]=b},removeEventListener:function(a,b){var c,d,e=this.D[a],f=[];for(d in e)e.hasOwnProperty(d)&&e[d]===b&&f.push(d);for(c=0;c<f.length;c++)d=f[c],delete e[d]},da:function(){g(1)},ha:function(a){var b,c;try{b=a.x||a.clientX||a.offsetX||0,c=a.y||a.clientY||a.offsetY||0}catch(a){c=b=0}0!=b&&0!=c&&m.random.addEntropy([b,c],2,"mouse"),g(0)},ja:function(a){a=a.touches[0]||a.changedTouches[0],m.random.addEntropy([a.pageX||a.clientX,a.pageY||a.clientY],1,"touch"),g(0)},fa:function(){g(2)},W:function(a){if(a=a.accelerationIncludingGravity.x||a.accelerationIncludingGravity.y||a.accelerationIncludingGravity.z,window.orientation){var b=window.orientation;"number"==typeof b&&m.random.addEntropy(b,1,"accelerometer")}a&&m.random.addEntropy(a,2,"accelerometer"),g(0)}},m.random=new m.prng(6);a:try{var n,o,p,q;if(q="undefined"!=typeof b){var r;if(r=b.exports){var s;try{s=a("crypto")}catch(a){s=null}r=(o=s)&&o.randomBytes}q=r}if(q)n=o.randomBytes(128),n=new Uint32Array(new Uint8Array(n).buffer),m.random.addEntropy(n,1024,"crypto['randomBytes']");else if("undefined"!=typeof window&&"undefined"!=typeof Uint32Array){if(p=new Uint32Array(32),window.crypto&&window.crypto.getRandomValues)window.crypto.getRandomValues(p);else{if(!window.msCrypto||!window.msCrypto.getRandomValues)break a;window.msCrypto.getRandomValues(p)}m.random.addEntropy(p,1024,"crypto['getRandomValues']")}}catch(a){"undefined"!=typeof window&&window.console&&(console.log("There was an error collecting entropy from the browser:"),console.log(a))}m.json={defaults:{v:1,iter:1e3,ks:128,ts:64,mode:"ccm",adata:"",cipher:"aes"},aa:function(a,b,c,e){c=c||{},e=e||{};var f,g=m.json,h=g.h({iv:m.random.randomWords(4,0)},g.defaults);return g.h(h,c),c=h.adata,"string"==typeof h.salt&&(h.salt=m.codec.base64.toBits(h.salt)),"string"==typeof h.iv&&(h.iv=m.codec.base64.toBits(h.iv)),(!m.mode[h.mode]||!m.cipher[h.cipher]||"string"==typeof a&&100>=h.iter||64!==h.ts&&96!==h.ts&&128!==h.ts||128!==h.ks&&192!==h.ks&&256!==h.ks||2>h.iv.length||4<h.iv.length)&&d(new m.exception.invalid("json encrypt: invalid parameters")),"string"==typeof a?(f=m.misc.cachedPbkdf2(a,h),a=f.key.slice(0,h.ks/32),h.salt=f.salt):m.ecc&&a instanceof m.ecc.elGamal.publicKey&&(f=a.kem(),h.kemtag=f.tag,a=f.key.slice(0,h.ks/32)),"string"==typeof b&&(b=m.codec.utf8String.toBits(b)),"string"==typeof c&&(h.adata=c=m.codec.utf8String.toBits(c)),f=new m.cipher[h.cipher](a),g.h(e,h),e.key=a,h.ct="ccm"===h.mode&&m.arrayBuffer&&m.arrayBuffer.ccm&&b instanceof ArrayBuffer?m.arrayBuffer.ccm.encrypt(f,b,h.iv,c,h.ts):m.mode[h.mode].encrypt(f,b,h.iv,c,h.ts),h},encrypt:function(a,b,c,d){var e=m.json,f=e.aa.apply(e,arguments);return e.encode(f)},$:function(a,b,c,e){c=c||{},e=e||{};var f=m.json;b=f.h(f.h(f.h({},f.defaults),b),c,!0);var g,h;return g=b.adata,"string"==typeof b.salt&&(b.salt=m.codec.base64.toBits(b.salt)),"string"==typeof b.iv&&(b.iv=m.codec.base64.toBits(b.iv)),(!m.mode[b.mode]||!m.cipher[b.cipher]||"string"==typeof a&&100>=b.iter||64!==b.ts&&96!==b.ts&&128!==b.ts||128!==b.ks&&192!==b.ks&&256!==b.ks||!b.iv||2>b.iv.length||4<b.iv.length)&&d(new m.exception.invalid("json decrypt: invalid parameters")),"string"==typeof a?(h=m.misc.cachedPbkdf2(a,b),a=h.key.slice(0,b.ks/32),b.salt=h.salt):m.ecc&&a instanceof m.ecc.elGamal.secretKey&&(a=a.unkem(m.codec.base64.toBits(b.kemtag)).slice(0,b.ks/32)),"string"==typeof g&&(g=m.codec.utf8String.toBits(g)),h=new m.cipher[b.cipher](a),g="ccm"===b.mode&&m.arrayBuffer&&m.arrayBuffer.ccm&&b.ct instanceof ArrayBuffer?m.arrayBuffer.ccm.decrypt(h,b.ct,b.iv,b.tag,g,b.ts):m.mode[b.mode].decrypt(h,b.ct,b.iv,g,b.ts),f.h(e,b),e.key=a,1===c.raw?g:m.codec.utf8String.fromBits(g)},decrypt:function(a,b,c,d){var e=m.json;return e.$(a,e.decode(b),c,d)},encode:function(a){var b,c="{",e="";for(b in a)if(a.hasOwnProperty(b))switch(b.match(/^[a-z0-9]+$/i)||d(new m.exception.invalid("json encode: invalid property name")),c+=e+'"'+b+'":',e=",",typeof a[b]){case"number":case"boolean":c+=a[b];break;case"string":c+='"'+escape(a[b])+'"';break;case"object":c+='"'+m.codec.base64.fromBits(a[b],0)+'"';break;default:d(new m.exception.bug("json encode: unsupported type"))}return c+"}"},decode:function(a){a=a.replace(/\s/g,""),a.match(/^\{.*\}$/)||d(new m.exception.invalid("json decode: this isn't json!")),a=a.replace(/^\{|\}$/g,"").split(/,/);var b,c,e={};for(b=0;b<a.length;b++)(c=a[b].match(/^\s*(?:(["']?)([a-z][a-z0-9]*)\1)\s*:\s*(?:(-?\d+)|"([a-z0-9+\/%*_.@=\-]*)"|(true|false))$/i))||d(new m.exception.invalid("json decode: this isn't json!")),null!=c[3]?e[c[2]]=parseInt(c[3],10):null!=c[4]?e[c[2]]=c[2].match(/^(ct|adata|salt|iv)$/)?m.codec.base64.toBits(c[4]):unescape(c[4]):null!=c[5]&&(e[c[2]]="true"===c[5]);return e},h:function(a,b,c){if(a===k&&(a={}),b===k)return a;for(var e in b)b.hasOwnProperty(e)&&(c&&a[e]!==k&&a[e]!==b[e]&&d(new m.exception.invalid("required parameter overridden")),a[e]=b[e]);return a},la:function(a,b){var c,d={};for(c in a)a.hasOwnProperty(c)&&a[c]!==b[c]&&(d[c]=a[c]);return d},ka:function(a,b){var c,d={};for(c=0;c<b.length;c++)a[b[c]]!==k&&(d[b[c]]=a[b[c]]);return d}},m.encrypt=m.json.encrypt,m.decrypt=m.json.decrypt,m.misc.ia={},m.misc.cachedPbkdf2=function(a,b){var c,d=m.misc.ia;return b=b||{},c=b.iter||1e3,d=d[a]=d[a]||{},c=d[c]=d[c]||{firstSalt:b.salt&&b.salt.length?b.salt.slice(0):m.random.randomWords(2,0)},d=b.salt===k?c.firstSalt:b.salt,c[d]=c[d]||m.misc.pbkdf2(a,d,b.iter),{key:c[d].slice(0),salt:d.slice(0)}}},{crypto:133}],31:[function(a,b,c){b.exports=["abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse","access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act","action","actor","actress","actual","adapt","add","addict","address","adjust","admit","adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent","agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert","alien","all","alley","allow","almost","alone","alpha","already","also","alter","always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger","angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique","anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic","area","arena","argue","arm","armed","armor","army","around","arrange","arrest","arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset","assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction","audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake","aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge","bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain","barrel","base","basic","basket","battle","beach","bean","beauty","because","become","beef","before","begin","behave","behind","believe","below","belt","bench","benefit","best","betray","better","between","beyond","bicycle","bid","bike","bind","biology","bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless","blind","blood","blossom","blouse","blue","blur","blush","board","boat","body","boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss","bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread","breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze","broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb","bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy","butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call","calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas","canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry","cart","case","cash","casino","castle","casual","cat","catalog","catch","category","cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century","cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase","chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child","chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle","citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk","clever","click","client","cliff","climb","clinic","clip","clock","clog","close","cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut","code","coffee","coil","coin","collect","color","column","combine","come","comfort","comic","common","company","concert","conduct","confirm","congress","connect","consider","control","convince","cook","cool","copper","copy","coral","core","corn","correct","cost","cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle","craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek","crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial","cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup","cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad","damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal","debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense","define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny","depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk","despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond","diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur","direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance","divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain","donate","donkey","donor","door","dose","double","dove","draft","dragon","drama","drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop","drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf","dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo","ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow","elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody","embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless","endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough","enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip","era","erase","erode","erosion","error","erupt","escape","essay","essence","estate","eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange","excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit","exotic","expand","expect","expire","explain","expose","express","extend","extra","eye","eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame","family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father","fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female","fence","festival","fetch","fever","few","fiber","fiction","field","figure","file","film","filter","final","find","fine","finger","finish","fire","firm","first","fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor","flee","flight","flip","float","flock","floor","flower","fluid","flush","fly","foam","focus","fog","foil","fold","follow","food","foot","force","forest","forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile","frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen","fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy","gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp","gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture","ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance","glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue","goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown","grab","grace","grain","grant","grape","grass","gravity","great","green","grid","grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt","guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy","harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health","heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden","high","hill","hint","hip","hire","history","hobby","hockey","hold","hole","holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital","host","hotel","hour","hover","hub","huge","human","humble","humor","hundred","hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea","identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune","impact","impose","improve","impulse","inch","include","income","increase","index","indicate","indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury","inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install","intact","interest","into","invest","invite","involve","iron","island","isolate","issue","item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel","job","join","joke","journey","joy","judge","juice","jump","jungle","junior","junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney","kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife","knock","know","lab","label","labor","ladder","lady","lake","lamp","language","laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit","layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal","legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level","liar","liberty","library","license","life","lift","light","like","limb","limit","link","lion","liquid","list","little","live","lizard","load","loan","lobster","local","lock","logic","lonely","long","loop","lottery","loud","lounge","love","loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad","magic","magnet","maid","mail","main","major","make","mammal","man","manage","mandate","mango","mansion","manual","maple","marble","march","margin","marine","market","marriage","mask","mass","master","match","material","math","matrix","matter","maximum","maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt","member","memory","mention","menu","mercy","merge","merit","merry","mesh","message","metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor","minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile","model","modify","mom","moment","monitor","monkey","monster","month","moon","moral","more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie","much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual","myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature","near","neck","need","negative","neglect","neither","nephew","nerve","nest","net","network","neutral","never","news","next","nice","night","noble","noise","nominee","noodle","normal","north","nose","notable","note","nothing","notice","novel","now","nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe","obtain","obvious","occur","ocean","october","odor","off","offer","office","often","oil","okay","old","olive","olympic","omit","once","one","onion","online","only","open","opera","opinion","oppose","option","orange","orbit","orchard","order","ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output","outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact","paddle","page","pair","palace","palm","panda","panel","panic","panther","paper","parade","parent","park","parrot","party","pass","patch","path","patient","patrol","pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen","penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo","phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot","pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate","play","please","pledge","pluck","plug","plunge","poem","poet","point","polar","pole","police","pond","pony","pool","popular","portion","position","possible","post","potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare","present","pretty","prevent","price","pride","primary","print","priority","prison","private","prize","problem","process","produce","profit","program","project","promote","proof","property","prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin","punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle","pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit","raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp","ranch","random","range","rapid","rare","rate","rather","raven","raw","razor","ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle","reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release","relief","rely","remain","remember","remind","remove","render","renew","rent","reopen","repair","repeat","replace","report","require","rescue","resemble","resist","resource","response","result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib","ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot","ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket","romance","roof","rookie","room","rose","rotate","rough","round","route","royal","rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness","safe","sail","salad","salmon","salon","salt","salute","same","sample","sand","satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter","scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script","scrub","sea","search","season","seat","second","secret","section","security","seed","seek","segment","select","sell","seminar","senior","sense","sentence","series","service","session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell","sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop","short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side","siege","sight","sign","silent","silk","silly","silver","similar","simple","since","sing","siren","sister","situate","six","size","skate","sketch","ski","skill","skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight","slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth","snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda","soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry","sort","soul","sound","soup","source","south","space","spare","spatial","spawn","speak","special","speed","spell","spend","sphere","spice","spider","spike","spin","spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring","spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp","stand","start","state","stay","steak","steel","stem","step","stereo","stick","still","sting","stock","stomach","stone","stool","story","stove","strategy","street","strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway","success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny","sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey","suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim","swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag","tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi","teach","team","tell","ten","tenant","tennis","tent","term","test","text","thank","that","theme","then","theory","there","they","thing","this","thought","three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber","time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler","toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool","tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist","toward","tower","town","toy","track","trade","traffic","tragic","train","transfer","trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick","trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust","truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle","twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella","unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform","unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade","uphold","upon","upper","upset","urban","urge","usage","use","used","useful","useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van","vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue","verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory","video","view","village","vintage","violin","virtual","virus","visa","visit","visual","vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage","wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash","wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather","web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat","wheel","when","where","whip","whisper","wide","width","wife","wild","will","win","window","wine","wing","wink","winner","winter","wire","wisdom","wise","wish","witness","wolf","woman","wonder","wood","wool","word","work","world","worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year","yellow","you","young","youth","zebra","zero","zone","zoo"];
6
},{}],32:[function(a,b,c){function d(a){if(a.length<8)return!1;if(a.length>72)return!1;if(48!==a[0])return!1;if(a[1]!==a.length-2)return!1;if(2!==a[2])return!1;var b=a[3];if(0===b)return!1;if(5+b>=a.length)return!1;if(2!==a[4+b])return!1;var c=a[5+b];return 0!==c&&(6+b+c===a.length&&(!(128&a[4])&&(!(b>1&&0===a[4]&&!(128&a[5]))&&(!(128&a[b+6])&&!(c>1&&0===a[b+6]&&!(128&a[b+7]))))))}function e(a){if(a.length<8)throw new Error("DER sequence length is too short");if(a.length>72)throw new Error("DER sequence length is too long");if(48!==a[0])throw new Error("Expected DER sequence");if(a[1]!==a.length-2)throw new Error("DER sequence length is invalid");if(2!==a[2])throw new Error("Expected DER integer");var b=a[3];if(0===b)throw new Error("R length is zero");if(5+b>=a.length)throw new Error("R length is too long");if(2!==a[4+b])throw new Error("Expected DER integer (2)");var c=a[5+b];if(0===c)throw new Error("S length is zero");if(6+b+c!==a.length)throw new Error("S length is invalid");if(128&a[4])throw new Error("R value is negative");if(b>1&&0===a[4]&&!(128&a[5]))throw new Error("R value excessively padded");if(128&a[b+6])throw new Error("S value is negative");if(c>1&&0===a[b+6]&&!(128&a[b+7]))throw new Error("S value excessively padded");return{r:a.slice(4,4+b),s:a.slice(6+b)}}function f(a,b){var c=a.length,d=b.length;if(0===c)throw new Error("R length is zero");if(0===d)throw new Error("S length is zero");if(c>33)throw new Error("R length is too long");if(d>33)throw new Error("S length is too long");if(128&a[0])throw new Error("R value is negative");if(128&b[0])throw new Error("S value is negative");if(c>1&&0===a[0]&&!(128&a[1]))throw new Error("R value excessively padded");if(d>1&&0===b[0]&&!(128&b[1]))throw new Error("S value excessively padded");var e=Buffer.allocUnsafe(6+c+d);return e[0]=48,e[1]=e.length-2,e[2]=2,e[3]=a.length,a.copy(e,4),e[4+c]=2,e[5+c]=b.length,b.copy(e,6+c),e}var Buffer=a("safe-buffer").Buffer;b.exports={check:d,decode:e,encode:f}},{"safe-buffer":311}],33:[function(a,b,c){b.exports={OP_FALSE:0,OP_0:0,OP_PUSHDATA1:76,OP_PUSHDATA2:77,OP_PUSHDATA4:78,OP_1NEGATE:79,OP_RESERVED:80,OP_1:81,OP_TRUE:81,OP_2:82,OP_3:83,OP_4:84,OP_5:85,OP_6:86,OP_7:87,OP_8:88,OP_9:89,OP_10:90,OP_11:91,OP_12:92,OP_13:93,OP_14:94,OP_15:95,OP_16:96,OP_NOP:97,OP_VER:98,OP_IF:99,OP_NOTIF:100,OP_VERIF:101,OP_VERNOTIF:102,OP_ELSE:103,OP_ENDIF:104,OP_VERIFY:105,OP_RETURN:106,OP_TOALTSTACK:107,OP_FROMALTSTACK:108,OP_2DROP:109,OP_2DUP:110,OP_3DUP:111,OP_2OVER:112,OP_2ROT:113,OP_2SWAP:114,OP_IFDUP:115,OP_DEPTH:116,OP_DROP:117,OP_DUP:118,OP_NIP:119,OP_OVER:120,OP_PICK:121,OP_ROLL:122,OP_ROT:123,OP_SWAP:124,OP_TUCK:125,OP_CAT:126,OP_SUBSTR:127,OP_LEFT:128,OP_RIGHT:129,OP_SIZE:130,OP_INVERT:131,OP_AND:132,OP_OR:133,OP_XOR:134,OP_EQUAL:135,OP_EQUALVERIFY:136,OP_RESERVED1:137,OP_RESERVED2:138,OP_1ADD:139,OP_1SUB:140,OP_2MUL:141,OP_2DIV:142,OP_NEGATE:143,OP_ABS:144,OP_NOT:145,OP_0NOTEQUAL:146,OP_ADD:147,OP_SUB:148,OP_MUL:149,OP_DIV:150,OP_MOD:151,OP_LSHIFT:152,OP_RSHIFT:153,OP_BOOLAND:154,OP_BOOLOR:155,OP_NUMEQUAL:156,OP_NUMEQUALVERIFY:157,OP_NUMNOTEQUAL:158,OP_LESSTHAN:159,OP_GREATERTHAN:160,OP_LESSTHANOREQUAL:161,OP_GREATERTHANOREQUAL:162,OP_MIN:163,OP_MAX:164,OP_WITHIN:165,OP_RIPEMD160:166,OP_SHA1:167,OP_SHA256:168,OP_HASH160:169,OP_HASH256:170,OP_CODESEPARATOR:171,OP_CHECKSIG:172,OP_CHECKSIGVERIFY:173,OP_CHECKMULTISIG:174,OP_CHECKMULTISIGVERIFY:175,OP_NOP1:176,OP_NOP2:177,OP_CHECKLOCKTIMEVERIFY:177,OP_NOP3:178,OP_NOP4:179,OP_NOP5:180,OP_NOP6:181,OP_NOP7:182,OP_NOP8:183,OP_NOP9:184,OP_NOP10:185,OP_PUBKEYHASH:253,OP_PUBKEY:254,OP_INVALIDOPCODE:255}},{}],34:[function(a,b,c){var d=a("./index.json"),e={};for(var f in d){var g=d[f];e[g]=f}b.exports=e},{"./index.json":33}],35:[function(a,b,c){function d(a){var b=k.decode(a);if(b.length<21)throw new TypeError(a+" is too short");if(b.length>21)throw new TypeError(a+" is too long");var c=b.readUInt8(0),d=b.slice(1);return{version:c,hash:d}}function e(a){var b=j.decode(a),c=j.fromWords(b.words.slice(1));return{version:b.words[0],prefix:b.prefix,data:Buffer.from(c)}}function f(a,b){n(o.tuple(o.Hash160bit,o.UInt8),arguments);var c=Buffer.allocUnsafe(21);return c.writeUInt8(b,0),a.copy(c,1),k.encode(c)}function g(a,b,c){var d=j.toWords(a);return d.unshift(b),j.encode(c,d)}function h(a,b){if(b=b||m.bitcoin,l.pubKeyHash.output.check(a))return f(l.compile(a).slice(3,23),b.pubKeyHash);if(l.scriptHash.output.check(a))return f(l.compile(a).slice(2,22),b.scriptHash);if(l.witnessPubKeyHash.output.check(a))return g(l.compile(a).slice(2,22),0,b.bech32);if(l.witnessScriptHash.output.check(a))return g(l.compile(a).slice(2,34),0,b.bech32);throw new Error(l.toASM(a)+" has no matching Address")}function i(a,b){b=b||m.bitcoin;var c;try{c=d(a)}catch(a){}if(c){if(c.version===b.pubKeyHash)return l.pubKeyHash.output.encode(c.hash);if(c.version===b.scriptHash)return l.scriptHash.output.encode(c.hash)}else{try{c=e(a)}catch(a){}if(c){if(c.prefix!==b.bech32)throw new Error(a+" has an invalid prefix");if(0===c.version){if(20===c.data.length)return l.witnessPubKeyHash.output.encode(c.data);if(32===c.data.length)return l.witnessScriptHash.output.encode(c.data)}}}throw new Error(a+" has no matching Script")}var Buffer=a("safe-buffer").Buffer,j=a("bech32"),k=a("bs58check"),l=a("./script"),m=a("./networks"),n=a("typeforce"),o=a("./types");b.exports={fromBase58Check:d,fromBech32:e,fromOutputScript:h,toBase58Check:f,toBech32:g,toOutputScript:i}},{"./networks":44,"./script":45,"./types":71,bech32:23,bs58check:101,"safe-buffer":311,typeforce:352}],36:[function(a,b,c){function d(){this.version=1,this.prevHash=null,this.merkleRoot=null,this.timestamp=0,this.bits=0,this.nonce=0}var Buffer=a("safe-buffer").Buffer,e=a("buffer-reverse"),f=a("./crypto"),g=a("merkle-lib/fastRoot"),h=a("typeforce"),i=a("./types"),j=a("varuint-bitcoin"),k=a("./transaction");d.fromBuffer=function(a){function b(b){return h+=b,a.slice(h-b,h)}function c(){var b=a.readUInt32LE(h);return h+=4,b}function e(){var b=a.readInt32LE(h);return h+=4,b}function f(){var b=j.decode(a,h);return h+=j.decode.bytes,b}function g(){var b=k.fromBuffer(a.slice(h),!0);return h+=b.byteLength(),b}if(a.length<80)throw new Error("Buffer too small (< 80 bytes)");var h=0,i=new d;if(i.version=e(),i.prevHash=b(32),i.merkleRoot=b(32),i.timestamp=c(),i.bits=c(),i.nonce=c(),80===a.length)return i;var l=f();i.transactions=[];for(var m=0;m<l;++m){var n=g();i.transactions.push(n)}return i},d.prototype.byteLength=function(a){return a||!this.transactions?80:80+j.encodingLength(this.transactions.length)+this.transactions.reduce(function(a,b){return a+b.byteLength()},0)},d.fromHex=function(a){return d.fromBuffer(Buffer.from(a,"hex"))},d.prototype.getHash=function(){return f.hash256(this.toBuffer(!0))},d.prototype.getId=function(){return e(this.getHash()).toString("hex")},d.prototype.getUTCDate=function(){var a=new Date(0);return a.setUTCSeconds(this.timestamp),a},d.prototype.toBuffer=function(a){function b(a){a.copy(e,f),f+=a.length}function c(a){e.writeInt32LE(a,f),f+=4}function d(a){e.writeUInt32LE(a,f),f+=4}var e=Buffer.allocUnsafe(this.byteLength(a)),f=0;return c(this.version),b(this.prevHash),b(this.merkleRoot),d(this.timestamp),d(this.bits),d(this.nonce),a||!this.transactions?e:(j.encode(this.transactions.length,e,f),f+=j.encode.bytes,this.transactions.forEach(function(a){var b=a.byteLength();a.toBuffer(e,f),f+=b}),e)},d.prototype.toHex=function(a){return this.toBuffer(a).toString("hex")},d.calculateTarget=function(a){var b=((4278190080&a)>>24)-3,c=8388607&a,d=Buffer.alloc(32,0);return d.writeUInt32BE(c,28-b),d},d.calculateMerkleRoot=function(a){if(h([{getHash:i.Function}],a),0===a.length)throw TypeError("Cannot compute merkle root for zero transactions");var b=a.map(function(a){return a.getHash()});return g(b,f.hash256)},d.prototype.checkMerkleRoot=function(){if(!this.transactions)return!1;var a=d.calculateMerkleRoot(this.transactions);return 0===this.merkleRoot.compare(a)},d.prototype.checkProofOfWork=function(){var a=e(this.getHash()),b=d.calculateTarget(this.bits);return a.compare(b)<=0},b.exports=d},{"./crypto":38,"./transaction":69,"./types":71,"buffer-reverse":103,"merkle-lib/fastRoot":252,"safe-buffer":311,typeforce:352,"varuint-bitcoin":361}],37:[function(a,b,c){function d(a,b){if("number"!=typeof a)throw new Error("cannot write a non-number as a number");if(a<0)throw new Error("specified a negative value for writing an unsigned value");if(a>b)throw new Error("RangeError: value out of range");if(Math.floor(a)!==a)throw new Error("value has a fractional component")}function e(a,b){var c=a.readUInt32LE(b),e=a.readUInt32LE(b+4);return e*=4294967296,d(e+c,9007199254740991),e+c}function f(a,b,c){return d(b,9007199254740991),a.writeInt32LE(b&-1,c),a.writeUInt32LE(Math.floor(b/4294967296),c+4),c+8}function g(a,b){var c=j.decode(a,b);return{number:c,size:j.decode.bytes}}function h(a,b,c){return j.encode(b,a,c),j.encode.bytes}var i=a("pushdata-bitcoin"),j=a("varuint-bitcoin");b.exports={pushDataSize:i.encodingLength,readPushDataInt:i.decode,readUInt64LE:e,readVarInt:g,varIntBuffer:j.encode,varIntSize:j.encodingLength,writePushDataInt:i.encode,writeUInt64LE:f,writeVarInt:h}},{"pushdata-bitcoin":292,"varuint-bitcoin":361}],38:[function(a,b,c){function d(a){return i("rmd160").update(a).digest()}function e(a){return i("sha1").update(a).digest()}function f(a){return i("sha256").update(a).digest()}function g(a){return d(f(a))}function h(a){return f(f(a))}var i=a("create-hash");b.exports={hash160:g,hash256:h,ripemd160:d,sha1:e,sha256:f}},{"create-hash":128}],39:[function(a,b,c){function d(a,b,c){h(i.tuple(i.Hash256bit,i.Buffer256bit,i.Function),arguments);var d=Buffer.alloc(32,0),e=Buffer.alloc(32,1);d=g("sha256",d).update(e).update(k).update(b).update(a).digest(),e=g("sha256",d).update(e).digest(),d=g("sha256",d).update(e).update(l).update(b).update(a).digest(),e=g("sha256",d).update(e).digest(),e=g("sha256",d).update(e).digest();for(var f=BigInteger.fromBuffer(e);f.signum()<=0||f.compareTo(n.n)>=0||!c(f);)d=g("sha256",d).update(e).update(k).digest(),e=g("sha256",d).update(e).digest(),e=g("sha256",d).update(e).digest(),f=BigInteger.fromBuffer(e);return f}function e(a,b){h(i.tuple(i.Hash256bit,i.BigInt),arguments);var c,e,f=b.toBuffer(32),g=BigInteger.fromBuffer(a),k=n.n,l=n.G;return d(a,f,function(a){var d=l.multiply(a);return!n.isInfinity(d)&&(c=d.affineX.mod(k),0!==c.signum()&&(e=a.modInverse(k).multiply(g.add(b.multiply(c))).mod(k),0!==e.signum()))}),e.compareTo(o)>0&&(e=k.subtract(e)),new j(c,e)}function f(a,b,c){h(i.tuple(i.Hash256bit,i.ECSignature,i.ECPoint),arguments);var d=n.n,e=n.G,f=b.r,g=b.s;if(f.signum()<=0||f.compareTo(d)>=0)return!1;if(g.signum()<=0||g.compareTo(d)>=0)return!1;var j=BigInteger.fromBuffer(a),k=g.modInverse(d),l=j.multiply(k).mod(d),m=f.multiply(k).mod(d),o=e.multiplyTwo(l,c,m);if(n.isInfinity(o))return!1;var p=o.affineX,q=p.mod(d);return q.equals(f)}var Buffer=a("safe-buffer").Buffer,g=a("create-hmac"),h=a("typeforce"),i=a("./types"),BigInteger=a("bigi"),j=a("./ecsignature"),k=Buffer.alloc(1,0),l=Buffer.alloc(1,1),m=a("ecurve"),n=m.getCurveByName("secp256k1"),o=n.n.shiftRight(1);b.exports={deterministicGenerateK:d,sign:e,verify:f,__curve:n}},{"./ecsignature":41,"./types":71,bigi:26,"create-hmac":131,ecurve:225,"safe-buffer":311,typeforce:352}],40:[function(a,b,c){function ECPair(a,b,c){if(c&&h({compressed:i.maybe(i.Boolean),network:i.maybe(i.Network)},c),c=c||{},a){if(a.signum()<=0)throw new Error("Private key must be greater than 0");if(a.compareTo(m.n)>=0)throw new Error("Private key must be less than the curve order");if(b)throw new TypeError("Unexpected publicKey parameter");this.d=a}else h(i.ECPoint,b),this.__Q=b;this.compressed=void 0===c.compressed||c.compressed,this.network=c.network||k.bitcoin}var d=a("./address"),e=a("./crypto"),f=a("./ecdsa"),g=a("randombytes"),h=a("typeforce"),i=a("./types"),j=a("wif"),k=a("./networks"),BigInteger=a("bigi"),l=a("ecurve"),m=f.__curve;Object.defineProperty(ECPair.prototype,"Q",{get:function(){return!this.__Q&&this.d&&(this.__Q=m.G.multiply(this.d)),this.__Q}}),ECPair.fromPublicKeyBuffer=function(a,b){var c=l.Point.decodeFrom(m,a);return new ECPair(null,c,{compressed:c.compressed,network:b})},ECPair.fromWIF=function(a,b){var c=j.decode(a),d=c.version;if(i.Array(b)){if(b=b.filter(function(a){return d===a.wif}).pop(),!b)throw new Error("Unknown network version")}else if(b=b||k.bitcoin,d!==b.wif)throw new Error("Invalid network version");var e=BigInteger.fromBuffer(c.privateKey);return new ECPair(e,null,{compressed:c.compressed,network:b})},ECPair.makeRandom=function(a){a=a||{};var b,c=a.rng||g;do{var d=c(32);h(i.Buffer256bit,d),b=BigInteger.fromBuffer(d)}while(b.signum()<=0||b.compareTo(m.n)>=0);return new ECPair(b,null,a)},ECPair.prototype.getAddress=function(){return d.toBase58Check(e.hash160(this.getPublicKeyBuffer()),this.getNetwork().pubKeyHash)},ECPair.prototype.getNetwork=function(){return this.network},ECPair.prototype.getPublicKeyBuffer=function(){return this.Q.getEncoded(this.compressed)},ECPair.prototype.sign=function(a){if(!this.d)throw new Error("Missing private key");return f.sign(a,this.d)},ECPair.prototype.toWIF=function(){if(!this.d)throw new Error("Missing private key");return j.encode(this.network.wif,this.d.toBuffer(32),this.compressed)},ECPair.prototype.verify=function(a,b){return f.verify(a,b,this.Q)},b.exports=ECPair},{"./address":35,"./crypto":38,"./ecdsa":39,"./networks":44,"./types":71,bigi:26,ecurve:225,randombytes:297,typeforce:352,wif:364}],41:[function(a,b,c){(function(Buffer){function c(a,b){e(f.tuple(f.BigInt,f.BigInt),arguments),this.r=a,this.s=b}var d=a("bip66"),e=a("typeforce"),f=a("./types"),BigInteger=a("bigi");c.parseCompact=function(a){if(65!==a.length)throw new Error("Invalid signature length");var b=a.readUInt8(0)-27;if(b!==(7&b))throw new Error("Invalid signature parameter");var d=!!(4&b),e=3&b,f=BigInteger.fromBuffer(a.slice(1,33)),g=BigInteger.fromBuffer(a.slice(33));return{compressed:d,i:e,signature:new c(f,g)}},c.fromDER=function(a){var b=d.decode(a),e=BigInteger.fromDERInteger(b.r),f=BigInteger.fromDERInteger(b.s);return new c(e,f)},c.parseScriptSignature=function(a){var b=a.readUInt8(a.length-1),d=b&-193;if(d<=0||d>=4)throw new Error("Invalid hashType "+b);return{signature:c.fromDER(a.slice(0,-1)),hashType:b}},c.prototype.toCompact=function(a,b){b&&(a+=4),a+=27;var c=Buffer.alloc(65);return c.writeUInt8(a,0),this.r.toBuffer(32).copy(c,1),this.s.toBuffer(32).copy(c,33),c},c.prototype.toDER=function(){var a=Buffer.from(this.r.toDERInteger()),b=Buffer.from(this.s.toDERInteger());return d.encode(a,b)},c.prototype.toScriptSignature=function(a){var b=a&-193;if(b<=0||b>=4)throw new Error("Invalid hashType "+a);var c=Buffer.alloc(1);return c.writeUInt8(a,0),Buffer.concat([this.toDER(),c])},b.exports=c}).call(this,a("buffer").Buffer)},{"./types":71,bigi:26,bip66:32,buffer:105,typeforce:352}],42:[function(a,b,c){function HDNode(a,b){if(g(h.tuple("ECPair",h.Buffer256bit),arguments),!a.compressed)throw new TypeError("BIP32 only allows compressed keyPairs");this.keyPair=a,this.chainCode=b,this.depth=0,this.index=0,this.parentFingerprint=0}var Buffer=a("safe-buffer").Buffer,d=a("bs58check"),e=a("./crypto"),f=a("create-hmac"),g=a("typeforce"),h=a("./types"),i=a("./networks"),BigInteger=a("bigi"),ECPair=a("./ecpair"),j=a("ecurve"),k=j.getCurveByName("secp256k1");HDNode.HIGHEST_BIT=2147483648,HDNode.LENGTH=78,HDNode.MASTER_SECRET=Buffer.from("Bitcoin seed","utf8"),HDNode.fromSeedBuffer=function(a,b){if(g(h.tuple(h.Buffer,h.maybe(h.Network)),arguments),a.length<16)throw new TypeError("Seed should be at least 128 bits");if(a.length>64)throw new TypeError("Seed should be at most 512 bits");var c=f("sha512",HDNode.MASTER_SECRET).update(a).digest(),d=c.slice(0,32),e=c.slice(32),i=BigInteger.fromBuffer(d),j=new ECPair(i,null,{network:b});return new HDNode(j,e)},HDNode.fromSeedHex=function(a,b){return HDNode.fromSeedBuffer(Buffer.from(a,"hex"),b)},HDNode.fromBase58=function(a,b){var c=d.decode(a);if(78!==c.length)throw new Error("Invalid buffer length");var e,f=c.readUInt32BE(0);if(Array.isArray(b)){if(e=b.filter(function(a){return f===a.bip32.private||f===a.bip32.public}).pop(),!e)throw new Error("Unknown network version")}else e=b||i.bitcoin;if(f!==e.bip32.private&&f!==e.bip32.public)throw new Error("Invalid network version");var g=c[4],h=c.readUInt32BE(5);if(0===g&&0!==h)throw new Error("Invalid parent fingerprint");var l=c.readUInt32BE(9);if(0===g&&0!==l)throw new Error("Invalid index");var m,n=c.slice(13,45);if(f===e.bip32.private){if(0!==c.readUInt8(45))throw new Error("Invalid private key");var o=BigInteger.fromBuffer(c.slice(46,78));m=new ECPair(o,null,{network:e})}else{var p=j.Point.decodeFrom(k,c.slice(45,78));k.validate(p),m=new ECPair(null,p,{network:e})}var q=new HDNode(m,n);return q.depth=g,q.index=l,q.parentFingerprint=h,q},HDNode.prototype.getAddress=function(){return this.keyPair.getAddress()},HDNode.prototype.getIdentifier=function(){return e.hash160(this.keyPair.getPublicKeyBuffer())},HDNode.prototype.getFingerprint=function(){return this.getIdentifier().slice(0,4)},HDNode.prototype.getNetwork=function(){return this.keyPair.getNetwork()},HDNode.prototype.getPublicKeyBuffer=function(){return this.keyPair.getPublicKeyBuffer()},HDNode.prototype.neutered=function(){var a=new ECPair(null,this.keyPair.Q,{network:this.keyPair.network}),b=new HDNode(a,this.chainCode);return b.depth=this.depth,b.index=this.index,b.parentFingerprint=this.parentFingerprint,b},HDNode.prototype.sign=function(a){return this.keyPair.sign(a)},HDNode.prototype.verify=function(a,b){return this.keyPair.verify(a,b)},HDNode.prototype.toBase58=function(a){if(void 0!==a)throw new TypeError("Unsupported argument in 2.0.0");var b=this.keyPair.network,c=this.isNeutered()?b.bip32.public:b.bip32.private,e=Buffer.allocUnsafe(78);return e.writeUInt32BE(c,0),e.writeUInt8(this.depth,4),e.writeUInt32BE(this.parentFingerprint,5),e.writeUInt32BE(this.index,9),this.chainCode.copy(e,13),this.isNeutered()?this.keyPair.getPublicKeyBuffer().copy(e,45):(e.writeUInt8(0,45),this.keyPair.d.toBuffer(32).copy(e,46)),d.encode(e)},HDNode.prototype.derive=function(a){g(h.UInt32,a);var b=a>=HDNode.HIGHEST_BIT,c=Buffer.allocUnsafe(37);if(b){if(this.isNeutered())throw new TypeError("Could not derive hardened child key");c[0]=0,this.keyPair.d.toBuffer(32).copy(c,1),c.writeUInt32BE(a,33)}else this.keyPair.getPublicKeyBuffer().copy(c,0),c.writeUInt32BE(a,33);var d=f("sha512",this.chainCode).update(c).digest(),e=d.slice(0,32),i=d.slice(32),j=BigInteger.fromBuffer(e);if(j.compareTo(k.n)>=0)return this.derive(a+1);var l;if(this.isNeutered()){var m=k.G.multiply(j).add(this.keyPair.Q);if(k.isInfinity(m))return this.derive(a+1);l=new ECPair(null,m,{network:this.keyPair.network})}else{var n=j.add(this.keyPair.d).mod(k.n);if(0===n.signum())return this.derive(a+1);l=new ECPair(n,null,{network:this.keyPair.network})}var o=new HDNode(l,i);return o.depth=this.depth+1,o.index=a,o.parentFingerprint=this.getFingerprint().readUInt32BE(0),o},HDNode.prototype.deriveHardened=function(a){return g(h.UInt31,a),this.derive(a+HDNode.HIGHEST_BIT)},HDNode.prototype.isNeutered=function(){return!this.keyPair.d},HDNode.prototype.derivePath=function(a){g(h.BIP32Path,a);var b=a.split("/");if("m"===b[0]){if(this.parentFingerprint)throw new Error("Not a master node");b=b.slice(1)}return b.reduce(function(a,b){var c;return"'"===b.slice(-1)?(c=parseInt(b.slice(0,-1),10),a.deriveHardened(c)):(c=parseInt(b,10),a.derive(c))},this)},b.exports=HDNode},{"./crypto":38,"./ecpair":40,"./networks":44,"./types":71,bigi:26,bs58check:101,"create-hmac":131,ecurve:225,"safe-buffer":311,typeforce:352}],43:[function(a,b,c){b.exports={Block:a("./block"),ECPair:a("./ecpair"),ECSignature:a("./ecsignature"),HDNode:a("./hdnode"),Transaction:a("./transaction"),TransactionBuilder:a("./transaction_builder"),address:a("./address"),bufferutils:a("./bufferutils"),crypto:a("./crypto"),networks:a("./networks"),opcodes:a("bitcoin-ops"),script:a("./script")}},{"./address":35,"./block":36,"./bufferutils":37,"./crypto":38,"./ecpair":40,"./ecsignature":41,"./hdnode":42,"./networks":44,"./script":45,"./transaction":69,"./transaction_builder":70,"bitcoin-ops":33}],44:[function(a,b,c){b.exports={bitcoincash:{messagePrefix:"Bitcoin Signed Message:\n",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},bitcoincashtestnet:{messagePrefix:"Bitcoin Signed Message:\n",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239},bitcoin:{messagePrefix:"Bitcoin Signed Message:\n",bech32:"bc",bip32:{public:76067358,private:76066276},pubKeyHash:0,scriptHash:5,wif:128},testnet:{messagePrefix:"Bitcoin Signed Message:\n",bech32:"tb",bip32:{public:70617039,private:70615956},pubKeyHash:111,scriptHash:196,wif:239},litecoin:{messagePrefix:"Litecoin Signed Message:\n",bip32:{public:27108450,private:27106558},pubKeyHash:48,scriptHash:50,wif:176}}},{}],45:[function(a,b,c){function d(a){return s.Number(a)&&(a===u.OP_0||a>=u.OP_1&&a<=u.OP_16||a===u.OP_1NEGATE)}function e(a){return s.Buffer(a)||d(a)}function f(a){return s.Array(a)&&a.every(e)}function g(a){if(0===a.length)return u.OP_0;if(1===a.length)return a[0]>=1&&a[0]<=16?w+a[0]:129===a[0]?u.OP_1NEGATE:void 0}function h(a){if(Buffer.isBuffer(a))return a;r(s.Array,a);var b=a.reduce(function(a,b){return Buffer.isBuffer(b)?1===b.length&&void 0!==g(b)?a+1:a+q.encodingLength(b.length)+b.length:a+1},0),c=Buffer.allocUnsafe(b),d=0;if(a.forEach(function(a){if(Buffer.isBuffer(a)){var b=g(a);if(void 0!==b)return c.writeUInt8(b,d),void(d+=1);d+=q.encode(c,a.length,d),a.copy(c,d),d+=a.length}else c.writeUInt8(a,d),d+=1}),d!==c.length)throw new Error("Could not decode chunks");return c}function i(a){if(s.Array(a))return a;r(s.Buffer,a);for(var b=[],c=0;c<a.length;){var d=a[c];if(d>u.OP_0&&d<=u.OP_PUSHDATA4){var e=q.decode(a,c);if(null===e)return[];if(c+=e.size,c+e.number>a.length)return[];var f=a.slice(c,c+e.number);c+=e.number;var h=g(f);void 0!==h?b.push(h):b.push(f)}else b.push(d),c+=1}return b}function j(a){return Buffer.isBuffer(a)&&(a=i(a)),a.map(function(a){if(Buffer.isBuffer(a)){var b=g(a);if(void 0===b)return a.toString("hex");a=b}return v[a]}).join(" ")}function k(asm){return r(s.String,asm),h(asm.split(" ").map(function(a){return void 0!==u[a]?u[a]:(r(s.Hex,a),Buffer.from(a,"hex"))}))}function l(a){return a=i(a),r(f,a),a.map(function(a){return Buffer.isBuffer(a)?a:a===u.OP_0?Buffer.allocUnsafe(0):t.encode(a-w)})}function m(a){if(!Buffer.isBuffer(a))return!1;if(a.length<33)return!1;switch(a[0]){case 2:case 3:return 33===a.length;case 4:return 65===a.length}return!1}function n(a){var b=a&-193;return b>0&&b<4}function o(a){return!!Buffer.isBuffer(a)&&(!!n(a[a.length-1])&&p.check(a.slice(0,-1)))}var Buffer=a("safe-buffer").Buffer,p=a("bip66"),q=a("pushdata-bitcoin"),r=a("typeforce"),s=a("./types"),t=a("./script_number"),u=a("bitcoin-ops"),v=a("bitcoin-ops/map"),w=u.OP_RESERVED;b.exports={compile:h,decompile:i,fromASM:k,toASM:j,toStack:l,number:a("./script_number"),isCanonicalPubKey:m,isCanonicalSignature:o,isPushOnly:f,isDefinedHashType:n};var x=a("./templates");for(var y in x)b.exports[y]=x[y]},{"./script_number":46,"./templates":47,"./types":71,bip66:32,"bitcoin-ops":33,"bitcoin-ops/map":34,"pushdata-bitcoin":292,"safe-buffer":311,typeforce:352}],46:[function(a,b,c){function d(a,b,c){b=b||4,c=void 0===c||c;var d=a.length;if(0===d)return 0;if(d>b)throw new TypeError("Script number overflow");if(c&&0===(127&a[d-1])&&(d<=1||0===(128&a[d-2])))throw new Error("Non-minimally encoded script number");if(5===d){var e=a.readUInt32LE(0),f=a.readUInt8(4);return 128&f?-(4294967296*(f&-129)+e):4294967296*f+e}for(var g=0,h=0;h<d;++h)g|=a[h]<<8*h;return 128&a[d-1]?-(g&~(128<<8*(d-1))):g}function e(a){return a>2147483647?5:a>8388607?4:a>32767?3:a>127?2:a>0?1:0}function f(a){for(var b=Math.abs(a),c=e(b),d=Buffer.allocUnsafe(c),f=a<0,g=0;g<c;++g)d.writeUInt8(255&b,g),b>>=8;return 128&d[c-1]?d.writeUInt8(f?128:0,c-1):f&&(d[c-1]|=128),d}var Buffer=a("safe-buffer").Buffer;b.exports={decode:d,encode:f}},{"safe-buffer":311}],47:[function(a,b,c){function d(a){if(m.output.check(a))return p.P2WPKH;if(n.output.check(a))return p.P2WSH;if(k.output.check(a))return p.P2PKH;if(l.output.check(a))return p.P2SH;var b=g(a);return h.output.check(b)?p.MULTISIG:j.output.check(b)?p.P2PK:o.output.check(b)?p.WITNESS_COMMITMENT:i.output.check(b)?p.NULLDATA:p.NONSTANDARD}function e(a,b){var c=g(a);return k.input.check(c)?p.P2PKH:h.input.check(c,b)?p.MULTISIG:l.input.check(c,b)?p.P2SH:j.input.check(c)?p.P2PK:p.NONSTANDARD}function f(a,b){var c=g(a);return m.input.check(c)?p.P2WPKH:n.input.check(c,b)?p.P2WSH:p.NONSTANDARD}var g=a("../script").decompile,h=a("./multisig"),i=a("./nulldata"),j=a("./pubkey"),k=a("./pubkeyhash"),l=a("./scripthash"),m=a("./witnesspubkeyhash"),n=a("./witnessscripthash"),o=a("./witnesscommitment"),p={MULTISIG:"multisig",NONSTANDARD:"nonstandard",NULLDATA:"nulldata",P2PK:"pubkey",P2PKH:"pubkeyhash",P2SH:"scripthash",P2WPKH:"witnesspubkeyhash",P2WSH:"witnessscripthash",WITNESS_COMMITMENT:"witnesscommitment"};b.exports={classifyInput:e,classifyOutput:d,classifyWitness:f,multisig:h,nullData:i,pubKey:j,pubKeyHash:k,scriptHash:l,witnessPubKeyHash:m,witnessScriptHash:n,witnessCommitment:o,types:p}},{"../script":45,"./multisig":48,"./nulldata":51,"./pubkey":52,"./pubkeyhash":55,"./scripthash":58,"./witnesscommitment":61,"./witnesspubkeyhash":63,"./witnessscripthash":66}],48:[function(a,b,c){b.exports={input:a("./input"),output:a("./output")}},{"./input":49,"./output":50}],49:[function(a,b,c){function d(a){return a===l.OP_0||j.isCanonicalSignature(a)}function e(a,b){var c=j.decompile(a);return!(c.length<2)&&(c[0]===l.OP_0&&(b?c.slice(1).every(d):c.slice(1).every(j.isCanonicalSignature)))}function f(a,b){if(k([d],a),b){var c=j.multisig.output.decode(b);if(a.length<c.m)throw new TypeError("Not enough signatures provided");if(a.length>c.pubKeys.length)throw new TypeError("Too many signatures provided")}return[].concat(m,a.map(function(a){return a===l.OP_0?m:a}))}function g(a,b){return j.compile(f(a,b))}function h(a,b){return k(e,a,b),a.slice(1)}function i(a,b){var c=j.decompile(a);return h(c,b)}var Buffer=a("safe-buffer").Buffer,j=a("../../script"),k=a("typeforce"),l=a("bitcoin-ops");e.toJSON=function(){return"multisig input"};var m=Buffer.allocUnsafe(0);b.exports={check:e,decode:i,decodeStack:h,encode:g,encodeStack:f}},{"../../script":45,"bitcoin-ops":33,"safe-buffer":311,typeforce:352}],50:[function(a,b,c){function d(a,b){var c=g.decompile(a);if(c.length<4)return!1;if(c[c.length-1]!==j.OP_CHECKMULTISIG)return!1;if(!h.Number(c[0]))return!1;if(!h.Number(c[c.length-2]))return!1;var d=c[0]-k,e=c[c.length-2]-k;if(d<=0)return!1;if(e>16)return!1;if(d>e)return!1;if(e!==c.length-3)return!1;if(b)return!0;var f=c.slice(1,-2);return f.every(g.isCanonicalPubKey)}function e(a,b){i({m:h.Number,pubKeys:[g.isCanonicalPubKey]},{m:a,pubKeys:b});var c=b.length;if(c<a)throw new TypeError("Not enough pubKeys provided");return g.compile([].concat(k+a,b,k+c,j.OP_CHECKMULTISIG))}function f(a,b){var c=g.decompile(a);return i(d,c,b),{m:c[0]-k,pubKeys:c.slice(1,-2)}}var g=a("../../script"),h=a("../../types"),i=a("typeforce"),j=a("bitcoin-ops"),k=j.OP_RESERVED;d.toJSON=function(){return"multi-sig output"},b.exports={check:d,decode:f,encode:e}},{"../../script":45,"../../types":71,"bitcoin-ops":33,typeforce:352}],51:[function(a,b,c){function d(a){var b=g.compile(a);return b.length>1&&b[0]===j.OP_RETURN}function e(a){return i(h.Buffer,a),g.compile([j.OP_RETURN,a])}function f(a){return i(d,a),a.slice(2)}var g=a("../script"),h=a("../types"),i=a("typeforce"),j=a("bitcoin-ops");d.toJSON=function(){return"null data output"},b.exports={output:{check:d,decode:f,encode:e}}},{"../script":45,"../types":71,"bitcoin-ops":33,typeforce:352}],52:[function(a,b,c){arguments[4][48][0].apply(c,arguments)},{"./input":53,"./output":54,dup:48}],53:[function(a,b,c){function d(a){var b=i.decompile(a);return 1===b.length&&i.isCanonicalSignature(b[0])}function e(a){return j(i.isCanonicalSignature,a),[a]}function f(a){return i.compile(e(a))}function g(a){return j(d,a),a[0]}function h(a){var b=i.decompile(a);return g(b)}var i=a("../../script"),j=a("typeforce");d.toJSON=function(){return"pubKey input"},b.exports={check:d,decode:h,decodeStack:g,encode:f,encodeStack:e}},{"../../script":45,typeforce:352}],54:[function(a,b,c){function d(a){var b=g.decompile(a);return 2===b.length&&g.isCanonicalPubKey(b[0])&&b[1]===i.OP_CHECKSIG}function e(a){return h(g.isCanonicalPubKey,a),g.compile([a,i.OP_CHECKSIG])}function f(a){var b=g.decompile(a);return h(d,b),b[0]}var g=a("../../script"),h=a("typeforce"),i=a("bitcoin-ops");d.toJSON=function(){return"pubKey output"},b.exports={check:d,decode:f,encode:e}},{"../../script":45,"bitcoin-ops":33,typeforce:352}],55:[function(a,b,c){arguments[4][48][0].apply(c,arguments)},{"./input":56,"./output":57,dup:48}],56:[function(a,b,c){function d(a){var b=i.decompile(a);return 2===b.length&&i.isCanonicalSignature(b[0])&&i.isCanonicalPubKey(b[1])}function e(a,b){return j({signature:i.isCanonicalSignature,pubKey:i.isCanonicalPubKey},{signature:a,pubKey:b}),[a,b]}function f(a,b){return i.compile(e(a,b))}function g(a){return j(d,a),{signature:a[0],pubKey:a[1]}}function h(a){var b=i.decompile(a);return g(b)}var i=a("../../script"),j=a("typeforce");d.toJSON=function(){return"pubKeyHash input"},b.exports={check:d,decode:h,decodeStack:g,encode:f,encodeStack:e}},{"../../script":45,typeforce:352}],57:[function(a,b,c){function d(a){var b=g.compile(a);return 25===b.length&&b[0]===j.OP_DUP&&b[1]===j.OP_HASH160&&20===b[2]&&b[23]===j.OP_EQUALVERIFY&&b[24]===j.OP_CHECKSIG}function e(a){return i(h.Hash160bit,a),g.compile([j.OP_DUP,j.OP_HASH160,a,j.OP_EQUALVERIFY,j.OP_CHECKSIG])}function f(a){return i(d,a),a.slice(3,23)}var g=a("../../script"),h=a("../../types"),i=a("typeforce"),j=a("bitcoin-ops");d.toJSON=function(){return"pubKeyHash output"},b.exports={check:d,decode:f,encode:e}},{"../../script":45,"../../types":71,"bitcoin-ops":33,typeforce:352}],58:[function(a,b,c){arguments[4][48][0].apply(c,arguments)},{"./input":59,"./output":60,dup:48}],59:[function(a,b,c){function d(a,b){var c=i.decompile(a);if(c.length<1)return!1;var d=c[c.length-1];if(!Buffer.isBuffer(d))return!1;var e=i.decompile(i.compile(c.slice(0,-1))),f=i.decompile(d);if(0===f.length)return!1;if(!i.isPushOnly(e))return!1;var g=i.classifyInput(e,b),h=i.classifyOutput(f);return 1===c.length?h===i.types.P2WSH||h===i.types.P2WPKH:g===h}function e(a,b){var c=i.compile(b);return[].concat(a,c)}function f(a,b){var c=i.decompile(a);return i.compile(e(c,b))}function g(a){return j(d,a),{redeemScriptStack:a.slice(0,-1),redeemScript:a[a.length-1]}}function h(a){var b=i.decompile(a),c=g(b);return c.redeemScriptSig=i.compile(c.redeemScriptStack),delete c.redeemScriptStack,c}var Buffer=a("safe-buffer").Buffer,i=a("../../script"),j=a("typeforce");d.toJSON=function(){return"scriptHash input"},b.exports={check:d,decode:h,decodeStack:g,encode:f,encodeStack:e}},{"../../script":45,"safe-buffer":311,typeforce:352}],60:[function(a,b,c){function d(a){var b=g.compile(a);return 23===b.length&&b[0]===j.OP_HASH160&&20===b[1]&&b[22]===j.OP_EQUAL}function e(a){return i(h.Hash160bit,a),g.compile([j.OP_HASH160,a,j.OP_EQUAL])}function f(a){return i(d,a),a.slice(2,22)}var g=a("../../script"),h=a("../../types"),i=a("typeforce"),j=a("bitcoin-ops");d.toJSON=function(){return"scriptHash output"},b.exports={check:d,decode:f,encode:e}},{"../../script":45,"../../types":71,"bitcoin-ops":33,typeforce:352}],61:[function(a,b,c){b.exports={output:a("./output")}},{"./output":62}],62:[function(a,b,c){function d(a){var b=g.compile(a);return b.length>37&&b[0]===j.OP_RETURN&&36===b[1]&&b.slice(2,6).equals(k)}function e(a){i(h.Hash256bit,a);var b=Buffer.allocUnsafe(36);return k.copy(b,0),a.copy(b,4),g.compile([j.OP_RETURN,b])}function f(a){return i(d,a),g.decompile(a)[1].slice(4,36)}var Buffer=a("safe-buffer").Buffer,g=a("../../script"),h=a("../../types"),i=a("typeforce"),j=a("bitcoin-ops"),k=Buffer.from("aa21a9ed","hex");
7
d.toJSON=function(){return"Witness commitment output"},b.exports={check:d,decode:f,encode:e}},{"../../script":45,"../../types":71,"bitcoin-ops":33,"safe-buffer":311,typeforce:352}],63:[function(a,b,c){arguments[4][48][0].apply(c,arguments)},{"./input":64,"./output":65,dup:48}],64:[function(a,b,c){function d(a){return h.isCanonicalPubKey(a)&&33===a.length}function e(a){var b=h.decompile(a);return 2===b.length&&h.isCanonicalSignature(b[0])&&d(b[1])}function f(a,b){return i({signature:h.isCanonicalSignature,pubKey:d},{signature:a,pubKey:b}),[a,b]}function g(a){return i(e,a),{signature:a[0],pubKey:a[1]}}var h=a("../../script"),i=a("typeforce");e.toJSON=function(){return"witnessPubKeyHash input"},b.exports={check:e,decodeStack:g,encodeStack:f}},{"../../script":45,typeforce:352}],65:[function(a,b,c){function d(a){var b=g.compile(a);return 22===b.length&&b[0]===j.OP_0&&20===b[1]}function e(a){return i(h.Hash160bit,a),g.compile([j.OP_0,a])}function f(a){return i(d,a),a.slice(2)}var g=a("../../script"),h=a("../../types"),i=a("typeforce"),j=a("bitcoin-ops");d.toJSON=function(){return"Witness pubKeyHash output"},b.exports={check:d,decode:f,encode:e}},{"../../script":45,"../../types":71,"bitcoin-ops":33,typeforce:352}],66:[function(a,b,c){arguments[4][48][0].apply(c,arguments)},{"./input":67,"./output":68,dup:48}],67:[function(a,b,c){var d=a("../scripthash/input");b.exports={check:d.check,decodeStack:d.decodeStack,encodeStack:d.encodeStack}},{"../scripthash/input":59}],68:[function(a,b,c){function d(a){var b=g.compile(a);return 34===b.length&&b[0]===j.OP_0&&32===b[1]}function e(a){return i(h.Hash256bit,a),g.compile([j.OP_0,a])}function f(a){return i(d,a),a.slice(2)}var g=a("../../script"),h=a("../../types"),i=a("typeforce"),j=a("bitcoin-ops");d.toJSON=function(){return"Witness scriptHash output"},b.exports={check:d,decode:f,encode:e}},{"../../script":45,"../../types":71,"bitcoin-ops":33,typeforce:352}],69:[function(a,b,c){function d(a){var b=a.length;return n.encodingLength(b)+b}function e(a){var b=a.length;return n.encodingLength(b)+a.reduce(function(a,b){return a+d(b)},0)}function f(){this.version=1,this.locktime=0,this.ins=[],this.outs=[]}var Buffer=a("safe-buffer").Buffer,g=a("buffer-reverse"),h=a("./crypto"),i=a("./script"),j=a("./bufferutils"),k=a("bitcoin-ops"),l=a("typeforce"),m=a("./types"),n=a("varuint-bitcoin");f.DEFAULT_SEQUENCE=4294967295,f.SIGHASH_ALL=1,f.SIGHASH_NONE=2,f.SIGHASH_SINGLE=3,f.SIGHASH_ANYONECANPAY=128,f.SIGHASH_BITCOINCASHBIP143=64,f.ADVANCED_TRANSACTION_MARKER=0,f.ADVANCED_TRANSACTION_FLAG=1;var o=Buffer.allocUnsafe(0),p=[],q=Buffer.from("0000000000000000000000000000000000000000000000000000000000000000","hex"),r=Buffer.from("0000000000000000000000000000000000000000000000000000000000000001","hex"),s=Buffer.from("ffffffffffffffff","hex"),t={script:o,valueBuffer:s};f.fromBuffer=function(a,b){function c(b){return l+=b,a.slice(l-b,l)}function d(){var b=a.readUInt32LE(l);return l+=4,b}function e(){var b=a.readInt32LE(l);return l+=4,b}function g(){var b=j.readUInt64LE(a,l);return l+=8,b}function h(){var b=n.decode(a,l);return l+=n.decode.bytes,b}function i(){return c(h())}function k(){for(var a=h(),b=[],c=0;c<a;c++)b.push(i());return b}var l=0,m=new f;m.version=e();var o=a.readUInt8(l),q=a.readUInt8(l+1),r=!1;o===f.ADVANCED_TRANSACTION_MARKER&&q===f.ADVANCED_TRANSACTION_FLAG&&(l+=2,r=!0);for(var s=h(),t=0;t<s;++t)m.ins.push({hash:c(32),index:d(),script:i(),sequence:d(),witness:p});var u=h();for(t=0;t<u;++t)m.outs.push({value:g(),script:i()});if(r){for(t=0;t<s;++t)m.ins[t].witness=k();if(!m.hasWitnesses())throw new Error("Transaction has superfluous witness data")}if(m.locktime=d(),b)return m;if(l!==a.length)throw new Error("Transaction has unexpected data");return m},f.fromHex=function(a){return f.fromBuffer(Buffer.from(a,"hex"))},f.isCoinbaseHash=function(a){l(m.Hash256bit,a);for(var b=0;b<32;++b)if(0!==a[b])return!1;return!0},f.prototype.isCoinbase=function(){return 1===this.ins.length&&f.isCoinbaseHash(this.ins[0].hash)},f.prototype.addInput=function(a,b,c,d){return l(m.tuple(m.Hash256bit,m.UInt32,m.maybe(m.UInt32),m.maybe(m.Buffer)),arguments),m.Null(c)&&(c=f.DEFAULT_SEQUENCE),this.ins.push({hash:a,index:b,script:d||o,sequence:c,witness:p})-1},f.prototype.addOutput=function(a,b){return l(m.tuple(m.Buffer,m.Satoshi),arguments),this.outs.push({script:a,value:b})-1},f.prototype.hasWitnesses=function(){return this.ins.some(function(a){return 0!==a.witness.length})},f.prototype.weight=function(){var a=this.__byteLength(!1),b=this.__byteLength(!0);return 3*a+b},f.prototype.virtualSize=function(){return Math.ceil(this.weight()/4)},f.prototype.byteLength=function(){return this.__byteLength(!0)},f.prototype.__byteLength=function(a){var b=a&&this.hasWitnesses();return(b?10:8)+n.encodingLength(this.ins.length)+n.encodingLength(this.outs.length)+this.ins.reduce(function(a,b){return a+40+d(b.script)},0)+this.outs.reduce(function(a,b){return a+8+d(b.script)},0)+(b?this.ins.reduce(function(a,b){return a+e(b.witness)},0):0)},f.prototype.clone=function(){var a=new f;return a.version=this.version,a.locktime=this.locktime,a.ins=this.ins.map(function(a){return{hash:a.hash,index:a.index,script:a.script,sequence:a.sequence,witness:a.witness}}),a.outs=this.outs.map(function(a){return{script:a.script,value:a.value}}),a},f.prototype.hashForSignature=function(a,b,c){if(l(m.tuple(m.UInt32,m.Buffer,m.Number),arguments),a>=this.ins.length)return r;var d=i.compile(i.decompile(b).filter(function(a){return a!==k.OP_CODESEPARATOR})),e=this.clone();if((31&c)===f.SIGHASH_NONE)e.outs=[],e.ins.forEach(function(b,c){c!==a&&(b.sequence=0)});else if((31&c)===f.SIGHASH_SINGLE){if(a>=this.outs.length)return r;e.outs.length=a+1;for(var g=0;g<a;g++)e.outs[g]=t;e.ins.forEach(function(b,c){c!==a&&(b.sequence=0)})}c&f.SIGHASH_ANYONECANPAY?(e.ins=[e.ins[a]],e.ins[0].script=d):(e.ins.forEach(function(a){a.script=o}),e.ins[a].script=d);var j=Buffer.allocUnsafe(e.__byteLength(!1)+4);return j.writeInt32LE(c,j.length-4),e.__toBuffer(j,0,!1),h.hash256(j)},f.prototype.hashForWitnessV0=function(a,b,c,e){function g(a){s+=a.copy(r,s)}function i(a){s=r.writeUInt32LE(a,s)}function k(a){s=j.writeUInt64LE(r,a,s)}function o(a){n.encode(a,r,s),s+=n.encode.bytes}function p(a){o(a.length),g(a)}l(m.tuple(m.UInt32,m.Buffer,m.Satoshi,m.UInt32),arguments);var r,s,t=q,u=q,v=q;if(e&f.SIGHASH_ANYONECANPAY||(r=Buffer.allocUnsafe(36*this.ins.length),s=0,this.ins.forEach(function(a){g(a.hash),i(a.index)}),u=h.hash256(r)),e&f.SIGHASH_ANYONECANPAY||(31&e)===f.SIGHASH_SINGLE||(31&e)===f.SIGHASH_NONE||(r=Buffer.allocUnsafe(4*this.ins.length),s=0,this.ins.forEach(function(a){i(a.sequence)}),v=h.hash256(r)),(31&e)!==f.SIGHASH_SINGLE&&(31&e)!==f.SIGHASH_NONE){var w=this.outs.reduce(function(a,b){return a+8+d(b.script)},0);r=Buffer.allocUnsafe(w),s=0,this.outs.forEach(function(a){k(a.value),p(a.script)}),t=h.hash256(r)}else if((31&e)===f.SIGHASH_SINGLE&&a<this.outs.length){var x=this.outs[a];r=Buffer.allocUnsafe(8+d(x.script)),s=0,k(x.value),p(x.script),t=h.hash256(r)}r=Buffer.allocUnsafe(156+d(b)),s=0;var y=this.ins[a];return i(this.version),g(u),g(v),g(y.hash),i(y.index),p(b),k(c),i(y.sequence),g(t),i(this.locktime),i(e),h.hash256(r)},f.prototype.hashForCashSignature=function(a,b,c,d){if(l(m.tuple(m.UInt32,m.Buffer,m.Number,m.maybe(m.UInt53)),arguments),d&f.SIGHASH_BITCOINCASHBIP143){if(m.Null(c))throw new Error("Bitcoin Cash sighash requires value of input to be signed.");return this.hashForWitnessV0(a,b,c,d)}return this.hashForSignature(a,b,d)},f.prototype.getHash=function(){return h.hash256(this.__toBuffer(void 0,void 0,!1))},f.prototype.getId=function(){return g(this.getHash()).toString("hex")},f.prototype.toBuffer=function(a,b){return this.__toBuffer(a,b,!0)},f.prototype.__toBuffer=function(a,b,c){function d(b){o+=b.copy(a,o)}function e(b){o=a.writeUInt8(b,o)}function g(b){o=a.writeUInt32LE(b,o)}function h(b){o=a.writeInt32LE(b,o)}function i(b){o=j.writeUInt64LE(a,b,o)}function k(b){n.encode(b,a,o),o+=n.encode.bytes}function l(a){k(a.length),d(a)}function m(a){k(a.length),a.forEach(l)}a||(a=Buffer.allocUnsafe(this.__byteLength(c)));var o=b||0;h(this.version);var p=c&&this.hasWitnesses();return p&&(e(f.ADVANCED_TRANSACTION_MARKER),e(f.ADVANCED_TRANSACTION_FLAG)),k(this.ins.length),this.ins.forEach(function(a){d(a.hash),g(a.index),l(a.script),g(a.sequence)}),k(this.outs.length),this.outs.forEach(function(a){a.valueBuffer?d(a.valueBuffer):i(a.value),l(a.script)}),p&&this.ins.forEach(function(a){m(a.witness)}),g(this.locktime),void 0!==b?a.slice(b,o):a},f.prototype.toHex=function(){return this.toBuffer().toString("hex")},f.prototype.setInputScript=function(a,b){l(m.tuple(m.Number,m.Buffer),arguments),this.ins[a].script=b},f.prototype.setWitness=function(a,b){l(m.tuple(m.Number,[m.Buffer]),arguments),this.ins[a].witness=b},b.exports=f},{"./bufferutils":37,"./crypto":38,"./script":45,"./types":71,"bitcoin-ops":33,"buffer-reverse":103,"safe-buffer":311,typeforce:352,"varuint-bitcoin":361}],70:[function(a,b,c){function d(a){return A.indexOf(a)!==-1}function e(a){return B.indexOf(a)!==-1}function f(a,b,c){var d=[],e=[];switch(a){case z.P2PKH:d=b.slice(1),e=b.slice(0,1);break;case z.P2PK:d[0]=c?u.pubKey.output.decode(c):void 0,e=b.slice(0,1);break;case z.MULTISIG:if(c){var f=u.multisig.output.decode(c);d=f.pubKeys}e=b.slice(1).map(function(a){return 0===a.length?void 0:a})}return{pubKeys:d,signatures:e}}function g(a,b){if(0===a.length&&0===b.length)return{};var c,g,h,i,j,k,l,m,n,o,p=!1,q=!1,r=!1,s=u.decompile(a),v=u.classifyInput(s,!0);v===z.P2SH&&(r=!0,j=s[s.length-1],m=u.classifyOutput(j),c=u.scriptHash.output.encode(t.hash160(j)),g=z.P2SH,i=j);var w=u.classifyWitness(b,!0);if(w===z.P2WSH){if(k=b[b.length-1],l=u.classifyOutput(k),q=!0,p=!0,0===a.length){if(c=u.witnessScriptHash.output.encode(t.sha256(k)),g=z.P2WSH,void 0!==j)throw new Error("Redeem script given when unnecessary")}else{if(!j)throw new Error("No redeemScript provided for P2WSH, but scriptSig non-empty");if(n=u.witnessScriptHash.output.encode(t.sha256(k)),!j.equals(n))throw new Error("Redeem script didn't match witnessScript")}if(!d(u.classifyOutput(k)))throw new Error("unsupported witness script");i=k,h=l,o=b.slice(0,-1)}else if(w===z.P2WPKH){p=!0;var x=b[b.length-1],y=t.hash160(x);if(0===a.length){if(c=u.witnessPubKeyHash.output.encode(y),g=z.P2WPKH,"undefined"!=typeof j)throw new Error("Redeem script given when unnecessary")}else{if(!j)throw new Error("No redeemScript provided for P2WPKH, but scriptSig wasn't empty");if(n=u.witnessPubKeyHash.output.encode(y),!j.equals(n))throw new Error("Redeem script did not have the right witness program")}h=z.P2PKH,o=b}else if(j){if(!e(m))throw new Error("Bad redeemscript!");i=j,h=m,o=s.slice(0,-1)}else g=h=u.classifyInput(a),o=s;var A=f(h,o,i),B={pubKeys:A.pubKeys,signatures:A.signatures,prevOutScript:c,prevOutType:g,signType:h,signScript:i,witness:Boolean(p)};return r&&(B.redeemScript=j,B.redeemScriptType=m),q&&(B.witnessScript=k,B.witnessScriptType=l),B}function h(a,b,c,d){if(a.signType===z.MULTISIG&&a.signScript&&a.pubKeys.length!==a.signatures.length){var e=a.signatures.concat();a.signatures=a.pubKeys.map(function(f){var g,h=ECPair.fromPublicKeyBuffer(f);return e.some(function(f,i){if(!f)return!1;var j,k=C.parseScriptSignature(f);return j=d?b.hashForCashSignature(c,a.signScript,a.value,k.hashType):a.witness?b.hashForWitnessV0(c,a.signScript,a.value,k.hashType):b.hashForSignature(c,a.signScript,k.hashType),!!h.verify(j,k.signature)&&(e[i]=void 0,g=f,!0)}),g})}}function i(a,b,c){x(y.Buffer,a);var d=u.decompile(a);b||(b=u.classifyOutput(a));var e=[];switch(b){case z.P2PKH:if(!c)break;var f=d[2],g=t.hash160(c);f.equals(g)&&(e=[c]);break;case z.P2WPKH:if(!c)break;var h=d[1],i=t.hash160(c);h.equals(i)&&(e=[c]);break;case z.P2PK:e=d.slice(0,1);break;case z.MULTISIG:e=d.slice(1,-2);break;default:return{scriptType:b}}return{pubKeys:e,scriptType:b,signatures:e.map(function(){})}}function j(a,b){if(a.prevOutType){if(a.prevOutType!==z.P2SH)throw new Error("PrevOutScript must be P2SH");var c=u.decompile(a.prevOutScript)[1];if(!c.equals(b))throw new Error("Inconsistent hash160(RedeemScript)")}}function k(a,b){if(a.prevOutType){if(a.prevOutType!==z.P2WSH)throw new Error("PrevOutScript must be P2WSH");var c=u.decompile(a.prevOutScript)[1];if(!c.equals(b))throw new Error("Inconsistent sha25(WitnessScript)")}}function l(a,b,c,d,e){var f,g,h,l,m,n,o,p,q,r=!1,s=!1,v=!1;if(c&&e){if(m=t.hash160(c),o=t.sha256(e),j(a,m),!c.equals(u.witnessScriptHash.output.encode(o)))throw new Error("Witness script inconsistent with redeem script");if(f=i(e,void 0,b),!f.pubKeys)throw new Error('WitnessScript not supported "'+u.toASM(c)+'"');g=u.types.P2SH,h=u.scriptHash.output.encode(m),r=s=v=!0,l=u.types.P2WSH,p=n=f.scriptType,q=e}else if(c){if(m=t.hash160(c),j(a,m),f=i(c,void 0,b),!f.pubKeys)throw new Error('RedeemScript not supported "'+u.toASM(c)+'"');g=u.types.P2SH,h=u.scriptHash.output.encode(m),r=!0,p=l=f.scriptType,q=c,s=p===u.types.P2WPKH}else if(e){if(o=t.sha256(e),k(a,o),f=i(e,void 0,b),!f.pubKeys)throw new Error('WitnessScript not supported "'+u.toASM(c)+'"');g=u.types.P2WSH,h=u.witnessScriptHash.output.encode(o),s=v=!0,p=n=f.scriptType,q=e}else if(a.prevOutType){if(a.prevOutType===z.P2SH||a.prevOutType===z.P2WSH)throw new Error("PrevOutScript is "+a.prevOutType+", requires redeemScript");if(g=a.prevOutType,h=a.prevOutScript,f=i(a.prevOutScript,a.prevOutType,b),!f.pubKeys)return;s=a.prevOutType===z.P2WPKH,p=g,q=h}else h=u.pubKeyHash.output.encode(t.hash160(b)),f=i(h,z.P2PKH,b),g=z.P2PKH,s=!1,p=g,q=h;if(void 0!==d||s){if(x(y.Satoshi,d),void 0!==a.value&&a.value!==d)throw new Error("Input didn't match witnessValue");a.value=d}p===z.P2WPKH&&(q=u.pubKeyHash.output.encode(u.witnessPubKeyHash.output.decode(q))),r&&(a.redeemScript=c,a.redeemScriptType=l),v&&(a.witnessScript=e,a.witnessScriptType=n),a.pubKeys=f.pubKeys,a.signatures=f.signatures,a.signScript=q,a.signType=p,a.prevOutScript=h,a.prevOutType=g,a.witness=s}function m(a,b,c,d){if(a===z.P2PKH){if(1===b.length&&Buffer.isBuffer(b[0])&&1===c.length)return u.pubKeyHash.input.encodeStack(b[0],c[0])}else if(a===z.P2PK){if(1===b.length&&Buffer.isBuffer(b[0]))return u.pubKey.input.encodeStack(b[0])}else{if(a!==z.MULTISIG)throw new Error("Not yet supported");if(b.length>0)return b=b.map(function(a){return a||w.OP_0}),d||(b=b.filter(function(a){return a!==w.OP_0})),u.multisig.input.encodeStack(b)}if(!d)throw new Error("Not enough signatures provided");return[]}function n(a,b){var c=a.prevOutType,f=[],g=[];d(c)&&(f=m(c,a.signatures,a.pubKeys,b));var h=!1;if(c===u.types.P2SH){if(!b&&!e(a.redeemScriptType))throw new Error("Impossible to sign this type");d(a.redeemScriptType)&&(f=m(a.redeemScriptType,a.signatures,a.pubKeys,b)),a.redeemScriptType&&(h=!0,c=a.redeemScriptType)}switch(c){case u.types.P2WPKH:g=m(u.types.P2PKH,a.signatures,a.pubKeys,b);break;case u.types.P2WSH:if(!b&&!d(a.witnessScriptType))throw new Error("Impossible to sign this type");d(a.witnessScriptType)&&(g=m(a.witnessScriptType,a.signatures,a.pubKeys,b),g.push(a.witnessScript),c=a.witnessScriptType)}return h&&f.push(a.redeemScript),{type:c,script:u.compile(f),witness:g}}function o(a,b){this.prevTxMap={},this.network=a||v.bitcoin,this.maximumFeeRate=b||1e3,this.inputs=[],this.bitcoinCash=!1,this.tx=new D}function p(a){return void 0!==a.prevOutScript&&void 0!==a.signScript&&void 0!==a.pubKeys&&void 0!==a.signatures&&a.signatures.length===a.pubKeys.length&&a.pubKeys.length>0&&void 0!==a.witness}function q(a){return a.readUInt8(a.length-1)}var Buffer=a("safe-buffer").Buffer,r=a("buffer-reverse"),s=a("./address"),t=a("./crypto"),u=a("./script"),v=a("./networks"),w=a("bitcoin-ops"),x=a("typeforce"),y=a("./types"),z=u.types,A=[u.types.P2PKH,u.types.P2PK,u.types.MULTISIG],B=A.concat([u.types.P2WPKH,u.types.P2WSH]),ECPair=a("./ecpair"),C=a("./ecsignature"),D=a("./transaction");o.prototype.enableBitcoinCash=function(a){"undefined"==typeof a&&(a=!0),this.bitcoinCash=a},o.prototype.setLockTime=function(a){if(x(y.UInt32,a),this.inputs.some(function(a){return!!a.signatures&&a.signatures.some(function(a){return a})}))throw new Error("No, this would invalidate signatures");this.tx.locktime=a},o.prototype.setVersion=function(a){x(y.UInt32,a),this.tx.version=a},o.fromTransaction=function(a,b,c){var d=new o(b);return d.enableBitcoinCash(Boolean(c)),d.setVersion(a.version),d.setLockTime(a.locktime),a.outs.forEach(function(a){d.addOutput(a.script,a.value)}),a.ins.forEach(function(a){d.__addInputUnsafe(a.hash,a.index,{sequence:a.sequence,script:a.script,value:a.value,witness:a.witness})}),d.inputs.forEach(function(b,d){h(b,a,d,c)}),d},o.prototype.addInput=function(a,b,c,d){if(!this.__canModifyInputs())throw new Error("No, this would invalidate signatures");var e;if("string"==typeof a)a=r(Buffer.from(a,"hex"));else if(a instanceof D){var f=a.outs[b];d=f.script,e=f.value,a=a.getHash()}return this.__addInputUnsafe(a,b,{sequence:c,prevOutScript:d,value:e})},o.prototype.__addInputUnsafe=function(a,b,c){if(D.isCoinbaseHash(a))throw new Error("coinbase inputs not supported");var d=a.toString("hex")+":"+b;if(void 0!==this.prevTxMap[d])throw new Error("Duplicate TxOut: "+d);var e={};if(void 0!==c.script&&(e=g(c.script,c.witness||[])),void 0!==c.value&&(e.value=c.value),!e.prevOutScript&&c.prevOutScript){var f;if(!e.pubKeys&&!e.signatures){var h=i(c.prevOutScript);h.pubKeys&&(e.pubKeys=h.pubKeys,e.signatures=h.signatures),f=h.scriptType}e.prevOutScript=c.prevOutScript,e.prevOutType=f||u.classifyOutput(c.prevOutScript)}var j=this.tx.addInput(a,b,c.sequence,c.scriptSig);return this.inputs[j]=e,this.prevTxMap[d]=j,j},o.prototype.addOutput=function(a,b){if(!this.__canModifyOutputs())throw new Error("No, this would invalidate signatures");return"string"==typeof a&&(a=s.toOutputScript(a,this.network)),this.tx.addOutput(a,b)},o.prototype.build=function(){return this.__build(!1)},o.prototype.buildIncomplete=function(){return this.__build(!0)},o.prototype.__build=function(a){if(!a){if(!this.tx.ins.length)throw new Error("Transaction has no inputs");if(!this.tx.outs.length)throw new Error("Transaction has no outputs")}var b=this.tx.clone();if(this.inputs.forEach(function(c,e){var f=c.witnessScriptType||c.redeemScriptType||c.prevOutType;if(!f&&!a)throw new Error("Transaction is not complete");var g=n(c,a);if(!a&&!d(g.type)&&g.type!==u.types.P2WPKH)throw new Error(g.type+" not supported");b.setInputScript(e,g.script),b.setWitness(e,g.witness)}),!a&&this.__overMaximumFees(b.virtualSize()))throw new Error("Transaction has absurd fees");return b},o.prototype.sign=function(a,b,c,d,e,f){if(b.network!==this.network)throw new Error("Inconsistent network");if(!this.inputs[a])throw new Error("No input at index: "+a);d=d||D.SIGHASH_ALL;var g=this.inputs[a];if(void 0!==g.redeemScript&&c&&!g.redeemScript.equals(c))throw new Error("Inconsistent redeemScript");var h=b.getPublicKeyBuffer();if(!p(g)&&(l(g,h,c,e,f),!p(g)))throw Error(g.prevOutType+" not supported");var i;i=this.bitcoinCash?this.tx.hashForCashSignature(a,g.signScript,e,d):g.witness?this.tx.hashForWitnessV0(a,g.signScript,e,d):this.tx.hashForSignature(a,g.signScript,d);var j=g.pubKeys.some(function(a,c){if(!h.equals(a))return!1;if(g.signatures[c])throw new Error("Signature already exists");if(!b.compressed&&g.signType===z.P2WPKH)throw new Error("BIP143 rejects uncompressed public keys in P2WPKH or P2WSH");return g.signatures[c]=b.sign(i).toScriptSignature(d),!0});if(!j)throw new Error("Key pair cannot sign for this input")},o.prototype.__canModifyInputs=function(){return this.inputs.every(function(a){return void 0===a.signatures||a.signatures.every(function(a){if(!a)return!0;var b=q(a);return b&D.SIGHASH_ANYONECANPAY})})},o.prototype.__canModifyOutputs=function(){var a=this.tx.ins.length,b=this.tx.outs.length;return this.inputs.every(function(c){return void 0===c.signatures||c.signatures.every(function(c){if(!c)return!0;var d=q(c),e=31&d;return e===D.SIGHASH_NONE||(e===D.SIGHASH_SINGLE?a<=b:void 0)})})},o.prototype.__overMaximumFees=function(a){var b=this.inputs.reduce(function(a,b){return a+(b.value>>>0)},0),c=this.tx.outs.reduce(function(a,b){return a+b.value},0),d=b-c,e=d/a;return e>this.maximumFeeRate},b.exports=o},{"./address":35,"./crypto":38,"./ecpair":40,"./ecsignature":41,"./networks":44,"./script":45,"./transaction":69,"./types":71,"bitcoin-ops":33,"buffer-reverse":103,"safe-buffer":311,typeforce:352}],71:[function(a,b,c){function d(a){return g.UInt32(a)&&a<=h}function e(a){return g.String(a)&&a.match(/^(m\/)?(\d+'?\/)*\d+'?$/)}function f(a){return g.UInt53(a)&&a<=i}var g=a("typeforce"),h=Math.pow(2,31)-1;e.toJSON=function(){return"BIP32 derivation path"};var i=21e14,j=g.quacksLike("BigInteger"),k=g.quacksLike("Point"),l=g.compile({r:j,s:j}),m=g.compile({messagePrefix:g.oneOf(g.Buffer,g.String),bip32:{public:g.UInt32,private:g.UInt32},pubKeyHash:g.UInt8,scriptHash:g.UInt8,wif:g.UInt8}),n={BigInt:j,BIP32Path:e,Buffer256bit:g.BufferN(32),ECPoint:k,ECSignature:l,Hash160bit:g.BufferN(20),Hash256bit:g.BufferN(32),Network:m,Satoshi:f,UInt31:d};for(var o in g)n[o]=g[o];b.exports=n},{typeforce:352}],72:[function(a,b,c){(function(Buffer){function c(a){var b=l("sha256").update(a).digest();return l("sha256").update(b).digest()}function d(a){var b=l("sha256").update(a).digest();return l("ripemd160").update(b).digest()}function e(a,b,c){return c&&(b+=4),Buffer.concat([new Buffer([b+27]),a])}function f(a){if(65!==a.length)throw new Error("Invalid signature length");var b=a.readUInt8(0)-27;if(b>7)throw new Error("Invalid signature parameter");return{compressed:!!(4&b),recovery:3&b,signature:a.slice(1)}}function g(a,b){var d=n.encodingLength(a.length),e=new Buffer(b.length+d+a.length);return e.write(b,0),n.encode(a.length,e,b.length),e.write(a,b.length+d),c(e)}function h(a,b,c,d){var f=g(a,b),h=m.sign(f,c);return e(h.signature,h.recovery,d)}function i(a,b,c,e){Buffer.isBuffer(e)||(e=new Buffer(e,"base64"));var h=f(e),i=g(a,b),l=m.recover(i,h.signature,h.recovery,h.compressed),n=d(l),o=j.decode(c).slice(1);return k(n,o)}var j=a("bs58check"),k=a("buffer-equals"),l=a("create-hash"),m=a("secp256k1"),n=a("varuint-bitcoin");b.exports={magicHash:g,sign:h,verify:i}}).call(this,a("buffer").Buffer)},{bs58check:75,buffer:105,"buffer-equals":102,"create-hash":128,secp256k1:312,"varuint-bitcoin":361}],73:[function(a,b,c){b.exports=function(a){function b(b){if(0===b.length)return"";for(var c=[0],d=0;d<b.length;++d){for(var e=0,g=b[d];e<c.length;++e)g+=c[e]<<8,c[e]=g%f,g=g/f|0;for(;g>0;)c.push(g%f),g=g/f|0}for(var h="",i=0;0===b[i]&&i<b.length-1;++i)h+=a[0];for(var j=c.length-1;j>=0;--j)h+=a[c[j]];return h}function c(a){if(0===a.length)return[];for(var b=[0],c=0;c<a.length;c++){var d=e[a[c]];if(void 0===d)return;for(var h=0,i=d;h<b.length;++h)i+=b[h]*f,b[h]=255&i,i>>=8;for(;i>0;)b.push(255&i),i>>=8}for(var j=0;a[j]===g&&j<a.length-1;++j)b.push(0);return b.reverse()}function d(a){var b=c(a);if(b)return b;throw new Error("Non-base"+f+" character")}for(var e={},f=a.length,g=a.charAt(0),h=0;h<a.length;h++)e[a.charAt(h)]=h;return{encode:b,decodeUnsafe:c,decode:d}}},{}],74:[function(a,b,c){var d=a("base-x"),e="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";b.exports=d(e)},{"base-x":73}],75:[function(a,b,c){(function(Buffer){"use strict";function c(a){var b=i("sha256").update(a).digest();return i("sha256").update(b).digest()}function d(a){var b=c(a);return h.encode(Buffer.concat([a,b],a.length+4))}function e(a){var b=a.slice(0,-4),d=a.slice(-4),e=c(b);if(!(d[0]^e[0]|d[1]^e[1]|d[2]^e[2]|d[3]^e[3]))return b}function f(a){var b=h.decodeUnsafe(a);if(b){var c=new Buffer(b);return e(c)}}function g(a){var b=h.decode(a),c=new Buffer(b),d=e(c);if(!d)throw new Error("Invalid checksum");return d}var h=a("bs58"),i=a("create-hash");b.exports={encode:d,decode:g,decodeUnsafe:f,decodeRaw:f}}).call(this,a("buffer").Buffer)},{bs58:74,buffer:105,"create-hash":128}],76:[function(a,b,c){function d(a){this.rand=a}var e;if(b.exports=function(a){return e||(e=new d(null)),e.generate(a)},b.exports.Rand=d,d.prototype.generate=function(a){return this._rand(a)},d.prototype._rand=function(a){if(this.rand.getBytes)return this.rand.getBytes(a);for(var b=new Uint8Array(a),c=0;c<b.length;c++)b[c]=this.rand.getByte();return b},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?d.prototype._rand=function(a){var b=new Uint8Array(a);return self.crypto.getRandomValues(b),b}:self.msCrypto&&self.msCrypto.getRandomValues?d.prototype._rand=function(a){var b=new Uint8Array(a);return self.msCrypto.getRandomValues(b),b}:"object"==typeof window&&(d.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var f=a("crypto");if("function"!=typeof f.randomBytes)throw new Error("Not supported");d.prototype._rand=function(a){return f.randomBytes(a)}}catch(a){}},{crypto:77}],77:[function(a,b,c){},{}],78:[function(a,b,c){function d(a){Buffer.isBuffer(a)||(a=Buffer.from(a));for(var b=a.length/4|0,c=new Array(b),d=0;d<b;d++)c[d]=a.readUInt32BE(4*d);return c}function e(a){for(var b=0;b<a.length;a++)a[b]=0}function f(a,b,c,d,e){for(var f,g,h,i,j=c[0],k=c[1],l=c[2],m=c[3],n=a[0]^b[0],o=a[1]^b[1],p=a[2]^b[2],q=a[3]^b[3],r=4,s=1;s<e;s++)f=j[n>>>24]^k[o>>>16&255]^l[p>>>8&255]^m[255&q]^b[r++],g=j[o>>>24]^k[p>>>16&255]^l[q>>>8&255]^m[255&n]^b[r++],h=j[p>>>24]^k[q>>>16&255]^l[n>>>8&255]^m[255&o]^b[r++],i=j[q>>>24]^k[n>>>16&255]^l[o>>>8&255]^m[255&p]^b[r++],n=f,o=g,p=h,q=i;return f=(d[n>>>24]<<24|d[o>>>16&255]<<16|d[p>>>8&255]<<8|d[255&q])^b[r++],g=(d[o>>>24]<<24|d[p>>>16&255]<<16|d[q>>>8&255]<<8|d[255&n])^b[r++],h=(d[p>>>24]<<24|d[q>>>16&255]<<16|d[n>>>8&255]<<8|d[255&o])^b[r++],i=(d[q>>>24]<<24|d[n>>>16&255]<<16|d[o>>>8&255]<<8|d[255&p])^b[r++],f>>>=0,g>>>=0,h>>>=0,i>>>=0,[f,g,h,i]}function g(a){this._key=d(a),this._reset()}var Buffer=a("safe-buffer").Buffer,h=[0,1,2,4,8,16,32,64,128,27,54],i=function(){for(var a=new Array(256),b=0;b<256;b++)b<128?a[b]=b<<1:a[b]=b<<1^283;for(var c=[],d=[],e=[[],[],[],[]],f=[[],[],[],[]],g=0,h=0,i=0;i<256;++i){var j=h^h<<1^h<<2^h<<3^h<<4;j=j>>>8^255&j^99,c[g]=j,d[j]=g;var k=a[g],l=a[k],m=a[l],n=257*a[j]^16843008*j;e[0][g]=n<<24|n>>>8,e[1][g]=n<<16|n>>>16,e[2][g]=n<<8|n>>>24,e[3][g]=n,n=16843009*m^65537*l^257*k^16843008*g,f[0][j]=n<<24|n>>>8,f[1][j]=n<<16|n>>>16,f[2][j]=n<<8|n>>>24,f[3][j]=n,0===g?g=h=1:(g=k^a[a[a[m^k]]],h^=a[a[h]])}return{SBOX:c,INV_SBOX:d,SUB_MIX:e,INV_SUB_MIX:f}}();g.blockSize=16,g.keySize=32,g.prototype.blockSize=g.blockSize,g.prototype.keySize=g.keySize,g.prototype._reset=function(){for(var a=this._key,b=a.length,c=b+6,d=4*(c+1),e=[],f=0;f<b;f++)e[f]=a[f];for(f=b;f<d;f++){var g=e[f-1];f%b===0?(g=g<<8|g>>>24,g=i.SBOX[g>>>24]<<24|i.SBOX[g>>>16&255]<<16|i.SBOX[g>>>8&255]<<8|i.SBOX[255&g],g^=h[f/b|0]<<24):b>6&&f%b===4&&(g=i.SBOX[g>>>24]<<24|i.SBOX[g>>>16&255]<<16|i.SBOX[g>>>8&255]<<8|i.SBOX[255&g]),e[f]=e[f-b]^g}for(var j=[],k=0;k<d;k++){var l=d-k,m=e[l-(k%4?0:4)];k<4||l<=4?j[k]=m:j[k]=i.INV_SUB_MIX[0][i.SBOX[m>>>24]]^i.INV_SUB_MIX[1][i.SBOX[m>>>16&255]]^i.INV_SUB_MIX[2][i.SBOX[m>>>8&255]]^i.INV_SUB_MIX[3][i.SBOX[255&m]]}this._nRounds=c,this._keySchedule=e,this._invKeySchedule=j},g.prototype.encryptBlockRaw=function(a){return a=d(a),f(a,this._keySchedule,i.SUB_MIX,i.SBOX,this._nRounds)},g.prototype.encryptBlock=function(a){var b=this.encryptBlockRaw(a),c=Buffer.allocUnsafe(16);return c.writeUInt32BE(b[0],0),c.writeUInt32BE(b[1],4),c.writeUInt32BE(b[2],8),c.writeUInt32BE(b[3],12),c},g.prototype.decryptBlock=function(a){a=d(a);var b=a[1];a[1]=a[3],a[3]=b;var c=f(a,this._invKeySchedule,i.INV_SUB_MIX,i.INV_SBOX,this._nRounds),e=Buffer.allocUnsafe(16);return e.writeUInt32BE(c[0],0),e.writeUInt32BE(c[3],4),e.writeUInt32BE(c[2],8),e.writeUInt32BE(c[1],12),e},g.prototype.scrub=function(){e(this._keySchedule),e(this._invKeySchedule),e(this._key)},b.exports.AES=g},{"safe-buffer":311}],79:[function(a,b,c){function d(a,b){var c=0;a.length!==b.length&&c++;for(var d=Math.min(a.length,b.length),e=0;e<d;++e)c+=a[e]^b[e];return c}function e(a,b,c){if(12===b.length)return a._finID=Buffer.concat([b,Buffer.from([0,0,0,1])]),Buffer.concat([b,Buffer.from([0,0,0,2])]);var d=new j(c),e=b.length,f=e%16;d.update(b),f&&(f=16-f,d.update(Buffer.alloc(f,0))),d.update(Buffer.alloc(8,0));var g=8*e,h=Buffer.alloc(8);h.writeUIntBE(g,0,8),d.update(h),a._finID=d.state;var i=Buffer.from(a._finID);return l(i),i}function f(a,b,c,d){h.call(this);var f=Buffer.alloc(4,0);this._cipher=new g.AES(b);var i=this._cipher.encryptBlock(f);this._ghash=new j(i),c=e(this,c,i),this._prev=Buffer.from(c),this._cache=Buffer.allocUnsafe(0),this._secCache=Buffer.allocUnsafe(0),this._decrypt=d,this._alen=0,this._len=0,this._mode=a,this._authTag=null,this._called=!1}var g=a("./aes"),Buffer=a("safe-buffer").Buffer,h=a("cipher-base"),i=a("inherits"),j=a("./ghash"),k=a("buffer-xor"),l=a("./incr32");i(f,h),f.prototype._update=function(a){if(!this._called&&this._alen){var b=16-this._alen%16;b<16&&(b=Buffer.alloc(b,0),this._ghash.update(b))}this._called=!0;var c=this._mode.encrypt(this,a);return this._decrypt?this._ghash.update(a):this._ghash.update(c),this._len+=a.length,c},f.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var a=k(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&d(a,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=a,this._cipher.scrub()},f.prototype.getAuthTag=function(){if(this._decrypt||!Buffer.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},f.prototype.setAuthTag=function(a){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=a},f.prototype.setAAD=function(a){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(a),this._alen+=a.length},b.exports=f},{"./aes":78,"./ghash":83,"./incr32":84,"buffer-xor":104,"cipher-base":107,inherits:246,"safe-buffer":311}],80:[function(a,b,c){function d(){return Object.keys(g)}var e=a("./encrypter"),f=a("./decrypter"),g=a("./modes/list.json");c.createCipher=c.Cipher=e.createCipher,c.createCipheriv=c.Cipheriv=e.createCipheriv,c.createDecipher=c.Decipher=f.createDecipher,c.createDecipheriv=c.Decipheriv=f.createDecipheriv,c.listCiphers=c.getCiphers=d},{"./decrypter":81,"./encrypter":82,"./modes/list.json":92}],81:[function(a,b,c){function d(a,b,c){l.call(this),this._cache=new e,this._last=void 0,this._cipher=new m.AES(b),this._prev=Buffer.from(c),this._mode=a,this._autopadding=!0}function e(){this.cache=Buffer.allocUnsafe(0)}function f(a){for(var b=a[15],c=-1;++c<b;)if(a[c+(16-b)]!==b)throw new Error("unable to decrypt data");if(16!==b)return a.slice(0,16-b)}function g(a,b,c){var e=j[a.toLowerCase()];if(!e)throw new TypeError("invalid suite type");if("string"==typeof c&&(c=Buffer.from(c)),"GCM"!==e.mode&&c.length!==e.iv)throw new TypeError("invalid iv length "+c.length);if("string"==typeof b&&(b=Buffer.from(b)),b.length!==e.key/8)throw new TypeError("invalid key length "+b.length);return"stream"===e.type?new k(e.module,b,c,!0):"auth"===e.type?new i(e.module,b,c,!0):new d(e.module,b,c)}function h(a,b){var c=j[a.toLowerCase()];if(!c)throw new TypeError("invalid suite type");var d=n(b,!1,c.key,c.iv);return g(a,d.key,d.iv)}var i=a("./authCipher"),Buffer=a("safe-buffer").Buffer,j=a("./modes"),k=a("./streamCipher"),l=a("cipher-base"),m=a("./aes"),n=a("evp_bytestokey"),o=a("inherits");o(d,l),d.prototype._update=function(a){this._cache.add(a);for(var b,c,d=[];b=this._cache.get(this._autopadding);)c=this._mode.decrypt(this,b),d.push(c);return Buffer.concat(d)},d.prototype._final=function(){var a=this._cache.flush();if(this._autopadding)return f(this._mode.decrypt(this,a));if(a)throw new Error("data not multiple of block length")},d.prototype.setAutoPadding=function(a){return this._autopadding=!!a,this},e.prototype.add=function(a){this.cache=Buffer.concat([this.cache,a]);
8
},e.prototype.get=function(a){var b;if(a){if(this.cache.length>16)return b=this.cache.slice(0,16),this.cache=this.cache.slice(16),b}else if(this.cache.length>=16)return b=this.cache.slice(0,16),this.cache=this.cache.slice(16),b;return null},e.prototype.flush=function(){if(this.cache.length)return this.cache},c.createDecipher=h,c.createDecipheriv=g},{"./aes":78,"./authCipher":79,"./modes":91,"./streamCipher":94,"cipher-base":107,evp_bytestokey:229,inherits:246,"safe-buffer":311}],82:[function(a,b,c){function d(a,b,c){k.call(this),this._cache=new e,this._cipher=new l.AES(b),this._prev=Buffer.from(c),this._mode=a,this._autopadding=!0}function e(){this.cache=Buffer.allocUnsafe(0)}function f(a,b,c){var e=h[a.toLowerCase()];if(!e)throw new TypeError("invalid suite type");if("string"==typeof b&&(b=Buffer.from(b)),b.length!==e.key/8)throw new TypeError("invalid key length "+b.length);if("string"==typeof c&&(c=Buffer.from(c)),"GCM"!==e.mode&&c.length!==e.iv)throw new TypeError("invalid iv length "+c.length);return"stream"===e.type?new j(e.module,b,c):"auth"===e.type?new i(e.module,b,c):new d(e.module,b,c)}function g(a,b){var c=h[a.toLowerCase()];if(!c)throw new TypeError("invalid suite type");var d=m(b,!1,c.key,c.iv);return f(a,d.key,d.iv)}var h=a("./modes"),i=a("./authCipher"),Buffer=a("safe-buffer").Buffer,j=a("./streamCipher"),k=a("cipher-base"),l=a("./aes"),m=a("evp_bytestokey"),n=a("inherits");n(d,k),d.prototype._update=function(a){this._cache.add(a);for(var b,c,d=[];b=this._cache.get();)c=this._mode.encrypt(this,b),d.push(c);return Buffer.concat(d)};var o=Buffer.alloc(16,16);d.prototype._final=function(){var a=this._cache.flush();if(this._autopadding)return a=this._mode.encrypt(this,a),this._cipher.scrub(),a;if(!a.equals(o))throw this._cipher.scrub(),new Error("data not multiple of block length")},d.prototype.setAutoPadding=function(a){return this._autopadding=!!a,this},e.prototype.add=function(a){this.cache=Buffer.concat([this.cache,a])},e.prototype.get=function(){if(this.cache.length>15){var a=this.cache.slice(0,16);return this.cache=this.cache.slice(16),a}return null},e.prototype.flush=function(){for(var a=16-this.cache.length,b=Buffer.allocUnsafe(a),c=-1;++c<a;)b.writeUInt8(a,c);return Buffer.concat([this.cache,b])},c.createCipheriv=f,c.createCipher=g},{"./aes":78,"./authCipher":79,"./modes":91,"./streamCipher":94,"cipher-base":107,evp_bytestokey:229,inherits:246,"safe-buffer":311}],83:[function(a,b,c){function d(a){return[a.readUInt32BE(0),a.readUInt32BE(4),a.readUInt32BE(8),a.readUInt32BE(12)]}function e(a){var b=Buffer.allocUnsafe(16);return b.writeUInt32BE(a[0]>>>0,0),b.writeUInt32BE(a[1]>>>0,4),b.writeUInt32BE(a[2]>>>0,8),b.writeUInt32BE(a[3]>>>0,12),b}function f(a){this.h=a,this.state=Buffer.alloc(16,0),this.cache=Buffer.allocUnsafe(0)}var Buffer=a("safe-buffer").Buffer,g=Buffer.alloc(16,0);f.prototype.ghash=function(a){for(var b=-1;++b<a.length;)this.state[b]^=a[b];this._multiply()},f.prototype._multiply=function(){for(var a,b,c,f=d(this.h),g=[0,0,0,0],h=-1;++h<128;){for(b=0!==(this.state[~~(h/8)]&1<<7-h%8),b&&(g[0]^=f[0],g[1]^=f[1],g[2]^=f[2],g[3]^=f[3]),c=0!==(1&f[3]),a=3;a>0;a--)f[a]=f[a]>>>1|(1&f[a-1])<<31;f[0]=f[0]>>>1,c&&(f[0]=f[0]^225<<24)}this.state=e(g)},f.prototype.update=function(a){this.cache=Buffer.concat([this.cache,a]);for(var b;this.cache.length>=16;)b=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(b)},f.prototype.final=function(a,b){return this.cache.length&&this.ghash(Buffer.concat([this.cache,g],16)),this.ghash(e([0,a,0,b])),this.state},b.exports=f},{"safe-buffer":311}],84:[function(a,b,c){function d(a){for(var b,c=a.length;c--;){if(b=a.readUInt8(c),255!==b){b++,a.writeUInt8(b,c);break}a.writeUInt8(0,c)}}b.exports=d},{}],85:[function(a,b,c){var d=a("buffer-xor");c.encrypt=function(a,b){var c=d(b,a._prev);return a._prev=a._cipher.encryptBlock(c),a._prev},c.decrypt=function(a,b){var c=a._prev;a._prev=b;var e=a._cipher.decryptBlock(b);return d(e,c)}},{"buffer-xor":104}],86:[function(a,b,c){function d(a,b,c){var d=b.length,f=e(b,a._cache);return a._cache=a._cache.slice(d),a._prev=Buffer.concat([a._prev,c?b:f]),f}var Buffer=a("safe-buffer").Buffer,e=a("buffer-xor");c.encrypt=function(a,b,c){for(var e,f=Buffer.allocUnsafe(0);b.length;){if(0===a._cache.length&&(a._cache=a._cipher.encryptBlock(a._prev),a._prev=Buffer.allocUnsafe(0)),!(a._cache.length<=b.length)){f=Buffer.concat([f,d(a,b,c)]);break}e=a._cache.length,f=Buffer.concat([f,d(a,b.slice(0,e),c)]),b=b.slice(e)}return f}},{"buffer-xor":104,"safe-buffer":311}],87:[function(a,b,c){function d(a,b,c){for(var d,f,g,h=-1,i=8,j=0;++h<i;)d=a._cipher.encryptBlock(a._prev),f=b&1<<7-h?128:0,g=d[0]^f,j+=(128&g)>>h%8,a._prev=e(a._prev,c?f:g);return j}function e(a,b){var c=a.length,d=-1,e=Buffer.allocUnsafe(a.length);for(a=Buffer.concat([a,Buffer.from([b])]);++d<c;)e[d]=a[d]<<1|a[d+1]>>7;return e}var Buffer=a("safe-buffer").Buffer;c.encrypt=function(a,b,c){for(var e=b.length,f=Buffer.allocUnsafe(e),g=-1;++g<e;)f[g]=d(a,b[g],c);return f}},{"safe-buffer":311}],88:[function(a,b,c){function d(a,b,c){var d=a._cipher.encryptBlock(a._prev),e=d[0]^b;return a._prev=Buffer.concat([a._prev.slice(1),Buffer.from([c?b:e])]),e}var Buffer=a("safe-buffer").Buffer;c.encrypt=function(a,b,c){for(var e=b.length,f=Buffer.allocUnsafe(e),g=-1;++g<e;)f[g]=d(a,b[g],c);return f}},{"safe-buffer":311}],89:[function(a,b,c){function d(a){var b=a._cipher.encryptBlockRaw(a._prev);return f(a._prev),b}var e=a("buffer-xor"),Buffer=a("safe-buffer").Buffer,f=a("../incr32"),g=16;c.encrypt=function(a,b){var c=Math.ceil(b.length/g),f=a._cache.length;a._cache=Buffer.concat([a._cache,Buffer.allocUnsafe(c*g)]);for(var h=0;h<c;h++){var i=d(a),j=f+h*g;a._cache.writeUInt32BE(i[0],j+0),a._cache.writeUInt32BE(i[1],j+4),a._cache.writeUInt32BE(i[2],j+8),a._cache.writeUInt32BE(i[3],j+12)}var k=a._cache.slice(0,b.length);return a._cache=a._cache.slice(b.length),e(b,k)}},{"../incr32":84,"buffer-xor":104,"safe-buffer":311}],90:[function(a,b,c){c.encrypt=function(a,b){return a._cipher.encryptBlock(b)},c.decrypt=function(a,b){return a._cipher.decryptBlock(b)}},{}],91:[function(a,b,c){var d={ECB:a("./ecb"),CBC:a("./cbc"),CFB:a("./cfb"),CFB8:a("./cfb8"),CFB1:a("./cfb1"),OFB:a("./ofb"),CTR:a("./ctr"),GCM:a("./ctr")},e=a("./list.json");for(var f in e)e[f].module=d[e[f].mode];b.exports=e},{"./cbc":85,"./cfb":86,"./cfb1":87,"./cfb8":88,"./ctr":89,"./ecb":90,"./list.json":92,"./ofb":93}],92:[function(a,b,c){b.exports={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192:{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256:{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}}},{}],93:[function(a,b,c){(function(Buffer){function b(a){return a._prev=a._cipher.encryptBlock(a._prev),a._prev}var d=a("buffer-xor");c.encrypt=function(a,c){for(;a._cache.length<c.length;)a._cache=Buffer.concat([a._cache,b(a)]);var e=a._cache.slice(0,c.length);return a._cache=a._cache.slice(c.length),d(c,e)}}).call(this,a("buffer").Buffer)},{buffer:105,"buffer-xor":104}],94:[function(a,b,c){function d(a,b,c,d){f.call(this),this._cipher=new e.AES(b),this._prev=Buffer.from(c),this._cache=Buffer.allocUnsafe(0),this._secCache=Buffer.allocUnsafe(0),this._decrypt=d,this._mode=a}var e=a("./aes"),Buffer=a("safe-buffer").Buffer,f=a("cipher-base"),g=a("inherits");g(d,f),d.prototype._update=function(a){return this._mode.encrypt(this,a,this._decrypt)},d.prototype._final=function(){this._cipher.scrub()},b.exports=d},{"./aes":78,"cipher-base":107,inherits:246,"safe-buffer":311}],95:[function(a,b,c){function d(a,b){var c,d;if(a=a.toLowerCase(),m[a])c=m[a].key,d=m[a].iv;else{if(!l[a])throw new TypeError("invalid suite type");c=8*l[a].key,d=l[a].iv}var e=i(b,!1,c,d);return f(a,e.key,e.iv)}function e(a,b){var c,d;if(a=a.toLowerCase(),m[a])c=m[a].key,d=m[a].iv;else{if(!l[a])throw new TypeError("invalid suite type");c=8*l[a].key,d=l[a].iv}var e=i(b,!1,c,d);return g(a,e.key,e.iv)}function f(a,b,c){if(a=a.toLowerCase(),m[a])return j.createCipheriv(a,b,c);if(l[a])return new k({key:b,iv:c,mode:a});throw new TypeError("invalid suite type")}function g(a,b,c){if(a=a.toLowerCase(),m[a])return j.createDecipheriv(a,b,c);if(l[a])return new k({key:b,iv:c,mode:a,decrypt:!0});throw new TypeError("invalid suite type")}function h(){return Object.keys(l).concat(j.getCiphers())}var i=a("evp_bytestokey"),j=a("browserify-aes/browser"),k=a("browserify-des"),l=a("browserify-des/modes"),m=a("browserify-aes/modes");c.createCipher=c.Cipher=d,c.createCipheriv=c.Cipheriv=f,c.createDecipher=c.Decipher=e,c.createDecipheriv=c.Decipheriv=g,c.listCiphers=c.getCiphers=h},{"browserify-aes/browser":80,"browserify-aes/modes":91,"browserify-des":96,"browserify-des/modes":97,evp_bytestokey:229}],96:[function(a,b,c){(function(Buffer){function c(a){d.call(this);var b,c=a.mode.toLowerCase(),e=g[c];b=a.decrypt?"decrypt":"encrypt";var f=a.key;"des-ede"!==c&&"des-ede-cbc"!==c||(f=Buffer.concat([f,f.slice(0,8)]));var h=a.iv;this._des=e.create({key:f,iv:h,type:b})}var d=a("cipher-base"),e=a("des.js"),f=a("inherits"),g={"des-ede3-cbc":e.CBC.instantiate(e.EDE),"des-ede3":e.EDE,"des-ede-cbc":e.CBC.instantiate(e.EDE),"des-ede":e.EDE,"des-cbc":e.CBC.instantiate(e.DES),"des-ecb":e.DES};g.des=g["des-cbc"],g.des3=g["des-ede3-cbc"],b.exports=c,f(c,d),c.prototype._update=function(a){return new Buffer(this._des.update(a))},c.prototype._final=function(){return new Buffer(this._des.final())}}).call(this,a("buffer").Buffer)},{buffer:105,"cipher-base":107,"des.js":212,inherits:246}],97:[function(a,b,c){c["des-ecb"]={key:8,iv:0},c["des-cbc"]=c.des={key:8,iv:8},c["des-ede3-cbc"]=c.des3={key:24,iv:8},c["des-ede3"]={key:24,iv:0},c["des-ede-cbc"]={key:16,iv:8},c["des-ede"]={key:16,iv:0}},{}],98:[function(a,b,c){"use strict";function d(a){if(!a)return"utf8";for(var b;;)switch(a){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return a;default:if(b)return;a=(""+a).toLowerCase(),b=!0}}function e(a){var b=d(a);if("string"!=typeof b&&(Buffer.isEncoding===s||!s(a)))throw new Error("Unknown encoding: "+a);return b||a}function f(a){this.encoding=e(a);var b;switch(this.encoding){case"utf16le":this.text=m,this.end=n,b=4;break;case"utf8":this.fillLast=j,b=4;break;case"base64":this.text=o,this.end=p,b=3;break;default:return this.write=q,void(this.end=r)}this.lastNeed=0,this.lastTotal=0,this.lastChar=Buffer.allocUnsafe(b)}function g(a){return a<=127?0:a>>5===6?2:a>>4===14?3:a>>3===30?4:-1}function h(a,b,c){var d=b.length-1;if(d<c)return 0;var e=g(b[d]);return e>=0?(e>0&&(a.lastNeed=e-1),e):--d<c?0:(e=g(b[d]),e>=0?(e>0&&(a.lastNeed=e-2),e):--d<c?0:(e=g(b[d]),e>=0?(e>0&&(2===e?e=0:a.lastNeed=e-3),e):0))}function i(a,b,c){if(128!==(192&b[0]))return a.lastNeed=0,"�".repeat(c);if(a.lastNeed>1&&b.length>1){if(128!==(192&b[1]))return a.lastNeed=1,"�".repeat(c+1);if(a.lastNeed>2&&b.length>2&&128!==(192&b[2]))return a.lastNeed=2,"�".repeat(c+2)}}function j(a){var b=this.lastTotal-this.lastNeed,c=i(this,a,b);return void 0!==c?c:this.lastNeed<=a.length?(a.copy(this.lastChar,b,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(a.copy(this.lastChar,b,0,a.length),void(this.lastNeed-=a.length))}function k(a,b){var c=h(this,a,b);if(!this.lastNeed)return a.toString("utf8",b);this.lastTotal=c;var d=a.length-(c-this.lastNeed);return a.copy(this.lastChar,0,d),a.toString("utf8",b,d)}function l(a){var b=a&&a.length?this.write(a):"";return this.lastNeed?b+"�".repeat(this.lastTotal-this.lastNeed):b}function m(a,b){if((a.length-b)%2===0){var c=a.toString("utf16le",b);if(c){var d=c.charCodeAt(c.length-1);if(d>=55296&&d<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=a[a.length-2],this.lastChar[1]=a[a.length-1],c.slice(0,-1)}return c}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=a[a.length-1],a.toString("utf16le",b,a.length-1)}function n(a){var b=a&&a.length?this.write(a):"";if(this.lastNeed){var c=this.lastTotal-this.lastNeed;return b+this.lastChar.toString("utf16le",0,c)}return b}function o(a,b){var c=(a.length-b)%3;return 0===c?a.toString("base64",b):(this.lastNeed=3-c,this.lastTotal=3,1===c?this.lastChar[0]=a[a.length-1]:(this.lastChar[0]=a[a.length-2],this.lastChar[1]=a[a.length-1]),a.toString("base64",b,a.length-c))}function p(a){var b=a&&a.length?this.write(a):"";return this.lastNeed?b+this.lastChar.toString("base64",0,3-this.lastNeed):b}function q(a){return a.toString(this.encoding)}function r(a){return a&&a.length?this.write(a):""}var Buffer=a("safe-buffer").Buffer,s=Buffer.isEncoding||function(a){switch(a=""+a,a&&a.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};c.StringDecoder=f,f.prototype.write=function(a){if(0===a.length)return"";var b,c;if(this.lastNeed){if(b=this.fillLast(a),void 0===b)return"";c=this.lastNeed,this.lastNeed=0}else c=0;return c<a.length?b?b+this.text(a,c):this.text(a,c):b||""},f.prototype.end=l,f.prototype.text=k,f.prototype.fillLast=function(a){return this.lastNeed<=a.length?(a.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(a.copy(this.lastChar,this.lastTotal-this.lastNeed,0,a.length),void(this.lastNeed-=a.length))}},{"safe-buffer":311}],99:[function(a,b,c){arguments[4][74][0].apply(c,arguments)},{"base-x":22,dup:74}],100:[function(a,b,c){(function(Buffer){"use strict";var c=a("bs58");b.exports=function(a){function b(b){var d=a(b);return c.encode(Buffer.concat([b,d],b.length+4))}function d(b){var c=b.slice(0,-4),d=b.slice(-4),e=a(c);if(!(d[0]^e[0]|d[1]^e[1]|d[2]^e[2]|d[3]^e[3]))return c}function e(a){var b=c.decodeUnsafe(a);if(b)return d(b)}function f(b){var e=c.decode(b),f=d(e,a);if(!f)throw new Error("Invalid checksum");return f}return{encode:b,decode:f,decodeUnsafe:e}}}).call(this,a("buffer").Buffer)},{bs58:99,buffer:105}],101:[function(a,b,c){"use strict";function d(a){var b=e("sha256").update(a).digest();return e("sha256").update(b).digest()}var e=a("create-hash"),f=a("./base");b.exports=f(d)},{"./base":100,"create-hash":128}],102:[function(a,b,c){(function(Buffer){"use strict";b.exports=function(a,b){if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return!0;if("function"==typeof a.equals)return a.equals(b);if(a.length!==b.length)return!1;for(var c=0;c<a.length;c++)if(a[c]!==b[c])return!1;return!0}}).call(this,{isBuffer:a("../is-buffer/index.js")})},{"../is-buffer/index.js":247}],103:[function(a,b,c){(function(Buffer){b.exports=function(a){for(var b=new Buffer(a.length),c=0,d=a.length-1;c<=d;++c,--d)b[c]=a[d],b[d]=a[c];return b}}).call(this,a("buffer").Buffer)},{buffer:105}],104:[function(a,b,c){(function(Buffer){b.exports=function(a,b){for(var c=Math.min(a.length,b.length),d=new Buffer(c),e=0;e<c;++e)d[e]=a[e]^b[e];return d}}).call(this,a("buffer").Buffer)},{buffer:105}],105:[function(a,b,c){"use strict";function d(){try{var a=new Uint8Array(1);return a.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===a.foo()}catch(a){return!1}}function e(a){if(a>Y)throw new RangeError("Invalid typed array length");var b=new Uint8Array(a);return b.__proto__=Buffer.prototype,b}function Buffer(a,b,c){if("number"==typeof a){if("string"==typeof b)throw new Error("If encoding is specified then the first argument must be a string");return i(a)}return f(a,b,c)}function f(a,b,c){if("number"==typeof a)throw new TypeError('"value" argument must not be a number');return T(a)?l(a,b,c):"string"==typeof a?j(a,b):m(a)}function g(a){if("number"!=typeof a)throw new TypeError('"size" argument must be a number');if(a<0)throw new RangeError('"size" argument must not be negative')}function h(a,b,c){return g(a),a<=0?e(a):void 0!==b?"string"==typeof c?e(a).fill(b,c):e(a).fill(b):e(a)}function i(a){return g(a),e(a<0?0:0|n(a))}function j(a,b){if("string"==typeof b&&""!==b||(b="utf8"),!Buffer.isEncoding(b))throw new TypeError('"encoding" must be a valid string encoding');var c=0|p(a,b),d=e(c),f=d.write(a,b);return f!==c&&(d=d.slice(0,f)),d}function k(a){for(var b=a.length<0?0:0|n(a.length),c=e(b),d=0;d<b;d+=1)c[d]=255&a[d];return c}function l(a,b,c){if(b<0||a.byteLength<b)throw new RangeError("'offset' is out of bounds");if(a.byteLength<b+(c||0))throw new RangeError("'length' is out of bounds");var d;return d=void 0===b&&void 0===c?new Uint8Array(a):void 0===c?new Uint8Array(a,b):new Uint8Array(a,b,c),d.__proto__=Buffer.prototype,d}function m(a){if(Buffer.isBuffer(a)){var b=0|n(a.length),c=e(b);return 0===c.length?c:(a.copy(c,0,0,b),c)}if(a){if(U(a)||"length"in a)return"number"!=typeof a.length||V(a.length)?e(0):k(a);if("Buffer"===a.type&&Array.isArray(a.data))return k(a.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function n(a){if(a>=Y)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Y.toString(16)+" bytes");return 0|a}function o(a){return+a!=a&&(a=0),Buffer.alloc(+a)}function p(a,b){if(Buffer.isBuffer(a))return a.length;if(U(a)||T(a))return a.byteLength;"string"!=typeof a&&(a=""+a);var c=a.length;if(0===c)return 0;for(var d=!1;;)switch(b){case"ascii":case"latin1":case"binary":return c;case"utf8":case"utf-8":case void 0:return O(a).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*c;case"hex":return c>>>1;case"base64":return R(a).length;default:if(d)return O(a).length;b=(""+b).toLowerCase(),d=!0}}function q(a,b,c){var d=!1;if((void 0===b||b<0)&&(b=0),b>this.length)return"";if((void 0===c||c>this.length)&&(c=this.length),c<=0)return"";if(c>>>=0,b>>>=0,c<=b)return"";for(a||(a="utf8");;)switch(a){case"hex":return F(this,b,c);case"utf8":case"utf-8":return B(this,b,c);case"ascii":return D(this,b,c);case"latin1":case"binary":return E(this,b,c);case"base64":return A(this,b,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return G(this,b,c);default:if(d)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase(),d=!0}}function r(a,b,c){var d=a[b];a[b]=a[c],a[c]=d}function s(a,b,c,d,e){if(0===a.length)return-1;if("string"==typeof c?(d=c,c=0):c>2147483647?c=2147483647:c<-2147483648&&(c=-2147483648),c=+c,V(c)&&(c=e?0:a.length-1),c<0&&(c=a.length+c),c>=a.length){if(e)return-1;c=a.length-1}else if(c<0){if(!e)return-1;c=0}if("string"==typeof b&&(b=Buffer.from(b,d)),Buffer.isBuffer(b))return 0===b.length?-1:t(a,b,c,d,e);if("number"==typeof b)return b&=255,"function"==typeof Uint8Array.prototype.indexOf?e?Uint8Array.prototype.indexOf.call(a,b,c):Uint8Array.prototype.lastIndexOf.call(a,b,c):t(a,[b],c,d,e);throw new TypeError("val must be string, number or Buffer")}function t(a,b,c,d,e){function f(a,b){return 1===g?a[b]:a.readUInt16BE(b*g)}var g=1,h=a.length,i=b.length;if(void 0!==d&&(d=String(d).toLowerCase(),"ucs2"===d||"ucs-2"===d||"utf16le"===d||"utf-16le"===d)){if(a.length<2||b.length<2)return-1;g=2,h/=2,i/=2,c/=2}var j;if(e){var k=-1;for(j=c;j<h;j++)if(f(a,j)===f(b,k===-1?0:j-k)){if(k===-1&&(k=j),j-k+1===i)return k*g}else k!==-1&&(j-=j-k),k=-1}else for(c+i>h&&(c=h-i),j=c;j>=0;j--){for(var l=!0,m=0;m<i;m++)if(f(a,j+m)!==f(b,m)){l=!1;break}if(l)return j}return-1}function u(a,b,c,d){c=Number(c)||0;var e=a.length-c;d?(d=Number(d),d>e&&(d=e)):d=e;var f=b.length;if(f%2!==0)throw new TypeError("Invalid hex string");d>f/2&&(d=f/2);for(var g=0;g<d;++g){var h=parseInt(b.substr(2*g,2),16);if(V(h))return g;a[c+g]=h}return g}function v(a,b,c,d){return S(O(b,a.length-c),a,c,d)}function w(a,b,c,d){return S(P(b),a,c,d)}function x(a,b,c,d){return w(a,b,c,d)}function y(a,b,c,d){return S(R(b),a,c,d)}function z(a,b,c,d){return S(Q(b,a.length-c),a,c,d)}function A(a,b,c){return 0===b&&c===a.length?W.fromByteArray(a):W.fromByteArray(a.slice(b,c))}function B(a,b,c){c=Math.min(a.length,c);for(var d=[],e=b;e<c;){var f=a[e],g=null,h=f>239?4:f>223?3:f>191?2:1;if(e+h<=c){var i,j,k,l;switch(h){case 1:f<128&&(g=f);break;case 2:i=a[e+1],128===(192&i)&&(l=(31&f)<<6|63&i,l>127&&(g=l));break;case 3:i=a[e+1],j=a[e+2],128===(192&i)&&128===(192&j)&&(l=(15&f)<<12|(63&i)<<6|63&j,l>2047&&(l<55296||l>57343)&&(g=l));break;case 4:i=a[e+1],j=a[e+2],k=a[e+3],128===(192&i)&&128===(192&j)&&128===(192&k)&&(l=(15&f)<<18|(63&i)<<12|(63&j)<<6|63&k,l>65535&&l<1114112&&(g=l))}}null===g?(g=65533,h=1):g>65535&&(g-=65536,d.push(g>>>10&1023|55296),g=56320|1023&g),d.push(g),e+=h}return C(d)}function C(a){var b=a.length;if(b<=Z)return String.fromCharCode.apply(String,a);for(var c="",d=0;d<b;)c+=String.fromCharCode.apply(String,a.slice(d,d+=Z));return c}function D(a,b,c){var d="";c=Math.min(a.length,c);for(var e=b;e<c;++e)d+=String.fromCharCode(127&a[e]);return d}function E(a,b,c){var d="";c=Math.min(a.length,c);for(var e=b;e<c;++e)d+=String.fromCharCode(a[e]);return d}function F(a,b,c){var d=a.length;(!b||b<0)&&(b=0),(!c||c<0||c>d)&&(c=d);for(var e="",f=b;f<c;++f)e+=N(a[f]);return e}function G(a,b,c){for(var d=a.slice(b,c),e="",f=0;f<d.length;f+=2)e+=String.fromCharCode(d[f]+256*d[f+1]);return e}function H(a,b,c){if(a%1!==0||a<0)throw new RangeError("offset is not uint");if(a+b>c)throw new RangeError("Trying to access beyond buffer length")}function I(a,b,c,d,e,f){if(!Buffer.isBuffer(a))throw new TypeError('"buffer" argument must be a Buffer instance');if(b>e||b<f)throw new RangeError('"value" argument is out of bounds');if(c+d>a.length)throw new RangeError("Index out of range")}function J(a,b,c,d,e,f){if(c+d>a.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("Index out of range")}function K(a,b,c,d,e){return b=+b,c>>>=0,e||J(a,b,c,4,3.4028234663852886e38,-3.4028234663852886e38),X.write(a,b,c,d,23,4),c+4}function L(a,b,c,d,e){return b=+b,c>>>=0,e||J(a,b,c,8,1.7976931348623157e308,-1.7976931348623157e308),X.write(a,b,c,d,52,8),c+8}function M(a){if(a=a.trim().replace($,""),a.length<2)return"";for(;a.length%4!==0;)a+="=";return a}function N(a){return a<16?"0"+a.toString(16):a.toString(16)}function O(a,b){b=b||1/0;for(var c,d=a.length,e=null,f=[],g=0;g<d;++g){if(c=a.charCodeAt(g),c>55295&&c<57344){if(!e){if(c>56319){(b-=3)>-1&&f.push(239,191,189);continue}if(g+1===d){(b-=3)>-1&&f.push(239,191,189);continue}e=c;continue}if(c<56320){(b-=3)>-1&&f.push(239,191,189),e=c;continue}c=(e-55296<<10|c-56320)+65536}else e&&(b-=3)>-1&&f.push(239,191,189);if(e=null,c<128){if((b-=1)<0)break;f.push(c)}else if(c<2048){if((b-=2)<0)break;f.push(c>>6|192,63&c|128)}else if(c<65536){if((b-=3)<0)break;f.push(c>>12|224,c>>6&63|128,63&c|128)}else{if(!(c<1114112))throw new Error("Invalid code point");if((b-=4)<0)break;f.push(c>>18|240,c>>12&63|128,c>>6&63|128,63&c|128)}}return f}function P(a){for(var b=[],c=0;c<a.length;++c)b.push(255&a.charCodeAt(c));return b}function Q(a,b){for(var c,d,e,f=[],g=0;g<a.length&&!((b-=2)<0);++g)c=a.charCodeAt(g),d=c>>8,e=c%256,f.push(e),f.push(d);return f}function R(a){return W.toByteArray(M(a))}function S(a,b,c,d){for(var e=0;e<d&&!(e+c>=b.length||e>=a.length);++e)b[e+c]=a[e];return e}function T(a){return a instanceof ArrayBuffer||null!=a&&null!=a.constructor&&"ArrayBuffer"===a.constructor.name&&"number"==typeof a.byteLength}function U(a){return"function"==typeof ArrayBuffer.isView&&ArrayBuffer.isView(a)}function V(a){return a!==a}var W=a("base64-js"),X=a("ieee754");c.Buffer=Buffer,c.SlowBuffer=o,c.INSPECT_MAX_BYTES=50;var Y=2147483647;c.kMaxLength=Y,Buffer.TYPED_ARRAY_SUPPORT=d(),Buffer.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),"undefined"!=typeof Symbol&&Symbol.species&&Buffer[Symbol.species]===Buffer&&Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),Buffer.poolSize=8192,Buffer.from=function(a,b,c){return f(a,b,c)},Buffer.prototype.__proto__=Uint8Array.prototype,Buffer.__proto__=Uint8Array,Buffer.alloc=function(a,b,c){return h(a,b,c)},Buffer.allocUnsafe=function(a){return i(a)},Buffer.allocUnsafeSlow=function(a){return i(a)},Buffer.isBuffer=function(a){return null!=a&&a._isBuffer===!0},Buffer.compare=function(a,b){if(!Buffer.isBuffer(a)||!Buffer.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var c=a.length,d=b.length,e=0,f=Math.min(c,d);e<f;++e)if(a[e]!==b[e]){c=a[e],d=b[e];break}return c<d?-1:d<c?1:0},Buffer.isEncoding=function(a){switch(String(a).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Buffer.concat=function(a,b){if(!Array.isArray(a))throw new TypeError('"list" argument must be an Array of Buffers');if(0===a.length)return Buffer.alloc(0);var c;if(void 0===b)for(b=0,c=0;c<a.length;++c)b+=a[c].length;var d=Buffer.allocUnsafe(b),e=0;for(c=0;c<a.length;++c){var f=a[c];if(!Buffer.isBuffer(f))throw new TypeError('"list" argument must be an Array of Buffers');f.copy(d,e),e+=f.length}return d},Buffer.byteLength=p,Buffer.prototype._isBuffer=!0,Buffer.prototype.swap16=function(){var a=this.length;if(a%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var b=0;b<a;b+=2)r(this,b,b+1);return this},Buffer.prototype.swap32=function(){var a=this.length;if(a%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var b=0;b<a;b+=4)r(this,b,b+3),r(this,b+1,b+2);return this},Buffer.prototype.swap64=function(){var a=this.length;if(a%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var b=0;b<a;b+=8)r(this,b,b+7),r(this,b+1,b+6),r(this,b+2,b+5),r(this,b+3,b+4);return this},Buffer.prototype.toString=function(){var a=this.length;return 0===a?"":0===arguments.length?B(this,0,a):q.apply(this,arguments)},Buffer.prototype.equals=function(a){if(!Buffer.isBuffer(a))throw new TypeError("Argument must be a Buffer");return this===a||0===Buffer.compare(this,a)},Buffer.prototype.inspect=function(){var a="",b=c.INSPECT_MAX_BYTES;return this.length>0&&(a=this.toString("hex",0,b).match(/.{2}/g).join(" "),this.length>b&&(a+=" ... ")),"<Buffer "+a+">"},Buffer.prototype.compare=function(a,b,c,d,e){if(!Buffer.isBuffer(a))throw new TypeError("Argument must be a Buffer");if(void 0===b&&(b=0),void 0===c&&(c=a?a.length:0),void 0===d&&(d=0),void 0===e&&(e=this.length),b<0||c>a.length||d<0||e>this.length)throw new RangeError("out of range index");if(d>=e&&b>=c)return 0;if(d>=e)return-1;if(b>=c)return 1;if(b>>>=0,c>>>=0,d>>>=0,e>>>=0,this===a)return 0;for(var f=e-d,g=c-b,h=Math.min(f,g),i=this.slice(d,e),j=a.slice(b,c),k=0;k<h;++k)if(i[k]!==j[k]){f=i[k],g=j[k];break}return f<g?-1:g<f?1:0},Buffer.prototype.includes=function(a,b,c){return this.indexOf(a,b,c)!==-1},Buffer.prototype.indexOf=function(a,b,c){return s(this,a,b,c,!0)},Buffer.prototype.lastIndexOf=function(a,b,c){return s(this,a,b,c,!1)},Buffer.prototype.write=function(a,b,c,d){if(void 0===b)d="utf8",c=this.length,b=0;else if(void 0===c&&"string"==typeof b)d=b,c=this.length,b=0;else{if(!isFinite(b))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");b>>>=0,isFinite(c)?(c>>>=0,void 0===d&&(d="utf8")):(d=c,c=void 0)}var e=this.length-b;if((void 0===c||c>e)&&(c=e),a.length>0&&(c<0||b<0)||b>this.length)throw new RangeError("Attempt to write outside buffer bounds");d||(d="utf8");for(var f=!1;;)switch(d){case"hex":return u(this,a,b,c);case"utf8":case"utf-8":return v(this,a,b,c);case"ascii":return w(this,a,b,c);case"latin1":case"binary":return x(this,a,b,c);case"base64":return y(this,a,b,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return z(this,a,b,c);default:if(f)throw new TypeError("Unknown encoding: "+d);d=(""+d).toLowerCase(),f=!0}},Buffer.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Z=4096;Buffer.prototype.slice=function(a,b){var c=this.length;a=~~a,b=void 0===b?c:~~b,a<0?(a+=c,a<0&&(a=0)):a>c&&(a=c),b<0?(b+=c,b<0&&(b=0)):b>c&&(b=c),b<a&&(b=a);var d=this.subarray(a,b);return d.__proto__=Buffer.prototype,d},Buffer.prototype.readUIntLE=function(a,b,c){a>>>=0,b>>>=0,c||H(a,b,this.length);for(var d=this[a],e=1,f=0;++f<b&&(e*=256);)d+=this[a+f]*e;return d},Buffer.prototype.readUIntBE=function(a,b,c){a>>>=0,b>>>=0,c||H(a,b,this.length);for(var d=this[a+--b],e=1;b>0&&(e*=256);)d+=this[a+--b]*e;return d},Buffer.prototype.readUInt8=function(a,b){return a>>>=0,b||H(a,1,this.length),this[a]},Buffer.prototype.readUInt16LE=function(a,b){return a>>>=0,b||H(a,2,this.length),this[a]|this[a+1]<<8},Buffer.prototype.readUInt16BE=function(a,b){return a>>>=0,b||H(a,2,this.length),this[a]<<8|this[a+1]},Buffer.prototype.readUInt32LE=function(a,b){return a>>>=0,b||H(a,4,this.length),(this[a]|this[a+1]<<8|this[a+2]<<16)+16777216*this[a+3]},Buffer.prototype.readUInt32BE=function(a,b){return a>>>=0,b||H(a,4,this.length),16777216*this[a]+(this[a+1]<<16|this[a+2]<<8|this[a+3])},Buffer.prototype.readIntLE=function(a,b,c){a>>>=0,b>>>=0,c||H(a,b,this.length);for(var d=this[a],e=1,f=0;++f<b&&(e*=256);)d+=this[a+f]*e;return e*=128,d>=e&&(d-=Math.pow(2,8*b)),d},Buffer.prototype.readIntBE=function(a,b,c){a>>>=0,b>>>=0,c||H(a,b,this.length);for(var d=b,e=1,f=this[a+--d];d>0&&(e*=256);)f+=this[a+--d]*e;return e*=128,f>=e&&(f-=Math.pow(2,8*b)),f},Buffer.prototype.readInt8=function(a,b){return a>>>=0,b||H(a,1,this.length),128&this[a]?(255-this[a]+1)*-1:this[a]},Buffer.prototype.readInt16LE=function(a,b){a>>>=0,b||H(a,2,this.length);var c=this[a]|this[a+1]<<8;return 32768&c?4294901760|c:c},Buffer.prototype.readInt16BE=function(a,b){a>>>=0,b||H(a,2,this.length);var c=this[a+1]|this[a]<<8;return 32768&c?4294901760|c:c},Buffer.prototype.readInt32LE=function(a,b){return a>>>=0,b||H(a,4,this.length),this[a]|this[a+1]<<8|this[a+2]<<16|this[a+3]<<24},Buffer.prototype.readInt32BE=function(a,b){return a>>>=0,b||H(a,4,this.length),this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+3]},Buffer.prototype.readFloatLE=function(a,b){return a>>>=0,b||H(a,4,this.length),X.read(this,a,!0,23,4)},Buffer.prototype.readFloatBE=function(a,b){return a>>>=0,b||H(a,4,this.length),X.read(this,a,!1,23,4)},Buffer.prototype.readDoubleLE=function(a,b){return a>>>=0,b||H(a,8,this.length),X.read(this,a,!0,52,8)},Buffer.prototype.readDoubleBE=function(a,b){
9
return a>>>=0,b||H(a,8,this.length),X.read(this,a,!1,52,8)},Buffer.prototype.writeUIntLE=function(a,b,c,d){if(a=+a,b>>>=0,c>>>=0,!d){var e=Math.pow(2,8*c)-1;I(this,a,b,c,e,0)}var f=1,g=0;for(this[b]=255&a;++g<c&&(f*=256);)this[b+g]=a/f&255;return b+c},Buffer.prototype.writeUIntBE=function(a,b,c,d){if(a=+a,b>>>=0,c>>>=0,!d){var e=Math.pow(2,8*c)-1;I(this,a,b,c,e,0)}var f=c-1,g=1;for(this[b+f]=255&a;--f>=0&&(g*=256);)this[b+f]=a/g&255;return b+c},Buffer.prototype.writeUInt8=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,1,255,0),this[b]=255&a,b+1},Buffer.prototype.writeUInt16LE=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,2,65535,0),this[b]=255&a,this[b+1]=a>>>8,b+2},Buffer.prototype.writeUInt16BE=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,2,65535,0),this[b]=a>>>8,this[b+1]=255&a,b+2},Buffer.prototype.writeUInt32LE=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,4,4294967295,0),this[b+3]=a>>>24,this[b+2]=a>>>16,this[b+1]=a>>>8,this[b]=255&a,b+4},Buffer.prototype.writeUInt32BE=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,4,4294967295,0),this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=255&a,b+4},Buffer.prototype.writeIntLE=function(a,b,c,d){if(a=+a,b>>>=0,!d){var e=Math.pow(2,8*c-1);I(this,a,b,c,e-1,-e)}var f=0,g=1,h=0;for(this[b]=255&a;++f<c&&(g*=256);)a<0&&0===h&&0!==this[b+f-1]&&(h=1),this[b+f]=(a/g>>0)-h&255;return b+c},Buffer.prototype.writeIntBE=function(a,b,c,d){if(a=+a,b>>>=0,!d){var e=Math.pow(2,8*c-1);I(this,a,b,c,e-1,-e)}var f=c-1,g=1,h=0;for(this[b+f]=255&a;--f>=0&&(g*=256);)a<0&&0===h&&0!==this[b+f+1]&&(h=1),this[b+f]=(a/g>>0)-h&255;return b+c},Buffer.prototype.writeInt8=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,1,127,-128),a<0&&(a=255+a+1),this[b]=255&a,b+1},Buffer.prototype.writeInt16LE=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,2,32767,-32768),this[b]=255&a,this[b+1]=a>>>8,b+2},Buffer.prototype.writeInt16BE=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,2,32767,-32768),this[b]=a>>>8,this[b+1]=255&a,b+2},Buffer.prototype.writeInt32LE=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,4,2147483647,-2147483648),this[b]=255&a,this[b+1]=a>>>8,this[b+2]=a>>>16,this[b+3]=a>>>24,b+4},Buffer.prototype.writeInt32BE=function(a,b,c){return a=+a,b>>>=0,c||I(this,a,b,4,2147483647,-2147483648),a<0&&(a=4294967295+a+1),this[b]=a>>>24,this[b+1]=a>>>16,this[b+2]=a>>>8,this[b+3]=255&a,b+4},Buffer.prototype.writeFloatLE=function(a,b,c){return K(this,a,b,!0,c)},Buffer.prototype.writeFloatBE=function(a,b,c){return K(this,a,b,!1,c)},Buffer.prototype.writeDoubleLE=function(a,b,c){return L(this,a,b,!0,c)},Buffer.prototype.writeDoubleBE=function(a,b,c){return L(this,a,b,!1,c)},Buffer.prototype.copy=function(a,b,c,d){if(c||(c=0),d||0===d||(d=this.length),b>=a.length&&(b=a.length),b||(b=0),d>0&&d<c&&(d=c),d===c)return 0;if(0===a.length||0===this.length)return 0;if(b<0)throw new RangeError("targetStart out of bounds");if(c<0||c>=this.length)throw new RangeError("sourceStart out of bounds");if(d<0)throw new RangeError("sourceEnd out of bounds");d>this.length&&(d=this.length),a.length-b<d-c&&(d=a.length-b+c);var e,f=d-c;if(this===a&&c<b&&b<d)for(e=f-1;e>=0;--e)a[e+b]=this[e+c];else if(f<1e3)for(e=0;e<f;++e)a[e+b]=this[e+c];else Uint8Array.prototype.set.call(a,this.subarray(c,c+f),b);return f},Buffer.prototype.fill=function(a,b,c,d){if("string"==typeof a){if("string"==typeof b?(d=b,b=0,c=this.length):"string"==typeof c&&(d=c,c=this.length),1===a.length){var e=a.charCodeAt(0);e<256&&(a=e)}if(void 0!==d&&"string"!=typeof d)throw new TypeError("encoding must be a string");if("string"==typeof d&&!Buffer.isEncoding(d))throw new TypeError("Unknown encoding: "+d)}else"number"==typeof a&&(a&=255);if(b<0||this.length<b||this.length<c)throw new RangeError("Out of range index");if(c<=b)return this;b>>>=0,c=void 0===c?this.length:c>>>0,a||(a=0);var f;if("number"==typeof a)for(f=b;f<c;++f)this[f]=a;else{var g=Buffer.isBuffer(a)?a:new Buffer(a,d),h=g.length;for(f=0;f<c-b;++f)this[f+b]=g[f%h]}return this};var $=/[^+\/0-9A-Za-z-_]/g},{"base64-js":106,ieee754:244}],106:[function(a,b,c){"use strict";function d(a){var b=a.length;if(b%4>0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===a[b-2]?2:"="===a[b-1]?1:0}function e(a){return 3*a.length/4-d(a)}function f(a){var b,c,e,f,g,h=a.length;f=d(a),g=new l(3*h/4-f),c=f>0?h-4:h;var i=0;for(b=0;b<c;b+=4)e=k[a.charCodeAt(b)]<<18|k[a.charCodeAt(b+1)]<<12|k[a.charCodeAt(b+2)]<<6|k[a.charCodeAt(b+3)],g[i++]=e>>16&255,g[i++]=e>>8&255,g[i++]=255&e;return 2===f?(e=k[a.charCodeAt(b)]<<2|k[a.charCodeAt(b+1)]>>4,g[i++]=255&e):1===f&&(e=k[a.charCodeAt(b)]<<10|k[a.charCodeAt(b+1)]<<4|k[a.charCodeAt(b+2)]>>2,g[i++]=e>>8&255,g[i++]=255&e),g}function g(a){return j[a>>18&63]+j[a>>12&63]+j[a>>6&63]+j[63&a]}function h(a,b,c){for(var d,e=[],f=b;f<c;f+=3)d=(a[f]<<16)+(a[f+1]<<8)+a[f+2],e.push(g(d));return e.join("")}function i(a){for(var b,c=a.length,d=c%3,e="",f=[],g=16383,i=0,k=c-d;i<k;i+=g)f.push(h(a,i,i+g>k?k:i+g));return 1===d?(b=a[c-1],e+=j[b>>2],e+=j[b<<4&63],e+="=="):2===d&&(b=(a[c-2]<<8)+a[c-1],e+=j[b>>10],e+=j[b>>4&63],e+=j[b<<2&63],e+="="),f.push(e),f.join("")}c.byteLength=e,c.toByteArray=f,c.fromByteArray=i;for(var j=[],k=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array,m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=m.length;n<o;++n)j[n]=m[n],k[m.charCodeAt(n)]=n;k["-".charCodeAt(0)]=62,k["_".charCodeAt(0)]=63},{}],107:[function(a,b,c){function d(a){e.call(this),this.hashMode="string"==typeof a,this.hashMode?this[a]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}var Buffer=a("safe-buffer").Buffer,e=a("stream").Transform,f=a("string_decoder").StringDecoder,g=a("inherits");g(d,e),d.prototype.update=function(a,b,c){"string"==typeof a&&(a=Buffer.from(a,b));var d=this._update(a);return this.hashMode?this:(c&&(d=this._toString(d,c)),d)},d.prototype.setAutoPadding=function(){},d.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},d.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},d.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},d.prototype._transform=function(a,b,c){var d;try{this.hashMode?this._update(a):this.push(this._update(a))}catch(a){d=a}finally{c(d)}},d.prototype._flush=function(a){var b;try{this.push(this.__final())}catch(a){b=a}a(b)},d.prototype._finalOrDigest=function(a){var b=this.__final()||Buffer.alloc(0);return a&&(b=this._toString(b,a,!0)),b},d.prototype._toString=function(a,b,c){if(this._decoder||(this._decoder=new f(b),this._encoding=b),this._encoding!==b)throw new Error("can't switch encodings");var d=this._decoder.write(a);return c&&(d+=this._decoder.end()),d},b.exports=d},{inherits:246,"safe-buffer":311,stream:344,string_decoder:98}],108:[function(a,b,c){function d(a){if(a)return e(a)}function e(a){for(var b in d.prototype)a[b]=d.prototype[b];return a}b.exports=d,d.prototype.on=d.prototype.addEventListener=function(a,b){return this._callbacks=this._callbacks||{},(this._callbacks[a]=this._callbacks[a]||[]).push(b),this},d.prototype.once=function(a,b){function c(){d.off(a,c),b.apply(this,arguments)}var d=this;return this._callbacks=this._callbacks||{},c.fn=b,this.on(a,c),this},d.prototype.off=d.prototype.removeListener=d.prototype.removeAllListeners=d.prototype.removeEventListener=function(a,b){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var c=this._callbacks[a];if(!c)return this;if(1==arguments.length)return delete this._callbacks[a],this;for(var d,e=0;e<c.length;e++)if(d=c[e],d===b||d.fn===b){c.splice(e,1);break}return this},d.prototype.emit=function(a){this._callbacks=this._callbacks||{};var b=[].slice.call(arguments,1),c=this._callbacks[a];if(c){c=c.slice(0);for(var d=0,e=c.length;d<e;++d)c[d].apply(this,b)}return this},d.prototype.listeners=function(a){return this._callbacks=this._callbacks||{},this._callbacks[a]||[]},d.prototype.hasListeners=function(a){return!!this.listeners(a).length}},{}],109:[function(a,b,c){(function(Buffer){function a(a){return Array.isArray?Array.isArray(a):"[object Array]"===p(a)}function b(a){return"boolean"==typeof a}function d(a){return null===a}function e(a){return null==a}function f(a){return"number"==typeof a}function g(a){return"string"==typeof a}function h(a){return"symbol"==typeof a}function i(a){return void 0===a}function j(a){return"[object RegExp]"===p(a)}function k(a){return"object"==typeof a&&null!==a}function l(a){return"[object Date]"===p(a)}function m(a){return"[object Error]"===p(a)||a instanceof Error}function n(a){return"function"==typeof a}function o(a){return null===a||"boolean"==typeof a||"number"==typeof a||"string"==typeof a||"symbol"==typeof a||"undefined"==typeof a}function p(a){return Object.prototype.toString.call(a)}c.isArray=a,c.isBoolean=b,c.isNull=d,c.isNullOrUndefined=e,c.isNumber=f,c.isString=g,c.isSymbol=h,c.isUndefined=i,c.isRegExp=j,c.isObject=k,c.isDate=l,c.isError=m,c.isFunction=n,c.isPrimitive=o,c.isBuffer=Buffer.isBuffer}).call(this,{isBuffer:a("../../is-buffer/index.js")})},{"../../is-buffer/index.js":247}],110:[function(a,b,c){(function(Buffer){function c(a){this.curveType=g[a],this.curveType||(this.curveType={name:a}),this.curve=new e.ec(this.curveType.name),this.keys=void 0}function d(a,b,c){Array.isArray(a)||(a=a.toArray());var d=new Buffer(a);if(c&&d.length<c){var e=new Buffer(c-d.length);e.fill(0),d=Buffer.concat([e,d])}return b?d.toString(b):d}var e=a("elliptic"),f=a("bn.js");b.exports=function(a){return new c(a)};var g={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};g.p224=g.secp224r1,g.p256=g.secp256r1=g.prime256v1,g.p192=g.secp192r1=g.prime192v1,g.p384=g.secp384r1,g.p521=g.secp521r1,c.prototype.generateKeys=function(a,b){return this.keys=this.curve.genKeyPair(),this.getPublicKey(a,b)},c.prototype.computeSecret=function(a,b,c){b=b||"utf8",Buffer.isBuffer(a)||(a=new Buffer(a,b));var e=this.curve.keyFromPublic(a).getPublic(),f=e.mul(this.keys.getPrivate()).getX();return d(f,c,this.curveType.byteLength)},c.prototype.getPublicKey=function(a,b){var c=this.keys.getPublic("compressed"===b,!0);return"hybrid"===b&&(c[c.length-1]%2?c[0]=7:c[0]=6),d(c,a)},c.prototype.getPrivateKey=function(a){return d(this.keys.getPrivate(),a)},c.prototype.setPublicKey=function(a,b){return b=b||"utf8",Buffer.isBuffer(a)||(a=new Buffer(a,b)),this.keys._importPublic(a),this},c.prototype.setPrivateKey=function(a,b){b=b||"utf8",Buffer.isBuffer(a)||(a=new Buffer(a,b));var c=new f(a);return c=c.toString(16),this.keys._importPrivate(c),this}}).call(this,a("buffer").Buffer)},{"bn.js":111,buffer:105,elliptic:112}],111:[function(a,b,c){!function(b,c){"use strict";function d(a,b){if(!a)throw new Error(b||"Assertion failed")}function e(a,b){a.super_=b;var c=function(){};c.prototype=b.prototype,a.prototype=new c,a.prototype.constructor=a}function f(a,b,c){return f.isBN(a)?a:(this.negative=0,this.words=null,this.length=0,this.red=null,void(null!==a&&("le"!==b&&"be"!==b||(c=b,b=10),this._init(a||0,b||10,c||"be"))))}function g(a,b,c){for(var d=0,e=Math.min(a.length,c),f=b;f<e;f++){var g=a.charCodeAt(f)-48;d<<=4,d|=g>=49&&g<=54?g-49+10:g>=17&&g<=22?g-17+10:15&g}return d}function h(a,b,c,d){for(var e=0,f=Math.min(a.length,c),g=b;g<f;g++){var h=a.charCodeAt(g)-48;e*=d,e+=h>=49?h-49+10:h>=17?h-17+10:h}return e}function i(a){for(var b=new Array(a.bitLength()),c=0;c<b.length;c++){var d=c/26|0,e=c%26;b[c]=(a.words[d]&1<<e)>>>e}return b}function j(a,b,c){c.negative=b.negative^a.negative;var d=a.length+b.length|0;c.length=d,d=d-1|0;var e=0|a.words[0],f=0|b.words[0],g=e*f,h=67108863&g,i=g/67108864|0;c.words[0]=h;for(var j=1;j<d;j++){for(var k=i>>>26,l=67108863&i,m=Math.min(j,b.length-1),n=Math.max(0,j-a.length+1);n<=m;n++){var o=j-n|0;e=0|a.words[o],f=0|b.words[n],g=e*f+l,k+=g/67108864|0,l=67108863&g}c.words[j]=0|l,i=0|k}return 0!==i?c.words[j]=0|i:c.length--,c.strip()}function k(a,b,c){c.negative=b.negative^a.negative,c.length=a.length+b.length;for(var d=0,e=0,f=0;f<c.length-1;f++){var g=e;e=0;for(var h=67108863&d,i=Math.min(f,b.length-1),j=Math.max(0,f-a.length+1);j<=i;j++){var k=f-j,l=0|a.words[k],m=0|b.words[j],n=l*m,o=67108863&n;g=g+(n/67108864|0)|0,o=o+h|0,h=67108863&o,g=g+(o>>>26)|0,e+=g>>>26,g&=67108863}c.words[f]=h,d=g,g=e}return 0!==d?c.words[f]=d:c.length--,c.strip()}function l(a,b,c){var d=new m;return d.mulp(a,b,c)}function m(a,b){this.x=a,this.y=b}function n(a,b){this.name=a,this.p=new f(b,16),this.n=this.p.bitLength(),this.k=new f(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function o(){n.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function p(){n.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function q(){n.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function r(){n.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function s(a){if("string"==typeof a){var b=f._prime(a);this.m=b.p,this.prime=b}else d(a.gtn(1),"modulus must be greater than 1"),this.m=a,this.prime=null}function t(a){s.call(this,a),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new f(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)}"object"==typeof b?b.exports=f:c.BN=f,f.BN=f,f.wordSize=26;var Buffer;try{Buffer=a("buffer").Buffer}catch(a){}f.isBN=function(a){return a instanceof f||null!==a&&"object"==typeof a&&a.constructor.wordSize===f.wordSize&&Array.isArray(a.words)},f.max=function(a,b){return a.cmp(b)>0?a:b},f.min=function(a,b){return a.cmp(b)<0?a:b},f.prototype._init=function(a,b,c){if("number"==typeof a)return this._initNumber(a,b,c);if("object"==typeof a)return this._initArray(a,b,c);"hex"===b&&(b=16),d(b===(0|b)&&b>=2&&b<=36),a=a.toString().replace(/\s+/g,"");var e=0;"-"===a[0]&&e++,16===b?this._parseHex(a,e):this._parseBase(a,b,e),"-"===a[0]&&(this.negative=1),this.strip(),"le"===c&&this._initArray(this.toArray(),b,c)},f.prototype._initNumber=function(a,b,c){a<0&&(this.negative=1,a=-a),a<67108864?(this.words=[67108863&a],this.length=1):a<4503599627370496?(this.words=[67108863&a,a/67108864&67108863],this.length=2):(d(a<9007199254740992),this.words=[67108863&a,a/67108864&67108863,1],this.length=3),"le"===c&&this._initArray(this.toArray(),b,c)},f.prototype._initArray=function(a,b,c){if(d("number"==typeof a.length),a.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(a.length/3),this.words=new Array(this.length);for(var e=0;e<this.length;e++)this.words[e]=0;var f,g,h=0;if("be"===c)for(e=a.length-1,f=0;e>=0;e-=3)g=a[e]|a[e-1]<<8|a[e-2]<<16,this.words[f]|=g<<h&67108863,this.words[f+1]=g>>>26-h&67108863,h+=24,h>=26&&(h-=26,f++);else if("le"===c)for(e=0,f=0;e<a.length;e+=3)g=a[e]|a[e+1]<<8|a[e+2]<<16,this.words[f]|=g<<h&67108863,this.words[f+1]=g>>>26-h&67108863,h+=24,h>=26&&(h-=26,f++);return this.strip()},f.prototype._parseHex=function(a,b){this.length=Math.ceil((a.length-b)/6),this.words=new Array(this.length);for(var c=0;c<this.length;c++)this.words[c]=0;var d,e,f=0;for(c=a.length-6,d=0;c>=b;c-=6)e=g(a,c,c+6),this.words[d]|=e<<f&67108863,this.words[d+1]|=e>>>26-f&4194303,f+=24,f>=26&&(f-=26,d++);c+6!==b&&(e=g(a,b,c+6),this.words[d]|=e<<f&67108863,this.words[d+1]|=e>>>26-f&4194303),this.strip()},f.prototype._parseBase=function(a,b,c){this.words=[0],this.length=1;for(var d=0,e=1;e<=67108863;e*=b)d++;d--,e=e/b|0;for(var f=a.length-c,g=f%d,i=Math.min(f,f-g)+c,j=0,k=c;k<i;k+=d)j=h(a,k,k+d,b),this.imuln(e),this.words[0]+j<67108864?this.words[0]+=j:this._iaddn(j);if(0!==g){var l=1;for(j=h(a,k,a.length,b),k=0;k<g;k++)l*=b;this.imuln(l),this.words[0]+j<67108864?this.words[0]+=j:this._iaddn(j)}},f.prototype.copy=function(a){a.words=new Array(this.length);for(var b=0;b<this.length;b++)a.words[b]=this.words[b];a.length=this.length,a.negative=this.negative,a.red=this.red},f.prototype.clone=function(){var a=new f(null);return this.copy(a),a},f.prototype._expand=function(a){for(;this.length<a;)this.words[this.length++]=0;return this},f.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},f.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},f.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u=["","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"],v=[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],w=[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];f.prototype.toString=function(a,b){a=a||10,b=0|b||1;var c;if(16===a||"hex"===a){c="";for(var e=0,f=0,g=0;g<this.length;g++){var h=this.words[g],i=(16777215&(h<<e|f)).toString(16);f=h>>>24-e&16777215,c=0!==f||g!==this.length-1?u[6-i.length]+i+c:i+c,e+=2,e>=26&&(e-=26,g--)}for(0!==f&&(c=f.toString(16)+c);c.length%b!==0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}if(a===(0|a)&&a>=2&&a<=36){var j=v[a],k=w[a];c="";var l=this.clone();for(l.negative=0;!l.isZero();){var m=l.modn(k).toString(a);l=l.idivn(k),c=l.isZero()?m+c:u[j-m.length]+m+c}for(this.isZero()&&(c="0"+c);c.length%b!==0;)c="0"+c;return 0!==this.negative&&(c="-"+c),c}d(!1,"Base should be between 2 and 36")},f.prototype.toNumber=function(){var a=this.words[0];return 2===this.length?a+=67108864*this.words[1]:3===this.length&&1===this.words[2]?a+=4503599627370496+67108864*this.words[1]:this.length>2&&d(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-a:a},f.prototype.toJSON=function(){return this.toString(16)},f.prototype.toBuffer=function(a,b){return d("undefined"!=typeof Buffer),this.toArrayLike(Buffer,a,b)},f.prototype.toArray=function(a,b){return this.toArrayLike(Array,a,b)},f.prototype.toArrayLike=function(a,b,c){var e=this.byteLength(),f=c||Math.max(1,e);d(e<=f,"byte array longer than desired length"),d(f>0,"Requested array length <= 0"),this.strip();var g,h,i="le"===b,j=new a(f),k=this.clone();if(i){for(h=0;!k.isZero();h++)g=k.andln(255),k.iushrn(8),j[h]=g;for(;h<f;h++)j[h]=0}else{for(h=0;h<f-e;h++)j[h]=0;for(h=0;!k.isZero();h++)g=k.andln(255),k.iushrn(8),j[f-h-1]=g}return j},Math.clz32?f.prototype._countBits=function(a){return 32-Math.clz32(a)}:f.prototype._countBits=function(a){var b=a,c=0;return b>=4096&&(c+=13,b>>>=13),b>=64&&(c+=7,b>>>=7),b>=8&&(c+=4,b>>>=4),b>=2&&(c+=2,b>>>=2),c+b},f.prototype._zeroBits=function(a){if(0===a)return 26;var b=a,c=0;return 0===(8191&b)&&(c+=13,b>>>=13),0===(127&b)&&(c+=7,b>>>=7),0===(15&b)&&(c+=4,b>>>=4),0===(3&b)&&(c+=2,b>>>=2),0===(1&b)&&c++,c},f.prototype.bitLength=function(){var a=this.words[this.length-1],b=this._countBits(a);return 26*(this.length-1)+b},f.prototype.zeroBits=function(){if(this.isZero())return 0;for(var a=0,b=0;b<this.length;b++){var c=this._zeroBits(this.words[b]);if(a+=c,26!==c)break}return a},f.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},f.prototype.toTwos=function(a){return 0!==this.negative?this.abs().inotn(a).iaddn(1):this.clone()},f.prototype.fromTwos=function(a){return this.testn(a-1)?this.notn(a).iaddn(1).ineg():this.clone()},f.prototype.isNeg=function(){return 0!==this.negative},f.prototype.neg=function(){return this.clone().ineg()},f.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},f.prototype.iuor=function(a){for(;this.length<a.length;)this.words[this.length++]=0;for(var b=0;b<a.length;b++)this.words[b]=this.words[b]|a.words[b];return this.strip()},f.prototype.ior=function(a){return d(0===(this.negative|a.negative)),this.iuor(a)},f.prototype.or=function(a){return this.length>a.length?this.clone().ior(a):a.clone().ior(this)},f.prototype.uor=function(a){return this.length>a.length?this.clone().iuor(a):a.clone().iuor(this)},f.prototype.iuand=function(a){var b;b=this.length>a.length?a:this;for(var c=0;c<b.length;c++)this.words[c]=this.words[c]&a.words[c];return this.length=b.length,this.strip()},f.prototype.iand=function(a){return d(0===(this.negative|a.negative)),this.iuand(a)},f.prototype.and=function(a){return this.length>a.length?this.clone().iand(a):a.clone().iand(this)},f.prototype.uand=function(a){return this.length>a.length?this.clone().iuand(a):a.clone().iuand(this)},f.prototype.iuxor=function(a){var b,c;this.length>a.length?(b=this,c=a):(b=a,c=this);for(var d=0;d<c.length;d++)this.words[d]=b.words[d]^c.words[d];if(this!==b)for(;d<b.length;d++)this.words[d]=b.words[d];return this.length=b.length,this.strip()},f.prototype.ixor=function(a){return d(0===(this.negative|a.negative)),this.iuxor(a)},f.prototype.xor=function(a){return this.length>a.length?this.clone().ixor(a):a.clone().ixor(this)},f.prototype.uxor=function(a){return this.length>a.length?this.clone().iuxor(a):a.clone().iuxor(this)},f.prototype.inotn=function(a){d("number"==typeof a&&a>=0);var b=0|Math.ceil(a/26),c=a%26;this._expand(b),c>0&&b--;for(var e=0;e<b;e++)this.words[e]=67108863&~this.words[e];return c>0&&(this.words[e]=~this.words[e]&67108863>>26-c),this.strip()},f.prototype.notn=function(a){return this.clone().inotn(a)},f.prototype.setn=function(a,b){d("number"==typeof a&&a>=0);var c=a/26|0,e=a%26;return this._expand(c+1),b?this.words[c]=this.words[c]|1<<e:this.words[c]=this.words[c]&~(1<<e),this.strip()},f.prototype.iadd=function(a){var b;if(0!==this.negative&&0===a.negative)return this.negative=0,b=this.isub(a),this.negative^=1,this._normSign();if(0===this.negative&&0!==a.negative)return a.negative=0,b=this.isub(a),a.negative=1,b._normSign();var c,d;this.length>a.length?(c=this,d=a):(c=a,d=this);for(var e=0,f=0;f<d.length;f++)b=(0|c.words[f])+(0|d.words[f])+e,this.words[f]=67108863&b,e=b>>>26;for(;0!==e&&f<c.length;f++)b=(0|c.words[f])+e,this.words[f]=67108863&b,e=b>>>26;if(this.length=c.length,0!==e)this.words[this.length]=e,this.length++;else if(c!==this)for(;f<c.length;f++)this.words[f]=c.words[f];return this},f.prototype.add=function(a){var b;return 0!==a.negative&&0===this.negative?(a.negative=0,b=this.sub(a),a.negative^=1,b):0===a.negative&&0!==this.negative?(this.negative=0,b=a.sub(this),this.negative=1,b):this.length>a.length?this.clone().iadd(a):a.clone().iadd(this)},f.prototype.isub=function(a){if(0!==a.negative){a.negative=0;var b=this.iadd(a);return a.negative=1,b._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(a),this.negative=1,this._normSign();var c=this.cmp(a);if(0===c)return this.negative=0,this.length=1,this.words[0]=0,this;var d,e;c>0?(d=this,e=a):(d=a,e=this);for(var f=0,g=0;g<e.length;g++)b=(0|d.words[g])-(0|e.words[g])+f,f=b>>26,this.words[g]=67108863&b;for(;0!==f&&g<d.length;g++)b=(0|d.words[g])+f,f=b>>26,this.words[g]=67108863&b;if(0===f&&g<d.length&&d!==this)for(;g<d.length;g++)this.words[g]=d.words[g];return this.length=Math.max(this.length,g),d!==this&&(this.negative=1),this.strip()},f.prototype.sub=function(a){return this.clone().isub(a)};var x=function(a,b,c){var d,e,f,g=a.words,h=b.words,i=c.words,j=0,k=0|g[0],l=8191&k,m=k>>>13,n=0|g[1],o=8191&n,p=n>>>13,q=0|g[2],r=8191&q,s=q>>>13,t=0|g[3],u=8191&t,v=t>>>13,w=0|g[4],x=8191&w,y=w>>>13,z=0|g[5],A=8191&z,B=z>>>13,C=0|g[6],D=8191&C,E=C>>>13,F=0|g[7],G=8191&F,H=F>>>13,I=0|g[8],J=8191&I,K=I>>>13,L=0|g[9],M=8191&L,N=L>>>13,O=0|h[0],P=8191&O,Q=O>>>13,R=0|h[1],S=8191&R,T=R>>>13,U=0|h[2],V=8191&U,W=U>>>13,X=0|h[3],Y=8191&X,Z=X>>>13,$=0|h[4],_=8191&$,aa=$>>>13,ba=0|h[5],ca=8191&ba,da=ba>>>13,ea=0|h[6],fa=8191&ea,ga=ea>>>13,ha=0|h[7],ia=8191&ha,ja=ha>>>13,ka=0|h[8],la=8191&ka,ma=ka>>>13,na=0|h[9],oa=8191&na,pa=na>>>13;c.negative=a.negative^b.negative,c.length=19,d=Math.imul(l,P),e=Math.imul(l,Q),e=e+Math.imul(m,P)|0,f=Math.imul(m,Q);var qa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(qa>>>26)|0,qa&=67108863,d=Math.imul(o,P),e=Math.imul(o,Q),e=e+Math.imul(p,P)|0,f=Math.imul(p,Q),d=d+Math.imul(l,S)|0,e=e+Math.imul(l,T)|0,e=e+Math.imul(m,S)|0,f=f+Math.imul(m,T)|0;var ra=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(ra>>>26)|0,ra&=67108863,d=Math.imul(r,P),e=Math.imul(r,Q),e=e+Math.imul(s,P)|0,f=Math.imul(s,Q),d=d+Math.imul(o,S)|0,e=e+Math.imul(o,T)|0,e=e+Math.imul(p,S)|0,f=f+Math.imul(p,T)|0,d=d+Math.imul(l,V)|0,e=e+Math.imul(l,W)|0,e=e+Math.imul(m,V)|0,f=f+Math.imul(m,W)|0;var sa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(sa>>>26)|0,sa&=67108863,d=Math.imul(u,P),e=Math.imul(u,Q),e=e+Math.imul(v,P)|0,f=Math.imul(v,Q),d=d+Math.imul(r,S)|0,e=e+Math.imul(r,T)|0,e=e+Math.imul(s,S)|0,f=f+Math.imul(s,T)|0,d=d+Math.imul(o,V)|0,e=e+Math.imul(o,W)|0,e=e+Math.imul(p,V)|0,f=f+Math.imul(p,W)|0,d=d+Math.imul(l,Y)|0,e=e+Math.imul(l,Z)|0,e=e+Math.imul(m,Y)|0,f=f+Math.imul(m,Z)|0;var ta=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(ta>>>26)|0,ta&=67108863,d=Math.imul(x,P),e=Math.imul(x,Q),e=e+Math.imul(y,P)|0,f=Math.imul(y,Q),d=d+Math.imul(u,S)|0,e=e+Math.imul(u,T)|0,e=e+Math.imul(v,S)|0,f=f+Math.imul(v,T)|0,d=d+Math.imul(r,V)|0,e=e+Math.imul(r,W)|0,e=e+Math.imul(s,V)|0,f=f+Math.imul(s,W)|0,d=d+Math.imul(o,Y)|0,e=e+Math.imul(o,Z)|0,e=e+Math.imul(p,Y)|0,f=f+Math.imul(p,Z)|0,d=d+Math.imul(l,_)|0,e=e+Math.imul(l,aa)|0,e=e+Math.imul(m,_)|0,f=f+Math.imul(m,aa)|0;var ua=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(ua>>>26)|0,ua&=67108863,d=Math.imul(A,P),e=Math.imul(A,Q),e=e+Math.imul(B,P)|0,f=Math.imul(B,Q),d=d+Math.imul(x,S)|0,e=e+Math.imul(x,T)|0,e=e+Math.imul(y,S)|0,f=f+Math.imul(y,T)|0,d=d+Math.imul(u,V)|0,e=e+Math.imul(u,W)|0,e=e+Math.imul(v,V)|0,f=f+Math.imul(v,W)|0,d=d+Math.imul(r,Y)|0,e=e+Math.imul(r,Z)|0,e=e+Math.imul(s,Y)|0,f=f+Math.imul(s,Z)|0,d=d+Math.imul(o,_)|0,e=e+Math.imul(o,aa)|0,e=e+Math.imul(p,_)|0,f=f+Math.imul(p,aa)|0,d=d+Math.imul(l,ca)|0,e=e+Math.imul(l,da)|0,e=e+Math.imul(m,ca)|0,f=f+Math.imul(m,da)|0;var va=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(va>>>26)|0,va&=67108863,d=Math.imul(D,P),e=Math.imul(D,Q),e=e+Math.imul(E,P)|0,f=Math.imul(E,Q),d=d+Math.imul(A,S)|0,e=e+Math.imul(A,T)|0,e=e+Math.imul(B,S)|0,f=f+Math.imul(B,T)|0,d=d+Math.imul(x,V)|0,e=e+Math.imul(x,W)|0,e=e+Math.imul(y,V)|0,f=f+Math.imul(y,W)|0,d=d+Math.imul(u,Y)|0,e=e+Math.imul(u,Z)|0,e=e+Math.imul(v,Y)|0,f=f+Math.imul(v,Z)|0,d=d+Math.imul(r,_)|0,e=e+Math.imul(r,aa)|0,e=e+Math.imul(s,_)|0,f=f+Math.imul(s,aa)|0,d=d+Math.imul(o,ca)|0,e=e+Math.imul(o,da)|0,e=e+Math.imul(p,ca)|0,f=f+Math.imul(p,da)|0,d=d+Math.imul(l,fa)|0,e=e+Math.imul(l,ga)|0,e=e+Math.imul(m,fa)|0,f=f+Math.imul(m,ga)|0;var wa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(wa>>>26)|0,wa&=67108863,d=Math.imul(G,P),e=Math.imul(G,Q),e=e+Math.imul(H,P)|0,f=Math.imul(H,Q),d=d+Math.imul(D,S)|0,e=e+Math.imul(D,T)|0,e=e+Math.imul(E,S)|0,f=f+Math.imul(E,T)|0,d=d+Math.imul(A,V)|0,e=e+Math.imul(A,W)|0,e=e+Math.imul(B,V)|0,f=f+Math.imul(B,W)|0,d=d+Math.imul(x,Y)|0,e=e+Math.imul(x,Z)|0,e=e+Math.imul(y,Y)|0,f=f+Math.imul(y,Z)|0,d=d+Math.imul(u,_)|0,e=e+Math.imul(u,aa)|0,e=e+Math.imul(v,_)|0,f=f+Math.imul(v,aa)|0,d=d+Math.imul(r,ca)|0,e=e+Math.imul(r,da)|0,e=e+Math.imul(s,ca)|0,f=f+Math.imul(s,da)|0,d=d+Math.imul(o,fa)|0,e=e+Math.imul(o,ga)|0,e=e+Math.imul(p,fa)|0,f=f+Math.imul(p,ga)|0,d=d+Math.imul(l,ia)|0,e=e+Math.imul(l,ja)|0,e=e+Math.imul(m,ia)|0,f=f+Math.imul(m,ja)|0;var xa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(xa>>>26)|0,xa&=67108863,d=Math.imul(J,P),e=Math.imul(J,Q),e=e+Math.imul(K,P)|0,f=Math.imul(K,Q),d=d+Math.imul(G,S)|0,e=e+Math.imul(G,T)|0,e=e+Math.imul(H,S)|0,f=f+Math.imul(H,T)|0,d=d+Math.imul(D,V)|0,e=e+Math.imul(D,W)|0,e=e+Math.imul(E,V)|0,f=f+Math.imul(E,W)|0,d=d+Math.imul(A,Y)|0,e=e+Math.imul(A,Z)|0,e=e+Math.imul(B,Y)|0,f=f+Math.imul(B,Z)|0,d=d+Math.imul(x,_)|0,e=e+Math.imul(x,aa)|0,e=e+Math.imul(y,_)|0,f=f+Math.imul(y,aa)|0,d=d+Math.imul(u,ca)|0,e=e+Math.imul(u,da)|0,e=e+Math.imul(v,ca)|0,f=f+Math.imul(v,da)|0,d=d+Math.imul(r,fa)|0,e=e+Math.imul(r,ga)|0,e=e+Math.imul(s,fa)|0,f=f+Math.imul(s,ga)|0,d=d+Math.imul(o,ia)|0,e=e+Math.imul(o,ja)|0,e=e+Math.imul(p,ia)|0,f=f+Math.imul(p,ja)|0,d=d+Math.imul(l,la)|0,e=e+Math.imul(l,ma)|0,e=e+Math.imul(m,la)|0,f=f+Math.imul(m,ma)|0;var ya=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(ya>>>26)|0,ya&=67108863,d=Math.imul(M,P),e=Math.imul(M,Q),e=e+Math.imul(N,P)|0,f=Math.imul(N,Q),d=d+Math.imul(J,S)|0,e=e+Math.imul(J,T)|0,e=e+Math.imul(K,S)|0,f=f+Math.imul(K,T)|0,d=d+Math.imul(G,V)|0,e=e+Math.imul(G,W)|0,e=e+Math.imul(H,V)|0,f=f+Math.imul(H,W)|0,d=d+Math.imul(D,Y)|0,e=e+Math.imul(D,Z)|0,e=e+Math.imul(E,Y)|0,f=f+Math.imul(E,Z)|0,d=d+Math.imul(A,_)|0,e=e+Math.imul(A,aa)|0,e=e+Math.imul(B,_)|0,f=f+Math.imul(B,aa)|0,d=d+Math.imul(x,ca)|0,e=e+Math.imul(x,da)|0,e=e+Math.imul(y,ca)|0,f=f+Math.imul(y,da)|0,d=d+Math.imul(u,fa)|0,e=e+Math.imul(u,ga)|0,e=e+Math.imul(v,fa)|0,f=f+Math.imul(v,ga)|0,d=d+Math.imul(r,ia)|0,e=e+Math.imul(r,ja)|0,e=e+Math.imul(s,ia)|0,f=f+Math.imul(s,ja)|0,d=d+Math.imul(o,la)|0,e=e+Math.imul(o,ma)|0,e=e+Math.imul(p,la)|0,f=f+Math.imul(p,ma)|0,d=d+Math.imul(l,oa)|0,e=e+Math.imul(l,pa)|0,e=e+Math.imul(m,oa)|0,f=f+Math.imul(m,pa)|0;var za=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(za>>>26)|0,za&=67108863,d=Math.imul(M,S),e=Math.imul(M,T),e=e+Math.imul(N,S)|0,f=Math.imul(N,T),d=d+Math.imul(J,V)|0,e=e+Math.imul(J,W)|0,e=e+Math.imul(K,V)|0,f=f+Math.imul(K,W)|0,d=d+Math.imul(G,Y)|0,e=e+Math.imul(G,Z)|0,e=e+Math.imul(H,Y)|0,f=f+Math.imul(H,Z)|0,d=d+Math.imul(D,_)|0,e=e+Math.imul(D,aa)|0,e=e+Math.imul(E,_)|0,f=f+Math.imul(E,aa)|0,d=d+Math.imul(A,ca)|0,e=e+Math.imul(A,da)|0,e=e+Math.imul(B,ca)|0,f=f+Math.imul(B,da)|0,d=d+Math.imul(x,fa)|0,e=e+Math.imul(x,ga)|0,e=e+Math.imul(y,fa)|0,f=f+Math.imul(y,ga)|0,d=d+Math.imul(u,ia)|0,e=e+Math.imul(u,ja)|0,e=e+Math.imul(v,ia)|0,f=f+Math.imul(v,ja)|0,d=d+Math.imul(r,la)|0,e=e+Math.imul(r,ma)|0,e=e+Math.imul(s,la)|0,f=f+Math.imul(s,ma)|0,d=d+Math.imul(o,oa)|0,e=e+Math.imul(o,pa)|0,e=e+Math.imul(p,oa)|0,f=f+Math.imul(p,pa)|0;var Aa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Aa>>>26)|0,Aa&=67108863,d=Math.imul(M,V),e=Math.imul(M,W),e=e+Math.imul(N,V)|0,f=Math.imul(N,W),d=d+Math.imul(J,Y)|0,e=e+Math.imul(J,Z)|0,e=e+Math.imul(K,Y)|0,f=f+Math.imul(K,Z)|0,d=d+Math.imul(G,_)|0,e=e+Math.imul(G,aa)|0,e=e+Math.imul(H,_)|0,f=f+Math.imul(H,aa)|0,d=d+Math.imul(D,ca)|0,e=e+Math.imul(D,da)|0,e=e+Math.imul(E,ca)|0,f=f+Math.imul(E,da)|0,d=d+Math.imul(A,fa)|0,e=e+Math.imul(A,ga)|0,e=e+Math.imul(B,fa)|0,f=f+Math.imul(B,ga)|0,d=d+Math.imul(x,ia)|0,e=e+Math.imul(x,ja)|0,e=e+Math.imul(y,ia)|0,f=f+Math.imul(y,ja)|0,d=d+Math.imul(u,la)|0,e=e+Math.imul(u,ma)|0,e=e+Math.imul(v,la)|0,f=f+Math.imul(v,ma)|0,d=d+Math.imul(r,oa)|0,e=e+Math.imul(r,pa)|0,e=e+Math.imul(s,oa)|0,f=f+Math.imul(s,pa)|0;var Ba=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ba>>>26)|0,Ba&=67108863,d=Math.imul(M,Y),e=Math.imul(M,Z),e=e+Math.imul(N,Y)|0,f=Math.imul(N,Z),d=d+Math.imul(J,_)|0,e=e+Math.imul(J,aa)|0,e=e+Math.imul(K,_)|0,f=f+Math.imul(K,aa)|0,d=d+Math.imul(G,ca)|0,e=e+Math.imul(G,da)|0,e=e+Math.imul(H,ca)|0,f=f+Math.imul(H,da)|0,d=d+Math.imul(D,fa)|0,e=e+Math.imul(D,ga)|0,e=e+Math.imul(E,fa)|0,f=f+Math.imul(E,ga)|0,d=d+Math.imul(A,ia)|0,e=e+Math.imul(A,ja)|0,e=e+Math.imul(B,ia)|0,f=f+Math.imul(B,ja)|0,d=d+Math.imul(x,la)|0,e=e+Math.imul(x,ma)|0,e=e+Math.imul(y,la)|0,f=f+Math.imul(y,ma)|0,d=d+Math.imul(u,oa)|0,
10
e=e+Math.imul(u,pa)|0,e=e+Math.imul(v,oa)|0,f=f+Math.imul(v,pa)|0;var Ca=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ca>>>26)|0,Ca&=67108863,d=Math.imul(M,_),e=Math.imul(M,aa),e=e+Math.imul(N,_)|0,f=Math.imul(N,aa),d=d+Math.imul(J,ca)|0,e=e+Math.imul(J,da)|0,e=e+Math.imul(K,ca)|0,f=f+Math.imul(K,da)|0,d=d+Math.imul(G,fa)|0,e=e+Math.imul(G,ga)|0,e=e+Math.imul(H,fa)|0,f=f+Math.imul(H,ga)|0,d=d+Math.imul(D,ia)|0,e=e+Math.imul(D,ja)|0,e=e+Math.imul(E,ia)|0,f=f+Math.imul(E,ja)|0,d=d+Math.imul(A,la)|0,e=e+Math.imul(A,ma)|0,e=e+Math.imul(B,la)|0,f=f+Math.imul(B,ma)|0,d=d+Math.imul(x,oa)|0,e=e+Math.imul(x,pa)|0,e=e+Math.imul(y,oa)|0,f=f+Math.imul(y,pa)|0;var Da=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Da>>>26)|0,Da&=67108863,d=Math.imul(M,ca),e=Math.imul(M,da),e=e+Math.imul(N,ca)|0,f=Math.imul(N,da),d=d+Math.imul(J,fa)|0,e=e+Math.imul(J,ga)|0,e=e+Math.imul(K,fa)|0,f=f+Math.imul(K,ga)|0,d=d+Math.imul(G,ia)|0,e=e+Math.imul(G,ja)|0,e=e+Math.imul(H,ia)|0,f=f+Math.imul(H,ja)|0,d=d+Math.imul(D,la)|0,e=e+Math.imul(D,ma)|0,e=e+Math.imul(E,la)|0,f=f+Math.imul(E,ma)|0,d=d+Math.imul(A,oa)|0,e=e+Math.imul(A,pa)|0,e=e+Math.imul(B,oa)|0,f=f+Math.imul(B,pa)|0;var Ea=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ea>>>26)|0,Ea&=67108863,d=Math.imul(M,fa),e=Math.imul(M,ga),e=e+Math.imul(N,fa)|0,f=Math.imul(N,ga),d=d+Math.imul(J,ia)|0,e=e+Math.imul(J,ja)|0,e=e+Math.imul(K,ia)|0,f=f+Math.imul(K,ja)|0,d=d+Math.imul(G,la)|0,e=e+Math.imul(G,ma)|0,e=e+Math.imul(H,la)|0,f=f+Math.imul(H,ma)|0,d=d+Math.imul(D,oa)|0,e=e+Math.imul(D,pa)|0,e=e+Math.imul(E,oa)|0,f=f+Math.imul(E,pa)|0;var Fa=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Fa>>>26)|0,Fa&=67108863,d=Math.imul(M,ia),e=Math.imul(M,ja),e=e+Math.imul(N,ia)|0,f=Math.imul(N,ja),d=d+Math.imul(J,la)|0,e=e+Math.imul(J,ma)|0,e=e+Math.imul(K,la)|0,f=f+Math.imul(K,ma)|0,d=d+Math.imul(G,oa)|0,e=e+Math.imul(G,pa)|0,e=e+Math.imul(H,oa)|0,f=f+Math.imul(H,pa)|0;var Ga=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ga>>>26)|0,Ga&=67108863,d=Math.imul(M,la),e=Math.imul(M,ma),e=e+Math.imul(N,la)|0,f=Math.imul(N,ma),d=d+Math.imul(J,oa)|0,e=e+Math.imul(J,pa)|0,e=e+Math.imul(K,oa)|0,f=f+Math.imul(K,pa)|0;var Ha=(j+d|0)+((8191&e)<<13)|0;j=(f+(e>>>13)|0)+(Ha>>>26)|0,Ha&=67108863,d=Math.imul(M,oa),e=Math.imul(M,pa),e=e+Math.imul(N,oa)|0,f=Math.imul(N,pa);var Ia=(j+d|0)+((8191&e)<<13)|0;return j=(f+(e>>>13)|0)+(Ia>>>26)|0,Ia&=67108863,i[0]=qa,i[1]=ra,i[2]=sa,i[3]=ta,i[4]=ua,i[5]=va,i[6]=wa,i[7]=xa,i[8]=ya,i[9]=za,i[10]=Aa,i[11]=Ba,i[12]=Ca,i[13]=Da,i[14]=Ea,i[15]=Fa,i[16]=Ga,i[17]=Ha,i[18]=Ia,0!==j&&(i[19]=j,c.length++),c};Math.imul||(x=j),f.prototype.mulTo=function(a,b){var c,d=this.length+a.length;return c=10===this.length&&10===a.length?x(this,a,b):d<63?j(this,a,b):d<1024?k(this,a,b):l(this,a,b)},m.prototype.makeRBT=function(a){for(var b=new Array(a),c=f.prototype._countBits(a)-1,d=0;d<a;d++)b[d]=this.revBin(d,c,a);return b},m.prototype.revBin=function(a,b,c){if(0===a||a===c-1)return a;for(var d=0,e=0;e<b;e++)d|=(1&a)<<b-e-1,a>>=1;return d},m.prototype.permute=function(a,b,c,d,e,f){for(var g=0;g<f;g++)d[g]=b[a[g]],e[g]=c[a[g]]},m.prototype.transform=function(a,b,c,d,e,f){this.permute(f,a,b,c,d,e);for(var g=1;g<e;g<<=1)for(var h=g<<1,i=Math.cos(2*Math.PI/h),j=Math.sin(2*Math.PI/h),k=0;k<e;k+=h)for(var l=i,m=j,n=0;n<g;n++){var o=c[k+n],p=d[k+n],q=c[k+n+g],r=d[k+n+g],s=l*q-m*r;r=l*r+m*q,q=s,c[k+n]=o+q,d[k+n]=p+r,c[k+n+g]=o-q,d[k+n+g]=p-r,n!==h&&(s=i*l-j*m,m=i*m+j*l,l=s)}},m.prototype.guessLen13b=function(a,b){var c=1|Math.max(b,a),d=1&c,e=0;for(c=c/2|0;c;c>>>=1)e++;return 1<<e+1+d},m.prototype.conjugate=function(a,b,c){if(!(c<=1))for(var d=0;d<c/2;d++){var e=a[d];a[d]=a[c-d-1],a[c-d-1]=e,e=b[d],b[d]=-b[c-d-1],b[c-d-1]=-e}},m.prototype.normalize13b=function(a,b){for(var c=0,d=0;d<b/2;d++){var e=8192*Math.round(a[2*d+1]/b)+Math.round(a[2*d]/b)+c;a[d]=67108863&e,c=e<67108864?0:e/67108864|0}return a},m.prototype.convert13b=function(a,b,c,e){for(var f=0,g=0;g<b;g++)f+=0|a[g],c[2*g]=8191&f,f>>>=13,c[2*g+1]=8191&f,f>>>=13;for(g=2*b;g<e;++g)c[g]=0;d(0===f),d(0===(f&-8192))},m.prototype.stub=function(a){for(var b=new Array(a),c=0;c<a;c++)b[c]=0;return b},m.prototype.mulp=function(a,b,c){var d=2*this.guessLen13b(a.length,b.length),e=this.makeRBT(d),f=this.stub(d),g=new Array(d),h=new Array(d),i=new Array(d),j=new Array(d),k=new Array(d),l=new Array(d),m=c.words;m.length=d,this.convert13b(a.words,a.length,g,d),this.convert13b(b.words,b.length,j,d),this.transform(g,f,h,i,d,e),this.transform(j,f,k,l,d,e);for(var n=0;n<d;n++){var o=h[n]*k[n]-i[n]*l[n];i[n]=h[n]*l[n]+i[n]*k[n],h[n]=o}return this.conjugate(h,i,d),this.transform(h,i,m,f,d,e),this.conjugate(m,f,d),this.normalize13b(m,d),c.negative=a.negative^b.negative,c.length=a.length+b.length,c.strip()},f.prototype.mul=function(a){var b=new f(null);return b.words=new Array(this.length+a.length),this.mulTo(a,b)},f.prototype.mulf=function(a){var b=new f(null);return b.words=new Array(this.length+a.length),l(this,a,b)},f.prototype.imul=function(a){return this.clone().mulTo(a,this)},f.prototype.imuln=function(a){d("number"==typeof a),d(a<67108864);for(var b=0,c=0;c<this.length;c++){var e=(0|this.words[c])*a,f=(67108863&e)+(67108863&b);b>>=26,b+=e/67108864|0,b+=f>>>26,this.words[c]=67108863&f}return 0!==b&&(this.words[c]=b,this.length++),this},f.prototype.muln=function(a){return this.clone().imuln(a)},f.prototype.sqr=function(){return this.mul(this)},f.prototype.isqr=function(){return this.imul(this.clone())},f.prototype.pow=function(a){var b=i(a);if(0===b.length)return new f(1);for(var c=this,d=0;d<b.length&&0===b[d];d++,c=c.sqr());if(++d<b.length)for(var e=c.sqr();d<b.length;d++,e=e.sqr())0!==b[d]&&(c=c.mul(e));return c},f.prototype.iushln=function(a){d("number"==typeof a&&a>=0);var b,c=a%26,e=(a-c)/26,f=67108863>>>26-c<<26-c;if(0!==c){var g=0;for(b=0;b<this.length;b++){var h=this.words[b]&f,i=(0|this.words[b])-h<<c;this.words[b]=i|g,g=h>>>26-c}g&&(this.words[b]=g,this.length++)}if(0!==e){for(b=this.length-1;b>=0;b--)this.words[b+e]=this.words[b];for(b=0;b<e;b++)this.words[b]=0;this.length+=e}return this.strip()},f.prototype.ishln=function(a){return d(0===this.negative),this.iushln(a)},f.prototype.iushrn=function(a,b,c){d("number"==typeof a&&a>=0);var e;e=b?(b-b%26)/26:0;var f=a%26,g=Math.min((a-f)/26,this.length),h=67108863^67108863>>>f<<f,i=c;if(e-=g,e=Math.max(0,e),i){for(var j=0;j<g;j++)i.words[j]=this.words[j];i.length=g}if(0===g);else if(this.length>g)for(this.length-=g,j=0;j<this.length;j++)this.words[j]=this.words[j+g];else this.words[0]=0,this.length=1;var k=0;for(j=this.length-1;j>=0&&(0!==k||j>=e);j--){var l=0|this.words[j];this.words[j]=k<<26-f|l>>>f,k=l&h}return i&&0!==k&&(i.words[i.length++]=k),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},f.prototype.ishrn=function(a,b,c){return d(0===this.negative),this.iushrn(a,b,c)},f.prototype.shln=function(a){return this.clone().ishln(a)},f.prototype.ushln=function(a){return this.clone().iushln(a)},f.prototype.shrn=function(a){return this.clone().ishrn(a)},f.prototype.ushrn=function(a){return this.clone().iushrn(a)},f.prototype.testn=function(a){d("number"==typeof a&&a>=0);var b=a%26,c=(a-b)/26,e=1<<b;if(this.length<=c)return!1;var f=this.words[c];return!!(f&e)},f.prototype.imaskn=function(a){d("number"==typeof a&&a>=0);var b=a%26,c=(a-b)/26;if(d(0===this.negative,"imaskn works only with positive numbers"),this.length<=c)return this;if(0!==b&&c++,this.length=Math.min(c,this.length),0!==b){var e=67108863^67108863>>>b<<b;this.words[this.length-1]&=e}return this.strip()},f.prototype.maskn=function(a){return this.clone().imaskn(a)},f.prototype.iaddn=function(a){return d("number"==typeof a),d(a<67108864),a<0?this.isubn(-a):0!==this.negative?1===this.length&&(0|this.words[0])<a?(this.words[0]=a-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(a),this.negative=1,this):this._iaddn(a)},f.prototype._iaddn=function(a){this.words[0]+=a;for(var b=0;b<this.length&&this.words[b]>=67108864;b++)this.words[b]-=67108864,b===this.length-1?this.words[b+1]=1:this.words[b+1]++;return this.length=Math.max(this.length,b+1),this},f.prototype.isubn=function(a){if(d("number"==typeof a),d(a<67108864),a<0)return this.iaddn(-a);if(0!==this.negative)return this.negative=0,this.iaddn(a),this.negative=1,this;if(this.words[0]-=a,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var b=0;b<this.length&&this.words[b]<0;b++)this.words[b]+=67108864,this.words[b+1]-=1;return this.strip()},f.prototype.addn=function(a){return this.clone().iaddn(a)},f.prototype.subn=function(a){return this.clone().isubn(a)},f.prototype.iabs=function(){return this.negative=0,this},f.prototype.abs=function(){return this.clone().iabs()},f.prototype._ishlnsubmul=function(a,b,c){var e,f=a.length+c;this._expand(f);var g,h=0;for(e=0;e<a.length;e++){g=(0|this.words[e+c])+h;var i=(0|a.words[e])*b;g-=67108863&i,h=(g>>26)-(i/67108864|0),this.words[e+c]=67108863&g}for(;e<this.length-c;e++)g=(0|this.words[e+c])+h,h=g>>26,this.words[e+c]=67108863&g;if(0===h)return this.strip();for(d(h===-1),h=0,e=0;e<this.length;e++)g=-(0|this.words[e])+h,h=g>>26,this.words[e]=67108863&g;return this.negative=1,this.strip()},f.prototype._wordDiv=function(a,b){var c=this.length-a.length,d=this.clone(),e=a,g=0|e.words[e.length-1],h=this._countBits(g);c=26-h,0!==c&&(e=e.ushln(c),d.iushln(c),g=0|e.words[e.length-1]);var i,j=d.length-e.length;if("mod"!==b){i=new f(null),i.length=j+1,i.words=new Array(i.length);for(var k=0;k<i.length;k++)i.words[k]=0}var l=d.clone()._ishlnsubmul(e,1,j);0===l.negative&&(d=l,i&&(i.words[j]=1));for(var m=j-1;m>=0;m--){var n=67108864*(0|d.words[e.length+m])+(0|d.words[e.length+m-1]);for(n=Math.min(n/g|0,67108863),d._ishlnsubmul(e,n,m);0!==d.negative;)n--,d.negative=0,d._ishlnsubmul(e,1,m),d.isZero()||(d.negative^=1);i&&(i.words[m]=n)}return i&&i.strip(),d.strip(),"div"!==b&&0!==c&&d.iushrn(c),{div:i||null,mod:d}},f.prototype.divmod=function(a,b,c){if(d(!a.isZero()),this.isZero())return{div:new f(0),mod:new f(0)};var e,g,h;return 0!==this.negative&&0===a.negative?(h=this.neg().divmod(a,b),"mod"!==b&&(e=h.div.neg()),"div"!==b&&(g=h.mod.neg(),c&&0!==g.negative&&g.iadd(a)),{div:e,mod:g}):0===this.negative&&0!==a.negative?(h=this.divmod(a.neg(),b),"mod"!==b&&(e=h.div.neg()),{div:e,mod:h.mod}):0!==(this.negative&a.negative)?(h=this.neg().divmod(a.neg(),b),"div"!==b&&(g=h.mod.neg(),c&&0!==g.negative&&g.isub(a)),{div:h.div,mod:g}):a.length>this.length||this.cmp(a)<0?{div:new f(0),mod:this}:1===a.length?"div"===b?{div:this.divn(a.words[0]),mod:null}:"mod"===b?{div:null,mod:new f(this.modn(a.words[0]))}:{div:this.divn(a.words[0]),mod:new f(this.modn(a.words[0]))}:this._wordDiv(a,b)},f.prototype.div=function(a){return this.divmod(a,"div",!1).div},f.prototype.mod=function(a){return this.divmod(a,"mod",!1).mod},f.prototype.umod=function(a){return this.divmod(a,"mod",!0).mod},f.prototype.divRound=function(a){var b=this.divmod(a);if(b.mod.isZero())return b.div;var c=0!==b.div.negative?b.mod.isub(a):b.mod,d=a.ushrn(1),e=a.andln(1),f=c.cmp(d);return f<0||1===e&&0===f?b.div:0!==b.div.negative?b.div.isubn(1):b.div.iaddn(1)},f.prototype.modn=function(a){d(a<=67108863);for(var b=(1<<26)%a,c=0,e=this.length-1;e>=0;e--)c=(b*c+(0|this.words[e]))%a;return c},f.prototype.idivn=function(a){d(a<=67108863);for(var b=0,c=this.length-1;c>=0;c--){var e=(0|this.words[c])+67108864*b;this.words[c]=e/a|0,b=e%a}return this.strip()},f.prototype.divn=function(a){return this.clone().idivn(a)},f.prototype.egcd=function(a){d(0===a.negative),d(!a.isZero());var b=this,c=a.clone();b=0!==b.negative?b.umod(a):b.clone();for(var e=new f(1),g=new f(0),h=new f(0),i=new f(1),j=0;b.isEven()&&c.isEven();)b.iushrn(1),c.iushrn(1),++j;for(var k=c.clone(),l=b.clone();!b.isZero();){for(var m=0,n=1;0===(b.words[0]&n)&&m<26;++m,n<<=1);if(m>0)for(b.iushrn(m);m-- >0;)(e.isOdd()||g.isOdd())&&(e.iadd(k),g.isub(l)),e.iushrn(1),g.iushrn(1);for(var o=0,p=1;0===(c.words[0]&p)&&o<26;++o,p<<=1);if(o>0)for(c.iushrn(o);o-- >0;)(h.isOdd()||i.isOdd())&&(h.iadd(k),i.isub(l)),h.iushrn(1),i.iushrn(1);b.cmp(c)>=0?(b.isub(c),e.isub(h),g.isub(i)):(c.isub(b),h.isub(e),i.isub(g))}return{a:h,b:i,gcd:c.iushln(j)}},f.prototype._invmp=function(a){d(0===a.negative),d(!a.isZero());var b=this,c=a.clone();b=0!==b.negative?b.umod(a):b.clone();for(var e=new f(1),g=new f(0),h=c.clone();b.cmpn(1)>0&&c.cmpn(1)>0;){for(var i=0,j=1;0===(b.words[0]&j)&&i<26;++i,j<<=1);if(i>0)for(b.iushrn(i);i-- >0;)e.isOdd()&&e.iadd(h),e.iushrn(1);for(var k=0,l=1;0===(c.words[0]&l)&&k<26;++k,l<<=1);if(k>0)for(c.iushrn(k);k-- >0;)g.isOdd()&&g.iadd(h),g.iushrn(1);b.cmp(c)>=0?(b.isub(c),e.isub(g)):(c.isub(b),g.isub(e))}var m;return m=0===b.cmpn(1)?e:g,m.cmpn(0)<0&&m.iadd(a),m},f.prototype.gcd=function(a){if(this.isZero())return a.abs();if(a.isZero())return this.abs();var b=this.clone(),c=a.clone();b.negative=0,c.negative=0;for(var d=0;b.isEven()&&c.isEven();d++)b.iushrn(1),c.iushrn(1);for(;;){for(;b.isEven();)b.iushrn(1);for(;c.isEven();)c.iushrn(1);var e=b.cmp(c);if(e<0){var f=b;b=c,c=f}else if(0===e||0===c.cmpn(1))break;b.isub(c)}return c.iushln(d)},f.prototype.invm=function(a){return this.egcd(a).a.umod(a)},f.prototype.isEven=function(){return 0===(1&this.words[0])},f.prototype.isOdd=function(){return 1===(1&this.words[0])},f.prototype.andln=function(a){return this.words[0]&a},f.prototype.bincn=function(a){d("number"==typeof a);var b=a%26,c=(a-b)/26,e=1<<b;if(this.length<=c)return this._expand(c+1),this.words[c]|=e,this;for(var f=e,g=c;0!==f&&g<this.length;g++){var h=0|this.words[g];h+=f,f=h>>>26,h&=67108863,this.words[g]=h}return 0!==f&&(this.words[g]=f,this.length++),this},f.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},f.prototype.cmpn=function(a){var b=a<0;if(0!==this.negative&&!b)return-1;if(0===this.negative&&b)return 1;this.strip();var c;if(this.length>1)c=1;else{b&&(a=-a),d(a<=67108863,"Number is too big");var e=0|this.words[0];c=e===a?0:e<a?-1:1}return 0!==this.negative?0|-c:c},f.prototype.cmp=function(a){if(0!==this.negative&&0===a.negative)return-1;if(0===this.negative&&0!==a.negative)return 1;var b=this.ucmp(a);return 0!==this.negative?0|-b:b},f.prototype.ucmp=function(a){if(this.length>a.length)return 1;if(this.length<a.length)return-1;for(var b=0,c=this.length-1;c>=0;c--){var d=0|this.words[c],e=0|a.words[c];if(d!==e){d<e?b=-1:d>e&&(b=1);break}}return b},f.prototype.gtn=function(a){return 1===this.cmpn(a)},f.prototype.gt=function(a){return 1===this.cmp(a)},f.prototype.gten=function(a){return this.cmpn(a)>=0},f.prototype.gte=function(a){return this.cmp(a)>=0},f.prototype.ltn=function(a){return this.cmpn(a)===-1},f.prototype.lt=function(a){return this.cmp(a)===-1},f.prototype.lten=function(a){return this.cmpn(a)<=0},f.prototype.lte=function(a){return this.cmp(a)<=0},f.prototype.eqn=function(a){return 0===this.cmpn(a)},f.prototype.eq=function(a){return 0===this.cmp(a)},f.red=function(a){return new s(a)},f.prototype.toRed=function(a){return d(!this.red,"Already a number in reduction context"),d(0===this.negative,"red works only with positives"),a.convertTo(this)._forceRed(a)},f.prototype.fromRed=function(){return d(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},f.prototype._forceRed=function(a){return this.red=a,this},f.prototype.forceRed=function(a){return d(!this.red,"Already a number in reduction context"),this._forceRed(a)},f.prototype.redAdd=function(a){return d(this.red,"redAdd works only with red numbers"),this.red.add(this,a)},f.prototype.redIAdd=function(a){return d(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,a)},f.prototype.redSub=function(a){return d(this.red,"redSub works only with red numbers"),this.red.sub(this,a)},f.prototype.redISub=function(a){return d(this.red,"redISub works only with red numbers"),this.red.isub(this,a)},f.prototype.redShl=function(a){return d(this.red,"redShl works only with red numbers"),this.red.shl(this,a)},f.prototype.redMul=function(a){return d(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.mul(this,a)},f.prototype.redIMul=function(a){return d(this.red,"redMul works only with red numbers"),this.red._verify2(this,a),this.red.imul(this,a)},f.prototype.redSqr=function(){return d(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},f.prototype.redISqr=function(){return d(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},f.prototype.redSqrt=function(){return d(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},f.prototype.redInvm=function(){return d(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},f.prototype.redNeg=function(){return d(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},f.prototype.redPow=function(a){return d(this.red&&!a.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,a)};var y={k256:null,p224:null,p192:null,p25519:null};n.prototype._tmp=function(){var a=new f(null);return a.words=new Array(Math.ceil(this.n/13)),a},n.prototype.ireduce=function(a){var b,c=a;do this.split(c,this.tmp),c=this.imulK(c),c=c.iadd(this.tmp),b=c.bitLength();while(b>this.n);var d=b<this.n?-1:c.ucmp(this.p);return 0===d?(c.words[0]=0,c.length=1):d>0?c.isub(this.p):c.strip(),c},n.prototype.split=function(a,b){a.iushrn(this.n,0,b)},n.prototype.imulK=function(a){return a.imul(this.k)},e(o,n),o.prototype.split=function(a,b){for(var c=4194303,d=Math.min(a.length,9),e=0;e<d;e++)b.words[e]=a.words[e];if(b.length=d,a.length<=9)return a.words[0]=0,void(a.length=1);var f=a.words[9];for(b.words[b.length++]=f&c,e=10;e<a.length;e++){var g=0|a.words[e];a.words[e-10]=(g&c)<<4|f>>>22,f=g}f>>>=22,a.words[e-10]=f,0===f&&a.length>10?a.length-=10:a.length-=9},o.prototype.imulK=function(a){a.words[a.length]=0,a.words[a.length+1]=0,a.length+=2;for(var b=0,c=0;c<a.length;c++){var d=0|a.words[c];b+=977*d,a.words[c]=67108863&b,b=64*d+(b/67108864|0)}return 0===a.words[a.length-1]&&(a.length--,0===a.words[a.length-1]&&a.length--),a},e(p,n),e(q,n),e(r,n),r.prototype.imulK=function(a){for(var b=0,c=0;c<a.length;c++){var d=19*(0|a.words[c])+b,e=67108863&d;d>>>=26,a.words[c]=e,b=d}return 0!==b&&(a.words[a.length++]=b),a},f._prime=function a(b){if(y[b])return y[b];var a;if("k256"===b)a=new o;else if("p224"===b)a=new p;else if("p192"===b)a=new q;else{if("p25519"!==b)throw new Error("Unknown prime "+b);a=new r}return y[b]=a,a},s.prototype._verify1=function(a){d(0===a.negative,"red works only with positives"),d(a.red,"red works only with red numbers")},s.prototype._verify2=function(a,b){d(0===(a.negative|b.negative),"red works only with positives"),d(a.red&&a.red===b.red,"red works only with red numbers")},s.prototype.imod=function(a){return this.prime?this.prime.ireduce(a)._forceRed(this):a.umod(this.m)._forceRed(this)},s.prototype.neg=function(a){return a.isZero()?a.clone():this.m.sub(a)._forceRed(this)},s.prototype.add=function(a,b){this._verify2(a,b);var c=a.add(b);return c.cmp(this.m)>=0&&c.isub(this.m),c._forceRed(this)},s.prototype.iadd=function(a,b){this._verify2(a,b);var c=a.iadd(b);return c.cmp(this.m)>=0&&c.isub(this.m),c},s.prototype.sub=function(a,b){this._verify2(a,b);var c=a.sub(b);return c.cmpn(0)<0&&c.iadd(this.m),c._forceRed(this)},s.prototype.isub=function(a,b){this._verify2(a,b);var c=a.isub(b);return c.cmpn(0)<0&&c.iadd(this.m),c},s.prototype.shl=function(a,b){return this._verify1(a),this.imod(a.ushln(b))},s.prototype.imul=function(a,b){return this._verify2(a,b),this.imod(a.imul(b))},s.prototype.mul=function(a,b){return this._verify2(a,b),this.imod(a.mul(b))},s.prototype.isqr=function(a){return this.imul(a,a.clone())},s.prototype.sqr=function(a){return this.mul(a,a)},s.prototype.sqrt=function(a){if(a.isZero())return a.clone();var b=this.m.andln(3);if(d(b%2===1),3===b){var c=this.m.add(new f(1)).iushrn(2);return this.pow(a,c)}for(var e=this.m.subn(1),g=0;!e.isZero()&&0===e.andln(1);)g++,e.iushrn(1);d(!e.isZero());var h=new f(1).toRed(this),i=h.redNeg(),j=this.m.subn(1).iushrn(1),k=this.m.bitLength();for(k=new f(2*k*k).toRed(this);0!==this.pow(k,j).cmp(i);)k.redIAdd(i);for(var l=this.pow(k,e),m=this.pow(a,e.addn(1).iushrn(1)),n=this.pow(a,e),o=g;0!==n.cmp(h);){for(var p=n,q=0;0!==p.cmp(h);q++)p=p.redSqr();d(q<o);var r=this.pow(l,new f(1).iushln(o-q-1));m=m.redMul(r),l=r.redSqr(),n=n.redMul(l),o=q}return m},s.prototype.invm=function(a){var b=a._invmp(this.m);return 0!==b.negative?(b.negative=0,this.imod(b).redNeg()):this.imod(b)},s.prototype.pow=function(a,b){if(b.isZero())return new f(1).toRed(this);if(0===b.cmpn(1))return a.clone();var c=4,d=new Array(1<<c);d[0]=new f(1).toRed(this),d[1]=a;for(var e=2;e<d.length;e++)d[e]=this.mul(d[e-1],a);var g=d[0],h=0,i=0,j=b.bitLength()%26;for(0===j&&(j=26),e=b.length-1;e>=0;e--){for(var k=b.words[e],l=j-1;l>=0;l--){var m=k>>l&1;g!==d[0]&&(g=this.sqr(g)),0!==m||0!==h?(h<<=1,h|=m,i++,(i===c||0===e&&0===l)&&(g=this.mul(g,d[h]),i=0,h=0)):i=0}j=26}return g},s.prototype.convertTo=function(a){var b=a.umod(this.m);return b===a?b.clone():b},s.prototype.convertFrom=function(a){var b=a.clone();return b.red=null,b},f.mont=function(a){return new t(a)},e(t,s),t.prototype.convertTo=function(a){return this.imod(a.ushln(this.shift))},t.prototype.convertFrom=function(a){var b=this.imod(a.mul(this.rinv));return b.red=null,b},t.prototype.imul=function(a,b){if(a.isZero()||b.isZero())return a.words[0]=0,a.length=1,a;var c=a.imul(b),d=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=c.isub(d).iushrn(this.shift),f=e;return e.cmp(this.m)>=0?f=e.isub(this.m):e.cmpn(0)<0&&(f=e.iadd(this.m)),f._forceRed(this)},t.prototype.mul=function(a,b){if(a.isZero()||b.isZero())return new f(0)._forceRed(this);var c=a.mul(b),d=c.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=c.isub(d).iushrn(this.shift),g=e;return e.cmp(this.m)>=0?g=e.isub(this.m):e.cmpn(0)<0&&(g=e.iadd(this.m)),g._forceRed(this)},t.prototype.invm=function(a){var b=this.imod(a._invmp(this.m).mul(this.r2));return b._forceRed(this)}}("undefined"==typeof b||b,this)},{buffer:77}],112:[function(a,b,c){"use strict";var d=c;d.version=a("../package.json").version,d.utils=a("./elliptic/utils"),d.rand=a("brorand"),d.curve=a("./elliptic/curve"),d.curves=a("./elliptic/curves"),d.ec=a("./elliptic/ec"),d.eddsa=a("./elliptic/eddsa")},{"../package.json":127,"./elliptic/curve":115,"./elliptic/curves":118,"./elliptic/ec":119,"./elliptic/eddsa":122,"./elliptic/utils":126,brorand:76}],113:[function(a,b,c){"use strict";function d(a,b){this.type=a,this.p=new f(b.p,16),this.red=b.prime?f.red(b.prime):f.mont(this.p),this.zero=new f(0).toRed(this.red),this.one=new f(1).toRed(this.red),this.two=new f(2).toRed(this.red),this.n=b.n&&new f(b.n,16),this.g=b.g&&this.pointFromJSON(b.g,b.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4);var c=this.n&&this.p.div(this.n);!c||c.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function e(a,b){this.curve=a,this.type=b,this.precomputed=null}var f=a("bn.js"),g=a("../../elliptic"),h=g.utils,i=h.getNAF,j=h.getJSF,k=h.assert;b.exports=d,d.prototype.point=function(){throw new Error("Not implemented")},d.prototype.validate=function(){throw new Error("Not implemented")},d.prototype._fixedNafMul=function(a,b){k(a.precomputed);var c=a._getDoubles(),d=i(b,1),e=(1<<c.step+1)-(c.step%2===0?2:1);e/=3;for(var f=[],g=0;g<d.length;g+=c.step){for(var h=0,b=g+c.step-1;b>=g;b--)h=(h<<1)+d[b];f.push(h)}for(var j=this.jpoint(null,null,null),l=this.jpoint(null,null,null),m=e;m>0;m--){for(var g=0;g<f.length;g++){var h=f[g];h===m?l=l.mixedAdd(c.points[g]):h===-m&&(l=l.mixedAdd(c.points[g].neg()))}j=j.add(l)}return j.toP()},d.prototype._wnafMul=function(a,b){var c=4,d=a._getNAFPoints(c);c=d.wnd;for(var e=d.points,f=i(b,c),g=this.jpoint(null,null,null),h=f.length-1;h>=0;h--){for(var b=0;h>=0&&0===f[h];h--)b++;if(h>=0&&b++,g=g.dblp(b),h<0)break;var j=f[h];k(0!==j),g="affine"===a.type?j>0?g.mixedAdd(e[j-1>>1]):g.mixedAdd(e[-j-1>>1].neg()):j>0?g.add(e[j-1>>1]):g.add(e[-j-1>>1].neg())}return"affine"===a.type?g.toP():g},d.prototype._wnafMulAdd=function(a,b,c,d,e){for(var f=this._wnafT1,g=this._wnafT2,h=this._wnafT3,k=0,l=0;l<d;l++){var m=b[l],n=m._getNAFPoints(a);f[l]=n.wnd,g[l]=n.points}for(var l=d-1;l>=1;l-=2){var o=l-1,p=l;if(1===f[o]&&1===f[p]){var q=[b[o],null,null,b[p]];0===b[o].y.cmp(b[p].y)?(q[1]=b[o].add(b[p]),q[2]=b[o].toJ().mixedAdd(b[p].neg())):0===b[o].y.cmp(b[p].y.redNeg())?(q[1]=b[o].toJ().mixedAdd(b[p]),q[2]=b[o].add(b[p].neg())):(q[1]=b[o].toJ().mixedAdd(b[p]),q[2]=b[o].toJ().mixedAdd(b[p].neg()));var r=[-3,-1,-5,-7,0,7,5,1,3],s=j(c[o],c[p]);k=Math.max(s[0].length,k),h[o]=new Array(k),h[p]=new Array(k);for(var t=0;t<k;t++){var u=0|s[0][t],v=0|s[1][t];h[o][t]=r[3*(u+1)+(v+1)],h[p][t]=0,g[o]=q}}else h[o]=i(c[o],f[o]),h[p]=i(c[p],f[p]),k=Math.max(h[o].length,k),k=Math.max(h[p].length,k)}for(var w=this.jpoint(null,null,null),x=this._wnafT4,l=k;l>=0;l--){for(var y=0;l>=0;){for(var z=!0,t=0;t<d;t++)x[t]=0|h[t][l],0!==x[t]&&(z=!1);if(!z)break;y++,l--}if(l>=0&&y++,w=w.dblp(y),l<0)break;for(var t=0;t<d;t++){var m,A=x[t];0!==A&&(A>0?m=g[t][A-1>>1]:A<0&&(m=g[t][-A-1>>1].neg()),w="affine"===m.type?w.mixedAdd(m):w.add(m))}}for(var l=0;l<d;l++)g[l]=null;return e?w:w.toP()},d.BasePoint=e,e.prototype.eq=function(){throw new Error("Not implemented")},e.prototype.validate=function(){return this.curve.validate(this)},d.prototype.decodePoint=function(a,b){a=h.toArray(a,b);var c=this.p.byteLength();if((4===a[0]||6===a[0]||7===a[0])&&a.length-1===2*c){6===a[0]?k(a[a.length-1]%2===0):7===a[0]&&k(a[a.length-1]%2===1);var d=this.point(a.slice(1,1+c),a.slice(1+c,1+2*c));return d}if((2===a[0]||3===a[0])&&a.length-1===c)return this.pointFromX(a.slice(1,1+c),3===a[0]);throw new Error("Unknown point format")},e.prototype.encodeCompressed=function(a){return this.encode(a,!0)},e.prototype._encode=function(a){var b=this.curve.p.byteLength(),c=this.getX().toArray("be",b);return a?[this.getY().isEven()?2:3].concat(c):[4].concat(c,this.getY().toArray("be",b))},e.prototype.encode=function(a,b){return h.encode(this._encode(b),a)},e.prototype.precompute=function(a){if(this.precomputed)return this;var b={doubles:null,naf:null,beta:null};return b.naf=this._getNAFPoints(8),b.doubles=this._getDoubles(4,a),b.beta=this._getBeta(),this.precomputed=b,this},e.prototype._hasDoubles=function(a){if(!this.precomputed)return!1;var b=this.precomputed.doubles;return!!b&&b.points.length>=Math.ceil((a.bitLength()+1)/b.step)},e.prototype._getDoubles=function(a,b){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var c=[this],d=this,e=0;e<b;e+=a){for(var f=0;f<a;f++)d=d.dbl();c.push(d)}return{step:a,points:c}},e.prototype._getNAFPoints=function(a){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var b=[this],c=(1<<a)-1,d=1===c?null:this.dbl(),e=1;e<c;e++)b[e]=b[e-1].add(d);return{wnd:a,points:b}},e.prototype._getBeta=function(){return null},e.prototype.dblp=function(a){for(var b=this,c=0;c<a;c++)b=b.dbl();return b}},{"../../elliptic":112,"bn.js":111}],114:[function(a,b,c){"use strict";function d(a){this.twisted=1!==(0|a.a),this.mOneA=this.twisted&&(0|a.a)===-1,this.extended=this.mOneA,i.call(this,"edwards",a),this.a=new g(a.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new g(a.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new g(a.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),j(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1===(0|a.c)}function Point(a,b,c,d,e){i.BasePoint.call(this,a,"projective"),null===b&&null===c&&null===d?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new g(b,16),this.y=new g(c,16),this.z=d?new g(d,16):this.curve.one,this.t=e&&new g(e,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}var e=a("../curve"),f=a("../../elliptic"),g=a("bn.js"),h=a("inherits"),i=e.base,j=f.utils.assert;h(d,i),b.exports=d,d.prototype._mulA=function(a){return this.mOneA?a.redNeg():this.a.redMul(a)},d.prototype._mulC=function(a){return this.oneC?a:this.c.redMul(a)},d.prototype.jpoint=function(a,b,c,d){return this.point(a,b,c,d)},d.prototype.pointFromX=function(a,b){a=new g(a,16),a.red||(a=a.toRed(this.red));var c=a.redSqr(),d=this.c2.redSub(this.a.redMul(c)),e=this.one.redSub(this.c2.redMul(this.d).redMul(c)),f=d.redMul(e.redInvm()),h=f.redSqrt();if(0!==h.redSqr().redSub(f).cmp(this.zero))throw new Error("invalid point");var i=h.fromRed().isOdd();return(b&&!i||!b&&i)&&(h=h.redNeg()),this.point(a,h)},d.prototype.pointFromY=function(a,b){a=new g(a,16),a.red||(a=a.toRed(this.red));var c=a.redSqr(),d=c.redSub(this.one),e=c.redMul(this.d).redAdd(this.one),f=d.redMul(e.redInvm());if(0===f.cmp(this.zero)){if(b)throw new Error("invalid point");return this.point(this.zero,a)}var h=f.redSqrt();if(0!==h.redSqr().redSub(f).cmp(this.zero))throw new Error("invalid point");return h.isOdd()!==b&&(h=h.redNeg()),this.point(h,a)},d.prototype.validate=function(a){if(a.isInfinity())return!0;a.normalize();var b=a.x.redSqr(),c=a.y.redSqr(),d=b.redMul(this.a).redAdd(c),e=this.c2.redMul(this.one.redAdd(this.d.redMul(b).redMul(c)));return 0===d.cmp(e)},h(Point,i.BasePoint),d.prototype.pointFromJSON=function(a){return Point.fromJSON(this,a)},d.prototype.point=function(a,b,c,d){return new Point(this,a,b,c,d)},Point.fromJSON=function(a,b){return new Point(a,b[0],b[1],b[2])},Point.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Point.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&0===this.y.cmp(this.z)},Point.prototype._extDbl=function(){var a=this.x.redSqr(),b=this.y.redSqr(),c=this.z.redSqr();c=c.redIAdd(c);var d=this.curve._mulA(a),e=this.x.redAdd(this.y).redSqr().redISub(a).redISub(b),f=d.redAdd(b),g=f.redSub(c),h=d.redSub(b),i=e.redMul(g),j=f.redMul(h),k=e.redMul(h),l=g.redMul(f);return this.curve.point(i,j,l,k)},Point.prototype._projDbl=function(){var a,b,c,d=this.x.redAdd(this.y).redSqr(),e=this.x.redSqr(),f=this.y.redSqr();if(this.curve.twisted){var g=this.curve._mulA(e),h=g.redAdd(f);if(this.zOne)a=d.redSub(e).redSub(f).redMul(h.redSub(this.curve.two)),b=h.redMul(g.redSub(f)),c=h.redSqr().redSub(h).redSub(h);else{var i=this.z.redSqr(),j=h.redSub(i).redISub(i);a=d.redSub(e).redISub(f).redMul(j),b=h.redMul(g.redSub(f)),c=h.redMul(j)}}else{var g=e.redAdd(f),i=this.curve._mulC(this.c.redMul(this.z)).redSqr(),j=g.redSub(i).redSub(i);a=this.curve._mulC(d.redISub(g)).redMul(j),b=this.curve._mulC(g).redMul(e.redISub(f)),c=g.redMul(j)}return this.curve.point(a,b,c)},Point.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},Point.prototype._extAdd=function(a){var b=this.y.redSub(this.x).redMul(a.y.redSub(a.x)),c=this.y.redAdd(this.x).redMul(a.y.redAdd(a.x)),d=this.t.redMul(this.curve.dd).redMul(a.t),e=this.z.redMul(a.z.redAdd(a.z)),f=c.redSub(b),g=e.redSub(d),h=e.redAdd(d),i=c.redAdd(b),j=f.redMul(g),k=h.redMul(i),l=f.redMul(i),m=g.redMul(h);return this.curve.point(j,k,m,l)},Point.prototype._projAdd=function(a){var b,c,d=this.z.redMul(a.z),e=d.redSqr(),f=this.x.redMul(a.x),g=this.y.redMul(a.y),h=this.curve.d.redMul(f).redMul(g),i=e.redSub(h),j=e.redAdd(h),k=this.x.redAdd(this.y).redMul(a.x.redAdd(a.y)).redISub(f).redISub(g),l=d.redMul(i).redMul(k);return this.curve.twisted?(b=d.redMul(j).redMul(g.redSub(this.curve._mulA(f))),c=i.redMul(j)):(b=d.redMul(j).redMul(g.redSub(f)),
11
c=this.curve._mulC(i).redMul(j)),this.curve.point(l,b,c)},Point.prototype.add=function(a){return this.isInfinity()?a:a.isInfinity()?this:this.curve.extended?this._extAdd(a):this._projAdd(a)},Point.prototype.mul=function(a){return this._hasDoubles(a)?this.curve._fixedNafMul(this,a):this.curve._wnafMul(this,a)},Point.prototype.mulAdd=function(a,b,c){return this.curve._wnafMulAdd(1,[this,b],[a,c],2,!1)},Point.prototype.jmulAdd=function(a,b,c){return this.curve._wnafMulAdd(1,[this,b],[a,c],2,!0)},Point.prototype.normalize=function(){if(this.zOne)return this;var a=this.z.redInvm();return this.x=this.x.redMul(a),this.y=this.y.redMul(a),this.t&&(this.t=this.t.redMul(a)),this.z=this.curve.one,this.zOne=!0,this},Point.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()},Point.prototype.getY=function(){return this.normalize(),this.y.fromRed()},Point.prototype.eq=function(a){return this===a||0===this.getX().cmp(a.getX())&&0===this.getY().cmp(a.getY())},Point.prototype.eqXToP=function(a){var b=a.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(b))return!0;for(var c=a.clone(),d=this.curve.redN.redMul(this.z);;){if(c.iadd(this.curve.n),c.cmp(this.curve.p)>=0)return!1;if(b.redIAdd(d),0===this.x.cmp(b))return!0}return!1},Point.prototype.toP=Point.prototype.normalize,Point.prototype.mixedAdd=Point.prototype.add},{"../../elliptic":112,"../curve":115,"bn.js":111,inherits:246}],115:[function(a,b,c){"use strict";var d=c;d.base=a("./base"),d.short=a("./short"),d.mont=a("./mont"),d.edwards=a("./edwards")},{"./base":113,"./edwards":114,"./mont":116,"./short":117}],116:[function(a,b,c){"use strict";function d(a){h.call(this,"mont",a),this.a=new f(a.a,16).toRed(this.red),this.b=new f(a.b,16).toRed(this.red),this.i4=new f(4).toRed(this.red).redInvm(),this.two=new f(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function Point(a,b,c){h.BasePoint.call(this,a,"projective"),null===b&&null===c?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new f(b,16),this.z=new f(c,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}var e=a("../curve"),f=a("bn.js"),g=a("inherits"),h=e.base,i=a("../../elliptic"),j=i.utils;g(d,h),b.exports=d,d.prototype.validate=function(a){var b=a.normalize().x,c=b.redSqr(),d=c.redMul(b).redAdd(c.redMul(this.a)).redAdd(b),e=d.redSqrt();return 0===e.redSqr().cmp(d)},g(Point,h.BasePoint),d.prototype.decodePoint=function(a,b){return this.point(j.toArray(a,b),1)},d.prototype.point=function(a,b){return new Point(this,a,b)},d.prototype.pointFromJSON=function(a){return Point.fromJSON(this,a)},Point.prototype.precompute=function(){},Point.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},Point.fromJSON=function(a,b){return new Point(a,b[0],b[1]||a.one)},Point.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},Point.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},Point.prototype.dbl=function(){var a=this.x.redAdd(this.z),b=a.redSqr(),c=this.x.redSub(this.z),d=c.redSqr(),e=b.redSub(d),f=b.redMul(d),g=e.redMul(d.redAdd(this.curve.a24.redMul(e)));return this.curve.point(f,g)},Point.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.diffAdd=function(a,b){var c=this.x.redAdd(this.z),d=this.x.redSub(this.z),e=a.x.redAdd(a.z),f=a.x.redSub(a.z),g=f.redMul(c),h=e.redMul(d),i=b.z.redMul(g.redAdd(h).redSqr()),j=b.x.redMul(g.redISub(h).redSqr());return this.curve.point(i,j)},Point.prototype.mul=function(a){for(var b=a.clone(),c=this,d=this.curve.point(null,null),e=this,f=[];0!==b.cmpn(0);b.iushrn(1))f.push(b.andln(1));for(var g=f.length-1;g>=0;g--)0===f[g]?(c=c.diffAdd(d,e),d=d.dbl()):(d=c.diffAdd(d,e),c=c.dbl());return d},Point.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},Point.prototype.eq=function(a){return 0===this.getX().cmp(a.getX())},Point.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},Point.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../../elliptic":112,"../curve":115,"bn.js":111,inherits:246}],117:[function(a,b,c){"use strict";function d(a){j.call(this,"short",a),this.a=new h(a.a,16).toRed(this.red),this.b=new h(a.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(a),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function Point(a,b,c,d){j.BasePoint.call(this,a,"affine"),null===b&&null===c?(this.x=null,this.y=null,this.inf=!0):(this.x=new h(b,16),this.y=new h(c,16),d&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function e(a,b,c,d){j.BasePoint.call(this,a,"jacobian"),null===b&&null===c&&null===d?(this.x=this.curve.one,this.y=this.curve.one,this.z=new h(0)):(this.x=new h(b,16),this.y=new h(c,16),this.z=new h(d,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}var f=a("../curve"),g=a("../../elliptic"),h=a("bn.js"),i=a("inherits"),j=f.base,k=g.utils.assert;i(d,j),b.exports=d,d.prototype._getEndomorphism=function(a){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var b,c;if(a.beta)b=new h(a.beta,16).toRed(this.red);else{var d=this._getEndoRoots(this.p);b=d[0].cmp(d[1])<0?d[0]:d[1],b=b.toRed(this.red)}if(a.lambda)c=new h(a.lambda,16);else{var e=this._getEndoRoots(this.n);0===this.g.mul(e[0]).x.cmp(this.g.x.redMul(b))?c=e[0]:(c=e[1],k(0===this.g.mul(c).x.cmp(this.g.x.redMul(b))))}var f;return f=a.basis?a.basis.map(function(a){return{a:new h(a.a,16),b:new h(a.b,16)}}):this._getEndoBasis(c),{beta:b,lambda:c,basis:f}}},d.prototype._getEndoRoots=function(a){var b=a===this.p?this.red:h.mont(a),c=new h(2).toRed(b).redInvm(),d=c.redNeg(),e=new h(3).toRed(b).redNeg().redSqrt().redMul(c),f=d.redAdd(e).fromRed(),g=d.redSub(e).fromRed();return[f,g]},d.prototype._getEndoBasis=function(a){for(var b,c,d,e,f,g,i,j,k,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),m=a,n=this.n.clone(),o=new h(1),p=new h(0),q=new h(0),r=new h(1),s=0;0!==m.cmpn(0);){var t=n.div(m);j=n.sub(t.mul(m)),k=q.sub(t.mul(o));var u=r.sub(t.mul(p));if(!d&&j.cmp(l)<0)b=i.neg(),c=o,d=j.neg(),e=k;else if(d&&2===++s)break;i=j,n=m,m=j,q=o,o=k,r=p,p=u}f=j.neg(),g=k;var v=d.sqr().add(e.sqr()),w=f.sqr().add(g.sqr());return w.cmp(v)>=0&&(f=b,g=c),d.negative&&(d=d.neg(),e=e.neg()),f.negative&&(f=f.neg(),g=g.neg()),[{a:d,b:e},{a:f,b:g}]},d.prototype._endoSplit=function(a){var b=this.endo.basis,c=b[0],d=b[1],e=d.b.mul(a).divRound(this.n),f=c.b.neg().mul(a).divRound(this.n),g=e.mul(c.a),h=f.mul(d.a),i=e.mul(c.b),j=f.mul(d.b),k=a.sub(g).sub(h),l=i.add(j).neg();return{k1:k,k2:l}},d.prototype.pointFromX=function(a,b){a=new h(a,16),a.red||(a=a.toRed(this.red));var c=a.redSqr().redMul(a).redIAdd(a.redMul(this.a)).redIAdd(this.b),d=c.redSqrt();if(0!==d.redSqr().redSub(c).cmp(this.zero))throw new Error("invalid point");var e=d.fromRed().isOdd();return(b&&!e||!b&&e)&&(d=d.redNeg()),this.point(a,d)},d.prototype.validate=function(a){if(a.inf)return!0;var b=a.x,c=a.y,d=this.a.redMul(b),e=b.redSqr().redMul(b).redIAdd(d).redIAdd(this.b);return 0===c.redSqr().redISub(e).cmpn(0)},d.prototype._endoWnafMulAdd=function(a,b,c){for(var d=this._endoWnafT1,e=this._endoWnafT2,f=0;f<a.length;f++){var g=this._endoSplit(b[f]),h=a[f],i=h._getBeta();g.k1.negative&&(g.k1.ineg(),h=h.neg(!0)),g.k2.negative&&(g.k2.ineg(),i=i.neg(!0)),d[2*f]=h,d[2*f+1]=i,e[2*f]=g.k1,e[2*f+1]=g.k2}for(var j=this._wnafMulAdd(1,d,e,2*f,c),k=0;k<2*f;k++)d[k]=null,e[k]=null;return j},i(Point,j.BasePoint),d.prototype.point=function(a,b,c){return new Point(this,a,b,c)},d.prototype.pointFromJSON=function(a,b){return Point.fromJSON(this,a,b)},Point.prototype._getBeta=function(){if(this.curve.endo){var a=this.precomputed;if(a&&a.beta)return a.beta;var b=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(a){var c=this.curve,d=function(a){return c.point(a.x.redMul(c.endo.beta),a.y)};a.beta=b,b.precomputed={beta:null,naf:a.naf&&{wnd:a.naf.wnd,points:a.naf.points.map(d)},doubles:a.doubles&&{step:a.doubles.step,points:a.doubles.points.map(d)}}}return b}},Point.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},Point.fromJSON=function(a,b,c){function d(b){return a.point(b[0],b[1],c)}"string"==typeof b&&(b=JSON.parse(b));var e=a.point(b[0],b[1],c);if(!b[2])return e;var f=b[2];return e.precomputed={beta:null,doubles:f.doubles&&{step:f.doubles.step,points:[e].concat(f.doubles.points.map(d))},naf:f.naf&&{wnd:f.naf.wnd,points:[e].concat(f.naf.points.map(d))}},e},Point.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},Point.prototype.isInfinity=function(){return this.inf},Point.prototype.add=function(a){if(this.inf)return a;if(a.inf)return this;if(this.eq(a))return this.dbl();if(this.neg().eq(a))return this.curve.point(null,null);if(0===this.x.cmp(a.x))return this.curve.point(null,null);var b=this.y.redSub(a.y);0!==b.cmpn(0)&&(b=b.redMul(this.x.redSub(a.x).redInvm()));var c=b.redSqr().redISub(this.x).redISub(a.x),d=b.redMul(this.x.redSub(c)).redISub(this.y);return this.curve.point(c,d)},Point.prototype.dbl=function(){if(this.inf)return this;var a=this.y.redAdd(this.y);if(0===a.cmpn(0))return this.curve.point(null,null);var b=this.curve.a,c=this.x.redSqr(),d=a.redInvm(),e=c.redAdd(c).redIAdd(c).redIAdd(b).redMul(d),f=e.redSqr().redISub(this.x.redAdd(this.x)),g=e.redMul(this.x.redSub(f)).redISub(this.y);return this.curve.point(f,g)},Point.prototype.getX=function(){return this.x.fromRed()},Point.prototype.getY=function(){return this.y.fromRed()},Point.prototype.mul=function(a){return a=new h(a,16),this._hasDoubles(a)?this.curve._fixedNafMul(this,a):this.curve.endo?this.curve._endoWnafMulAdd([this],[a]):this.curve._wnafMul(this,a)},Point.prototype.mulAdd=function(a,b,c){var d=[this,b],e=[a,c];return this.curve.endo?this.curve._endoWnafMulAdd(d,e):this.curve._wnafMulAdd(1,d,e,2)},Point.prototype.jmulAdd=function(a,b,c){var d=[this,b],e=[a,c];return this.curve.endo?this.curve._endoWnafMulAdd(d,e,!0):this.curve._wnafMulAdd(1,d,e,2,!0)},Point.prototype.eq=function(a){return this===a||this.inf===a.inf&&(this.inf||0===this.x.cmp(a.x)&&0===this.y.cmp(a.y))},Point.prototype.neg=function(a){if(this.inf)return this;var b=this.curve.point(this.x,this.y.redNeg());if(a&&this.precomputed){var c=this.precomputed,d=function(a){return a.neg()};b.precomputed={naf:c.naf&&{wnd:c.naf.wnd,points:c.naf.points.map(d)},doubles:c.doubles&&{step:c.doubles.step,points:c.doubles.points.map(d)}}}return b},Point.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var a=this.curve.jpoint(this.x,this.y,this.curve.one);return a},i(e,j.BasePoint),d.prototype.jpoint=function(a,b,c){return new e(this,a,b,c)},e.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var a=this.z.redInvm(),b=a.redSqr(),c=this.x.redMul(b),d=this.y.redMul(b).redMul(a);return this.curve.point(c,d)},e.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},e.prototype.add=function(a){if(this.isInfinity())return a;if(a.isInfinity())return this;var b=a.z.redSqr(),c=this.z.redSqr(),d=this.x.redMul(b),e=a.x.redMul(c),f=this.y.redMul(b.redMul(a.z)),g=a.y.redMul(c.redMul(this.z)),h=d.redSub(e),i=f.redSub(g);if(0===h.cmpn(0))return 0!==i.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var j=h.redSqr(),k=j.redMul(h),l=d.redMul(j),m=i.redSqr().redIAdd(k).redISub(l).redISub(l),n=i.redMul(l.redISub(m)).redISub(f.redMul(k)),o=this.z.redMul(a.z).redMul(h);return this.curve.jpoint(m,n,o)},e.prototype.mixedAdd=function(a){if(this.isInfinity())return a.toJ();if(a.isInfinity())return this;var b=this.z.redSqr(),c=this.x,d=a.x.redMul(b),e=this.y,f=a.y.redMul(b).redMul(this.z),g=c.redSub(d),h=e.redSub(f);if(0===g.cmpn(0))return 0!==h.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var i=g.redSqr(),j=i.redMul(g),k=c.redMul(i),l=h.redSqr().redIAdd(j).redISub(k).redISub(k),m=h.redMul(k.redISub(l)).redISub(e.redMul(j)),n=this.z.redMul(g);return this.curve.jpoint(l,m,n)},e.prototype.dblp=function(a){if(0===a)return this;if(this.isInfinity())return this;if(!a)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var b=this,c=0;c<a;c++)b=b.dbl();return b}for(var d=this.curve.a,e=this.curve.tinv,f=this.x,g=this.y,h=this.z,i=h.redSqr().redSqr(),j=g.redAdd(g),c=0;c<a;c++){var k=f.redSqr(),l=j.redSqr(),m=l.redSqr(),n=k.redAdd(k).redIAdd(k).redIAdd(d.redMul(i)),o=f.redMul(l),p=n.redSqr().redISub(o.redAdd(o)),q=o.redISub(p),r=n.redMul(q);r=r.redIAdd(r).redISub(m);var s=j.redMul(h);c+1<a&&(i=i.redMul(m)),f=p,h=s,j=r}return this.curve.jpoint(f,j.redMul(e),h)},e.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},e.prototype._zeroDbl=function(){var a,b,c;if(this.zOne){var d=this.x.redSqr(),e=this.y.redSqr(),f=e.redSqr(),g=this.x.redAdd(e).redSqr().redISub(d).redISub(f);g=g.redIAdd(g);var h=d.redAdd(d).redIAdd(d),i=h.redSqr().redISub(g).redISub(g),j=f.redIAdd(f);j=j.redIAdd(j),j=j.redIAdd(j),a=i,b=h.redMul(g.redISub(i)).redISub(j),c=this.y.redAdd(this.y)}else{var k=this.x.redSqr(),l=this.y.redSqr(),m=l.redSqr(),n=this.x.redAdd(l).redSqr().redISub(k).redISub(m);n=n.redIAdd(n);var o=k.redAdd(k).redIAdd(k),p=o.redSqr(),q=m.redIAdd(m);q=q.redIAdd(q),q=q.redIAdd(q),a=p.redISub(n).redISub(n),b=o.redMul(n.redISub(a)).redISub(q),c=this.y.redMul(this.z),c=c.redIAdd(c)}return this.curve.jpoint(a,b,c)},e.prototype._threeDbl=function(){var a,b,c;if(this.zOne){var d=this.x.redSqr(),e=this.y.redSqr(),f=e.redSqr(),g=this.x.redAdd(e).redSqr().redISub(d).redISub(f);g=g.redIAdd(g);var h=d.redAdd(d).redIAdd(d).redIAdd(this.curve.a),i=h.redSqr().redISub(g).redISub(g);a=i;var j=f.redIAdd(f);j=j.redIAdd(j),j=j.redIAdd(j),b=h.redMul(g.redISub(i)).redISub(j),c=this.y.redAdd(this.y)}else{var k=this.z.redSqr(),l=this.y.redSqr(),m=this.x.redMul(l),n=this.x.redSub(k).redMul(this.x.redAdd(k));n=n.redAdd(n).redIAdd(n);var o=m.redIAdd(m);o=o.redIAdd(o);var p=o.redAdd(o);a=n.redSqr().redISub(p),c=this.y.redAdd(this.z).redSqr().redISub(l).redISub(k);var q=l.redSqr();q=q.redIAdd(q),q=q.redIAdd(q),q=q.redIAdd(q),b=n.redMul(o.redISub(a)).redISub(q)}return this.curve.jpoint(a,b,c)},e.prototype._dbl=function(){var a=this.curve.a,b=this.x,c=this.y,d=this.z,e=d.redSqr().redSqr(),f=b.redSqr(),g=c.redSqr(),h=f.redAdd(f).redIAdd(f).redIAdd(a.redMul(e)),i=b.redAdd(b);i=i.redIAdd(i);var j=i.redMul(g),k=h.redSqr().redISub(j.redAdd(j)),l=j.redISub(k),m=g.redSqr();m=m.redIAdd(m),m=m.redIAdd(m),m=m.redIAdd(m);var n=h.redMul(l).redISub(m),o=c.redAdd(c).redMul(d);return this.curve.jpoint(k,n,o)},e.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var a=this.x.redSqr(),b=this.y.redSqr(),c=this.z.redSqr(),d=b.redSqr(),e=a.redAdd(a).redIAdd(a),f=e.redSqr(),g=this.x.redAdd(b).redSqr().redISub(a).redISub(d);g=g.redIAdd(g),g=g.redAdd(g).redIAdd(g),g=g.redISub(f);var h=g.redSqr(),i=d.redIAdd(d);i=i.redIAdd(i),i=i.redIAdd(i),i=i.redIAdd(i);var j=e.redIAdd(g).redSqr().redISub(f).redISub(h).redISub(i),k=b.redMul(j);k=k.redIAdd(k),k=k.redIAdd(k);var l=this.x.redMul(h).redISub(k);l=l.redIAdd(l),l=l.redIAdd(l);var m=this.y.redMul(j.redMul(i.redISub(j)).redISub(g.redMul(h)));m=m.redIAdd(m),m=m.redIAdd(m),m=m.redIAdd(m);var n=this.z.redAdd(g).redSqr().redISub(c).redISub(h);return this.curve.jpoint(l,m,n)},e.prototype.mul=function(a,b){return a=new h(a,b),this.curve._wnafMul(this,a)},e.prototype.eq=function(a){if("affine"===a.type)return this.eq(a.toJ());if(this===a)return!0;var b=this.z.redSqr(),c=a.z.redSqr();if(0!==this.x.redMul(c).redISub(a.x.redMul(b)).cmpn(0))return!1;var d=b.redMul(this.z),e=c.redMul(a.z);return 0===this.y.redMul(e).redISub(a.y.redMul(d)).cmpn(0)},e.prototype.eqXToP=function(a){var b=this.z.redSqr(),c=a.toRed(this.curve.red).redMul(b);if(0===this.x.cmp(c))return!0;for(var d=a.clone(),e=this.curve.redN.redMul(b);;){if(d.iadd(this.curve.n),d.cmp(this.curve.p)>=0)return!1;if(c.redIAdd(e),0===this.x.cmp(c))return!0}return!1},e.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},e.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../../elliptic":112,"../curve":115,"bn.js":111,inherits:246}],118:[function(a,b,c){"use strict";function d(a){"short"===a.type?this.curve=new h.curve.short(a):"edwards"===a.type?this.curve=new h.curve.edwards(a):this.curve=new h.curve.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function e(a,b){Object.defineProperty(f,a,{configurable:!0,enumerable:!0,get:function(){var c=new d(b);return Object.defineProperty(f,a,{configurable:!0,enumerable:!0,value:c}),c}})}var f=c,g=a("hash.js"),h=a("../elliptic"),i=h.utils.assert;f.PresetCurve=d,e("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:g.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),e("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:g.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),e("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:g.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),e("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:g.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"]}),e("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:g.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"]}),e("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:g.sha256,gRed:!1,g:["9"]}),e("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:g.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var j;try{j=a("./precomputed/secp256k1")}catch(a){j=void 0}e("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:g.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",j]})},{"../elliptic":112,"./precomputed/secp256k1":125,"hash.js":231}],119:[function(a,b,c){"use strict";function d(a){return this instanceof d?("string"==typeof a&&(i(g.curves.hasOwnProperty(a),"Unknown curve "+a),a=g.curves[a]),a instanceof g.curves.PresetCurve&&(a={curve:a}),this.curve=a.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=a.curve.g,this.g.precompute(a.curve.n.bitLength()+1),void(this.hash=a.hash||a.curve.hash)):new d(a)}var e=a("bn.js"),f=a("hmac-drbg"),g=a("../../elliptic"),h=g.utils,i=h.assert,j=a("./key"),k=a("./signature");b.exports=d,d.prototype.keyPair=function(a){return new j(this,a)},d.prototype.keyFromPrivate=function(a,b){return j.fromPrivate(this,a,b)},d.prototype.keyFromPublic=function(a,b){return j.fromPublic(this,a,b)},d.prototype.genKeyPair=function(a){a||(a={});for(var b=new f({hash:this.hash,pers:a.pers,persEnc:a.persEnc||"utf8",entropy:a.entropy||g.rand(this.hash.hmacStrength),entropyEnc:a.entropy&&a.entropyEnc||"utf8",nonce:this.n.toArray()}),c=this.n.byteLength(),d=this.n.sub(new e(2));;){var h=new e(b.generate(c));if(!(h.cmp(d)>0))return h.iaddn(1),this.keyFromPrivate(h)}},d.prototype._truncateToN=function(a,b){var c=8*a.byteLength()-this.n.bitLength();return c>0&&(a=a.ushrn(c)),!b&&a.cmp(this.n)>=0?a.sub(this.n):a},d.prototype.sign=function(a,b,c,d){"object"==typeof c&&(d=c,c=null),d||(d={}),b=this.keyFromPrivate(b,c),a=this._truncateToN(new e(a,16));for(var g=this.n.byteLength(),h=b.getPrivate().toArray("be",g),i=a.toArray("be",g),j=new f({hash:this.hash,entropy:h,nonce:i,pers:d.pers,persEnc:d.persEnc||"utf8"}),l=this.n.sub(new e(1)),m=0;!0;m++){var n=d.k?d.k(m):new e(j.generate(this.n.byteLength()));if(n=this._truncateToN(n,!0),!(n.cmpn(1)<=0||n.cmp(l)>=0)){var o=this.g.mul(n);if(!o.isInfinity()){var p=o.getX(),q=p.umod(this.n);if(0!==q.cmpn(0)){var r=n.invm(this.n).mul(q.mul(b.getPrivate()).iadd(a));if(r=r.umod(this.n),0!==r.cmpn(0)){var s=(o.getY().isOdd()?1:0)|(0!==p.cmp(q)?2:0);return d.canonical&&r.cmp(this.nh)>0&&(r=this.n.sub(r),s^=1),new k({r:q,s:r,recoveryParam:s})}}}}}},d.prototype.verify=function(a,b,c,d){a=this._truncateToN(new e(a,16)),c=this.keyFromPublic(c,d),b=new k(b,"hex");var f=b.r,g=b.s;if(f.cmpn(1)<0||f.cmp(this.n)>=0)return!1;if(g.cmpn(1)<0||g.cmp(this.n)>=0)return!1;var h=g.invm(this.n),i=h.mul(a).umod(this.n),j=h.mul(f).umod(this.n);if(!this.curve._maxwellTrick){var l=this.g.mulAdd(i,c.getPublic(),j);return!l.isInfinity()&&0===l.getX().umod(this.n).cmp(f)}var l=this.g.jmulAdd(i,c.getPublic(),j);return!l.isInfinity()&&l.eqXToP(f)},d.prototype.recoverPubKey=function(a,b,c,d){i((3&c)===c,"The recovery param is more than two bits"),b=new k(b,d);var f=this.n,g=new e(a),h=b.r,j=b.s,l=1&c,m=c>>1;if(h.cmp(this.curve.p.umod(this.curve.n))>=0&&m)throw new Error("Unable to find sencond key candinate");h=m?this.curve.pointFromX(h.add(this.curve.n),l):this.curve.pointFromX(h,l);var n=b.r.invm(f),o=f.sub(g).mul(n).umod(f),p=j.mul(n).umod(f);return this.g.mulAdd(o,h,p)},d.prototype.getKeyRecoveryParam=function(a,b,c,d){if(b=new k(b,d),null!==b.recoveryParam)return b.recoveryParam;for(var e=0;e<4;e++){var f;try{f=this.recoverPubKey(a,b,e)}catch(a){continue}if(f.eq(c))return e}throw new Error("Unable to find valid recovery factor")}},{"../../elliptic":112,"./key":120,"./signature":121,"bn.js":111,"hmac-drbg":243}],120:[function(a,b,c){"use strict";function d(a,b){this.ec=a,this.priv=null,this.pub=null,b.priv&&this._importPrivate(b.priv,b.privEnc),b.pub&&this._importPublic(b.pub,b.pubEnc)}var e=a("bn.js"),f=a("../../elliptic"),g=f.utils,h=g.assert;b.exports=d,d.fromPublic=function(a,b,c){return b instanceof d?b:new d(a,{pub:b,pubEnc:c})},d.fromPrivate=function(a,b,c){return b instanceof d?b:new d(a,{priv:b,privEnc:c})},d.prototype.validate=function(){var a=this.getPublic();return a.isInfinity()?{result:!1,reason:"Invalid public key"}:a.validate()?a.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},d.prototype.getPublic=function(a,b){return"string"==typeof a&&(b=a,a=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),b?this.pub.encode(b,a):this.pub},d.prototype.getPrivate=function(a){return"hex"===a?this.priv.toString(16,2):this.priv},d.prototype._importPrivate=function(a,b){this.priv=new e(a,b||16),this.priv=this.priv.umod(this.ec.curve.n)},d.prototype._importPublic=function(a,b){return a.x||a.y?("mont"===this.ec.curve.type?h(a.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||h(a.x&&a.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(a.x,a.y))):void(this.pub=this.ec.curve.decodePoint(a,b))},d.prototype.derive=function(a){return a.mul(this.priv).getX()},d.prototype.sign=function(a,b,c){return this.ec.sign(a,this,b,c)},d.prototype.verify=function(a,b){return this.ec.verify(a,b,this)},d.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},{"../../elliptic":112,"bn.js":111}],121:[function(a,b,c){"use strict";function d(a,b){return a instanceof d?a:void(this._importDER(a,b)||(l(a.r&&a.s,"Signature without r or s"),this.r=new i(a.r,16),this.s=new i(a.s,16),void 0===a.recoveryParam?this.recoveryParam=null:this.recoveryParam=a.recoveryParam))}function e(){this.place=0}function f(a,b){var c=a[b.place++];if(!(128&c))return c;for(var d=15&c,e=0,f=0,g=b.place;f<d;f++,g++)e<<=8,e|=a[g];return b.place=g,e}function g(a){for(var b=0,c=a.length-1;!a[b]&&!(128&a[b+1])&&b<c;)b++;return 0===b?a:a.slice(b)}function h(a,b){if(b<128)return void a.push(b);var c=1+(Math.log(b)/Math.LN2>>>3);for(a.push(128|c);--c;)a.push(b>>>(c<<3)&255);a.push(b)}var i=a("bn.js"),j=a("../../elliptic"),k=j.utils,l=k.assert;b.exports=d,d.prototype._importDER=function(a,b){a=k.toArray(a,b);var c=new e;if(48!==a[c.place++])return!1;var d=f(a,c);if(d+c.place!==a.length)return!1;if(2!==a[c.place++])return!1;var g=f(a,c),h=a.slice(c.place,g+c.place);if(c.place+=g,2!==a[c.place++])return!1;var j=f(a,c);if(a.length!==j+c.place)return!1;var l=a.slice(c.place,j+c.place);return 0===h[0]&&128&h[1]&&(h=h.slice(1)),0===l[0]&&128&l[1]&&(l=l.slice(1)),this.r=new i(h),this.s=new i(l),this.recoveryParam=null,!0},d.prototype.toDER=function(a){var b=this.r.toArray(),c=this.s.toArray();for(128&b[0]&&(b=[0].concat(b)),128&c[0]&&(c=[0].concat(c)),b=g(b),c=g(c);!(c[0]||128&c[1]);)c=c.slice(1);var d=[2];h(d,b.length),d=d.concat(b),d.push(2),h(d,c.length);var e=d.concat(c),f=[48];return h(f,e.length),f=f.concat(e),k.encode(f,a)}},{"../../elliptic":112,"bn.js":111}],122:[function(a,b,c){"use strict";function d(a){if(h("ed25519"===a,"only tested with ed25519 so far"),!(this instanceof d))return new d(a);var a=f.curves[a].curve;this.curve=a,this.g=a.g,this.g.precompute(a.n.bitLength()+1),this.pointClass=a.point().constructor,this.encodingLength=Math.ceil(a.n.bitLength()/8),this.hash=e.sha512}var e=a("hash.js"),f=a("../../elliptic"),g=f.utils,h=g.assert,i=g.parseBytes,j=a("./key"),k=a("./signature");b.exports=d,d.prototype.sign=function(a,b){a=i(a);var c=this.keyFromSecret(b),d=this.hashInt(c.messagePrefix(),a),e=this.g.mul(d),f=this.encodePoint(e),g=this.hashInt(f,c.pubBytes(),a).mul(c.priv()),h=d.add(g).umod(this.curve.n);return this.makeSignature({R:e,S:h,Rencoded:f})},d.prototype.verify=function(a,b,c){a=i(a),b=this.makeSignature(b);var d=this.keyFromPublic(c),e=this.hashInt(b.Rencoded(),d.pubBytes(),a),f=this.g.mul(b.S()),g=b.R().add(d.pub().mul(e));return g.eq(f)},d.prototype.hashInt=function(){for(var a=this.hash(),b=0;b<arguments.length;b++)a.update(arguments[b]);return g.intFromLE(a.digest()).umod(this.curve.n)},d.prototype.keyFromPublic=function(a){return j.fromPublic(this,a)},d.prototype.keyFromSecret=function(a){return j.fromSecret(this,a)},d.prototype.makeSignature=function(a){return a instanceof k?a:new k(this,a)},d.prototype.encodePoint=function(a){var b=a.getY().toArray("le",this.encodingLength);return b[this.encodingLength-1]|=a.getX().isOdd()?128:0,b},d.prototype.decodePoint=function(a){a=g.parseBytes(a);var b=a.length-1,c=a.slice(0,b).concat(a[b]&-129),d=0!==(128&a[b]),e=g.intFromLE(c);return this.curve.pointFromY(e,d)},d.prototype.encodeInt=function(a){return a.toArray("le",this.encodingLength)},d.prototype.decodeInt=function(a){return g.intFromLE(a)},d.prototype.isPoint=function(a){return a instanceof this.pointClass}},{"../../elliptic":112,"./key":123,"./signature":124,"hash.js":231}],123:[function(a,b,c){"use strict";function d(a,b){this.eddsa=a,this._secret=h(b.secret),a.isPoint(b.pub)?this._pub=b.pub:this._pubBytes=h(b.pub)}var e=a("../../elliptic"),f=e.utils,g=f.assert,h=f.parseBytes,i=f.cachedProperty;d.fromPublic=function(a,b){return b instanceof d?b:new d(a,{pub:b})},d.fromSecret=function(a,b){return b instanceof d?b:new d(a,{secret:b})},d.prototype.secret=function(){return this._secret},i(d,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),i(d,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),i(d,"privBytes",function(){var a=this.eddsa,b=this.hash(),c=a.encodingLength-1,d=b.slice(0,a.encodingLength);return d[0]&=248,d[c]&=127,d[c]|=64,d}),i(d,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),i(d,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),i(d,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),d.prototype.sign=function(a){return g(this._secret,"KeyPair can only verify"),this.eddsa.sign(a,this)},d.prototype.verify=function(a,b){