@dodoex/wallet-web3 0.0.34-3 → 0.0.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/dist/__node-resolve_empty-82b9d0e4.js +1 -0
  2. package/dist/__tslib-0abc1b4c.js +1 -0
  3. package/dist/{blocto-53865eae.js → blocto-5f313221.js} +1 -1
  4. package/dist/{bn-53c76a3b.js → bn-9ca73e46.js} +1 -1
  5. package/dist/{browser-ponyfill-7755f936.js → browser-ponyfill-0710c79e.js} +1 -1
  6. package/dist/cjs/{__node-resolve_empty-2ed13f23.cjs → __node-resolve_empty-0ecaed18.cjs} +1 -1
  7. package/dist/cjs/__tslib-b7181c88.cjs +1 -0
  8. package/dist/cjs/{blocto-b197e0ed.cjs → blocto-19ac1e61.cjs} +1 -1
  9. package/dist/cjs/{bn-c7b10248.cjs → bn-4591529d.cjs} +1 -1
  10. package/dist/cjs/{browser-ponyfill-06e7485b.cjs → browser-ponyfill-590d98a7.cjs} +1 -1
  11. package/dist/cjs/{draggabilly-b7c8d360.cjs → draggabilly-cb58edd9.cjs} +1 -1
  12. package/dist/cjs/{ethers-5e0917d9.cjs → ethers-744b55fd.cjs} +1 -1
  13. package/dist/cjs/{hash-282034e6.cjs → hash-7ce6fed5.cjs} +1 -1
  14. package/dist/cjs/{id-957afd64.cjs → id-82f9eda5.cjs} +1 -1
  15. package/dist/cjs/{index-d0c28dd5.cjs → index-137c3076.cjs} +1 -1
  16. package/dist/cjs/{index-17201521.cjs → index-2aa37181.cjs} +1 -1
  17. package/dist/cjs/{index-def5ba88.cjs → index-503abeea.cjs} +2 -2
  18. package/dist/cjs/{index-4d630349.cjs → index-89120740.cjs} +1 -1
  19. package/dist/cjs/index-8a46fe81.cjs +1 -0
  20. package/dist/cjs/{index-229ab74e.cjs → index-8ae812d2.cjs} +1 -1
  21. package/dist/cjs/{index-93196761.cjs → index-974f471e.cjs} +1 -1
  22. package/dist/cjs/{index-f31554d5.cjs → index-c6c8c87f.cjs} +1 -1
  23. package/dist/cjs/{index-43ebbf90.cjs → index-e710682a.cjs} +1 -1
  24. package/dist/cjs/{index-d9cd1772.cjs → index-eb9a5bf3.cjs} +1 -1
  25. package/dist/cjs/{index-a65b2ed9.cjs → index-f2695b40.cjs} +1 -1
  26. package/dist/cjs/index.cjs +1 -1
  27. package/dist/cjs/{index.es-a52e6150.cjs → index.es-5465858b.cjs} +1 -1
  28. package/dist/cjs/{interface-f058190d.cjs → interface-def43b4d.cjs} +1 -1
  29. package/dist/cjs/{lib-typedarrays-b1cc17b4.cjs → lib-typedarrays-7895e6b7.cjs} +1 -1
  30. package/dist/cjs/{portis-d26d1211.cjs → portis-19c93a37.cjs} +1 -1
  31. package/dist/cjs/{provider-ff61dd78.cjs → provider-f4c996c1.cjs} +1 -1
  32. package/dist/cjs/{rainbow-67a78559.cjs → rainbow-9d23745a.cjs} +1 -1
  33. package/dist/cjs/{sha224-db87a820.cjs → sha224-0050a3f0.cjs} +1 -1
  34. package/dist/cjs/{sha256-9701fc11.cjs → sha256-590c9926.cjs} +1 -1
  35. package/dist/cjs/{typed-data-687b7cc5.cjs → typed-data-5802eace.cjs} +1 -1
  36. package/dist/cjs/{uAuth-3914d07f.cjs → uAuth-c5e46f86.cjs} +1 -1
  37. package/dist/cjs/{walletConnect-420ae38c.cjs → walletConnect-38fb1a67.cjs} +1 -1
  38. package/dist/cjs/walletLink-43d92a70.cjs +1 -0
  39. package/dist/{draggabilly-6749fb13.js → draggabilly-e28f6ca1.js} +1 -1
  40. package/dist/{ethers-8d0f359b.js → ethers-2d473ac7.js} +1 -1
  41. package/dist/{hash-a9ebd52a.js → hash-b468659c.js} +1 -1
  42. package/dist/{id-9141cd94.js → id-ffcb95de.js} +1 -1
  43. package/dist/{index-38a2b32c.js → index-05263830.js} +1 -1
  44. package/dist/{index-7b1db3a5.js → index-13b4095c.js} +1 -1
  45. package/dist/index-1f76095c.js +1 -0
  46. package/dist/{index-cc4e29b8.js → index-28b4febe.js} +1 -1
  47. package/dist/{index-8400d105.js → index-3b05b9da.js} +1 -1
  48. package/dist/{index-15bdafe8.js → index-54d6f293.js} +1 -1
  49. package/dist/{index-9cb24b04.js → index-7d6bed60.js} +2 -2
  50. package/dist/{index-66fea03f.js → index-8f171ea0.js} +1 -1
  51. package/dist/{index-0ce3be59.js → index-ac52eb44.js} +1 -1
  52. package/dist/{index-028368fa.js → index-c93ac5db.js} +1 -1
  53. package/dist/{index-5abb7d26.js → index-fcfb77a4.js} +1 -1
  54. package/dist/{index.es-97634eaa.js → index.es-671cfa43.js} +1 -1
  55. package/dist/index.js +1 -1
  56. package/dist/{interface-40f53a95.js → interface-cb6da378.js} +1 -1
  57. package/dist/{lib-typedarrays-8f7a7c6f.js → lib-typedarrays-cccf7381.js} +1 -1
  58. package/dist/{portis-4a88a53f.js → portis-cf4fb494.js} +1 -1
  59. package/dist/{provider-6d84aaad.js → provider-708485ee.js} +1 -1
  60. package/dist/rainbow-0c7ce607.js +1 -0
  61. package/dist/{sha224-50b02425.js → sha224-87901239.js} +1 -1
  62. package/dist/{sha256-febb5248.js → sha256-6ce7ae85.js} +1 -1
  63. package/dist/{typed-data-9913b176.js → typed-data-14a23035.js} +1 -1
  64. package/dist/{uAuth-3a1f57d8.js → uAuth-5b79478c.js} +1 -1
  65. package/dist/{walletConnect-d3c8e011.js → walletConnect-fb4e7fb6.js} +1 -1
  66. package/dist/walletLink-6cb2cd2f.js +1 -0
  67. package/package.json +1 -1
  68. package/dist/__node-resolve_empty-5ca02702.js +0 -1
  69. package/dist/__tslib-b57427f1.js +0 -1
  70. package/dist/cjs/__tslib-5075b745.cjs +0 -1
  71. package/dist/cjs/index-cf9228e5.cjs +0 -1
  72. package/dist/cjs/walletLink-2b8a1d57.cjs +0 -1
  73. package/dist/index-30cee19c.js +0 -1
  74. package/dist/rainbow-97391f2e.js +0 -1
  75. package/dist/walletLink-e0a1f4e6.js +0 -1
  76. /package/dist/cjs/{index-cf3bf3b5.cjs → index-b71fbdbb.cjs} +0 -0
  77. /package/dist/cjs/{inherits_browser-f88a000a.cjs → inherits_browser-50deae74.cjs} +0 -0
  78. /package/dist/{index-5a901c0e.js → index-b7d8351d.js} +0 -0
  79. /package/dist/{inherits_browser-06ba108b.js → inherits_browser-51bb8c3c.js} +0 -0
@@ -1 +1 @@
1
- import{i as t}from"./inherits_browser-06ba108b.js";function i(t,i){return i.forEach((function(i){i&&"string"!=typeof i&&!Array.isArray(i)&&Object.keys(i).forEach((function(h){if("default"!==h&&!(h in t)){var n=Object.getOwnPropertyDescriptor(i,h);Object.defineProperty(t,h,n.get?n:{enumerable:!0,get:function(){return i[h]}})}}))})),Object.freeze(t)}var h={},n={},r=e;function e(t,i){if(!t)throw new Error(i||"Assertion failed")}e.equal=function(t,i,h){if(t!=i)throw new Error(h||"Assertion failed: "+t+" != "+i)};var s=r,o=t.exports;function u(t,i){return 55296==(64512&t.charCodeAt(i))&&(!(i<0||i+1>=t.length)&&56320==(64512&t.charCodeAt(i+1)))}function a(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function c(t){return 1===t.length?"0"+t:t}function l(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}n.inherits=o,n.toArray=function(t,i){if(Array.isArray(t))return t.slice();if(!t)return[];var h=[];if("string"==typeof t)if(i){if("hex"===i)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),r=0;r<t.length;r+=2)h.push(parseInt(t[r]+t[r+1],16))}else for(var n=0,r=0;r<t.length;r++){var e=t.charCodeAt(r);e<128?h[n++]=e:e<2048?(h[n++]=e>>6|192,h[n++]=63&e|128):u(t,r)?(e=65536+((1023&e)<<10)+(1023&t.charCodeAt(++r)),h[n++]=e>>18|240,h[n++]=e>>12&63|128,h[n++]=e>>6&63|128,h[n++]=63&e|128):(h[n++]=e>>12|224,h[n++]=e>>6&63|128,h[n++]=63&e|128)}else for(r=0;r<t.length;r++)h[r]=0|t[r];return h},n.toHex=function(t){for(var i="",h=0;h<t.length;h++)i+=c(t[h].toString(16));return i},n.htonl=a,n.toHex32=function(t,i){for(var h="",n=0;n<t.length;n++){var r=t[n];"little"===i&&(r=a(r)),h+=l(r.toString(16))}return h},n.zero2=c,n.zero8=l,n.join32=function(t,i,h,n){var r=h-i;s(r%4==0);for(var e=new Array(r/4),o=0,u=i;o<e.length;o++,u+=4){var a;a="big"===n?t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]:t[u+3]<<24|t[u+2]<<16|t[u+1]<<8|t[u],e[o]=a>>>0}return e},n.split32=function(t,i){for(var h=new Array(4*t.length),n=0,r=0;n<t.length;n++,r+=4){var e=t[n];"big"===i?(h[r]=e>>>24,h[r+1]=e>>>16&255,h[r+2]=e>>>8&255,h[r+3]=255&e):(h[r+3]=e>>>24,h[r+2]=e>>>16&255,h[r+1]=e>>>8&255,h[r]=255&e)}return h},n.rotr32=function(t,i){return t>>>i|t<<32-i},n.rotl32=function(t,i){return t<<i|t>>>32-i},n.sum32=function(t,i){return t+i>>>0},n.sum32_3=function(t,i,h){return t+i+h>>>0},n.sum32_4=function(t,i,h,n){return t+i+h+n>>>0},n.sum32_5=function(t,i,h,n,r){return t+i+h+n+r>>>0},n.sum64=function(t,i,h,n){var r=t[i],e=n+t[i+1]>>>0,s=(e<n?1:0)+h+r;t[i]=s>>>0,t[i+1]=e},n.sum64_hi=function(t,i,h,n){return(i+n>>>0<i?1:0)+t+h>>>0},n.sum64_lo=function(t,i,h,n){return i+n>>>0},n.sum64_4_hi=function(t,i,h,n,r,e,s,o){var u=0,a=i;return u+=(a=a+n>>>0)<i?1:0,u+=(a=a+e>>>0)<e?1:0,t+h+r+s+(u+=(a=a+o>>>0)<o?1:0)>>>0},n.sum64_4_lo=function(t,i,h,n,r,e,s,o){return i+n+e+o>>>0},n.sum64_5_hi=function(t,i,h,n,r,e,s,o,u,a){var c=0,l=i;return c+=(l=l+n>>>0)<i?1:0,c+=(l=l+e>>>0)<e?1:0,c+=(l=l+o>>>0)<o?1:0,t+h+r+s+u+(c+=(l=l+a>>>0)<a?1:0)>>>0},n.sum64_5_lo=function(t,i,h,n,r,e,s,o,u,a){return i+n+e+o+a>>>0},n.rotr64_hi=function(t,i,h){return(i<<32-h|t>>>h)>>>0},n.rotr64_lo=function(t,i,h){return(t<<32-h|i>>>h)>>>0},n.shr64_hi=function(t,i,h){return t>>>h},n.shr64_lo=function(t,i,h){return(t<<32-h|i>>>h)>>>0};var f={},g=n,p=r;function d(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}f.BlockHash=d,d.prototype.update=function(t,i){if(t=g.toArray(t,i),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var h=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-h,t.length),0===this.pending.length&&(this.pending=null),t=g.join32(t,0,t.length-h,this.endian);for(var n=0;n<t.length;n+=this._delta32)this._update(t,n,n+this._delta32)}return this},d.prototype.digest=function(t){return this.update(this._pad()),p(null===this.pending),this._digest(t)},d.prototype._pad=function(){var t=this.pendingTotal,i=this._delta8,h=i-(t+this.padLength)%i,n=new Array(h+this.padLength);n[0]=128;for(var r=1;r<h;r++)n[r]=0;if(t<<=3,"big"===this.endian){for(var e=8;e<this.padLength;e++)n[r++]=0;n[r++]=0,n[r++]=0,n[r++]=0,n[r++]=0,n[r++]=t>>>24&255,n[r++]=t>>>16&255,n[r++]=t>>>8&255,n[r++]=255&t}else for(n[r++]=255&t,n[r++]=t>>>8&255,n[r++]=t>>>16&255,n[r++]=t>>>24&255,n[r++]=0,n[r++]=0,n[r++]=0,n[r++]=0,e=8;e<this.padLength;e++)n[r++]=0;return n};var _={},v={},m=n.rotr32;function b(t,i,h){return t&i^~t&h}function y(t,i,h){return t&i^t&h^i&h}function S(t,i,h){return t^i^h}v.ft_1=function(t,i,h,n){return 0===t?b(i,h,n):1===t||3===t?S(i,h,n):2===t?y(i,h,n):void 0},v.ch32=b,v.maj32=y,v.p32=S,v.s0_256=function(t){return m(t,2)^m(t,13)^m(t,22)},v.s1_256=function(t){return m(t,6)^m(t,11)^m(t,25)},v.g0_256=function(t){return m(t,7)^m(t,18)^t>>>3},v.g1_256=function(t){return m(t,17)^m(t,19)^t>>>10};var k=n,z=f,w=v,A=k.rotl32,x=k.sum32,H=k.sum32_5,L=w.ft_1,j=z.BlockHash,B=[1518500249,1859775393,2400959708,3395469782];function W(){if(!(this instanceof W))return new W;j.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}k.inherits(W,j);var O=W;W.blockSize=512,W.outSize=160,W.hmacStrength=80,W.padLength=64,W.prototype._update=function(t,i){for(var h=this.W,n=0;n<16;n++)h[n]=t[i+n];for(;n<h.length;n++)h[n]=A(h[n-3]^h[n-8]^h[n-14]^h[n-16],1);var r=this.h[0],e=this.h[1],s=this.h[2],o=this.h[3],u=this.h[4];for(n=0;n<h.length;n++){var a=~~(n/20),c=H(A(r,5),L(a,e,s,o),u,h[n],B[a]);u=o,o=s,s=A(e,30),e=r,r=c}this.h[0]=x(this.h[0],r),this.h[1]=x(this.h[1],e),this.h[2]=x(this.h[2],s),this.h[3]=x(this.h[3],o),this.h[4]=x(this.h[4],u)},W.prototype._digest=function(t){return"hex"===t?k.toHex32(this.h,"big"):k.split32(this.h,"big")};var C=n,E=f,T=v,P=r,q=C.sum32,D=C.sum32_4,I=C.sum32_5,F=T.ch32,G=T.maj32,J=T.s0_256,K=T.s1_256,M=T.g0_256,N=T.g1_256,Q=E.BlockHash,R=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function U(){if(!(this instanceof U))return new U;Q.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=R,this.W=new Array(64)}C.inherits(U,Q);var V=U;U.blockSize=512,U.outSize=256,U.hmacStrength=192,U.padLength=64,U.prototype._update=function(t,i){for(var h=this.W,n=0;n<16;n++)h[n]=t[i+n];for(;n<h.length;n++)h[n]=D(N(h[n-2]),h[n-7],M(h[n-15]),h[n-16]);var r=this.h[0],e=this.h[1],s=this.h[2],o=this.h[3],u=this.h[4],a=this.h[5],c=this.h[6],l=this.h[7];for(P(this.k.length===h.length),n=0;n<h.length;n++){var f=I(l,K(u),F(u,a,c),this.k[n],h[n]),g=q(J(r),G(r,e,s));l=c,c=a,a=u,u=q(o,f),o=s,s=e,e=r,r=q(f,g)}this.h[0]=q(this.h[0],r),this.h[1]=q(this.h[1],e),this.h[2]=q(this.h[2],s),this.h[3]=q(this.h[3],o),this.h[4]=q(this.h[4],u),this.h[5]=q(this.h[5],a),this.h[6]=q(this.h[6],c),this.h[7]=q(this.h[7],l)},U.prototype._digest=function(t){return"hex"===t?C.toHex32(this.h,"big"):C.split32(this.h,"big")};var X=n,Y=V;function Z(){if(!(this instanceof Z))return new Z;Y.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}X.inherits(Z,Y);var $=Z;Z.blockSize=512,Z.outSize=224,Z.hmacStrength=192,Z.padLength=64,Z.prototype._digest=function(t){return"hex"===t?X.toHex32(this.h.slice(0,7),"big"):X.split32(this.h.slice(0,7),"big")};var tt=n,it=f,ht=r,nt=tt.rotr64_hi,rt=tt.rotr64_lo,et=tt.shr64_hi,st=tt.shr64_lo,ot=tt.sum64,ut=tt.sum64_hi,at=tt.sum64_lo,ct=tt.sum64_4_hi,lt=tt.sum64_4_lo,ft=tt.sum64_5_hi,gt=tt.sum64_5_lo,pt=it.BlockHash,dt=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function _t(){if(!(this instanceof _t))return new _t;pt.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=dt,this.W=new Array(160)}tt.inherits(_t,pt);var vt=_t;function mt(t,i,h,n,r){var e=t&h^~t&r;return e<0&&(e+=4294967296),e}function bt(t,i,h,n,r,e){var s=i&n^~i&e;return s<0&&(s+=4294967296),s}function yt(t,i,h,n,r){var e=t&h^t&r^h&r;return e<0&&(e+=4294967296),e}function St(t,i,h,n,r,e){var s=i&n^i&e^n&e;return s<0&&(s+=4294967296),s}function kt(t,i){var h=nt(t,i,28)^nt(i,t,2)^nt(i,t,7);return h<0&&(h+=4294967296),h}function zt(t,i){var h=rt(t,i,28)^rt(i,t,2)^rt(i,t,7);return h<0&&(h+=4294967296),h}function wt(t,i){var h=nt(t,i,14)^nt(t,i,18)^nt(i,t,9);return h<0&&(h+=4294967296),h}function At(t,i){var h=rt(t,i,14)^rt(t,i,18)^rt(i,t,9);return h<0&&(h+=4294967296),h}function xt(t,i){var h=nt(t,i,1)^nt(t,i,8)^et(t,i,7);return h<0&&(h+=4294967296),h}function Ht(t,i){var h=rt(t,i,1)^rt(t,i,8)^st(t,i,7);return h<0&&(h+=4294967296),h}function Lt(t,i){var h=nt(t,i,19)^nt(i,t,29)^et(t,i,6);return h<0&&(h+=4294967296),h}function jt(t,i){var h=rt(t,i,19)^rt(i,t,29)^st(t,i,6);return h<0&&(h+=4294967296),h}_t.blockSize=1024,_t.outSize=512,_t.hmacStrength=192,_t.padLength=128,_t.prototype._prepareBlock=function(t,i){for(var h=this.W,n=0;n<32;n++)h[n]=t[i+n];for(;n<h.length;n+=2){var r=Lt(h[n-4],h[n-3]),e=jt(h[n-4],h[n-3]),s=h[n-14],o=h[n-13],u=xt(h[n-30],h[n-29]),a=Ht(h[n-30],h[n-29]),c=h[n-32],l=h[n-31];h[n]=ct(r,e,s,o,u,a,c,l),h[n+1]=lt(r,e,s,o,u,a,c,l)}},_t.prototype._update=function(t,i){this._prepareBlock(t,i);var h=this.W,n=this.h[0],r=this.h[1],e=this.h[2],s=this.h[3],o=this.h[4],u=this.h[5],a=this.h[6],c=this.h[7],l=this.h[8],f=this.h[9],g=this.h[10],p=this.h[11],d=this.h[12],_=this.h[13],v=this.h[14],m=this.h[15];ht(this.k.length===h.length);for(var b=0;b<h.length;b+=2){var y=v,S=m,k=wt(l,f),z=At(l,f),w=mt(l,f,g,p,d),A=bt(l,f,g,p,d,_),x=this.k[b],H=this.k[b+1],L=h[b],j=h[b+1],B=ft(y,S,k,z,w,A,x,H,L,j),W=gt(y,S,k,z,w,A,x,H,L,j);y=kt(n,r),S=zt(n,r),k=yt(n,r,e,s,o),z=St(n,r,e,s,o,u);var O=ut(y,S,k,z),C=at(y,S,k,z);v=d,m=_,d=g,_=p,g=l,p=f,l=ut(a,c,B,W),f=at(c,c,B,W),a=o,c=u,o=e,u=s,e=n,s=r,n=ut(B,W,O,C),r=at(B,W,O,C)}ot(this.h,0,n,r),ot(this.h,2,e,s),ot(this.h,4,o,u),ot(this.h,6,a,c),ot(this.h,8,l,f),ot(this.h,10,g,p),ot(this.h,12,d,_),ot(this.h,14,v,m)},_t.prototype._digest=function(t){return"hex"===t?tt.toHex32(this.h,"big"):tt.split32(this.h,"big")};var Bt=n,Wt=vt;function Ot(){if(!(this instanceof Ot))return new Ot;Wt.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Bt.inherits(Ot,Wt);var Ct=Ot;Ot.blockSize=1024,Ot.outSize=384,Ot.hmacStrength=192,Ot.padLength=128,Ot.prototype._digest=function(t){return"hex"===t?Bt.toHex32(this.h.slice(0,12),"big"):Bt.split32(this.h.slice(0,12),"big")},_.sha1=O,_.sha224=$,_.sha256=V,_.sha384=Ct,_.sha512=vt;var Et={},Tt=n,Pt=f,qt=Tt.rotl32,Dt=Tt.sum32,It=Tt.sum32_3,Ft=Tt.sum32_4,Gt=Pt.BlockHash;function Jt(){if(!(this instanceof Jt))return new Jt;Gt.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function Kt(t,i,h,n){return t<=15?i^h^n:t<=31?i&h|~i&n:t<=47?(i|~h)^n:t<=63?i&n|h&~n:i^(h|~n)}function Mt(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function Nt(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}Tt.inherits(Jt,Gt),Et.ripemd160=Jt,Jt.blockSize=512,Jt.outSize=160,Jt.hmacStrength=192,Jt.padLength=64,Jt.prototype._update=function(t,i){for(var h=this.h[0],n=this.h[1],r=this.h[2],e=this.h[3],s=this.h[4],o=h,u=n,a=r,c=e,l=s,f=0;f<80;f++){var g=Dt(qt(Ft(h,Kt(f,n,r,e),t[Qt[f]+i],Mt(f)),Ut[f]),s);h=s,s=e,e=qt(r,10),r=n,n=g,g=Dt(qt(Ft(o,Kt(79-f,u,a,c),t[Rt[f]+i],Nt(f)),Vt[f]),l),o=l,l=c,c=qt(a,10),a=u,u=g}g=It(this.h[1],r,c),this.h[1]=It(this.h[2],e,l),this.h[2]=It(this.h[3],s,o),this.h[3]=It(this.h[4],h,u),this.h[4]=It(this.h[0],n,a),this.h[0]=g},Jt.prototype._digest=function(t){return"hex"===t?Tt.toHex32(this.h,"little"):Tt.split32(this.h,"little")};var Qt=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],Rt=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],Ut=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],Vt=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],Xt=n,Yt=r;function Zt(t,i,h){if(!(this instanceof Zt))return new Zt(t,i,h);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(Xt.toArray(i,h))}var $t=Zt;Zt.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),Yt(t.length<=this.blockSize);for(var i=t.length;i<this.blockSize;i++)t.push(0);for(i=0;i<t.length;i++)t[i]^=54;for(this.inner=(new this.Hash).update(t),i=0;i<t.length;i++)t[i]^=106;this.outer=(new this.Hash).update(t)},Zt.prototype.update=function(t,i){return this.inner.update(t,i),this},Zt.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)},function(t){var i=t;i.utils=n,i.common=f,i.sha=_,i.ripemd=Et,i.hmac=$t,i.sha1=i.sha.sha1,i.sha256=i.sha.sha256,i.sha224=i.sha.sha224,i.sha384=i.sha.sha384,i.sha512=i.sha.sha512,i.ripemd160=i.ripemd.ripemd160}(h);var ti=i({__proto__:null,default:h},[h]);export{ti as K,h,r as m};
1
+ import{i as t}from"./inherits_browser-51bb8c3c.js";function i(t,i){return i.forEach((function(i){i&&"string"!=typeof i&&!Array.isArray(i)&&Object.keys(i).forEach((function(h){if("default"!==h&&!(h in t)){var n=Object.getOwnPropertyDescriptor(i,h);Object.defineProperty(t,h,n.get?n:{enumerable:!0,get:function(){return i[h]}})}}))})),Object.freeze(t)}var h={},n={},r=e;function e(t,i){if(!t)throw new Error(i||"Assertion failed")}e.equal=function(t,i,h){if(t!=i)throw new Error(h||"Assertion failed: "+t+" != "+i)};var s=r,o=t.exports;function u(t,i){return 55296==(64512&t.charCodeAt(i))&&(!(i<0||i+1>=t.length)&&56320==(64512&t.charCodeAt(i+1)))}function a(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function c(t){return 1===t.length?"0"+t:t}function l(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}n.inherits=o,n.toArray=function(t,i){if(Array.isArray(t))return t.slice();if(!t)return[];var h=[];if("string"==typeof t)if(i){if("hex"===i)for((t=t.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(t="0"+t),r=0;r<t.length;r+=2)h.push(parseInt(t[r]+t[r+1],16))}else for(var n=0,r=0;r<t.length;r++){var e=t.charCodeAt(r);e<128?h[n++]=e:e<2048?(h[n++]=e>>6|192,h[n++]=63&e|128):u(t,r)?(e=65536+((1023&e)<<10)+(1023&t.charCodeAt(++r)),h[n++]=e>>18|240,h[n++]=e>>12&63|128,h[n++]=e>>6&63|128,h[n++]=63&e|128):(h[n++]=e>>12|224,h[n++]=e>>6&63|128,h[n++]=63&e|128)}else for(r=0;r<t.length;r++)h[r]=0|t[r];return h},n.toHex=function(t){for(var i="",h=0;h<t.length;h++)i+=c(t[h].toString(16));return i},n.htonl=a,n.toHex32=function(t,i){for(var h="",n=0;n<t.length;n++){var r=t[n];"little"===i&&(r=a(r)),h+=l(r.toString(16))}return h},n.zero2=c,n.zero8=l,n.join32=function(t,i,h,n){var r=h-i;s(r%4==0);for(var e=new Array(r/4),o=0,u=i;o<e.length;o++,u+=4){var a;a="big"===n?t[u]<<24|t[u+1]<<16|t[u+2]<<8|t[u+3]:t[u+3]<<24|t[u+2]<<16|t[u+1]<<8|t[u],e[o]=a>>>0}return e},n.split32=function(t,i){for(var h=new Array(4*t.length),n=0,r=0;n<t.length;n++,r+=4){var e=t[n];"big"===i?(h[r]=e>>>24,h[r+1]=e>>>16&255,h[r+2]=e>>>8&255,h[r+3]=255&e):(h[r+3]=e>>>24,h[r+2]=e>>>16&255,h[r+1]=e>>>8&255,h[r]=255&e)}return h},n.rotr32=function(t,i){return t>>>i|t<<32-i},n.rotl32=function(t,i){return t<<i|t>>>32-i},n.sum32=function(t,i){return t+i>>>0},n.sum32_3=function(t,i,h){return t+i+h>>>0},n.sum32_4=function(t,i,h,n){return t+i+h+n>>>0},n.sum32_5=function(t,i,h,n,r){return t+i+h+n+r>>>0},n.sum64=function(t,i,h,n){var r=t[i],e=n+t[i+1]>>>0,s=(e<n?1:0)+h+r;t[i]=s>>>0,t[i+1]=e},n.sum64_hi=function(t,i,h,n){return(i+n>>>0<i?1:0)+t+h>>>0},n.sum64_lo=function(t,i,h,n){return i+n>>>0},n.sum64_4_hi=function(t,i,h,n,r,e,s,o){var u=0,a=i;return u+=(a=a+n>>>0)<i?1:0,u+=(a=a+e>>>0)<e?1:0,t+h+r+s+(u+=(a=a+o>>>0)<o?1:0)>>>0},n.sum64_4_lo=function(t,i,h,n,r,e,s,o){return i+n+e+o>>>0},n.sum64_5_hi=function(t,i,h,n,r,e,s,o,u,a){var c=0,l=i;return c+=(l=l+n>>>0)<i?1:0,c+=(l=l+e>>>0)<e?1:0,c+=(l=l+o>>>0)<o?1:0,t+h+r+s+u+(c+=(l=l+a>>>0)<a?1:0)>>>0},n.sum64_5_lo=function(t,i,h,n,r,e,s,o,u,a){return i+n+e+o+a>>>0},n.rotr64_hi=function(t,i,h){return(i<<32-h|t>>>h)>>>0},n.rotr64_lo=function(t,i,h){return(t<<32-h|i>>>h)>>>0},n.shr64_hi=function(t,i,h){return t>>>h},n.shr64_lo=function(t,i,h){return(t<<32-h|i>>>h)>>>0};var f={},g=n,p=r;function d(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}f.BlockHash=d,d.prototype.update=function(t,i){if(t=g.toArray(t,i),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var h=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-h,t.length),0===this.pending.length&&(this.pending=null),t=g.join32(t,0,t.length-h,this.endian);for(var n=0;n<t.length;n+=this._delta32)this._update(t,n,n+this._delta32)}return this},d.prototype.digest=function(t){return this.update(this._pad()),p(null===this.pending),this._digest(t)},d.prototype._pad=function(){var t=this.pendingTotal,i=this._delta8,h=i-(t+this.padLength)%i,n=new Array(h+this.padLength);n[0]=128;for(var r=1;r<h;r++)n[r]=0;if(t<<=3,"big"===this.endian){for(var e=8;e<this.padLength;e++)n[r++]=0;n[r++]=0,n[r++]=0,n[r++]=0,n[r++]=0,n[r++]=t>>>24&255,n[r++]=t>>>16&255,n[r++]=t>>>8&255,n[r++]=255&t}else for(n[r++]=255&t,n[r++]=t>>>8&255,n[r++]=t>>>16&255,n[r++]=t>>>24&255,n[r++]=0,n[r++]=0,n[r++]=0,n[r++]=0,e=8;e<this.padLength;e++)n[r++]=0;return n};var _={},v={},m=n.rotr32;function b(t,i,h){return t&i^~t&h}function y(t,i,h){return t&i^t&h^i&h}function S(t,i,h){return t^i^h}v.ft_1=function(t,i,h,n){return 0===t?b(i,h,n):1===t||3===t?S(i,h,n):2===t?y(i,h,n):void 0},v.ch32=b,v.maj32=y,v.p32=S,v.s0_256=function(t){return m(t,2)^m(t,13)^m(t,22)},v.s1_256=function(t){return m(t,6)^m(t,11)^m(t,25)},v.g0_256=function(t){return m(t,7)^m(t,18)^t>>>3},v.g1_256=function(t){return m(t,17)^m(t,19)^t>>>10};var k=n,z=f,w=v,A=k.rotl32,x=k.sum32,H=k.sum32_5,L=w.ft_1,j=z.BlockHash,B=[1518500249,1859775393,2400959708,3395469782];function W(){if(!(this instanceof W))return new W;j.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}k.inherits(W,j);var O=W;W.blockSize=512,W.outSize=160,W.hmacStrength=80,W.padLength=64,W.prototype._update=function(t,i){for(var h=this.W,n=0;n<16;n++)h[n]=t[i+n];for(;n<h.length;n++)h[n]=A(h[n-3]^h[n-8]^h[n-14]^h[n-16],1);var r=this.h[0],e=this.h[1],s=this.h[2],o=this.h[3],u=this.h[4];for(n=0;n<h.length;n++){var a=~~(n/20),c=H(A(r,5),L(a,e,s,o),u,h[n],B[a]);u=o,o=s,s=A(e,30),e=r,r=c}this.h[0]=x(this.h[0],r),this.h[1]=x(this.h[1],e),this.h[2]=x(this.h[2],s),this.h[3]=x(this.h[3],o),this.h[4]=x(this.h[4],u)},W.prototype._digest=function(t){return"hex"===t?k.toHex32(this.h,"big"):k.split32(this.h,"big")};var C=n,E=f,T=v,P=r,q=C.sum32,D=C.sum32_4,I=C.sum32_5,F=T.ch32,G=T.maj32,J=T.s0_256,K=T.s1_256,M=T.g0_256,N=T.g1_256,Q=E.BlockHash,R=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function U(){if(!(this instanceof U))return new U;Q.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=R,this.W=new Array(64)}C.inherits(U,Q);var V=U;U.blockSize=512,U.outSize=256,U.hmacStrength=192,U.padLength=64,U.prototype._update=function(t,i){for(var h=this.W,n=0;n<16;n++)h[n]=t[i+n];for(;n<h.length;n++)h[n]=D(N(h[n-2]),h[n-7],M(h[n-15]),h[n-16]);var r=this.h[0],e=this.h[1],s=this.h[2],o=this.h[3],u=this.h[4],a=this.h[5],c=this.h[6],l=this.h[7];for(P(this.k.length===h.length),n=0;n<h.length;n++){var f=I(l,K(u),F(u,a,c),this.k[n],h[n]),g=q(J(r),G(r,e,s));l=c,c=a,a=u,u=q(o,f),o=s,s=e,e=r,r=q(f,g)}this.h[0]=q(this.h[0],r),this.h[1]=q(this.h[1],e),this.h[2]=q(this.h[2],s),this.h[3]=q(this.h[3],o),this.h[4]=q(this.h[4],u),this.h[5]=q(this.h[5],a),this.h[6]=q(this.h[6],c),this.h[7]=q(this.h[7],l)},U.prototype._digest=function(t){return"hex"===t?C.toHex32(this.h,"big"):C.split32(this.h,"big")};var X=n,Y=V;function Z(){if(!(this instanceof Z))return new Z;Y.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}X.inherits(Z,Y);var $=Z;Z.blockSize=512,Z.outSize=224,Z.hmacStrength=192,Z.padLength=64,Z.prototype._digest=function(t){return"hex"===t?X.toHex32(this.h.slice(0,7),"big"):X.split32(this.h.slice(0,7),"big")};var tt=n,it=f,ht=r,nt=tt.rotr64_hi,rt=tt.rotr64_lo,et=tt.shr64_hi,st=tt.shr64_lo,ot=tt.sum64,ut=tt.sum64_hi,at=tt.sum64_lo,ct=tt.sum64_4_hi,lt=tt.sum64_4_lo,ft=tt.sum64_5_hi,gt=tt.sum64_5_lo,pt=it.BlockHash,dt=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function _t(){if(!(this instanceof _t))return new _t;pt.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=dt,this.W=new Array(160)}tt.inherits(_t,pt);var vt=_t;function mt(t,i,h,n,r){var e=t&h^~t&r;return e<0&&(e+=4294967296),e}function bt(t,i,h,n,r,e){var s=i&n^~i&e;return s<0&&(s+=4294967296),s}function yt(t,i,h,n,r){var e=t&h^t&r^h&r;return e<0&&(e+=4294967296),e}function St(t,i,h,n,r,e){var s=i&n^i&e^n&e;return s<0&&(s+=4294967296),s}function kt(t,i){var h=nt(t,i,28)^nt(i,t,2)^nt(i,t,7);return h<0&&(h+=4294967296),h}function zt(t,i){var h=rt(t,i,28)^rt(i,t,2)^rt(i,t,7);return h<0&&(h+=4294967296),h}function wt(t,i){var h=nt(t,i,14)^nt(t,i,18)^nt(i,t,9);return h<0&&(h+=4294967296),h}function At(t,i){var h=rt(t,i,14)^rt(t,i,18)^rt(i,t,9);return h<0&&(h+=4294967296),h}function xt(t,i){var h=nt(t,i,1)^nt(t,i,8)^et(t,i,7);return h<0&&(h+=4294967296),h}function Ht(t,i){var h=rt(t,i,1)^rt(t,i,8)^st(t,i,7);return h<0&&(h+=4294967296),h}function Lt(t,i){var h=nt(t,i,19)^nt(i,t,29)^et(t,i,6);return h<0&&(h+=4294967296),h}function jt(t,i){var h=rt(t,i,19)^rt(i,t,29)^st(t,i,6);return h<0&&(h+=4294967296),h}_t.blockSize=1024,_t.outSize=512,_t.hmacStrength=192,_t.padLength=128,_t.prototype._prepareBlock=function(t,i){for(var h=this.W,n=0;n<32;n++)h[n]=t[i+n];for(;n<h.length;n+=2){var r=Lt(h[n-4],h[n-3]),e=jt(h[n-4],h[n-3]),s=h[n-14],o=h[n-13],u=xt(h[n-30],h[n-29]),a=Ht(h[n-30],h[n-29]),c=h[n-32],l=h[n-31];h[n]=ct(r,e,s,o,u,a,c,l),h[n+1]=lt(r,e,s,o,u,a,c,l)}},_t.prototype._update=function(t,i){this._prepareBlock(t,i);var h=this.W,n=this.h[0],r=this.h[1],e=this.h[2],s=this.h[3],o=this.h[4],u=this.h[5],a=this.h[6],c=this.h[7],l=this.h[8],f=this.h[9],g=this.h[10],p=this.h[11],d=this.h[12],_=this.h[13],v=this.h[14],m=this.h[15];ht(this.k.length===h.length);for(var b=0;b<h.length;b+=2){var y=v,S=m,k=wt(l,f),z=At(l,f),w=mt(l,f,g,p,d),A=bt(l,f,g,p,d,_),x=this.k[b],H=this.k[b+1],L=h[b],j=h[b+1],B=ft(y,S,k,z,w,A,x,H,L,j),W=gt(y,S,k,z,w,A,x,H,L,j);y=kt(n,r),S=zt(n,r),k=yt(n,r,e,s,o),z=St(n,r,e,s,o,u);var O=ut(y,S,k,z),C=at(y,S,k,z);v=d,m=_,d=g,_=p,g=l,p=f,l=ut(a,c,B,W),f=at(c,c,B,W),a=o,c=u,o=e,u=s,e=n,s=r,n=ut(B,W,O,C),r=at(B,W,O,C)}ot(this.h,0,n,r),ot(this.h,2,e,s),ot(this.h,4,o,u),ot(this.h,6,a,c),ot(this.h,8,l,f),ot(this.h,10,g,p),ot(this.h,12,d,_),ot(this.h,14,v,m)},_t.prototype._digest=function(t){return"hex"===t?tt.toHex32(this.h,"big"):tt.split32(this.h,"big")};var Bt=n,Wt=vt;function Ot(){if(!(this instanceof Ot))return new Ot;Wt.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}Bt.inherits(Ot,Wt);var Ct=Ot;Ot.blockSize=1024,Ot.outSize=384,Ot.hmacStrength=192,Ot.padLength=128,Ot.prototype._digest=function(t){return"hex"===t?Bt.toHex32(this.h.slice(0,12),"big"):Bt.split32(this.h.slice(0,12),"big")},_.sha1=O,_.sha224=$,_.sha256=V,_.sha384=Ct,_.sha512=vt;var Et={},Tt=n,Pt=f,qt=Tt.rotl32,Dt=Tt.sum32,It=Tt.sum32_3,Ft=Tt.sum32_4,Gt=Pt.BlockHash;function Jt(){if(!(this instanceof Jt))return new Jt;Gt.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function Kt(t,i,h,n){return t<=15?i^h^n:t<=31?i&h|~i&n:t<=47?(i|~h)^n:t<=63?i&n|h&~n:i^(h|~n)}function Mt(t){return t<=15?0:t<=31?1518500249:t<=47?1859775393:t<=63?2400959708:2840853838}function Nt(t){return t<=15?1352829926:t<=31?1548603684:t<=47?1836072691:t<=63?2053994217:0}Tt.inherits(Jt,Gt),Et.ripemd160=Jt,Jt.blockSize=512,Jt.outSize=160,Jt.hmacStrength=192,Jt.padLength=64,Jt.prototype._update=function(t,i){for(var h=this.h[0],n=this.h[1],r=this.h[2],e=this.h[3],s=this.h[4],o=h,u=n,a=r,c=e,l=s,f=0;f<80;f++){var g=Dt(qt(Ft(h,Kt(f,n,r,e),t[Qt[f]+i],Mt(f)),Ut[f]),s);h=s,s=e,e=qt(r,10),r=n,n=g,g=Dt(qt(Ft(o,Kt(79-f,u,a,c),t[Rt[f]+i],Nt(f)),Vt[f]),l),o=l,l=c,c=qt(a,10),a=u,u=g}g=It(this.h[1],r,c),this.h[1]=It(this.h[2],e,l),this.h[2]=It(this.h[3],s,o),this.h[3]=It(this.h[4],h,u),this.h[4]=It(this.h[0],n,a),this.h[0]=g},Jt.prototype._digest=function(t){return"hex"===t?Tt.toHex32(this.h,"little"):Tt.split32(this.h,"little")};var Qt=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],Rt=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],Ut=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],Vt=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],Xt=n,Yt=r;function Zt(t,i,h){if(!(this instanceof Zt))return new Zt(t,i,h);this.Hash=t,this.blockSize=t.blockSize/8,this.outSize=t.outSize/8,this.inner=null,this.outer=null,this._init(Xt.toArray(i,h))}var $t=Zt;Zt.prototype._init=function(t){t.length>this.blockSize&&(t=(new this.Hash).update(t).digest()),Yt(t.length<=this.blockSize);for(var i=t.length;i<this.blockSize;i++)t.push(0);for(i=0;i<t.length;i++)t[i]^=54;for(this.inner=(new this.Hash).update(t),i=0;i<t.length;i++)t[i]^=106;this.outer=(new this.Hash).update(t)},Zt.prototype.update=function(t,i){return this.inner.update(t,i),this},Zt.prototype.digest=function(t){return this.outer.update(this.inner.digest()),this.outer.digest(t)},function(t){var i=t;i.utils=n,i.common=f,i.sha=_,i.ripemd=Et,i.hmac=$t,i.sha1=i.sha.sha1,i.sha256=i.sha.sha256,i.sha224=i.sha.sha224,i.sha384=i.sha.sha384,i.sha512=i.sha.sha512,i.ripemd160=i.ripemd.ripemd160}(h);var ti=i({__proto__:null,default:h},[h]);export{ti as K,h,r as m};
@@ -1 +1 @@
1
- import{c as t,k as i}from"./index-5abb7d26.js";import{r}from"./__node-resolve_empty-5ca02702.js";import{isBytes as e,hexlify as n,isHexString as h,arrayify as o}from"@ethersproject/bytes";let s=!1,u=!1;const a={debug:1,default:2,info:2,warning:3,error:4,off:5};let l=a.default,m=null;const f=function(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach((i=>{try{if("test"!=="test".normalize(i))throw new Error("bad normalize")}catch(r){t.push(i)}})),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}();var d,p;!function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"}(d||(d={})),function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"}(p||(p={}));const g="0123456789abcdef";class c{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,i){const r=t.toLowerCase();null==a[r]&&this.throwArgumentError("invalid log level name","logLevel",t),l>a[r]||console.log.apply(console,i)}debug(...t){this._log(c.levels.DEBUG,t)}info(...t){this._log(c.levels.INFO,t)}warn(...t){this._log(c.levels.WARNING,t)}makeError(t,i,r){if(u)return this.makeError("censored error",i,{});i||(i=c.errors.UNKNOWN_ERROR),r||(r={});const e=[];Object.keys(r).forEach((t=>{const i=r[t];try{if(i instanceof Uint8Array){let r="";for(let t=0;t<i.length;t++)r+=g[i[t]>>4],r+=g[15&i[t]];e.push(t+"=Uint8Array(0x"+r+")")}else e.push(t+"="+JSON.stringify(i))}catch(i){e.push(t+"="+JSON.stringify(r[t].toString()))}})),e.push(`code=${i}`),e.push(`version=${this.version}`);const n=t;let h="";switch(i){case p.NUMERIC_FAULT:{h="NUMERIC_FAULT";const i=t;switch(i){case"overflow":case"underflow":case"division-by-zero":h+="-"+i;break;case"negative-power":case"negative-width":h+="-unsupported";break;case"unbound-bitwise-result":h+="-unbound-result"}break}case p.CALL_EXCEPTION:case p.INSUFFICIENT_FUNDS:case p.MISSING_NEW:case p.NONCE_EXPIRED:case p.REPLACEMENT_UNDERPRICED:case p.TRANSACTION_REPLACED:case p.UNPREDICTABLE_GAS_LIMIT:h=i}h&&(t+=" [ See: https://links.ethers.org/v5-errors-"+h+" ]"),e.length&&(t+=" ("+e.join(", ")+")");const o=new Error(t);return o.reason=n,o.code=i,Object.keys(r).forEach((function(t){o[t]=r[t]})),o}throwError(t,i,r){throw this.makeError(t,i,r)}throwArgumentError(t,i,r){return this.throwError(t,c.errors.INVALID_ARGUMENT,{argument:i,value:r})}assert(t,i,r,e){t||this.throwError(i,r,e)}assertArgument(t,i,r,e){t||this.throwArgumentError(i,r,e)}checkNormalize(t){f&&this.throwError("platform missing String.prototype.normalize",c.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:f})}checkSafeUint53(t,i){"number"==typeof t&&(null==i&&(i="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(i,c.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(i,c.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,i,r){r=r?": "+r:"",t<i&&this.throwError("missing argument"+r,c.errors.MISSING_ARGUMENT,{count:t,expectedCount:i}),t>i&&this.throwError("too many arguments"+r,c.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:i})}checkNew(t,i){t!==Object&&null!=t||this.throwError("missing new",c.errors.MISSING_NEW,{name:i.name})}checkAbstract(t,i){t===i?this.throwError("cannot instantiate abstract class "+JSON.stringify(i.name)+" directly; use a sub-class",c.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",c.errors.MISSING_NEW,{name:i.name})}static globalLogger(){return m||(m=new c("logger/5.7.0")),m}static setCensorship(t,i){if(!t&&i&&this.globalLogger().throwError("cannot permanently disable censorship",c.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),s){if(!t)return;this.globalLogger().throwError("error censorship permanent",c.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}u=!!t,s=!!i}static setLogLevel(t){const i=a[t.toLowerCase()];null!=i?l=i:c.globalLogger().warn("invalid log level - "+t)}static from(t){return new c(t)}}c.errors=p,c.levels=d;var M=Object.freeze({__proto__:null,get LogLevel(){return d},get ErrorCode(){return p},Logger:c}),v={exports:{}};!function(t,i){function e(t,i){if(!t)throw new Error(i||"Assertion failed")}function n(t,i){t.super_=i;var r=function(){};r.prototype=i.prototype,t.prototype=new r,t.prototype.constructor=t}function h(t,i,r){if(h.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==i&&"be"!==i||(r=i,i=10),this._init(t||0,i||10,r||"be"))}var o;"object"==typeof t?t.exports=h:i.BN=h,h.BN=h,h.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r.Buffer}catch(t){}function s(t,i){var r=t.charCodeAt(i);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void e(!1,"Invalid character in "+t)}function u(t,i,r){var e=s(t,r);return r-1>=i&&(e|=s(t,r-1)<<4),e}function a(t,i,r,n){for(var h=0,o=0,s=Math.min(t.length,r),u=i;u<s;u++){var a=t.charCodeAt(u)-48;h*=n,o=a>=49?a-49+10:a>=17?a-17+10:a,e(a>=0&&o<n,"Invalid character"),h+=o}return h}function l(t,i){t.words=i.words,t.length=i.length,t.negative=i.negative,t.red=i.red}if(h.isBN=function(t){return t instanceof h||null!==t&&"object"==typeof t&&t.constructor.wordSize===h.wordSize&&Array.isArray(t.words)},h.max=function(t,i){return t.cmp(i)>0?t:i},h.min=function(t,i){return t.cmp(i)<0?t:i},h.prototype._init=function(t,i,r){if("number"==typeof t)return this._initNumber(t,i,r);if("object"==typeof t)return this._initArray(t,i,r);"hex"===i&&(i=16),e(i===(0|i)&&i>=2&&i<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<t.length&&(16===i?this._parseHex(t,n,r):(this._parseBase(t,i,n),"le"===r&&this._initArray(this.toArray(),i,r)))},h.prototype._initNumber=function(t,i,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(e(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),i,r)},h.prototype._initArray=function(t,i,r){if(e("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var h,o,s=0;if("be"===r)for(n=t.length-1,h=0;n>=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[h]|=o<<s&67108863,this.words[h+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,h++);else if("le"===r)for(n=0,h=0;n<t.length;n+=3)o=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[h]|=o<<s&67108863,this.words[h+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,h++);return this._strip()},h.prototype._parseHex=function(t,i,r){this.length=Math.ceil((t.length-i)/6),this.words=new Array(this.length);for(var e=0;e<this.length;e++)this.words[e]=0;var n,h=0,o=0;if("be"===r)for(e=t.length-1;e>=i;e-=2)n=u(t,i,e)<<h,this.words[o]|=67108863&n,h>=18?(h-=18,o+=1,this.words[o]|=n>>>26):h+=8;else for(e=(t.length-i)%2==0?i+1:i;e<t.length;e+=2)n=u(t,i,e)<<h,this.words[o]|=67108863&n,h>=18?(h-=18,o+=1,this.words[o]|=n>>>26):h+=8;this._strip()},h.prototype._parseBase=function(t,i,r){this.words=[0],this.length=1;for(var e=0,n=1;n<=67108863;n*=i)e++;e--,n=n/i|0;for(var h=t.length-r,o=h%e,s=Math.min(h,h-o)+r,u=0,l=r;l<s;l+=e)u=a(t,l,l+e,i),this.imuln(n),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==o){var m=1;for(u=a(t,l,t.length,i),l=0;l<o;l++)m*=i;this.imuln(m),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},h.prototype.copy=function(t){t.words=new Array(this.length);for(var i=0;i<this.length;i++)t.words[i]=this.words[i];t.length=this.length,t.negative=this.negative,t.red=this.red},h.prototype._move=function(t){l(t,this)},h.prototype.clone=function(){var t=new h(null);return this.copy(t),t},h.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},h.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},h.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{h.prototype[Symbol.for("nodejs.util.inspect.custom")]=m}catch(t){h.prototype.inspect=m}else h.prototype.inspect=m;function m(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function g(t,i,r){r.negative=i.negative^t.negative;var e=t.length+i.length|0;r.length=e,e=e-1|0;var n=0|t.words[0],h=0|i.words[0],o=n*h,s=67108863&o,u=o/67108864|0;r.words[0]=s;for(var a=1;a<e;a++){for(var l=u>>>26,m=67108863&u,f=Math.min(a,i.length-1),d=Math.max(0,a-t.length+1);d<=f;d++){var p=a-d|0;l+=(o=(n=0|t.words[p])*(h=0|i.words[d])+m)/67108864|0,m=67108863&o}r.words[a]=0|m,u=0|l}return 0!==u?r.words[a]=0|u:r.length--,r._strip()}h.prototype.toString=function(t,i){var r;if(i=0|i||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,h=0,o=0;o<this.length;o++){var s=this.words[o],u=(16777215&(s<<n|h)).toString(16);h=s>>>24-n&16777215,(n+=2)>=26&&(n-=26,o--),r=0!==h||o!==this.length-1?f[6-u.length]+u+r:u+r}for(0!==h&&(r=h.toString(16)+r);r.length%i!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var a=d[t],l=p[t];r="";var m=this.clone();for(m.negative=0;!m.isZero();){var g=m.modrn(l).toString(t);r=(m=m.idivn(l)).isZero()?g+r:f[a-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%i!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}e(!1,"Base should be between 2 and 36")},h.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&e(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},h.prototype.toJSON=function(){return this.toString(16,2)},o&&(h.prototype.toBuffer=function(t,i){return this.toArrayLike(o,t,i)}),h.prototype.toArray=function(t,i){return this.toArrayLike(Array,t,i)},h.prototype.toArrayLike=function(t,i,r){this._strip();var n=this.byteLength(),h=r||Math.max(1,n);e(n<=h,"byte array longer than desired length"),e(h>0,"Requested array length <= 0");var o=function(t,i){return t.allocUnsafe?t.allocUnsafe(i):new t(i)}(t,h);return this["_toArrayLike"+("le"===i?"LE":"BE")](o,n),o},h.prototype._toArrayLikeLE=function(t,i){for(var r=0,e=0,n=0,h=0;n<this.length;n++){var o=this.words[n]<<h|e;t[r++]=255&o,r<t.length&&(t[r++]=o>>8&255),r<t.length&&(t[r++]=o>>16&255),6===h?(r<t.length&&(t[r++]=o>>24&255),e=0,h=0):(e=o>>>24,h+=2)}if(r<t.length)for(t[r++]=e;r<t.length;)t[r++]=0},h.prototype._toArrayLikeBE=function(t,i){for(var r=t.length-1,e=0,n=0,h=0;n<this.length;n++){var o=this.words[n]<<h|e;t[r--]=255&o,r>=0&&(t[r--]=o>>8&255),r>=0&&(t[r--]=o>>16&255),6===h?(r>=0&&(t[r--]=o>>24&255),e=0,h=0):(e=o>>>24,h+=2)}if(r>=0)for(t[r--]=e;r>=0;)t[r--]=0},Math.clz32?h.prototype._countBits=function(t){return 32-Math.clz32(t)}:h.prototype._countBits=function(t){var i=t,r=0;return i>=4096&&(r+=13,i>>>=13),i>=64&&(r+=7,i>>>=7),i>=8&&(r+=4,i>>>=4),i>=2&&(r+=2,i>>>=2),r+i},h.prototype._zeroBits=function(t){if(0===t)return 26;var i=t,r=0;return 0==(8191&i)&&(r+=13,i>>>=13),0==(127&i)&&(r+=7,i>>>=7),0==(15&i)&&(r+=4,i>>>=4),0==(3&i)&&(r+=2,i>>>=2),0==(1&i)&&r++,r},h.prototype.bitLength=function(){var t=this.words[this.length-1],i=this._countBits(t);return 26*(this.length-1)+i},h.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,i=0;i<this.length;i++){var r=this._zeroBits(this.words[i]);if(t+=r,26!==r)break}return t},h.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},h.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},h.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},h.prototype.isNeg=function(){return 0!==this.negative},h.prototype.neg=function(){return this.clone().ineg()},h.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},h.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var i=0;i<t.length;i++)this.words[i]=this.words[i]|t.words[i];return this._strip()},h.prototype.ior=function(t){return e(0==(this.negative|t.negative)),this.iuor(t)},h.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},h.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},h.prototype.iuand=function(t){var i;i=this.length>t.length?t:this;for(var r=0;r<i.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=i.length,this._strip()},h.prototype.iand=function(t){return e(0==(this.negative|t.negative)),this.iuand(t)},h.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},h.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},h.prototype.iuxor=function(t){var i,r;this.length>t.length?(i=this,r=t):(i=t,r=this);for(var e=0;e<r.length;e++)this.words[e]=i.words[e]^r.words[e];if(this!==i)for(;e<i.length;e++)this.words[e]=i.words[e];return this.length=i.length,this._strip()},h.prototype.ixor=function(t){return e(0==(this.negative|t.negative)),this.iuxor(t)},h.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},h.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},h.prototype.inotn=function(t){e("number"==typeof t&&t>=0);var i=0|Math.ceil(t/26),r=t%26;this._expand(i),r>0&&i--;for(var n=0;n<i;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},h.prototype.notn=function(t){return this.clone().inotn(t)},h.prototype.setn=function(t,i){e("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=i?this.words[r]|1<<n:this.words[r]&~(1<<n),this._strip()},h.prototype.iadd=function(t){var i,r,e;if(0!==this.negative&&0===t.negative)return this.negative=0,i=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,i=this.isub(t),t.negative=1,i._normSign();this.length>t.length?(r=this,e=t):(r=t,e=this);for(var n=0,h=0;h<e.length;h++)i=(0|r.words[h])+(0|e.words[h])+n,this.words[h]=67108863&i,n=i>>>26;for(;0!==n&&h<r.length;h++)i=(0|r.words[h])+n,this.words[h]=67108863&i,n=i>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;h<r.length;h++)this.words[h]=r.words[h];return this},h.prototype.add=function(t){var i;return 0!==t.negative&&0===this.negative?(t.negative=0,i=this.sub(t),t.negative^=1,i):0===t.negative&&0!==this.negative?(this.negative=0,i=t.sub(this),this.negative=1,i):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},h.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var i=this.iadd(t);return t.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,e,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,e=t):(r=t,e=this);for(var h=0,o=0;o<e.length;o++)h=(i=(0|r.words[o])-(0|e.words[o])+h)>>26,this.words[o]=67108863&i;for(;0!==h&&o<r.length;o++)h=(i=(0|r.words[o])+h)>>26,this.words[o]=67108863&i;if(0===h&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this._strip()},h.prototype.sub=function(t){return this.clone().isub(t)};var c=function(t,i,r){var e,n,h,o=t.words,s=i.words,u=r.words,a=0,l=0|o[0],m=8191&l,f=l>>>13,d=0|o[1],p=8191&d,g=d>>>13,c=0|o[2],M=8191&c,v=c>>>13,w=0|o[3],y=8191&w,b=w>>>13,E=0|o[4],N=8191&E,_=E>>>13,R=0|o[5],S=8191&R,A=R>>>13,I=0|o[6],T=8191&I,O=I>>>13,U=0|o[7],C=8191&U,k=U>>>13,x=0|o[8],L=8191&x,P=x>>>13,D=0|o[9],B=8191&D,F=D>>>13,G=0|s[0],Z=8191&G,q=G>>>13,z=0|s[1],j=8191&z,X=z>>>13,K=0|s[2],V=8191&K,W=K>>>13,H=0|s[3],J=8191&H,$=H>>>13,Q=0|s[4],Y=8191&Q,tt=Q>>>13,it=0|s[5],rt=8191&it,et=it>>>13,nt=0|s[6],ht=8191&nt,ot=nt>>>13,st=0|s[7],ut=8191&st,at=st>>>13,lt=0|s[8],mt=8191&lt,ft=lt>>>13,dt=0|s[9],pt=8191&dt,gt=dt>>>13;r.negative=t.negative^i.negative,r.length=19;var ct=(a+(e=Math.imul(m,Z))|0)+((8191&(n=(n=Math.imul(m,q))+Math.imul(f,Z)|0))<<13)|0;a=((h=Math.imul(f,q))+(n>>>13)|0)+(ct>>>26)|0,ct&=67108863,e=Math.imul(p,Z),n=(n=Math.imul(p,q))+Math.imul(g,Z)|0,h=Math.imul(g,q);var Mt=(a+(e=e+Math.imul(m,j)|0)|0)+((8191&(n=(n=n+Math.imul(m,X)|0)+Math.imul(f,j)|0))<<13)|0;a=((h=h+Math.imul(f,X)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,e=Math.imul(M,Z),n=(n=Math.imul(M,q))+Math.imul(v,Z)|0,h=Math.imul(v,q),e=e+Math.imul(p,j)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(g,j)|0,h=h+Math.imul(g,X)|0;var vt=(a+(e=e+Math.imul(m,V)|0)|0)+((8191&(n=(n=n+Math.imul(m,W)|0)+Math.imul(f,V)|0))<<13)|0;a=((h=h+Math.imul(f,W)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,e=Math.imul(y,Z),n=(n=Math.imul(y,q))+Math.imul(b,Z)|0,h=Math.imul(b,q),e=e+Math.imul(M,j)|0,n=(n=n+Math.imul(M,X)|0)+Math.imul(v,j)|0,h=h+Math.imul(v,X)|0,e=e+Math.imul(p,V)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(g,V)|0,h=h+Math.imul(g,W)|0;var wt=(a+(e=e+Math.imul(m,J)|0)|0)+((8191&(n=(n=n+Math.imul(m,$)|0)+Math.imul(f,J)|0))<<13)|0;a=((h=h+Math.imul(f,$)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,e=Math.imul(N,Z),n=(n=Math.imul(N,q))+Math.imul(_,Z)|0,h=Math.imul(_,q),e=e+Math.imul(y,j)|0,n=(n=n+Math.imul(y,X)|0)+Math.imul(b,j)|0,h=h+Math.imul(b,X)|0,e=e+Math.imul(M,V)|0,n=(n=n+Math.imul(M,W)|0)+Math.imul(v,V)|0,h=h+Math.imul(v,W)|0,e=e+Math.imul(p,J)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(g,J)|0,h=h+Math.imul(g,$)|0;var yt=(a+(e=e+Math.imul(m,Y)|0)|0)+((8191&(n=(n=n+Math.imul(m,tt)|0)+Math.imul(f,Y)|0))<<13)|0;a=((h=h+Math.imul(f,tt)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,e=Math.imul(S,Z),n=(n=Math.imul(S,q))+Math.imul(A,Z)|0,h=Math.imul(A,q),e=e+Math.imul(N,j)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(_,j)|0,h=h+Math.imul(_,X)|0,e=e+Math.imul(y,V)|0,n=(n=n+Math.imul(y,W)|0)+Math.imul(b,V)|0,h=h+Math.imul(b,W)|0,e=e+Math.imul(M,J)|0,n=(n=n+Math.imul(M,$)|0)+Math.imul(v,J)|0,h=h+Math.imul(v,$)|0,e=e+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(g,Y)|0,h=h+Math.imul(g,tt)|0;var bt=(a+(e=e+Math.imul(m,rt)|0)|0)+((8191&(n=(n=n+Math.imul(m,et)|0)+Math.imul(f,rt)|0))<<13)|0;a=((h=h+Math.imul(f,et)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,e=Math.imul(T,Z),n=(n=Math.imul(T,q))+Math.imul(O,Z)|0,h=Math.imul(O,q),e=e+Math.imul(S,j)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(A,j)|0,h=h+Math.imul(A,X)|0,e=e+Math.imul(N,V)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(_,V)|0,h=h+Math.imul(_,W)|0,e=e+Math.imul(y,J)|0,n=(n=n+Math.imul(y,$)|0)+Math.imul(b,J)|0,h=h+Math.imul(b,$)|0,e=e+Math.imul(M,Y)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(v,Y)|0,h=h+Math.imul(v,tt)|0,e=e+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,et)|0)+Math.imul(g,rt)|0,h=h+Math.imul(g,et)|0;var Et=(a+(e=e+Math.imul(m,ht)|0)|0)+((8191&(n=(n=n+Math.imul(m,ot)|0)+Math.imul(f,ht)|0))<<13)|0;a=((h=h+Math.imul(f,ot)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,e=Math.imul(C,Z),n=(n=Math.imul(C,q))+Math.imul(k,Z)|0,h=Math.imul(k,q),e=e+Math.imul(T,j)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(O,j)|0,h=h+Math.imul(O,X)|0,e=e+Math.imul(S,V)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(A,V)|0,h=h+Math.imul(A,W)|0,e=e+Math.imul(N,J)|0,n=(n=n+Math.imul(N,$)|0)+Math.imul(_,J)|0,h=h+Math.imul(_,$)|0,e=e+Math.imul(y,Y)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(b,Y)|0,h=h+Math.imul(b,tt)|0,e=e+Math.imul(M,rt)|0,n=(n=n+Math.imul(M,et)|0)+Math.imul(v,rt)|0,h=h+Math.imul(v,et)|0,e=e+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ot)|0)+Math.imul(g,ht)|0,h=h+Math.imul(g,ot)|0;var Nt=(a+(e=e+Math.imul(m,ut)|0)|0)+((8191&(n=(n=n+Math.imul(m,at)|0)+Math.imul(f,ut)|0))<<13)|0;a=((h=h+Math.imul(f,at)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,e=Math.imul(L,Z),n=(n=Math.imul(L,q))+Math.imul(P,Z)|0,h=Math.imul(P,q),e=e+Math.imul(C,j)|0,n=(n=n+Math.imul(C,X)|0)+Math.imul(k,j)|0,h=h+Math.imul(k,X)|0,e=e+Math.imul(T,V)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(O,V)|0,h=h+Math.imul(O,W)|0,e=e+Math.imul(S,J)|0,n=(n=n+Math.imul(S,$)|0)+Math.imul(A,J)|0,h=h+Math.imul(A,$)|0,e=e+Math.imul(N,Y)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(_,Y)|0,h=h+Math.imul(_,tt)|0,e=e+Math.imul(y,rt)|0,n=(n=n+Math.imul(y,et)|0)+Math.imul(b,rt)|0,h=h+Math.imul(b,et)|0,e=e+Math.imul(M,ht)|0,n=(n=n+Math.imul(M,ot)|0)+Math.imul(v,ht)|0,h=h+Math.imul(v,ot)|0,e=e+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,at)|0)+Math.imul(g,ut)|0,h=h+Math.imul(g,at)|0;var _t=(a+(e=e+Math.imul(m,mt)|0)|0)+((8191&(n=(n=n+Math.imul(m,ft)|0)+Math.imul(f,mt)|0))<<13)|0;a=((h=h+Math.imul(f,ft)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,e=Math.imul(B,Z),n=(n=Math.imul(B,q))+Math.imul(F,Z)|0,h=Math.imul(F,q),e=e+Math.imul(L,j)|0,n=(n=n+Math.imul(L,X)|0)+Math.imul(P,j)|0,h=h+Math.imul(P,X)|0,e=e+Math.imul(C,V)|0,n=(n=n+Math.imul(C,W)|0)+Math.imul(k,V)|0,h=h+Math.imul(k,W)|0,e=e+Math.imul(T,J)|0,n=(n=n+Math.imul(T,$)|0)+Math.imul(O,J)|0,h=h+Math.imul(O,$)|0,e=e+Math.imul(S,Y)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(A,Y)|0,h=h+Math.imul(A,tt)|0,e=e+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,et)|0)+Math.imul(_,rt)|0,h=h+Math.imul(_,et)|0,e=e+Math.imul(y,ht)|0,n=(n=n+Math.imul(y,ot)|0)+Math.imul(b,ht)|0,h=h+Math.imul(b,ot)|0,e=e+Math.imul(M,ut)|0,n=(n=n+Math.imul(M,at)|0)+Math.imul(v,ut)|0,h=h+Math.imul(v,at)|0,e=e+Math.imul(p,mt)|0,n=(n=n+Math.imul(p,ft)|0)+Math.imul(g,mt)|0,h=h+Math.imul(g,ft)|0;var Rt=(a+(e=e+Math.imul(m,pt)|0)|0)+((8191&(n=(n=n+Math.imul(m,gt)|0)+Math.imul(f,pt)|0))<<13)|0;a=((h=h+Math.imul(f,gt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,e=Math.imul(B,j),n=(n=Math.imul(B,X))+Math.imul(F,j)|0,h=Math.imul(F,X),e=e+Math.imul(L,V)|0,n=(n=n+Math.imul(L,W)|0)+Math.imul(P,V)|0,h=h+Math.imul(P,W)|0,e=e+Math.imul(C,J)|0,n=(n=n+Math.imul(C,$)|0)+Math.imul(k,J)|0,h=h+Math.imul(k,$)|0,e=e+Math.imul(T,Y)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(O,Y)|0,h=h+Math.imul(O,tt)|0,e=e+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,et)|0)+Math.imul(A,rt)|0,h=h+Math.imul(A,et)|0,e=e+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ot)|0)+Math.imul(_,ht)|0,h=h+Math.imul(_,ot)|0,e=e+Math.imul(y,ut)|0,n=(n=n+Math.imul(y,at)|0)+Math.imul(b,ut)|0,h=h+Math.imul(b,at)|0,e=e+Math.imul(M,mt)|0,n=(n=n+Math.imul(M,ft)|0)+Math.imul(v,mt)|0,h=h+Math.imul(v,ft)|0;var St=(a+(e=e+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;a=((h=h+Math.imul(g,gt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,e=Math.imul(B,V),n=(n=Math.imul(B,W))+Math.imul(F,V)|0,h=Math.imul(F,W),e=e+Math.imul(L,J)|0,n=(n=n+Math.imul(L,$)|0)+Math.imul(P,J)|0,h=h+Math.imul(P,$)|0,e=e+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(k,Y)|0,h=h+Math.imul(k,tt)|0,e=e+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,et)|0)+Math.imul(O,rt)|0,h=h+Math.imul(O,et)|0,e=e+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ot)|0)+Math.imul(A,ht)|0,h=h+Math.imul(A,ot)|0,e=e+Math.imul(N,ut)|0,n=(n=n+Math.imul(N,at)|0)+Math.imul(_,ut)|0,h=h+Math.imul(_,at)|0,e=e+Math.imul(y,mt)|0,n=(n=n+Math.imul(y,ft)|0)+Math.imul(b,mt)|0,h=h+Math.imul(b,ft)|0;var At=(a+(e=e+Math.imul(M,pt)|0)|0)+((8191&(n=(n=n+Math.imul(M,gt)|0)+Math.imul(v,pt)|0))<<13)|0;a=((h=h+Math.imul(v,gt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,e=Math.imul(B,J),n=(n=Math.imul(B,$))+Math.imul(F,J)|0,h=Math.imul(F,$),e=e+Math.imul(L,Y)|0,n=(n=n+Math.imul(L,tt)|0)+Math.imul(P,Y)|0,h=h+Math.imul(P,tt)|0,e=e+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,et)|0)+Math.imul(k,rt)|0,h=h+Math.imul(k,et)|0,e=e+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ot)|0)+Math.imul(O,ht)|0,h=h+Math.imul(O,ot)|0,e=e+Math.imul(S,ut)|0,n=(n=n+Math.imul(S,at)|0)+Math.imul(A,ut)|0,h=h+Math.imul(A,at)|0,e=e+Math.imul(N,mt)|0,n=(n=n+Math.imul(N,ft)|0)+Math.imul(_,mt)|0,h=h+Math.imul(_,ft)|0;var It=(a+(e=e+Math.imul(y,pt)|0)|0)+((8191&(n=(n=n+Math.imul(y,gt)|0)+Math.imul(b,pt)|0))<<13)|0;a=((h=h+Math.imul(b,gt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,e=Math.imul(B,Y),n=(n=Math.imul(B,tt))+Math.imul(F,Y)|0,h=Math.imul(F,tt),e=e+Math.imul(L,rt)|0,n=(n=n+Math.imul(L,et)|0)+Math.imul(P,rt)|0,h=h+Math.imul(P,et)|0,e=e+Math.imul(C,ht)|0,n=(n=n+Math.imul(C,ot)|0)+Math.imul(k,ht)|0,h=h+Math.imul(k,ot)|0,e=e+Math.imul(T,ut)|0,n=(n=n+Math.imul(T,at)|0)+Math.imul(O,ut)|0,h=h+Math.imul(O,at)|0,e=e+Math.imul(S,mt)|0,n=(n=n+Math.imul(S,ft)|0)+Math.imul(A,mt)|0,h=h+Math.imul(A,ft)|0;var Tt=(a+(e=e+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,gt)|0)+Math.imul(_,pt)|0))<<13)|0;a=((h=h+Math.imul(_,gt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,e=Math.imul(B,rt),n=(n=Math.imul(B,et))+Math.imul(F,rt)|0,h=Math.imul(F,et),e=e+Math.imul(L,ht)|0,n=(n=n+Math.imul(L,ot)|0)+Math.imul(P,ht)|0,h=h+Math.imul(P,ot)|0,e=e+Math.imul(C,ut)|0,n=(n=n+Math.imul(C,at)|0)+Math.imul(k,ut)|0,h=h+Math.imul(k,at)|0,e=e+Math.imul(T,mt)|0,n=(n=n+Math.imul(T,ft)|0)+Math.imul(O,mt)|0,h=h+Math.imul(O,ft)|0;var Ot=(a+(e=e+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,gt)|0)+Math.imul(A,pt)|0))<<13)|0;a=((h=h+Math.imul(A,gt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,e=Math.imul(B,ht),n=(n=Math.imul(B,ot))+Math.imul(F,ht)|0,h=Math.imul(F,ot),e=e+Math.imul(L,ut)|0,n=(n=n+Math.imul(L,at)|0)+Math.imul(P,ut)|0,h=h+Math.imul(P,at)|0,e=e+Math.imul(C,mt)|0,n=(n=n+Math.imul(C,ft)|0)+Math.imul(k,mt)|0,h=h+Math.imul(k,ft)|0;var Ut=(a+(e=e+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,gt)|0)+Math.imul(O,pt)|0))<<13)|0;a=((h=h+Math.imul(O,gt)|0)+(n>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,e=Math.imul(B,ut),n=(n=Math.imul(B,at))+Math.imul(F,ut)|0,h=Math.imul(F,at),e=e+Math.imul(L,mt)|0,n=(n=n+Math.imul(L,ft)|0)+Math.imul(P,mt)|0,h=h+Math.imul(P,ft)|0;var Ct=(a+(e=e+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,gt)|0)+Math.imul(k,pt)|0))<<13)|0;a=((h=h+Math.imul(k,gt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,e=Math.imul(B,mt),n=(n=Math.imul(B,ft))+Math.imul(F,mt)|0,h=Math.imul(F,ft);var kt=(a+(e=e+Math.imul(L,pt)|0)|0)+((8191&(n=(n=n+Math.imul(L,gt)|0)+Math.imul(P,pt)|0))<<13)|0;a=((h=h+Math.imul(P,gt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863;var xt=(a+(e=Math.imul(B,pt))|0)+((8191&(n=(n=Math.imul(B,gt))+Math.imul(F,pt)|0))<<13)|0;return a=((h=Math.imul(F,gt))+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,u[0]=ct,u[1]=Mt,u[2]=vt,u[3]=wt,u[4]=yt,u[5]=bt,u[6]=Et,u[7]=Nt,u[8]=_t,u[9]=Rt,u[10]=St,u[11]=At,u[12]=It,u[13]=Tt,u[14]=Ot,u[15]=Ut,u[16]=Ct,u[17]=kt,u[18]=xt,0!==a&&(u[19]=a,r.length++),r};function M(t,i,r){r.negative=i.negative^t.negative,r.length=t.length+i.length;for(var e=0,n=0,h=0;h<r.length-1;h++){var o=n;n=0;for(var s=67108863&e,u=Math.min(h,i.length-1),a=Math.max(0,h-t.length+1);a<=u;a++){var l=h-a,m=(0|t.words[l])*(0|i.words[a]),f=67108863&m;s=67108863&(f=f+s|0),n+=(o=(o=o+(m/67108864|0)|0)+(f>>>26)|0)>>>26,o&=67108863}r.words[h]=s,e=o,o=n}return 0!==e?r.words[h]=e:r.length--,r._strip()}function v(t,i,r){return M(t,i,r)}Math.imul||(c=g),h.prototype.mulTo=function(t,i){var r=this.length+t.length;return 10===this.length&&10===t.length?c(this,t,i):r<63?g(this,t,i):r<1024?M(this,t,i):v(this,t,i)},h.prototype.mul=function(t){var i=new h(null);return i.words=new Array(this.length+t.length),this.mulTo(t,i)},h.prototype.mulf=function(t){var i=new h(null);return i.words=new Array(this.length+t.length),v(this,t,i)},h.prototype.imul=function(t){return this.clone().mulTo(t,this)},h.prototype.imuln=function(t){var i=t<0;i&&(t=-t),e("number"==typeof t),e(t<67108864);for(var r=0,n=0;n<this.length;n++){var h=(0|this.words[n])*t,o=(67108863&h)+(67108863&r);r>>=26,r+=h/67108864|0,r+=o>>>26,this.words[n]=67108863&o}return 0!==r&&(this.words[n]=r,this.length++),i?this.ineg():this},h.prototype.muln=function(t){return this.clone().imuln(t)},h.prototype.sqr=function(){return this.mul(this)},h.prototype.isqr=function(){return this.imul(this.clone())},h.prototype.pow=function(t){var i=function(t){for(var i=new Array(t.bitLength()),r=0;r<i.length;r++){var e=r/26|0,n=r%26;i[r]=t.words[e]>>>n&1}return i}(t);if(0===i.length)return new h(1);for(var r=this,e=0;e<i.length&&0===i[e];e++,r=r.sqr());if(++e<i.length)for(var n=r.sqr();e<i.length;e++,n=n.sqr())0!==i[e]&&(r=r.mul(n));return r},h.prototype.iushln=function(t){e("number"==typeof t&&t>=0);var i,r=t%26,n=(t-r)/26,h=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(i=0;i<this.length;i++){var s=this.words[i]&h,u=(0|this.words[i])-s<<r;this.words[i]=u|o,o=s>>>26-r}o&&(this.words[i]=o,this.length++)}if(0!==n){for(i=this.length-1;i>=0;i--)this.words[i+n]=this.words[i];for(i=0;i<n;i++)this.words[i]=0;this.length+=n}return this._strip()},h.prototype.ishln=function(t){return e(0===this.negative),this.iushln(t)},h.prototype.iushrn=function(t,i,r){var n;e("number"==typeof t&&t>=0),n=i?(i-i%26)/26:0;var h=t%26,o=Math.min((t-h)/26,this.length),s=67108863^67108863>>>h<<h,u=r;if(n-=o,n=Math.max(0,n),u){for(var a=0;a<o;a++)u.words[a]=this.words[a];u.length=o}if(0===o);else if(this.length>o)for(this.length-=o,a=0;a<this.length;a++)this.words[a]=this.words[a+o];else this.words[0]=0,this.length=1;var l=0;for(a=this.length-1;a>=0&&(0!==l||a>=n);a--){var m=0|this.words[a];this.words[a]=l<<26-h|m>>>h,l=m&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},h.prototype.ishrn=function(t,i,r){return e(0===this.negative),this.iushrn(t,i,r)},h.prototype.shln=function(t){return this.clone().ishln(t)},h.prototype.ushln=function(t){return this.clone().iushln(t)},h.prototype.shrn=function(t){return this.clone().ishrn(t)},h.prototype.ushrn=function(t){return this.clone().iushrn(t)},h.prototype.testn=function(t){e("number"==typeof t&&t>=0);var i=t%26,r=(t-i)/26,n=1<<i;return!(this.length<=r||!(this.words[r]&n))},h.prototype.imaskn=function(t){e("number"==typeof t&&t>=0);var i=t%26,r=(t-i)/26;if(e(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==i&&r++,this.length=Math.min(r,this.length),0!==i){var n=67108863^67108863>>>i<<i;this.words[this.length-1]&=n}return this._strip()},h.prototype.maskn=function(t){return this.clone().imaskn(t)},h.prototype.iaddn=function(t){return e("number"==typeof t),e(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},h.prototype._iaddn=function(t){this.words[0]+=t;for(var i=0;i<this.length&&this.words[i]>=67108864;i++)this.words[i]-=67108864,i===this.length-1?this.words[i+1]=1:this.words[i+1]++;return this.length=Math.max(this.length,i+1),this},h.prototype.isubn=function(t){if(e("number"==typeof t),e(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var i=0;i<this.length&&this.words[i]<0;i++)this.words[i]+=67108864,this.words[i+1]-=1;return this._strip()},h.prototype.addn=function(t){return this.clone().iaddn(t)},h.prototype.subn=function(t){return this.clone().isubn(t)},h.prototype.iabs=function(){return this.negative=0,this},h.prototype.abs=function(){return this.clone().iabs()},h.prototype._ishlnsubmul=function(t,i,r){var n,h,o=t.length+r;this._expand(o);var s=0;for(n=0;n<t.length;n++){h=(0|this.words[n+r])+s;var u=(0|t.words[n])*i;s=((h-=67108863&u)>>26)-(u/67108864|0),this.words[n+r]=67108863&h}for(;n<this.length-r;n++)s=(h=(0|this.words[n+r])+s)>>26,this.words[n+r]=67108863&h;if(0===s)return this._strip();for(e(-1===s),s=0,n=0;n<this.length;n++)s=(h=-(0|this.words[n])+s)>>26,this.words[n]=67108863&h;return this.negative=1,this._strip()},h.prototype._wordDiv=function(t,i){var r=(this.length,t.length),e=this.clone(),n=t,o=0|n.words[n.length-1];0!=(r=26-this._countBits(o))&&(n=n.ushln(r),e.iushln(r),o=0|n.words[n.length-1]);var s,u=e.length-n.length;if("mod"!==i){(s=new h(null)).length=u+1,s.words=new Array(s.length);for(var a=0;a<s.length;a++)s.words[a]=0}var l=e.clone()._ishlnsubmul(n,1,u);0===l.negative&&(e=l,s&&(s.words[u]=1));for(var m=u-1;m>=0;m--){var f=67108864*(0|e.words[n.length+m])+(0|e.words[n.length+m-1]);for(f=Math.min(f/o|0,67108863),e._ishlnsubmul(n,f,m);0!==e.negative;)f--,e.negative=0,e._ishlnsubmul(n,1,m),e.isZero()||(e.negative^=1);s&&(s.words[m]=f)}return s&&s._strip(),e._strip(),"div"!==i&&0!==r&&e.iushrn(r),{div:s||null,mod:e}},h.prototype.divmod=function(t,i,r){return e(!t.isZero()),this.isZero()?{div:new h(0),mod:new h(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,i),"mod"!==i&&(n=s.div.neg()),"div"!==i&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),i),"mod"!==i&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),i),"div"!==i&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new h(0),mod:this}:1===t.length?"div"===i?{div:this.divn(t.words[0]),mod:null}:"mod"===i?{div:null,mod:new h(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new h(this.modrn(t.words[0]))}:this._wordDiv(t,i);var n,o,s},h.prototype.div=function(t){return this.divmod(t,"div",!1).div},h.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},h.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},h.prototype.divRound=function(t){var i=this.divmod(t);if(i.mod.isZero())return i.div;var r=0!==i.div.negative?i.mod.isub(t):i.mod,e=t.ushrn(1),n=t.andln(1),h=r.cmp(e);return h<0||1===n&&0===h?i.div:0!==i.div.negative?i.div.isubn(1):i.div.iaddn(1)},h.prototype.modrn=function(t){var i=t<0;i&&(t=-t),e(t<=67108863);for(var r=(1<<26)%t,n=0,h=this.length-1;h>=0;h--)n=(r*n+(0|this.words[h]))%t;return i?-n:n},h.prototype.modn=function(t){return this.modrn(t)},h.prototype.idivn=function(t){var i=t<0;i&&(t=-t),e(t<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var h=(0|this.words[n])+67108864*r;this.words[n]=h/t|0,r=h%t}return this._strip(),i?this.ineg():this},h.prototype.divn=function(t){return this.clone().idivn(t)},h.prototype.egcd=function(t){e(0===t.negative),e(!t.isZero());var i=this,r=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var n=new h(1),o=new h(0),s=new h(0),u=new h(1),a=0;i.isEven()&&r.isEven();)i.iushrn(1),r.iushrn(1),++a;for(var l=r.clone(),m=i.clone();!i.isZero();){for(var f=0,d=1;0==(i.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(i.iushrn(f);f-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(l),o.isub(m)),n.iushrn(1),o.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(m)),s.iushrn(1),u.iushrn(1);i.cmp(r)>=0?(i.isub(r),n.isub(s),o.isub(u)):(r.isub(i),s.isub(n),u.isub(o))}return{a:s,b:u,gcd:r.iushln(a)}},h.prototype._invmp=function(t){e(0===t.negative),e(!t.isZero());var i=this,r=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var n,o=new h(1),s=new h(0),u=r.clone();i.cmpn(1)>0&&r.cmpn(1)>0;){for(var a=0,l=1;0==(i.words[0]&l)&&a<26;++a,l<<=1);if(a>0)for(i.iushrn(a);a-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var m=0,f=1;0==(r.words[0]&f)&&m<26;++m,f<<=1);if(m>0)for(r.iushrn(m);m-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);i.cmp(r)>=0?(i.isub(r),o.isub(s)):(r.isub(i),s.isub(o))}return(n=0===i.cmpn(1)?o:s).cmpn(0)<0&&n.iadd(t),n},h.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var i=this.clone(),r=t.clone();i.negative=0,r.negative=0;for(var e=0;i.isEven()&&r.isEven();e++)i.iushrn(1),r.iushrn(1);for(;;){for(;i.isEven();)i.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=i.cmp(r);if(n<0){var h=i;i=r,r=h}else if(0===n||0===r.cmpn(1))break;i.isub(r)}return r.iushln(e)},h.prototype.invm=function(t){return this.egcd(t).a.umod(t)},h.prototype.isEven=function(){return 0==(1&this.words[0])},h.prototype.isOdd=function(){return 1==(1&this.words[0])},h.prototype.andln=function(t){return this.words[0]&t},h.prototype.bincn=function(t){e("number"==typeof t);var i=t%26,r=(t-i)/26,n=1<<i;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var h=n,o=r;0!==h&&o<this.length;o++){var s=0|this.words[o];h=(s+=h)>>>26,s&=67108863,this.words[o]=s}return 0!==h&&(this.words[o]=h,this.length++),this},h.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},h.prototype.cmpn=function(t){var i,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)i=1;else{r&&(t=-t),e(t<=67108863,"Number is too big");var n=0|this.words[0];i=n===t?0:n<t?-1:1}return 0!==this.negative?0|-i:i},h.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var i=this.ucmp(t);return 0!==this.negative?0|-i:i},h.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var i=0,r=this.length-1;r>=0;r--){var e=0|this.words[r],n=0|t.words[r];if(e!==n){e<n?i=-1:e>n&&(i=1);break}}return i},h.prototype.gtn=function(t){return 1===this.cmpn(t)},h.prototype.gt=function(t){return 1===this.cmp(t)},h.prototype.gten=function(t){return this.cmpn(t)>=0},h.prototype.gte=function(t){return this.cmp(t)>=0},h.prototype.ltn=function(t){return-1===this.cmpn(t)},h.prototype.lt=function(t){return-1===this.cmp(t)},h.prototype.lten=function(t){return this.cmpn(t)<=0},h.prototype.lte=function(t){return this.cmp(t)<=0},h.prototype.eqn=function(t){return 0===this.cmpn(t)},h.prototype.eq=function(t){return 0===this.cmp(t)},h.red=function(t){return new R(t)},h.prototype.toRed=function(t){return e(!this.red,"Already a number in reduction context"),e(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},h.prototype.fromRed=function(){return e(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},h.prototype._forceRed=function(t){return this.red=t,this},h.prototype.forceRed=function(t){return e(!this.red,"Already a number in reduction context"),this._forceRed(t)},h.prototype.redAdd=function(t){return e(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},h.prototype.redIAdd=function(t){return e(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},h.prototype.redSub=function(t){return e(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},h.prototype.redISub=function(t){return e(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},h.prototype.redShl=function(t){return e(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},h.prototype.redMul=function(t){return e(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},h.prototype.redIMul=function(t){return e(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},h.prototype.redSqr=function(){return e(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},h.prototype.redISqr=function(){return e(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},h.prototype.redSqrt=function(){return e(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},h.prototype.redInvm=function(){return e(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},h.prototype.redNeg=function(){return e(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},h.prototype.redPow=function(t){return e(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var w={k256:null,p224:null,p192:null,p25519:null};function y(t,i){this.name=t,this.p=new h(i,16),this.n=this.p.bitLength(),this.k=new h(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function N(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function R(t){if("string"==typeof t){var i=h._prime(t);this.m=i.p,this.prime=i}else e(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){R.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new h(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var t=new h(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var i,r=t;do{this.split(r,this.tmp),i=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(i>this.n);var e=i<this.n?-1:r.ucmp(this.p);return 0===e?(r.words[0]=0,r.length=1):e>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(t,i){t.iushrn(this.n,0,i)},y.prototype.imulK=function(t){return t.imul(this.k)},n(b,y),b.prototype.split=function(t,i){for(var r=4194303,e=Math.min(t.length,9),n=0;n<e;n++)i.words[n]=t.words[n];if(i.length=e,t.length<=9)return t.words[0]=0,void(t.length=1);var h=t.words[9];for(i.words[i.length++]=h&r,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(o&r)<<4|h>>>22,h=o}h>>>=22,t.words[n-10]=h,0===h&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var i=0,r=0;r<t.length;r++){var e=0|t.words[r];i+=977*e,t.words[r]=67108863&i,i=64*e+(i/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(E,y),n(N,y),n(_,y),_.prototype.imulK=function(t){for(var i=0,r=0;r<t.length;r++){var e=19*(0|t.words[r])+i,n=67108863&e;e>>>=26,t.words[r]=n,i=e}return 0!==i&&(t.words[t.length++]=i),t},h._prime=function(t){if(w[t])return w[t];var i;if("k256"===t)i=new b;else if("p224"===t)i=new E;else if("p192"===t)i=new N;else{if("p25519"!==t)throw new Error("Unknown prime "+t);i=new _}return w[t]=i,i},R.prototype._verify1=function(t){e(0===t.negative,"red works only with positives"),e(t.red,"red works only with red numbers")},R.prototype._verify2=function(t,i){e(0==(t.negative|i.negative),"red works only with positives"),e(t.red&&t.red===i.red,"red works only with red numbers")},R.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(l(t,t.umod(this.m)._forceRed(this)),t)},R.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},R.prototype.add=function(t,i){this._verify2(t,i);var r=t.add(i);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},R.prototype.iadd=function(t,i){this._verify2(t,i);var r=t.iadd(i);return r.cmp(this.m)>=0&&r.isub(this.m),r},R.prototype.sub=function(t,i){this._verify2(t,i);var r=t.sub(i);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},R.prototype.isub=function(t,i){this._verify2(t,i);var r=t.isub(i);return r.cmpn(0)<0&&r.iadd(this.m),r},R.prototype.shl=function(t,i){return this._verify1(t),this.imod(t.ushln(i))},R.prototype.imul=function(t,i){return this._verify2(t,i),this.imod(t.imul(i))},R.prototype.mul=function(t,i){return this._verify2(t,i),this.imod(t.mul(i))},R.prototype.isqr=function(t){return this.imul(t,t.clone())},R.prototype.sqr=function(t){return this.mul(t,t)},R.prototype.sqrt=function(t){if(t.isZero())return t.clone();var i=this.m.andln(3);if(e(i%2==1),3===i){var r=this.m.add(new h(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);e(!n.isZero());var s=new h(1).toRed(this),u=s.redNeg(),a=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new h(2*l*l).toRed(this);0!==this.pow(l,a).cmp(u);)l.redIAdd(u);for(var m=this.pow(l,n),f=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=o;0!==d.cmp(s);){for(var g=d,c=0;0!==g.cmp(s);c++)g=g.redSqr();e(c<p);var M=this.pow(m,new h(1).iushln(p-c-1));f=f.redMul(M),m=M.redSqr(),d=d.redMul(m),p=c}return f},R.prototype.invm=function(t){var i=t._invmp(this.m);return 0!==i.negative?(i.negative=0,this.imod(i).redNeg()):this.imod(i)},R.prototype.pow=function(t,i){if(i.isZero())return new h(1).toRed(this);if(0===i.cmpn(1))return t.clone();var r=new Array(16);r[0]=new h(1).toRed(this),r[1]=t;for(var e=2;e<r.length;e++)r[e]=this.mul(r[e-1],t);var n=r[0],o=0,s=0,u=i.bitLength()%26;for(0===u&&(u=26),e=i.length-1;e>=0;e--){for(var a=i.words[e],l=u-1;l>=0;l--){var m=a>>l&1;n!==r[0]&&(n=this.sqr(n)),0!==m||0!==o?(o<<=1,o|=m,(4==++s||0===e&&0===l)&&(n=this.mul(n,r[o]),s=0,o=0)):s=0}u=26}return n},R.prototype.convertTo=function(t){var i=t.umod(this.m);return i===t?i.clone():i},R.prototype.convertFrom=function(t){var i=t.clone();return i.red=null,i},h.mont=function(t){return new S(t)},n(S,R),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var i=this.imod(t.mul(this.rinv));return i.red=null,i},S.prototype.imul=function(t,i){if(t.isZero()||i.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(i),e=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(e).iushrn(this.shift),h=n;return n.cmp(this.m)>=0?h=n.isub(this.m):n.cmpn(0)<0&&(h=n.iadd(this.m)),h._forceRed(this)},S.prototype.mul=function(t,i){if(t.isZero()||i.isZero())return new h(0)._forceRed(this);var r=t.mul(i),e=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(e).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(v,t);const w="bignumber/5.7.0";var y=v.exports.BN;const b=new c(w),E={},N=9007199254740991;function _(t){return null!=t&&(S.isBigNumber(t)||"number"==typeof t&&t%1==0||"string"==typeof t&&!!t.match(/^-?[0-9]+$/)||h(t)||"bigint"==typeof t||e(t))}let R=!1;class S{constructor(t,i){t!==E&&b.throwError("cannot call constructor directly; use BigNumber.from",c.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=i,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return I(T(this).fromTwos(t))}toTwos(t){return I(T(this).toTwos(t))}abs(){return"-"===this._hex[0]?S.from(this._hex.substring(1)):this}add(t){return I(T(this).add(T(t)))}sub(t){return I(T(this).sub(T(t)))}div(t){return S.from(t).isZero()&&O("division-by-zero","div"),I(T(this).div(T(t)))}mul(t){return I(T(this).mul(T(t)))}mod(t){const i=T(t);return i.isNeg()&&O("division-by-zero","mod"),I(T(this).umod(i))}pow(t){const i=T(t);return i.isNeg()&&O("negative-power","pow"),I(T(this).pow(i))}and(t){const i=T(t);return(this.isNegative()||i.isNeg())&&O("unbound-bitwise-result","and"),I(T(this).and(i))}or(t){const i=T(t);return(this.isNegative()||i.isNeg())&&O("unbound-bitwise-result","or"),I(T(this).or(i))}xor(t){const i=T(t);return(this.isNegative()||i.isNeg())&&O("unbound-bitwise-result","xor"),I(T(this).xor(i))}mask(t){return(this.isNegative()||t<0)&&O("negative-width","mask"),I(T(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&O("negative-width","shl"),I(T(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&O("negative-width","shr"),I(T(this).shrn(t))}eq(t){return T(this).eq(T(t))}lt(t){return T(this).lt(T(t))}lte(t){return T(this).lte(T(t))}gt(t){return T(this).gt(T(t))}gte(t){return T(this).gte(T(t))}isNegative(){return"-"===this._hex[0]}isZero(){return T(this).isZero()}toNumber(){try{return T(this).toNumber()}catch(t){O("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(t){}return b.throwError("this platform does not support BigInt",c.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?R||(R=!0,b.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?b.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",c.errors.UNEXPECTED_ARGUMENT,{}):b.throwError("BigNumber.toString does not accept parameters",c.errors.UNEXPECTED_ARGUMENT,{})),T(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof S)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new S(E,A(t)):t.match(/^-?[0-9]+$/)?new S(E,A(new y(t))):b.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&O("underflow","BigNumber.from",t),(t>=N||t<=-N)&&O("overflow","BigNumber.from",t),S.from(String(t));const i=t;if("bigint"==typeof i)return S.from(i.toString());if(e(i))return S.from(n(i));if(i)if(i.toHexString){const t=i.toHexString();if("string"==typeof t)return S.from(t)}else{let t=i._hex;if(null==t&&"BigNumber"===i.type&&(t=i.hex),"string"==typeof t&&(h(t)||"-"===t[0]&&h(t.substring(1))))return S.from(t)}return b.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!(!t||!t._isBigNumber)}}function A(t){if("string"!=typeof t)return A(t.toString(16));if("-"===t[0])return"-"===(t=t.substring(1))[0]&&b.throwArgumentError("invalid hex","value",t),"0x00"===(t=A(t))?t:"-"+t;if("0x"!==t.substring(0,2)&&(t="0x"+t),"0x"===t)return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&"0x00"===t.substring(0,4);)t="0x"+t.substring(4);return t}function I(t){return S.from(A(t))}function T(t){const i=S.from(t).toHexString();return"-"===i[0]?new y("-"+i.substring(3),16):new y(i.substring(2),16)}function O(t,i,r){const e={fault:t,operation:i};return null!=r&&(e.value=r),b.throwError(t,c.errors.NUMERIC_FAULT,e)}const U=new c("strings/5.7.0");var C,k;function x(t,i,r,e,n){if(t===k.BAD_PREFIX||t===k.UNEXPECTED_CONTINUE){let t=0;for(let e=i+1;e<r.length&&r[e]>>6==2;e++)t++;return t}return t===k.OVERRUN?r.length-i-1:0}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(C||(C={})),function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"}(k||(k={}));const L=Object.freeze({error:function(t,i,r,e,n){return U.throwArgumentError(`invalid codepoint at offset ${i}; ${t}`,"bytes",r)},ignore:x,replace:function(t,i,r,e,n){return t===k.OVERLONG?(e.push(n),0):(e.push(65533),x(t,i,r))}});function P(t,i){null==i&&(i=L.error),t=o(t);const r=[];let e=0;for(;e<t.length;){const n=t[e++];if(n>>7==0){r.push(n);continue}let h=null,o=null;if(192==(224&n))h=1,o=127;else if(224==(240&n))h=2,o=2047;else{if(240!=(248&n)){e+=i(128==(192&n)?k.UNEXPECTED_CONTINUE:k.BAD_PREFIX,e-1,t,r);continue}h=3,o=65535}if(e-1+h>=t.length){e+=i(k.OVERRUN,e-1,t,r);continue}let s=n&(1<<8-h-1)-1;for(let n=0;n<h;n++){let n=t[e];if(128!=(192&n)){e+=i(k.MISSING_CONTINUE,e,t,r),s=null;break}s=s<<6|63&n,e++}null!==s&&(s>1114111?e+=i(k.OUT_OF_RANGE,e-1-h,t,r,s):s>=55296&&s<=57343?e+=i(k.UTF16_SURROGATE,e-1-h,t,r,s):s<=o?e+=i(k.OVERLONG,e-1-h,t,r,s):r.push(s))}return r}function D(t,i=C.current){i!=C.current&&(U.checkNormalize(),t=t.normalize(i));let r=[];for(let i=0;i<t.length;i++){const e=t.charCodeAt(i);if(e<128)r.push(e);else if(e<2048)r.push(e>>6|192),r.push(63&e|128);else if(55296==(64512&e)){i++;const n=t.charCodeAt(i);if(i>=t.length||56320!=(64512&n))throw new Error("invalid utf-8 string");const h=65536+((1023&e)<<10)+(1023&n);r.push(h>>18|240),r.push(h>>12&63|128),r.push(h>>6&63|128),r.push(63&h|128)}else r.push(e>>12|224),r.push(e>>6&63|128),r.push(63&e|128)}return o(r)}function B(t){const i="0000"+t.toString(16);return"\\u"+i.substring(i.length-4)}function F(t,i){return'"'+P(t,i).map((t=>{if(t<256){switch(t){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(t>=32&&t<127)return String.fromCharCode(t)}return t<=65535?B(t):B(55296+((t-=65536)>>10&1023))+B(56320+(1023&t))})).join("")+'"'}function G(t){return t.map((t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10&1023),56320+(1023&t))))).join("")}function Z(t,i){return G(P(t,i))}function q(t,i=C.current){return P(D(t,i))}function z(t){return i(D(t))}export{S as B,p as E,c as L,C as U,G as _,Z as a,_ as b,q as c,F as d,L as e,k as f,z as i,M as l,D as t,w as v};
1
+ import{c as t,k as i}from"./index-fcfb77a4.js";import{r}from"./__node-resolve_empty-82b9d0e4.js";import{isBytes as e,hexlify as n,isHexString as h,arrayify as o}from"@ethersproject/bytes";let s=!1,u=!1;const a={debug:1,default:2,info:2,warning:3,error:4,off:5};let l=a.default,m=null;const f=function(){try{const t=[];if(["NFD","NFC","NFKD","NFKC"].forEach((i=>{try{if("test"!=="test".normalize(i))throw new Error("bad normalize")}catch(r){t.push(i)}})),t.length)throw new Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}();var d,p;!function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"}(d||(d={})),function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"}(p||(p={}));const g="0123456789abcdef";class c{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,i){const r=t.toLowerCase();null==a[r]&&this.throwArgumentError("invalid log level name","logLevel",t),l>a[r]||console.log.apply(console,i)}debug(...t){this._log(c.levels.DEBUG,t)}info(...t){this._log(c.levels.INFO,t)}warn(...t){this._log(c.levels.WARNING,t)}makeError(t,i,r){if(u)return this.makeError("censored error",i,{});i||(i=c.errors.UNKNOWN_ERROR),r||(r={});const e=[];Object.keys(r).forEach((t=>{const i=r[t];try{if(i instanceof Uint8Array){let r="";for(let t=0;t<i.length;t++)r+=g[i[t]>>4],r+=g[15&i[t]];e.push(t+"=Uint8Array(0x"+r+")")}else e.push(t+"="+JSON.stringify(i))}catch(i){e.push(t+"="+JSON.stringify(r[t].toString()))}})),e.push(`code=${i}`),e.push(`version=${this.version}`);const n=t;let h="";switch(i){case p.NUMERIC_FAULT:{h="NUMERIC_FAULT";const i=t;switch(i){case"overflow":case"underflow":case"division-by-zero":h+="-"+i;break;case"negative-power":case"negative-width":h+="-unsupported";break;case"unbound-bitwise-result":h+="-unbound-result"}break}case p.CALL_EXCEPTION:case p.INSUFFICIENT_FUNDS:case p.MISSING_NEW:case p.NONCE_EXPIRED:case p.REPLACEMENT_UNDERPRICED:case p.TRANSACTION_REPLACED:case p.UNPREDICTABLE_GAS_LIMIT:h=i}h&&(t+=" [ See: https://links.ethers.org/v5-errors-"+h+" ]"),e.length&&(t+=" ("+e.join(", ")+")");const o=new Error(t);return o.reason=n,o.code=i,Object.keys(r).forEach((function(t){o[t]=r[t]})),o}throwError(t,i,r){throw this.makeError(t,i,r)}throwArgumentError(t,i,r){return this.throwError(t,c.errors.INVALID_ARGUMENT,{argument:i,value:r})}assert(t,i,r,e){t||this.throwError(i,r,e)}assertArgument(t,i,r,e){t||this.throwArgumentError(i,r,e)}checkNormalize(t){f&&this.throwError("platform missing String.prototype.normalize",c.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:f})}checkSafeUint53(t,i){"number"==typeof t&&(null==i&&(i="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(i,c.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(i,c.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,i,r){r=r?": "+r:"",t<i&&this.throwError("missing argument"+r,c.errors.MISSING_ARGUMENT,{count:t,expectedCount:i}),t>i&&this.throwError("too many arguments"+r,c.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:i})}checkNew(t,i){t!==Object&&null!=t||this.throwError("missing new",c.errors.MISSING_NEW,{name:i.name})}checkAbstract(t,i){t===i?this.throwError("cannot instantiate abstract class "+JSON.stringify(i.name)+" directly; use a sub-class",c.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",c.errors.MISSING_NEW,{name:i.name})}static globalLogger(){return m||(m=new c("logger/5.7.0")),m}static setCensorship(t,i){if(!t&&i&&this.globalLogger().throwError("cannot permanently disable censorship",c.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),s){if(!t)return;this.globalLogger().throwError("error censorship permanent",c.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}u=!!t,s=!!i}static setLogLevel(t){const i=a[t.toLowerCase()];null!=i?l=i:c.globalLogger().warn("invalid log level - "+t)}static from(t){return new c(t)}}c.errors=p,c.levels=d;var M=Object.freeze({__proto__:null,get LogLevel(){return d},get ErrorCode(){return p},Logger:c}),v={exports:{}};!function(t,i){function e(t,i){if(!t)throw new Error(i||"Assertion failed")}function n(t,i){t.super_=i;var r=function(){};r.prototype=i.prototype,t.prototype=new r,t.prototype.constructor=t}function h(t,i,r){if(h.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==i&&"be"!==i||(r=i,i=10),this._init(t||0,i||10,r||"be"))}var o;"object"==typeof t?t.exports=h:i.BN=h,h.BN=h,h.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r.Buffer}catch(t){}function s(t,i){var r=t.charCodeAt(i);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void e(!1,"Invalid character in "+t)}function u(t,i,r){var e=s(t,r);return r-1>=i&&(e|=s(t,r-1)<<4),e}function a(t,i,r,n){for(var h=0,o=0,s=Math.min(t.length,r),u=i;u<s;u++){var a=t.charCodeAt(u)-48;h*=n,o=a>=49?a-49+10:a>=17?a-17+10:a,e(a>=0&&o<n,"Invalid character"),h+=o}return h}function l(t,i){t.words=i.words,t.length=i.length,t.negative=i.negative,t.red=i.red}if(h.isBN=function(t){return t instanceof h||null!==t&&"object"==typeof t&&t.constructor.wordSize===h.wordSize&&Array.isArray(t.words)},h.max=function(t,i){return t.cmp(i)>0?t:i},h.min=function(t,i){return t.cmp(i)<0?t:i},h.prototype._init=function(t,i,r){if("number"==typeof t)return this._initNumber(t,i,r);if("object"==typeof t)return this._initArray(t,i,r);"hex"===i&&(i=16),e(i===(0|i)&&i>=2&&i<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<t.length&&(16===i?this._parseHex(t,n,r):(this._parseBase(t,i,n),"le"===r&&this._initArray(this.toArray(),i,r)))},h.prototype._initNumber=function(t,i,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(e(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),i,r)},h.prototype._initArray=function(t,i,r){if(e("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var h,o,s=0;if("be"===r)for(n=t.length-1,h=0;n>=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[h]|=o<<s&67108863,this.words[h+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,h++);else if("le"===r)for(n=0,h=0;n<t.length;n+=3)o=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[h]|=o<<s&67108863,this.words[h+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,h++);return this._strip()},h.prototype._parseHex=function(t,i,r){this.length=Math.ceil((t.length-i)/6),this.words=new Array(this.length);for(var e=0;e<this.length;e++)this.words[e]=0;var n,h=0,o=0;if("be"===r)for(e=t.length-1;e>=i;e-=2)n=u(t,i,e)<<h,this.words[o]|=67108863&n,h>=18?(h-=18,o+=1,this.words[o]|=n>>>26):h+=8;else for(e=(t.length-i)%2==0?i+1:i;e<t.length;e+=2)n=u(t,i,e)<<h,this.words[o]|=67108863&n,h>=18?(h-=18,o+=1,this.words[o]|=n>>>26):h+=8;this._strip()},h.prototype._parseBase=function(t,i,r){this.words=[0],this.length=1;for(var e=0,n=1;n<=67108863;n*=i)e++;e--,n=n/i|0;for(var h=t.length-r,o=h%e,s=Math.min(h,h-o)+r,u=0,l=r;l<s;l+=e)u=a(t,l,l+e,i),this.imuln(n),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==o){var m=1;for(u=a(t,l,t.length,i),l=0;l<o;l++)m*=i;this.imuln(m),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},h.prototype.copy=function(t){t.words=new Array(this.length);for(var i=0;i<this.length;i++)t.words[i]=this.words[i];t.length=this.length,t.negative=this.negative,t.red=this.red},h.prototype._move=function(t){l(t,this)},h.prototype.clone=function(){var t=new h(null);return this.copy(t),t},h.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},h.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},h.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{h.prototype[Symbol.for("nodejs.util.inspect.custom")]=m}catch(t){h.prototype.inspect=m}else h.prototype.inspect=m;function m(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function g(t,i,r){r.negative=i.negative^t.negative;var e=t.length+i.length|0;r.length=e,e=e-1|0;var n=0|t.words[0],h=0|i.words[0],o=n*h,s=67108863&o,u=o/67108864|0;r.words[0]=s;for(var a=1;a<e;a++){for(var l=u>>>26,m=67108863&u,f=Math.min(a,i.length-1),d=Math.max(0,a-t.length+1);d<=f;d++){var p=a-d|0;l+=(o=(n=0|t.words[p])*(h=0|i.words[d])+m)/67108864|0,m=67108863&o}r.words[a]=0|m,u=0|l}return 0!==u?r.words[a]=0|u:r.length--,r._strip()}h.prototype.toString=function(t,i){var r;if(i=0|i||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,h=0,o=0;o<this.length;o++){var s=this.words[o],u=(16777215&(s<<n|h)).toString(16);h=s>>>24-n&16777215,(n+=2)>=26&&(n-=26,o--),r=0!==h||o!==this.length-1?f[6-u.length]+u+r:u+r}for(0!==h&&(r=h.toString(16)+r);r.length%i!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var a=d[t],l=p[t];r="";var m=this.clone();for(m.negative=0;!m.isZero();){var g=m.modrn(l).toString(t);r=(m=m.idivn(l)).isZero()?g+r:f[a-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%i!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}e(!1,"Base should be between 2 and 36")},h.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&e(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},h.prototype.toJSON=function(){return this.toString(16,2)},o&&(h.prototype.toBuffer=function(t,i){return this.toArrayLike(o,t,i)}),h.prototype.toArray=function(t,i){return this.toArrayLike(Array,t,i)},h.prototype.toArrayLike=function(t,i,r){this._strip();var n=this.byteLength(),h=r||Math.max(1,n);e(n<=h,"byte array longer than desired length"),e(h>0,"Requested array length <= 0");var o=function(t,i){return t.allocUnsafe?t.allocUnsafe(i):new t(i)}(t,h);return this["_toArrayLike"+("le"===i?"LE":"BE")](o,n),o},h.prototype._toArrayLikeLE=function(t,i){for(var r=0,e=0,n=0,h=0;n<this.length;n++){var o=this.words[n]<<h|e;t[r++]=255&o,r<t.length&&(t[r++]=o>>8&255),r<t.length&&(t[r++]=o>>16&255),6===h?(r<t.length&&(t[r++]=o>>24&255),e=0,h=0):(e=o>>>24,h+=2)}if(r<t.length)for(t[r++]=e;r<t.length;)t[r++]=0},h.prototype._toArrayLikeBE=function(t,i){for(var r=t.length-1,e=0,n=0,h=0;n<this.length;n++){var o=this.words[n]<<h|e;t[r--]=255&o,r>=0&&(t[r--]=o>>8&255),r>=0&&(t[r--]=o>>16&255),6===h?(r>=0&&(t[r--]=o>>24&255),e=0,h=0):(e=o>>>24,h+=2)}if(r>=0)for(t[r--]=e;r>=0;)t[r--]=0},Math.clz32?h.prototype._countBits=function(t){return 32-Math.clz32(t)}:h.prototype._countBits=function(t){var i=t,r=0;return i>=4096&&(r+=13,i>>>=13),i>=64&&(r+=7,i>>>=7),i>=8&&(r+=4,i>>>=4),i>=2&&(r+=2,i>>>=2),r+i},h.prototype._zeroBits=function(t){if(0===t)return 26;var i=t,r=0;return 0==(8191&i)&&(r+=13,i>>>=13),0==(127&i)&&(r+=7,i>>>=7),0==(15&i)&&(r+=4,i>>>=4),0==(3&i)&&(r+=2,i>>>=2),0==(1&i)&&r++,r},h.prototype.bitLength=function(){var t=this.words[this.length-1],i=this._countBits(t);return 26*(this.length-1)+i},h.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,i=0;i<this.length;i++){var r=this._zeroBits(this.words[i]);if(t+=r,26!==r)break}return t},h.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},h.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},h.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},h.prototype.isNeg=function(){return 0!==this.negative},h.prototype.neg=function(){return this.clone().ineg()},h.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},h.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var i=0;i<t.length;i++)this.words[i]=this.words[i]|t.words[i];return this._strip()},h.prototype.ior=function(t){return e(0==(this.negative|t.negative)),this.iuor(t)},h.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},h.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},h.prototype.iuand=function(t){var i;i=this.length>t.length?t:this;for(var r=0;r<i.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=i.length,this._strip()},h.prototype.iand=function(t){return e(0==(this.negative|t.negative)),this.iuand(t)},h.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},h.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},h.prototype.iuxor=function(t){var i,r;this.length>t.length?(i=this,r=t):(i=t,r=this);for(var e=0;e<r.length;e++)this.words[e]=i.words[e]^r.words[e];if(this!==i)for(;e<i.length;e++)this.words[e]=i.words[e];return this.length=i.length,this._strip()},h.prototype.ixor=function(t){return e(0==(this.negative|t.negative)),this.iuxor(t)},h.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},h.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},h.prototype.inotn=function(t){e("number"==typeof t&&t>=0);var i=0|Math.ceil(t/26),r=t%26;this._expand(i),r>0&&i--;for(var n=0;n<i;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},h.prototype.notn=function(t){return this.clone().inotn(t)},h.prototype.setn=function(t,i){e("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=i?this.words[r]|1<<n:this.words[r]&~(1<<n),this._strip()},h.prototype.iadd=function(t){var i,r,e;if(0!==this.negative&&0===t.negative)return this.negative=0,i=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,i=this.isub(t),t.negative=1,i._normSign();this.length>t.length?(r=this,e=t):(r=t,e=this);for(var n=0,h=0;h<e.length;h++)i=(0|r.words[h])+(0|e.words[h])+n,this.words[h]=67108863&i,n=i>>>26;for(;0!==n&&h<r.length;h++)i=(0|r.words[h])+n,this.words[h]=67108863&i,n=i>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;h<r.length;h++)this.words[h]=r.words[h];return this},h.prototype.add=function(t){var i;return 0!==t.negative&&0===this.negative?(t.negative=0,i=this.sub(t),t.negative^=1,i):0===t.negative&&0!==this.negative?(this.negative=0,i=t.sub(this),this.negative=1,i):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},h.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var i=this.iadd(t);return t.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,e,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,e=t):(r=t,e=this);for(var h=0,o=0;o<e.length;o++)h=(i=(0|r.words[o])-(0|e.words[o])+h)>>26,this.words[o]=67108863&i;for(;0!==h&&o<r.length;o++)h=(i=(0|r.words[o])+h)>>26,this.words[o]=67108863&i;if(0===h&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this._strip()},h.prototype.sub=function(t){return this.clone().isub(t)};var c=function(t,i,r){var e,n,h,o=t.words,s=i.words,u=r.words,a=0,l=0|o[0],m=8191&l,f=l>>>13,d=0|o[1],p=8191&d,g=d>>>13,c=0|o[2],M=8191&c,v=c>>>13,w=0|o[3],y=8191&w,b=w>>>13,E=0|o[4],N=8191&E,_=E>>>13,R=0|o[5],S=8191&R,A=R>>>13,I=0|o[6],T=8191&I,O=I>>>13,U=0|o[7],C=8191&U,k=U>>>13,x=0|o[8],L=8191&x,P=x>>>13,D=0|o[9],B=8191&D,F=D>>>13,G=0|s[0],Z=8191&G,q=G>>>13,z=0|s[1],j=8191&z,X=z>>>13,K=0|s[2],V=8191&K,W=K>>>13,H=0|s[3],J=8191&H,$=H>>>13,Q=0|s[4],Y=8191&Q,tt=Q>>>13,it=0|s[5],rt=8191&it,et=it>>>13,nt=0|s[6],ht=8191&nt,ot=nt>>>13,st=0|s[7],ut=8191&st,at=st>>>13,lt=0|s[8],mt=8191&lt,ft=lt>>>13,dt=0|s[9],pt=8191&dt,gt=dt>>>13;r.negative=t.negative^i.negative,r.length=19;var ct=(a+(e=Math.imul(m,Z))|0)+((8191&(n=(n=Math.imul(m,q))+Math.imul(f,Z)|0))<<13)|0;a=((h=Math.imul(f,q))+(n>>>13)|0)+(ct>>>26)|0,ct&=67108863,e=Math.imul(p,Z),n=(n=Math.imul(p,q))+Math.imul(g,Z)|0,h=Math.imul(g,q);var Mt=(a+(e=e+Math.imul(m,j)|0)|0)+((8191&(n=(n=n+Math.imul(m,X)|0)+Math.imul(f,j)|0))<<13)|0;a=((h=h+Math.imul(f,X)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,e=Math.imul(M,Z),n=(n=Math.imul(M,q))+Math.imul(v,Z)|0,h=Math.imul(v,q),e=e+Math.imul(p,j)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(g,j)|0,h=h+Math.imul(g,X)|0;var vt=(a+(e=e+Math.imul(m,V)|0)|0)+((8191&(n=(n=n+Math.imul(m,W)|0)+Math.imul(f,V)|0))<<13)|0;a=((h=h+Math.imul(f,W)|0)+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,e=Math.imul(y,Z),n=(n=Math.imul(y,q))+Math.imul(b,Z)|0,h=Math.imul(b,q),e=e+Math.imul(M,j)|0,n=(n=n+Math.imul(M,X)|0)+Math.imul(v,j)|0,h=h+Math.imul(v,X)|0,e=e+Math.imul(p,V)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(g,V)|0,h=h+Math.imul(g,W)|0;var wt=(a+(e=e+Math.imul(m,J)|0)|0)+((8191&(n=(n=n+Math.imul(m,$)|0)+Math.imul(f,J)|0))<<13)|0;a=((h=h+Math.imul(f,$)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,e=Math.imul(N,Z),n=(n=Math.imul(N,q))+Math.imul(_,Z)|0,h=Math.imul(_,q),e=e+Math.imul(y,j)|0,n=(n=n+Math.imul(y,X)|0)+Math.imul(b,j)|0,h=h+Math.imul(b,X)|0,e=e+Math.imul(M,V)|0,n=(n=n+Math.imul(M,W)|0)+Math.imul(v,V)|0,h=h+Math.imul(v,W)|0,e=e+Math.imul(p,J)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(g,J)|0,h=h+Math.imul(g,$)|0;var yt=(a+(e=e+Math.imul(m,Y)|0)|0)+((8191&(n=(n=n+Math.imul(m,tt)|0)+Math.imul(f,Y)|0))<<13)|0;a=((h=h+Math.imul(f,tt)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,e=Math.imul(S,Z),n=(n=Math.imul(S,q))+Math.imul(A,Z)|0,h=Math.imul(A,q),e=e+Math.imul(N,j)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(_,j)|0,h=h+Math.imul(_,X)|0,e=e+Math.imul(y,V)|0,n=(n=n+Math.imul(y,W)|0)+Math.imul(b,V)|0,h=h+Math.imul(b,W)|0,e=e+Math.imul(M,J)|0,n=(n=n+Math.imul(M,$)|0)+Math.imul(v,J)|0,h=h+Math.imul(v,$)|0,e=e+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(g,Y)|0,h=h+Math.imul(g,tt)|0;var bt=(a+(e=e+Math.imul(m,rt)|0)|0)+((8191&(n=(n=n+Math.imul(m,et)|0)+Math.imul(f,rt)|0))<<13)|0;a=((h=h+Math.imul(f,et)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,e=Math.imul(T,Z),n=(n=Math.imul(T,q))+Math.imul(O,Z)|0,h=Math.imul(O,q),e=e+Math.imul(S,j)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(A,j)|0,h=h+Math.imul(A,X)|0,e=e+Math.imul(N,V)|0,n=(n=n+Math.imul(N,W)|0)+Math.imul(_,V)|0,h=h+Math.imul(_,W)|0,e=e+Math.imul(y,J)|0,n=(n=n+Math.imul(y,$)|0)+Math.imul(b,J)|0,h=h+Math.imul(b,$)|0,e=e+Math.imul(M,Y)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(v,Y)|0,h=h+Math.imul(v,tt)|0,e=e+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,et)|0)+Math.imul(g,rt)|0,h=h+Math.imul(g,et)|0;var Et=(a+(e=e+Math.imul(m,ht)|0)|0)+((8191&(n=(n=n+Math.imul(m,ot)|0)+Math.imul(f,ht)|0))<<13)|0;a=((h=h+Math.imul(f,ot)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,e=Math.imul(C,Z),n=(n=Math.imul(C,q))+Math.imul(k,Z)|0,h=Math.imul(k,q),e=e+Math.imul(T,j)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(O,j)|0,h=h+Math.imul(O,X)|0,e=e+Math.imul(S,V)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(A,V)|0,h=h+Math.imul(A,W)|0,e=e+Math.imul(N,J)|0,n=(n=n+Math.imul(N,$)|0)+Math.imul(_,J)|0,h=h+Math.imul(_,$)|0,e=e+Math.imul(y,Y)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(b,Y)|0,h=h+Math.imul(b,tt)|0,e=e+Math.imul(M,rt)|0,n=(n=n+Math.imul(M,et)|0)+Math.imul(v,rt)|0,h=h+Math.imul(v,et)|0,e=e+Math.imul(p,ht)|0,n=(n=n+Math.imul(p,ot)|0)+Math.imul(g,ht)|0,h=h+Math.imul(g,ot)|0;var Nt=(a+(e=e+Math.imul(m,ut)|0)|0)+((8191&(n=(n=n+Math.imul(m,at)|0)+Math.imul(f,ut)|0))<<13)|0;a=((h=h+Math.imul(f,at)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,e=Math.imul(L,Z),n=(n=Math.imul(L,q))+Math.imul(P,Z)|0,h=Math.imul(P,q),e=e+Math.imul(C,j)|0,n=(n=n+Math.imul(C,X)|0)+Math.imul(k,j)|0,h=h+Math.imul(k,X)|0,e=e+Math.imul(T,V)|0,n=(n=n+Math.imul(T,W)|0)+Math.imul(O,V)|0,h=h+Math.imul(O,W)|0,e=e+Math.imul(S,J)|0,n=(n=n+Math.imul(S,$)|0)+Math.imul(A,J)|0,h=h+Math.imul(A,$)|0,e=e+Math.imul(N,Y)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(_,Y)|0,h=h+Math.imul(_,tt)|0,e=e+Math.imul(y,rt)|0,n=(n=n+Math.imul(y,et)|0)+Math.imul(b,rt)|0,h=h+Math.imul(b,et)|0,e=e+Math.imul(M,ht)|0,n=(n=n+Math.imul(M,ot)|0)+Math.imul(v,ht)|0,h=h+Math.imul(v,ot)|0,e=e+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,at)|0)+Math.imul(g,ut)|0,h=h+Math.imul(g,at)|0;var _t=(a+(e=e+Math.imul(m,mt)|0)|0)+((8191&(n=(n=n+Math.imul(m,ft)|0)+Math.imul(f,mt)|0))<<13)|0;a=((h=h+Math.imul(f,ft)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,e=Math.imul(B,Z),n=(n=Math.imul(B,q))+Math.imul(F,Z)|0,h=Math.imul(F,q),e=e+Math.imul(L,j)|0,n=(n=n+Math.imul(L,X)|0)+Math.imul(P,j)|0,h=h+Math.imul(P,X)|0,e=e+Math.imul(C,V)|0,n=(n=n+Math.imul(C,W)|0)+Math.imul(k,V)|0,h=h+Math.imul(k,W)|0,e=e+Math.imul(T,J)|0,n=(n=n+Math.imul(T,$)|0)+Math.imul(O,J)|0,h=h+Math.imul(O,$)|0,e=e+Math.imul(S,Y)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(A,Y)|0,h=h+Math.imul(A,tt)|0,e=e+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,et)|0)+Math.imul(_,rt)|0,h=h+Math.imul(_,et)|0,e=e+Math.imul(y,ht)|0,n=(n=n+Math.imul(y,ot)|0)+Math.imul(b,ht)|0,h=h+Math.imul(b,ot)|0,e=e+Math.imul(M,ut)|0,n=(n=n+Math.imul(M,at)|0)+Math.imul(v,ut)|0,h=h+Math.imul(v,at)|0,e=e+Math.imul(p,mt)|0,n=(n=n+Math.imul(p,ft)|0)+Math.imul(g,mt)|0,h=h+Math.imul(g,ft)|0;var Rt=(a+(e=e+Math.imul(m,pt)|0)|0)+((8191&(n=(n=n+Math.imul(m,gt)|0)+Math.imul(f,pt)|0))<<13)|0;a=((h=h+Math.imul(f,gt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,e=Math.imul(B,j),n=(n=Math.imul(B,X))+Math.imul(F,j)|0,h=Math.imul(F,X),e=e+Math.imul(L,V)|0,n=(n=n+Math.imul(L,W)|0)+Math.imul(P,V)|0,h=h+Math.imul(P,W)|0,e=e+Math.imul(C,J)|0,n=(n=n+Math.imul(C,$)|0)+Math.imul(k,J)|0,h=h+Math.imul(k,$)|0,e=e+Math.imul(T,Y)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(O,Y)|0,h=h+Math.imul(O,tt)|0,e=e+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,et)|0)+Math.imul(A,rt)|0,h=h+Math.imul(A,et)|0,e=e+Math.imul(N,ht)|0,n=(n=n+Math.imul(N,ot)|0)+Math.imul(_,ht)|0,h=h+Math.imul(_,ot)|0,e=e+Math.imul(y,ut)|0,n=(n=n+Math.imul(y,at)|0)+Math.imul(b,ut)|0,h=h+Math.imul(b,at)|0,e=e+Math.imul(M,mt)|0,n=(n=n+Math.imul(M,ft)|0)+Math.imul(v,mt)|0,h=h+Math.imul(v,ft)|0;var St=(a+(e=e+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,gt)|0)+Math.imul(g,pt)|0))<<13)|0;a=((h=h+Math.imul(g,gt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,e=Math.imul(B,V),n=(n=Math.imul(B,W))+Math.imul(F,V)|0,h=Math.imul(F,W),e=e+Math.imul(L,J)|0,n=(n=n+Math.imul(L,$)|0)+Math.imul(P,J)|0,h=h+Math.imul(P,$)|0,e=e+Math.imul(C,Y)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(k,Y)|0,h=h+Math.imul(k,tt)|0,e=e+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,et)|0)+Math.imul(O,rt)|0,h=h+Math.imul(O,et)|0,e=e+Math.imul(S,ht)|0,n=(n=n+Math.imul(S,ot)|0)+Math.imul(A,ht)|0,h=h+Math.imul(A,ot)|0,e=e+Math.imul(N,ut)|0,n=(n=n+Math.imul(N,at)|0)+Math.imul(_,ut)|0,h=h+Math.imul(_,at)|0,e=e+Math.imul(y,mt)|0,n=(n=n+Math.imul(y,ft)|0)+Math.imul(b,mt)|0,h=h+Math.imul(b,ft)|0;var At=(a+(e=e+Math.imul(M,pt)|0)|0)+((8191&(n=(n=n+Math.imul(M,gt)|0)+Math.imul(v,pt)|0))<<13)|0;a=((h=h+Math.imul(v,gt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,e=Math.imul(B,J),n=(n=Math.imul(B,$))+Math.imul(F,J)|0,h=Math.imul(F,$),e=e+Math.imul(L,Y)|0,n=(n=n+Math.imul(L,tt)|0)+Math.imul(P,Y)|0,h=h+Math.imul(P,tt)|0,e=e+Math.imul(C,rt)|0,n=(n=n+Math.imul(C,et)|0)+Math.imul(k,rt)|0,h=h+Math.imul(k,et)|0,e=e+Math.imul(T,ht)|0,n=(n=n+Math.imul(T,ot)|0)+Math.imul(O,ht)|0,h=h+Math.imul(O,ot)|0,e=e+Math.imul(S,ut)|0,n=(n=n+Math.imul(S,at)|0)+Math.imul(A,ut)|0,h=h+Math.imul(A,at)|0,e=e+Math.imul(N,mt)|0,n=(n=n+Math.imul(N,ft)|0)+Math.imul(_,mt)|0,h=h+Math.imul(_,ft)|0;var It=(a+(e=e+Math.imul(y,pt)|0)|0)+((8191&(n=(n=n+Math.imul(y,gt)|0)+Math.imul(b,pt)|0))<<13)|0;a=((h=h+Math.imul(b,gt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,e=Math.imul(B,Y),n=(n=Math.imul(B,tt))+Math.imul(F,Y)|0,h=Math.imul(F,tt),e=e+Math.imul(L,rt)|0,n=(n=n+Math.imul(L,et)|0)+Math.imul(P,rt)|0,h=h+Math.imul(P,et)|0,e=e+Math.imul(C,ht)|0,n=(n=n+Math.imul(C,ot)|0)+Math.imul(k,ht)|0,h=h+Math.imul(k,ot)|0,e=e+Math.imul(T,ut)|0,n=(n=n+Math.imul(T,at)|0)+Math.imul(O,ut)|0,h=h+Math.imul(O,at)|0,e=e+Math.imul(S,mt)|0,n=(n=n+Math.imul(S,ft)|0)+Math.imul(A,mt)|0,h=h+Math.imul(A,ft)|0;var Tt=(a+(e=e+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,gt)|0)+Math.imul(_,pt)|0))<<13)|0;a=((h=h+Math.imul(_,gt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,e=Math.imul(B,rt),n=(n=Math.imul(B,et))+Math.imul(F,rt)|0,h=Math.imul(F,et),e=e+Math.imul(L,ht)|0,n=(n=n+Math.imul(L,ot)|0)+Math.imul(P,ht)|0,h=h+Math.imul(P,ot)|0,e=e+Math.imul(C,ut)|0,n=(n=n+Math.imul(C,at)|0)+Math.imul(k,ut)|0,h=h+Math.imul(k,at)|0,e=e+Math.imul(T,mt)|0,n=(n=n+Math.imul(T,ft)|0)+Math.imul(O,mt)|0,h=h+Math.imul(O,ft)|0;var Ot=(a+(e=e+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,gt)|0)+Math.imul(A,pt)|0))<<13)|0;a=((h=h+Math.imul(A,gt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,e=Math.imul(B,ht),n=(n=Math.imul(B,ot))+Math.imul(F,ht)|0,h=Math.imul(F,ot),e=e+Math.imul(L,ut)|0,n=(n=n+Math.imul(L,at)|0)+Math.imul(P,ut)|0,h=h+Math.imul(P,at)|0,e=e+Math.imul(C,mt)|0,n=(n=n+Math.imul(C,ft)|0)+Math.imul(k,mt)|0,h=h+Math.imul(k,ft)|0;var Ut=(a+(e=e+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,gt)|0)+Math.imul(O,pt)|0))<<13)|0;a=((h=h+Math.imul(O,gt)|0)+(n>>>13)|0)+(Ut>>>26)|0,Ut&=67108863,e=Math.imul(B,ut),n=(n=Math.imul(B,at))+Math.imul(F,ut)|0,h=Math.imul(F,at),e=e+Math.imul(L,mt)|0,n=(n=n+Math.imul(L,ft)|0)+Math.imul(P,mt)|0,h=h+Math.imul(P,ft)|0;var Ct=(a+(e=e+Math.imul(C,pt)|0)|0)+((8191&(n=(n=n+Math.imul(C,gt)|0)+Math.imul(k,pt)|0))<<13)|0;a=((h=h+Math.imul(k,gt)|0)+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,e=Math.imul(B,mt),n=(n=Math.imul(B,ft))+Math.imul(F,mt)|0,h=Math.imul(F,ft);var kt=(a+(e=e+Math.imul(L,pt)|0)|0)+((8191&(n=(n=n+Math.imul(L,gt)|0)+Math.imul(P,pt)|0))<<13)|0;a=((h=h+Math.imul(P,gt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863;var xt=(a+(e=Math.imul(B,pt))|0)+((8191&(n=(n=Math.imul(B,gt))+Math.imul(F,pt)|0))<<13)|0;return a=((h=Math.imul(F,gt))+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,u[0]=ct,u[1]=Mt,u[2]=vt,u[3]=wt,u[4]=yt,u[5]=bt,u[6]=Et,u[7]=Nt,u[8]=_t,u[9]=Rt,u[10]=St,u[11]=At,u[12]=It,u[13]=Tt,u[14]=Ot,u[15]=Ut,u[16]=Ct,u[17]=kt,u[18]=xt,0!==a&&(u[19]=a,r.length++),r};function M(t,i,r){r.negative=i.negative^t.negative,r.length=t.length+i.length;for(var e=0,n=0,h=0;h<r.length-1;h++){var o=n;n=0;for(var s=67108863&e,u=Math.min(h,i.length-1),a=Math.max(0,h-t.length+1);a<=u;a++){var l=h-a,m=(0|t.words[l])*(0|i.words[a]),f=67108863&m;s=67108863&(f=f+s|0),n+=(o=(o=o+(m/67108864|0)|0)+(f>>>26)|0)>>>26,o&=67108863}r.words[h]=s,e=o,o=n}return 0!==e?r.words[h]=e:r.length--,r._strip()}function v(t,i,r){return M(t,i,r)}Math.imul||(c=g),h.prototype.mulTo=function(t,i){var r=this.length+t.length;return 10===this.length&&10===t.length?c(this,t,i):r<63?g(this,t,i):r<1024?M(this,t,i):v(this,t,i)},h.prototype.mul=function(t){var i=new h(null);return i.words=new Array(this.length+t.length),this.mulTo(t,i)},h.prototype.mulf=function(t){var i=new h(null);return i.words=new Array(this.length+t.length),v(this,t,i)},h.prototype.imul=function(t){return this.clone().mulTo(t,this)},h.prototype.imuln=function(t){var i=t<0;i&&(t=-t),e("number"==typeof t),e(t<67108864);for(var r=0,n=0;n<this.length;n++){var h=(0|this.words[n])*t,o=(67108863&h)+(67108863&r);r>>=26,r+=h/67108864|0,r+=o>>>26,this.words[n]=67108863&o}return 0!==r&&(this.words[n]=r,this.length++),i?this.ineg():this},h.prototype.muln=function(t){return this.clone().imuln(t)},h.prototype.sqr=function(){return this.mul(this)},h.prototype.isqr=function(){return this.imul(this.clone())},h.prototype.pow=function(t){var i=function(t){for(var i=new Array(t.bitLength()),r=0;r<i.length;r++){var e=r/26|0,n=r%26;i[r]=t.words[e]>>>n&1}return i}(t);if(0===i.length)return new h(1);for(var r=this,e=0;e<i.length&&0===i[e];e++,r=r.sqr());if(++e<i.length)for(var n=r.sqr();e<i.length;e++,n=n.sqr())0!==i[e]&&(r=r.mul(n));return r},h.prototype.iushln=function(t){e("number"==typeof t&&t>=0);var i,r=t%26,n=(t-r)/26,h=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(i=0;i<this.length;i++){var s=this.words[i]&h,u=(0|this.words[i])-s<<r;this.words[i]=u|o,o=s>>>26-r}o&&(this.words[i]=o,this.length++)}if(0!==n){for(i=this.length-1;i>=0;i--)this.words[i+n]=this.words[i];for(i=0;i<n;i++)this.words[i]=0;this.length+=n}return this._strip()},h.prototype.ishln=function(t){return e(0===this.negative),this.iushln(t)},h.prototype.iushrn=function(t,i,r){var n;e("number"==typeof t&&t>=0),n=i?(i-i%26)/26:0;var h=t%26,o=Math.min((t-h)/26,this.length),s=67108863^67108863>>>h<<h,u=r;if(n-=o,n=Math.max(0,n),u){for(var a=0;a<o;a++)u.words[a]=this.words[a];u.length=o}if(0===o);else if(this.length>o)for(this.length-=o,a=0;a<this.length;a++)this.words[a]=this.words[a+o];else this.words[0]=0,this.length=1;var l=0;for(a=this.length-1;a>=0&&(0!==l||a>=n);a--){var m=0|this.words[a];this.words[a]=l<<26-h|m>>>h,l=m&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},h.prototype.ishrn=function(t,i,r){return e(0===this.negative),this.iushrn(t,i,r)},h.prototype.shln=function(t){return this.clone().ishln(t)},h.prototype.ushln=function(t){return this.clone().iushln(t)},h.prototype.shrn=function(t){return this.clone().ishrn(t)},h.prototype.ushrn=function(t){return this.clone().iushrn(t)},h.prototype.testn=function(t){e("number"==typeof t&&t>=0);var i=t%26,r=(t-i)/26,n=1<<i;return!(this.length<=r||!(this.words[r]&n))},h.prototype.imaskn=function(t){e("number"==typeof t&&t>=0);var i=t%26,r=(t-i)/26;if(e(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==i&&r++,this.length=Math.min(r,this.length),0!==i){var n=67108863^67108863>>>i<<i;this.words[this.length-1]&=n}return this._strip()},h.prototype.maskn=function(t){return this.clone().imaskn(t)},h.prototype.iaddn=function(t){return e("number"==typeof t),e(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<=t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},h.prototype._iaddn=function(t){this.words[0]+=t;for(var i=0;i<this.length&&this.words[i]>=67108864;i++)this.words[i]-=67108864,i===this.length-1?this.words[i+1]=1:this.words[i+1]++;return this.length=Math.max(this.length,i+1),this},h.prototype.isubn=function(t){if(e("number"==typeof t),e(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var i=0;i<this.length&&this.words[i]<0;i++)this.words[i]+=67108864,this.words[i+1]-=1;return this._strip()},h.prototype.addn=function(t){return this.clone().iaddn(t)},h.prototype.subn=function(t){return this.clone().isubn(t)},h.prototype.iabs=function(){return this.negative=0,this},h.prototype.abs=function(){return this.clone().iabs()},h.prototype._ishlnsubmul=function(t,i,r){var n,h,o=t.length+r;this._expand(o);var s=0;for(n=0;n<t.length;n++){h=(0|this.words[n+r])+s;var u=(0|t.words[n])*i;s=((h-=67108863&u)>>26)-(u/67108864|0),this.words[n+r]=67108863&h}for(;n<this.length-r;n++)s=(h=(0|this.words[n+r])+s)>>26,this.words[n+r]=67108863&h;if(0===s)return this._strip();for(e(-1===s),s=0,n=0;n<this.length;n++)s=(h=-(0|this.words[n])+s)>>26,this.words[n]=67108863&h;return this.negative=1,this._strip()},h.prototype._wordDiv=function(t,i){var r=(this.length,t.length),e=this.clone(),n=t,o=0|n.words[n.length-1];0!=(r=26-this._countBits(o))&&(n=n.ushln(r),e.iushln(r),o=0|n.words[n.length-1]);var s,u=e.length-n.length;if("mod"!==i){(s=new h(null)).length=u+1,s.words=new Array(s.length);for(var a=0;a<s.length;a++)s.words[a]=0}var l=e.clone()._ishlnsubmul(n,1,u);0===l.negative&&(e=l,s&&(s.words[u]=1));for(var m=u-1;m>=0;m--){var f=67108864*(0|e.words[n.length+m])+(0|e.words[n.length+m-1]);for(f=Math.min(f/o|0,67108863),e._ishlnsubmul(n,f,m);0!==e.negative;)f--,e.negative=0,e._ishlnsubmul(n,1,m),e.isZero()||(e.negative^=1);s&&(s.words[m]=f)}return s&&s._strip(),e._strip(),"div"!==i&&0!==r&&e.iushrn(r),{div:s||null,mod:e}},h.prototype.divmod=function(t,i,r){return e(!t.isZero()),this.isZero()?{div:new h(0),mod:new h(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,i),"mod"!==i&&(n=s.div.neg()),"div"!==i&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),i),"mod"!==i&&(n=s.div.neg()),{div:n,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),i),"div"!==i&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new h(0),mod:this}:1===t.length?"div"===i?{div:this.divn(t.words[0]),mod:null}:"mod"===i?{div:null,mod:new h(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new h(this.modrn(t.words[0]))}:this._wordDiv(t,i);var n,o,s},h.prototype.div=function(t){return this.divmod(t,"div",!1).div},h.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},h.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},h.prototype.divRound=function(t){var i=this.divmod(t);if(i.mod.isZero())return i.div;var r=0!==i.div.negative?i.mod.isub(t):i.mod,e=t.ushrn(1),n=t.andln(1),h=r.cmp(e);return h<0||1===n&&0===h?i.div:0!==i.div.negative?i.div.isubn(1):i.div.iaddn(1)},h.prototype.modrn=function(t){var i=t<0;i&&(t=-t),e(t<=67108863);for(var r=(1<<26)%t,n=0,h=this.length-1;h>=0;h--)n=(r*n+(0|this.words[h]))%t;return i?-n:n},h.prototype.modn=function(t){return this.modrn(t)},h.prototype.idivn=function(t){var i=t<0;i&&(t=-t),e(t<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var h=(0|this.words[n])+67108864*r;this.words[n]=h/t|0,r=h%t}return this._strip(),i?this.ineg():this},h.prototype.divn=function(t){return this.clone().idivn(t)},h.prototype.egcd=function(t){e(0===t.negative),e(!t.isZero());var i=this,r=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var n=new h(1),o=new h(0),s=new h(0),u=new h(1),a=0;i.isEven()&&r.isEven();)i.iushrn(1),r.iushrn(1),++a;for(var l=r.clone(),m=i.clone();!i.isZero();){for(var f=0,d=1;0==(i.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(i.iushrn(f);f-- >0;)(n.isOdd()||o.isOdd())&&(n.iadd(l),o.isub(m)),n.iushrn(1),o.iushrn(1);for(var p=0,g=1;0==(r.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(m)),s.iushrn(1),u.iushrn(1);i.cmp(r)>=0?(i.isub(r),n.isub(s),o.isub(u)):(r.isub(i),s.isub(n),u.isub(o))}return{a:s,b:u,gcd:r.iushln(a)}},h.prototype._invmp=function(t){e(0===t.negative),e(!t.isZero());var i=this,r=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var n,o=new h(1),s=new h(0),u=r.clone();i.cmpn(1)>0&&r.cmpn(1)>0;){for(var a=0,l=1;0==(i.words[0]&l)&&a<26;++a,l<<=1);if(a>0)for(i.iushrn(a);a-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var m=0,f=1;0==(r.words[0]&f)&&m<26;++m,f<<=1);if(m>0)for(r.iushrn(m);m-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);i.cmp(r)>=0?(i.isub(r),o.isub(s)):(r.isub(i),s.isub(o))}return(n=0===i.cmpn(1)?o:s).cmpn(0)<0&&n.iadd(t),n},h.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var i=this.clone(),r=t.clone();i.negative=0,r.negative=0;for(var e=0;i.isEven()&&r.isEven();e++)i.iushrn(1),r.iushrn(1);for(;;){for(;i.isEven();)i.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=i.cmp(r);if(n<0){var h=i;i=r,r=h}else if(0===n||0===r.cmpn(1))break;i.isub(r)}return r.iushln(e)},h.prototype.invm=function(t){return this.egcd(t).a.umod(t)},h.prototype.isEven=function(){return 0==(1&this.words[0])},h.prototype.isOdd=function(){return 1==(1&this.words[0])},h.prototype.andln=function(t){return this.words[0]&t},h.prototype.bincn=function(t){e("number"==typeof t);var i=t%26,r=(t-i)/26,n=1<<i;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var h=n,o=r;0!==h&&o<this.length;o++){var s=0|this.words[o];h=(s+=h)>>>26,s&=67108863,this.words[o]=s}return 0!==h&&(this.words[o]=h,this.length++),this},h.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},h.prototype.cmpn=function(t){var i,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)i=1;else{r&&(t=-t),e(t<=67108863,"Number is too big");var n=0|this.words[0];i=n===t?0:n<t?-1:1}return 0!==this.negative?0|-i:i},h.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var i=this.ucmp(t);return 0!==this.negative?0|-i:i},h.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var i=0,r=this.length-1;r>=0;r--){var e=0|this.words[r],n=0|t.words[r];if(e!==n){e<n?i=-1:e>n&&(i=1);break}}return i},h.prototype.gtn=function(t){return 1===this.cmpn(t)},h.prototype.gt=function(t){return 1===this.cmp(t)},h.prototype.gten=function(t){return this.cmpn(t)>=0},h.prototype.gte=function(t){return this.cmp(t)>=0},h.prototype.ltn=function(t){return-1===this.cmpn(t)},h.prototype.lt=function(t){return-1===this.cmp(t)},h.prototype.lten=function(t){return this.cmpn(t)<=0},h.prototype.lte=function(t){return this.cmp(t)<=0},h.prototype.eqn=function(t){return 0===this.cmpn(t)},h.prototype.eq=function(t){return 0===this.cmp(t)},h.red=function(t){return new R(t)},h.prototype.toRed=function(t){return e(!this.red,"Already a number in reduction context"),e(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},h.prototype.fromRed=function(){return e(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},h.prototype._forceRed=function(t){return this.red=t,this},h.prototype.forceRed=function(t){return e(!this.red,"Already a number in reduction context"),this._forceRed(t)},h.prototype.redAdd=function(t){return e(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},h.prototype.redIAdd=function(t){return e(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},h.prototype.redSub=function(t){return e(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},h.prototype.redISub=function(t){return e(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},h.prototype.redShl=function(t){return e(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},h.prototype.redMul=function(t){return e(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},h.prototype.redIMul=function(t){return e(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},h.prototype.redSqr=function(){return e(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},h.prototype.redISqr=function(){return e(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},h.prototype.redSqrt=function(){return e(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},h.prototype.redInvm=function(){return e(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},h.prototype.redNeg=function(){return e(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},h.prototype.redPow=function(t){return e(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var w={k256:null,p224:null,p192:null,p25519:null};function y(t,i){this.name=t,this.p=new h(i,16),this.n=this.p.bitLength(),this.k=new h(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function N(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function R(t){if("string"==typeof t){var i=h._prime(t);this.m=i.p,this.prime=i}else e(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){R.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new h(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var t=new h(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var i,r=t;do{this.split(r,this.tmp),i=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(i>this.n);var e=i<this.n?-1:r.ucmp(this.p);return 0===e?(r.words[0]=0,r.length=1):e>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(t,i){t.iushrn(this.n,0,i)},y.prototype.imulK=function(t){return t.imul(this.k)},n(b,y),b.prototype.split=function(t,i){for(var r=4194303,e=Math.min(t.length,9),n=0;n<e;n++)i.words[n]=t.words[n];if(i.length=e,t.length<=9)return t.words[0]=0,void(t.length=1);var h=t.words[9];for(i.words[i.length++]=h&r,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(o&r)<<4|h>>>22,h=o}h>>>=22,t.words[n-10]=h,0===h&&t.length>10?t.length-=10:t.length-=9},b.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var i=0,r=0;r<t.length;r++){var e=0|t.words[r];i+=977*e,t.words[r]=67108863&i,i=64*e+(i/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(E,y),n(N,y),n(_,y),_.prototype.imulK=function(t){for(var i=0,r=0;r<t.length;r++){var e=19*(0|t.words[r])+i,n=67108863&e;e>>>=26,t.words[r]=n,i=e}return 0!==i&&(t.words[t.length++]=i),t},h._prime=function(t){if(w[t])return w[t];var i;if("k256"===t)i=new b;else if("p224"===t)i=new E;else if("p192"===t)i=new N;else{if("p25519"!==t)throw new Error("Unknown prime "+t);i=new _}return w[t]=i,i},R.prototype._verify1=function(t){e(0===t.negative,"red works only with positives"),e(t.red,"red works only with red numbers")},R.prototype._verify2=function(t,i){e(0==(t.negative|i.negative),"red works only with positives"),e(t.red&&t.red===i.red,"red works only with red numbers")},R.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(l(t,t.umod(this.m)._forceRed(this)),t)},R.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},R.prototype.add=function(t,i){this._verify2(t,i);var r=t.add(i);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},R.prototype.iadd=function(t,i){this._verify2(t,i);var r=t.iadd(i);return r.cmp(this.m)>=0&&r.isub(this.m),r},R.prototype.sub=function(t,i){this._verify2(t,i);var r=t.sub(i);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},R.prototype.isub=function(t,i){this._verify2(t,i);var r=t.isub(i);return r.cmpn(0)<0&&r.iadd(this.m),r},R.prototype.shl=function(t,i){return this._verify1(t),this.imod(t.ushln(i))},R.prototype.imul=function(t,i){return this._verify2(t,i),this.imod(t.imul(i))},R.prototype.mul=function(t,i){return this._verify2(t,i),this.imod(t.mul(i))},R.prototype.isqr=function(t){return this.imul(t,t.clone())},R.prototype.sqr=function(t){return this.mul(t,t)},R.prototype.sqrt=function(t){if(t.isZero())return t.clone();var i=this.m.andln(3);if(e(i%2==1),3===i){var r=this.m.add(new h(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),o=0;!n.isZero()&&0===n.andln(1);)o++,n.iushrn(1);e(!n.isZero());var s=new h(1).toRed(this),u=s.redNeg(),a=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new h(2*l*l).toRed(this);0!==this.pow(l,a).cmp(u);)l.redIAdd(u);for(var m=this.pow(l,n),f=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=o;0!==d.cmp(s);){for(var g=d,c=0;0!==g.cmp(s);c++)g=g.redSqr();e(c<p);var M=this.pow(m,new h(1).iushln(p-c-1));f=f.redMul(M),m=M.redSqr(),d=d.redMul(m),p=c}return f},R.prototype.invm=function(t){var i=t._invmp(this.m);return 0!==i.negative?(i.negative=0,this.imod(i).redNeg()):this.imod(i)},R.prototype.pow=function(t,i){if(i.isZero())return new h(1).toRed(this);if(0===i.cmpn(1))return t.clone();var r=new Array(16);r[0]=new h(1).toRed(this),r[1]=t;for(var e=2;e<r.length;e++)r[e]=this.mul(r[e-1],t);var n=r[0],o=0,s=0,u=i.bitLength()%26;for(0===u&&(u=26),e=i.length-1;e>=0;e--){for(var a=i.words[e],l=u-1;l>=0;l--){var m=a>>l&1;n!==r[0]&&(n=this.sqr(n)),0!==m||0!==o?(o<<=1,o|=m,(4==++s||0===e&&0===l)&&(n=this.mul(n,r[o]),s=0,o=0)):s=0}u=26}return n},R.prototype.convertTo=function(t){var i=t.umod(this.m);return i===t?i.clone():i},R.prototype.convertFrom=function(t){var i=t.clone();return i.red=null,i},h.mont=function(t){return new S(t)},n(S,R),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var i=this.imod(t.mul(this.rinv));return i.red=null,i},S.prototype.imul=function(t,i){if(t.isZero()||i.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(i),e=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(e).iushrn(this.shift),h=n;return n.cmp(this.m)>=0?h=n.isub(this.m):n.cmpn(0)<0&&(h=n.iadd(this.m)),h._forceRed(this)},S.prototype.mul=function(t,i){if(t.isZero()||i.isZero())return new h(0)._forceRed(this);var r=t.mul(i),e=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(e).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(v,t);const w="bignumber/5.7.0";var y=v.exports.BN;const b=new c(w),E={},N=9007199254740991;function _(t){return null!=t&&(S.isBigNumber(t)||"number"==typeof t&&t%1==0||"string"==typeof t&&!!t.match(/^-?[0-9]+$/)||h(t)||"bigint"==typeof t||e(t))}let R=!1;class S{constructor(t,i){t!==E&&b.throwError("cannot call constructor directly; use BigNumber.from",c.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=i,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return I(T(this).fromTwos(t))}toTwos(t){return I(T(this).toTwos(t))}abs(){return"-"===this._hex[0]?S.from(this._hex.substring(1)):this}add(t){return I(T(this).add(T(t)))}sub(t){return I(T(this).sub(T(t)))}div(t){return S.from(t).isZero()&&O("division-by-zero","div"),I(T(this).div(T(t)))}mul(t){return I(T(this).mul(T(t)))}mod(t){const i=T(t);return i.isNeg()&&O("division-by-zero","mod"),I(T(this).umod(i))}pow(t){const i=T(t);return i.isNeg()&&O("negative-power","pow"),I(T(this).pow(i))}and(t){const i=T(t);return(this.isNegative()||i.isNeg())&&O("unbound-bitwise-result","and"),I(T(this).and(i))}or(t){const i=T(t);return(this.isNegative()||i.isNeg())&&O("unbound-bitwise-result","or"),I(T(this).or(i))}xor(t){const i=T(t);return(this.isNegative()||i.isNeg())&&O("unbound-bitwise-result","xor"),I(T(this).xor(i))}mask(t){return(this.isNegative()||t<0)&&O("negative-width","mask"),I(T(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&O("negative-width","shl"),I(T(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&O("negative-width","shr"),I(T(this).shrn(t))}eq(t){return T(this).eq(T(t))}lt(t){return T(this).lt(T(t))}lte(t){return T(this).lte(T(t))}gt(t){return T(this).gt(T(t))}gte(t){return T(this).gte(T(t))}isNegative(){return"-"===this._hex[0]}isZero(){return T(this).isZero()}toNumber(){try{return T(this).toNumber()}catch(t){O("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(t){}return b.throwError("this platform does not support BigInt",c.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?R||(R=!0,b.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?b.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",c.errors.UNEXPECTED_ARGUMENT,{}):b.throwError("BigNumber.toString does not accept parameters",c.errors.UNEXPECTED_ARGUMENT,{})),T(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof S)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new S(E,A(t)):t.match(/^-?[0-9]+$/)?new S(E,A(new y(t))):b.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&O("underflow","BigNumber.from",t),(t>=N||t<=-N)&&O("overflow","BigNumber.from",t),S.from(String(t));const i=t;if("bigint"==typeof i)return S.from(i.toString());if(e(i))return S.from(n(i));if(i)if(i.toHexString){const t=i.toHexString();if("string"==typeof t)return S.from(t)}else{let t=i._hex;if(null==t&&"BigNumber"===i.type&&(t=i.hex),"string"==typeof t&&(h(t)||"-"===t[0]&&h(t.substring(1))))return S.from(t)}return b.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!(!t||!t._isBigNumber)}}function A(t){if("string"!=typeof t)return A(t.toString(16));if("-"===t[0])return"-"===(t=t.substring(1))[0]&&b.throwArgumentError("invalid hex","value",t),"0x00"===(t=A(t))?t:"-"+t;if("0x"!==t.substring(0,2)&&(t="0x"+t),"0x"===t)return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&"0x00"===t.substring(0,4);)t="0x"+t.substring(4);return t}function I(t){return S.from(A(t))}function T(t){const i=S.from(t).toHexString();return"-"===i[0]?new y("-"+i.substring(3),16):new y(i.substring(2),16)}function O(t,i,r){const e={fault:t,operation:i};return null!=r&&(e.value=r),b.throwError(t,c.errors.NUMERIC_FAULT,e)}const U=new c("strings/5.7.0");var C,k;function x(t,i,r,e,n){if(t===k.BAD_PREFIX||t===k.UNEXPECTED_CONTINUE){let t=0;for(let e=i+1;e<r.length&&r[e]>>6==2;e++)t++;return t}return t===k.OVERRUN?r.length-i-1:0}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(C||(C={})),function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"}(k||(k={}));const L=Object.freeze({error:function(t,i,r,e,n){return U.throwArgumentError(`invalid codepoint at offset ${i}; ${t}`,"bytes",r)},ignore:x,replace:function(t,i,r,e,n){return t===k.OVERLONG?(e.push(n),0):(e.push(65533),x(t,i,r))}});function P(t,i){null==i&&(i=L.error),t=o(t);const r=[];let e=0;for(;e<t.length;){const n=t[e++];if(n>>7==0){r.push(n);continue}let h=null,o=null;if(192==(224&n))h=1,o=127;else if(224==(240&n))h=2,o=2047;else{if(240!=(248&n)){e+=i(128==(192&n)?k.UNEXPECTED_CONTINUE:k.BAD_PREFIX,e-1,t,r);continue}h=3,o=65535}if(e-1+h>=t.length){e+=i(k.OVERRUN,e-1,t,r);continue}let s=n&(1<<8-h-1)-1;for(let n=0;n<h;n++){let n=t[e];if(128!=(192&n)){e+=i(k.MISSING_CONTINUE,e,t,r),s=null;break}s=s<<6|63&n,e++}null!==s&&(s>1114111?e+=i(k.OUT_OF_RANGE,e-1-h,t,r,s):s>=55296&&s<=57343?e+=i(k.UTF16_SURROGATE,e-1-h,t,r,s):s<=o?e+=i(k.OVERLONG,e-1-h,t,r,s):r.push(s))}return r}function D(t,i=C.current){i!=C.current&&(U.checkNormalize(),t=t.normalize(i));let r=[];for(let i=0;i<t.length;i++){const e=t.charCodeAt(i);if(e<128)r.push(e);else if(e<2048)r.push(e>>6|192),r.push(63&e|128);else if(55296==(64512&e)){i++;const n=t.charCodeAt(i);if(i>=t.length||56320!=(64512&n))throw new Error("invalid utf-8 string");const h=65536+((1023&e)<<10)+(1023&n);r.push(h>>18|240),r.push(h>>12&63|128),r.push(h>>6&63|128),r.push(63&h|128)}else r.push(e>>12|224),r.push(e>>6&63|128),r.push(63&e|128)}return o(r)}function B(t){const i="0000"+t.toString(16);return"\\u"+i.substring(i.length-4)}function F(t,i){return'"'+P(t,i).map((t=>{if(t<256){switch(t){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(t>=32&&t<127)return String.fromCharCode(t)}return t<=65535?B(t):B(55296+((t-=65536)>>10&1023))+B(56320+(1023&t))})).join("")+'"'}function G(t){return t.map((t=>t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode(55296+(t>>10&1023),56320+(1023&t))))).join("")}function Z(t,i){return G(P(t,i))}function q(t,i=C.current){return P(D(t,i))}function z(t){return i(D(t))}export{S as B,p as E,c as L,C as U,G as _,Z as a,_ as b,q as c,F as d,L as e,k as f,z as i,M as l,D as t,w as v};
@@ -1 +1 @@
1
- import{_ as e,l as r,m as t,n as o,E as n,o as s,p as i,u as a}from"./index-5abb7d26.js";export{q as getIsCyber}from"./index-5abb7d26.js";import{JsonRpcProvider as d}from"@ethersproject/providers";import{getAddress as c}from"@ethersproject/address";import"events";import{hexlify as h}from"@ethersproject/bytes";import{t as p}from"./id-9141cd94.js";import{T as u}from"./typed-data-9913b176.js";import{Signer as l}from"@ethersproject/abstract-signer";import{deepCopy as m}from"@ethersproject/properties";import{f as v}from"./index-028368fa.js";import"zustand";import"@ethersproject/constants";import"@ethersproject/contracts";import"@ethersproject/transactions";import"./__node-resolve_empty-5ca02702.js";class g extends l{constructor(e,r,t,o){super(),this._address=r,this._index=null!=t?t:0,this.provider=e,this.app=o}_legacySignMessage(e){throw new Error("Method not implemented.")}sendUncheckedTransaction(e){throw new Error("Method not implemented.")}unlock(e){throw new Error("Method not implemented.")}getAddress(){return e(this,void 0,void 0,(function*(){return Promise.resolve(c(this._address))}))}signMessage(t){return e(this,void 0,void 0,(function*(){const e=r(),o="string"==typeof t?p(t):t,n=yield this.getAddress();return yield e.send("personal_sign",[h(o),n.toLowerCase()])}))}_signTypedData(o,n,s){var i,a;return e(this,void 0,void 0,(function*(){const d=r(),c=yield u.resolveNames(o,n,s,(r=>e(this,void 0,void 0,(function*(){return yield d.resolveName(r)})))),h=null!==(a=null===(i=t())||void 0===i?void 0:i.ownerAddress)&&void 0!==a?a:"";return yield d.send("eth_signTypedData_v4",[h.toLowerCase(),JSON.stringify(u.getPayload(c.domain,n,c.value))])}))}signTransaction(r){return e(this,void 0,void 0,(function*(){throw new Error("Method not implemented.")}))}sendTransaction(r){return e(this,void 0,void 0,(function*(){const e=yield this.getChainId(),t=o(this.app,e);return{hash:yield t.sendTransaction({to:r.to,value:r.value,data:r.data}).catch((e=>{if(e.name===n.SendTransactionError&&(console.error(e.shortMessage),e.shortMessage))throw new Error(e.shortMessage);throw e}))}}))}connect(e){return new g(null!=e?e:this.provider,this._address,this._index,this.app)}connectUnchecked(){return new g(this.provider,this._address,this._index,this.app)}}function f(e){if(e.error){const r=new Error(e.error.message);throw r.code=e.error.code,r.data=e.error.data,r}return e.result}function w(r,t){return e(this,void 0,void 0,(function*(){const o=yield function({appName:r,appLogoUrl:t,rpcUrl:o,rpc:n,chainId:a,cyberParams:h}){return e(this,void 0,void 0,(function*(){if(!r||!t)throw new Error("appName and appLogoUrl is required.");if(!(null==h?void 0:h.appId))throw new Error("cyberParams.appId and appLogoUrl is required.");const{app:p,cyberAccount:u}=yield s({appName:r,appLogoUrl:t,appId:null==h?void 0:h.appId});if(!u)throw new Error("cyberAccount is not valid.");const l=u.address,w=new class extends d{constructor(e,r){super(e,r),this.updateUpWalletConfig=e=>{const r=null==n?void 0:n[e];if(!i.includes(e)||!r)throw new Error(`chainId ${e} not supported`);return this.chainId=e,r&&(this.rpcUrl=r),this.emit("chainChanged",`0x${e.toString(16)}`),{result:!0}},this.rpcUrl=e,this.chainId=a}getSigner(){return new g(w,l,0,p)}listAccounts(){return e(this,void 0,void 0,(function*(){return[l]}))}getNetwork(){return this.chainId?Promise.resolve({chainId:this.chainId,name:"unknown"}):super.getNetwork()}send(e,r){const t={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:m(t),provider:this});const o=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(o&&this._cache[e])return this._cache[e];const n=v({url:this.rpcUrl},JSON.stringify(t),f).then((e=>(this.emit("debug",{action:"response",request:t,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:t,provider:this}),e}));return o&&(this._cache[e]=n,setTimeout((()=>{this._cache[e]=null}),0)),n}getAddress(){return Promise.resolve(c(l))}}(o,a);return w}))}(r);return o.on("connect",t.connect),o.on("disconnect",t.disconnect),o.on("accountsChanged",t.accountsChanged),o.on("chainChanged",t.chainChanged),o.on("message",t.message),o}))}function y(e){var r;const t=e.addChainParameters.chainId,o="string"==typeof t&&(null==t?void 0:t.startsWith("0x"))?parseInt(t,16):Number(t);if(!i.includes(o))throw new Error(`chainId ${o} not supported`);return null===(r=a.getState().provider)||void 0===r?void 0:r.updateUpWalletConfig(o)}export{w as default,y as switchChain};
1
+ import{_ as e,l as r,m as t,n as o,E as n,o as s,p as i,u as a}from"./index-fcfb77a4.js";export{q as getIsCyber}from"./index-fcfb77a4.js";import{JsonRpcProvider as d}from"@ethersproject/providers";import{getAddress as c}from"@ethersproject/address";import"events";import{hexlify as h}from"@ethersproject/bytes";import{t as p}from"./id-ffcb95de.js";import{T as u}from"./typed-data-14a23035.js";import{Signer as l}from"@ethersproject/abstract-signer";import{deepCopy as m}from"@ethersproject/properties";import{f as v}from"./index-c93ac5db.js";import"zustand";import"@ethersproject/constants";import"@ethersproject/contracts";import"@ethersproject/transactions";import"./__node-resolve_empty-82b9d0e4.js";class f extends l{constructor(e,r,t,o){super(),this._address=r,this._index=null!=t?t:0,this.provider=e,this.app=o}_legacySignMessage(e){throw new Error("Method not implemented.")}sendUncheckedTransaction(e){throw new Error("Method not implemented.")}unlock(e){throw new Error("Method not implemented.")}getAddress(){return e(this,void 0,void 0,(function*(){return Promise.resolve(c(this._address))}))}signMessage(t){return e(this,void 0,void 0,(function*(){const e=r(),o="string"==typeof t?p(t):t,n=yield this.getAddress();return yield e.send("personal_sign",[h(o),n.toLowerCase()])}))}_signTypedData(o,n,s){var i,a;return e(this,void 0,void 0,(function*(){const d=r(),c=yield u.resolveNames(o,n,s,(r=>e(this,void 0,void 0,(function*(){return yield d.resolveName(r)})))),h=null!==(a=null===(i=t())||void 0===i?void 0:i.ownerAddress)&&void 0!==a?a:"";return yield d.send("eth_signTypedData_v4",[h.toLowerCase(),JSON.stringify(u.getPayload(c.domain,n,c.value))])}))}signTransaction(r){return e(this,void 0,void 0,(function*(){throw new Error("Method not implemented.")}))}sendTransaction(r){return e(this,void 0,void 0,(function*(){const e=yield this.getChainId(),t=o(this.app,e);return{hash:yield t.sendTransaction({to:r.to,value:r.value,data:r.data}).catch((e=>{if(e.name===n.SendTransactionError&&(console.error(e.shortMessage),e.shortMessage))throw new Error(e.shortMessage);throw e}))}}))}connect(e){return new f(null!=e?e:this.provider,this._address,this._index,this.app)}connectUnchecked(){return new f(this.provider,this._address,this._index,this.app)}}function g(e){if(e.error){const r=new Error(e.error.message);throw r.code=e.error.code,r.data=e.error.data,r}return e.result}function w(r,t){return e(this,void 0,void 0,(function*(){const o=yield function({appName:r,appLogoUrl:t,rpcUrl:o,rpc:n,chainId:a,cyberParams:h}){return e(this,void 0,void 0,(function*(){if(!r||!t)throw new Error("appName and appLogoUrl is required.");if(!(null==h?void 0:h.appId))throw new Error("cyberParams.appId and appLogoUrl is required.");const{app:p,cyberAccount:u}=yield s({appName:r,appLogoUrl:t,appId:null==h?void 0:h.appId});if(!u)throw new Error("cyberAccount is not valid.");const l=u.address,w=new class extends d{constructor(e,r){super(e,r),this.updateUpWalletConfig=e=>{const r=null==n?void 0:n[e];if(!i.includes(e)||!r)throw new Error(`chainId ${e} not supported`);return this.chainId=e,r&&(this.rpcUrl=r),this.emit("chainChanged",`0x${e.toString(16)}`),{result:!0}},this.rpcUrl=e,this.chainId=a}getSigner(){return new f(w,l,0,p)}listAccounts(){return e(this,void 0,void 0,(function*(){return[l]}))}getNetwork(){return this.chainId?Promise.resolve({chainId:this.chainId,name:"unknown"}):super.getNetwork()}send(e,r){const t={method:e,params:r,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:m(t),provider:this});const o=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(o&&this._cache[e])return this._cache[e];const n=v({url:this.rpcUrl},JSON.stringify(t),g).then((e=>(this.emit("debug",{action:"response",request:t,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:t,provider:this}),e}));return o&&(this._cache[e]=n,setTimeout((()=>{this._cache[e]=null}),0)),n}getAddress(){return Promise.resolve(c(l))}}(o,a);return w}))}(r);return o.on("connect",t.connect),o.on("disconnect",t.disconnect),o.on("accountsChanged",t.accountsChanged),o.on("chainChanged",t.chainChanged),o.on("message",t.message),o}))}function y(e){var r;const t=e.addChainParameters.chainId,o="string"==typeof t&&(null==t?void 0:t.startsWith("0x"))?parseInt(t,16):Number(t);if(!i.includes(o))throw new Error(`chainId ${o} not supported`);return null===(r=a.getState().provider)||void 0===r?void 0:r.updateUpWalletConfig(o)}export{w as default,y as switchChain};
@@ -1 +1 @@
1
- import{hexlify as r,arrayify as t,isBytesLike as o}from"@ethersproject/bytes";import{L as e}from"./id-9141cd94.js";const n=new e("rlp/5.7.0");function s(r){const t=[];for(;r;)t.unshift(255&r),r>>=8;return t}function c(r,t,o){let e=0;for(let n=0;n<o;n++)e=256*e+r[t+n];return e}function h(r){if(Array.isArray(r)){let t=[];if(r.forEach((function(r){t=t.concat(h(r))})),t.length<=55)return t.unshift(192+t.length),t;const o=s(t.length);return o.unshift(247+o.length),o.concat(t)}o(r)||n.throwArgumentError("RLP object must be BytesLike","object",r);const e=Array.prototype.slice.call(t(r));if(1===e.length&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const c=s(e.length);return c.unshift(183+c.length),c.concat(e)}function u(t){return r(h(t))}function a(r,t,o,s){const c=[];for(;o<t+1+s;){const h=l(r,o);c.push(h.result),(o+=h.consumed)>t+1+s&&n.throwError("child data too short",e.errors.BUFFER_OVERRUN,{})}return{consumed:1+s,result:c}}function l(t,o){if(0===t.length&&n.throwError("data too short",e.errors.BUFFER_OVERRUN,{}),t[o]>=248){const r=t[o]-247;o+1+r>t.length&&n.throwError("data short segment too short",e.errors.BUFFER_OVERRUN,{});const s=c(t,o+1,r);return o+1+r+s>t.length&&n.throwError("data long segment too short",e.errors.BUFFER_OVERRUN,{}),a(t,o,o+1+r,r+s)}if(t[o]>=192){const r=t[o]-192;return o+1+r>t.length&&n.throwError("data array too short",e.errors.BUFFER_OVERRUN,{}),a(t,o,o+1,r)}if(t[o]>=184){const s=t[o]-183;o+1+s>t.length&&n.throwError("data array too short",e.errors.BUFFER_OVERRUN,{});const h=c(t,o+1,s);o+1+s+h>t.length&&n.throwError("data array too short",e.errors.BUFFER_OVERRUN,{});return{consumed:1+s+h,result:r(t.slice(o+1+s,o+1+s+h))}}if(t[o]>=128){const s=t[o]-128;o+1+s>t.length&&n.throwError("data too short",e.errors.BUFFER_OVERRUN,{});return{consumed:1+s,result:r(t.slice(o+1,o+1+s))}}return{consumed:1,result:r(t[o])}}function i(r){const o=t(r),e=l(o,0);return e.consumed!==o.length&&n.throwArgumentError("invalid rlp data","data",r),e.result}var f=Object.freeze({__proto__:null,encode:u,decode:i});export{i as d,u as e,f as l};
1
+ import{hexlify as r,arrayify as t,isBytesLike as o}from"@ethersproject/bytes";import{L as e}from"./id-ffcb95de.js";const n=new e("rlp/5.7.0");function s(r){const t=[];for(;r;)t.unshift(255&r),r>>=8;return t}function c(r,t,o){let e=0;for(let n=0;n<o;n++)e=256*e+r[t+n];return e}function h(r){if(Array.isArray(r)){let t=[];if(r.forEach((function(r){t=t.concat(h(r))})),t.length<=55)return t.unshift(192+t.length),t;const o=s(t.length);return o.unshift(247+o.length),o.concat(t)}o(r)||n.throwArgumentError("RLP object must be BytesLike","object",r);const e=Array.prototype.slice.call(t(r));if(1===e.length&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const c=s(e.length);return c.unshift(183+c.length),c.concat(e)}function u(t){return r(h(t))}function a(r,t,o,s){const c=[];for(;o<t+1+s;){const h=l(r,o);c.push(h.result),(o+=h.consumed)>t+1+s&&n.throwError("child data too short",e.errors.BUFFER_OVERRUN,{})}return{consumed:1+s,result:c}}function l(t,o){if(0===t.length&&n.throwError("data too short",e.errors.BUFFER_OVERRUN,{}),t[o]>=248){const r=t[o]-247;o+1+r>t.length&&n.throwError("data short segment too short",e.errors.BUFFER_OVERRUN,{});const s=c(t,o+1,r);return o+1+r+s>t.length&&n.throwError("data long segment too short",e.errors.BUFFER_OVERRUN,{}),a(t,o,o+1+r,r+s)}if(t[o]>=192){const r=t[o]-192;return o+1+r>t.length&&n.throwError("data array too short",e.errors.BUFFER_OVERRUN,{}),a(t,o,o+1,r)}if(t[o]>=184){const s=t[o]-183;o+1+s>t.length&&n.throwError("data array too short",e.errors.BUFFER_OVERRUN,{});const h=c(t,o+1,s);o+1+s+h>t.length&&n.throwError("data array too short",e.errors.BUFFER_OVERRUN,{});return{consumed:1+s+h,result:r(t.slice(o+1+s,o+1+s+h))}}if(t[o]>=128){const s=t[o]-128;o+1+s>t.length&&n.throwError("data too short",e.errors.BUFFER_OVERRUN,{});return{consumed:1+s,result:r(t.slice(o+1,o+1+s))}}return{consumed:1,result:r(t[o])}}function i(r){const o=t(r),e=l(o,0);return e.consumed!==o.length&&n.throwArgumentError("invalid rlp data","data",r),e.result}var f=Object.freeze({__proto__:null,encode:u,decode:i});export{i as d,u as e,f as l};
@@ -0,0 +1 @@
1
+ import{g as a}from"./index-fcfb77a4.js";import{C as r,E as e,a as s,F as t,b as o,P as n,c,A as i,d as m,I as f,f as d,e as p,L as F,T as g}from"./interface-cb6da378.js";var b=a(Object.freeze({__proto__:null,ConstructorFragment:r,ErrorFragment:e,EventFragment:s,Fragment:t,FunctionFragment:o,ParamType:n,FormatTypes:c,AbiCoder:i,defaultAbiCoder:m,Interface:f,Indexed:d,checkResultErrors:p,LogDescription:F,TransactionDescription:g}));export{b as r};