@dodoex/wallet-web3 0.0.41-5 → 0.0.41
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.
- package/dist/{DefaultJsonRpcProvider-6a21f359.js → DefaultJsonRpcProvider-81dbd3f9.js} +1 -1
- package/dist/__node-resolve_empty-314df16e.js +1 -0
- package/dist/__tslib-895a7349.js +1 -0
- package/dist/{blocto-1e01ed61.js → blocto-a553b391.js} +1 -1
- package/dist/bn-8f7cc9b5.js +1 -0
- package/dist/{browser-ponyfill-dbcd3487.js → browser-ponyfill-4134b2b7.js} +1 -1
- package/dist/cjs/{DefaultJsonRpcProvider-2896bdc6.cjs → DefaultJsonRpcProvider-851de86a.cjs} +1 -1
- package/dist/cjs/{__node-resolve_empty-1e1ab047.cjs → __node-resolve_empty-04cc3662.cjs} +1 -1
- package/dist/cjs/__tslib-07f80053.cjs +1 -0
- package/dist/cjs/{blocto-66f8432e.cjs → blocto-1d2d3abc.cjs} +1 -1
- package/dist/cjs/bn-8a65a921.cjs +1 -0
- package/dist/cjs/{browser-ponyfill-5cbcbec7.cjs → browser-ponyfill-96a14706.cjs} +1 -1
- package/dist/cjs/{draggabilly-f0c0e597.cjs → draggabilly-326f0353.cjs} +1 -1
- package/dist/cjs/ethers-c6e7830c.cjs +1 -0
- package/dist/cjs/id-ac2184da.cjs +1 -0
- package/dist/cjs/{index-d36fba96.cjs → index-01b3872e.cjs} +1 -1
- package/dist/cjs/index-38a82c12.cjs +1 -0
- package/dist/cjs/index-4685dfbc.cjs +9 -0
- package/dist/cjs/index-4f46ab04.cjs +1 -0
- package/dist/cjs/{index-84bddb78.cjs → index-6130f88a.cjs} +2 -2
- package/dist/cjs/index-823d3a25.cjs +6 -0
- package/dist/cjs/index-8d32723e.cjs +15 -0
- package/dist/cjs/index-97c32dcf.cjs +1 -0
- package/dist/cjs/{index-7a5facb5.cjs → index-b3a93c7d.cjs} +1 -1
- package/dist/cjs/{index-0dd9ae9a.cjs → index-c6a78b5c.cjs} +1 -1
- package/dist/cjs/index-d89005f4.cjs +1 -0
- package/dist/cjs/{index-9f2a69d5.cjs → index-df8e5839.cjs} +1 -1
- package/dist/cjs/{index-35edc6a0.cjs → index-eb09e54d.cjs} +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/{index.es-d276a0c3.cjs → index.es-168fe2b1.cjs} +2 -2
- package/dist/cjs/{interface-27dc9126.cjs → interface-f6b53727.cjs} +1 -1
- package/dist/cjs/{lib-typedarrays-bf82ea24.cjs → lib-typedarrays-05755aa6.cjs} +1 -1
- package/dist/cjs/{portis-282159f7.cjs → portis-7873ce6a.cjs} +1 -1
- package/dist/cjs/{provider-e4b2bc55.cjs → provider-d7c647ea.cjs} +1 -1
- package/dist/cjs/{rainbow-77aec431.cjs → rainbow-43c8e5f6.cjs} +1 -1
- package/dist/cjs/sha224-86e8cc7f.cjs +1 -0
- package/dist/cjs/{sha256-8765e543.cjs → sha256-7cc68713.cjs} +1 -1
- package/dist/cjs/state.d.ts +0 -1
- package/dist/cjs/uAuth-6aa71b34.cjs +1 -0
- package/dist/cjs/{walletConnect-67671d50.cjs → walletConnect-b0df4f12.cjs} +1 -1
- package/dist/cjs/walletLink-eb56d177.cjs +3 -0
- package/dist/{draggabilly-542c5cae.js → draggabilly-291f869b.js} +1 -1
- package/dist/ethers-f8f094be.js +1 -0
- package/dist/id-dcb529f4.js +1 -0
- package/dist/{index-65d96278.js → index-0ee5ef8d.js} +1 -1
- package/dist/{index-3c3d04d7.js → index-20ce8a4c.js} +1 -1
- package/dist/{index-79f8a14f.js → index-4e6b81d8.js} +1 -1
- package/dist/index-7a7a090a.js +1 -0
- package/dist/{index-d5b21786.js → index-89a7e976.js} +1 -1
- package/dist/index-914dc773.js +15 -0
- package/dist/index-a1df7720.js +1 -0
- package/dist/index-bc061f7b.js +9 -0
- package/dist/index-cbfb042c.js +1 -0
- package/dist/{index-1bf00f8f.js → index-cebac794.js} +2 -2
- package/dist/index-cec5c507.js +6 -0
- package/dist/{index-f08d6a6b.js → index-e0d3617a.js} +1 -1
- package/dist/index-e3070128.js +1 -0
- package/dist/{index.es-c9a2db2c.js → index.es-b6986074.js} +2 -2
- package/dist/index.js +1 -1
- package/dist/{interface-936da3ce.js → interface-6c3ec32a.js} +1 -1
- package/dist/{lib-typedarrays-38faff47.js → lib-typedarrays-f1051e37.js} +1 -1
- package/dist/{portis-76a8e487.js → portis-6c321b6b.js} +1 -1
- package/dist/{provider-db6426ff.js → provider-0a241f15.js} +1 -1
- package/dist/rainbow-43a583fd.js +1 -0
- package/dist/{sha224-2ced289a.js → sha224-1e5a1736.js} +1 -1
- package/dist/{sha256-c1265a22.js → sha256-79cd8cb2.js} +1 -1
- package/dist/state.d.ts +0 -1
- package/dist/uAuth-57530103.js +1 -0
- package/dist/{walletConnect-0903c9e0.js → walletConnect-dc900305.js} +1 -1
- package/dist/walletLink-7f641f02.js +3 -0
- package/package.json +1 -1
- package/dist/__node-resolve_empty-cca64a4a.js +0 -1
- package/dist/__tslib-b24ce2ae.js +0 -1
- package/dist/bn-43db0a80.js +0 -1
- package/dist/cjs/__tslib-e13a96b6.cjs +0 -1
- package/dist/cjs/bn-6c93fb4c.cjs +0 -1
- package/dist/cjs/ethers-5799ca27.cjs +0 -1
- package/dist/cjs/id-48662e0b.cjs +0 -1
- package/dist/cjs/index-0984de48.cjs +0 -15
- package/dist/cjs/index-48d95e72.cjs +0 -1
- package/dist/cjs/index-529b9846.cjs +0 -1
- package/dist/cjs/index-6c6c6323.cjs +0 -1
- package/dist/cjs/index-9898e190.cjs +0 -6
- package/dist/cjs/index-9bc0d4c3.cjs +0 -1
- package/dist/cjs/index-fd18f5c9.cjs +0 -9
- package/dist/cjs/sha224-770ad141.cjs +0 -1
- package/dist/cjs/uAuth-66e7f842.cjs +0 -1
- package/dist/cjs/walletLink-75d77597.cjs +0 -3
- package/dist/ethers-fe9fa84f.js +0 -1
- package/dist/id-693d7c84.js +0 -1
- package/dist/index-1137a917.js +0 -1
- package/dist/index-1f918a4b.js +0 -1
- package/dist/index-3bb899bf.js +0 -1
- package/dist/index-51ac6957.js +0 -9
- package/dist/index-e1a91fd3.js +0 -6
- package/dist/index-f728f8ed.js +0 -15
- package/dist/index-ff04a168.js +0 -1
- package/dist/rainbow-9a1e9915.js +0 -1
- package/dist/uAuth-b6bee9b3.js +0 -1
- package/dist/walletLink-a9316447.js +0 -3
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as e}from"./index-51ac6957.js";var r=e(Object.freeze({__proto__:null,default:{}}));export{r};
|
package/dist/__tslib-b24ce2ae.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{g as a,f as r}from"./index-51ac6957.js";var s=a(r);export{s as r};
|
package/dist/bn-43db0a80.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as t}from"./index-51ac6957.js";import{r as i}from"./__node-resolve_empty-cca64a4a.js";var r={exports:{}};!function(t,r){function h(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 e(t,i,r){if(e.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=e:r.BN=e,e.BN=e,e.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:i.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 h(!1,"Invalid character in "+t)}function u(t,i,r){var h=s(t,r);return r-1>=i&&(h|=s(t,r-1)<<4),h}function l(t,i,r,n){for(var e=0,o=0,s=Math.min(t.length,r),u=i;u<s;u++){var l=t.charCodeAt(u)-48;e*=n,o=l>=49?l-49+10:l>=17?l-17+10:l,h(l>=0&&o<n,"Invalid character"),e+=o}return e}function a(t,i){t.words=i.words,t.length=i.length,t.negative=i.negative,t.red=i.red}if(e.isBN=function(t){return t instanceof e||null!==t&&"object"==typeof t&&t.constructor.wordSize===e.wordSize&&Array.isArray(t.words)},e.max=function(t,i){return t.cmp(i)>0?t:i},e.min=function(t,i){return t.cmp(i)<0?t:i},e.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),h(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)))},e.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):(h(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),i,r)},e.prototype._initArray=function(t,i,r){if(h("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 e,o,s=0;if("be"===r)for(n=t.length-1,e=0;n>=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[e]|=o<<s&67108863,this.words[e+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,e++);else if("le"===r)for(n=0,e=0;n<t.length;n+=3)o=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[e]|=o<<s&67108863,this.words[e+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,e++);return this._strip()},e.prototype._parseHex=function(t,i,r){this.length=Math.ceil((t.length-i)/6),this.words=new Array(this.length);for(var h=0;h<this.length;h++)this.words[h]=0;var n,e=0,o=0;if("be"===r)for(h=t.length-1;h>=i;h-=2)n=u(t,i,h)<<e,this.words[o]|=67108863&n,e>=18?(e-=18,o+=1,this.words[o]|=n>>>26):e+=8;else for(h=(t.length-i)%2==0?i+1:i;h<t.length;h+=2)n=u(t,i,h)<<e,this.words[o]|=67108863&n,e>=18?(e-=18,o+=1,this.words[o]|=n>>>26):e+=8;this._strip()},e.prototype._parseBase=function(t,i,r){this.words=[0],this.length=1;for(var h=0,n=1;n<=67108863;n*=i)h++;h--,n=n/i|0;for(var e=t.length-r,o=e%h,s=Math.min(e,e-o)+r,u=0,a=r;a<s;a+=h)u=l(t,a,a+h,i),this.imuln(n),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==o){var m=1;for(u=l(t,a,t.length,i),a=0;a<o;a++)m*=i;this.imuln(m),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},e.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},e.prototype._move=function(t){a(t,this)},e.prototype.clone=function(){var t=new e(null);return this.copy(t),t},e.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},e.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},e.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{e.prototype[Symbol.for("nodejs.util.inspect.custom")]=m}catch(t){e.prototype.inspect=m}else e.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 M(t,i,r){r.negative=i.negative^t.negative;var h=t.length+i.length|0;r.length=h,h=h-1|0;var n=0|t.words[0],e=0|i.words[0],o=n*e,s=67108863&o,u=o/67108864|0;r.words[0]=s;for(var l=1;l<h;l++){for(var a=u>>>26,m=67108863&u,f=Math.min(l,i.length-1),d=Math.max(0,l-t.length+1);d<=f;d++){var p=l-d|0;a+=(o=(n=0|t.words[p])*(e=0|i.words[d])+m)/67108864|0,m=67108863&o}r.words[l]=0|m,u=0|a}return 0!==u?r.words[l]=0|u:r.length--,r._strip()}e.prototype.toString=function(t,i){var r;if(i=0|i||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,e=0,o=0;o<this.length;o++){var s=this.words[o],u=(16777215&(s<<n|e)).toString(16);e=s>>>24-n&16777215,(n+=2)>=26&&(n-=26,o--),r=0!==e||o!==this.length-1?f[6-u.length]+u+r:u+r}for(0!==e&&(r=e.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 l=d[t],a=p[t];r="";var m=this.clone();for(m.negative=0;!m.isZero();){var M=m.modrn(a).toString(t);r=(m=m.idivn(a)).isZero()?M+r:f[l-M.length]+M+r}for(this.isZero()&&(r="0"+r);r.length%i!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}h(!1,"Base should be between 2 and 36")},e.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&&h(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},e.prototype.toJSON=function(){return this.toString(16,2)},o&&(e.prototype.toBuffer=function(t,i){return this.toArrayLike(o,t,i)}),e.prototype.toArray=function(t,i){return this.toArrayLike(Array,t,i)},e.prototype.toArrayLike=function(t,i,r){this._strip();var n=this.byteLength(),e=r||Math.max(1,n);h(n<=e,"byte array longer than desired length"),h(e>0,"Requested array length <= 0");var o=function(t,i){return t.allocUnsafe?t.allocUnsafe(i):new t(i)}(t,e);return this["_toArrayLike"+("le"===i?"LE":"BE")](o,n),o},e.prototype._toArrayLikeLE=function(t,i){for(var r=0,h=0,n=0,e=0;n<this.length;n++){var o=this.words[n]<<e|h;t[r++]=255&o,r<t.length&&(t[r++]=o>>8&255),r<t.length&&(t[r++]=o>>16&255),6===e?(r<t.length&&(t[r++]=o>>24&255),h=0,e=0):(h=o>>>24,e+=2)}if(r<t.length)for(t[r++]=h;r<t.length;)t[r++]=0},e.prototype._toArrayLikeBE=function(t,i){for(var r=t.length-1,h=0,n=0,e=0;n<this.length;n++){var o=this.words[n]<<e|h;t[r--]=255&o,r>=0&&(t[r--]=o>>8&255),r>=0&&(t[r--]=o>>16&255),6===e?(r>=0&&(t[r--]=o>>24&255),h=0,e=0):(h=o>>>24,e+=2)}if(r>=0)for(t[r--]=h;r>=0;)t[r--]=0},Math.clz32?e.prototype._countBits=function(t){return 32-Math.clz32(t)}:e.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},e.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},e.prototype.bitLength=function(){var t=this.words[this.length-1],i=this._countBits(t);return 26*(this.length-1)+i},e.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},e.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},e.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},e.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},e.prototype.isNeg=function(){return 0!==this.negative},e.prototype.neg=function(){return this.clone().ineg()},e.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},e.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()},e.prototype.ior=function(t){return h(0==(this.negative|t.negative)),this.iuor(t)},e.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},e.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},e.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()},e.prototype.iand=function(t){return h(0==(this.negative|t.negative)),this.iuand(t)},e.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},e.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},e.prototype.iuxor=function(t){var i,r;this.length>t.length?(i=this,r=t):(i=t,r=this);for(var h=0;h<r.length;h++)this.words[h]=i.words[h]^r.words[h];if(this!==i)for(;h<i.length;h++)this.words[h]=i.words[h];return this.length=i.length,this._strip()},e.prototype.ixor=function(t){return h(0==(this.negative|t.negative)),this.iuxor(t)},e.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},e.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},e.prototype.inotn=function(t){h("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()},e.prototype.notn=function(t){return this.clone().inotn(t)},e.prototype.setn=function(t,i){h("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()},e.prototype.iadd=function(t){var i,r,h;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,h=t):(r=t,h=this);for(var n=0,e=0;e<h.length;e++)i=(0|r.words[e])+(0|h.words[e])+n,this.words[e]=67108863&i,n=i>>>26;for(;0!==n&&e<r.length;e++)i=(0|r.words[e])+n,this.words[e]=67108863&i,n=i>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;e<r.length;e++)this.words[e]=r.words[e];return this},e.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)},e.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,h,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,h=t):(r=t,h=this);for(var e=0,o=0;o<h.length;o++)e=(i=(0|r.words[o])-(0|h.words[o])+e)>>26,this.words[o]=67108863&i;for(;0!==e&&o<r.length;o++)e=(i=(0|r.words[o])+e)>>26,this.words[o]=67108863&i;if(0===e&&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()},e.prototype.sub=function(t){return this.clone().isub(t)};var v=function(t,i,r){var h,n,e,o=t.words,s=i.words,u=r.words,l=0,a=0|o[0],m=8191&a,f=a>>>13,d=0|o[1],p=8191&d,M=d>>>13,v=0|o[2],g=8191&v,c=v>>>13,w=0|o[3],y=8191&w,b=w>>>13,_=0|o[4],k=8191&_,A=_>>>13,S=0|o[5],x=8191&S,q=S>>>13,Z=0|o[6],B=8191&Z,R=Z>>>13,L=0|o[7],N=8191&L,E=L>>>13,I=0|o[8],z=8191&I,O=I>>>13,T=0|o[9],j=8191&T,K=T>>>13,F=0|s[0],U=8191&F,C=F>>>13,D=0|s[1],H=8191&D,P=D>>>13,J=0|s[2],G=8191&J,Q=J>>>13,V=0|s[3],W=8191&V,X=V>>>13,Y=0|s[4],$=8191&Y,tt=Y>>>13,it=0|s[5],rt=8191&it,ht=it>>>13,nt=0|s[6],et=8191&nt,ot=nt>>>13,st=0|s[7],ut=8191&st,lt=st>>>13,at=0|s[8],mt=8191&at,ft=at>>>13,dt=0|s[9],pt=8191&dt,Mt=dt>>>13;r.negative=t.negative^i.negative,r.length=19;var vt=(l+(h=Math.imul(m,U))|0)+((8191&(n=(n=Math.imul(m,C))+Math.imul(f,U)|0))<<13)|0;l=((e=Math.imul(f,C))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,h=Math.imul(p,U),n=(n=Math.imul(p,C))+Math.imul(M,U)|0,e=Math.imul(M,C);var gt=(l+(h=h+Math.imul(m,H)|0)|0)+((8191&(n=(n=n+Math.imul(m,P)|0)+Math.imul(f,H)|0))<<13)|0;l=((e=e+Math.imul(f,P)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,h=Math.imul(g,U),n=(n=Math.imul(g,C))+Math.imul(c,U)|0,e=Math.imul(c,C),h=h+Math.imul(p,H)|0,n=(n=n+Math.imul(p,P)|0)+Math.imul(M,H)|0,e=e+Math.imul(M,P)|0;var ct=(l+(h=h+Math.imul(m,G)|0)|0)+((8191&(n=(n=n+Math.imul(m,Q)|0)+Math.imul(f,G)|0))<<13)|0;l=((e=e+Math.imul(f,Q)|0)+(n>>>13)|0)+(ct>>>26)|0,ct&=67108863,h=Math.imul(y,U),n=(n=Math.imul(y,C))+Math.imul(b,U)|0,e=Math.imul(b,C),h=h+Math.imul(g,H)|0,n=(n=n+Math.imul(g,P)|0)+Math.imul(c,H)|0,e=e+Math.imul(c,P)|0,h=h+Math.imul(p,G)|0,n=(n=n+Math.imul(p,Q)|0)+Math.imul(M,G)|0,e=e+Math.imul(M,Q)|0;var wt=(l+(h=h+Math.imul(m,W)|0)|0)+((8191&(n=(n=n+Math.imul(m,X)|0)+Math.imul(f,W)|0))<<13)|0;l=((e=e+Math.imul(f,X)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,h=Math.imul(k,U),n=(n=Math.imul(k,C))+Math.imul(A,U)|0,e=Math.imul(A,C),h=h+Math.imul(y,H)|0,n=(n=n+Math.imul(y,P)|0)+Math.imul(b,H)|0,e=e+Math.imul(b,P)|0,h=h+Math.imul(g,G)|0,n=(n=n+Math.imul(g,Q)|0)+Math.imul(c,G)|0,e=e+Math.imul(c,Q)|0,h=h+Math.imul(p,W)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(M,W)|0,e=e+Math.imul(M,X)|0;var yt=(l+(h=h+Math.imul(m,$)|0)|0)+((8191&(n=(n=n+Math.imul(m,tt)|0)+Math.imul(f,$)|0))<<13)|0;l=((e=e+Math.imul(f,tt)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,h=Math.imul(x,U),n=(n=Math.imul(x,C))+Math.imul(q,U)|0,e=Math.imul(q,C),h=h+Math.imul(k,H)|0,n=(n=n+Math.imul(k,P)|0)+Math.imul(A,H)|0,e=e+Math.imul(A,P)|0,h=h+Math.imul(y,G)|0,n=(n=n+Math.imul(y,Q)|0)+Math.imul(b,G)|0,e=e+Math.imul(b,Q)|0,h=h+Math.imul(g,W)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(c,W)|0,e=e+Math.imul(c,X)|0,h=h+Math.imul(p,$)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(M,$)|0,e=e+Math.imul(M,tt)|0;var bt=(l+(h=h+Math.imul(m,rt)|0)|0)+((8191&(n=(n=n+Math.imul(m,ht)|0)+Math.imul(f,rt)|0))<<13)|0;l=((e=e+Math.imul(f,ht)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,h=Math.imul(B,U),n=(n=Math.imul(B,C))+Math.imul(R,U)|0,e=Math.imul(R,C),h=h+Math.imul(x,H)|0,n=(n=n+Math.imul(x,P)|0)+Math.imul(q,H)|0,e=e+Math.imul(q,P)|0,h=h+Math.imul(k,G)|0,n=(n=n+Math.imul(k,Q)|0)+Math.imul(A,G)|0,e=e+Math.imul(A,Q)|0,h=h+Math.imul(y,W)|0,n=(n=n+Math.imul(y,X)|0)+Math.imul(b,W)|0,e=e+Math.imul(b,X)|0,h=h+Math.imul(g,$)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(c,$)|0,e=e+Math.imul(c,tt)|0,h=h+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(M,rt)|0,e=e+Math.imul(M,ht)|0;var _t=(l+(h=h+Math.imul(m,et)|0)|0)+((8191&(n=(n=n+Math.imul(m,ot)|0)+Math.imul(f,et)|0))<<13)|0;l=((e=e+Math.imul(f,ot)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,h=Math.imul(N,U),n=(n=Math.imul(N,C))+Math.imul(E,U)|0,e=Math.imul(E,C),h=h+Math.imul(B,H)|0,n=(n=n+Math.imul(B,P)|0)+Math.imul(R,H)|0,e=e+Math.imul(R,P)|0,h=h+Math.imul(x,G)|0,n=(n=n+Math.imul(x,Q)|0)+Math.imul(q,G)|0,e=e+Math.imul(q,Q)|0,h=h+Math.imul(k,W)|0,n=(n=n+Math.imul(k,X)|0)+Math.imul(A,W)|0,e=e+Math.imul(A,X)|0,h=h+Math.imul(y,$)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(b,$)|0,e=e+Math.imul(b,tt)|0,h=h+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,ht)|0)+Math.imul(c,rt)|0,e=e+Math.imul(c,ht)|0,h=h+Math.imul(p,et)|0,n=(n=n+Math.imul(p,ot)|0)+Math.imul(M,et)|0,e=e+Math.imul(M,ot)|0;var kt=(l+(h=h+Math.imul(m,ut)|0)|0)+((8191&(n=(n=n+Math.imul(m,lt)|0)+Math.imul(f,ut)|0))<<13)|0;l=((e=e+Math.imul(f,lt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,h=Math.imul(z,U),n=(n=Math.imul(z,C))+Math.imul(O,U)|0,e=Math.imul(O,C),h=h+Math.imul(N,H)|0,n=(n=n+Math.imul(N,P)|0)+Math.imul(E,H)|0,e=e+Math.imul(E,P)|0,h=h+Math.imul(B,G)|0,n=(n=n+Math.imul(B,Q)|0)+Math.imul(R,G)|0,e=e+Math.imul(R,Q)|0,h=h+Math.imul(x,W)|0,n=(n=n+Math.imul(x,X)|0)+Math.imul(q,W)|0,e=e+Math.imul(q,X)|0,h=h+Math.imul(k,$)|0,n=(n=n+Math.imul(k,tt)|0)+Math.imul(A,$)|0,e=e+Math.imul(A,tt)|0,h=h+Math.imul(y,rt)|0,n=(n=n+Math.imul(y,ht)|0)+Math.imul(b,rt)|0,e=e+Math.imul(b,ht)|0,h=h+Math.imul(g,et)|0,n=(n=n+Math.imul(g,ot)|0)+Math.imul(c,et)|0,e=e+Math.imul(c,ot)|0,h=h+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,lt)|0)+Math.imul(M,ut)|0,e=e+Math.imul(M,lt)|0;var At=(l+(h=h+Math.imul(m,mt)|0)|0)+((8191&(n=(n=n+Math.imul(m,ft)|0)+Math.imul(f,mt)|0))<<13)|0;l=((e=e+Math.imul(f,ft)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,h=Math.imul(j,U),n=(n=Math.imul(j,C))+Math.imul(K,U)|0,e=Math.imul(K,C),h=h+Math.imul(z,H)|0,n=(n=n+Math.imul(z,P)|0)+Math.imul(O,H)|0,e=e+Math.imul(O,P)|0,h=h+Math.imul(N,G)|0,n=(n=n+Math.imul(N,Q)|0)+Math.imul(E,G)|0,e=e+Math.imul(E,Q)|0,h=h+Math.imul(B,W)|0,n=(n=n+Math.imul(B,X)|0)+Math.imul(R,W)|0,e=e+Math.imul(R,X)|0,h=h+Math.imul(x,$)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(q,$)|0,e=e+Math.imul(q,tt)|0,h=h+Math.imul(k,rt)|0,n=(n=n+Math.imul(k,ht)|0)+Math.imul(A,rt)|0,e=e+Math.imul(A,ht)|0,h=h+Math.imul(y,et)|0,n=(n=n+Math.imul(y,ot)|0)+Math.imul(b,et)|0,e=e+Math.imul(b,ot)|0,h=h+Math.imul(g,ut)|0,n=(n=n+Math.imul(g,lt)|0)+Math.imul(c,ut)|0,e=e+Math.imul(c,lt)|0,h=h+Math.imul(p,mt)|0,n=(n=n+Math.imul(p,ft)|0)+Math.imul(M,mt)|0,e=e+Math.imul(M,ft)|0;var St=(l+(h=h+Math.imul(m,pt)|0)|0)+((8191&(n=(n=n+Math.imul(m,Mt)|0)+Math.imul(f,pt)|0))<<13)|0;l=((e=e+Math.imul(f,Mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,h=Math.imul(j,H),n=(n=Math.imul(j,P))+Math.imul(K,H)|0,e=Math.imul(K,P),h=h+Math.imul(z,G)|0,n=(n=n+Math.imul(z,Q)|0)+Math.imul(O,G)|0,e=e+Math.imul(O,Q)|0,h=h+Math.imul(N,W)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(E,W)|0,e=e+Math.imul(E,X)|0,h=h+Math.imul(B,$)|0,n=(n=n+Math.imul(B,tt)|0)+Math.imul(R,$)|0,e=e+Math.imul(R,tt)|0,h=h+Math.imul(x,rt)|0,n=(n=n+Math.imul(x,ht)|0)+Math.imul(q,rt)|0,e=e+Math.imul(q,ht)|0,h=h+Math.imul(k,et)|0,n=(n=n+Math.imul(k,ot)|0)+Math.imul(A,et)|0,e=e+Math.imul(A,ot)|0,h=h+Math.imul(y,ut)|0,n=(n=n+Math.imul(y,lt)|0)+Math.imul(b,ut)|0,e=e+Math.imul(b,lt)|0,h=h+Math.imul(g,mt)|0,n=(n=n+Math.imul(g,ft)|0)+Math.imul(c,mt)|0,e=e+Math.imul(c,ft)|0;var xt=(l+(h=h+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,Mt)|0)+Math.imul(M,pt)|0))<<13)|0;l=((e=e+Math.imul(M,Mt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,h=Math.imul(j,G),n=(n=Math.imul(j,Q))+Math.imul(K,G)|0,e=Math.imul(K,Q),h=h+Math.imul(z,W)|0,n=(n=n+Math.imul(z,X)|0)+Math.imul(O,W)|0,e=e+Math.imul(O,X)|0,h=h+Math.imul(N,$)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(E,$)|0,e=e+Math.imul(E,tt)|0,h=h+Math.imul(B,rt)|0,n=(n=n+Math.imul(B,ht)|0)+Math.imul(R,rt)|0,e=e+Math.imul(R,ht)|0,h=h+Math.imul(x,et)|0,n=(n=n+Math.imul(x,ot)|0)+Math.imul(q,et)|0,e=e+Math.imul(q,ot)|0,h=h+Math.imul(k,ut)|0,n=(n=n+Math.imul(k,lt)|0)+Math.imul(A,ut)|0,e=e+Math.imul(A,lt)|0,h=h+Math.imul(y,mt)|0,n=(n=n+Math.imul(y,ft)|0)+Math.imul(b,mt)|0,e=e+Math.imul(b,ft)|0;var qt=(l+(h=h+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,Mt)|0)+Math.imul(c,pt)|0))<<13)|0;l=((e=e+Math.imul(c,Mt)|0)+(n>>>13)|0)+(qt>>>26)|0,qt&=67108863,h=Math.imul(j,W),n=(n=Math.imul(j,X))+Math.imul(K,W)|0,e=Math.imul(K,X),h=h+Math.imul(z,$)|0,n=(n=n+Math.imul(z,tt)|0)+Math.imul(O,$)|0,e=e+Math.imul(O,tt)|0,h=h+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,ht)|0)+Math.imul(E,rt)|0,e=e+Math.imul(E,ht)|0,h=h+Math.imul(B,et)|0,n=(n=n+Math.imul(B,ot)|0)+Math.imul(R,et)|0,e=e+Math.imul(R,ot)|0,h=h+Math.imul(x,ut)|0,n=(n=n+Math.imul(x,lt)|0)+Math.imul(q,ut)|0,e=e+Math.imul(q,lt)|0,h=h+Math.imul(k,mt)|0,n=(n=n+Math.imul(k,ft)|0)+Math.imul(A,mt)|0,e=e+Math.imul(A,ft)|0;var Zt=(l+(h=h+Math.imul(y,pt)|0)|0)+((8191&(n=(n=n+Math.imul(y,Mt)|0)+Math.imul(b,pt)|0))<<13)|0;l=((e=e+Math.imul(b,Mt)|0)+(n>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,h=Math.imul(j,$),n=(n=Math.imul(j,tt))+Math.imul(K,$)|0,e=Math.imul(K,tt),h=h+Math.imul(z,rt)|0,n=(n=n+Math.imul(z,ht)|0)+Math.imul(O,rt)|0,e=e+Math.imul(O,ht)|0,h=h+Math.imul(N,et)|0,n=(n=n+Math.imul(N,ot)|0)+Math.imul(E,et)|0,e=e+Math.imul(E,ot)|0,h=h+Math.imul(B,ut)|0,n=(n=n+Math.imul(B,lt)|0)+Math.imul(R,ut)|0,e=e+Math.imul(R,lt)|0,h=h+Math.imul(x,mt)|0,n=(n=n+Math.imul(x,ft)|0)+Math.imul(q,mt)|0,e=e+Math.imul(q,ft)|0;var Bt=(l+(h=h+Math.imul(k,pt)|0)|0)+((8191&(n=(n=n+Math.imul(k,Mt)|0)+Math.imul(A,pt)|0))<<13)|0;l=((e=e+Math.imul(A,Mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,h=Math.imul(j,rt),n=(n=Math.imul(j,ht))+Math.imul(K,rt)|0,e=Math.imul(K,ht),h=h+Math.imul(z,et)|0,n=(n=n+Math.imul(z,ot)|0)+Math.imul(O,et)|0,e=e+Math.imul(O,ot)|0,h=h+Math.imul(N,ut)|0,n=(n=n+Math.imul(N,lt)|0)+Math.imul(E,ut)|0,e=e+Math.imul(E,lt)|0,h=h+Math.imul(B,mt)|0,n=(n=n+Math.imul(B,ft)|0)+Math.imul(R,mt)|0,e=e+Math.imul(R,ft)|0;var Rt=(l+(h=h+Math.imul(x,pt)|0)|0)+((8191&(n=(n=n+Math.imul(x,Mt)|0)+Math.imul(q,pt)|0))<<13)|0;l=((e=e+Math.imul(q,Mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,h=Math.imul(j,et),n=(n=Math.imul(j,ot))+Math.imul(K,et)|0,e=Math.imul(K,ot),h=h+Math.imul(z,ut)|0,n=(n=n+Math.imul(z,lt)|0)+Math.imul(O,ut)|0,e=e+Math.imul(O,lt)|0,h=h+Math.imul(N,mt)|0,n=(n=n+Math.imul(N,ft)|0)+Math.imul(E,mt)|0,e=e+Math.imul(E,ft)|0;var Lt=(l+(h=h+Math.imul(B,pt)|0)|0)+((8191&(n=(n=n+Math.imul(B,Mt)|0)+Math.imul(R,pt)|0))<<13)|0;l=((e=e+Math.imul(R,Mt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,h=Math.imul(j,ut),n=(n=Math.imul(j,lt))+Math.imul(K,ut)|0,e=Math.imul(K,lt),h=h+Math.imul(z,mt)|0,n=(n=n+Math.imul(z,ft)|0)+Math.imul(O,mt)|0,e=e+Math.imul(O,ft)|0;var Nt=(l+(h=h+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,Mt)|0)+Math.imul(E,pt)|0))<<13)|0;l=((e=e+Math.imul(E,Mt)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,h=Math.imul(j,mt),n=(n=Math.imul(j,ft))+Math.imul(K,mt)|0,e=Math.imul(K,ft);var Et=(l+(h=h+Math.imul(z,pt)|0)|0)+((8191&(n=(n=n+Math.imul(z,Mt)|0)+Math.imul(O,pt)|0))<<13)|0;l=((e=e+Math.imul(O,Mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863;var It=(l+(h=Math.imul(j,pt))|0)+((8191&(n=(n=Math.imul(j,Mt))+Math.imul(K,pt)|0))<<13)|0;return l=((e=Math.imul(K,Mt))+(n>>>13)|0)+(It>>>26)|0,It&=67108863,u[0]=vt,u[1]=gt,u[2]=ct,u[3]=wt,u[4]=yt,u[5]=bt,u[6]=_t,u[7]=kt,u[8]=At,u[9]=St,u[10]=xt,u[11]=qt,u[12]=Zt,u[13]=Bt,u[14]=Rt,u[15]=Lt,u[16]=Nt,u[17]=Et,u[18]=It,0!==l&&(u[19]=l,r.length++),r};function g(t,i,r){r.negative=i.negative^t.negative,r.length=t.length+i.length;for(var h=0,n=0,e=0;e<r.length-1;e++){var o=n;n=0;for(var s=67108863&h,u=Math.min(e,i.length-1),l=Math.max(0,e-t.length+1);l<=u;l++){var a=e-l,m=(0|t.words[a])*(0|i.words[l]),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[e]=s,h=o,o=n}return 0!==h?r.words[e]=h:r.length--,r._strip()}function c(t,i,r){return g(t,i,r)}Math.imul||(v=M),e.prototype.mulTo=function(t,i){var r=this.length+t.length;return 10===this.length&&10===t.length?v(this,t,i):r<63?M(this,t,i):r<1024?g(this,t,i):c(this,t,i)},e.prototype.mul=function(t){var i=new e(null);return i.words=new Array(this.length+t.length),this.mulTo(t,i)},e.prototype.mulf=function(t){var i=new e(null);return i.words=new Array(this.length+t.length),c(this,t,i)},e.prototype.imul=function(t){return this.clone().mulTo(t,this)},e.prototype.imuln=function(t){var i=t<0;i&&(t=-t),h("number"==typeof t),h(t<67108864);for(var r=0,n=0;n<this.length;n++){var e=(0|this.words[n])*t,o=(67108863&e)+(67108863&r);r>>=26,r+=e/67108864|0,r+=o>>>26,this.words[n]=67108863&o}return 0!==r&&(this.words[n]=r,this.length++),i?this.ineg():this},e.prototype.muln=function(t){return this.clone().imuln(t)},e.prototype.sqr=function(){return this.mul(this)},e.prototype.isqr=function(){return this.imul(this.clone())},e.prototype.pow=function(t){var i=function(t){for(var i=new Array(t.bitLength()),r=0;r<i.length;r++){var h=r/26|0,n=r%26;i[r]=t.words[h]>>>n&1}return i}(t);if(0===i.length)return new e(1);for(var r=this,h=0;h<i.length&&0===i[h];h++,r=r.sqr());if(++h<i.length)for(var n=r.sqr();h<i.length;h++,n=n.sqr())0!==i[h]&&(r=r.mul(n));return r},e.prototype.iushln=function(t){h("number"==typeof t&&t>=0);var i,r=t%26,n=(t-r)/26,e=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(i=0;i<this.length;i++){var s=this.words[i]&e,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()},e.prototype.ishln=function(t){return h(0===this.negative),this.iushln(t)},e.prototype.iushrn=function(t,i,r){var n;h("number"==typeof t&&t>=0),n=i?(i-i%26)/26:0;var e=t%26,o=Math.min((t-e)/26,this.length),s=67108863^67108863>>>e<<e,u=r;if(n-=o,n=Math.max(0,n),u){for(var l=0;l<o;l++)u.words[l]=this.words[l];u.length=o}if(0===o);else if(this.length>o)for(this.length-=o,l=0;l<this.length;l++)this.words[l]=this.words[l+o];else this.words[0]=0,this.length=1;var a=0;for(l=this.length-1;l>=0&&(0!==a||l>=n);l--){var m=0|this.words[l];this.words[l]=a<<26-e|m>>>e,a=m&s}return u&&0!==a&&(u.words[u.length++]=a),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},e.prototype.ishrn=function(t,i,r){return h(0===this.negative),this.iushrn(t,i,r)},e.prototype.shln=function(t){return this.clone().ishln(t)},e.prototype.ushln=function(t){return this.clone().iushln(t)},e.prototype.shrn=function(t){return this.clone().ishrn(t)},e.prototype.ushrn=function(t){return this.clone().iushrn(t)},e.prototype.testn=function(t){h("number"==typeof t&&t>=0);var i=t%26,r=(t-i)/26,n=1<<i;return!(this.length<=r||!(this.words[r]&n))},e.prototype.imaskn=function(t){h("number"==typeof t&&t>=0);var i=t%26,r=(t-i)/26;if(h(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()},e.prototype.maskn=function(t){return this.clone().imaskn(t)},e.prototype.iaddn=function(t){return h("number"==typeof t),h(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)},e.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},e.prototype.isubn=function(t){if(h("number"==typeof t),h(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()},e.prototype.addn=function(t){return this.clone().iaddn(t)},e.prototype.subn=function(t){return this.clone().isubn(t)},e.prototype.iabs=function(){return this.negative=0,this},e.prototype.abs=function(){return this.clone().iabs()},e.prototype._ishlnsubmul=function(t,i,r){var n,e,o=t.length+r;this._expand(o);var s=0;for(n=0;n<t.length;n++){e=(0|this.words[n+r])+s;var u=(0|t.words[n])*i;s=((e-=67108863&u)>>26)-(u/67108864|0),this.words[n+r]=67108863&e}for(;n<this.length-r;n++)s=(e=(0|this.words[n+r])+s)>>26,this.words[n+r]=67108863&e;if(0===s)return this._strip();for(h(-1===s),s=0,n=0;n<this.length;n++)s=(e=-(0|this.words[n])+s)>>26,this.words[n]=67108863&e;return this.negative=1,this._strip()},e.prototype._wordDiv=function(t,i){var r=(this.length,t.length),h=this.clone(),n=t,o=0|n.words[n.length-1];0!=(r=26-this._countBits(o))&&(n=n.ushln(r),h.iushln(r),o=0|n.words[n.length-1]);var s,u=h.length-n.length;if("mod"!==i){(s=new e(null)).length=u+1,s.words=new Array(s.length);for(var l=0;l<s.length;l++)s.words[l]=0}var a=h.clone()._ishlnsubmul(n,1,u);0===a.negative&&(h=a,s&&(s.words[u]=1));for(var m=u-1;m>=0;m--){var f=67108864*(0|h.words[n.length+m])+(0|h.words[n.length+m-1]);for(f=Math.min(f/o|0,67108863),h._ishlnsubmul(n,f,m);0!==h.negative;)f--,h.negative=0,h._ishlnsubmul(n,1,m),h.isZero()||(h.negative^=1);s&&(s.words[m]=f)}return s&&s._strip(),h._strip(),"div"!==i&&0!==r&&h.iushrn(r),{div:s||null,mod:h}},e.prototype.divmod=function(t,i,r){return h(!t.isZero()),this.isZero()?{div:new e(0),mod:new e(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 e(0),mod:this}:1===t.length?"div"===i?{div:this.divn(t.words[0]),mod:null}:"mod"===i?{div:null,mod:new e(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new e(this.modrn(t.words[0]))}:this._wordDiv(t,i);var n,o,s},e.prototype.div=function(t){return this.divmod(t,"div",!1).div},e.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},e.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},e.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,h=t.ushrn(1),n=t.andln(1),e=r.cmp(h);return e<0||1===n&&0===e?i.div:0!==i.div.negative?i.div.isubn(1):i.div.iaddn(1)},e.prototype.modrn=function(t){var i=t<0;i&&(t=-t),h(t<=67108863);for(var r=(1<<26)%t,n=0,e=this.length-1;e>=0;e--)n=(r*n+(0|this.words[e]))%t;return i?-n:n},e.prototype.modn=function(t){return this.modrn(t)},e.prototype.idivn=function(t){var i=t<0;i&&(t=-t),h(t<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var e=(0|this.words[n])+67108864*r;this.words[n]=e/t|0,r=e%t}return this._strip(),i?this.ineg():this},e.prototype.divn=function(t){return this.clone().idivn(t)},e.prototype.egcd=function(t){h(0===t.negative),h(!t.isZero());var i=this,r=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var n=new e(1),o=new e(0),s=new e(0),u=new e(1),l=0;i.isEven()&&r.isEven();)i.iushrn(1),r.iushrn(1),++l;for(var a=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(a),o.isub(m)),n.iushrn(1),o.iushrn(1);for(var p=0,M=1;0==(r.words[0]&M)&&p<26;++p,M<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(a),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(l)}},e.prototype._invmp=function(t){h(0===t.negative),h(!t.isZero());var i=this,r=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var n,o=new e(1),s=new e(0),u=r.clone();i.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,a=1;0==(i.words[0]&a)&&l<26;++l,a<<=1);if(l>0)for(i.iushrn(l);l-- >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},e.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 h=0;i.isEven()&&r.isEven();h++)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 e=i;i=r,r=e}else if(0===n||0===r.cmpn(1))break;i.isub(r)}return r.iushln(h)},e.prototype.invm=function(t){return this.egcd(t).a.umod(t)},e.prototype.isEven=function(){return 0==(1&this.words[0])},e.prototype.isOdd=function(){return 1==(1&this.words[0])},e.prototype.andln=function(t){return this.words[0]&t},e.prototype.bincn=function(t){h("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 e=n,o=r;0!==e&&o<this.length;o++){var s=0|this.words[o];e=(s+=e)>>>26,s&=67108863,this.words[o]=s}return 0!==e&&(this.words[o]=e,this.length++),this},e.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},e.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),h(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},e.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},e.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 h=0|this.words[r],n=0|t.words[r];if(h!==n){h<n?i=-1:h>n&&(i=1);break}}return i},e.prototype.gtn=function(t){return 1===this.cmpn(t)},e.prototype.gt=function(t){return 1===this.cmp(t)},e.prototype.gten=function(t){return this.cmpn(t)>=0},e.prototype.gte=function(t){return this.cmp(t)>=0},e.prototype.ltn=function(t){return-1===this.cmpn(t)},e.prototype.lt=function(t){return-1===this.cmp(t)},e.prototype.lten=function(t){return this.cmpn(t)<=0},e.prototype.lte=function(t){return this.cmp(t)<=0},e.prototype.eqn=function(t){return 0===this.cmpn(t)},e.prototype.eq=function(t){return 0===this.cmp(t)},e.red=function(t){return new S(t)},e.prototype.toRed=function(t){return h(!this.red,"Already a number in reduction context"),h(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},e.prototype.fromRed=function(){return h(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},e.prototype._forceRed=function(t){return this.red=t,this},e.prototype.forceRed=function(t){return h(!this.red,"Already a number in reduction context"),this._forceRed(t)},e.prototype.redAdd=function(t){return h(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},e.prototype.redIAdd=function(t){return h(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},e.prototype.redSub=function(t){return h(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},e.prototype.redISub=function(t){return h(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},e.prototype.redShl=function(t){return h(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},e.prototype.redMul=function(t){return h(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},e.prototype.redIMul=function(t){return h(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},e.prototype.redSqr=function(){return h(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},e.prototype.redISqr=function(){return h(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},e.prototype.redSqrt=function(){return h(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},e.prototype.redInvm=function(){return h(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},e.prototype.redNeg=function(){return h(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},e.prototype.redPow=function(t){return h(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 e(i,16),this.n=this.p.bitLength(),this.k=new e(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 _(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function k(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(t){if("string"==typeof t){var i=e._prime(t);this.m=i.p,this.prime=i}else h(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function x(t){S.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new e(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 e(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 h=i<this.n?-1:r.ucmp(this.p);return 0===h?(r.words[0]=0,r.length=1):h>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,h=Math.min(t.length,9),n=0;n<h;n++)i.words[n]=t.words[n];if(i.length=h,t.length<=9)return t.words[0]=0,void(t.length=1);var e=t.words[9];for(i.words[i.length++]=e&r,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(o&r)<<4|e>>>22,e=o}e>>>=22,t.words[n-10]=e,0===e&&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 h=0|t.words[r];i+=977*h,t.words[r]=67108863&i,i=64*h+(i/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(_,y),n(k,y),n(A,y),A.prototype.imulK=function(t){for(var i=0,r=0;r<t.length;r++){var h=19*(0|t.words[r])+i,n=67108863&h;h>>>=26,t.words[r]=n,i=h}return 0!==i&&(t.words[t.length++]=i),t},e._prime=function(t){if(w[t])return w[t];var i;if("k256"===t)i=new b;else if("p224"===t)i=new _;else if("p192"===t)i=new k;else{if("p25519"!==t)throw new Error("Unknown prime "+t);i=new A}return w[t]=i,i},S.prototype._verify1=function(t){h(0===t.negative,"red works only with positives"),h(t.red,"red works only with red numbers")},S.prototype._verify2=function(t,i){h(0==(t.negative|i.negative),"red works only with positives"),h(t.red&&t.red===i.red,"red works only with red numbers")},S.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(a(t,t.umod(this.m)._forceRed(this)),t)},S.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},S.prototype.add=function(t,i){this._verify2(t,i);var r=t.add(i);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.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},S.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)},S.prototype.isub=function(t,i){this._verify2(t,i);var r=t.isub(i);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(t,i){return this._verify1(t),this.imod(t.ushln(i))},S.prototype.imul=function(t,i){return this._verify2(t,i),this.imod(t.imul(i))},S.prototype.mul=function(t,i){return this._verify2(t,i),this.imod(t.mul(i))},S.prototype.isqr=function(t){return this.imul(t,t.clone())},S.prototype.sqr=function(t){return this.mul(t,t)},S.prototype.sqrt=function(t){if(t.isZero())return t.clone();var i=this.m.andln(3);if(h(i%2==1),3===i){var r=this.m.add(new e(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);h(!n.isZero());var s=new e(1).toRed(this),u=s.redNeg(),l=this.m.subn(1).iushrn(1),a=this.m.bitLength();for(a=new e(2*a*a).toRed(this);0!==this.pow(a,l).cmp(u);)a.redIAdd(u);for(var m=this.pow(a,n),f=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=o;0!==d.cmp(s);){for(var M=d,v=0;0!==M.cmp(s);v++)M=M.redSqr();h(v<p);var g=this.pow(m,new e(1).iushln(p-v-1));f=f.redMul(g),m=g.redSqr(),d=d.redMul(m),p=v}return f},S.prototype.invm=function(t){var i=t._invmp(this.m);return 0!==i.negative?(i.negative=0,this.imod(i).redNeg()):this.imod(i)},S.prototype.pow=function(t,i){if(i.isZero())return new e(1).toRed(this);if(0===i.cmpn(1))return t.clone();var r=new Array(16);r[0]=new e(1).toRed(this),r[1]=t;for(var h=2;h<r.length;h++)r[h]=this.mul(r[h-1],t);var n=r[0],o=0,s=0,u=i.bitLength()%26;for(0===u&&(u=26),h=i.length-1;h>=0;h--){for(var l=i.words[h],a=u-1;a>=0;a--){var m=l>>a&1;n!==r[0]&&(n=this.sqr(n)),0!==m||0!==o?(o<<=1,o|=m,(4==++s||0===h&&0===a)&&(n=this.mul(n,r[o]),s=0,o=0)):s=0}u=26}return n},S.prototype.convertTo=function(t){var i=t.umod(this.m);return i===t?i.clone():i},S.prototype.convertFrom=function(t){var i=t.clone();return i.red=null,i},e.mont=function(t){return new x(t)},n(x,S),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var i=this.imod(t.mul(this.rinv));return i.red=null,i},x.prototype.imul=function(t,i){if(t.isZero()||i.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(i),h=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(h).iushrn(this.shift),e=n;return n.cmp(this.m)>=0?e=n.isub(this.m):n.cmpn(0)<0&&(e=n.iadd(this.m)),e._forceRed(this)},x.prototype.mul=function(t,i){if(t.isZero()||i.isZero())return new e(0)._forceRed(this);var r=t.mul(i),h=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(h).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)},x.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(r,t);var h=r.exports;export{h as B,r as b};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("./index-fd18f5c9.cjs"),r=e.getAugmentedNamespace(e._tslib);exports.require$$0=r;
|
package/dist/cjs/bn-6c93fb4c.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var t=require("./index-fd18f5c9.cjs"),i=require("./__node-resolve_empty-1e1ab047.cjs"),r={exports:{}};!function(t,r){function h(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 e(t,i,r){if(e.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=e:r.BN=e,e.BN=e,e.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:i.require$$1.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 h(!1,"Invalid character in "+t)}function u(t,i,r){var h=s(t,r);return r-1>=i&&(h|=s(t,r-1)<<4),h}function l(t,i,r,n){for(var e=0,o=0,s=Math.min(t.length,r),u=i;u<s;u++){var l=t.charCodeAt(u)-48;e*=n,o=l>=49?l-49+10:l>=17?l-17+10:l,h(l>=0&&o<n,"Invalid character"),e+=o}return e}function a(t,i){t.words=i.words,t.length=i.length,t.negative=i.negative,t.red=i.red}if(e.isBN=function(t){return t instanceof e||null!==t&&"object"==typeof t&&t.constructor.wordSize===e.wordSize&&Array.isArray(t.words)},e.max=function(t,i){return t.cmp(i)>0?t:i},e.min=function(t,i){return t.cmp(i)<0?t:i},e.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),h(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)))},e.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):(h(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),i,r)},e.prototype._initArray=function(t,i,r){if(h("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 e,o,s=0;if("be"===r)for(n=t.length-1,e=0;n>=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[e]|=o<<s&67108863,this.words[e+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,e++);else if("le"===r)for(n=0,e=0;n<t.length;n+=3)o=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[e]|=o<<s&67108863,this.words[e+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,e++);return this._strip()},e.prototype._parseHex=function(t,i,r){this.length=Math.ceil((t.length-i)/6),this.words=new Array(this.length);for(var h=0;h<this.length;h++)this.words[h]=0;var n,e=0,o=0;if("be"===r)for(h=t.length-1;h>=i;h-=2)n=u(t,i,h)<<e,this.words[o]|=67108863&n,e>=18?(e-=18,o+=1,this.words[o]|=n>>>26):e+=8;else for(h=(t.length-i)%2==0?i+1:i;h<t.length;h+=2)n=u(t,i,h)<<e,this.words[o]|=67108863&n,e>=18?(e-=18,o+=1,this.words[o]|=n>>>26):e+=8;this._strip()},e.prototype._parseBase=function(t,i,r){this.words=[0],this.length=1;for(var h=0,n=1;n<=67108863;n*=i)h++;h--,n=n/i|0;for(var e=t.length-r,o=e%h,s=Math.min(e,e-o)+r,u=0,a=r;a<s;a+=h)u=l(t,a,a+h,i),this.imuln(n),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==o){var m=1;for(u=l(t,a,t.length,i),a=0;a<o;a++)m*=i;this.imuln(m),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},e.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},e.prototype._move=function(t){a(t,this)},e.prototype.clone=function(){var t=new e(null);return this.copy(t),t},e.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},e.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},e.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{e.prototype[Symbol.for("nodejs.util.inspect.custom")]=m}catch(t){e.prototype.inspect=m}else e.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 M(t,i,r){r.negative=i.negative^t.negative;var h=t.length+i.length|0;r.length=h,h=h-1|0;var n=0|t.words[0],e=0|i.words[0],o=n*e,s=67108863&o,u=o/67108864|0;r.words[0]=s;for(var l=1;l<h;l++){for(var a=u>>>26,m=67108863&u,f=Math.min(l,i.length-1),d=Math.max(0,l-t.length+1);d<=f;d++){var p=l-d|0;a+=(o=(n=0|t.words[p])*(e=0|i.words[d])+m)/67108864|0,m=67108863&o}r.words[l]=0|m,u=0|a}return 0!==u?r.words[l]=0|u:r.length--,r._strip()}e.prototype.toString=function(t,i){var r;if(i=0|i||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,e=0,o=0;o<this.length;o++){var s=this.words[o],u=(16777215&(s<<n|e)).toString(16);e=s>>>24-n&16777215,(n+=2)>=26&&(n-=26,o--),r=0!==e||o!==this.length-1?f[6-u.length]+u+r:u+r}for(0!==e&&(r=e.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 l=d[t],a=p[t];r="";var m=this.clone();for(m.negative=0;!m.isZero();){var M=m.modrn(a).toString(t);r=(m=m.idivn(a)).isZero()?M+r:f[l-M.length]+M+r}for(this.isZero()&&(r="0"+r);r.length%i!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}h(!1,"Base should be between 2 and 36")},e.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&&h(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},e.prototype.toJSON=function(){return this.toString(16,2)},o&&(e.prototype.toBuffer=function(t,i){return this.toArrayLike(o,t,i)}),e.prototype.toArray=function(t,i){return this.toArrayLike(Array,t,i)},e.prototype.toArrayLike=function(t,i,r){this._strip();var n=this.byteLength(),e=r||Math.max(1,n);h(n<=e,"byte array longer than desired length"),h(e>0,"Requested array length <= 0");var o=function(t,i){return t.allocUnsafe?t.allocUnsafe(i):new t(i)}(t,e);return this["_toArrayLike"+("le"===i?"LE":"BE")](o,n),o},e.prototype._toArrayLikeLE=function(t,i){for(var r=0,h=0,n=0,e=0;n<this.length;n++){var o=this.words[n]<<e|h;t[r++]=255&o,r<t.length&&(t[r++]=o>>8&255),r<t.length&&(t[r++]=o>>16&255),6===e?(r<t.length&&(t[r++]=o>>24&255),h=0,e=0):(h=o>>>24,e+=2)}if(r<t.length)for(t[r++]=h;r<t.length;)t[r++]=0},e.prototype._toArrayLikeBE=function(t,i){for(var r=t.length-1,h=0,n=0,e=0;n<this.length;n++){var o=this.words[n]<<e|h;t[r--]=255&o,r>=0&&(t[r--]=o>>8&255),r>=0&&(t[r--]=o>>16&255),6===e?(r>=0&&(t[r--]=o>>24&255),h=0,e=0):(h=o>>>24,e+=2)}if(r>=0)for(t[r--]=h;r>=0;)t[r--]=0},Math.clz32?e.prototype._countBits=function(t){return 32-Math.clz32(t)}:e.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},e.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},e.prototype.bitLength=function(){var t=this.words[this.length-1],i=this._countBits(t);return 26*(this.length-1)+i},e.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},e.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},e.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},e.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},e.prototype.isNeg=function(){return 0!==this.negative},e.prototype.neg=function(){return this.clone().ineg()},e.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},e.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()},e.prototype.ior=function(t){return h(0==(this.negative|t.negative)),this.iuor(t)},e.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},e.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},e.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()},e.prototype.iand=function(t){return h(0==(this.negative|t.negative)),this.iuand(t)},e.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},e.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},e.prototype.iuxor=function(t){var i,r;this.length>t.length?(i=this,r=t):(i=t,r=this);for(var h=0;h<r.length;h++)this.words[h]=i.words[h]^r.words[h];if(this!==i)for(;h<i.length;h++)this.words[h]=i.words[h];return this.length=i.length,this._strip()},e.prototype.ixor=function(t){return h(0==(this.negative|t.negative)),this.iuxor(t)},e.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},e.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},e.prototype.inotn=function(t){h("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()},e.prototype.notn=function(t){return this.clone().inotn(t)},e.prototype.setn=function(t,i){h("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()},e.prototype.iadd=function(t){var i,r,h;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,h=t):(r=t,h=this);for(var n=0,e=0;e<h.length;e++)i=(0|r.words[e])+(0|h.words[e])+n,this.words[e]=67108863&i,n=i>>>26;for(;0!==n&&e<r.length;e++)i=(0|r.words[e])+n,this.words[e]=67108863&i,n=i>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;e<r.length;e++)this.words[e]=r.words[e];return this},e.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)},e.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,h,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,h=t):(r=t,h=this);for(var e=0,o=0;o<h.length;o++)e=(i=(0|r.words[o])-(0|h.words[o])+e)>>26,this.words[o]=67108863&i;for(;0!==e&&o<r.length;o++)e=(i=(0|r.words[o])+e)>>26,this.words[o]=67108863&i;if(0===e&&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()},e.prototype.sub=function(t){return this.clone().isub(t)};var v=function(t,i,r){var h,n,e,o=t.words,s=i.words,u=r.words,l=0,a=0|o[0],m=8191&a,f=a>>>13,d=0|o[1],p=8191&d,M=d>>>13,v=0|o[2],g=8191&v,c=v>>>13,w=0|o[3],y=8191&w,b=w>>>13,_=0|o[4],k=8191&_,A=_>>>13,x=0|o[5],S=8191&x,q=x>>>13,Z=0|o[6],B=8191&Z,R=Z>>>13,N=0|o[7],L=8191&N,E=N>>>13,I=0|o[8],z=8191&I,O=I>>>13,T=0|o[9],j=8191&T,K=T>>>13,F=0|s[0],U=8191&F,C=F>>>13,D=0|s[1],H=8191&D,P=D>>>13,$=0|s[2],G=8191&$,J=$>>>13,Q=0|s[3],V=8191&Q,W=Q>>>13,X=0|s[4],Y=8191&X,tt=X>>>13,it=0|s[5],rt=8191&it,ht=it>>>13,nt=0|s[6],et=8191&nt,ot=nt>>>13,st=0|s[7],ut=8191&st,lt=st>>>13,at=0|s[8],mt=8191&at,ft=at>>>13,dt=0|s[9],pt=8191&dt,Mt=dt>>>13;r.negative=t.negative^i.negative,r.length=19;var vt=(l+(h=Math.imul(m,U))|0)+((8191&(n=(n=Math.imul(m,C))+Math.imul(f,U)|0))<<13)|0;l=((e=Math.imul(f,C))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,h=Math.imul(p,U),n=(n=Math.imul(p,C))+Math.imul(M,U)|0,e=Math.imul(M,C);var gt=(l+(h=h+Math.imul(m,H)|0)|0)+((8191&(n=(n=n+Math.imul(m,P)|0)+Math.imul(f,H)|0))<<13)|0;l=((e=e+Math.imul(f,P)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,h=Math.imul(g,U),n=(n=Math.imul(g,C))+Math.imul(c,U)|0,e=Math.imul(c,C),h=h+Math.imul(p,H)|0,n=(n=n+Math.imul(p,P)|0)+Math.imul(M,H)|0,e=e+Math.imul(M,P)|0;var ct=(l+(h=h+Math.imul(m,G)|0)|0)+((8191&(n=(n=n+Math.imul(m,J)|0)+Math.imul(f,G)|0))<<13)|0;l=((e=e+Math.imul(f,J)|0)+(n>>>13)|0)+(ct>>>26)|0,ct&=67108863,h=Math.imul(y,U),n=(n=Math.imul(y,C))+Math.imul(b,U)|0,e=Math.imul(b,C),h=h+Math.imul(g,H)|0,n=(n=n+Math.imul(g,P)|0)+Math.imul(c,H)|0,e=e+Math.imul(c,P)|0,h=h+Math.imul(p,G)|0,n=(n=n+Math.imul(p,J)|0)+Math.imul(M,G)|0,e=e+Math.imul(M,J)|0;var wt=(l+(h=h+Math.imul(m,V)|0)|0)+((8191&(n=(n=n+Math.imul(m,W)|0)+Math.imul(f,V)|0))<<13)|0;l=((e=e+Math.imul(f,W)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,h=Math.imul(k,U),n=(n=Math.imul(k,C))+Math.imul(A,U)|0,e=Math.imul(A,C),h=h+Math.imul(y,H)|0,n=(n=n+Math.imul(y,P)|0)+Math.imul(b,H)|0,e=e+Math.imul(b,P)|0,h=h+Math.imul(g,G)|0,n=(n=n+Math.imul(g,J)|0)+Math.imul(c,G)|0,e=e+Math.imul(c,J)|0,h=h+Math.imul(p,V)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(M,V)|0,e=e+Math.imul(M,W)|0;var yt=(l+(h=h+Math.imul(m,Y)|0)|0)+((8191&(n=(n=n+Math.imul(m,tt)|0)+Math.imul(f,Y)|0))<<13)|0;l=((e=e+Math.imul(f,tt)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,h=Math.imul(S,U),n=(n=Math.imul(S,C))+Math.imul(q,U)|0,e=Math.imul(q,C),h=h+Math.imul(k,H)|0,n=(n=n+Math.imul(k,P)|0)+Math.imul(A,H)|0,e=e+Math.imul(A,P)|0,h=h+Math.imul(y,G)|0,n=(n=n+Math.imul(y,J)|0)+Math.imul(b,G)|0,e=e+Math.imul(b,J)|0,h=h+Math.imul(g,V)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(c,V)|0,e=e+Math.imul(c,W)|0,h=h+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(M,Y)|0,e=e+Math.imul(M,tt)|0;var bt=(l+(h=h+Math.imul(m,rt)|0)|0)+((8191&(n=(n=n+Math.imul(m,ht)|0)+Math.imul(f,rt)|0))<<13)|0;l=((e=e+Math.imul(f,ht)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,h=Math.imul(B,U),n=(n=Math.imul(B,C))+Math.imul(R,U)|0,e=Math.imul(R,C),h=h+Math.imul(S,H)|0,n=(n=n+Math.imul(S,P)|0)+Math.imul(q,H)|0,e=e+Math.imul(q,P)|0,h=h+Math.imul(k,G)|0,n=(n=n+Math.imul(k,J)|0)+Math.imul(A,G)|0,e=e+Math.imul(A,J)|0,h=h+Math.imul(y,V)|0,n=(n=n+Math.imul(y,W)|0)+Math.imul(b,V)|0,e=e+Math.imul(b,W)|0,h=h+Math.imul(g,Y)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(c,Y)|0,e=e+Math.imul(c,tt)|0,h=h+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(M,rt)|0,e=e+Math.imul(M,ht)|0;var _t=(l+(h=h+Math.imul(m,et)|0)|0)+((8191&(n=(n=n+Math.imul(m,ot)|0)+Math.imul(f,et)|0))<<13)|0;l=((e=e+Math.imul(f,ot)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,h=Math.imul(L,U),n=(n=Math.imul(L,C))+Math.imul(E,U)|0,e=Math.imul(E,C),h=h+Math.imul(B,H)|0,n=(n=n+Math.imul(B,P)|0)+Math.imul(R,H)|0,e=e+Math.imul(R,P)|0,h=h+Math.imul(S,G)|0,n=(n=n+Math.imul(S,J)|0)+Math.imul(q,G)|0,e=e+Math.imul(q,J)|0,h=h+Math.imul(k,V)|0,n=(n=n+Math.imul(k,W)|0)+Math.imul(A,V)|0,e=e+Math.imul(A,W)|0,h=h+Math.imul(y,Y)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(b,Y)|0,e=e+Math.imul(b,tt)|0,h=h+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,ht)|0)+Math.imul(c,rt)|0,e=e+Math.imul(c,ht)|0,h=h+Math.imul(p,et)|0,n=(n=n+Math.imul(p,ot)|0)+Math.imul(M,et)|0,e=e+Math.imul(M,ot)|0;var kt=(l+(h=h+Math.imul(m,ut)|0)|0)+((8191&(n=(n=n+Math.imul(m,lt)|0)+Math.imul(f,ut)|0))<<13)|0;l=((e=e+Math.imul(f,lt)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,h=Math.imul(z,U),n=(n=Math.imul(z,C))+Math.imul(O,U)|0,e=Math.imul(O,C),h=h+Math.imul(L,H)|0,n=(n=n+Math.imul(L,P)|0)+Math.imul(E,H)|0,e=e+Math.imul(E,P)|0,h=h+Math.imul(B,G)|0,n=(n=n+Math.imul(B,J)|0)+Math.imul(R,G)|0,e=e+Math.imul(R,J)|0,h=h+Math.imul(S,V)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(q,V)|0,e=e+Math.imul(q,W)|0,h=h+Math.imul(k,Y)|0,n=(n=n+Math.imul(k,tt)|0)+Math.imul(A,Y)|0,e=e+Math.imul(A,tt)|0,h=h+Math.imul(y,rt)|0,n=(n=n+Math.imul(y,ht)|0)+Math.imul(b,rt)|0,e=e+Math.imul(b,ht)|0,h=h+Math.imul(g,et)|0,n=(n=n+Math.imul(g,ot)|0)+Math.imul(c,et)|0,e=e+Math.imul(c,ot)|0,h=h+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,lt)|0)+Math.imul(M,ut)|0,e=e+Math.imul(M,lt)|0;var At=(l+(h=h+Math.imul(m,mt)|0)|0)+((8191&(n=(n=n+Math.imul(m,ft)|0)+Math.imul(f,mt)|0))<<13)|0;l=((e=e+Math.imul(f,ft)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,h=Math.imul(j,U),n=(n=Math.imul(j,C))+Math.imul(K,U)|0,e=Math.imul(K,C),h=h+Math.imul(z,H)|0,n=(n=n+Math.imul(z,P)|0)+Math.imul(O,H)|0,e=e+Math.imul(O,P)|0,h=h+Math.imul(L,G)|0,n=(n=n+Math.imul(L,J)|0)+Math.imul(E,G)|0,e=e+Math.imul(E,J)|0,h=h+Math.imul(B,V)|0,n=(n=n+Math.imul(B,W)|0)+Math.imul(R,V)|0,e=e+Math.imul(R,W)|0,h=h+Math.imul(S,Y)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(q,Y)|0,e=e+Math.imul(q,tt)|0,h=h+Math.imul(k,rt)|0,n=(n=n+Math.imul(k,ht)|0)+Math.imul(A,rt)|0,e=e+Math.imul(A,ht)|0,h=h+Math.imul(y,et)|0,n=(n=n+Math.imul(y,ot)|0)+Math.imul(b,et)|0,e=e+Math.imul(b,ot)|0,h=h+Math.imul(g,ut)|0,n=(n=n+Math.imul(g,lt)|0)+Math.imul(c,ut)|0,e=e+Math.imul(c,lt)|0,h=h+Math.imul(p,mt)|0,n=(n=n+Math.imul(p,ft)|0)+Math.imul(M,mt)|0,e=e+Math.imul(M,ft)|0;var xt=(l+(h=h+Math.imul(m,pt)|0)|0)+((8191&(n=(n=n+Math.imul(m,Mt)|0)+Math.imul(f,pt)|0))<<13)|0;l=((e=e+Math.imul(f,Mt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,h=Math.imul(j,H),n=(n=Math.imul(j,P))+Math.imul(K,H)|0,e=Math.imul(K,P),h=h+Math.imul(z,G)|0,n=(n=n+Math.imul(z,J)|0)+Math.imul(O,G)|0,e=e+Math.imul(O,J)|0,h=h+Math.imul(L,V)|0,n=(n=n+Math.imul(L,W)|0)+Math.imul(E,V)|0,e=e+Math.imul(E,W)|0,h=h+Math.imul(B,Y)|0,n=(n=n+Math.imul(B,tt)|0)+Math.imul(R,Y)|0,e=e+Math.imul(R,tt)|0,h=h+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,ht)|0)+Math.imul(q,rt)|0,e=e+Math.imul(q,ht)|0,h=h+Math.imul(k,et)|0,n=(n=n+Math.imul(k,ot)|0)+Math.imul(A,et)|0,e=e+Math.imul(A,ot)|0,h=h+Math.imul(y,ut)|0,n=(n=n+Math.imul(y,lt)|0)+Math.imul(b,ut)|0,e=e+Math.imul(b,lt)|0,h=h+Math.imul(g,mt)|0,n=(n=n+Math.imul(g,ft)|0)+Math.imul(c,mt)|0,e=e+Math.imul(c,ft)|0;var St=(l+(h=h+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,Mt)|0)+Math.imul(M,pt)|0))<<13)|0;l=((e=e+Math.imul(M,Mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,h=Math.imul(j,G),n=(n=Math.imul(j,J))+Math.imul(K,G)|0,e=Math.imul(K,J),h=h+Math.imul(z,V)|0,n=(n=n+Math.imul(z,W)|0)+Math.imul(O,V)|0,e=e+Math.imul(O,W)|0,h=h+Math.imul(L,Y)|0,n=(n=n+Math.imul(L,tt)|0)+Math.imul(E,Y)|0,e=e+Math.imul(E,tt)|0,h=h+Math.imul(B,rt)|0,n=(n=n+Math.imul(B,ht)|0)+Math.imul(R,rt)|0,e=e+Math.imul(R,ht)|0,h=h+Math.imul(S,et)|0,n=(n=n+Math.imul(S,ot)|0)+Math.imul(q,et)|0,e=e+Math.imul(q,ot)|0,h=h+Math.imul(k,ut)|0,n=(n=n+Math.imul(k,lt)|0)+Math.imul(A,ut)|0,e=e+Math.imul(A,lt)|0,h=h+Math.imul(y,mt)|0,n=(n=n+Math.imul(y,ft)|0)+Math.imul(b,mt)|0,e=e+Math.imul(b,ft)|0;var qt=(l+(h=h+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,Mt)|0)+Math.imul(c,pt)|0))<<13)|0;l=((e=e+Math.imul(c,Mt)|0)+(n>>>13)|0)+(qt>>>26)|0,qt&=67108863,h=Math.imul(j,V),n=(n=Math.imul(j,W))+Math.imul(K,V)|0,e=Math.imul(K,W),h=h+Math.imul(z,Y)|0,n=(n=n+Math.imul(z,tt)|0)+Math.imul(O,Y)|0,e=e+Math.imul(O,tt)|0,h=h+Math.imul(L,rt)|0,n=(n=n+Math.imul(L,ht)|0)+Math.imul(E,rt)|0,e=e+Math.imul(E,ht)|0,h=h+Math.imul(B,et)|0,n=(n=n+Math.imul(B,ot)|0)+Math.imul(R,et)|0,e=e+Math.imul(R,ot)|0,h=h+Math.imul(S,ut)|0,n=(n=n+Math.imul(S,lt)|0)+Math.imul(q,ut)|0,e=e+Math.imul(q,lt)|0,h=h+Math.imul(k,mt)|0,n=(n=n+Math.imul(k,ft)|0)+Math.imul(A,mt)|0,e=e+Math.imul(A,ft)|0;var Zt=(l+(h=h+Math.imul(y,pt)|0)|0)+((8191&(n=(n=n+Math.imul(y,Mt)|0)+Math.imul(b,pt)|0))<<13)|0;l=((e=e+Math.imul(b,Mt)|0)+(n>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,h=Math.imul(j,Y),n=(n=Math.imul(j,tt))+Math.imul(K,Y)|0,e=Math.imul(K,tt),h=h+Math.imul(z,rt)|0,n=(n=n+Math.imul(z,ht)|0)+Math.imul(O,rt)|0,e=e+Math.imul(O,ht)|0,h=h+Math.imul(L,et)|0,n=(n=n+Math.imul(L,ot)|0)+Math.imul(E,et)|0,e=e+Math.imul(E,ot)|0,h=h+Math.imul(B,ut)|0,n=(n=n+Math.imul(B,lt)|0)+Math.imul(R,ut)|0,e=e+Math.imul(R,lt)|0,h=h+Math.imul(S,mt)|0,n=(n=n+Math.imul(S,ft)|0)+Math.imul(q,mt)|0,e=e+Math.imul(q,ft)|0;var Bt=(l+(h=h+Math.imul(k,pt)|0)|0)+((8191&(n=(n=n+Math.imul(k,Mt)|0)+Math.imul(A,pt)|0))<<13)|0;l=((e=e+Math.imul(A,Mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,h=Math.imul(j,rt),n=(n=Math.imul(j,ht))+Math.imul(K,rt)|0,e=Math.imul(K,ht),h=h+Math.imul(z,et)|0,n=(n=n+Math.imul(z,ot)|0)+Math.imul(O,et)|0,e=e+Math.imul(O,ot)|0,h=h+Math.imul(L,ut)|0,n=(n=n+Math.imul(L,lt)|0)+Math.imul(E,ut)|0,e=e+Math.imul(E,lt)|0,h=h+Math.imul(B,mt)|0,n=(n=n+Math.imul(B,ft)|0)+Math.imul(R,mt)|0,e=e+Math.imul(R,ft)|0;var Rt=(l+(h=h+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,Mt)|0)+Math.imul(q,pt)|0))<<13)|0;l=((e=e+Math.imul(q,Mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,h=Math.imul(j,et),n=(n=Math.imul(j,ot))+Math.imul(K,et)|0,e=Math.imul(K,ot),h=h+Math.imul(z,ut)|0,n=(n=n+Math.imul(z,lt)|0)+Math.imul(O,ut)|0,e=e+Math.imul(O,lt)|0,h=h+Math.imul(L,mt)|0,n=(n=n+Math.imul(L,ft)|0)+Math.imul(E,mt)|0,e=e+Math.imul(E,ft)|0;var Nt=(l+(h=h+Math.imul(B,pt)|0)|0)+((8191&(n=(n=n+Math.imul(B,Mt)|0)+Math.imul(R,pt)|0))<<13)|0;l=((e=e+Math.imul(R,Mt)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,h=Math.imul(j,ut),n=(n=Math.imul(j,lt))+Math.imul(K,ut)|0,e=Math.imul(K,lt),h=h+Math.imul(z,mt)|0,n=(n=n+Math.imul(z,ft)|0)+Math.imul(O,mt)|0,e=e+Math.imul(O,ft)|0;var Lt=(l+(h=h+Math.imul(L,pt)|0)|0)+((8191&(n=(n=n+Math.imul(L,Mt)|0)+Math.imul(E,pt)|0))<<13)|0;l=((e=e+Math.imul(E,Mt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,h=Math.imul(j,mt),n=(n=Math.imul(j,ft))+Math.imul(K,mt)|0,e=Math.imul(K,ft);var Et=(l+(h=h+Math.imul(z,pt)|0)|0)+((8191&(n=(n=n+Math.imul(z,Mt)|0)+Math.imul(O,pt)|0))<<13)|0;l=((e=e+Math.imul(O,Mt)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863;var It=(l+(h=Math.imul(j,pt))|0)+((8191&(n=(n=Math.imul(j,Mt))+Math.imul(K,pt)|0))<<13)|0;return l=((e=Math.imul(K,Mt))+(n>>>13)|0)+(It>>>26)|0,It&=67108863,u[0]=vt,u[1]=gt,u[2]=ct,u[3]=wt,u[4]=yt,u[5]=bt,u[6]=_t,u[7]=kt,u[8]=At,u[9]=xt,u[10]=St,u[11]=qt,u[12]=Zt,u[13]=Bt,u[14]=Rt,u[15]=Nt,u[16]=Lt,u[17]=Et,u[18]=It,0!==l&&(u[19]=l,r.length++),r};function g(t,i,r){r.negative=i.negative^t.negative,r.length=t.length+i.length;for(var h=0,n=0,e=0;e<r.length-1;e++){var o=n;n=0;for(var s=67108863&h,u=Math.min(e,i.length-1),l=Math.max(0,e-t.length+1);l<=u;l++){var a=e-l,m=(0|t.words[a])*(0|i.words[l]),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[e]=s,h=o,o=n}return 0!==h?r.words[e]=h:r.length--,r._strip()}function c(t,i,r){return g(t,i,r)}Math.imul||(v=M),e.prototype.mulTo=function(t,i){var r=this.length+t.length;return 10===this.length&&10===t.length?v(this,t,i):r<63?M(this,t,i):r<1024?g(this,t,i):c(this,t,i)},e.prototype.mul=function(t){var i=new e(null);return i.words=new Array(this.length+t.length),this.mulTo(t,i)},e.prototype.mulf=function(t){var i=new e(null);return i.words=new Array(this.length+t.length),c(this,t,i)},e.prototype.imul=function(t){return this.clone().mulTo(t,this)},e.prototype.imuln=function(t){var i=t<0;i&&(t=-t),h("number"==typeof t),h(t<67108864);for(var r=0,n=0;n<this.length;n++){var e=(0|this.words[n])*t,o=(67108863&e)+(67108863&r);r>>=26,r+=e/67108864|0,r+=o>>>26,this.words[n]=67108863&o}return 0!==r&&(this.words[n]=r,this.length++),i?this.ineg():this},e.prototype.muln=function(t){return this.clone().imuln(t)},e.prototype.sqr=function(){return this.mul(this)},e.prototype.isqr=function(){return this.imul(this.clone())},e.prototype.pow=function(t){var i=function(t){for(var i=new Array(t.bitLength()),r=0;r<i.length;r++){var h=r/26|0,n=r%26;i[r]=t.words[h]>>>n&1}return i}(t);if(0===i.length)return new e(1);for(var r=this,h=0;h<i.length&&0===i[h];h++,r=r.sqr());if(++h<i.length)for(var n=r.sqr();h<i.length;h++,n=n.sqr())0!==i[h]&&(r=r.mul(n));return r},e.prototype.iushln=function(t){h("number"==typeof t&&t>=0);var i,r=t%26,n=(t-r)/26,e=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(i=0;i<this.length;i++){var s=this.words[i]&e,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()},e.prototype.ishln=function(t){return h(0===this.negative),this.iushln(t)},e.prototype.iushrn=function(t,i,r){var n;h("number"==typeof t&&t>=0),n=i?(i-i%26)/26:0;var e=t%26,o=Math.min((t-e)/26,this.length),s=67108863^67108863>>>e<<e,u=r;if(n-=o,n=Math.max(0,n),u){for(var l=0;l<o;l++)u.words[l]=this.words[l];u.length=o}if(0===o);else if(this.length>o)for(this.length-=o,l=0;l<this.length;l++)this.words[l]=this.words[l+o];else this.words[0]=0,this.length=1;var a=0;for(l=this.length-1;l>=0&&(0!==a||l>=n);l--){var m=0|this.words[l];this.words[l]=a<<26-e|m>>>e,a=m&s}return u&&0!==a&&(u.words[u.length++]=a),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},e.prototype.ishrn=function(t,i,r){return h(0===this.negative),this.iushrn(t,i,r)},e.prototype.shln=function(t){return this.clone().ishln(t)},e.prototype.ushln=function(t){return this.clone().iushln(t)},e.prototype.shrn=function(t){return this.clone().ishrn(t)},e.prototype.ushrn=function(t){return this.clone().iushrn(t)},e.prototype.testn=function(t){h("number"==typeof t&&t>=0);var i=t%26,r=(t-i)/26,n=1<<i;return!(this.length<=r||!(this.words[r]&n))},e.prototype.imaskn=function(t){h("number"==typeof t&&t>=0);var i=t%26,r=(t-i)/26;if(h(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()},e.prototype.maskn=function(t){return this.clone().imaskn(t)},e.prototype.iaddn=function(t){return h("number"==typeof t),h(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)},e.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},e.prototype.isubn=function(t){if(h("number"==typeof t),h(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()},e.prototype.addn=function(t){return this.clone().iaddn(t)},e.prototype.subn=function(t){return this.clone().isubn(t)},e.prototype.iabs=function(){return this.negative=0,this},e.prototype.abs=function(){return this.clone().iabs()},e.prototype._ishlnsubmul=function(t,i,r){var n,e,o=t.length+r;this._expand(o);var s=0;for(n=0;n<t.length;n++){e=(0|this.words[n+r])+s;var u=(0|t.words[n])*i;s=((e-=67108863&u)>>26)-(u/67108864|0),this.words[n+r]=67108863&e}for(;n<this.length-r;n++)s=(e=(0|this.words[n+r])+s)>>26,this.words[n+r]=67108863&e;if(0===s)return this._strip();for(h(-1===s),s=0,n=0;n<this.length;n++)s=(e=-(0|this.words[n])+s)>>26,this.words[n]=67108863&e;return this.negative=1,this._strip()},e.prototype._wordDiv=function(t,i){var r=(this.length,t.length),h=this.clone(),n=t,o=0|n.words[n.length-1];0!=(r=26-this._countBits(o))&&(n=n.ushln(r),h.iushln(r),o=0|n.words[n.length-1]);var s,u=h.length-n.length;if("mod"!==i){(s=new e(null)).length=u+1,s.words=new Array(s.length);for(var l=0;l<s.length;l++)s.words[l]=0}var a=h.clone()._ishlnsubmul(n,1,u);0===a.negative&&(h=a,s&&(s.words[u]=1));for(var m=u-1;m>=0;m--){var f=67108864*(0|h.words[n.length+m])+(0|h.words[n.length+m-1]);for(f=Math.min(f/o|0,67108863),h._ishlnsubmul(n,f,m);0!==h.negative;)f--,h.negative=0,h._ishlnsubmul(n,1,m),h.isZero()||(h.negative^=1);s&&(s.words[m]=f)}return s&&s._strip(),h._strip(),"div"!==i&&0!==r&&h.iushrn(r),{div:s||null,mod:h}},e.prototype.divmod=function(t,i,r){return h(!t.isZero()),this.isZero()?{div:new e(0),mod:new e(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 e(0),mod:this}:1===t.length?"div"===i?{div:this.divn(t.words[0]),mod:null}:"mod"===i?{div:null,mod:new e(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new e(this.modrn(t.words[0]))}:this._wordDiv(t,i);var n,o,s},e.prototype.div=function(t){return this.divmod(t,"div",!1).div},e.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},e.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},e.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,h=t.ushrn(1),n=t.andln(1),e=r.cmp(h);return e<0||1===n&&0===e?i.div:0!==i.div.negative?i.div.isubn(1):i.div.iaddn(1)},e.prototype.modrn=function(t){var i=t<0;i&&(t=-t),h(t<=67108863);for(var r=(1<<26)%t,n=0,e=this.length-1;e>=0;e--)n=(r*n+(0|this.words[e]))%t;return i?-n:n},e.prototype.modn=function(t){return this.modrn(t)},e.prototype.idivn=function(t){var i=t<0;i&&(t=-t),h(t<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var e=(0|this.words[n])+67108864*r;this.words[n]=e/t|0,r=e%t}return this._strip(),i?this.ineg():this},e.prototype.divn=function(t){return this.clone().idivn(t)},e.prototype.egcd=function(t){h(0===t.negative),h(!t.isZero());var i=this,r=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var n=new e(1),o=new e(0),s=new e(0),u=new e(1),l=0;i.isEven()&&r.isEven();)i.iushrn(1),r.iushrn(1),++l;for(var a=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(a),o.isub(m)),n.iushrn(1),o.iushrn(1);for(var p=0,M=1;0==(r.words[0]&M)&&p<26;++p,M<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(a),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(l)}},e.prototype._invmp=function(t){h(0===t.negative),h(!t.isZero());var i=this,r=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var n,o=new e(1),s=new e(0),u=r.clone();i.cmpn(1)>0&&r.cmpn(1)>0;){for(var l=0,a=1;0==(i.words[0]&a)&&l<26;++l,a<<=1);if(l>0)for(i.iushrn(l);l-- >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},e.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 h=0;i.isEven()&&r.isEven();h++)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 e=i;i=r,r=e}else if(0===n||0===r.cmpn(1))break;i.isub(r)}return r.iushln(h)},e.prototype.invm=function(t){return this.egcd(t).a.umod(t)},e.prototype.isEven=function(){return 0==(1&this.words[0])},e.prototype.isOdd=function(){return 1==(1&this.words[0])},e.prototype.andln=function(t){return this.words[0]&t},e.prototype.bincn=function(t){h("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 e=n,o=r;0!==e&&o<this.length;o++){var s=0|this.words[o];e=(s+=e)>>>26,s&=67108863,this.words[o]=s}return 0!==e&&(this.words[o]=e,this.length++),this},e.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},e.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),h(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},e.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},e.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 h=0|this.words[r],n=0|t.words[r];if(h!==n){h<n?i=-1:h>n&&(i=1);break}}return i},e.prototype.gtn=function(t){return 1===this.cmpn(t)},e.prototype.gt=function(t){return 1===this.cmp(t)},e.prototype.gten=function(t){return this.cmpn(t)>=0},e.prototype.gte=function(t){return this.cmp(t)>=0},e.prototype.ltn=function(t){return-1===this.cmpn(t)},e.prototype.lt=function(t){return-1===this.cmp(t)},e.prototype.lten=function(t){return this.cmpn(t)<=0},e.prototype.lte=function(t){return this.cmp(t)<=0},e.prototype.eqn=function(t){return 0===this.cmpn(t)},e.prototype.eq=function(t){return 0===this.cmp(t)},e.red=function(t){return new x(t)},e.prototype.toRed=function(t){return h(!this.red,"Already a number in reduction context"),h(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},e.prototype.fromRed=function(){return h(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},e.prototype._forceRed=function(t){return this.red=t,this},e.prototype.forceRed=function(t){return h(!this.red,"Already a number in reduction context"),this._forceRed(t)},e.prototype.redAdd=function(t){return h(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},e.prototype.redIAdd=function(t){return h(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},e.prototype.redSub=function(t){return h(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},e.prototype.redISub=function(t){return h(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},e.prototype.redShl=function(t){return h(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},e.prototype.redMul=function(t){return h(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},e.prototype.redIMul=function(t){return h(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},e.prototype.redSqr=function(){return h(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},e.prototype.redISqr=function(){return h(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},e.prototype.redSqrt=function(){return h(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},e.prototype.redInvm=function(){return h(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},e.prototype.redNeg=function(){return h(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},e.prototype.redPow=function(t){return h(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 e(i,16),this.n=this.p.bitLength(),this.k=new e(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 _(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function k(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(t){if("string"==typeof t){var i=e._prime(t);this.m=i.p,this.prime=i}else h(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){x.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new e(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 e(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 h=i<this.n?-1:r.ucmp(this.p);return 0===h?(r.words[0]=0,r.length=1):h>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,h=Math.min(t.length,9),n=0;n<h;n++)i.words[n]=t.words[n];if(i.length=h,t.length<=9)return t.words[0]=0,void(t.length=1);var e=t.words[9];for(i.words[i.length++]=e&r,n=10;n<t.length;n++){var o=0|t.words[n];t.words[n-10]=(o&r)<<4|e>>>22,e=o}e>>>=22,t.words[n-10]=e,0===e&&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 h=0|t.words[r];i+=977*h,t.words[r]=67108863&i,i=64*h+(i/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(_,y),n(k,y),n(A,y),A.prototype.imulK=function(t){for(var i=0,r=0;r<t.length;r++){var h=19*(0|t.words[r])+i,n=67108863&h;h>>>=26,t.words[r]=n,i=h}return 0!==i&&(t.words[t.length++]=i),t},e._prime=function(t){if(w[t])return w[t];var i;if("k256"===t)i=new b;else if("p224"===t)i=new _;else if("p192"===t)i=new k;else{if("p25519"!==t)throw new Error("Unknown prime "+t);i=new A}return w[t]=i,i},x.prototype._verify1=function(t){h(0===t.negative,"red works only with positives"),h(t.red,"red works only with red numbers")},x.prototype._verify2=function(t,i){h(0==(t.negative|i.negative),"red works only with positives"),h(t.red&&t.red===i.red,"red works only with red numbers")},x.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(a(t,t.umod(this.m)._forceRed(this)),t)},x.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},x.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)},x.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},x.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)},x.prototype.isub=function(t,i){this._verify2(t,i);var r=t.isub(i);return r.cmpn(0)<0&&r.iadd(this.m),r},x.prototype.shl=function(t,i){return this._verify1(t),this.imod(t.ushln(i))},x.prototype.imul=function(t,i){return this._verify2(t,i),this.imod(t.imul(i))},x.prototype.mul=function(t,i){return this._verify2(t,i),this.imod(t.mul(i))},x.prototype.isqr=function(t){return this.imul(t,t.clone())},x.prototype.sqr=function(t){return this.mul(t,t)},x.prototype.sqrt=function(t){if(t.isZero())return t.clone();var i=this.m.andln(3);if(h(i%2==1),3===i){var r=this.m.add(new e(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);h(!n.isZero());var s=new e(1).toRed(this),u=s.redNeg(),l=this.m.subn(1).iushrn(1),a=this.m.bitLength();for(a=new e(2*a*a).toRed(this);0!==this.pow(a,l).cmp(u);)a.redIAdd(u);for(var m=this.pow(a,n),f=this.pow(t,n.addn(1).iushrn(1)),d=this.pow(t,n),p=o;0!==d.cmp(s);){for(var M=d,v=0;0!==M.cmp(s);v++)M=M.redSqr();h(v<p);var g=this.pow(m,new e(1).iushln(p-v-1));f=f.redMul(g),m=g.redSqr(),d=d.redMul(m),p=v}return f},x.prototype.invm=function(t){var i=t._invmp(this.m);return 0!==i.negative?(i.negative=0,this.imod(i).redNeg()):this.imod(i)},x.prototype.pow=function(t,i){if(i.isZero())return new e(1).toRed(this);if(0===i.cmpn(1))return t.clone();var r=new Array(16);r[0]=new e(1).toRed(this),r[1]=t;for(var h=2;h<r.length;h++)r[h]=this.mul(r[h-1],t);var n=r[0],o=0,s=0,u=i.bitLength()%26;for(0===u&&(u=26),h=i.length-1;h>=0;h--){for(var l=i.words[h],a=u-1;a>=0;a--){var m=l>>a&1;n!==r[0]&&(n=this.sqr(n)),0!==m||0!==o?(o<<=1,o|=m,(4==++s||0===h&&0===a)&&(n=this.mul(n,r[o]),s=0,o=0)):s=0}u=26}return n},x.prototype.convertTo=function(t){var i=t.umod(this.m);return i===t?i.clone():i},x.prototype.convertFrom=function(t){var i=t.clone();return i.red=null,i},e.mont=function(t){return new S(t)},n(S,x),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),h=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(h).iushrn(this.shift),e=n;return n.cmp(this.m)>=0?e=n.isub(this.m):n.cmpn(0)<0&&(e=n.iadd(this.m)),e._forceRed(this)},S.prototype.mul=function(t,i){if(t.isZero()||i.isZero())return new e(0)._forceRed(this);var r=t.mul(i),h=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(h).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)}}(r,t.commonjsGlobal);var h=r.exports;exports.BN=h,exports.bn=r;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var e=require("@ethersproject/contracts"),r=require("@ethersproject/abstract-signer"),t=require("@ethersproject/address"),n=require("@ethersproject/abstract-provider"),i=require("@ethersproject/bytes"),o=require("./index-fd18f5c9.cjs"),a=require("./id-48662e0b.cjs"),f=require("./index-0dd9ae9a.cjs"),s=require("@ethersproject/properties"),d=require("./bn-6c93fb4c.cjs"),l=require("./hash-7ce6fed5.cjs"),u=require("@ethersproject/transactions"),c=require("@ethersproject/json-wallets"),h=require("@ethersproject/constants"),p=require("@ethersproject/providers"),A=require("./interface-27dc9126.cjs"),g=require("./index-529b9846.cjs");function m(e){if(e&&e.__esModule)return e;var r=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}})),r.default=e,Object.freeze(r)}var y=m(h),b=m(p);const v=new a.Logger(a.version),w={},S=a.BigNumber.from(0),B=a.BigNumber.from(-1);function C(e,r,t,n){const i={fault:r,operation:t};return void 0!==n&&(i.value=n),v.throwError(e,a.Logger.errors.NUMERIC_FAULT,i)}let E="0";for(;E.length<256;)E+=E;function x(e){if("number"!=typeof e)try{e=a.BigNumber.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+E.substring(0,e):v.throwArgumentError("invalid decimal size","decimals",e)}function I(e,r){null==r&&(r=0);const t=x(r),n=(e=a.BigNumber.from(e)).lt(S);n&&(e=e.mul(B));let i=e.mod(t).toString();for(;i.length<t.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const o=e.div(t).toString();return e=1===t.length?o:o+"."+i,n&&(e="-"+e),e}function F(e,r){null==r&&(r=0);const t=x(r);"string"==typeof e&&e.match(/^-?[0-9.]+$/)||v.throwArgumentError("invalid decimal value","value",e);const n="-"===e.substring(0,1);n&&(e=e.substring(1)),"."===e&&v.throwArgumentError("missing value","value",e);const i=e.split(".");i.length>2&&v.throwArgumentError("too many decimal points","value",e);let o=i[0],f=i[1];for(o||(o="0"),f||(f="0");"0"===f[f.length-1];)f=f.substring(0,f.length-1);for(f.length>t.length-1&&C("fractional component exceeds decimals","underflow","parseFixed"),""===f&&(f="0");f.length<t.length-1;)f+="0";const s=a.BigNumber.from(o),d=a.BigNumber.from(f);let l=s.mul(t).add(d);return n&&(l=l.mul(B)),l}class P{constructor(e,r,t,n){e!==w&&v.throwError("cannot use FixedFormat constructor; use FixedFormat.from",a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=r,this.width=t,this.decimals=n,this.name=(r?"":"u")+"fixed"+String(t)+"x"+String(n),this._multiplier=x(n),Object.freeze(this)}static from(e){if(e instanceof P)return e;"number"==typeof e&&(e=`fixed128x${e}`);let r=!0,t=128,n=18;if("string"==typeof e)if("fixed"===e);else if("ufixed"===e)r=!1;else{const i=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);i||v.throwArgumentError("invalid fixed format","format",e),r="u"!==i[1],t=parseInt(i[2]),n=parseInt(i[3])}else if(e){const i=(r,t,n)=>null==e[r]?n:(typeof e[r]!==t&&v.throwArgumentError("invalid fixed format ("+r+" not "+t+")","format."+r,e[r]),e[r]);r=i("signed","boolean",r),t=i("width","number",t),n=i("decimals","number",n)}return t%8&&v.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",t),n>80&&v.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new P(w,r,t,n)}}class D{constructor(e,r,t,n){e!==w&&v.throwError("cannot use FixedNumber constructor; use FixedNumber.from",a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=r,this._value=t,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&v.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const r=F(this._value,this.format.decimals),t=F(e._value,e.format.decimals);return D.fromValue(r.add(t),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const r=F(this._value,this.format.decimals),t=F(e._value,e.format.decimals);return D.fromValue(r.sub(t),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const r=F(this._value,this.format.decimals),t=F(e._value,e.format.decimals);return D.fromValue(r.mul(t).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const r=F(this._value,this.format.decimals),t=F(e._value,e.format.decimals);return D.fromValue(r.mul(this.format._multiplier).div(t),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let r=D.from(e[0],this.format);const t=!e[1].match(/^(0*)$/);return this.isNegative()&&t&&(r=r.subUnsafe(M.toFormat(r.format))),r}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let r=D.from(e[0],this.format);const t=!e[1].match(/^(0*)$/);return!this.isNegative()&&t&&(r=r.addUnsafe(M.toFormat(r.format))),r}round(e){null==e&&(e=0);const r=this.toString().split(".");if(1===r.length&&r.push("0"),(e<0||e>80||e%1)&&v.throwArgumentError("invalid decimal count","decimals",e),r[1].length<=e)return this;const t=D.from("1"+E.substring(0,e),this.format),n=R.toFormat(this.format);return this.mulUnsafe(t).addUnsafe(n).floor().divUnsafe(t)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&v.throwArgumentError("invalid byte width","width",e);const r=a.BigNumber.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return i.hexZeroPad(r,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return D.fromString(this._value,e)}static fromValue(e,r,t){return null!=t||null==r||a.isBigNumberish(r)||(t=r,r=null),null==r&&(r=0),null==t&&(t="fixed"),D.fromString(I(e,r),P.from(t))}static fromString(e,r){null==r&&(r="fixed");const t=P.from(r),n=F(e,t.decimals);!t.signed&&n.lt(S)&&C("unsigned value cannot be negative","overflow","value",e);let o=null;t.signed?o=n.toTwos(t.width).toHexString():(o=n.toHexString(),o=i.hexZeroPad(o,t.width/8));const a=I(n,t.decimals);return new D(w,o,a,t)}static fromBytes(e,r){null==r&&(r="fixed");const t=P.from(r);if(i.arrayify(e).length>t.width/8)throw new Error("overflow");let n=a.BigNumber.from(e);t.signed&&(n=n.fromTwos(t.width));const o=n.toTwos((t.signed?0:1)+t.width).toHexString(),f=I(n,t.decimals);return new D(w,o,f,t)}static from(e,r){if("string"==typeof e)return D.fromString(e,r);if(i.isBytes(e))return D.fromBytes(e,r);try{return D.fromValue(e,0,r)}catch(e){if(e.code!==a.Logger.errors.INVALID_ARGUMENT)throw e}return v.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const M=D.from(1),R=D.from("0.5");function T(e){const r=a.toUtf8Bytes(e);if(r.length>31)throw new Error("bytes32 string must be less than 32 bytes");return i.hexlify(i.concat([r,h.HashZero]).slice(0,32))}function k(e){const r=i.arrayify(e);if(32!==r.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==r[31])throw new Error("invalid bytes32 string - no null terminator");let t=31;for(;0===r[t-1];)t--;return a.toUtf8String(r.slice(0,t))}function N(e,r){r||(r=function(e){return[parseInt(e,16)]});let t=0,n={};return e.split(",").forEach((e=>{let i=e.split(":");t+=parseInt(i[0],16),n[t]=r(i[1])})),n}function O(e){let r=0;return e.split(",").map((e=>{let t=e.split("-");1===t.length?t[1]="0":""===t[1]&&(t[1]="1");let n=r+parseInt(t[0],16);return r=parseInt(t[1],16),{l:n,h:r}}))}function U(e,r){let t=0;for(let n=0;n<r.length;n++){let i=r[n];if(t+=i.l,e>=t&&e<=t+i.h&&(e-t)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(e-t))continue;return i}}return null}const L=O("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),K="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((e=>parseInt(e,16))),q=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],H=N("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),z=N("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),G=N("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!=0)throw new Error("bad data");let r=[];for(let t=0;t<e.length;t+=4)r.push(parseInt(e.substring(t,t+4),16));return r})),Q=O("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function W(e){if(e.match(/^[a-z0-9-]*$/i)&&e.length<=59)return e.toLowerCase();let r=a.toUtf8CodePoints(e);var t;t=r.map((e=>{if(K.indexOf(e)>=0)return[];if(e>=65024&&e<=65039)return[];let r=function(e){let r=U(e,q);if(r)return[e+r.s];let t=H[e];if(t)return t;let n=z[e];return n?[e+n[0]]:G[e]||null}(e);return r||[e]})),r=t.reduce(((e,r)=>(r.forEach((r=>{e.push(r)})),e)),[]),r=a.toUtf8CodePoints(a._toUtf8String(r),a.UnicodeNormalizationForm.NFKC),r.forEach((e=>{if(U(e,Q))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),r.forEach((e=>{if(U(e,L))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));let n=a._toUtf8String(r);if("-"===n.substring(0,1)||"--"===n.substring(2,4)||"-"===n.substring(n.length-1))throw new Error("invalid hyphen");return n}var J=Object.freeze({__proto__:null,decode:f.decode,encode:f.encode});function Y(e,r){null==r&&(r=1);const t=[],n=t.forEach,i=function(e,r){n.call(e,(function(e){r>0&&Array.isArray(e)?i(e,r-1):t.push(e)}))};return i(e,r),t}function V(e){return function(e){let r=0;return()=>e[r++]}(function(e){let r=0;function t(){return e[r++]<<8|e[r++]}let n=t(),i=1,o=[0,1];for(let e=1;e<n;e++)o.push(i+=t());let a=t(),f=r;r+=a;let s=0,d=0;function l(){return 0==s&&(d=d<<8|e[r++],s=8),d>>--s&1}const u=Math.pow(2,31),c=u>>>1,h=c>>1,p=u-1;let A=0;for(let e=0;e<31;e++)A=A<<1|l();let g=[],m=0,y=u;for(;;){let e=Math.floor(((A-m+1)*i-1)/y),r=0,t=n;for(;t-r>1;){let n=r+t>>>1;e<o[n]?t=n:r=n}if(0==r)break;g.push(r);let a=m+Math.floor(y*o[r]/i),f=m+Math.floor(y*o[r+1]/i)-1;for(;0==((a^f)&c);)A=A<<1&p|l(),a=a<<1&p,f=f<<1&p|1;for(;a&~f&h;)A=A&c|A<<1&p>>>1|l(),a=a<<1^c,f=(f^c)<<1|c|1;m=a,y=1+f-a}let b=n-4;return g.map((r=>{switch(r-b){case 3:return b+65792+(e[f++]<<16|e[f++]<<8|e[f++]);case 2:return b+256+(e[f++]<<8|e[f++]);case 1:return b+e[f++];default:return r-1}}))}(e))}function j(e){return 1&e?~e>>1:e>>1}function X(e,r){let t=Array(e);for(let n=0,i=-1;n<e;n++)t[n]=i+=1+r();return t}function _(e,r){let t=Array(e);for(let n=0,i=0;n<e;n++)t[n]=i+=j(r());return t}function Z(e,r){let t=X(e(),e),n=e(),i=X(n,e),o=function(e,r){let t=Array(e);for(let n=0;n<e;n++)t[n]=1+r();return t}(n,e);for(let e=0;e<n;e++)for(let r=0;r<o[e];r++)t.push(i[e]+r);return r?t.map((e=>r[e])):t}function $(e,r,t){let n=Array(e).fill(void 0).map((()=>[]));for(let i=0;i<r;i++)_(e,t).forEach(((e,r)=>n[r].push(e)));return n}function ee(e,r){let t=1+r(),n=r(),i=function(e){let r=[];for(;;){let t=e();if(0==t)break;r.push(t)}return r}(r);return Y($(i.length,1+e,r).map(((e,r)=>{const o=e[0],a=e.slice(1);return Array(i[r]).fill(void 0).map(((e,r)=>{let i=r*n;return[o+r*t,a.map((e=>e+i))]}))})))}function re(e,r){return $(1+r(),1+e,r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ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),ne=new Set(Z(te)),ie=new Set(Z(te)),oe=function(e){let r=[];for(;;){let t=e();if(0==t)break;r.push(ee(t,e))}for(;;){let t=e()-1;if(t<0)break;r.push(re(t,e))}return function(e){const r={};for(let t=0;t<e.length;t++){const n=e[t];r[n[0]]=n[1]}return r}(Y(r))}(te),ae=function(e){let r=Z(e).sort(((e,r)=>e-r));return function t(){let n=[];for(;;){let i=Z(e,r);if(0==i.length)break;n.push({set:new Set(i),node:t()})}n.sort(((e,r)=>r.set.size-e.set.size));let i=e(),o=i%3;i=i/3|0;let a=!!(1&i);return i>>=1,{branches:n,valid:o,fe0f:a,save:1==i,check:2==i}}()}(te),fe=45,se=95;function de(e){return a.toUtf8CodePoints(e)}function le(e){return e.filter((e=>65039!=e))}function ue(e){for(let r of e.split(".")){let e=de(r);try{for(let r=e.lastIndexOf(se)-1;r>=0;r--)if(e[r]!==se)throw new Error("underscore only allowed at start");if(e.length>=4&&e.every((e=>e<128))&&e[2]===fe&&e[3]===fe)throw new Error("invalid label extension")}catch(e){throw new Error(`Invalid label "${r}": ${e.message}`)}}return e}function ce(e){return ue(function(e,r){let t=de(e).reverse(),n=[];for(;t.length;){let e=he(t);if(e){n.push(...r(e));continue}let i=t.pop();if(ne.has(i)){n.push(i);continue}if(ie.has(i))continue;let o=oe[i];if(!o)throw new Error(`Disallowed codepoint: 0x${i.toString(16).toUpperCase()}`);n.push(...o)}return ue((i=String.fromCodePoint(...n),i.normalize("NFC")));var i}(e,le))}function he(e,r){var t;let n,i,o=ae,a=[],f=e.length;for(r&&(r.length=0);f;){let s=e[--f];if(o=null===(t=o.branches.find((e=>e.set.has(s))))||void 0===t?void 0:t.node,!o)break;if(o.save)i=s;else if(o.check&&s===i)break;a.push(s),o.fe0f&&(a.push(65039),f>0&&65039==e[f-1]&&f--),o.valid&&(n=a.slice(),2==o.valid&&n.splice(1,1),r&&r.push(...e.slice(f).reverse()),e.length=f)}return n}const pe=new a.Logger(f.version),Ae=new Uint8Array(32);function ge(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function me(e){const r=a.toUtf8Bytes(ce(e)),t=[];if(0===e.length)return t;let n=0;for(let e=0;e<r.length;e++){46===r[e]&&(t.push(ge(r.slice(n,e))),n=e+1)}if(n>=r.length)throw new Error("invalid ENS name; empty component");return t.push(ge(r.slice(n))),t}function ye(e){try{return 0!==me(e).length}catch(e){}return!1}function be(e){"string"!=typeof e&&pe.throwArgumentError("invalid ENS name; not a string","name",e);let r=Ae;const t=me(e);for(;t.length;)r=o.keccak256(i.concat([r,o.keccak256(t.pop())]));return i.hexlify(r)}function ve(e){return i.hexlify(i.concat(me(e).map((e=>{if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");const r=new Uint8Array(e.length+1);return r.set(e,1),r[0]=r.length-1,r}))))+"00"}Ae.fill(0);const we="Ethereum Signed Message:\n";function Se(e){return"string"==typeof e&&(e=a.toUtf8Bytes(e)),o.keccak256(i.concat([a.toUtf8Bytes(we),a.toUtf8Bytes(String(e.length)),e]))}class Be{constructor(e){s.defineReadOnly(this,"alphabet",e),s.defineReadOnly(this,"base",e.length),s.defineReadOnly(this,"_alphabetMap",{}),s.defineReadOnly(this,"_leader",e.charAt(0));for(let r=0;r<e.length;r++)this._alphabetMap[e.charAt(r)]=r}encode(e){let r=i.arrayify(e);if(0===r.length)return"";let t=[0];for(let e=0;e<r.length;++e){let n=r[e];for(let e=0;e<t.length;++e)n+=t[e]<<8,t[e]=n%this.base,n=n/this.base|0;for(;n>0;)t.push(n%this.base),n=n/this.base|0}let n="";for(let e=0;0===r[e]&&e<r.length-1;++e)n+=this._leader;for(let e=t.length-1;e>=0;--e)n+=this.alphabet[t[e]];return n}decode(e){if("string"!=typeof e)throw new TypeError("Expected String");let r=[];if(0===e.length)return new Uint8Array(r);r.push(0);for(let t=0;t<e.length;t++){let n=this._alphabetMap[e[t]];if(void 0===n)throw new Error("Non-base"+this.base+" character");let i=n;for(let e=0;e<r.length;++e)i+=r[e]*this.base,r[e]=255&i,i>>=8;for(;i>0;)r.push(255&i),i>>=8}for(let t=0;e[t]===this._leader&&t<e.length-1;++t)r.push(0);return i.arrayify(new Uint8Array(r.reverse()))}}const Ce=new Be("abcdefghijklmnopqrstuvwxyz234567"),Ee=new Be("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");var xe,Ie=Object.freeze({__proto__:null,BaseX:Be,Base32:Ce,Base58:Ee});exports.SupportedAlgorithm=void 0,(xe=exports.SupportedAlgorithm||(exports.SupportedAlgorithm={})).sha256="sha256",xe.sha512="sha512";const Fe=new a.Logger("sha2/5.7.0");function Pe(e){return"0x"+l.hash.ripemd160().update(i.arrayify(e)).digest("hex")}function De(e){return"0x"+l.hash.sha256().update(i.arrayify(e)).digest("hex")}function Me(e){return"0x"+l.hash.sha512().update(i.arrayify(e)).digest("hex")}function Re(e,r,t){return exports.SupportedAlgorithm[e]||Fe.throwError("unsupported algorithm "+e,a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:e}),"0x"+l.hash.hmac(l.hash[e],i.arrayify(r)).update(i.arrayify(t)).digest("hex")}function Te(e,r,t){return t={path:r,exports:{},require:function(e,r){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==r&&t.path)}},e(t,t.exports),t.exports}var ke=Ne;function Ne(e,r){if(!e)throw new Error(r||"Assertion failed")}Ne.equal=function(e,r,t){if(e!=r)throw new Error(t||"Assertion failed: "+e+" != "+r)};var Oe=Te((function(e,r){var t=r;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var r="",t=0;t<e.length;t++)r+=n(e[t].toString(16));return r}t.toArray=function(e,r){if(Array.isArray(e))return e.slice();if(!e)return[];var t=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)t[n]=0|e[n];return t}if("hex"===r){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(n=0;n<e.length;n+=2)t.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,a=255&i;o?t.push(o,a):t.push(a)}return t},t.zero2=n,t.toHex=i,t.encode=function(e,r){return"hex"===r?i(e):e}})),Ue=Te((function(e,r){var t=r;t.assert=ke,t.toArray=Oe.toArray,t.zero2=Oe.zero2,t.toHex=Oe.toHex,t.encode=Oe.encode,t.getNAF=function(e,r,t){var n=new Array(Math.max(e.bitLength(),t)+1);n.fill(0);for(var i=1<<r+1,o=e.clone(),a=0;a<n.length;a++){var f,s=o.andln(i-1);o.isOdd()?(f=s>(i>>1)-1?(i>>1)-s:s,o.isubn(f)):f=0,n[a]=f,o.iushrn(1)}return n},t.getJSF=function(e,r){var t=[[],[]];e=e.clone(),r=r.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||r.cmpn(-o)>0;){var a,f,s=e.andln(3)+i&3,d=r.andln(3)+o&3;3===s&&(s=-1),3===d&&(d=-1),a=0==(1&s)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==d?s:-s,t[0].push(a),f=0==(1&d)?0:3!==(n=r.andln(7)+o&7)&&5!==n||2!==s?d:-d,t[1].push(f),2*i===a+1&&(i=1-i),2*o===f+1&&(o=1-o),e.iushrn(1),r.iushrn(1)}return t},t.cachedProperty=function(e,r,t){var n="_"+r;e.prototype[r]=function(){return void 0!==this[n]?this[n]:this[n]=t.call(this)}},t.parseBytes=function(e){return"string"==typeof e?t.toArray(e,"hex"):e},t.intFromLE=function(e){return new d.BN(e,"hex","le")}})),Le=Ue.getNAF,Ke=Ue.getJSF,qe=Ue.assert;function He(e,r){this.type=e,this.p=new d.BN(r.p,16),this.red=r.prime?d.BN.red(r.prime):d.BN.mont(this.p),this.zero=new d.BN(0).toRed(this.red),this.one=new d.BN(1).toRed(this.red),this.two=new d.BN(2).toRed(this.red),this.n=r.n&&new d.BN(r.n,16),this.g=r.g&&this.pointFromJSON(r.g,r.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var t=this.n&&this.p.div(this.n);!t||t.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var ze=He;function Ge(e,r){this.curve=e,this.type=r,this.precomputed=null}He.prototype.point=function(){throw new Error("Not implemented")},He.prototype.validate=function(){throw new Error("Not implemented")},He.prototype._fixedNafMul=function(e,r){qe(e.precomputed);var t=e._getDoubles(),n=Le(r,1,this._bitLength),i=(1<<t.step+1)-(t.step%2==0?2:1);i/=3;var o,a,f=[];for(o=0;o<n.length;o+=t.step){a=0;for(var s=o+t.step-1;s>=o;s--)a=(a<<1)+n[s];f.push(a)}for(var d=this.jpoint(null,null,null),l=this.jpoint(null,null,null),u=i;u>0;u--){for(o=0;o<f.length;o++)(a=f[o])===u?l=l.mixedAdd(t.points[o]):a===-u&&(l=l.mixedAdd(t.points[o].neg()));d=d.add(l)}return d.toP()},He.prototype._wnafMul=function(e,r){var t=4,n=e._getNAFPoints(t);t=n.wnd;for(var i=n.points,o=Le(r,t,this._bitLength),a=this.jpoint(null,null,null),f=o.length-1;f>=0;f--){for(var s=0;f>=0&&0===o[f];f--)s++;if(f>=0&&s++,a=a.dblp(s),f<0)break;var d=o[f];qe(0!==d),a="affine"===e.type?d>0?a.mixedAdd(i[d-1>>1]):a.mixedAdd(i[-d-1>>1].neg()):d>0?a.add(i[d-1>>1]):a.add(i[-d-1>>1].neg())}return"affine"===e.type?a.toP():a},He.prototype._wnafMulAdd=function(e,r,t,n,i){var o,a,f,s=this._wnafT1,d=this._wnafT2,l=this._wnafT3,u=0;for(o=0;o<n;o++){var c=(f=r[o])._getNAFPoints(e);s[o]=c.wnd,d[o]=c.points}for(o=n-1;o>=1;o-=2){var h=o-1,p=o;if(1===s[h]&&1===s[p]){var A=[r[h],null,null,r[p]];0===r[h].y.cmp(r[p].y)?(A[1]=r[h].add(r[p]),A[2]=r[h].toJ().mixedAdd(r[p].neg())):0===r[h].y.cmp(r[p].y.redNeg())?(A[1]=r[h].toJ().mixedAdd(r[p]),A[2]=r[h].add(r[p].neg())):(A[1]=r[h].toJ().mixedAdd(r[p]),A[2]=r[h].toJ().mixedAdd(r[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],m=Ke(t[h],t[p]);for(u=Math.max(m[0].length,u),l[h]=new Array(u),l[p]=new Array(u),a=0;a<u;a++){var y=0|m[0][a],b=0|m[1][a];l[h][a]=g[3*(y+1)+(b+1)],l[p][a]=0,d[h]=A}}else l[h]=Le(t[h],s[h],this._bitLength),l[p]=Le(t[p],s[p],this._bitLength),u=Math.max(l[h].length,u),u=Math.max(l[p].length,u)}var v=this.jpoint(null,null,null),w=this._wnafT4;for(o=u;o>=0;o--){for(var S=0;o>=0;){var B=!0;for(a=0;a<n;a++)w[a]=0|l[a][o],0!==w[a]&&(B=!1);if(!B)break;S++,o--}if(o>=0&&S++,v=v.dblp(S),o<0)break;for(a=0;a<n;a++){var C=w[a];0!==C&&(C>0?f=d[a][C-1>>1]:C<0&&(f=d[a][-C-1>>1].neg()),v="affine"===f.type?v.mixedAdd(f):v.add(f))}}for(o=0;o<n;o++)d[o]=null;return i?v:v.toP()},He.BasePoint=Ge,Ge.prototype.eq=function(){throw new Error("Not implemented")},Ge.prototype.validate=function(){return this.curve.validate(this)},He.prototype.decodePoint=function(e,r){e=Ue.toArray(e,r);var t=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*t)return 6===e[0]?qe(e[e.length-1]%2==0):7===e[0]&&qe(e[e.length-1]%2==1),this.point(e.slice(1,1+t),e.slice(1+t,1+2*t));if((2===e[0]||3===e[0])&&e.length-1===t)return this.pointFromX(e.slice(1,1+t),3===e[0]);throw new Error("Unknown point format")},Ge.prototype.encodeCompressed=function(e){return this.encode(e,!0)},Ge.prototype._encode=function(e){var r=this.curve.p.byteLength(),t=this.getX().toArray("be",r);return e?[this.getY().isEven()?2:3].concat(t):[4].concat(t,this.getY().toArray("be",r))},Ge.prototype.encode=function(e,r){return Ue.encode(this._encode(r),e)},Ge.prototype.precompute=function(e){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,e),r.beta=this._getBeta(),this.precomputed=r,this},Ge.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return!!r&&r.points.length>=Math.ceil((e.bitLength()+1)/r.step)},Ge.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var t=[this],n=this,i=0;i<r;i+=e){for(var o=0;o<e;o++)n=n.dbl();t.push(n)}return{step:e,points:t}},Ge.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var r=[this],t=(1<<e)-1,n=1===t?null:this.dbl(),i=1;i<t;i++)r[i]=r[i-1].add(n);return{wnd:e,points:r}},Ge.prototype._getBeta=function(){return null},Ge.prototype.dblp=function(e){for(var r=this,t=0;t<e;t++)r=r.dbl();return r};var Qe=Te((function(e){"function"==typeof Object.create?e.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,r){if(r){e.super_=r;var t=function(){};t.prototype=r.prototype,e.prototype=new t,e.prototype.constructor=e}}})),We=Ue.assert;function Je(e){ze.call(this,"short",e),this.a=new d.BN(e.a,16).toRed(this.red),this.b=new d.BN(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}Qe(Je,ze);var Ye=Je;function Ve(e,r,t,n){ze.BasePoint.call(this,e,"affine"),null===r&&null===t?(this.x=null,this.y=null,this.inf=!0):(this.x=new d.BN(r,16),this.y=new d.BN(t,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function je(e,r,t,n){ze.BasePoint.call(this,e,"jacobian"),null===r&&null===t&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new d.BN(0)):(this.x=new d.BN(r,16),this.y=new d.BN(t,16),this.z=new d.BN(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}Je.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var r,t;if(e.beta)r=new d.BN(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);r=(r=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)t=new d.BN(e.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(r))?t=i[0]:(t=i[1],We(0===this.g.mul(t).x.cmp(this.g.x.redMul(r))))}return{beta:r,lambda:t,basis:e.basis?e.basis.map((function(e){return{a:new d.BN(e.a,16),b:new d.BN(e.b,16)}})):this._getEndoBasis(t)}}},Je.prototype._getEndoRoots=function(e){var r=e===this.p?this.red:d.BN.mont(e),t=new d.BN(2).toRed(r).redInvm(),n=t.redNeg(),i=new d.BN(3).toRed(r).redNeg().redSqrt().redMul(t);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},Je.prototype._getEndoBasis=function(e){for(var r,t,n,i,o,a,f,s,l,u=this.n.ushrn(Math.floor(this.n.bitLength()/2)),c=e,h=this.n.clone(),p=new d.BN(1),A=new d.BN(0),g=new d.BN(0),m=new d.BN(1),y=0;0!==c.cmpn(0);){var b=h.div(c);s=h.sub(b.mul(c)),l=g.sub(b.mul(p));var v=m.sub(b.mul(A));if(!n&&s.cmp(u)<0)r=f.neg(),t=p,n=s.neg(),i=l;else if(n&&2==++y)break;f=s,h=c,c=s,g=p,p=l,m=A,A=v}o=s.neg(),a=l;var w=n.sqr().add(i.sqr());return o.sqr().add(a.sqr()).cmp(w)>=0&&(o=r,a=t),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:n,b:i},{a:o,b:a}]},Je.prototype._endoSplit=function(e){var r=this.endo.basis,t=r[0],n=r[1],i=n.b.mul(e).divRound(this.n),o=t.b.neg().mul(e).divRound(this.n),a=i.mul(t.a),f=o.mul(n.a),s=i.mul(t.b),d=o.mul(n.b);return{k1:e.sub(a).sub(f),k2:s.add(d).neg()}},Je.prototype.pointFromX=function(e,r){(e=new d.BN(e,16)).red||(e=e.toRed(this.red));var t=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=t.redSqrt();if(0!==n.redSqr().redSub(t).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(r&&!i||!r&&i)&&(n=n.redNeg()),this.point(e,n)},Je.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,t=e.y,n=this.a.redMul(r),i=r.redSqr().redMul(r).redIAdd(n).redIAdd(this.b);return 0===t.redSqr().redISub(i).cmpn(0)},Je.prototype._endoWnafMulAdd=function(e,r,t){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(r[o]),f=e[o],s=f._getBeta();a.k1.negative&&(a.k1.ineg(),f=f.neg(!0)),a.k2.negative&&(a.k2.ineg(),s=s.neg(!0)),n[2*o]=f,n[2*o+1]=s,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var d=this._wnafMulAdd(1,n,i,2*o,t),l=0;l<2*o;l++)n[l]=null,i[l]=null;return d},Qe(Ve,ze.BasePoint),Je.prototype.point=function(e,r,t){return new Ve(this,e,r,t)},Je.prototype.pointFromJSON=function(e,r){return Ve.fromJSON(this,e,r)},Ve.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var t=this.curve,n=function(e){return t.point(e.x.redMul(t.endo.beta),e.y)};e.beta=r,r.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return r}},Ve.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},Ve.fromJSON=function(e,r,t){"string"==typeof r&&(r=JSON.parse(r));var n=e.point(r[0],r[1],t);if(!r[2])return n;function i(r){return e.point(r[0],r[1],t)}var o=r[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},Ve.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},Ve.prototype.isInfinity=function(){return this.inf},Ve.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var r=this.y.redSub(e.y);0!==r.cmpn(0)&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var t=r.redSqr().redISub(this.x).redISub(e.x),n=r.redMul(this.x.redSub(t)).redISub(this.y);return this.curve.point(t,n)},Ve.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var r=this.curve.a,t=this.x.redSqr(),n=e.redInvm(),i=t.redAdd(t).redIAdd(t).redIAdd(r).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},Ve.prototype.getX=function(){return this.x.fromRed()},Ve.prototype.getY=function(){return this.y.fromRed()},Ve.prototype.mul=function(e){return e=new d.BN(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},Ve.prototype.mulAdd=function(e,r,t){var n=[this,r],i=[e,t];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},Ve.prototype.jmulAdd=function(e,r,t){var n=[this,r],i=[e,t];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},Ve.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},Ve.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var t=this.precomputed,n=function(e){return e.neg()};r.precomputed={naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(n)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(n)}}}return r},Ve.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},Qe(je,ze.BasePoint),Je.prototype.jpoint=function(e,r,t){return new je(this,e,r,t)},je.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),t=this.x.redMul(r),n=this.y.redMul(r).redMul(e);return this.curve.point(t,n)},je.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},je.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),t=this.z.redSqr(),n=this.x.redMul(r),i=e.x.redMul(t),o=this.y.redMul(r.redMul(e.z)),a=e.y.redMul(t.redMul(this.z)),f=n.redSub(i),s=o.redSub(a);if(0===f.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var d=f.redSqr(),l=d.redMul(f),u=n.redMul(d),c=s.redSqr().redIAdd(l).redISub(u).redISub(u),h=s.redMul(u.redISub(c)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(f);return this.curve.jpoint(c,h,p)},je.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),t=this.x,n=e.x.redMul(r),i=this.y,o=e.y.redMul(r).redMul(this.z),a=t.redSub(n),f=i.redSub(o);if(0===a.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var s=a.redSqr(),d=s.redMul(a),l=t.redMul(s),u=f.redSqr().redIAdd(d).redISub(l).redISub(l),c=f.redMul(l.redISub(u)).redISub(i.redMul(d)),h=this.z.redMul(a);return this.curve.jpoint(u,c,h)},je.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var t=this;for(r=0;r<e;r++)t=t.dbl();return t}var n=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,f=this.z,s=f.redSqr().redSqr(),d=a.redAdd(a);for(r=0;r<e;r++){var l=o.redSqr(),u=d.redSqr(),c=u.redSqr(),h=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(s)),p=o.redMul(u),A=h.redSqr().redISub(p.redAdd(p)),g=p.redISub(A),m=h.redMul(g);m=m.redIAdd(m).redISub(c);var y=d.redMul(f);r+1<e&&(s=s.redMul(c)),o=A,f=y,d=m}return this.curve.jpoint(o,d.redMul(i),f)},je.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},je.prototype._zeroDbl=function(){var e,r,t;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var f=n.redAdd(n).redIAdd(n),s=f.redSqr().redISub(a).redISub(a),d=o.redIAdd(o);d=(d=d.redIAdd(d)).redIAdd(d),e=s,r=f.redMul(a.redISub(s)).redISub(d),t=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),u=this.y.redSqr(),c=u.redSqr(),h=this.x.redAdd(u).redSqr().redISub(l).redISub(c);h=h.redIAdd(h);var p=l.redAdd(l).redIAdd(l),A=p.redSqr(),g=c.redIAdd(c);g=(g=g.redIAdd(g)).redIAdd(g),e=A.redISub(h).redISub(h),r=p.redMul(h.redISub(e)).redISub(g),t=(t=this.y.redMul(this.z)).redIAdd(t)}return this.curve.jpoint(e,r,t)},je.prototype._threeDbl=function(){var e,r,t;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var f=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),s=f.redSqr().redISub(a).redISub(a);e=s;var d=o.redIAdd(o);d=(d=d.redIAdd(d)).redIAdd(d),r=f.redMul(a.redISub(s)).redISub(d),t=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),u=this.y.redSqr(),c=this.x.redMul(u),h=this.x.redSub(l).redMul(this.x.redAdd(l));h=h.redAdd(h).redIAdd(h);var p=c.redIAdd(c),A=(p=p.redIAdd(p)).redAdd(p);e=h.redSqr().redISub(A),t=this.y.redAdd(this.z).redSqr().redISub(u).redISub(l);var g=u.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),r=h.redMul(p.redISub(e)).redISub(g)}return this.curve.jpoint(e,r,t)},je.prototype._dbl=function(){var e=this.curve.a,r=this.x,t=this.y,n=this.z,i=n.redSqr().redSqr(),o=r.redSqr(),a=t.redSqr(),f=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),s=r.redAdd(r),d=(s=s.redIAdd(s)).redMul(a),l=f.redSqr().redISub(d.redAdd(d)),u=d.redISub(l),c=a.redSqr();c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var h=f.redMul(u).redISub(c),p=t.redAdd(t).redMul(n);return this.curve.jpoint(l,h,p)},je.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),r=this.y.redSqr(),t=this.z.redSqr(),n=r.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),a=this.x.redAdd(r).redSqr().redISub(e).redISub(n),f=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),s=n.redIAdd(n);s=(s=(s=s.redIAdd(s)).redIAdd(s)).redIAdd(s);var d=i.redIAdd(a).redSqr().redISub(o).redISub(f).redISub(s),l=r.redMul(d);l=(l=l.redIAdd(l)).redIAdd(l);var u=this.x.redMul(f).redISub(l);u=(u=u.redIAdd(u)).redIAdd(u);var c=this.y.redMul(d.redMul(s.redISub(d)).redISub(a.redMul(f)));c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var h=this.z.redAdd(a).redSqr().redISub(t).redISub(f);return this.curve.jpoint(u,c,h)},je.prototype.mul=function(e,r){return e=new d.BN(e,r),this.curve._wnafMul(this,e)},je.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var r=this.z.redSqr(),t=e.z.redSqr();if(0!==this.x.redMul(t).redISub(e.x.redMul(r)).cmpn(0))return!1;var n=r.redMul(this.z),i=t.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},je.prototype.eqXToP=function(e){var r=this.z.redSqr(),t=e.toRed(this.curve.red).redMul(r);if(0===this.x.cmp(t))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(r);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},je.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},je.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var Xe=Te((function(e,r){var t=r;t.base=ze,t.short=Ye,t.mont=null,t.edwards=null})),_e=Te((function(e,r){var t,n=r,i=Ue.assert;function o(e){"short"===e.type?this.curve=new Xe.short(e):"edwards"===e.type?this.curve=new Xe.edwards(e):this.curve=new Xe.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,r){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var t=new o(r);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:t}),t}})}n.PresetCurve=o,a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:l.hash.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:l.hash.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:l.hash.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:l.hash.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:l.hash.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:l.hash.sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:l.hash.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{t=null.crash()}catch(e){t=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:l.hash.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",t]})}));function Ze(e){if(!(this instanceof Ze))return new Ze(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var r=Oe.toArray(e.entropy,e.entropyEnc||"hex"),t=Oe.toArray(e.nonce,e.nonceEnc||"hex"),n=Oe.toArray(e.pers,e.persEnc||"hex");ke(r.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(r,t,n)}var $e=Ze;Ze.prototype._init=function(e,r,t){var n=e.concat(r).concat(t);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},Ze.prototype._hmac=function(){return new l.hash.hmac(this.hash,this.K)},Ze.prototype._update=function(e){var r=this._hmac().update(this.V).update([0]);e&&(r=r.update(e)),this.K=r.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},Ze.prototype.reseed=function(e,r,t,n){"string"!=typeof r&&(n=t,t=r,r=null),e=Oe.toArray(e,r),t=Oe.toArray(t,n),ke(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(t||[])),this._reseed=1},Ze.prototype.generate=function(e,r,t,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof r&&(n=t,t=r,r=null),t&&(t=Oe.toArray(t,n||"hex"),this._update(t));for(var i=[];i.length<e;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var o=i.slice(0,e);return this._update(t),this._reseed++,Oe.encode(o,r)};var er=Ue.assert;function rr(e,r){this.ec=e,this.priv=null,this.pub=null,r.priv&&this._importPrivate(r.priv,r.privEnc),r.pub&&this._importPublic(r.pub,r.pubEnc)}var tr=rr;rr.fromPublic=function(e,r,t){return r instanceof rr?r:new rr(e,{pub:r,pubEnc:t})},rr.fromPrivate=function(e,r,t){return r instanceof rr?r:new rr(e,{priv:r,privEnc:t})},rr.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},rr.prototype.getPublic=function(e,r){return"string"==typeof e&&(r=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,e):this.pub},rr.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},rr.prototype._importPrivate=function(e,r){this.priv=new d.BN(e,r||16),this.priv=this.priv.umod(this.ec.curve.n)},rr.prototype._importPublic=function(e,r){if(e.x||e.y)return"mont"===this.ec.curve.type?er(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||er(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,r)},rr.prototype.derive=function(e){return e.validate()||er(e.validate(),"public point not validated"),e.mul(this.priv).getX()},rr.prototype.sign=function(e,r,t){return this.ec.sign(e,this,r,t)},rr.prototype.verify=function(e,r){return this.ec.verify(e,r,this)},rr.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var nr=Ue.assert;function ir(e,r){if(e instanceof ir)return e;this._importDER(e,r)||(nr(e.r&&e.s,"Signature without r or s"),this.r=new d.BN(e.r,16),this.s=new d.BN(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var or=ir;function ar(){this.place=0}function fr(e,r){var t=e[r.place++];if(!(128&t))return t;var n=15&t;if(0===n||n>4)return!1;for(var i=0,o=0,a=r.place;o<n;o++,a++)i<<=8,i|=e[a],i>>>=0;return!(i<=127)&&(r.place=a,i)}function sr(e){for(var r=0,t=e.length-1;!e[r]&&!(128&e[r+1])&&r<t;)r++;return 0===r?e:e.slice(r)}function dr(e,r){if(r<128)e.push(r);else{var t=1+(Math.log(r)/Math.LN2>>>3);for(e.push(128|t);--t;)e.push(r>>>(t<<3)&255);e.push(r)}}ir.prototype._importDER=function(e,r){e=Ue.toArray(e,r);var t=new ar;if(48!==e[t.place++])return!1;var n=fr(e,t);if(!1===n)return!1;if(n+t.place!==e.length)return!1;if(2!==e[t.place++])return!1;var i=fr(e,t);if(!1===i)return!1;var o=e.slice(t.place,i+t.place);if(t.place+=i,2!==e[t.place++])return!1;var a=fr(e,t);if(!1===a)return!1;if(e.length!==a+t.place)return!1;var f=e.slice(t.place,a+t.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new d.BN(o),this.s=new d.BN(f),this.recoveryParam=null,!0},ir.prototype.toDER=function(e){var r=this.r.toArray(),t=this.s.toArray();for(128&r[0]&&(r=[0].concat(r)),128&t[0]&&(t=[0].concat(t)),r=sr(r),t=sr(t);!(t[0]||128&t[1]);)t=t.slice(1);var n=[2];dr(n,r.length),(n=n.concat(r)).push(2),dr(n,t.length);var i=n.concat(t),o=[48];return dr(o,i.length),o=o.concat(i),Ue.encode(o,e)};var lr=function(){throw new Error("unsupported")},ur=Ue.assert;function cr(e){if(!(this instanceof cr))return new cr(e);"string"==typeof e&&(ur(Object.prototype.hasOwnProperty.call(_e,e),"Unknown curve "+e),e=_e[e]),e instanceof _e.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var hr=cr;cr.prototype.keyPair=function(e){return new tr(this,e)},cr.prototype.keyFromPrivate=function(e,r){return tr.fromPrivate(this,e,r)},cr.prototype.keyFromPublic=function(e,r){return tr.fromPublic(this,e,r)},cr.prototype.genKeyPair=function(e){e||(e={});for(var r=new $e({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||lr(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),t=this.n.byteLength(),n=this.n.sub(new d.BN(2));;){var i=new d.BN(r.generate(t));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},cr.prototype._truncateToN=function(e,r){var t=8*e.byteLength()-this.n.bitLength();return t>0&&(e=e.ushrn(t)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e},cr.prototype.sign=function(e,r,t,n){"object"==typeof t&&(n=t,t=null),n||(n={}),r=this.keyFromPrivate(r,t),e=this._truncateToN(new d.BN(e,16));for(var i=this.n.byteLength(),o=r.getPrivate().toArray("be",i),a=e.toArray("be",i),f=new $e({hash:this.hash,entropy:o,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),s=this.n.sub(new d.BN(1)),l=0;;l++){var u=n.k?n.k(l):new d.BN(f.generate(this.n.byteLength()));if(!((u=this._truncateToN(u,!0)).cmpn(1)<=0||u.cmp(s)>=0)){var c=this.g.mul(u);if(!c.isInfinity()){var h=c.getX(),p=h.umod(this.n);if(0!==p.cmpn(0)){var A=u.invm(this.n).mul(p.mul(r.getPrivate()).iadd(e));if(0!==(A=A.umod(this.n)).cmpn(0)){var g=(c.getY().isOdd()?1:0)|(0!==h.cmp(p)?2:0);return n.canonical&&A.cmp(this.nh)>0&&(A=this.n.sub(A),g^=1),new or({r:p,s:A,recoveryParam:g})}}}}}},cr.prototype.verify=function(e,r,t,n){e=this._truncateToN(new d.BN(e,16)),t=this.keyFromPublic(t,n);var i=(r=new or(r,"hex")).r,o=r.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,f=o.invm(this.n),s=f.mul(e).umod(this.n),l=f.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(s,t.getPublic(),l)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(s,t.getPublic(),l)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},cr.prototype.recoverPubKey=function(e,r,t,n){ur((3&t)===t,"The recovery param is more than two bits"),r=new or(r,n);var i=this.n,o=new d.BN(e),a=r.r,f=r.s,s=1&t,l=t>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&l)throw new Error("Unable to find sencond key candinate");a=l?this.curve.pointFromX(a.add(this.curve.n),s):this.curve.pointFromX(a,s);var u=r.r.invm(i),c=i.sub(o).mul(u).umod(i),h=f.mul(u).umod(i);return this.g.mulAdd(c,a,h)},cr.prototype.getKeyRecoveryParam=function(e,r,t,n){if(null!==(r=new or(r,n)).recoveryParam)return r.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,r,i)}catch(e){continue}if(o.eq(t))return i}throw new Error("Unable to find valid recovery factor")};var pr=Te((function(e,r){var t=r;t.version="6.5.4",t.utils=Ue,t.rand=function(){throw new Error("unsupported")},t.curve=Xe,t.curves=_e,t.ec=hr,t.eddsa=null})).ec;const Ar=new a.Logger("signing-key/5.7.0");let gr=null;function mr(){return gr||(gr=new pr("secp256k1")),gr}class yr{constructor(e){s.defineReadOnly(this,"curve","secp256k1"),s.defineReadOnly(this,"privateKey",i.hexlify(e)),32!==i.hexDataLength(this.privateKey)&&Ar.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const r=mr().keyFromPrivate(i.arrayify(this.privateKey));s.defineReadOnly(this,"publicKey","0x"+r.getPublic(!1,"hex")),s.defineReadOnly(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),s.defineReadOnly(this,"_isSigningKey",!0)}_addPoint(e){const r=mr().keyFromPublic(i.arrayify(this.publicKey)),t=mr().keyFromPublic(i.arrayify(e));return"0x"+r.pub.add(t.pub).encodeCompressed("hex")}signDigest(e){const r=mr().keyFromPrivate(i.arrayify(this.privateKey)),t=i.arrayify(e);32!==t.length&&Ar.throwArgumentError("bad digest length","digest",e);const n=r.sign(t,{canonical:!0});return i.splitSignature({recoveryParam:n.recoveryParam,r:i.hexZeroPad("0x"+n.r.toString(16),32),s:i.hexZeroPad("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const r=mr().keyFromPrivate(i.arrayify(this.privateKey)),t=mr().keyFromPublic(i.arrayify(vr(e)));return i.hexZeroPad("0x"+r.derive(t.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function br(e,r){const t=i.splitSignature(r),n={r:i.arrayify(t.r),s:i.arrayify(t.s)};return"0x"+mr().recoverPubKey(i.arrayify(e),n,t.recoveryParam).encode("hex",!1)}function vr(e,r){const t=i.arrayify(e);if(32===t.length){const e=new yr(t);return r?"0x"+mr().keyFromPrivate(t).getPublic(!0,"hex"):e.publicKey}return 33===t.length?r?i.hexlify(t):"0x"+mr().keyFromPublic(t).getPublic(!1,"hex"):65===t.length?r?"0x"+mr().keyFromPublic(t).getPublic(!0,"hex"):i.hexlify(t):Ar.throwArgumentError("invalid public or private key","key","[REDACTED]")}var wr=Object.freeze({__proto__:null,SigningKey:yr,recoverPublicKey:br,computePublicKey:vr});const Sr=new a.Logger("wordlists/5.7.0");class Br{constructor(e){Sr.checkAbstract(new.target,Br),s.defineReadOnly(this,"locale",e)}split(e){return e.toLowerCase().split(/ +/g)}join(e){return e.join(" ")}static check(e){const r=[];for(let t=0;t<2048;t++){const n=e.getWord(t);if(t!==e.getWordIndex(n))return"0x";r.push(n)}return a.id(r.join("\n")+"\n")}static register(e,r){r||(r=e.locale)}}let Cr=null;function Er(e){if(null==Cr&&(Cr="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==Br.check(e)))throw Cr=null,new Error("BIP39 Wordlist for en (English) FAILED")}const xr=new class extends Br{constructor(){super("en")}getWord(e){return Er(this),Cr[e]}getWordIndex(e){return Er(this),Cr.indexOf(e)}};Br.register(xr);const Ir={en:xr},Fr=new a.Logger("hdnode/5.7.0"),Pr=a.BigNumber.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Dr=a.toUtf8Bytes("Bitcoin seed"),Mr=2147483648;function Rr(e){return(1<<e)-1<<8-e}function Tr(e){return i.hexZeroPad(i.hexlify(e),32)}function kr(e){return Ee.encode(i.concat([e,i.hexDataSlice(De(De(e)),0,4)]))}function Nr(e){if(null==e)return Ir.en;if("string"==typeof e){const r=Ir[e];return null==r&&Fr.throwArgumentError("unknown locale","wordlist",e),r}return e}const Or={},Ur="m/44'/60'/0'/0/0";class Lr{constructor(e,r,t,n,o,a,f,d){if(e!==Or)throw new Error("HDNode constructor cannot be called directly");if(r){const e=new yr(r);s.defineReadOnly(this,"privateKey",e.privateKey),s.defineReadOnly(this,"publicKey",e.compressedPublicKey)}else s.defineReadOnly(this,"privateKey",null),s.defineReadOnly(this,"publicKey",i.hexlify(t));s.defineReadOnly(this,"parentFingerprint",n),s.defineReadOnly(this,"fingerprint",i.hexDataSlice(Pe(De(this.publicKey)),0,4)),s.defineReadOnly(this,"address",u.computeAddress(this.publicKey)),s.defineReadOnly(this,"chainCode",o),s.defineReadOnly(this,"index",a),s.defineReadOnly(this,"depth",f),null==d?(s.defineReadOnly(this,"mnemonic",null),s.defineReadOnly(this,"path",null)):"string"==typeof d?(s.defineReadOnly(this,"mnemonic",null),s.defineReadOnly(this,"path",d)):(s.defineReadOnly(this,"mnemonic",d),s.defineReadOnly(this,"path",d.path))}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return kr(i.concat([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",i.hexlify(this.depth),this.parentFingerprint,i.hexZeroPad(i.hexlify(this.index),4),this.chainCode,null!=this.privateKey?i.concat(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new Lr(Or,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let r=this.path;r&&(r+="/"+(2147483647&e));const t=new Uint8Array(37);if(e&Mr){if(!this.privateKey)throw new Error("cannot derive child of neutered node");t.set(i.arrayify(this.privateKey),1),r&&(r+="'")}else t.set(i.arrayify(this.publicKey));for(let r=24;r>=0;r-=8)t[33+(r>>3)]=e>>24-r&255;const n=i.arrayify(Re(exports.SupportedAlgorithm.sha512,this.chainCode,t)),o=n.slice(0,32),f=n.slice(32);let s=null,d=null;if(this.privateKey)s=Tr(a.BigNumber.from(o).add(this.privateKey).mod(Pr));else{d=new yr(i.hexlify(o))._addPoint(this.publicKey)}let l=r;const u=this.mnemonic;return u&&(l=Object.freeze({phrase:u.phrase,path:r,locale:u.locale||"en"})),new Lr(Or,s,d,this.fingerprint,Tr(f),e,this.depth+1,l)}derivePath(e){const r=e.split("/");if(0===r.length||"m"===r[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===r[0]&&r.shift();let t=this;for(let e=0;e<r.length;e++){const n=r[e];if(n.match(/^[0-9]+'$/)){const e=parseInt(n.substring(0,n.length-1));if(e>=Mr)throw new Error("invalid path index - "+n);t=t._derive(Mr+e)}else{if(!n.match(/^[0-9]+$/))throw new Error("invalid path component - "+n);{const e=parseInt(n);if(e>=Mr)throw new Error("invalid path index - "+n);t=t._derive(e)}}}return t}static _fromSeed(e,r){const t=i.arrayify(e);if(t.length<16||t.length>64)throw new Error("invalid seed");const n=i.arrayify(Re(exports.SupportedAlgorithm.sha512,Dr,t));return new Lr(Or,Tr(n.slice(0,32)),null,"0x00000000",Tr(n.slice(32)),0,0,r)}static fromMnemonic(e,r,t){return e=Hr(qr(e,t=Nr(t)),t),Lr._fromSeed(Kr(e,r),{phrase:e,path:"m",locale:t.locale})}static fromSeed(e){return Lr._fromSeed(e,null)}static fromExtendedKey(e){const r=Ee.decode(e);82===r.length&&kr(r.slice(0,78))===e||Fr.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const t=r[4],n=i.hexlify(r.slice(5,9)),o=parseInt(i.hexlify(r.slice(9,13)).substring(2),16),a=i.hexlify(r.slice(13,45)),f=r.slice(45,78);switch(i.hexlify(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new Lr(Or,null,i.hexlify(f),n,a,o,t,null);case"0x0488ade4":case"0x04358394 ":if(0!==f[0])break;return new Lr(Or,i.hexlify(f.slice(1)),null,n,a,o,t,null)}return Fr.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function Kr(e,r){r||(r="");const t=a.toUtf8Bytes("mnemonic"+r,a.UnicodeNormalizationForm.NFKD);return function(e,r,t,n,o){let a;e=i.arrayify(e),r=i.arrayify(r);let f=1;const s=new Uint8Array(n),d=new Uint8Array(r.length+4);let l,u;d.set(r);for(let c=1;c<=f;c++){d[r.length]=c>>24&255,d[r.length+1]=c>>16&255,d[r.length+2]=c>>8&255,d[r.length+3]=255&c;let h=i.arrayify(Re(o,e,d));a||(a=h.length,u=new Uint8Array(a),f=Math.ceil(n/a),l=n-(f-1)*a),u.set(h);for(let r=1;r<t;r++){h=i.arrayify(Re(o,e,h));for(let e=0;e<a;e++)u[e]^=h[e]}const p=(c-1)*a,A=c===f?l:a;s.set(i.arrayify(u).slice(0,A),p)}return i.hexlify(s)}(a.toUtf8Bytes(e,a.UnicodeNormalizationForm.NFKD),t,2048,64,"sha512")}function qr(e,r){r=Nr(r),Fr.checkNormalize();const t=r.split(e);if(t.length%3!=0)throw new Error("invalid mnemonic");const n=i.arrayify(new Uint8Array(Math.ceil(11*t.length/8)));let o=0;for(let e=0;e<t.length;e++){let i=r.getWordIndex(t[e].normalize("NFKD"));if(-1===i)throw new Error("invalid mnemonic");for(let e=0;e<11;e++)i&1<<10-e&&(n[o>>3]|=1<<7-o%8),o++}const a=32*t.length/3,f=Rr(t.length/3);if((i.arrayify(De(n.slice(0,a/8)))[0]&f)!==(n[n.length-1]&f))throw new Error("invalid checksum");return i.hexlify(n.slice(0,a/8))}function Hr(e,r){if(r=Nr(r),(e=i.arrayify(e)).length%4!=0||e.length<16||e.length>32)throw new Error("invalid entropy");const t=[0];let n=11;for(let r=0;r<e.length;r++)n>8?(t[t.length-1]<<=8,t[t.length-1]|=e[r],n-=8):(t[t.length-1]<<=n,t[t.length-1]|=e[r]>>8-n,t.push(e[r]&(1<<8-n)-1),n+=3);const o=e.length/4,a=i.arrayify(De(e))[0]&Rr(o);return t[t.length-1]<<=o,t[t.length-1]|=a>>8-o,r.join(t.map((e=>r.getWord(e))))}function zr(e,r){try{return qr(e,r),!0}catch(e){}return!1}function Gr(e){return("number"!=typeof e||e<0||e>=Mr||e%1)&&Fr.throwArgumentError("invalid account index","index",e),`m/44'/60'/${e}'/0/0`}var Qr=Object.freeze({__proto__:null,defaultPath:Ur,HDNode:Lr,mnemonicToSeed:Kr,mnemonicToEntropy:qr,entropyToMnemonic:Hr,isValidMnemonic:zr,getAccountPath:Gr});const Wr=new a.Logger("random/5.7.0");const Jr=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}();let Yr=Jr.crypto||Jr.msCrypto;function Vr(e){(e<=0||e>1024||e%1||e!=e)&&Wr.throwArgumentError("invalid length","length",e);const r=new Uint8Array(e);return Yr.getRandomValues(r),i.arrayify(r)}function jr(e){for(let r=(e=e.slice()).length-1;r>0;r--){const t=Math.floor(Math.random()*(r+1)),n=e[r];e[r]=e[t],e[t]=n}return e}Yr&&Yr.getRandomValues||(Wr.warn("WARNING: Missing strong random number source"),Yr={getRandomValues:function(e){return Wr.throwError("no secure random source avaialble",a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});var Xr=function(e,r,t,n){return new(t||(t=Promise))((function(i,o){function a(e){try{s(n.next(e))}catch(e){o(e)}}function f(e){try{s(n.throw(e))}catch(e){o(e)}}function s(e){var r;e.done?i(e.value):(r=e.value,r instanceof t?r:new t((function(e){e(r)}))).then(a,f)}s((n=n.apply(e,r||[])).next())}))};const _r=new a.Logger("wallet/5.7.0");class Zr extends r.Signer{constructor(e,r){if(super(),null!=(o=e)&&i.isHexString(o.privateKey,32)&&null!=o.address){const r=new yr(e.privateKey);if(s.defineReadOnly(this,"_signingKey",(()=>r)),s.defineReadOnly(this,"address",u.computeAddress(this.publicKey)),this.address!==t.getAddress(e.address)&&_r.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){const r=e.mnemonic;return r&&r.phrase}(e)){const r=e.mnemonic;s.defineReadOnly(this,"_mnemonic",(()=>({phrase:r.phrase,path:r.path||Ur,locale:r.locale||"en"})));const t=this.mnemonic,n=Lr.fromMnemonic(t.phrase,null,t.locale).derivePath(t.path);u.computeAddress(n.privateKey)!==this.address&&_r.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else s.defineReadOnly(this,"_mnemonic",(()=>null))}else{if(yr.isSigningKey(e))"secp256k1"!==e.curve&&_r.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),s.defineReadOnly(this,"_signingKey",(()=>e));else{"string"==typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);const r=new yr(e);s.defineReadOnly(this,"_signingKey",(()=>r))}s.defineReadOnly(this,"_mnemonic",(()=>null)),s.defineReadOnly(this,"address",u.computeAddress(this.publicKey))}var o;r&&!n.Provider.isProvider(r)&&_r.throwArgumentError("invalid provider","provider",r),s.defineReadOnly(this,"provider",r||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new Zr(this,e)}signTransaction(e){return s.resolveProperties(e).then((r=>{null!=r.from&&(t.getAddress(r.from)!==this.address&&_r.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete r.from);const n=this._signingKey().signDigest(o.keccak256(u.serialize(r)));return u.serialize(r,n)}))}signMessage(e){return Xr(this,void 0,void 0,(function*(){return i.joinSignature(this._signingKey().signDigest(Se(e)))}))}_signTypedData(e,r,t){return Xr(this,void 0,void 0,(function*(){const n=yield f.TypedDataEncoder.resolveNames(e,r,t,(e=>(null==this.provider&&_r.throwError("cannot resolve ENS names without a provider",a.Logger.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),this.provider.resolveName(e))));return i.joinSignature(this._signingKey().signDigest(f.TypedDataEncoder.hash(n.domain,r,n.value)))}))}encrypt(e,r,t){if("function"!=typeof r||t||(t=r,r={}),t&&"function"!=typeof t)throw new Error("invalid callback");return r||(r={}),c.encryptKeystore(this,e,r,t)}static createRandom(e){let r=Vr(16);e||(e={}),e.extraEntropy&&(r=i.arrayify(i.hexDataSlice(o.keccak256(i.concat([r,e.extraEntropy])),0,16)));const t=Hr(r,e.locale);return Zr.fromMnemonic(t,e.path,e.locale)}static fromEncryptedJson(e,r,t){return c.decryptJsonWallet(e,r,t).then((e=>new Zr(e)))}static fromEncryptedJsonSync(e,r){return new Zr(c.decryptJsonWalletSync(e,r))}static fromMnemonic(e,r,t){return r||(r=Ur),new Zr(Lr.fromMnemonic(e,null,t).derivePath(r))}}function $r(e,r){return u.recoverAddress(Se(e),r)}function et(e,r,t,n){return u.recoverAddress(f.TypedDataEncoder.hash(e,r,t),n)}var rt=Object.freeze({__proto__:null,Wallet:Zr,verifyMessage:$r,verifyTypedData:et});const tt=new RegExp("^bytes([0-9]+)$"),nt=new RegExp("^(u?int)([0-9]*)$"),it=new RegExp("^(.*)\\[([0-9]*)\\]$"),ot="0000000000000000000000000000000000000000000000000000000000000000",at=new a.Logger("solidity/5.7.0");function ft(e,r,t){switch(e){case"address":return t?i.zeroPad(r,32):i.arrayify(r);case"string":return a.toUtf8Bytes(r);case"bytes":return i.arrayify(r);case"bool":return r=r?"0x01":"0x00",t?i.zeroPad(r,32):i.arrayify(r)}let n=e.match(nt);if(n){let o=parseInt(n[2]||"256");return(n[2]&&String(o)!==n[2]||o%8!=0||0===o||o>256)&&at.throwArgumentError("invalid number type","type",e),t&&(o=256),r=a.BigNumber.from(r).toTwos(o),i.zeroPad(r,o/8)}if(n=e.match(tt),n){const o=parseInt(n[1]);return(String(o)!==n[1]||0===o||o>32)&&at.throwArgumentError("invalid bytes type","type",e),i.arrayify(r).byteLength!==o&&at.throwArgumentError(`invalid value for ${e}`,"value",r),t?i.arrayify((r+ot).substring(0,66)):r}if(n=e.match(it),n&&Array.isArray(r)){const t=n[1];parseInt(n[2]||String(r.length))!=r.length&&at.throwArgumentError(`invalid array length for ${e}`,"value",r);const o=[];return r.forEach((function(e){o.push(ft(t,e,!0))})),i.concat(o)}return at.throwArgumentError("invalid type","type",e)}function st(e,r){e.length!=r.length&&at.throwArgumentError("wrong number of values; expected ${ types.length }","values",r);const t=[];return e.forEach((function(e,n){t.push(ft(e,r[n]))})),i.hexlify(i.concat(t))}function dt(e,r){return o.keccak256(st(e,r))}function lt(e,r){return De(st(e,r))}var ut=Object.freeze({__proto__:null,pack:st,keccak256:dt,sha256:lt});const ct=new a.Logger("units/5.7.0"),ht=["wei","kwei","mwei","gwei","szabo","finney","ether"];function pt(e){const r=String(e).split(".");(r.length>2||!r[0].match(/^-?[0-9]*$/)||r[1]&&!r[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&ct.throwArgumentError("invalid value","value",e);let t=r[0],n="";for("-"===t.substring(0,1)&&(n="-",t=t.substring(1));"0"===t.substring(0,1);)t=t.substring(1);""===t&&(t="0");let i="";for(2===r.length&&(i="."+(r[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);const o=[];for(;t.length;){if(t.length<=3){o.unshift(t);break}{const e=t.length-3;o.unshift(t.substring(e)),t=t.substring(0,e)}}return n+o.join(",")+i}function At(e,r){if("string"==typeof r){const e=ht.indexOf(r);-1!==e&&(r=3*e)}return I(e,null!=r?r:18)}function gt(e,r){if("string"!=typeof e&&ct.throwArgumentError("value must be a string","value",e),"string"==typeof r){const e=ht.indexOf(r);-1!==e&&(r=3*e)}return F(e,null!=r?r:18)}function mt(e){return At(e,18)}function yt(e){return gt(e,18)}var bt=Object.freeze({__proto__:null,commify:pt,formatUnits:At,parseUnits:gt,formatEther:mt,parseEther:yt}),vt=Object.freeze({__proto__:null,AbiCoder:A.AbiCoder,defaultAbiCoder:A.defaultAbiCoder,Fragment:A.Fragment,ConstructorFragment:A.ConstructorFragment,ErrorFragment:A.ErrorFragment,EventFragment:A.EventFragment,FunctionFragment:A.FunctionFragment,ParamType:A.ParamType,FormatTypes:A.FormatTypes,checkResultErrors:A.checkResultErrors,Logger:a.Logger,RLP:g.lib_esm,_fetchData:f._fetchData,fetchJson:f.fetchJson,poll:f.poll,checkProperties:s.checkProperties,deepCopy:s.deepCopy,defineReadOnly:s.defineReadOnly,getStatic:s.getStatic,resolveProperties:s.resolveProperties,shallowCopy:s.shallowCopy,arrayify:i.arrayify,concat:i.concat,stripZeros:i.stripZeros,zeroPad:i.zeroPad,isBytes:i.isBytes,isBytesLike:i.isBytesLike,defaultPath:Ur,HDNode:Lr,SigningKey:yr,Interface:A.Interface,LogDescription:A.LogDescription,TransactionDescription:A.TransactionDescription,base58:Ee,base64:J,hexlify:i.hexlify,isHexString:i.isHexString,hexConcat:i.hexConcat,hexStripZeros:i.hexStripZeros,hexValue:i.hexValue,hexZeroPad:i.hexZeroPad,hexDataLength:i.hexDataLength,hexDataSlice:i.hexDataSlice,nameprep:W,_toEscapedUtf8String:a._toEscapedUtf8String,toUtf8Bytes:a.toUtf8Bytes,toUtf8CodePoints:a.toUtf8CodePoints,toUtf8String:a.toUtf8String,Utf8ErrorFuncs:a.Utf8ErrorFuncs,formatBytes32String:T,parseBytes32String:k,dnsEncode:ve,hashMessage:Se,namehash:be,isValidName:ye,id:a.id,_TypedDataEncoder:f.TypedDataEncoder,getAddress:t.getAddress,getIcapAddress:t.getIcapAddress,getContractAddress:t.getContractAddress,getCreate2Address:t.getCreate2Address,isAddress:t.isAddress,formatEther:mt,parseEther:yt,formatUnits:At,parseUnits:gt,commify:pt,computeHmac:Re,keccak256:o.keccak256,ripemd160:Pe,sha256:De,sha512:Me,randomBytes:Vr,shuffled:jr,solidityPack:st,solidityKeccak256:dt,soliditySha256:lt,splitSignature:i.splitSignature,joinSignature:i.joinSignature,accessListify:u.accessListify,parseTransaction:u.parse,serializeTransaction:u.serialize,TransactionTypes:u.TransactionTypes,getJsonWalletAddress:c.getJsonWalletAddress,computeAddress:u.computeAddress,recoverAddress:u.recoverAddress,computePublicKey:vr,recoverPublicKey:br,verifyMessage:$r,verifyTypedData:et,getAccountPath:Gr,mnemonicToEntropy:qr,entropyToMnemonic:Hr,isValidMnemonic:zr,mnemonicToSeed:Kr,get SupportedAlgorithm(){return exports.SupportedAlgorithm},get UnicodeNormalizationForm(){return a.UnicodeNormalizationForm},get Utf8ErrorReason(){return a.Utf8ErrorReason},Indexed:A.Indexed});const wt="ethers/5.7.2",St=new a.Logger(wt);var Bt=Object.freeze({__proto__:null,Signer:r.Signer,Wallet:Zr,VoidSigner:r.VoidSigner,getDefaultProvider:p.getDefaultProvider,providers:b,BaseContract:e.BaseContract,Contract:e.Contract,ContractFactory:e.ContractFactory,BigNumber:a.BigNumber,FixedNumber:D,constants:y,get errors(){return a.ErrorCode},logger:St,utils:vt,wordlists:Ir,version:wt,Wordlist:Br});exports.FixedNumber=D,exports.Wallet=Zr,exports.Wordlist=Br,exports.computeHmac=Re,exports.dnsEncode=ve,exports.ensNormalize=function(e){return me(e).map((e=>a.toUtf8String(e))).join(".")},exports.ethers=Bt,exports.formatBytes32String=T,exports.hashMessage=Se,exports.isValidName=ye,exports.lib_esm=J,exports.lib_esm$1=Ie,exports.lib_esm$2=Qr,exports.lib_esm$3=ut,exports.lib_esm$4=wr,exports.lib_esm$5=bt,exports.lib_esm$6=rt,exports.logger=St,exports.messagePrefix=we,exports.namehash=be,exports.nameprep=W,exports.parseBytes32String=k,exports.randomBytes=Vr,exports.ripemd160=Pe,exports.sha256=De,exports.sha512=Me,exports.shuffled=jr,exports.utils=vt,exports.version=wt,exports.wordlists=Ir;
|
package/dist/cjs/id-48662e0b.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var r=require("./bn-6c93fb4c.cjs"),e=require("@ethersproject/bytes"),t=require("./index-fd18f5c9.cjs");let o=!1,n=!1;const s={debug:1,default:2,info:2,warning:3,error:4,off:5};let i=s.default,u=null;const a=function(){try{const r=[];if(["NFD","NFC","NFKD","NFKC"].forEach((e=>{try{if("test"!=="test".normalize(e))throw new Error("bad normalize")}catch(t){r.push(e)}})),r.length)throw new Error("missing "+r.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(r){return r.message}return null}();var E,N;!function(r){r.DEBUG="DEBUG",r.INFO="INFO",r.WARNING="WARNING",r.ERROR="ERROR",r.OFF="OFF"}(E||(E={})),exports.ErrorCode=void 0,(N=exports.ErrorCode||(exports.ErrorCode={})).UNKNOWN_ERROR="UNKNOWN_ERROR",N.NOT_IMPLEMENTED="NOT_IMPLEMENTED",N.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",N.NETWORK_ERROR="NETWORK_ERROR",N.SERVER_ERROR="SERVER_ERROR",N.TIMEOUT="TIMEOUT",N.BUFFER_OVERRUN="BUFFER_OVERRUN",N.NUMERIC_FAULT="NUMERIC_FAULT",N.MISSING_NEW="MISSING_NEW",N.INVALID_ARGUMENT="INVALID_ARGUMENT",N.MISSING_ARGUMENT="MISSING_ARGUMENT",N.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",N.CALL_EXCEPTION="CALL_EXCEPTION",N.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",N.NONCE_EXPIRED="NONCE_EXPIRED",N.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",N.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",N.TRANSACTION_REPLACED="TRANSACTION_REPLACED",N.ACTION_REJECTED="ACTION_REJECTED";const c="0123456789abcdef";class h{constructor(r){Object.defineProperty(this,"version",{enumerable:!0,value:r,writable:!1})}_log(r,e){const t=r.toLowerCase();null==s[t]&&this.throwArgumentError("invalid log level name","logLevel",r),i>s[t]||console.log.apply(console,e)}debug(...r){this._log(h.levels.DEBUG,r)}info(...r){this._log(h.levels.INFO,r)}warn(...r){this._log(h.levels.WARNING,r)}makeError(r,e,t){if(n)return this.makeError("censored error",e,{});e||(e=h.errors.UNKNOWN_ERROR),t||(t={});const o=[];Object.keys(t).forEach((r=>{const e=t[r];try{if(e instanceof Uint8Array){let t="";for(let r=0;r<e.length;r++)t+=c[e[r]>>4],t+=c[15&e[r]];o.push(r+"=Uint8Array(0x"+t+")")}else o.push(r+"="+JSON.stringify(e))}catch(e){o.push(r+"="+JSON.stringify(t[r].toString()))}})),o.push(`code=${e}`),o.push(`version=${this.version}`);const s=r;let i="";switch(e){case exports.ErrorCode.NUMERIC_FAULT:{i="NUMERIC_FAULT";const e=r;switch(e){case"overflow":case"underflow":case"division-by-zero":i+="-"+e;break;case"negative-power":case"negative-width":i+="-unsupported";break;case"unbound-bitwise-result":i+="-unbound-result"}break}case exports.ErrorCode.CALL_EXCEPTION:case exports.ErrorCode.INSUFFICIENT_FUNDS:case exports.ErrorCode.MISSING_NEW:case exports.ErrorCode.NONCE_EXPIRED:case exports.ErrorCode.REPLACEMENT_UNDERPRICED:case exports.ErrorCode.TRANSACTION_REPLACED:case exports.ErrorCode.UNPREDICTABLE_GAS_LIMIT:i=e}i&&(r+=" [ See: https://links.ethers.org/v5-errors-"+i+" ]"),o.length&&(r+=" ("+o.join(", ")+")");const u=new Error(r);return u.reason=s,u.code=e,Object.keys(t).forEach((function(r){u[r]=t[r]})),u}throwError(r,e,t){throw this.makeError(r,e,t)}throwArgumentError(r,e,t){return this.throwError(r,h.errors.INVALID_ARGUMENT,{argument:e,value:t})}assert(r,e,t,o){r||this.throwError(e,t,o)}assertArgument(r,e,t,o){r||this.throwArgumentError(e,t,o)}checkNormalize(r){a&&this.throwError("platform missing String.prototype.normalize",h.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:a})}checkSafeUint53(r,e){"number"==typeof r&&(null==e&&(e="value not safe"),(r<0||r>=9007199254740991)&&this.throwError(e,h.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:r}),r%1&&this.throwError(e,h.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:r}))}checkArgumentCount(r,e,t){t=t?": "+t:"",r<e&&this.throwError("missing argument"+t,h.errors.MISSING_ARGUMENT,{count:r,expectedCount:e}),r>e&&this.throwError("too many arguments"+t,h.errors.UNEXPECTED_ARGUMENT,{count:r,expectedCount:e})}checkNew(r,e){r!==Object&&null!=r||this.throwError("missing new",h.errors.MISSING_NEW,{name:e.name})}checkAbstract(r,e){r===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",h.errors.UNSUPPORTED_OPERATION,{name:r.name,operation:"new"}):r!==Object&&null!=r||this.throwError("missing new",h.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return u||(u=new h("logger/5.7.0")),u}static setCensorship(r,e){if(!r&&e&&this.globalLogger().throwError("cannot permanently disable censorship",h.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o){if(!r)return;this.globalLogger().throwError("error censorship permanent",h.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}n=!!r,o=!!e}static setLogLevel(r){const e=s[r.toLowerCase()];null!=e?i=e:h.globalLogger().warn("invalid log level - "+r)}static from(r){return new h(r)}}h.errors=exports.ErrorCode,h.levels=E;var l=Object.freeze({__proto__:null,get LogLevel(){return E},get ErrorCode(){return exports.ErrorCode},Logger:h});const g="bignumber/5.7.0";var f=r.BN.BN;const p=new h(g),R={},m=9007199254740991;let U=!1;class _{constructor(r,e){r!==R&&p.throwError("cannot call constructor directly; use BigNumber.from",h.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(r){return d(T(this).fromTwos(r))}toTwos(r){return d(T(this).toTwos(r))}abs(){return"-"===this._hex[0]?_.from(this._hex.substring(1)):this}add(r){return d(T(this).add(T(r)))}sub(r){return d(T(this).sub(T(r)))}div(r){return _.from(r).isZero()&&C("division-by-zero","div"),d(T(this).div(T(r)))}mul(r){return d(T(this).mul(T(r)))}mod(r){const e=T(r);return e.isNeg()&&C("division-by-zero","mod"),d(T(this).umod(e))}pow(r){const e=T(r);return e.isNeg()&&C("negative-power","pow"),d(T(this).pow(e))}and(r){const e=T(r);return(this.isNegative()||e.isNeg())&&C("unbound-bitwise-result","and"),d(T(this).and(e))}or(r){const e=T(r);return(this.isNegative()||e.isNeg())&&C("unbound-bitwise-result","or"),d(T(this).or(e))}xor(r){const e=T(r);return(this.isNegative()||e.isNeg())&&C("unbound-bitwise-result","xor"),d(T(this).xor(e))}mask(r){return(this.isNegative()||r<0)&&C("negative-width","mask"),d(T(this).maskn(r))}shl(r){return(this.isNegative()||r<0)&&C("negative-width","shl"),d(T(this).shln(r))}shr(r){return(this.isNegative()||r<0)&&C("negative-width","shr"),d(T(this).shrn(r))}eq(r){return T(this).eq(T(r))}lt(r){return T(this).lt(T(r))}lte(r){return T(this).lte(T(r))}gt(r){return T(this).gt(T(r))}gte(r){return T(this).gte(T(r))}isNegative(){return"-"===this._hex[0]}isZero(){return T(this).isZero()}toNumber(){try{return T(this).toNumber()}catch(r){C("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(r){}return p.throwError("this platform does not support BigInt",h.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?U||(U=!0,p.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?p.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",h.errors.UNEXPECTED_ARGUMENT,{}):p.throwError("BigNumber.toString does not accept parameters",h.errors.UNEXPECTED_ARGUMENT,{})),T(this).toString(10)}toHexString(){return this._hex}toJSON(r){return{type:"BigNumber",hex:this.toHexString()}}static from(r){if(r instanceof _)return r;if("string"==typeof r)return r.match(/^-?0x[0-9a-f]+$/i)?new _(R,I(r)):r.match(/^-?[0-9]+$/)?new _(R,I(new f(r))):p.throwArgumentError("invalid BigNumber string","value",r);if("number"==typeof r)return r%1&&C("underflow","BigNumber.from",r),(r>=m||r<=-m)&&C("overflow","BigNumber.from",r),_.from(String(r));const t=r;if("bigint"==typeof t)return _.from(t.toString());if(e.isBytes(t))return _.from(e.hexlify(t));if(t)if(t.toHexString){const r=t.toHexString();if("string"==typeof r)return _.from(r)}else{let r=t._hex;if(null==r&&"BigNumber"===t.type&&(r=t.hex),"string"==typeof r&&(e.isHexString(r)||"-"===r[0]&&e.isHexString(r.substring(1))))return _.from(r)}return p.throwArgumentError("invalid BigNumber value","value",r)}static isBigNumber(r){return!(!r||!r._isBigNumber)}}function I(r){if("string"!=typeof r)return I(r.toString(16));if("-"===r[0])return"-"===(r=r.substring(1))[0]&&p.throwArgumentError("invalid hex","value",r),"0x00"===(r=I(r))?r:"-"+r;if("0x"!==r.substring(0,2)&&(r="0x"+r),"0x"===r)return"0x00";for(r.length%2&&(r="0x0"+r.substring(2));r.length>4&&"0x00"===r.substring(0,4);)r="0x"+r.substring(4);return r}function d(r){return _.from(I(r))}function T(r){const e=_.from(r).toHexString();return"-"===e[0]?new f("-"+e.substring(3),16):new f(e.substring(2),16)}function C(r,e,t){const o={fault:r,operation:e};return null!=t&&(o.value=t),p.throwError(r,h.errors.NUMERIC_FAULT,o)}const O=new h("strings/5.7.0");var b,S;function x(r,e,t,o,n){if(r===exports.Utf8ErrorReason.BAD_PREFIX||r===exports.Utf8ErrorReason.UNEXPECTED_CONTINUE){let r=0;for(let o=e+1;o<t.length&&t[o]>>6==2;o++)r++;return r}return r===exports.Utf8ErrorReason.OVERRUN?t.length-e-1:0}exports.UnicodeNormalizationForm=void 0,(b=exports.UnicodeNormalizationForm||(exports.UnicodeNormalizationForm={})).current="",b.NFC="NFC",b.NFD="NFD",b.NFKC="NFKC",b.NFKD="NFKD",exports.Utf8ErrorReason=void 0,(S=exports.Utf8ErrorReason||(exports.Utf8ErrorReason={})).UNEXPECTED_CONTINUE="unexpected continuation byte",S.BAD_PREFIX="bad codepoint prefix",S.OVERRUN="string overrun",S.MISSING_CONTINUE="missing continuation byte",S.OUT_OF_RANGE="out of UTF-8 range",S.UTF16_SURROGATE="UTF-16 surrogate",S.OVERLONG="overlong representation";const w=Object.freeze({error:function(r,e,t,o,n){return O.throwArgumentError(`invalid codepoint at offset ${e}; ${r}`,"bytes",t)},ignore:x,replace:function(r,e,t,o,n){return r===exports.Utf8ErrorReason.OVERLONG?(o.push(n),0):(o.push(65533),x(r,e,t))}});function A(r,t){null==t&&(t=w.error),r=e.arrayify(r);const o=[];let n=0;for(;n<r.length;){const e=r[n++];if(e>>7==0){o.push(e);continue}let s=null,i=null;if(192==(224&e))s=1,i=127;else if(224==(240&e))s=2,i=2047;else{if(240!=(248&e)){n+=t(128==(192&e)?exports.Utf8ErrorReason.UNEXPECTED_CONTINUE:exports.Utf8ErrorReason.BAD_PREFIX,n-1,r,o);continue}s=3,i=65535}if(n-1+s>=r.length){n+=t(exports.Utf8ErrorReason.OVERRUN,n-1,r,o);continue}let u=e&(1<<8-s-1)-1;for(let e=0;e<s;e++){let e=r[n];if(128!=(192&e)){n+=t(exports.Utf8ErrorReason.MISSING_CONTINUE,n,r,o),u=null;break}u=u<<6|63&e,n++}null!==u&&(u>1114111?n+=t(exports.Utf8ErrorReason.OUT_OF_RANGE,n-1-s,r,o,u):u>=55296&&u<=57343?n+=t(exports.Utf8ErrorReason.UTF16_SURROGATE,n-1-s,r,o,u):u<=i?n+=t(exports.Utf8ErrorReason.OVERLONG,n-1-s,r,o,u):o.push(u))}return o}function v(r,t=exports.UnicodeNormalizationForm.current){t!=exports.UnicodeNormalizationForm.current&&(O.checkNormalize(),r=r.normalize(t));let o=[];for(let e=0;e<r.length;e++){const t=r.charCodeAt(e);if(t<128)o.push(t);else if(t<2048)o.push(t>>6|192),o.push(63&t|128);else if(55296==(64512&t)){e++;const n=r.charCodeAt(e);if(e>=r.length||56320!=(64512&n))throw new Error("invalid utf-8 string");const s=65536+((1023&t)<<10)+(1023&n);o.push(s>>18|240),o.push(s>>12&63|128),o.push(s>>6&63|128),o.push(63&s|128)}else o.push(t>>12|224),o.push(t>>6&63|128),o.push(63&t|128)}return e.arrayify(o)}function P(r){const e="0000"+r.toString(16);return"\\u"+e.substring(e.length-4)}function F(r){return r.map((r=>r<=65535?String.fromCharCode(r):(r-=65536,String.fromCharCode(55296+(r>>10&1023),56320+(1023&r))))).join("")}exports.BigNumber=_,exports.Logger=h,exports.Utf8ErrorFuncs=w,exports._toEscapedUtf8String=function(r,e){return'"'+A(r,e).map((r=>{if(r<256){switch(r){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(r>=32&&r<127)return String.fromCharCode(r)}return r<=65535?P(r):P(55296+((r-=65536)>>10&1023))+P(56320+(1023&r))})).join("")+'"'},exports._toUtf8String=F,exports.id=function(r){return t.keccak256(v(r))},exports.isBigNumberish=function(r){return null!=r&&(_.isBigNumber(r)||"number"==typeof r&&r%1==0||"string"==typeof r&&!!r.match(/^-?[0-9]+$/)||e.isHexString(r)||"bigint"==typeof r||e.isBytes(r))},exports.lib_esm=l,exports.toUtf8Bytes=v,exports.toUtf8CodePoints=function(r,e=exports.UnicodeNormalizationForm.current){return A(v(r,e))},exports.toUtf8String=function(r,e){return F(A(r,e))},exports.version=g;
|