-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
6690-986facc7a4afa700.js.download
1 lines (1 loc) · 91.8 KB
/
6690-986facc7a4afa700.js.download
1
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6690],{62325:function(t,e,r){"use strict";r.d(e,{vU:function(){return eh}});var i,n,s,o,a,h,u,l,f=r(1581);let m=new f.Yd("bytes/5.6.0");function c(t){return t.slice||(t.slice=function(){let e=Array.prototype.slice.call(arguments);return c(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function d(t){return"number"==typeof t&&t==t&&t%1==0}function p(t,e){return"string"==typeof t&&!!t.match(/^0x[0-9A-Fa-f]*$/)&&(!e||t.length===2+2*e)}var g=r(83877),y=r.n(g);let w=new f.Yd("bytes/5.6.0");function v(t){return"number"==typeof t&&t==t&&t%1==0}function b(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t||!v(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){let r=t[e];if(!v(r)||r<0||r>=256)return!1}return!0}function M(t,e){return"string"==typeof t&&!!t.match(/^0x[0-9A-Fa-f]*$/)&&(!e||t.length===2+2*e)}let E="0123456789abcdef";var _=y().BN;let x=new f.Yd("bignumber/5.6.0"),A={},N=!1;class S{constructor(t,e){x.checkNew(new.target,S),t!==A&&x.throwError("cannot call constructor directly; use BigNumber.from",f.Yd.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return k(R(this).fromTwos(t))}toTwos(t){return k(R(this).toTwos(t))}abs(){return"-"===this._hex[0]?S.from(this._hex.substring(1)):this}add(t){return k(R(this).add(R(t)))}sub(t){return k(R(this).sub(R(t)))}div(t){let e=S.from(t);return e.isZero()&&j("division-by-zero","div"),k(R(this).div(R(t)))}mul(t){return k(R(this).mul(R(t)))}mod(t){let e=R(t);return e.isNeg()&&j("division-by-zero","mod"),k(R(this).umod(e))}pow(t){let e=R(t);return e.isNeg()&&j("negative-power","pow"),k(R(this).pow(e))}and(t){let e=R(t);return(this.isNegative()||e.isNeg())&&j("unbound-bitwise-result","and"),k(R(this).and(e))}or(t){let e=R(t);return(this.isNegative()||e.isNeg())&&j("unbound-bitwise-result","or"),k(R(this).or(e))}xor(t){let e=R(t);return(this.isNegative()||e.isNeg())&&j("unbound-bitwise-result","xor"),k(R(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&j("negative-width","mask"),k(R(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&j("negative-width","shl"),k(R(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&j("negative-width","shr"),k(R(this).shrn(t))}eq(t){return R(this).eq(R(t))}lt(t){return R(this).lt(R(t))}lte(t){return R(this).lte(R(t))}gt(t){return R(this).gt(R(t))}gte(t){return R(this).gte(R(t))}isNegative(){return"-"===this._hex[0]}isZero(){return R(this).isZero()}toNumber(){try{return R(this).toNumber()}catch(t){j("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(t){}return x.throwError("this platform does not support BigInt",f.Yd.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?N||(N=!0,x.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?x.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",f.Yd.errors.UNEXPECTED_ARGUMENT,{}):x.throwError("BigNumber.toString does not accept parameters",f.Yd.errors.UNEXPECTED_ARGUMENT,{})),R(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof S)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new S(A,O(t)):t.match(/^-?[0-9]+$/)?new S(A,O(new _(t))):x.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&j("underflow","BigNumber.from",t),(t>=9007199254740991||t<=-9007199254740991)&&j("overflow","BigNumber.from",t),S.from(String(t));if("bigint"==typeof t)return S.from(t.toString());if(b(t))return S.from(function(t,e){if(e||(e={}),"number"==typeof t){w.checkSafeUint53(t,"invalid hexlify value");let e="";for(;t;)e=E[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("bigint"==typeof t)return(t=t.toString(16)).length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),t.toHexString)return t.toHexString();if(M(t))return t.length%2&&("left"===e.hexPad?t="0x0"+t.substring(2):"right"===e.hexPad?t+="0":w.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(b(t)){let e="0x";for(let r=0;r<t.length;r++){let i=t[r];e+=E[(240&i)>>4]+E[15&i]}return e}return w.throwArgumentError("invalid hexlify value","value",t)}(t));if(t){if(t.toHexString){let e=t.toHexString();if("string"==typeof e)return S.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&(M(e)||"-"===e[0]&&M(e.substring(1))))return S.from(e)}}return x.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!!(t&&t._isBigNumber)}}function O(t){if("string"!=typeof t)return O(t.toString(16));if("-"===t[0])return("-"===(t=t.substring(1))[0]&&x.throwArgumentError("invalid hex","value",t),"0x00"===(t=O(t)))?t:"-"+t;if("0x"!==t.substring(0,2)&&(t="0x"+t),"0x"===t)return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&"0x00"===t.substring(0,4);)t="0x"+t.substring(4);return t}function k(t){return S.from(O(t))}function R(t){let e=S.from(t).toHexString();return"-"===e[0]?new _("-"+e.substring(3),16):new _(e.substring(2),16)}function j(t,e,r){let i={fault:t,operation:e};return null!=r&&(i.value=r),x.throwError(t,f.Yd.errors.NUMERIC_FAULT,i)}var T=r(91094),U=r.n(T);let F=new f.Yd("bytes/5.6.0");function C(t){return t.slice||(t.slice=function(){let e=Array.prototype.slice.call(arguments);return C(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function P(t){return"number"==typeof t&&t==t&&t%1==0}function I(t){return"0x"+U().keccak_256(function(t,e){var r,i;if(e||(e={}),"number"==typeof t){F.checkSafeUint53(t,"invalid arrayify value");let e=[];for(;t;)e.unshift(255&t),t=parseInt(String(t/256));return 0===e.length&&e.push(0),C(new Uint8Array(e))}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),t.toHexString&&(t=t.toHexString()),"string"==typeof(r=t)&&r.match(/^0x[0-9A-Fa-f]*$/)&&(!i||r.length===2+2*i)){let r=t.substring(2);r.length%2&&("left"===e.hexPad?r="0x0"+r.substring(2):"right"===e.hexPad?r+="0":F.throwArgumentError("hex data is odd-length","value",t));let i=[];for(let t=0;t<r.length;t+=2)i.push(parseInt(r.substring(t,t+2),16));return C(new Uint8Array(i))}return!function(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t||!P(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){let r=t[e];if(!P(r)||r<0||r>=256)return!1}return!0}(t)?F.throwArgumentError("invalid arrayify value","value",t):C(new Uint8Array(t))}(t))}let B=new f.Yd("address/5.6.0");function L(t){p(t,20)||B.throwArgumentError("invalid address","address",t),t=t.toLowerCase();let e=t.substring(2).split(""),r=new Uint8Array(40);for(let t=0;t<40;t++)r[t]=e[t].charCodeAt(0);let i=function(t,e){if(e||(e={}),"number"==typeof t){m.checkSafeUint53(t,"invalid arrayify value");let e=[];for(;t;)e.unshift(255&t),t=parseInt(String(t/256));return 0===e.length&&e.push(0),c(new Uint8Array(e))}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),t.toHexString&&(t=t.toHexString()),p(t)){let r=t.substring(2);r.length%2&&("left"===e.hexPad?r="0x0"+r.substring(2):"right"===e.hexPad?r+="0":m.throwArgumentError("hex data is odd-length","value",t));let i=[];for(let t=0;t<r.length;t+=2)i.push(parseInt(r.substring(t,t+2),16));return c(new Uint8Array(i))}return!function(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t||!d(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){let r=t[e];if(!d(r)||r<0||r>=256)return!1}return!0}(t)?m.throwArgumentError("invalid arrayify value","value",t):c(new Uint8Array(t))}(I(r));for(let t=0;t<40;t+=2)i[t>>1]>>4>=8&&(e[t]=e[t].toUpperCase()),(15&i[t>>1])>=8&&(e[t+1]=e[t+1].toUpperCase());return"0x"+e.join("")}let z={};for(let t=0;t<10;t++)z[String(t)]=String(t);for(let t=0;t<26;t++)z[String.fromCharCode(65+t)]=String(10+t);let V=Math.floor(Math.log10?Math.log10(9007199254740991):Math.log(9007199254740991)/Math.LN10);function D(t){let e=null;if("string"!=typeof t&&B.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=L(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&B.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){var r;for(t.substring(2,4)!==function(t){let e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map(t=>z[t]).join("");for(;e.length>=V;){let t=e.substring(0,V);e=parseInt(t,10)%97+e.substring(t.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}(t)&&B.throwArgumentError("bad icap checksum","address",t),r=t.substring(4),e=new _(r,36).toString(16);e.length<40;)e="0"+e;e=L("0x"+e)}else B.throwArgumentError("invalid address","address",t);return e}let Z=new f.Yd("bytes/5.6.0");function $(t){return!!t.toHexString}function Y(t){return t.slice||(t.slice=function(){let e=Array.prototype.slice.call(arguments);return Y(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function q(t){return"number"==typeof t&&t==t&&t%1==0}function H(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t||!q(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){let r=t[e];if(!q(r)||r<0||r>=256)return!1}return!0}function G(t,e){if(e||(e={}),"number"==typeof t){Z.checkSafeUint53(t,"invalid arrayify value");let e=[];for(;t;)e.unshift(255&t),t=parseInt(String(t/256));return 0===e.length&&e.push(0),Y(new Uint8Array(e))}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),$(t)&&(t=t.toHexString()),X(t)){let r=t.substring(2);r.length%2&&("left"===e.hexPad?r="0x0"+r.substring(2):"right"===e.hexPad?r+="0":Z.throwArgumentError("hex data is odd-length","value",t));let i=[];for(let t=0;t<r.length;t+=2)i.push(parseInt(r.substring(t,t+2),16));return Y(new Uint8Array(i))}return H(t)?Y(new Uint8Array(t)):Z.throwArgumentError("invalid arrayify value","value",t)}function J(t){let e=t.map(t=>G(t)),r=e.reduce((t,e)=>t+e.length,0),i=new Uint8Array(r);return e.reduce((t,e)=>(i.set(e,t),t+e.length),0),Y(i)}function X(t,e){return"string"==typeof t&&!!t.match(/^0x[0-9A-Fa-f]*$/)&&(!e||t.length===2+2*e)}let K="0123456789abcdef";function W(t,e){if(e||(e={}),"number"==typeof t){Z.checkSafeUint53(t,"invalid hexlify value");let e="";for(;t;)e=K[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("bigint"==typeof t)return(t=t.toString(16)).length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),$(t))return t.toHexString();if(X(t))return t.length%2&&("left"===e.hexPad?t="0x0"+t.substring(2):"right"===e.hexPad?t+="0":Z.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(H(t)){let e="0x";for(let r=0;r<t.length;r++){let i=t[r];e+=K[(240&i)>>4]+K[15&i]}return e}return Z.throwArgumentError("invalid hexlify value","value",t)}function Q(t,e){for("string"!=typeof t?t=W(t):X(t)||Z.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&Z.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}let tt=new f.Yd("bytes/5.6.0");function te(t){return t.slice||(t.slice=function(){let e=Array.prototype.slice.call(arguments);return te(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function tr(t){return"number"==typeof t&&t==t&&t%1==0}let ti=new f.Yd("strings/5.6.0");function tn(t,e,r,i,n){if(t===h.BAD_PREFIX||t===h.UNEXPECTED_CONTINUE){let t=0;for(let i=e+1;i<r.length&&r[i]>>6==2;i++)t++;return t}return t===h.OVERRUN?r.length-e-1:0}function ts(t){return I(function(t,e=a.current){e!=a.current&&(ti.checkNormalize(),t=t.normalize(e));let r=[];for(let e=0;e<t.length;e++){let i=t.charCodeAt(e);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(63&i|128);else if((64512&i)==55296){e++;let n=t.charCodeAt(e);if(e>=t.length||(64512&n)!=56320)throw Error("invalid utf-8 string");let s=65536+((1023&i)<<10)+(1023&n);r.push(s>>18|240),r.push(s>>12&63|128),r.push(s>>6&63|128),r.push(63&s|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(63&i|128)}return function(t,e){var r,i;if(e||(e={}),"number"==typeof t){tt.checkSafeUint53(t,"invalid arrayify value");let e=[];for(;t;)e.unshift(255&t),t=parseInt(String(t/256));return 0===e.length&&e.push(0),te(new Uint8Array(e))}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),t.toHexString&&(t=t.toHexString()),"string"==typeof(r=t)&&r.match(/^0x[0-9A-Fa-f]*$/)&&(!i||r.length===2+2*i)){let r=t.substring(2);r.length%2&&("left"===e.hexPad?r="0x0"+r.substring(2):"right"===e.hexPad?r+="0":tt.throwArgumentError("hex data is odd-length","value",t));let i=[];for(let t=0;t<r.length;t+=2)i.push(parseInt(r.substring(t,t+2),16));return te(new Uint8Array(i))}return!function(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t||!tr(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){let r=t[e];if(!tr(r)||r<0||r>=256)return!1}return!0}(t)?tt.throwArgumentError("invalid arrayify value","value",t):te(new Uint8Array(t))}(r)}(t))}(i=a||(a={})).current="",i.NFC="NFC",i.NFD="NFD",i.NFKC="NFKC",i.NFKD="NFKD",(n=h||(h={})).UNEXPECTED_CONTINUE="unexpected continuation byte",n.BAD_PREFIX="bad codepoint prefix",n.OVERRUN="string overrun",n.MISSING_CONTINUE="missing continuation byte",n.OUT_OF_RANGE="out of UTF-8 range",n.UTF16_SURROGATE="UTF-16 surrogate",n.OVERLONG="overlong representation",Object.freeze({error:function(t,e,r,i,n){return ti.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)},ignore:tn,replace:function(t,e,r,i,n){return t===h.OVERLONG?(i.push(n),0):(i.push(65533),tn(t,e,r,i,n))}});let to=new f.Yd("properties/5.6.0");function ta(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function th(t,e){for(let r=0;r<32;r++){if(t[e])return t[e];if(!t.prototype||"object"!=typeof t.prototype)break;t=Object.getPrototypeOf(t.prototype).constructor}return null}let tu={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};class tl{constructor(t){for(let e in t)this[e]=function t(e){return function(e){if(function t(e){if(null==e||tu[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;let r=Object.keys(e);for(let i=0;i<r.length;i++){let n=null;try{n=e[r[i]]}catch(t){continue}if(!t(n))return!1}return!0}return to.throwArgumentError(`Cannot deepCopy ${typeof e}`,"object",e)}(e))return e;if(Array.isArray(e))return Object.freeze(e.map(e=>t(e)));if("object"==typeof e){let r={};for(let i in e){let n=e[i];void 0!==n&&ta(r,i,t(n))}return r}return to.throwArgumentError(`Cannot deepCopy ${typeof e}`,"object",e)}(e)}(t[e])}}let tf="abi/5.6.1",tm=new f.Yd(tf);class tc{constructor(t,e,r,i){this.name=t,this.type=e,this.localName=r,this.dynamic=i}_throwError(t,e){tm.throwArgumentError(t,this.localName,e)}}class td{constructor(t){ta(this,"wordSize",t||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(t)}get data(){var t;let e;return t=this._data,e="0x",t.forEach(t=>{e+=W(t).substring(2)}),e}get length(){return this._dataLength}_writeData(t){return this._data.push(t),this._dataLength+=t.length,t.length}appendWriter(t){return this._writeData(J(t._data))}writeBytes(t){let e=G(t),r=e.length%this.wordSize;return r&&(e=J([e,this._padding.slice(r)])),this._writeData(e)}_getValue(t){let e=G(S.from(t));return e.length>this.wordSize&&tm.throwError("value out-of-bounds",f.Yd.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:e.length}),e.length%this.wordSize&&(e=J([this._padding.slice(e.length%this.wordSize),e])),e}writeValue(t){return this._writeData(this._getValue(t))}writeUpdatableValue(){let t=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,e=>{this._data[t]=this._getValue(e)}}}class tp{constructor(t,e,r,i){ta(this,"_data",G(t)),ta(this,"wordSize",e||32),ta(this,"_coerceFunc",r),ta(this,"allowLoose",i),this._offset=0}get data(){return W(this._data)}get consumed(){return this._offset}static coerce(t,e){let r=t.match("^u?int([0-9]+)$");return r&&48>=parseInt(r[1])&&(e=e.toNumber()),e}coerce(t,e){return this._coerceFunc?this._coerceFunc(t,e):tp.coerce(t,e)}_peekBytes(t,e,r){let i=Math.ceil(e/this.wordSize)*this.wordSize;return this._offset+i>this._data.length&&(this.allowLoose&&r&&this._offset+e<=this._data.length?i=e:tm.throwError("data out-of-bounds",f.Yd.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+i})),this._data.slice(this._offset,this._offset+i)}subReader(t){return new tp(this._data.slice(this._offset+t),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(t,e){let r=this._peekBytes(0,t,!!e);return this._offset+=r.length,r.slice(0,t)}readValue(){return S.from(this.readBytes(this.wordSize))}}class tg extends tc{constructor(t){super("address","address",t,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(t,e){try{e=D(e)}catch(t){this._throwError(t.message,e)}return t.writeValue(e)}decode(t){return D(Q(t.readValue().toHexString(),20))}}class ty extends tc{constructor(t){super(t.name,t.type,void 0,t.dynamic),this.coder=t}defaultValue(){return this.coder.defaultValue()}encode(t,e){return this.coder.encode(t,e)}decode(t){return this.coder.decode(t)}}let tw=new f.Yd(tf);function tv(t,e,r){let i=null;if(Array.isArray(r))i=r;else if(r&&"object"==typeof r){let t={};i=e.map(e=>{let i=e.localName;return i||tw.throwError("cannot encode object for signature with missing names",f.Yd.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),t[i]&&tw.throwError("cannot encode object for signature with duplicate names",f.Yd.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),t[i]=!0,r[i]})}else tw.throwArgumentError("invalid tuple value","tuple",r);e.length!==i.length&&tw.throwArgumentError("types/value length mismatch","tuple",r);let n=new td(t.wordSize),s=new td(t.wordSize),o=[];return e.forEach((t,e)=>{let r=i[e];if(t.dynamic){let e=s.length;t.encode(s,r);let i=n.writeUpdatableValue();o.push(t=>{i(t+e)})}else t.encode(n,r)}),o.forEach(t=>{t(n.length)}),t.appendWriter(n)+t.appendWriter(s)}function tb(t,e){let r=[],i=t.subReader(0);e.forEach(e=>{let n=null;if(e.dynamic){let r=t.readValue(),s=i.subReader(r.toNumber());try{n=e.decode(s)}catch(t){if(t.code===f.Yd.errors.BUFFER_OVERRUN)throw t;(n=t).baseType=e.name,n.name=e.localName,n.type=e.type}}else try{n=e.decode(t)}catch(t){if(t.code===f.Yd.errors.BUFFER_OVERRUN)throw t;(n=t).baseType=e.name,n.name=e.localName,n.type=e.type}void 0!=n&&r.push(n)});let n=e.reduce((t,e)=>{let r=e.localName;return r&&(t[r]||(t[r]=0),t[r]++),t},{});e.forEach((t,e)=>{let i=t.localName;if(!i||1!==n[i]||("length"===i&&(i="_length"),null!=r[i]))return;let s=r[e];s instanceof Error?Object.defineProperty(r,i,{enumerable:!0,get:()=>{throw s}}):r[i]=s});for(let t=0;t<r.length;t++){let e=r[t];e instanceof Error&&Object.defineProperty(r,t,{enumerable:!0,get:()=>{throw e}})}return Object.freeze(r)}class tM extends tc{constructor(t,e,r){let i=t.type+"["+(e>=0?e:"")+"]",n=-1===e||t.dynamic;super("array",i,r,n),this.coder=t,this.length=e}defaultValue(){let t=this.coder.defaultValue(),e=[];for(let r=0;r<this.length;r++)e.push(t);return e}encode(t,e){Array.isArray(e)||this._throwError("expected array value",e);let r=this.length;-1===r&&(r=e.length,t.writeValue(e.length)),tw.checkArgumentCount(e.length,r,"coder array"+(this.localName?" "+this.localName:""));let i=[];for(let t=0;t<e.length;t++)i.push(this.coder);return tv(t,i,e)}decode(t){let e=this.length;-1===e&&32*(e=t.readValue().toNumber())>t._data.length&&tw.throwError("insufficient data length",f.Yd.errors.BUFFER_OVERRUN,{length:t._data.length,count:e});let r=[];for(let t=0;t<e;t++)r.push(new ty(this.coder));return t.coerce(this.name,tb(t,r))}}class tE extends tc{constructor(t){super("bool","bool",t,!1)}defaultValue(){return!1}encode(t,e){return t.writeValue(e?1:0)}decode(t){return t.coerce(this.type,!t.readValue().isZero())}}class t_ extends tc{constructor(t,e){super(t,t,e,!0)}defaultValue(){return"0x"}encode(t,e){return e=G(e),t.writeValue(e.length)+t.writeBytes(e)}decode(t){return t.readBytes(t.readValue().toNumber(),!0)}}class tx extends t_{constructor(t){super("bytes",t)}decode(t){return t.coerce(this.name,W(super.decode(t)))}}class tA extends tc{constructor(t,e){let r="bytes"+String(t);super(r,r,e,!1),this.size=t}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(t,e){let r=G(e);return r.length!==this.size&&this._throwError("incorrect data length",e),t.writeBytes(r)}decode(t){return t.coerce(this.name,W(t.readBytes(this.size)))}}class tN extends tc{constructor(t){super("null","",t,!1)}defaultValue(){return null}encode(t,e){return null!=e&&this._throwError("not null",e),t.writeBytes([])}decode(t){return t.readBytes(0),t.coerce(this.name,null)}}let tS=S.from(-1),tO=S.from(0),tk=S.from(1),tR=S.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");class tj extends tc{constructor(t,e,r){let i=(e?"int":"uint")+8*t;super(i,i,r,!1),this.size=t,this.signed=e}defaultValue(){return 0}encode(t,e){let r=S.from(e),i=tR.mask(8*t.wordSize);if(this.signed){let t=i.mask(8*this.size-1);(r.gt(t)||r.lt(t.add(tk).mul(tS)))&&this._throwError("value out-of-bounds",e)}else(r.lt(tO)||r.gt(i.mask(8*this.size)))&&this._throwError("value out-of-bounds",e);return r=r.toTwos(8*this.size).mask(8*this.size),this.signed&&(r=r.fromTwos(8*this.size).toTwos(8*t.wordSize)),t.writeValue(r)}decode(t){let e=t.readValue().mask(8*this.size);return this.signed&&(e=e.fromTwos(8*this.size)),t.coerce(this.name,e)}}let tT=new f.Yd("strings/5.6.0");function tU(t,e,r,i,n){if(t===l.BAD_PREFIX||t===l.UNEXPECTED_CONTINUE){let t=0;for(let i=e+1;i<r.length&&r[i]>>6==2;i++)t++;return t}return t===l.OVERRUN?r.length-e-1:0}(s=u||(u={})).current="",s.NFC="NFC",s.NFD="NFD",s.NFKC="NFKC",s.NFKD="NFKD",(o=l||(l={})).UNEXPECTED_CONTINUE="unexpected continuation byte",o.BAD_PREFIX="bad codepoint prefix",o.OVERRUN="string overrun",o.MISSING_CONTINUE="missing continuation byte",o.OUT_OF_RANGE="out of UTF-8 range",o.UTF16_SURROGATE="UTF-16 surrogate",o.OVERLONG="overlong representation";let tF=Object.freeze({error:function(t,e,r,i,n){return tT.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)},ignore:tU,replace:function(t,e,r,i,n){return t===l.OVERLONG?(i.push(n),0):(i.push(65533),tU(t,e,r,i,n))}});class tC extends t_{constructor(t){super("string",t)}defaultValue(){return""}encode(t,e){return super.encode(t,function(t,e=u.current){e!=u.current&&(tT.checkNormalize(),t=t.normalize(e));let r=[];for(let e=0;e<t.length;e++){let i=t.charCodeAt(e);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(63&i|128);else if((64512&i)==55296){e++;let n=t.charCodeAt(e);if(e>=t.length||(64512&n)!=56320)throw Error("invalid utf-8 string");let s=65536+((1023&i)<<10)+(1023&n);r.push(s>>18|240),r.push(s>>12&63|128),r.push(s>>6&63|128),r.push(63&s|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(63&i|128)}return G(r)}(e))}decode(t){return(function(t,e){null==e&&(e=tF.error),t=G(t);let r=[],i=0;for(;i<t.length;){let n=t[i++];if(n>>7==0){r.push(n);continue}let s=null,o=null;if((224&n)==192)s=1,o=127;else if((240&n)==224)s=2,o=2047;else if((248&n)==240)s=3,o=65535;else{(192&n)==128?i+=e(l.UNEXPECTED_CONTINUE,i-1,t,r):i+=e(l.BAD_PREFIX,i-1,t,r);continue}if(i-1+s>=t.length){i+=e(l.OVERRUN,i-1,t,r);continue}let a=n&(1<<8-s-1)-1;for(let n=0;n<s;n++){let n=t[i];if((192&n)!=128){i+=e(l.MISSING_CONTINUE,i,t,r),a=null;break}a=a<<6|63&n,i++}if(null!==a){if(a>1114111){i+=e(l.OUT_OF_RANGE,i-1-s,t,r,a);continue}if(a>=55296&&a<=57343){i+=e(l.UTF16_SURROGATE,i-1-s,t,r,a);continue}if(a<=o){i+=e(l.OVERLONG,i-1-s,t,r,a);continue}r.push(a)}}return r})(super.decode(t),void 0).map(t=>t<=65535?String.fromCharCode(t):String.fromCharCode(((t-=65536)>>10&1023)+55296,(1023&t)+56320)).join("")}}class tP extends tc{constructor(t,e){let r=!1,i=[];t.forEach(t=>{t.dynamic&&(r=!0),i.push(t.type)});let n="tuple("+i.join(",")+")";super("tuple",n,e,r),this.coders=t}defaultValue(){let t=[];this.coders.forEach(e=>{t.push(e.defaultValue())});let e=this.coders.reduce((t,e)=>{let r=e.localName;return r&&(t[r]||(t[r]=0),t[r]++),t},{});return this.coders.forEach((r,i)=>{let n=r.localName;n&&1===e[n]&&("length"===n&&(n="_length"),null==t[n]&&(t[n]=t[i]))}),Object.freeze(t)}encode(t,e){return tv(t,this.coders,e)}decode(t){return t.coerce(this.name,tb(t,this.coders))}}let tI=new f.Yd(tf),tB={},tL={calldata:!0,memory:!0,storage:!0},tz={calldata:!0,memory:!0};function tV(t,e){if("bytes"===t||"string"===t){if(tL[e])return!0}else if("address"===t){if("payable"===e)return!0}else if((t.indexOf("[")>=0||"tuple"===t)&&tz[e])return!0;return(tL[e]||"payable"===e)&&tI.throwArgumentError("invalid modifier","name",e),!1}function tD(t,e){for(let r in e)ta(t,r,e[r])}let tZ=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),t$=new RegExp(/^(.*)\[([0-9]*)\]$/);class tY{constructor(t,e){t!==tB&&tI.throwError("use fromString",f.Yd.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),tD(this,e);let r=this.type.match(t$);r?tD(this,{arrayLength:parseInt(r[2]||"-1"),arrayChildren:tY.fromObject({type:r[1],components:this.components}),baseType:"array"}):tD(this,{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(t){if(t||(t=tZ.sighash),tZ[t]||tI.throwArgumentError("invalid format type","format",t),t===tZ.json){let e={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(e.indexed=this.indexed),this.components&&(e.components=this.components.map(e=>JSON.parse(e.format(t)))),JSON.stringify(e)}let e="";return"array"===this.baseType?e+=this.arrayChildren.format(t)+"["+(this.arrayLength<0?"":String(this.arrayLength))+"]":"tuple"===this.baseType?(t!==tZ.sighash&&(e+=this.type),e+="("+this.components.map(e=>e.format(t)).join(t===tZ.full?", ":",")+")"):e+=this.type,t!==tZ.sighash&&(!0===this.indexed&&(e+=" indexed"),t===tZ.full&&this.name&&(e+=" "+this.name)),e}static from(t,e){return"string"==typeof t?tY.fromString(t,e):tY.fromObject(t)}static fromObject(t){return tY.isParamType(t)?t:new tY(tB,{name:t.name||null,type:t6(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(tY.fromObject):null})}static fromString(t,e){var r;return r=function(t,e){let r=t;function i(e){tI.throwArgumentError(`unexpected character at position ${e}`,"param",t)}function n(t){let r={type:"",name:"",parent:t,state:{allowType:!0}};return e&&(r.indexed=!1),r}t=t.replace(/\s/g," ");let s={type:"",name:"",state:{allowType:!0}},o=s;for(let r=0;r<t.length;r++){let s=t[r];switch(s){case"(":o.state.allowType&&""===o.type?o.type="tuple":o.state.allowParams||i(r),o.state.allowType=!1,o.type=t6(o.type),o.components=[n(o)],o=o.components[0];break;case")":delete o.state,"indexed"===o.name&&(e||i(r),o.indexed=!0,o.name=""),tV(o.type,o.name)&&(o.name=""),o.type=t6(o.type);let a=o;(o=o.parent)||i(r),delete a.parent,o.state.allowParams=!1,o.state.allowName=!0,o.state.allowArray=!0;break;case",":delete o.state,"indexed"===o.name&&(e||i(r),o.indexed=!0,o.name=""),tV(o.type,o.name)&&(o.name=""),o.type=t6(o.type);let h=n(o.parent);o.parent.components.push(h),delete o.parent,o=h;break;case" ":o.state.allowType&&""!==o.type&&(o.type=t6(o.type),delete o.state.allowType,o.state.allowName=!0,o.state.allowParams=!0),o.state.allowName&&""!==o.name&&("indexed"===o.name?(e||i(r),o.indexed&&i(r),o.indexed=!0,o.name=""):tV(o.type,o.name)?o.name="":o.state.allowName=!1);break;case"[":o.state.allowArray||i(r),o.type+=s,o.state.allowArray=!1,o.state.allowName=!1,o.state.readArray=!0;break;case"]":o.state.readArray||i(r),o.type+=s,o.state.readArray=!1,o.state.allowArray=!0,o.state.allowName=!0;break;default:o.state.allowType?(o.type+=s,o.state.allowParams=!0,o.state.allowArray=!0):o.state.allowName?(o.name+=s,delete o.state.allowArray):o.state.readArray?o.type+=s:i(r)}}return o.parent&&tI.throwArgumentError("unexpected eof","param",t),delete s.state,"indexed"===o.name?(e||i(r.length-7),o.indexed&&i(r.length-7),o.indexed=!0,o.name=""):tV(o.type,o.name)&&(o.name=""),s.type=t6(s.type),s}(t,!!e),tY.fromObject({name:r.name,type:r.type,indexed:r.indexed,components:r.components})}static isParamType(t){return!!(null!=t&&t._isParamType)}}function tq(t,e){return(function(t){t=t.trim();let e=[],r="",i=0;for(let n=0;n<t.length;n++){let s=t[n];","===s&&0===i?(e.push(r),r=""):(r+=s,"("===s?i++:")"===s&&-1==--i&&tI.throwArgumentError("unbalanced parenthesis","value",t))}return r&&e.push(r),e})(t).map(t=>tY.fromString(t,e))}class tH{constructor(t,e){t!==tB&&tI.throwError("use a static from method",f.Yd.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),tD(this,e),this._isFragment=!0,Object.freeze(this)}static from(t){return tH.isFragment(t)?t:"string"==typeof t?tH.fromString(t):tH.fromObject(t)}static fromObject(t){if(tH.isFragment(t))return t;switch(t.type){case"function":return tQ.fromObject(t);case"event":return tG.fromObject(t);case"constructor":return tW.fromObject(t);case"error":return t1.fromObject(t);case"fallback":case"receive":return null}return tI.throwArgumentError("invalid fragment object","value",t)}static fromString(t){return"event"===(t=(t=(t=t.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?tG.fromString(t.substring(5).trim()):"function"===t.split(" ")[0]?tQ.fromString(t.substring(8).trim()):"constructor"===t.split("(")[0].trim()?tW.fromString(t.trim()):"error"===t.split(" ")[0]?t1.fromString(t.substring(5).trim()):tI.throwArgumentError("unsupported fragment","value",t)}static isFragment(t){return!!(t&&t._isFragment)}}class tG extends tH{format(t){if(t||(t=tZ.sighash),tZ[t]||tI.throwArgumentError("invalid format type","format",t),t===tZ.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(e=>JSON.parse(e.format(t)))});let e="";return t!==tZ.sighash&&(e+="event "),e+=this.name+"("+this.inputs.map(e=>e.format(t)).join(t===tZ.full?", ":",")+") ",t!==tZ.sighash&&this.anonymous&&(e+="anonymous "),e.trim()}static from(t){return"string"==typeof t?tG.fromString(t):tG.fromObject(t)}static fromObject(t){if(tG.isEventFragment(t))return t;"event"!==t.type&&tI.throwArgumentError("invalid event object","value",t);let e={name:t8(t.name),anonymous:t.anonymous,inputs:t.inputs?t.inputs.map(tY.fromObject):[],type:"event"};return new tG(tB,e)}static fromString(t){let e=t.match(t3);e||tI.throwArgumentError("invalid event string","value",t);let r=!1;return e[3].split(" ").forEach(t=>{switch(t.trim()){case"anonymous":r=!0;break;case"":break;default:tI.warn("unknown modifier: "+t)}}),tG.fromObject({name:e[1].trim(),anonymous:r,inputs:tq(e[2],!0),type:"event"})}static isEventFragment(t){return t&&t._isFragment&&"event"===t.type}}function tJ(t,e){e.gas=null;let r=t.split("@");return 1!==r.length?(r.length>2&&tI.throwArgumentError("invalid human-readable ABI signature","value",t),r[1].match(/^[0-9]+$/)||tI.throwArgumentError("invalid human-readable ABI signature gas","value",t),e.gas=S.from(r[1]),r[0]):t}function tX(t,e){e.constant=!1,e.payable=!1,e.stateMutability="nonpayable",t.split(" ").forEach(t=>{switch(t.trim()){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"nonpayable":e.payable=!1,e.stateMutability="nonpayable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+t)}})}function tK(t){let e={constant:!1,payable:!0,stateMutability:"payable"};return null!=t.stateMutability?(e.stateMutability=t.stateMutability,e.constant="view"===e.stateMutability||"pure"===e.stateMutability,null!=t.constant&&!!t.constant!==e.constant&&tI.throwArgumentError("cannot have constant function with mutability "+e.stateMutability,"value",t),e.payable="payable"===e.stateMutability,null!=t.payable&&!!t.payable!==e.payable&&tI.throwArgumentError("cannot have payable function with mutability "+e.stateMutability,"value",t)):null!=t.payable?(e.payable=!!t.payable,null!=t.constant||e.payable||"constructor"===t.type||tI.throwArgumentError("unable to determine stateMutability","value",t),e.constant=!!t.constant,e.constant?e.stateMutability="view":e.stateMutability=e.payable?"payable":"nonpayable",e.payable&&e.constant&&tI.throwArgumentError("cannot have constant payable function","value",t)):null!=t.constant?(e.constant=!!t.constant,e.payable=!e.constant,e.stateMutability=e.constant?"view":"payable"):"constructor"!==t.type&&tI.throwArgumentError("unable to determine stateMutability","value",t),e}class tW extends tH{format(t){if(t||(t=tZ.sighash),tZ[t]||tI.throwArgumentError("invalid format type","format",t),t===tZ.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(e=>JSON.parse(e.format(t)))});t===tZ.sighash&&tI.throwError("cannot format a constructor for sighash",f.Yd.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let e="constructor("+this.inputs.map(e=>e.format(t)).join(t===tZ.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(e+=this.stateMutability+" "),e.trim()}static from(t){return"string"==typeof t?tW.fromString(t):tW.fromObject(t)}static fromObject(t){if(tW.isConstructorFragment(t))return t;"constructor"!==t.type&&tI.throwArgumentError("invalid constructor object","value",t);let e=tK(t);e.constant&&tI.throwArgumentError("constructor cannot be constant","value",t);let r={name:null,type:t.type,inputs:t.inputs?t.inputs.map(tY.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?S.from(t.gas):null};return new tW(tB,r)}static fromString(t){let e={type:"constructor"},r=(t=tJ(t,e)).match(t3);return r&&"constructor"===r[1].trim()||tI.throwArgumentError("invalid constructor string","value",t),e.inputs=tq(r[2].trim(),!1),tX(r[3].trim(),e),tW.fromObject(e)}static isConstructorFragment(t){return t&&t._isFragment&&"constructor"===t.type}}class tQ extends tW{format(t){if(t||(t=tZ.sighash),tZ[t]||tI.throwArgumentError("invalid format type","format",t),t===tZ.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(e=>JSON.parse(e.format(t))),outputs:this.outputs.map(e=>JSON.parse(e.format(t)))});let e="";return t!==tZ.sighash&&(e+="function "),e+=this.name+"("+this.inputs.map(e=>e.format(t)).join(t===tZ.full?", ":",")+") ",t!==tZ.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(e+=this.stateMutability+" "):this.constant&&(e+="view "),this.outputs&&this.outputs.length&&(e+="returns ("+this.outputs.map(e=>e.format(t)).join(", ")+") "),null!=this.gas&&(e+="@"+this.gas.toString()+" ")),e.trim()}static from(t){return"string"==typeof t?tQ.fromString(t):tQ.fromObject(t)}static fromObject(t){if(tQ.isFunctionFragment(t))return t;"function"!==t.type&&tI.throwArgumentError("invalid function object","value",t);let e=tK(t),r={type:t.type,name:t8(t.name),constant:e.constant,inputs:t.inputs?t.inputs.map(tY.fromObject):[],outputs:t.outputs?t.outputs.map(tY.fromObject):[],payable:e.payable,stateMutability:e.stateMutability,gas:t.gas?S.from(t.gas):null};return new tQ(tB,r)}static fromString(t){let e={type:"function"},r=(t=tJ(t,e)).split(" returns ");r.length>2&&tI.throwArgumentError("invalid function string","value",t);let i=r[0].match(t3);if(i||tI.throwArgumentError("invalid function signature","value",t),e.name=i[1].trim(),e.name&&t8(e.name),e.inputs=tq(i[2],!1),tX(i[3].trim(),e),r.length>1){let i=r[1].match(t3);(""!=i[1].trim()||""!=i[3].trim())&&tI.throwArgumentError("unexpected tokens","value",t),e.outputs=tq(i[2],!1)}else e.outputs=[];return tQ.fromObject(e)}static isFunctionFragment(t){return t&&t._isFragment&&"function"===t.type}}function t0(t){let e=t.format();return("Error(string)"===e||"Panic(uint256)"===e)&&tI.throwArgumentError(`cannot specify user defined ${e} error`,"fragment",t),t}class t1 extends tH{format(t){if(t||(t=tZ.sighash),tZ[t]||tI.throwArgumentError("invalid format type","format",t),t===tZ.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(e=>JSON.parse(e.format(t)))});let e="";return t!==tZ.sighash&&(e+="error "),(e+=this.name+"("+this.inputs.map(e=>e.format(t)).join(t===tZ.full?", ":",")+") ").trim()}static from(t){return"string"==typeof t?t1.fromString(t):t1.fromObject(t)}static fromObject(t){if(t1.isErrorFragment(t))return t;"error"!==t.type&&tI.throwArgumentError("invalid error object","value",t);let e={type:t.type,name:t8(t.name),inputs:t.inputs?t.inputs.map(tY.fromObject):[]};return t0(new t1(tB,e))}static fromString(t){let e={type:"error"},r=t.match(t3);return r||tI.throwArgumentError("invalid error signature","value",t),e.name=r[1].trim(),e.name&&t8(e.name),e.inputs=tq(r[2],!1),t0(t1.fromObject(e))}static isErrorFragment(t){return t&&t._isFragment&&"error"===t.type}}function t6(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}let t2=RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function t8(t){return t&&t.match(t2)||tI.throwArgumentError(`invalid identifier "${t}"`,"value",t),t}let t3=RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),t7=new f.Yd(tf),t9=new RegExp(/^bytes([0-9]*)$/),t5=new RegExp(/^(u?int)([0-9]*)$/);class t4{constructor(t){t7.checkNew(new.target,t4),ta(this,"coerceFunc",t||null)}_getCoder(t){switch(t.baseType){case"address":return new tg(t.name);case"bool":return new tE(t.name);case"string":return new tC(t.name);case"bytes":return new tx(t.name);case"array":return new tM(this._getCoder(t.arrayChildren),t.arrayLength,t.name);case"tuple":return new tP((t.components||[]).map(t=>this._getCoder(t)),t.name);case"":return new tN(t.name)}let e=t.type.match(t5);if(e){let r=parseInt(e[2]||"256");return(0===r||r>256||r%8!=0)&&t7.throwArgumentError("invalid "+e[1]+" bit length","param",t),new tj(r/8,"int"===e[1],t.name)}if(e=t.type.match(t9)){let r=parseInt(e[1]);return(0===r||r>32)&&t7.throwArgumentError("invalid bytes length","param",t),new tA(r,t.name)}return t7.throwArgumentError("invalid type","type",t.type)}_getWordSize(){return 32}_getReader(t,e){return new tp(t,this._getWordSize(),this.coerceFunc,e)}_getWriter(){return new td(this._getWordSize())}getDefaultValue(t){let e=t.map(t=>this._getCoder(tY.from(t))),r=new tP(e,"_");return r.defaultValue()}encode(t,e){t.length!==e.length&&t7.throwError("types/values length mismatch",f.Yd.errors.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});let r=t.map(t=>this._getCoder(tY.from(t))),i=new tP(r,"_"),n=this._getWriter();return i.encode(n,e),n.data}decode(t,e,r){let i=t.map(t=>this._getCoder(tY.from(t))),n=new tP(i,"_");return n.decode(this._getReader(G(e),r))}}let et=new t4,ee=new f.Yd(tf);class er extends tl{}class ei extends tl{}class en extends tl{}class es extends tl{static isIndexed(t){return!!(t&&t._isIndexed)}}let eo={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function ea(t,e){let r=Error(`deferred error during ABI decoding triggered accessing ${t}`);return r.error=e,r}class eh{constructor(t){ee.checkNew(new.target,eh);ta(this,"fragments",("string"==typeof t?JSON.parse(t):t).map(t=>tH.from(t)).filter(t=>null!=t)),ta(this,"_abiCoder",th(new.target,"getAbiCoder")()),ta(this,"functions",{}),ta(this,"errors",{}),ta(this,"events",{}),ta(this,"structs",{}),this.fragments.forEach(t=>{let e=null;switch(t.type){case"constructor":if(this.deploy){ee.warn("duplicate definition - constructor");return}ta(this,"deploy",t);return;case"function":e=this.functions;break;case"event":e=this.events;break;case"error":e=this.errors;break;default:return}let r=t.format();if(e[r]){ee.warn("duplicate definition - "+r);return}e[r]=t}),this.deploy||ta(this,"deploy",tW.from({payable:!1,type:"constructor"})),ta(this,"_isInterface",!0)}format(t){t||(t=tZ.full),t===tZ.sighash&&ee.throwArgumentError("interface does not support formatting sighash","format",t);let e=this.fragments.map(e=>e.format(t));return t===tZ.json?JSON.stringify(e.map(t=>JSON.parse(t))):e}static getAbiCoder(){return et}static getAddress(t){return D(t)}static getSighash(t){var e,r;return e=ts(t.format()),r=0,"string"!=typeof e?e=W(e):(!X(e)||e.length%2)&&Z.throwArgumentError("invalid hexData","value",e),r=2+2*r,"0x"+e.substring(r,10)}static getEventTopic(t){return ts(t.format())}getFunction(t){if(X(t)){for(let e in this.functions)if(t===this.getSighash(e))return this.functions[e];ee.throwArgumentError("no matching function","sighash",t)}if(-1===t.indexOf("(")){let e=t.trim(),r=Object.keys(this.functions).filter(t=>t.split("(")[0]===e);return 0===r.length?ee.throwArgumentError("no matching function","name",e):r.length>1&&ee.throwArgumentError("multiple matching functions","name",e),this.functions[r[0]]}let e=this.functions[tQ.fromString(t).format()];return e||ee.throwArgumentError("no matching function","signature",t),e}getEvent(t){if(X(t)){let e=t.toLowerCase();for(let t in this.events)if(e===this.getEventTopic(t))return this.events[t];ee.throwArgumentError("no matching event","topichash",e)}if(-1===t.indexOf("(")){let e=t.trim(),r=Object.keys(this.events).filter(t=>t.split("(")[0]===e);return 0===r.length?ee.throwArgumentError("no matching event","name",e):r.length>1&&ee.throwArgumentError("multiple matching events","name",e),this.events[r[0]]}let e=this.events[tG.fromString(t).format()];return e||ee.throwArgumentError("no matching event","signature",t),e}getError(t){if(X(t)){let e=th(this.constructor,"getSighash");for(let r in this.errors){let i=this.errors[r];if(t===e(i))return this.errors[r]}ee.throwArgumentError("no matching error","sighash",t)}if(-1===t.indexOf("(")){let e=t.trim(),r=Object.keys(this.errors).filter(t=>t.split("(")[0]===e);return 0===r.length?ee.throwArgumentError("no matching error","name",e):r.length>1&&ee.throwArgumentError("multiple matching errors","name",e),this.errors[r[0]]}let e=this.errors[tQ.fromString(t).format()];return e||ee.throwArgumentError("no matching error","signature",t),e}getSighash(t){if("string"==typeof t)try{t=this.getFunction(t)}catch(e){try{t=this.getError(t)}catch(t){throw e}}return th(this.constructor,"getSighash")(t)}getEventTopic(t){return"string"==typeof t&&(t=this.getEvent(t)),th(this.constructor,"getEventTopic")(t)}_decodeParams(t,e){return this._abiCoder.decode(t,e)}_encodeParams(t,e){return this._abiCoder.encode(t,e)}encodeDeploy(t){return this._encodeParams(this.deploy.inputs,t||[])}decodeErrorResult(t,e){"string"==typeof t&&(t=this.getError(t));let r=G(e);return W(r.slice(0,4))!==this.getSighash(t)&&ee.throwArgumentError(`data signature does not match error ${t.name}.`,"data",W(r)),this._decodeParams(t.inputs,r.slice(4))}encodeErrorResult(t,e){return"string"==typeof t&&(t=this.getError(t)),W(J([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionData(t,e){"string"==typeof t&&(t=this.getFunction(t));let r=G(e);return W(r.slice(0,4))!==this.getSighash(t)&&ee.throwArgumentError(`data signature does not match function ${t.name}.`,"data",W(r)),this._decodeParams(t.inputs,r.slice(4))}encodeFunctionData(t,e){return"string"==typeof t&&(t=this.getFunction(t)),W(J([this.getSighash(t),this._encodeParams(t.inputs,e||[])]))}decodeFunctionResult(t,e){"string"==typeof t&&(t=this.getFunction(t));let r=G(e),i=null,n="",s=null,o=null,a=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(t.outputs,r)}catch(t){}break;case 4:{let t=W(r.slice(0,4)),e=eo[t];if(e)s=this._abiCoder.decode(e.inputs,r.slice(4)),o=e.name,a=e.signature,e.reason&&(i=s[0]),"Error"===o?n=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(s[0])}`:"Panic"===o&&(n=`; VM Exception while processing transaction: reverted with panic code ${s[0]}`);else try{let e=this.getError(t);s=this._abiCoder.decode(e.inputs,r.slice(4)),o=e.name,a=e.format()}catch(t){}}}return ee.throwError("call revert exception"+n,f.Yd.errors.CALL_EXCEPTION,{method:t.format(),data:W(e),errorArgs:s,errorName:o,errorSignature:a,reason:i})}encodeFunctionResult(t,e){return"string"==typeof t&&(t=this.getFunction(t)),W(this._abiCoder.encode(t.outputs,e||[]))}encodeFilterTopics(t,e){"string"==typeof t&&(t=this.getEvent(t)),e.length>t.inputs.length&&ee.throwError("too many arguments for "+t.format(),f.Yd.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:e});let r=[];t.anonymous||r.push(this.getEventTopic(t));let i=(t,e)=>"string"===t.type?ts(e):"bytes"===t.type?I(W(e)):("address"===t.type&&this._abiCoder.encode(["address"],[e]),Q(W(e),32));for(e.forEach((e,n)=>{let s=t.inputs[n];if(!s.indexed){null!=e&&ee.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+s.name,e);return}null==e?r.push(null):"array"===s.baseType||"tuple"===s.baseType?ee.throwArgumentError("filtering with tuples or arrays not supported","contract."+s.name,e):Array.isArray(e)?r.push(e.map(t=>i(s,t))):r.push(i(s,e))});r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(t,e){"string"==typeof t&&(t=this.getEvent(t));let r=[],i=[],n=[];return t.anonymous||r.push(this.getEventTopic(t)),e.length!==t.inputs.length&&ee.throwArgumentError("event arguments/values mismatch","values",e),t.inputs.forEach((t,s)=>{let o=e[s];if(t.indexed){if("string"===t.type)r.push(ts(o));else if("bytes"===t.type)r.push(I(o));else if("tuple"===t.baseType||"array"===t.baseType)throw Error("not implemented");else r.push(this._abiCoder.encode([t.type],[o]))}else i.push(t),n.push(o)}),{data:this._abiCoder.encode(i,n),topics:r}}decodeEventLog(t,e,r){if("string"==typeof t&&(t=this.getEvent(t)),null!=r&&!t.anonymous){let e=this.getEventTopic(t);X(r[0],32)&&r[0].toLowerCase()===e||ee.throwError("fragment/topic mismatch",f.Yd.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:e,value:r[0]}),r=r.slice(1)}let i=[],n=[],s=[];t.inputs.forEach((t,e)=>{t.indexed?"string"===t.type||"bytes"===t.type||"tuple"===t.baseType||"array"===t.baseType?(i.push(tY.fromObject({type:"bytes32",name:t.name})),s.push(!0)):(i.push(t),s.push(!1)):(n.push(t),s.push(!1))});let o=null!=r?this._abiCoder.decode(i,J(r)):null,a=this._abiCoder.decode(n,e,!0),h=[],u=0,l=0;t.inputs.forEach((t,e)=>{if(t.indexed){if(null==o)h[e]=new es({_isIndexed:!0,hash:null});else if(s[e])h[e]=new es({_isIndexed:!0,hash:o[l++]});else try{h[e]=o[l++]}catch(t){h[e]=t}}else try{h[e]=a[u++]}catch(t){h[e]=t}if(t.name&&null==h[t.name]){let r=h[e];r instanceof Error?Object.defineProperty(h,t.name,{enumerable:!0,get:()=>{throw ea(`property ${JSON.stringify(t.name)}`,r)}}):h[t.name]=r}});for(let t=0;t<h.length;t++){let e=h[t];e instanceof Error&&Object.defineProperty(h,t,{enumerable:!0,get:()=>{throw ea(`index ${t}`,e)}})}return Object.freeze(h)}parseTransaction(t){let e=this.getFunction(t.data.substring(0,10).toLowerCase());return e?new ei({args:this._abiCoder.decode(e.inputs,"0x"+t.data.substring(10)),functionFragment:e,name:e.name,signature:e.format(),sighash:this.getSighash(e),value:S.from(t.value||"0")}):null}parseLog(t){let e=this.getEvent(t.topics[0]);return!e||e.anonymous?null:new er({eventFragment:e,name:e.name,signature:e.format(),topic:this.getEventTopic(e),args:this.decodeEventLog(e,t.data,t.topics)})}parseError(t){let e=W(t),r=this.getError(e.substring(0,10).toLowerCase());return r?new en({args:this._abiCoder.decode(r.inputs,"0x"+e.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}static isInterface(t){return!!(t&&t._isInterface)}}},83877:function(t,e,r){!function(t,e){"use strict";function i(t,e){if(!t)throw Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function s(t,e,r){if(s.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&(("le"===e||"be"===e)&&(r=e,e=10),this._init(t||0,e||10,r||"be"))}"object"==typeof t?t.exports=s:e.BN=s,s.BN=s,s.wordSize=26;try{u="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(88677).Buffer}catch(t){}function o(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(t,e,r){var i=o(t,r);return r-1>=e&&(i|=o(t,r-1)<<4),i}function h(t,e,r,i){for(var n=0,s=Math.min(t.length,r),o=e;o<s;o++){var a=t.charCodeAt(o)-48;n*=i,a>=49?n+=a-49+10:a>=17?n+=a-17+10:n+=a}return n}s.isBN=function(t){return t instanceof s||null!==t&&"object"==typeof t&&t.constructor.wordSize===s.wordSize&&Array.isArray(t.words)},s.max=function(t,e){return t.cmp(e)>0?t:e},s.min=function(t,e){return 0>t.cmp(e)?t:e},s.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n<t.length&&(16===e?this._parseHex(t,n,r):(this._parseBase(t,e,n),"le"===r&&this._initArray(this.toArray(),e,r)))},s.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},s.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=Array(this.length);for(var n,s,o=0;o<this.length;o++)this.words[o]=0;var a=0;if("be"===r)for(o=t.length-1,n=0;o>=0;o-=3)s=t[o]|t[o-1]<<8|t[o-2]<<16,this.words[n]|=s<<a&67108863,this.words[n+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);else if("le"===r)for(o=0,n=0;o<t.length;o+=3)s=t[o]|t[o+1]<<8|t[o+2]<<16,this.words[n]|=s<<a&67108863,this.words[n+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,n++);return this.strip()},s.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=Array(this.length);for(var i,n=0;n<this.length;n++)this.words[n]=0;var s=0,o=0;if("be"===r)for(n=t.length-1;n>=e;n-=2)i=a(t,e,n)<<s,this.words[o]|=67108863&i,s>=18?(s-=18,o+=1,this.words[o]|=i>>>26):s+=8;else for(n=(t.length-e)%2==0?e+1:e;n<t.length;n+=2)i=a(t,e,n)<<s,this.words[o]|=67108863&i,s>=18?(s-=18,o+=1,this.words[o]|=i>>>26):s+=8;this.strip()},s.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var s=t.length-r,o=s%i,a=Math.min(s,s-o)+r,u=0,l=r;l<a;l+=i)u=h(t,l,l+i,e),this.imuln(n),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==o){var f=1;for(u=h(t,l,t.length,e),l=0;l<o;l++)f*=e;this.imuln(f),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()},s.prototype.copy=function(t){t.words=Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},s.prototype.clone=function(){var t=new s(null);return this.copy(t),t},s.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},s.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},s.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var u,l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],m=[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 c(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],s=0|e.words[0],o=n*s,a=67108863&o,h=o/67108864|0;r.words[0]=a;for(var u=1;u<i;u++){for(var l=h>>>26,f=67108863&h,m=Math.min(u,e.length-1),c=Math.max(0,u-t.length+1);c<=m;c++){var d=u-c|0;l+=(o=(n=0|t.words[d])*(s=0|e.words[c])+f)/67108864|0,f=67108863&o}r.words[u]=0|f,h=0|l}return 0!==h?r.words[u]=0|h:r.length--,r.strip()}s.prototype.toString=function(t,e){if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var r,n=0,s=0,o=0;o<this.length;o++){var a=this.words[o],h=((a<<n|s)&16777215).toString(16);r=0!=(s=a>>>24-n&16777215)||o!==this.length-1?l[6-h.length]+h+r:h+r,(n+=2)>=26&&(n-=26,o--)}for(0!==s&&(r=s.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var u=f[t],c=m[t];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var p=d.modn(c).toString(t);r=(d=d.idivn(c)).isZero()?p+r:l[u-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},s.prototype.toJSON=function(){return this.toString(16)},s.prototype.toBuffer=function(t,e){return i(void 0!==u),this.toArrayLike(u,t,e)},s.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},s.prototype.toArrayLike=function(t,e,r){var n,s,o=this.byteLength(),a=r||Math.max(1,o);i(o<=a,"byte array longer than desired length"),i(a>0,"Requested array length <= 0"),this.strip();var h=new t(a),u=this.clone();if("le"===e){for(s=0;!u.isZero();s++)n=u.andln(255),u.iushrn(8),h[s]=n;for(;s<a;s++)h[s]=0}else{for(s=0;s<a-o;s++)h[s]=0;for(s=0;!u.isZero();s++)n=u.andln(255),u.iushrn(8),h[a-s-1]=n}return h},Math.clz32?s.prototype._countBits=function(t){return 32-Math.clz32(t)}:s.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},s.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return(8191&e)==0&&(r+=13,e>>>=13),(127&e)==0&&(r+=7,e>>>=7),(15&e)==0&&(r+=4,e>>>=4),(3&e)==0&&(r+=2,e>>>=2),(1&e)==0&&r++,r},s.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return(this.length-1)*26+e},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},s.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},s.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},s.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},s.prototype.isNeg=function(){return 0!==this.negative},s.prototype.neg=function(){return this.clone().ineg()},s.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},s.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},s.prototype.ior=function(t){return i((this.negative|t.negative)==0),this.iuor(t)},s.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},s.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},s.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},s.prototype.iand=function(t){return i((this.negative|t.negative)==0),this.iuand(t)},s.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},s.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},s.prototype.iuxor=function(t){this.length>t.length?(e=this,r=t):(e=t,r=this);for(var e,r,i=0;i<r.length;i++)this.words[i]=e.words[i]^r.words[i];if(this!==e)for(;i<e.length;i++)this.words[i]=e.words[i];return this.length=e.length,this.strip()},s.prototype.ixor=function(t){return i((this.negative|t.negative)==0),this.iuxor(t)},s.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},s.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},s.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},s.prototype.notn=function(t){return this.clone().inotn(t)},s.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),e?this.words[r]=this.words[r]|1<<n:this.words[r]=this.words[r]&~(1<<n),this.strip()},s.prototype.iadd=function(t){if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,i=t):(r=t,i=this);for(var e,r,i,n=0,s=0;s<i.length;s++)e=(0|r.words[s])+(0|i.words[s])+n,this.words[s]=67108863&e,n=e>>>26;for(;0!==n&&s<r.length;s++)e=(0|r.words[s])+n,this.words[s]=67108863&e,n=e>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this},s.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},s.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e,r,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 n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(e=this,r=t):(e=t,r=this);for(var s=0,o=0;o<r.length;o++)s=(i=(0|e.words[o])-(0|r.words[o])+s)>>26,this.words[o]=67108863&i;for(;0!==s&&o<e.length;o++)s=(i=(0|e.words[o])+s)>>26,this.words[o]=67108863&i;if(0===s&&o<e.length&&e!==this)for(;o<e.length;o++)this.words[o]=e.words[o];return this.length=Math.max(this.length,o),e!==this&&(this.negative=1),this.strip()},s.prototype.sub=function(t){return this.clone().isub(t)};var d=function(t,e,r){var i,n,s,o=t.words,a=e.words,h=r.words,u=0,l=0|o[0],f=8191&l,m=l>>>13,c=0|o[1],d=8191&c,p=c>>>13,g=0|o[2],y=8191&g,w=g>>>13,v=0|o[3],b=8191&v,M=v>>>13,E=0|o[4],_=8191&E,x=E>>>13,A=0|o[5],N=8191&A,S=A>>>13,O=0|o[6],k=8191&O,R=O>>>13,j=0|o[7],T=8191&j,U=j>>>13,F=0|o[8],C=8191&F,P=F>>>13,I=0|o[9],B=8191&I,L=I>>>13,z=0|a[0],V=8191&z,D=z>>>13,Z=0|a[1],$=8191&Z,Y=Z>>>13,q=0|a[2],H=8191&q,G=q>>>13,J=0|a[3],X=8191&J,K=J>>>13,W=0|a[4],Q=8191&W,tt=W>>>13,te=0|a[5],tr=8191&te,ti=te>>>13,tn=0|a[6],ts=8191&tn,to=tn>>>13,ta=0|a[7],th=8191&ta,tu=ta>>>13,tl=0|a[8],tf=8191&tl,tm=tl>>>13,tc=0|a[9],td=8191&tc,tp=tc>>>13;r.negative=t.negative^e.negative,r.length=19;var tg=(u+(i=Math.imul(f,V))|0)+((8191&(n=(n=Math.imul(f,D))+Math.imul(m,V)|0))<<13)|0;u=((s=Math.imul(m,D))+(n>>>13)|0)+(tg>>>26)|0,tg&=67108863,i=Math.imul(d,V),n=(n=Math.imul(d,D))+Math.imul(p,V)|0,s=Math.imul(p,D);var ty=(u+(i=i+Math.imul(f,$)|0)|0)+((8191&(n=(n=n+Math.imul(f,Y)|0)+Math.imul(m,$)|0))<<13)|0;u=((s=s+Math.imul(m,Y)|0)+(n>>>13)|0)+(ty>>>26)|0,ty&=67108863,i=Math.imul(y,V),n=(n=Math.imul(y,D))+Math.imul(w,V)|0,s=Math.imul(w,D),i=i+Math.imul(d,$)|0,n=(n=n+Math.imul(d,Y)|0)+Math.imul(p,$)|0,s=s+Math.imul(p,Y)|0;var tw=(u+(i=i+Math.imul(f,H)|0)|0)+((8191&(n=(n=n+Math.imul(f,G)|0)+Math.imul(m,H)|0))<<13)|0;u=((s=s+Math.imul(m,G)|0)+(n>>>13)|0)+(tw>>>26)|0,tw&=67108863,i=Math.imul(b,V),n=(n=Math.imul(b,D))+Math.imul(M,V)|0,s=Math.imul(M,D),i=i+Math.imul(y,$)|0,n=(n=n+Math.imul(y,Y)|0)+Math.imul(w,$)|0,s=s+Math.imul(w,Y)|0,i=i+Math.imul(d,H)|0,n=(n=n+Math.imul(d,G)|0)+Math.imul(p,H)|0,s=s+Math.imul(p,G)|0;var tv=(u+(i=i+Math.imul(f,X)|0)|0)+((8191&(n=(n=n+Math.imul(f,K)|0)+Math.imul(m,X)|0))<<13)|0;u=((s=s+Math.imul(m,K)|0)+(n>>>13)|0)+(tv>>>26)|0,tv&=67108863,i=Math.imul(_,V),n=(n=Math.imul(_,D))+Math.imul(x,V)|0,s=Math.imul(x,D),i=i+Math.imul(b,$)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(M,$)|0,s=s+Math.imul(M,Y)|0,i=i+Math.imul(y,H)|0,n=(n=n+Math.imul(y,G)|0)+Math.imul(w,H)|0,s=s+Math.imul(w,G)|0,i=i+Math.imul(d,X)|0,n=(n=n+Math.imul(d,K)|0)+Math.imul(p,X)|0,s=s+Math.imul(p,K)|0;var tb=(u+(i=i+Math.imul(f,Q)|0)|0)+((8191&(n=(n=n+Math.imul(f,tt)|0)+Math.imul(m,Q)|0))<<13)|0;u=((s=s+Math.imul(m,tt)|0)+(n>>>13)|0)+(tb>>>26)|0,tb&=67108863,i=Math.imul(N,V),n=(n=Math.imul(N,D))+Math.imul(S,V)|0,s=Math.imul(S,D),i=i+Math.imul(_,$)|0,n=(n=n+Math.imul(_,Y)|0)+Math.imul(x,$)|0,s=s+Math.imul(x,Y)|0,i=i+Math.imul(b,H)|0,n=(n=n+Math.imul(b,G)|0)+Math.imul(M,H)|0,s=s+Math.imul(M,G)|0,i=i+Math.imul(y,X)|0,n=(n=n+Math.imul(y,K)|0)+Math.imul(w,X)|0,s=s+Math.imul(w,K)|0,i=i+Math.imul(d,Q)|0,n=(n=n+Math.imul(d,tt)|0)+Math.imul(p,Q)|0,s=s+Math.imul(p,tt)|0;var tM=(u+(i=i+Math.imul(f,tr)|0)|0)+((8191&(n=(n=n+Math.imul(f,ti)|0)+Math.imul(m,tr)|0))<<13)|0;u=((s=s+Math.imul(m,ti)|0)+(n>>>13)|0)+(tM>>>26)|0,tM&=67108863,i=Math.imul(k,V),n=(n=Math.imul(k,D))+Math.imul(R,V)|0,s=Math.imul(R,D),i=i+Math.imul(N,$)|0,n=(n=n+Math.imul(N,Y)|0)+Math.imul(S,$)|0,s=s+Math.imul(S,Y)|0,i=i+Math.imul(_,H)|0,n=(n=n+Math.imul(_,G)|0)+Math.imul(x,H)|0,s=s+Math.imul(x,G)|0,i=i+Math.imul(b,X)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(M,X)|0,s=s+Math.imul(M,K)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(w,Q)|0,s=s+Math.imul(w,tt)|0,i=i+Math.imul(d,tr)|0,n=(n=n+Math.imul(d,ti)|0)+Math.imul(p,tr)|0,s=s+Math.imul(p,ti)|0;var tE=(u+(i=i+Math.imul(f,ts)|0)|0)+((8191&(n=(n=n+Math.imul(f,to)|0)+Math.imul(m,ts)|0))<<13)|0;u=((s=s+Math.imul(m,to)|0)+(n>>>13)|0)+(tE>>>26)|0,tE&=67108863,i=Math.imul(T,V),n=(n=Math.imul(T,D))+Math.imul(U,V)|0,s=Math.imul(U,D),i=i+Math.imul(k,$)|0,n=(n=n+Math.imul(k,Y)|0)+Math.imul(R,$)|0,s=s+Math.imul(R,Y)|0,i=i+Math.imul(N,H)|0,n=(n=n+Math.imul(N,G)|0)+Math.imul(S,H)|0,s=s+Math.imul(S,G)|0,i=i+Math.imul(_,X)|0,n=(n=n+Math.imul(_,K)|0)+Math.imul(x,X)|0,s=s+Math.imul(x,K)|0,i=i+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(M,Q)|0,s=s+Math.imul(M,tt)|0,i=i+Math.imul(y,tr)|0,n=(n=n+Math.imul(y,ti)|0)+Math.imul(w,tr)|0,s=s+Math.imul(w,ti)|0,i=i+Math.imul(d,ts)|0,n=(n=n+Math.imul(d,to)|0)+Math.imul(p,ts)|0,s=s+Math.imul(p,to)|0;var t_=(u+(i=i+Math.imul(f,th)|0)|0)+((8191&(n=(n=n+Math.imul(f,tu)|0)+Math.imul(m,th)|0))<<13)|0;u=((s=s+Math.imul(m,tu)|0)+(n>>>13)|0)+(t_>>>26)|0,t_&=67108863,i=Math.imul(C,V),n=(n=Math.imul(C,D))+Math.imul(P,V)|0,s=Math.imul(P,D),i=i+Math.imul(T,$)|0,n=(n=n+Math.imul(T,Y)|0)+Math.imul(U,$)|0,s=s+Math.imul(U,Y)|0,i=i+Math.imul(k,H)|0,n=(n=n+Math.imul(k,G)|0)+Math.imul(R,H)|0,s=s+Math.imul(R,G)|0,i=i+Math.imul(N,X)|0,n=(n=n+Math.imul(N,K)|0)+Math.imul(S,X)|0,s=s+Math.imul(S,K)|0,i=i+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,tt)|0)+Math.imul(x,Q)|0,s=s+Math.imul(x,tt)|0,i=i+Math.imul(b,tr)|0,n=(n=n+Math.imul(b,ti)|0)+Math.imul(M,tr)|0,s=s+Math.imul(M,ti)|0,i=i+Math.imul(y,ts)|0,n=(n=n+Math.imul(y,to)|0)+Math.imul(w,ts)|0,s=s+Math.imul(w,to)|0,i=i+Math.imul(d,th)|0,n=(n=n+Math.imul(d,tu)|0)+Math.imul(p,th)|0,s=s+Math.imul(p,tu)|0;var tx=(u+(i=i+Math.imul(f,tf)|0)|0)+((8191&(n=(n=n+Math.imul(f,tm)|0)+Math.imul(m,tf)|0))<<13)|0;u=((s=s+Math.imul(m,tm)|0)+(n>>>13)|0)+(tx>>>26)|0,tx&=67108863,i=Math.imul(B,V),n=(n=Math.imul(B,D))+Math.imul(L,V)|0,s=Math.imul(L,D),i=i+Math.imul(C,$)|0,n=(n=n+Math.imul(C,Y)|0)+Math.imul(P,$)|0,s=s+Math.imul(P,Y)|0,i=i+Math.imul(T,H)|0,n=(n=n+Math.imul(T,G)|0)+Math.imul(U,H)|0,s=s+Math.imul(U,G)|0,i=i+Math.imul(k,X)|0,n=(n=n+Math.imul(k,K)|0)+Math.imul(R,X)|0,s=s+Math.imul(R,K)|0,i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(S,Q)|0,s=s+Math.imul(S,tt)|0,i=i+Math.imul(_,tr)|0,n=(n=n+Math.imul(_,ti)|0)+Math.imul(x,tr)|0,s=s+Math.imul(x,ti)|0,i=i+Math.imul(b,ts)|0,n=(n=n+Math.imul(b,to)|0)+Math.imul(M,ts)|0,s=s+Math.imul(M,to)|0,i=i+Math.imul(y,th)|0,n=(n=n+Math.imul(y,tu)|0)+Math.imul(w,th)|0,s=s+Math.imul(w,tu)|0,i=i+Math.imul(d,tf)|0,n=(n=n+Math.imul(d,tm)|0)+Math.imul(p,tf)|0,s=s+Math.imul(p,tm)|0;var tA=(u+(i=i+Math.imul(f,td)|0)|0)+((8191&(n=(n=n+Math.imul(f,tp)|0)+Math.imul(m,td)|0))<<13)|0;u=((s=s+Math.imul(m,tp)|0)+(n>>>13)|0)+(tA>>>26)|0,tA&=67108863,i=Math.imul(B,$),n=(n=Math.imul(B,Y))+Math.imul(L,$)|0,s=Math.imul(L,Y),i=i+Math.imul(C,H)|0,n=(n=n+Math.imul(C,G)|0)+Math.imul(P,H)|0,s=s+Math.imul(P,G)|0,i=i+Math.imul(T,X)|0,n=(n=n+Math.imul(T,K)|0)+Math.imul(U,X)|0,s=s+Math.imul(U,K)|0,i=i+Math.imul(k,Q)|0,n=(n=n+Math.imul(k,tt)|0)+Math.imul(R,Q)|0,s=s+Math.imul(R,tt)|0,i=i+Math.imul(N,tr)|0,n=(n=n+Math.imul(N,ti)|0)+Math.imul(S,tr)|0,s=s+Math.imul(S,ti)|0,i=i+Math.imul(_,ts)|0,n=(n=n+Math.imul(_,to)|0)+Math.imul(x,ts)|0,s=s+Math.imul(x,to)|0,i=i+Math.imul(b,th)|0,n=(n=n+Math.imul(b,tu)|0)+Math.imul(M,th)|0,s=s+Math.imul(M,tu)|0,i=i+Math.imul(y,tf)|0,n=(n=n+Math.imul(y,tm)|0)+Math.imul(w,tf)|0,s=s+Math.imul(w,tm)|0;var tN=(u+(i=i+Math.imul(d,td)|0)|0)+((8191&(n=(n=n+Math.imul(d,tp)|0)+Math.imul(p,td)|0))<<13)|0;u=((s=s+Math.imul(p,tp)|0)+(n>>>13)|0)+(tN>>>26)|0,tN&=67108863,i=Math.imul(B,H),n=(n=Math.imul(B,G))+Math.imul(L,H)|0,s=Math.imul(L,G),i=i+Math.imul(C,X)|0,n=(n=n+Math.imul(C,K)|0)+Math.imul(P,X)|0,s=s+Math.imul(P,K)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(U,Q)|0,s=s+Math.imul(U,tt)|0,i=i+Math.imul(k,tr)|0,n=(n=n+Math.imul(k,ti)|0)+Math.imul(R,tr)|0,s=s+Math.imul(R,ti)|0,i=i+Math.imul(N,ts)|0,n=(n=n+Math.imul(N,to)|0)+Math.imul(S,ts)|0,s=s+Math.imul(S,to)|0,i=i+Math.imul(_,th)|0,n=(n=n+Math.imul(_,tu)|0)+Math.imul(x,th)|0,s=s+Math.imul(x,tu)|0,i=i+Math.imul(b,tf)|0,n=(n=n+Math.imul(b,tm)|0)+Math.imul(M,tf)|0,s=s+Math.imul(M,tm)|0;var tS=(u+(i=i+Math.imul(y,td)|0)|0)+((8191&(n=(n=n+Math.imul(y,tp)|0)+Math.imul(w,td)|0))<<13)|0;u=((s=s+Math.imul(w,tp)|0)+(n>>>13)|0)+(tS>>>26)|0,tS&=67108863,i=Math.imul(B,X),n=(n=Math.imul(B,K))+Math.imul(L,X)|0,s=Math.imul(L,K),i=i+Math.imul(C,Q)|0,n=(n=n+Math.imul(C,tt)|0)+Math.imul(P,Q)|0,s=s+Math.imul(P,tt)|0,i=i+Math.imul(T,tr)|0,n=(n=n+Math.imul(T,ti)|0)+Math.imul(U,tr)|0,s=s+Math.imul(U,ti)|0,i=i+Math.imul(k,ts)|0,n=(n=n+Math.imul(k,to)|0)+Math.imul(R,ts)|0,s=s+Math.imul(R,to)|0,i=i+Math.imul(N,th)|0,n=(n=n+Math.imul(N,tu)|0)+Math.imul(S,th)|0,s=s+Math.imul(S,tu)|0,i=i+Math.imul(_,tf)|0,n=(n=n+Math.imul(_,tm)|0)+Math.imul(x,tf)|0,s=s+Math.imul(x,tm)|0;var tO=(u+(i=i+Math.imul(b,td)|0)|0)+((8191&(n=(n=n+Math.imul(b,tp)|0)+Math.imul(M,td)|0))<<13)|0;u=((s=s+Math.imul(M,tp)|0)+(n>>>13)|0)+(tO>>>26)|0,tO&=67108863,i=Math.imul(B,Q),n=(n=Math.imul(B,tt))+Math.imul(L,Q)|0,s=Math.imul(L,tt),i=i+Math.imul(C,tr)|0,n=(n=n+Math.imul(C,ti)|0)+Math.imul(P,tr)|0,s=s+Math.imul(P,ti)|0,i=i+Math.imul(T,ts)|0,n=(n=n+Math.imul(T,to)|0)+Math.imul(U,ts)|0,s=s+Math.imul(U,to)|0,i=i+Math.imul(k,th)|0,n=(n=n+Math.imul(k,tu)|0)+Math.imul(R,th)|0,s=s+Math.imul(R,tu)|0,i=i+Math.imul(N,tf)|0,n=(n=n+Math.imul(N,tm)|0)+Math.imul(S,tf)|0,s=s+Math.imul(S,tm)|0;var tk=(u+(i=i+Math.imul(_,td)|0)|0)+((8191&(n=(n=n+Math.imul(_,tp)|0)+Math.imul(x,td)|0))<<13)|0;u=((s=s+Math.imul(x,tp)|0)+(n>>>13)|0)+(tk>>>26)|0,tk&=67108863,i=Math.imul(B,tr),n=(n=Math.imul(B,ti))+Math.imul(L,tr)|0,s=Math.imul(L,ti),i=i+Math.imul(C,ts)|0,n=(n=n+Math.imul(C,to)|0)+Math.imul(P,ts)|0,s=s+Math.imul(P,to)|0,i=i+Math.imul(T,th)|0,n=(n=n+Math.imul(T,tu)|0)+Math.imul(U,th)|0,s=s+Math.imul(U,tu)|0,i=i+Math.imul(k,tf)|0,n=(n=n+Math.imul(k,tm)|0)+Math.imul(R,tf)|0,s=s+Math.imul(R,tm)|0;var tR=(u+(i=i+Math.imul(N,td)|0)|0)+((8191&(n=(n=n+Math.imul(N,tp)|0)+Math.imul(S,td)|0))<<13)|0;u=((s=s+Math.imul(S,tp)|0)+(n>>>13)|0)+(tR>>>26)|0,tR&=67108863,i=Math.imul(B,ts),n=(n=Math.imul(B,to))+Math.imul(L,ts)|0,s=Math.imul(L,to),i=i+Math.imul(C,th)|0,n=(n=n+Math.imul(C,tu)|0)+Math.imul(P,th)|0,s=s+Math.imul(P,tu)|0,i=i+Math.imul(T,tf)|0,n=(n=n+Math.imul(T,tm)|0)+Math.imul(U,tf)|0,s=s+Math.imul(U,tm)|0;var tj=(u+(i=i+Math.imul(k,td)|0)|0)+((8191&(n=(n=n+Math.imul(k,tp)|0)+Math.imul(R,td)|0))<<13)|0;u=((s=s+Math.imul(R,tp)|0)+(n>>>13)|0)+(tj>>>26)|0,tj&=67108863,i=Math.imul(B,th),n=(n=Math.imul(B,tu))+Math.imul(L,th)|0,s=Math.imul(L,tu),i=i+Math.imul(C,tf)|0,n=(n=n+Math.imul(C,tm)|0)+Math.imul(P,tf)|0,s=s+Math.imul(P,tm)|0;var tT=(u+(i=i+Math.imul(T,td)|0)|0)+((8191&(n=(n=n+Math.imul(T,tp)|0)+Math.imul(U,td)|0))<<13)|0;u=((s=s+Math.imul(U,tp)|0)+(n>>>13)|0)+(tT>>>26)|0,tT&=67108863,i=Math.imul(B,tf),n=(n=Math.imul(B,tm))+Math.imul(L,tf)|0,s=Math.imul(L,tm);var tU=(u+(i=i+Math.imul(C,td)|0)|0)+((8191&(n=(n=n+Math.imul(C,tp)|0)+Math.imul(P,td)|0))<<13)|0;u=((s=s+Math.imul(P,tp)|0)+(n>>>13)|0)+(tU>>>26)|0,tU&=67108863;var tF=(u+(i=Math.imul(B,td))|0)+((8191&(n=(n=Math.imul(B,tp))+Math.imul(L,td)|0))<<13)|0;return u=((s=Math.imul(L,tp))+(n>>>13)|0)+(tF>>>26)|0,tF&=67108863,h[0]=tg,h[1]=ty,h[2]=tw,h[3]=tv,h[4]=tb,h[5]=tM,h[6]=tE,h[7]=t_,h[8]=tx,h[9]=tA,h[10]=tN,h[11]=tS,h[12]=tO,h[13]=tk,h[14]=tR,h[15]=tj,h[16]=tT,h[17]=tU,h[18]=tF,0!==u&&(h[19]=u,r.length++),r};function p(t,e,r){return new g().mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(d=c),s.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?c(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,s=0;s<r.length-1;s++){var o=n;n=0;for(var a=67108863&i,h=Math.min(s,e.length-1),u=Math.max(0,s-t.length+1);u<=h;u++){var l=s-u,f=(0|t.words[l])*(0|e.words[u]),m=67108863&f;o=o+(f/67108864|0)|0,a=67108863&(m=m+a|0),n+=(o=o+(m>>>26)|0)>>>26,o&=67108863}r.words[s]=a,i=o,o=n}return 0!==i?r.words[s]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},g.prototype.makeRBT=function(t){for(var e=Array(t),r=s.prototype._countBits(t)-1,i=0;i<t;i++)e[i]=this.revBin(i,r,t);return e},g.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var i=0,n=0;n<e;n++)i|=(1&t)<<e-n-1,t>>=1;return i},g.prototype.permute=function(t,e,r,i,n,s){for(var o=0;o<s;o++)i[o]=e[t[o]],n[o]=r[t[o]]},g.prototype.transform=function(t,e,r,i,n,s){this.permute(s,t,e,r,i,n);for(var o=1;o<n;o<<=1)for(var a=o<<1,h=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),l=0;l<n;l+=a)for(var f=h,m=u,c=0;c<o;c++){var d=r[l+c],p=i[l+c],g=r[l+c+o],y=i[l+c+o],w=f*g-m*y;y=f*y+m*g,g=w,r[l+c]=d+g,i[l+c]=p+y,r[l+c+o]=d-g,i[l+c+o]=p-y,c!==a&&(w=h*f-u*m,m=h*m+u*f,f=w)}},g.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},g.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=t[i];t[i]=t[r-i-1],t[r-i-1]=n,n=e[i],e[i]=-e[r-i-1],e[r-i-1]=-n}},g.prototype.normalize13b=function(t,e){for(var r=0,i=0;i<e/2;i++){var n=8192*Math.round(t[2*i+1]/e)+Math.round(t[2*i]/e)+r;t[i]=67108863&n,r=n<67108864?0:n/67108864|0}return t},g.prototype.convert13b=function(t,e,r,n){for(var s=0,o=0;o<e;o++)s+=0|t[o],r[2*o]=8191&s,s>>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*e;o<n;++o)r[o]=0;i(0===s),i((-8192&s)==0)},g.prototype.stub=function(t){for(var e=Array(t),r=0;r<t;r++)e[r]=0;return e},g.prototype.mulp=function(t,e,r){var i=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(i),s=this.stub(i),o=Array(i),a=Array(i),h=Array(i),u=Array(i),l=Array(i),f=Array(i),m=r.words;m.length=i,this.convert13b(t.words,t.length,o,i),this.convert13b(e.words,e.length,u,i),this.transform(o,s,a,h,i,n),this.transform(u,s,l,f,i,n);for(var c=0;c<i;c++){var d=a[c]*l[c]-h[c]*f[c];h[c]=a[c]*f[c]+h[c]*l[c],a[c]=d}return this.conjugate(a,h,i),this.transform(a,h,m,s,i,n),this.conjugate(m,s,i),this.normalize13b(m,i),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},s.prototype.mul=function(t){var e=new s(null);return e.words=Array(this.length+t.length),this.mulTo(t,e)},s.prototype.mulf=function(t){var e=new s(null);return e.words=Array(this.length+t.length),p(this,t,e)},s.prototype.imul=function(t){return this.clone().mulTo(t,this)},s.prototype.imuln=function(t){i("number"==typeof t),i(t<67108864);for(var e=0,r=0;r<this.length;r++){var n=(0|this.words[r])*t,s=(67108863&n)+(67108863&e);e>>=26,e+=(n/67108864|0)+(s>>>26),this.words[r]=67108863&s}return 0!==e&&(this.words[r]=e,this.length++),this},s.prototype.muln=function(t){return this.clone().imuln(t)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(t){var e=function(t){for(var e=Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=(t.words[i]&1<<n)>>>n}return e}(t);if(0===e.length)return new s(1);for(var r=this,i=0;i<e.length&&0===e[i];i++,r=r.sqr());if(++i<e.length)for(var n=r.sqr();i<e.length;i++,n=n.sqr())0!==e[i]&&(r=r.mul(n));return r},s.prototype.iushln=function(t){i("number"==typeof t&&t>=0);var e,r=t%26,n=(t-r)/26,s=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e<this.length;e++){var a=this.words[e]&s,h=(0|this.words[e])-a<<r;this.words[e]=h|o,o=a>>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},s.prototype.ishln=function(t){return i(0===this.negative),this.iushln(t)},s.prototype.iushrn=function(t,e,r){i("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var n,s=t%26,o=Math.min((t-s)/26,this.length),a=67108863^67108863>>>s<<s,h=r;if(n-=o,n=Math.max(0,n),h){for(var u=0;u<o;u++)h.words[u]=this.words[u];h.length=o}if(0===o);else if(this.length>o)for(this.length-=o,u=0;u<this.length;u++)this.words[u]=this.words[u+o];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=n);u--){var f=0|this.words[u];this.words[u]=l<<26-s|f>>>s,l=f&a}return h&&0!==l&&(h.words[h.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},s.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},s.prototype.shln=function(t){return this.clone().ishln(t)},s.prototype.ushln=function(t){return this.clone().iushln(t)},s.prototype.shrn=function(t){return this.clone().ishrn(t)},s.prototype.ushrn=function(t){return this.clone().iushrn(t)},s.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;return!(this.length<=r)&&!!(this.words[r]&1<<e)},s.prototype.imaskn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;return(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)?this:(0!==e&&r++,this.length=Math.min(r,this.length),0!==e&&(this.words[this.length-1]&=67108863^67108863>>>e<<e),this.strip())},s.prototype.maskn=function(t){return this.clone().imaskn(t)},s.prototype.iaddn=function(t){return(i("number"==typeof t),i(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)},s.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},s.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},s.prototype.addn=function(t){return this.clone().iaddn(t)},s.prototype.subn=function(t){return this.clone().isubn(t)},s.prototype.iabs=function(){return this.negative=0,this},s.prototype.abs=function(){return this.clone().iabs()},s.prototype._ishlnsubmul=function(t,e,r){var n,s,o=t.length+r;this._expand(o);var a=0;for(n=0;n<t.length;n++){s=(0|this.words[n+r])+a;var h=(0|t.words[n])*e;s-=67108863&h,a=(s>>26)-(h/67108864|0),this.words[n+r]=67108863&s}for(;n<this.length-r;n++)a=(s=(0|this.words[n+r])+a)>>26,this.words[n+r]=67108863&s;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n<this.length;n++)a=(s=-(0|this.words[n])+a)>>26,this.words[n]=67108863&s;return this.negative=1,this.strip()},s.prototype._wordDiv=function(t,e){var r,i=this.length-t.length,n=this.clone(),o=t,a=0|o.words[o.length-1];0!=(i=26-this._countBits(a))&&(o=o.ushln(i),n.iushln(i),a=0|o.words[o.length-1]);var h=n.length-o.length;if("mod"!==e){(r=new s(null)).length=h+1,r.words=Array(r.length);for(var u=0;u<r.length;u++)r.words[u]=0}var l=n.clone()._ishlnsubmul(o,1,h);0===l.negative&&(n=l,r&&(r.words[h]=1));for(var f=h-1;f>=0;f--){var m=(0|n.words[o.length+f])*67108864+(0|n.words[o.length+f-1]);for(m=Math.min(m/a|0,67108863),n._ishlnsubmul(o,m,f);0!==n.negative;)m--,n.negative=0,n._ishlnsubmul(o,1,f),n.isZero()||(n.negative^=1);r&&(r.words[f]=m)}return r&&r.strip(),n.strip(),"div"!==e&&0!==i&&n.iushrn(i),{div:r||null,mod:n}},s.prototype.divmod=function(t,e,r){var n,o,a;return(i(!t.isZero()),this.isZero())?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:n,mod:o}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):(this.negative&t.negative)!=0?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:a.div,mod:o}):t.length>this.length||0>this.cmp(t)?{div:new s(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new s(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new s(this.modn(t.words[0]))}:this._wordDiv(t,e)},s.prototype.div=function(t){return this.divmod(t,"div",!1).div},s.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},s.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},s.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),s=r.cmp(i);return s<0||1===n&&0===s?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},s.prototype.modn=function(t){i(t<=67108863);for(var e=67108864%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},s.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},s.prototype.divn=function(t){return this.clone().idivn(t)},s.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new s(1),o=new s(0),a=new s(0),h=new s(1),u=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++u;for(var l=r.clone(),f=e.clone();!e.isZero();){for(var m=0,c=1;(e.words[0]&c)==0&&m<26;++m,c<<=1);if(m>0)for(e.iushrn(m);m-->0;)(n.isOdd()||o.isOdd())&&(n.iadd(l),o.isub(f)),n.iushrn(1),o.iushrn(1);for(var d=0,p=1;(r.words[0]&p)==0&&d<26;++d,p<<=1);if(d>0)for(r.iushrn(d);d-->0;)(a.isOdd()||h.isOdd())&&(a.iadd(l),h.isub(f)),a.iushrn(1),h.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),o.isub(h)):(r.isub(e),a.isub(n),h.isub(o))}return{a:a,b:h,gcd:r.iushln(u)}},s.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e,r=this,n=t.clone();r=0!==r.negative?r.umod(t):r.clone();for(var o=new s(1),a=new s(0),h=n.clone();r.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,l=1;(r.words[0]&l)==0&&u<26;++u,l<<=1);if(u>0)for(r.iushrn(u);u-->0;)o.isOdd()&&o.iadd(h),o.iushrn(1);for(var f=0,m=1;(n.words[0]&m)==0&&f<26;++f,m<<=1);if(f>0)for(n.iushrn(f);f-->0;)a.isOdd()&&a.iadd(h),a.iushrn(1);r.cmp(n)>=0?(r.isub(n),o.isub(a)):(n.isub(r),a.isub(o))}return 0>(e=0===r.cmpn(1)?o:a).cmpn(0)&&e.iadd(t),e},s.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var s=e;e=r,r=s}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},s.prototype.invm=function(t){return this.egcd(t).a.umod(t)},s.prototype.isEven=function(){return(1&this.words[0])==0},s.prototype.isOdd=function(){return(1&this.words[0])==1},s.prototype.andln=function(t){return this.words[0]&t},s.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var s=n,o=r;0!==s&&o<this.length;o++){var a=0|this.words[o];a+=s,s=a>>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},s.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},s.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){i<n?e=-1:i>n&&(e=1);break}}return e},s.prototype.gtn=function(t){return 1===this.cmpn(t)},s.prototype.gt=function(t){return 1===this.cmp(t)},s.prototype.gten=function(t){return this.cmpn(t)>=0},s.prototype.gte=function(t){return this.cmp(t)>=0},s.prototype.ltn=function(t){return-1===this.cmpn(t)},s.prototype.lt=function(t){return-1===this.cmp(t)},s.prototype.lten=function(t){return 0>=this.cmpn(t)},s.prototype.lte=function(t){return 0>=this.cmp(t)},s.prototype.eqn=function(t){return 0===this.cmpn(t)},s.prototype.eq=function(t){return 0===this.cmp(t)},s.red=function(t){return new _(t)},s.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},s.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(t){return this.red=t,this},s.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},s.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},s.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},s.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},s.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},s.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},s.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},s.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},s.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var y={k256:null,p224:null,p192:null,p25519:null};function w(t,e){this.name=t,this.p=new s(e,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function _(t){if("string"==typeof t){var e=s._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function x(t){_.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var t=new s(null);return t.words=Array(Math.ceil(this.n/13)),t},w.prototype.ireduce=function(t){var e,r=t;do this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(e>this.n);var i=e<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(t,e){t.iushrn(this.n,0,e)},w.prototype.imulK=function(t){return t.imul(this.k)},n(v,w),v.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i<r;i++)e.words[i]=t.words[i];if(e.length=r,t.length<=9){t.words[0]=0,t.length=1;return}var n=t.words[9];for(i=10,e.words[e.length++]=4194303&n;i<t.length;i++){var s=0|t.words[i];t.words[i-10]=(4194303&s)<<4|n>>>22,n=s}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},v.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var i=0|t.words[r];e+=977*i,t.words[r]=67108863&e,e=64*i+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(b,w),n(M,w),n(E,w),E.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var i=(0|t.words[r])*19+e,n=67108863&i;i>>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},s._prime=function(t){var e;if(y[t])return y[t];if("k256"===t)e=new v;else if("p224"===t)e=new b;else if("p192"===t)e=new M;else if("p25519"===t)e=new E;else throw Error("Unknown prime "+t);return y[t]=e,e},_.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},_.prototype._verify2=function(t,e){i((t.negative|e.negative)==0,"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},_.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},_.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},_.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},_.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},_.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},_.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r},_.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},_.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},_.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},_.prototype.isqr=function(t){return this.imul(t,t.clone())},_.prototype.sqr=function(t){return this.mul(t,t)},_.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new s(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);i(!n.isZero());var a=new s(1).toRed(this),h=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new s(2*l*l).toRed(this);0!==this.pow(l,u).cmp(h);)l.redIAdd(h);for(var f=this.pow(l,n),m=this.pow(t,n.addn(1).iushrn(1)),c=this.pow(t,n),d=o;0!==c.cmp(a);){for(var p=c,g=0;0!==p.cmp(a);g++)p=p.redSqr();i(g<d);var y=this.pow(f,new s(1).iushln(d-g-1));m=m.redMul(y),f=y.redSqr(),c=c.redMul(f),d=g}return m},_.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},_.prototype.pow=function(t,e){if(e.isZero())return new s(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=Array(16);r[0]=new s(1).toRed(this),r[1]=t;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],t);var n=r[0],o=0,a=0,h=e.bitLength()%26;for(0===h&&(h=26),i=e.length-1;i>=0;i--){for(var u=e.words[i],l=h-1;l>=0;l--){var f=u>>l&1;if(n!==r[0]&&(n=this.sqr(n)),0===f&&0===o){a=0;continue}o<<=1,o|=f,(4==++a||0===i&&0===l)&&(n=this.mul(n,r[o]),a=0,o=0)}h=26}return n},_.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},_.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},s.mont=function(t){return new x(t)},n(x,_),x.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},x.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},x.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):0>n.cmpn(0)&&(s=n.iadd(this.m)),s._forceRed(this)},x.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new s(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):0>n.cmpn(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)}}(t=r.nmd(t),this)},65068:function(t,e,r){"use strict";r.d(e,{z:function(){return o}});var i=r(67294),n=r(93552),s=function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&0>e.indexOf(i)&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)0>e.indexOf(i[n])&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r};let o=i.forwardRef((t,e)=>{var{color:r}=t,o=s(t,["color"]);return i.createElement("svg",Object.assign({},(0,n.ti)(o),{ref:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"}),i.createElement("path",{d:"M16.293 9.29291L13 12.5859V4H11V12.5857L7.70718 9.29291L6.29297 10.7071L12.0001 16.4142L17.7072 10.7071L16.293 9.29291Z",fill:r}),i.createElement("path",{d:"M6 20H18V18H6V20Z",fill:r}))});o.displayName="Deposit"},73444:function(t,e,r){"use strict";r.d(e,{e:function(){return o}});var i=r(67294),n=r(93552),s=function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&0>e.indexOf(i)&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)0>e.indexOf(i[n])&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r};let o=i.forwardRef((t,e)=>{var{color:r}=t,o=s(t,["color"]);return i.createElement("svg",Object.assign({},(0,n.ti)(o),{ref:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"}),i.createElement("path",{d:"M17.707 9.29286L16.2928 10.7071L13 7.41426L13 16H11L11 7.41411L7.70703 10.7071L6.29282 9.29286L11.9999 3.58575L17.707 9.29286Z",fill:r}),i.createElement("path",{d:"M6 20H18V18H6V20Z",fill:r}))});o.displayName="Withdraw"},99431:function(t,e,r){"use strict";r.d(e,{O:function(){return h}});var i=r(67294),n=r(86010),s=r(23458),o=r.n(s),a=function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&0>e.indexOf(i)&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)0>e.indexOf(i[n])&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r};let h=t=>{let{status:e="pending",width:r="100%",height:s,children:h,className:u}=t,l=a(t,["status","width","height","children","className"]);return i.createElement("div",Object.assign({className:(0,n.Z)(o().skeleton,u,{[o().error]:"error"===e},"label-2"),style:{width:r,height:s},"data-testid":"pending"===e?"skeleton-pending":"skeleton-error"},l),h)}},23458:function(t){t.exports={skeleton:"Skeleton_skeleton__D6YkJ",shimmer:"Skeleton_shimmer__syugd",error:"Skeleton_error__7IrGz"}}}]);