diff --git a/js/jcwallet.js b/js/jcwallet.js index b32d644..fa9ee38 100644 --- a/js/jcwallet.js +++ b/js/jcwallet.js @@ -13,7 +13,7 @@ var n=r(0),a=n.Buffer;function i(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r) * * @author Feross Aboukhadijeh * @license MIT - */function i(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,a=0,i=Math.min(r,n);a=0;f--)if(s[f]!==u[f])return!1;for(f=s.length-1;f>=0;f--)if(o=s[f],!g(e[o],t[o],r,n))return!1;return!0}(e,t,r,a))}return r?e===t:e==t}function w(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function _(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function M(e,t,r,n){var a;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),a=function(e){var t;try{e()}catch(e){t=e}return t}(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!a&&y(a,r,"Missing expected exception"+n);var i="string"==typeof n,o=!e&&a&&!r;if((!e&&c.isError(a)&&i&&_(a,r)||o)&&y(a,r,"Got unwanted exception"+n),e&&a&&r&&!_(a,r)||!e&&a)throw a}h.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return m(x(e.actual),128)+" "+e.operator+" "+m(x(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||y;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,a=p(t),i=n.indexOf("\n"+a);if(i>=0){var o=n.indexOf("\n",i+1);n=n.substring(o+1)}this.stack=n}}},c.inherits(h.AssertionError,Error),h.fail=y,h.ok=v,h.equal=function(e,t,r){e!=t&&y(e,t,r,"==",h.equal)},h.notEqual=function(e,t,r){e==t&&y(e,t,r,"!=",h.notEqual)},h.deepEqual=function(e,t,r){g(e,t,!1)||y(e,t,r,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(e,t,r){g(e,t,!0)||y(e,t,r,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(e,t,r){g(e,t,!1)&&y(e,t,r,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function e(t,r,n){g(t,r,!0)&&y(t,r,n,"notDeepStrictEqual",e)},h.strictEqual=function(e,t,r){e!==t&&y(e,t,r,"===",h.strictEqual)},h.notStrictEqual=function(e,t,r){e===t&&y(e,t,r,"!==",h.notStrictEqual)},h.throws=function(e,t,r){M(!0,e,t,r)},h.doesNotThrow=function(e,t,r){M(!1,e,t,r)},h.ifError=function(e){if(e)throw e},h.strict=a((function e(t,r){t||y(t,!0,r,"==",e)}),h,{equal:h.strictEqual,deepEqual:h.deepStrictEqual,notEqual:h.notStrictEqual,notDeepEqual:h.notDeepStrictEqual}),h.strict.strict=h.strict;var k=Object.keys||function(e){var t=[];for(var r in e)f.call(e,r)&&t.push(r);return t}}).call(this,r(13))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";var n=r(376),a=r(377);e.exports={errors:n,formatters:a}},function(e,t,r){"use strict";var n;function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,"b",(function(){return i})),r.d(t,"d",(function(){return o})),r.d(t,"c",(function(){return c})),r.d(t,"e",(function(){return f})),r.d(t,"f",(function(){return d})),r.d(t,"a",(function(){return s}));var i="INTERNAL_ERROR",o="SERVER_ERROR",c=[-32700,-32600,-32601,-32602,-32603],f=[-32e3,-32099],d=(a(n={},"PARSE_ERROR",{code:-32700,message:"Parse error"}),a(n,"INVALID_REQUEST",{code:-32600,message:"Invalid Request"}),a(n,"METHOD_NOT_FOUND",{code:-32601,message:"Method not found"}),a(n,"INVALID_PARAMS",{code:-32602,message:"Invalid params"}),a(n,i,{code:-32603,message:"Internal error"}),a(n,o,{code:-32e3,message:"Server error"}),n),s=o},function(e,t,r){"use strict";(function(t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=r(196),i=r(195);function o(e){var t=e;if("string"!=typeof t)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+n(t)+", while padToEven.");return t.length%2&&(t="0"+t),t}function c(e){return"0x"+e.toString(16)}e.exports={arrayContainsArray:function(e,t,r){if(!0!==Array.isArray(e))throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+n(e)+"'");if(!0!==Array.isArray(t))throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+n(t)+"'");return t[Boolean(r)?"some":"every"]((function(t){return e.indexOf(t)>=0}))},intToBuffer:function(e){var r=c(e);return new t(o(r.slice(2)),"hex")},getBinarySize:function(e){if("string"!=typeof e)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+n(e)+"'.");return t.byteLength(e,"utf8")},isHexPrefixed:a,stripHexPrefix:i,padToEven:o,intToHex:c,fromAscii:function(e){for(var t="",r=0;rr.length)throw new Error("invalid rlp: total length is larger than the data");if(0===(c=r.slice(a,u)).length)throw new Error("invalid rlp, List has a invalid length");for(;c.length;)f=t(c),d.push(f.data),c=f.remainder;return{data:d,remainder:r.slice(u)}}(d(t));if(r)return n;if(0!==n.remainder.length)throw new Error("invalid remainder");return n.data},t.getLength=function(t){if(!t||0===t.length)return e.from([]);var r=d(t),n=r[0];if(n<=127)return r.length;if(n<=183)return n-127;if(n<=191)return n-182;if(n<=247)return n-191;var a=n-246;return a+i(r.slice(1,a).toString("hex"),16)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{f(n.next(e))}catch(e){i(e)}}function c(e){try{f(n.throw(e))}catch(e){i(e)}}function f(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}f((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=o.trys,(a=a.length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]0&&o.length>a&&!o.warned){o.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=e,f.type=t,f.count=o.length,c=f,console&&console.warn&&console.warn(c)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},a=h.bind(n);return a.listener=r,n.wrapFn=a,a}function p(e,t,r){var n=e._events;if(void 0===n)return[];var a=n[t];return void 0===a?[]:"function"==typeof a?r?[a.listener||a]:[a]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(i=t[0]),i instanceof Error)throw i;var c=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw c.context=i,c}var f=a[e];if(void 0===f)return!1;if("function"==typeof f)o(f,this,t);else{var d=f.length,s=x(f,d);for(r=0;r=0;i--)if(r[i]===t||r[i].listener===t){o=r[i].listener,a=i;break}if(a<0)return this;0===a?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},f.prototype.listeners=function(e){return p(this,e,!0)},f.prototype.rawListeners=function(e){return p(this,e,!1)},f.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},f.prototype.listenerCount=m,f.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]}},function(e,t,r){var n,a,i,o;function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}o=function(e){var t,r,n,a,i,o,c;return r=(t=e).lib,n=r.Base,a=r.WordArray,i=t.algo,o=i.MD5,c=i.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r,n=this.cfg,i=n.hasher.create(),o=a.create(),c=o.words,f=n.keySize,d=n.iterations;c.length=0&&(i=r.type.substring(o));var c=e(t,r.components);Array.isArray(c)&&t?a.push("tuple("+c.join(",")+")"+i):t?a.push("("+c+")"):a.push("("+c.join(",")+")"+i)}else a.push(r.type)})),a},s=function(e){if(!i.isHexStrict(e))throw new Error("The parameter must be a valid HEX string.");var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r7?r+=e[n].toUpperCase():r+=e[n];return r},toHex:i.toHex,toBN:i.toBN,bytesToHex:i.bytesToHex,hexToBytes:i.hexToBytes,hexToNumberString:i.hexToNumberString,hexToNumber:i.hexToNumber,toDecimal:i.hexToNumber,numberToHex:i.numberToHex,fromDecimal:i.numberToHex,hexToUtf8:i.hexToUtf8,hexToString:i.hexToUtf8,toUtf8:i.hexToUtf8,stripHexPrefix:i.stripHexPrefix,utf8ToHex:i.utf8ToHex,stringToHex:i.utf8ToHex,fromUtf8:i.utf8ToHex,hexToAscii:s,toAscii:s,asciiToHex:u,fromAscii:u,unitMap:a.unitMap,toWei:function(e,t){if(t=b(t),!i.isBN(e)&&"string"!=typeof e)throw new Error("Please pass numbers as strings or BN objects to avoid precision errors.");return i.isBN(e)?a.toWei(e,t):a.toWei(e,t).toString(10)},fromWei:function(e,t){if(t=b(t),!i.isBN(e)&&"string"!=typeof e)throw new Error("Please pass numbers as strings or BN objects to avoid precision errors.");return i.isBN(e)?a.fromWei(e,t):a.fromWei(e,t).toString(10)},padLeft:i.leftPad,leftPad:i.leftPad,padRight:i.rightPad,rightPad:i.rightPad,toTwosComplement:i.toTwosComplement,isBloom:i.isBloom,isUserEthereumAddressInBloom:i.isUserEthereumAddressInBloom,isContractAddressInBloom:i.isContractAddressInBloom,isTopic:i.isTopic,isTopicInBloom:i.isTopicInBloom,isInBloom:i.isInBloom,compareBlockNumbers:function(e,t){if(e==t)return 0;if("genesis"!=e&&"earliest"!=e&&0!=e||"genesis"!=t&&"earliest"!=t&&0!=t){if("genesis"==e||"earliest"==e)return-1;if("genesis"==t||"earliest"==t)return 1;if("latest"==e)return"pending"==t?-1:1;if("latest"===t)return"pending"==e?1:-1;if("pending"==e)return 1;if("pending"==t)return-1;var r=new f(e),n=new f(t);return r.lt(n)?-1:r.eq(n)?0:1}return 0},toNumber:i.toNumber}},function(e,t,r){var n,a,i,o;function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}o=function(e){return function(t){var r=e,n=r.lib,a=n.WordArray,i=n.Hasher,o=r.algo,c=[];!function(){for(var e=0;e<64;e++)c[e]=4294967296*t.abs(t.sin(e+1))|0}();var f=o.MD5=i.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,a=e[n];e[n]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}var i=this._hash.words,o=e[t+0],f=e[t+1],h=e[t+2],l=e[t+3],p=e[t+4],m=e[t+5],x=e[t+6],y=e[t+7],v=e[t+8],g=e[t+9],w=e[t+10],_=e[t+11],M=e[t+12],k=e[t+13],S=e[t+14],A=e[t+15],E=i[0],O=i[1],T=i[2],P=i[3];E=d(E,O,T,P,o,7,c[0]),P=d(P,E,O,T,f,12,c[1]),T=d(T,P,E,O,h,17,c[2]),O=d(O,T,P,E,l,22,c[3]),E=d(E,O,T,P,p,7,c[4]),P=d(P,E,O,T,m,12,c[5]),T=d(T,P,E,O,x,17,c[6]),O=d(O,T,P,E,y,22,c[7]),E=d(E,O,T,P,v,7,c[8]),P=d(P,E,O,T,g,12,c[9]),T=d(T,P,E,O,w,17,c[10]),O=d(O,T,P,E,_,22,c[11]),E=d(E,O,T,P,M,7,c[12]),P=d(P,E,O,T,k,12,c[13]),T=d(T,P,E,O,S,17,c[14]),E=s(E,O=d(O,T,P,E,A,22,c[15]),T,P,f,5,c[16]),P=s(P,E,O,T,x,9,c[17]),T=s(T,P,E,O,_,14,c[18]),O=s(O,T,P,E,o,20,c[19]),E=s(E,O,T,P,m,5,c[20]),P=s(P,E,O,T,w,9,c[21]),T=s(T,P,E,O,A,14,c[22]),O=s(O,T,P,E,p,20,c[23]),E=s(E,O,T,P,g,5,c[24]),P=s(P,E,O,T,S,9,c[25]),T=s(T,P,E,O,l,14,c[26]),O=s(O,T,P,E,v,20,c[27]),E=s(E,O,T,P,k,5,c[28]),P=s(P,E,O,T,h,9,c[29]),T=s(T,P,E,O,y,14,c[30]),E=u(E,O=s(O,T,P,E,M,20,c[31]),T,P,m,4,c[32]),P=u(P,E,O,T,v,11,c[33]),T=u(T,P,E,O,_,16,c[34]),O=u(O,T,P,E,S,23,c[35]),E=u(E,O,T,P,f,4,c[36]),P=u(P,E,O,T,p,11,c[37]),T=u(T,P,E,O,y,16,c[38]),O=u(O,T,P,E,w,23,c[39]),E=u(E,O,T,P,k,4,c[40]),P=u(P,E,O,T,o,11,c[41]),T=u(T,P,E,O,l,16,c[42]),O=u(O,T,P,E,x,23,c[43]),E=u(E,O,T,P,g,4,c[44]),P=u(P,E,O,T,M,11,c[45]),T=u(T,P,E,O,A,16,c[46]),E=b(E,O=u(O,T,P,E,h,23,c[47]),T,P,o,6,c[48]),P=b(P,E,O,T,y,10,c[49]),T=b(T,P,E,O,S,15,c[50]),O=b(O,T,P,E,m,21,c[51]),E=b(E,O,T,P,M,6,c[52]),P=b(P,E,O,T,l,10,c[53]),T=b(T,P,E,O,w,15,c[54]),O=b(O,T,P,E,f,21,c[55]),E=b(E,O,T,P,v,6,c[56]),P=b(P,E,O,T,A,10,c[57]),T=b(T,P,E,O,x,15,c[58]),O=b(O,T,P,E,k,21,c[59]),E=b(E,O,T,P,p,6,c[60]),P=b(P,E,O,T,_,10,c[61]),T=b(T,P,E,O,h,15,c[62]),O=b(O,T,P,E,g,21,c[63]),i[0]=i[0]+E|0,i[1]=i[1]+O|0,i[2]=i[2]+T|0,i[3]=i[3]+P|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,a=8*e.sigBytes;r[a>>>5]|=128<<24-a%32;var i=t.floor(n/4294967296),o=n;r[15+(a+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),r[14+(a+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),e.sigBytes=4*(r.length+1),this._process();for(var c=this._hash,f=c.words,d=0;d<4;d++){var s=f[d];f[d]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return c},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function d(e,t,r,n,a,i,o){var c=e+(t&r|~t&n)+a+o;return(c<>>32-i)+t}function s(e,t,r,n,a,i,o){var c=e+(t&n|r&~n)+a+o;return(c<>>32-i)+t}function u(e,t,r,n,a,i,o){var c=e+(t^r^n)+a+o;return(c<>>32-i)+t}function b(e,t,r,n,a,i,o){var c=e+(r^(t|~n))+a+o;return(c<>>32-i)+t}r.MD5=i._createHelper(f),r.HmacMD5=i._createHmacHelper(f)}(Math),e.MD5},"object"===c(t)?e.exports=t=o(r(2)):(a=[r(2)],void 0===(i="function"==typeof(n=o)?n.apply(t,a):n)||(e.exports=i))},function(e,t,r){"use strict";var n=t,a=r(9),i=r(30),o=r(201);n.assert=i,n.toArray=o.toArray,n.zero2=o.zero2,n.toHex=o.toHex,n.encode=o.encode,n.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var a=1<(a>>1)-1?(a>>1)-f:f,i.isubn(c)):c=0,n[o]=c,i.iushrn(1)}return n},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,a=0,i=0;e.cmpn(-a)>0||t.cmpn(-i)>0;){var o,c,f=e.andln(3)+a&3,d=t.andln(3)+i&3;3===f&&(f=-1),3===d&&(d=-1),o=0==(1&f)?0:3!==(n=e.andln(7)+a&7)&&5!==n||2!==d?f:-f,r[0].push(o),c=0==(1&d)?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==f?d:-d,r[1].push(c),2*a===o+1&&(a=1-a),2*i===c+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new a(e,"hex","le")}},function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=r,r.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},function(e,t,r){var n,a,i,o;function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}o=function(e){var t,r;return r=(t=e).lib.WordArray,t.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var a=[],i=0;i>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,c=0;c<4&&i+.75*c>>6*(3-c)&63));var f=n.charAt(64);if(f)for(;a.length%4;)a.push(f);return a.join("")},parse:function(e){var t=e.length,n=this._map,a=this._reverseMap;if(!a){a=this._reverseMap=[];for(var i=0;i>>6-o%4*2,d=c|f;a[i>>>2]|=d<<24-i%4*8,i++}return r.create(a,i)}(e,t,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},e.enc.Base64},"object"===c(t)?e.exports=t=o(r(2)):(a=[r(2)],void 0===(i="function"==typeof(n=o)?n.apply(t,a):n)||(e.exports=i))},function(e,t,r){"use strict";(function(t,n){var a=r(6).Buffer,i=t.crypto||t.msCrypto;function o(e){for(var t=0,r=e.length;t4294967295)throw new RangeError("requested too many random bytes");var r=a.allocUnsafe(e);if(e>0)if(e>65536)for(var o=0;o4294967295)throw new RangeError("requested too many random bytes");var r=a.allocUnsafe(e);if(e>0)if(e>65536)for(var i=0;i>1]>>4>=8&&(t[f]=t[f].toUpperCase()),(15&c[f>>1])>=8&&(t[f+1]=t[f+1].toUpperCase());return"0x"+t.join("")}for(var f={},d=0;d<10;d++)f[String(d)]=String(d);for(var s=0;s<26;s++)f[String.fromCharCode(65+s)]=String(10+s);var u,b=Math.floor((u=9007199254740991,Math.log10?Math.log10(u):Math.log(u)/Math.LN10));function h(e){for(var t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((function(e){return f[e]})).join("");t.length>=b;){var r=t.substring(0,b);t=parseInt(r,10)%97+t.substring(r.length)}for(var n=String(98-parseInt(t,10)%97);n.length<2;)n="0"+n;return n}function l(e){var t=null;if("string"!=typeof e&&o.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=c(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&o.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==h(e)&&o.throwArgumentError("bad icap checksum","address",e),t=Object(a.c)(e.substring(4));t.length<40;)t="0"+t;t=c("0x"+t)}else o.throwArgumentError("invalid address","address",e);return t}},function(e,t,r){"use strict";r.d(t,"b",(function(){return f})),r.d(t,"a",(function(){return u}));var n=r(1),a=r(3),i=new a.a("rlp/5.6.1");function o(e){for(var t=[];e;)t.unshift(255&e),e>>=8;return t}function c(e,t,r){for(var n=0,a=0;at+1+n&&i.throwError("child data too short",a.a.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:o}}function s(e,t){if(0===e.length&&i.throwError("data too short",a.a.errors.BUFFER_OVERRUN,{}),e[t]>=248){var r=e[t]-247;t+1+r>e.length&&i.throwError("data short segment too short",a.a.errors.BUFFER_OVERRUN,{});var o=c(e,t+1,r);return t+1+r+o>e.length&&i.throwError("data long segment too short",a.a.errors.BUFFER_OVERRUN,{}),d(e,t,t+1+r,r+o)}if(e[t]>=192){var f=e[t]-192;return t+1+f>e.length&&i.throwError("data array too short",a.a.errors.BUFFER_OVERRUN,{}),d(e,t,t+1,f)}if(e[t]>=184){var s=e[t]-183;t+1+s>e.length&&i.throwError("data array too short",a.a.errors.BUFFER_OVERRUN,{});var u=c(e,t+1,s);return t+1+s+u>e.length&&i.throwError("data array too short",a.a.errors.BUFFER_OVERRUN,{}),{consumed:1+s+u,result:Object(n.g)(e.slice(t+1+s,t+1+s+u))}}if(e[t]>=128){var b=e[t]-128;return t+1+b>e.length&&i.throwError("data too short",a.a.errors.BUFFER_OVERRUN,{}),{consumed:1+b,result:Object(n.g)(e.slice(t+1,t+1+b))}}return{consumed:1,result:Object(n.g)(e[t])}}function u(e){var t=Object(n.a)(e),r=s(t,0);return r.consumed!==t.length&&i.throwArgumentError("invalid rlp data","data",e),r.result}},function(e,t,r){"use strict";var n=r(30),a=r(4);function i(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function c(e){return 1===e.length?"0"+e:e}function f(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=a,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),a=0;a>6|192,r[n++]=63&o|128):i(e,a)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++a)),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=63&o|128)}else for(a=0;a>>0}return o},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,a=0;n>>24,r[a+1]=i>>>16&255,r[a+2]=i>>>8&255,r[a+3]=255&i):(r[a+3]=i>>>24,r[a+2]=i>>>16&255,r[a+1]=i>>>8&255,r[a]=255&i)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,a){return e+t+r+n+a>>>0},t.sum64=function(e,t,r,n){var a=e[t],i=n+e[t+1]>>>0,o=(i>>0,e[t+1]=i},t.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,a,i,o,c){var f=0,d=t;return f+=(d=d+n>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,r,n,a,i,o,c){return t+n+i+c>>>0},t.sum64_5_hi=function(e,t,r,n,a,i,o,c,f,d){var s=0,u=t;return s+=(u=u+n>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,n,a,i,o,c,f,d){return t+n+i+c+d>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return a(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var c=o(r(98));t.BN=c.default;var f=i(r(21));t.rlp=f},function(e,t,r){"use strict";var n=t;n.version=r(387).version,n.utils=r(29),n.rand=r(124),n.curve=r(202),n.curves=r(125),n.ec=r(399),n.eddsa=r(403)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(128),a=r(407);t.keccak224=n.createHashFunction((function(){return a("keccak224")})),t.keccak256=n.createHashFunction((function(){return a("keccak256")})),t.keccak384=n.createHashFunction((function(){return a("keccak384")})),t.keccak512=n.createHashFunction((function(){return a("keccak512")}))},function(e,t,r){"use strict";var n=r(6).Buffer,a=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===a||!a(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=f,this.end=d,t=4;break;case"utf8":this.fillLast=c,t=4;break;case"base64":this.text=s,this.end=u,t=3;break;default:return this.write=b,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function c(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function f(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function d(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function s(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function u(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function b(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return a>0&&(e.lastNeed=a-1),a;if(--n=0)return a>0&&(e.lastNeed=a-2),a;if(--n=0)return a>0&&(2===a?a=0:e.lastNeed=a-3),a;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return a(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var c=o(r(580));t.BN=c.default;var f=i(r(21));t.rlp=f},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return a(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var c=o(r(587));t.BN=c.default;var f=i(r(21));t.rlp=f},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return a(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var c=o(r(650));t.BN=c.default;var f=i(r(21));t.rlp=f},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return a(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var c=o(r(707));t.BN=c.default;var f=i(r(21));t.rlp=f},function(e,t,r){(function(e){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n=a)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),c=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(r)?n.showHidden=r:r&&t._extend(n,r),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=d),u(n,e,n.depth)}function d(e,t){var r=f.styles[t];return r?"["+f.colors[r][0]+"m"+e+"["+f.colors[r][1]+"m":e}function s(e,t){return e}function u(e,r,n){if(e.customInspect&&r&&k(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var a=r.inspect(n,e);return y(a)||(a=u(e,a,n)),a}var i=function(e,t){if(v(t))return e.stylize("undefined","undefined");if(y(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(x(t))return e.stylize(""+t,"number");if(p(t))return e.stylize(""+t,"boolean");if(m(t))return e.stylize("null","null")}(e,r);if(i)return i;var o=Object.keys(r),c=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),M(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return b(r);if(0===o.length){if(k(r)){var f=r.name?": "+r.name:"";return e.stylize("[Function"+f+"]","special")}if(g(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(_(r))return e.stylize(Date.prototype.toString.call(r),"date");if(M(r))return b(r)}var d,s="",w=!1,S=["{","}"];(l(r)&&(w=!0,S=["[","]"]),k(r))&&(s=" [Function"+(r.name?": "+r.name:"")+"]");return g(r)&&(s=" "+RegExp.prototype.toString.call(r)),_(r)&&(s=" "+Date.prototype.toUTCString.call(r)),M(r)&&(s=" "+b(r)),0!==o.length||w&&0!=r.length?n<0?g(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),d=w?function(e,t,r,n,a){for(var i=[],o=0,c=t.length;o=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(d,s,S)):S[0]+s+S[1]}function b(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,a,i){var o,c,f;if((f=Object.getOwnPropertyDescriptor(t,a)||{value:t[a]}).get?c=f.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):f.set&&(c=e.stylize("[Setter]","special")),T(n,a)||(o="["+a+"]"),c||(e.seen.indexOf(f.value)<0?(c=m(r)?u(e,f.value,null):u(e,f.value,r-1)).indexOf("\n")>-1&&(c=i?c.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+c.split("\n").map((function(e){return" "+e})).join("\n")):c=e.stylize("[Circular]","special")),v(o)){if(i&&a.match(/^\d+$/))return c;(o=JSON.stringify(""+a)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+c}function l(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function m(e){return null===e}function x(e){return"number"==typeof e}function y(e){return"string"==typeof e}function v(e){return void 0===e}function g(e){return w(e)&&"[object RegExp]"===S(e)}function w(e){return"object"===n(e)&&null!==e}function _(e){return w(e)&&"[object Date]"===S(e)}function M(e){return w(e)&&("[object Error]"===S(e)||e instanceof Error)}function k(e){return"function"==typeof e}function S(e){return Object.prototype.toString.call(e)}function A(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(r){if(v(o)&&(o=e.env.NODE_DEBUG||""),r=r.toUpperCase(),!c[r])if(new RegExp("\\b"+r+"\\b","i").test(o)){var n=e.pid;c[r]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",r,n,e)}}else c[r]=function(){};return c[r]},t.inspect=f,f.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},f.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=l,t.isBoolean=p,t.isNull=m,t.isNullOrUndefined=function(e){return null==e},t.isNumber=x,t.isString=y,t.isSymbol=function(e){return"symbol"===n(e)},t.isUndefined=v,t.isRegExp=g,t.isObject=w,t.isDate=_,t.isError=M,t.isFunction=k,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"===n(e)||void 0===e},t.isBuffer=r(374);var E=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function O(){var e=new Date,t=[A(e.getHours()),A(e.getMinutes()),A(e.getSeconds())].join(":");return[e.getDate(),E[e.getMonth()],t].join(" ")}function T(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",O(),t.format.apply(t,arguments))},t.inherits=r(375),t._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var P="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function j(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(P&&e[P]){var t;if("function"!=typeof(t=e[P]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,P,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),a=[],i=0;i=9007199254740991||t<=-9007199254740991)&&m("overflow","BigNumber.from",t),e.from(String(t));var r=t;if("bigint"==typeof r)return e.from(r.toString());if(Object(i.h)(r))return e.from(Object(i.g)(r));if(r)if(r.toHexString){var n=r.toHexString();if("string"==typeof n)return e.from(n)}else{var a=r._hex;if(null==a&&"BigNumber"===r.type&&(a=r.hex),"string"==typeof a&&(Object(i.j)(a)||"-"===a[0]&&Object(i.j)(a.substring(1))))return e.from(a)}return d.throwArgumentError("invalid BigNumber value","value",t)}},{key:"isBigNumber",value:function(e){return!(!e||!e._isBigNumber)}}],(r=[{key:"fromTwos",value:function(e){return l(p(this).fromTwos(e))}},{key:"toTwos",value:function(e){return l(p(this).toTwos(e))}},{key:"abs",value:function(){return"-"===this._hex[0]?e.from(this._hex.substring(1)):this}},{key:"add",value:function(e){return l(p(this).add(p(e)))}},{key:"sub",value:function(e){return l(p(this).sub(p(e)))}},{key:"div",value:function(t){return e.from(t).isZero()&&m("division-by-zero","div"),l(p(this).div(p(t)))}},{key:"mul",value:function(e){return l(p(this).mul(p(e)))}},{key:"mod",value:function(e){var t=p(e);return t.isNeg()&&m("division-by-zero","mod"),l(p(this).umod(t))}},{key:"pow",value:function(e){var t=p(e);return t.isNeg()&&m("negative-power","pow"),l(p(this).pow(t))}},{key:"and",value:function(e){var t=p(e);return(this.isNegative()||t.isNeg())&&m("unbound-bitwise-result","and"),l(p(this).and(t))}},{key:"or",value:function(e){var t=p(e);return(this.isNegative()||t.isNeg())&&m("unbound-bitwise-result","or"),l(p(this).or(t))}},{key:"xor",value:function(e){var t=p(e);return(this.isNegative()||t.isNeg())&&m("unbound-bitwise-result","xor"),l(p(this).xor(t))}},{key:"mask",value:function(e){return(this.isNegative()||e<0)&&m("negative-width","mask"),l(p(this).maskn(e))}},{key:"shl",value:function(e){return(this.isNegative()||e<0)&&m("negative-width","shl"),l(p(this).shln(e))}},{key:"shr",value:function(e){return(this.isNegative()||e<0)&&m("negative-width","shr"),l(p(this).shrn(e))}},{key:"eq",value:function(e){return p(this).eq(p(e))}},{key:"lt",value:function(e){return p(this).lt(p(e))}},{key:"lte",value:function(e){return p(this).lte(p(e))}},{key:"gt",value:function(e){return p(this).gt(p(e))}},{key:"gte",value:function(e){return p(this).gte(p(e))}},{key:"isNegative",value:function(){return"-"===this._hex[0]}},{key:"isZero",value:function(){return p(this).isZero()}},{key:"toNumber",value:function(){try{return p(this).toNumber()}catch(e){m("overflow","toNumber",this.toString())}return null}},{key:"toBigInt",value:function(){try{return BigInt(this.toString())}catch(e){}return d.throwError("this platform does not support BigInt",o.a.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}},{key:"toString",value:function(){return arguments.length>0&&(10===arguments[0]?u||(u=!0,d.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?d.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",o.a.errors.UNEXPECTED_ARGUMENT,{}):d.throwError("BigNumber.toString does not accept parameters",o.a.errors.UNEXPECTED_ARGUMENT,{})),p(this).toString(10)}},{key:"toHexString",value:function(){return this._hex}},{key:"toJSON",value:function(e){return{type:"BigNumber",hex:this.toHexString()}}}])&&c(t.prototype,r),n&&c(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function h(e){if("string"!=typeof e)return h(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&d.throwArgumentError("invalid hex","value",e),"0x00"===(e=h(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function l(e){return b.from(h(e))}function p(e){var t=b.from(e).toHexString();return"-"===t[0]?new f("-"+t.substring(3),16):new f(t.substring(2),16)}function m(e,t,r){var n={fault:e,operation:t};return null!=r&&(n.value=r),d.throwError(e,o.a.errors.NUMERIC_FAULT,n)}function x(e){return new f(e,36).toString(16)}function y(e){return new f(e,16).toString(36)}},function(e,t,r){var n=r(373),a=r(475);e.exports={packageInit:function(e,t){if(t=Array.prototype.slice.call(t),!e)throw new Error('You need to instantiate using the "new" keyword.');Object.defineProperty(e,"currentProvider",{get:function(){return e._provider},set:function(t){return e.setProvider(t)},enumerable:!0,configurable:!0}),t[0]&&t[0]._requestManager?e._requestManager=t[0]._requestManager:e._requestManager=new n.Manager(t[0],t[1]),e.givenProvider=n.Manager.givenProvider,e.providers=n.Manager.providers,e._provider=e._requestManager.provider,e.setProvider||(e.setProvider=function(t,r){return e._requestManager.setProvider(t,r),e._provider=e._requestManager.provider,!0}),e.setRequestManager=function(t){e._requestManager=t,e._provider=t.provider},e.BatchRequest=n.BatchManager.bind(null,e._requestManager),e.extend=a(e)},addProviders:function(e){e.givenProvider=n.Manager.givenProvider,e.providers=n.Manager.providers}}},function(e,t,r){"use strict";(function(e){var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var i=r(36),o=r(61),c=r(100);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToBuffer=function(r){var n=(0,t.intToHex)(r);return e.from((0,o.padToEven)(n.slice(2)),"hex")};t.zeros=function(t){return e.allocUnsafe(t).fill(0)};var f=function(e,r,n){var a=(0,t.zeros)(r);return n?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,c.assertIsBuffer)(e),d(e)};t.unpadArray=function(e){return(0,c.assertIsArray)(e),d(e)};t.unpadHexString=function(e){return(0,c.assertIsHexString)(e),e=(0,o.stripHexPrefix)(e),d(e)};t.toBuffer=function(r){if(null==r)return e.allocUnsafe(0);if(e.isBuffer(r))return e.from(r);if(Array.isArray(r)||r instanceof Uint8Array)return e.from(r);if("string"==typeof r){if(!(0,o.isHexString)(r))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(r));return e.from((0,o.padToEven)((0,o.stripHexPrefix)(r)),"hex")}if("number"==typeof r)return(0,t.intToBuffer)(r);if(i.BN.isBN(r)){if(r.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(r));return r.toArrayLike(e)}if(r.toArray)return e.from(r.toArray());if(r.toBuffer)return e.from(r.toBuffer());throw new Error("invalid type")};t.bufferToInt=function(e){return new i.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")};t.fromSigned=function(e){return new i.BN(e).fromTwos(256)};t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())};t.addHexPrefix=function(e){return"string"!=typeof e||(0,o.isHexPrefixed)(e)?e:"0x"+e};t.toUtf8=function(t){if((t=(0,o.stripHexPrefix)(t)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return e.from(t.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};t.baToJSON=function(r){if(e.isBuffer(r))return"0x".concat(r.toString("hex"));if(r instanceof Array){for(var n=[],a=0;a0&&0===d[0])throw new Error("".concat(f," cannot have leading zeroes, received: ").concat(d.toString("hex")))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},t.arrToBufArr=function t(r){return Array.isArray(r)?r.map((function(e){return t(e)})):e.from(r)},t.bufArrToArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):Uint8Array.from(null!=t?t:[])}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=r(102),a=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=u;var i=Object.create(r(78));i.inherits=r(4);var o=r(222),c=r(135);i.inherits(u,o);for(var f=a(c.prototype),d=0;de.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--a){var i=this.tryEntries[a],o=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),f=r.call(i,"finallyLoc");if(c&&f){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),k(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;k(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:A(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),b}},e}function d(e,t,r,n,a,i,o){try{var c=e[i](o),f=c.value}catch(e){return void r(e)}c.done?t(f):Promise.resolve(f).then(n,a)}function s(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){d(i,n,a,o,c,"next",e)}function c(e){d(i,n,a,o,c,"throw",e)}o(void 0)}))}}function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var b=r(16).errors,h=r(16).formatters,l=r(27),p=r(104),m=r(105).subscriptions,x=r(854),y=function(e){if(!e.call||!e.name)throw new Error('When creating a method you need to provide at least the "name" and "call" property.');this.name=e.name,this.call=e.call,this.params=e.params||0,this.inputFormatter=e.inputFormatter,this.outputFormatter=e.outputFormatter,this.transformPayload=e.transformPayload,this.extraFormatters=e.extraFormatters,this.abiCoder=e.abiCoder,this.requestManager=e.requestManager,this.accounts=e.accounts,this.defaultBlock=e.defaultBlock||"latest",this.defaultAccount=e.defaultAccount||null,this.transactionBlockTimeout=e.transactionBlockTimeout||50,this.transactionConfirmationBlocks=e.transactionConfirmationBlocks||24,this.transactionPollingTimeout=e.transactionPollingTimeout||750,this.transactionPollingInterval=e.transactionPollingInterval||1e3,this.blockHeaderTimeout=e.blockHeaderTimeout||10,this.defaultCommon=e.defaultCommon,this.defaultChain=e.defaultChain,this.defaultHardfork=e.defaultHardfork,this.handleRevert=e.handleRevert};y.prototype.setRequestManager=function(e,t){this.requestManager=e,t&&(this.accounts=t)},y.prototype.createFunction=function(e,t){var r=this.buildCall();return Object.defineProperty(r,"call",{configurable:!0,writable:!0,value:this.call}),this.setRequestManager(e||this.requestManager,t||this.accounts),r},y.prototype.attachToObject=function(e){var t=this.buildCall();Object.defineProperty(t,"call",{configurable:!0,writable:!0,value:this.call});var r=this.name.split(".");r.length>1?(e[r[0]]=e[r[0]]||{},e[r[0]][r[1]]=t):e[r[0]]=t},y.prototype.getCall=function(e){return"function"==typeof this.call?this.call(e):this.call},y.prototype.extractCallback=function(e){if("function"==typeof e[e.length-1])return e.pop()},y.prototype.validateArgs=function(e){if(e.length!==this.params)throw b.InvalidNumberOfParams(e.length,this.params,this.name)},y.prototype.formatInput=function(e){var t=this;return this.inputFormatter?this.inputFormatter.map((function(r,n){return r?r.call(t,e[n]):e[n]})):e},y.prototype.formatOutput=function(e){var t=this;return Array.isArray(e)?e.map((function(e){return t.outputFormatter&&e?t.outputFormatter(e):e})):this.outputFormatter&&e?this.outputFormatter(e):e},y.prototype.toPayload=function(e){var t=this.getCall(e),r=this.extractCallback(e),n=this.formatInput(e);this.validateArgs(n);var a={method:t,params:n,callback:r};return this.transformPayload&&(a=this.transformPayload(a)),a},y.prototype._confirmTransaction=function(e,t,r){var n=this,a=!1,i=!0,o=0,c=0,d=null,v=null,g=null,w=r.params[0]&&"object"===u(r.params[0])&&r.params[0].gas?r.params[0].gas:null,_=!!r.params[0]&&"object"===u(r.params[0])&&r.params[0].data&&r.params[0].from&&!r.params[0].to,M=_&&r.params[0].data.length>2,k=[new y({name:"getBlockByNumber",call:"eth_getBlockByNumber",params:2,inputFormatter:[h.inputBlockNumberFormatter,function(e){return!!e}],outputFormatter:h.outputBlockFormatter}),new y({name:"getTransactionReceipt",call:"eth_getTransactionReceipt",params:1,inputFormatter:[null],outputFormatter:h.outputTransactionReceiptFormatter}),new y({name:"getCode",call:"eth_getCode",params:2,inputFormatter:[h.inputAddressFormatter,h.inputDefaultBlockNumberFormatter]}),new y({name:"getTransactionByHash",call:"eth_getTransactionByHash",params:1,inputFormatter:[null],outputFormatter:h.outputTransactionFormatter}),new m({name:"subscribe",type:"eth",subscriptions:{newBlockHeaders:{subscriptionName:"newHeads",params:0,outputFormatter:h.outputBlockFormatter}}})],S={};k.forEach((function(e){e.attachToObject(S),e.requestManager=n.requestManager}));var A=function(u,m,y,k,A){if(!y)return A||(A={unsubscribe:function(){clearInterval(d),clearTimeout(v)}}),(u?p.resolve(u):S.getTransactionReceipt(t)).catch((function(t){A.unsubscribe(),a=!0,l._fireError({message:"Failed to check for transaction receipt:",data:t},e.eventEmitter,e.reject)})).then(function(){var t=s(f().mark((function t(r){var a,o,d;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r&&r.blockHash){t.next=2;break}throw new Error("Receipt missing or blockHash null");case 2:if(n.extraFormatters&&n.extraFormatters.receiptFormatter&&(r=n.extraFormatters.receiptFormatter(r)),!(e.eventEmitter.listeners("confirmation").length>0)){t.next=28;break}if(void 0!==u&&0===c){t.next=25;break}return t.next=7,S.getBlockByNumber("latest");case 7:if(o=t.sent,d=o?o.hash:null,!m){t.next=24;break}if(!g){t.next=17;break}return t.next=13,S.getBlockByNumber(g.number+1);case 13:(a=t.sent)&&(g=a,e.eventEmitter.emit("confirmation",c,r,d)),t.next=22;break;case 17:return t.next=19,S.getBlockByNumber(r.blockNumber);case 19:a=t.sent,g=a,e.eventEmitter.emit("confirmation",c,r,d);case 22:t.next=25;break;case 24:e.eventEmitter.emit("confirmation",c,r,d);case 25:(m&&a||!m)&&c++,i=!1,c===n.transactionConfirmationBlocks+1&&(A.unsubscribe(),e.eventEmitter.removeAllListeners());case 28:return t.abrupt("return",r);case 29:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).then(function(){var t=s(f().mark((function t(r){var o;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!_||a){t.next=19;break}if(r.contractAddress){t.next=5;break}return i&&(A.unsubscribe(),a=!0),l._fireError(b.NoContractAddressFoundError(r),e.eventEmitter,e.reject,null,r),t.abrupt("return");case 5:return t.prev=5,t.next=8,S.getCode(r.contractAddress);case 8:o=t.sent,t.next=13;break;case 11:t.prev=11,t.t0=t.catch(5);case 13:if(o){t.next=15;break}return t.abrupt("return");case 15:!0===r.status&&M||o.length>2?(e.eventEmitter.emit("receipt",r),n.extraFormatters&&n.extraFormatters.contractDeployFormatter?e.resolve(n.extraFormatters.contractDeployFormatter(r)):e.resolve(r),i&&e.eventEmitter.removeAllListeners()):l._fireError(b.ContractCodeNotStoredError(r),e.eventEmitter,e.reject,null,r),i&&A.unsubscribe(),a=!0;case 19:return t.abrupt("return",r);case 20:case"end":return t.stop()}}),t,null,[[5,11]])})));return function(e){return t.apply(this,arguments)}}()).then(function(){var t=s(f().mark((function t(o){var c,d,s,u;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(_||a){t.next=35;break}if(o.outOfGas||w&&w===o.gasUsed||!0!==o.status&&"0x1"!==o.status&&void 0!==o.status){t.next=7;break}e.eventEmitter.emit("receipt",o),e.resolve(o),i&&e.eventEmitter.removeAllListeners(),t.next=33;break;case 7:if(JSON.stringify(o,null,2),!1!==o.status&&"0x0"!==o.status){t.next=32;break}if(t.prev=9,c=null,!n.handleRevert||"eth_sendTransaction"!==n.call&&"eth_sendRawTransaction"!==n.call){t.next=24;break}return d=r.params[0],"eth_sendRawTransaction"===n.call&&(s=r.params[0],u=x.parse(s),d=h.inputTransactionFormatter({data:u.data,to:u.to,from:u.from,gas:u.gasLimit.toHexString(),gasPrice:u.gasPrice?u.gasPrice.toHexString():void 0,value:u.value.toHexString()})),t.next=16,n.getRevertReason(d,o.blockNumber);case 16:if(!(c=t.sent)){t.next=21;break}l._fireError(b.TransactionRevertInstructionError(c.reason,c.signature,o),e.eventEmitter,e.reject,null,o),t.next=22;break;case 21:throw!1;case 22:t.next=25;break;case 24:throw!1;case 25:t.next=30;break;case 27:t.prev=27,t.t0=t.catch(9),l._fireError(b.TransactionRevertedWithoutReasonError(o),e.eventEmitter,e.reject,null,o);case 30:t.next=33;break;case 32:l._fireError(b.TransactionOutOfGasError(o),e.eventEmitter,e.reject,null,o);case 33:i&&A.unsubscribe(),a=!0;case 35:case"end":return t.stop()}}),t,null,[[9,27]])})));return function(e){return t.apply(this,arguments)}}()).catch((function(){o++,m?o-1>=n.transactionPollingTimeout&&(A.unsubscribe(),a=!0,l._fireError(b.TransactionError("Transaction was not mined within "+n.transactionPollingTimeout+" seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!"),e.eventEmitter,e.reject)):o-1>=n.transactionBlockTimeout&&(A.unsubscribe(),a=!0,l._fireError(b.TransactionError("Transaction was not mined within "+n.transactionBlockTimeout+" blocks, please make sure your transaction was properly sent. Be aware that it might still be mined!"),e.eventEmitter,e.reject))}));A.unsubscribe(),a=!0,l._fireError({message:"Failed to subscribe to new newBlockHeaders to confirm the transaction receipts.",data:y},e.eventEmitter,e.reject)},E=function(e){var t=!1,r=function(){d=setInterval(A.bind(null,e,!0),n.transactionPollingInterval)};if(!this.requestManager.provider.on)return r();S.subscribe("newBlockHeaders",(function(n,a,i){if(t=!0,n||!a)return r();A(e,!1,n,0,i)})),v=setTimeout((function(){t||r()}),1e3*this.blockHeaderTimeout)}.bind(this);S.getTransactionReceipt(t).then((function(t){t&&t.blockHash?(e.eventEmitter.listeners("confirmation").length>0&&E(t),A(t,!1)):a||E()})).catch((function(){a||E()}))};var v=function(e,t){return"number"==typeof e?t.wallet[e]:e&&"object"===u(e)&&e.address&&e.privateKey?e:t.wallet[e.toLowerCase()]};function g(e,t){return new Promise((function(r,a){try{var i=new y({name:"getBlockByNumber",call:"eth_getBlockByNumber",params:2,inputFormatter:[function(e){return e?l.toHex(e):"latest"},function(){return!1}]}).createFunction(e.requestManager),o=new y({name:"getGasPrice",call:"eth_gasPrice",params:0}).createFunction(e.requestManager);Promise.all([i(),o()]).then((function(e){var a=n(e,2),i=a[0],o=a[1];if(("0x2"===t.type||void 0===t.type)&&i&&i.baseFeePerGas){var c,f;t.gasPrice?(c=t.gasPrice,f=t.gasPrice,delete t.gasPrice):(c=t.maxPriorityFeePerGas||"0x9502F900",f=t.maxFeePerGas||l.toHex(l.toBN(i.baseFeePerGas).mul(l.toBN(2)).add(l.toBN(c)))),r({maxFeePerGas:f,maxPriorityFeePerGas:c})}else{if(t.maxPriorityFeePerGas||t.maxFeePerGas)throw Error("Network doesn't support eip-1559");r({gasPrice:o})}}))}catch(e){a(e)}}))}y.prototype.buildCall=function(){var e=this,t="eth_sendTransaction"===e.call||"eth_sendRawTransaction"===e.call,r="eth_call"===e.call,n=function(){var n=p(!t),a=e.toPayload(Array.prototype.slice.call(arguments)),i=function(i,o){var c;if(e.handleRevert&&r&&e.abiCoder&&(!i&&e.isRevertReasonString(o)?c=o.substring(10):i&&i.data&&(c=i.data.substring(10)),c)){var f=e.abiCoder.decodeParameter("string","0x"+c);return void l._fireError(b.RevertInstructionError(f,"Error(String)"),n.eventEmitter,n.reject,a.callback,{reason:f,signature:"Error(String)"})}try{o=e.formatOutput(o)}catch(e){i=e}if(o instanceof Error&&(i=o),i)return i.error&&(i=i.error),l._fireError(i,n.eventEmitter,n.reject,a.callback);a.callback&&a.callback(null,o),t?(n.eventEmitter.emit("transactionHash",o),e._confirmTransaction(n,o,a)):i||n.resolve(o)},c=function(t){var r=o(o({},a),{},{method:"eth_sendRawTransaction",params:[t.rawTransaction]});e.requestManager.send(r,i)},f=function(e,t){var r;if(t&&t.accounts&&t.accounts.wallet&&t.accounts.wallet.length)if("eth_sendTransaction"===e.method){var a=e.params[0];if((r=v(a&&"object"===u(a)?a.from:null,t.accounts))&&r.privateKey)return delete(a=JSON.parse(JSON.stringify(a))).from,t.defaultChain&&!a.chain&&(a.chain=t.defaultChain),t.defaultHardfork&&!a.hardfork&&(a.hardfork=t.defaultHardfork),t.defaultCommon&&!a.common&&(a.common=t.defaultCommon),void t.accounts.signTransaction(a,r.privateKey).then(c).catch((function(e){if("function"==typeof n.eventEmitter.listeners&&n.eventEmitter.listeners("error").length){try{n.eventEmitter.emit("error",e)}catch(e){}n.eventEmitter.removeAllListeners(),n.eventEmitter.catch((function(){}))}n.reject(e)}))}else if("eth_sign"===e.method){var o=e.params[1];if((r=v(e.params[0],t.accounts))&&r.privateKey){var f=t.accounts.sign(o,r.privateKey);return e.callback&&e.callback(null,f.signature),void n.resolve(f.signature)}}return t.requestManager.send(e,i)};return t&&a.params[0]&&"object"===u(a.params[0])&&void 0===a.params[0].gasPrice&&(void 0===a.params[0].maxPriorityFeePerGas||void 0===a.params[0].maxFeePerGas)?g(e,a.params[0]).then((function(r){void 0!==r.gasPrice?a.params[0].gasPrice=r.gasPrice:void 0!==r.maxPriorityFeePerGas&&void 0!==r.maxFeePerGas&&(a.params[0].maxPriorityFeePerGas=r.maxPriorityFeePerGas,a.params[0].maxFeePerGas=r.maxFeePerGas),t&&setTimeout((function(){n.eventEmitter.emit("sending",a)}),0),f(a,e)})):(t&&setTimeout((function(){n.eventEmitter.emit("sending",a)}),0),f(a,e)),t&&setTimeout((function(){n.eventEmitter.emit("sent",a)}),0),n.eventEmitter};return n.method=e,n.request=this.request.bind(this),n},y.prototype.getRevertReason=function(e,t){var r=this;return new Promise((function(n,a){new y({name:"call",call:"eth_call",params:2,abiCoder:r.abiCoder,handleRevert:!0}).createFunction(r.requestManager)(e,l.numberToHex(t)).then((function(){n(!1)})).catch((function(e){e.reason?n({reason:e.reason,signature:e.signature}):a(e)}))}))},y.prototype.isRevertReasonString=function(e){return"string"==typeof e&&(e.length-2)/2%32==4&&"0x08c379a0"===e.substring(0,10)},y.prototype.request=function(){var e=this.toPayload(Array.prototype.slice.call(arguments));return e.format=this.formatOutput.bind(this),e},e.exports=y},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,a(r(275),t),a(r(276),t),a(r(582),t),a(r(156),t),a(r(583),t),a(r(53),t),a(r(584),t),a(r(40),t),a(r(157),t);var i=r(69);Object.defineProperty(t,"isHexPrefixed",{enumerable:!0,get:function(){return i.isHexPrefixed}}),Object.defineProperty(t,"stripHexPrefix",{enumerable:!0,get:function(){return i.stripHexPrefix}}),Object.defineProperty(t,"padToEven",{enumerable:!0,get:function(){return i.padToEven}}),Object.defineProperty(t,"getBinarySize",{enumerable:!0,get:function(){return i.getBinarySize}}),Object.defineProperty(t,"arrayContainsArray",{enumerable:!0,get:function(){return i.arrayContainsArray}}),Object.defineProperty(t,"toAscii",{enumerable:!0,get:function(){return i.toAscii}}),Object.defineProperty(t,"fromUtf8",{enumerable:!0,get:function(){return i.fromUtf8}}),Object.defineProperty(t,"fromAscii",{enumerable:!0,get:function(){return i.fromAscii}}),Object.defineProperty(t,"getKeys",{enumerable:!0,get:function(){return i.getKeys}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return i.isHexString}})},function(e,t,r){"use strict";(function(e){var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var i=r(40),o=r(69),c=r(111);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToBuffer=function(r){var n=(0,t.intToHex)(r);return e.from((0,o.padToEven)(n.slice(2)),"hex")};t.zeros=function(t){return e.allocUnsafe(t).fill(0)};var f=function(e,r,n){var a=(0,t.zeros)(r);return n?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,c.assertIsBuffer)(e),d(e)};t.unpadArray=function(e){return(0,c.assertIsArray)(e),d(e)};t.unpadHexString=function(e){return(0,c.assertIsHexString)(e),e=(0,o.stripHexPrefix)(e),d(e)};t.toBuffer=function(r){if(null==r)return e.allocUnsafe(0);if(e.isBuffer(r))return e.from(r);if(Array.isArray(r)||r instanceof Uint8Array)return e.from(r);if("string"==typeof r){if(!(0,o.isHexString)(r))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(r));return e.from((0,o.padToEven)((0,o.stripHexPrefix)(r)),"hex")}if("number"==typeof r)return(0,t.intToBuffer)(r);if(i.BN.isBN(r)){if(r.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(r));return r.toArrayLike(e)}if(r.toArray)return e.from(r.toArray());if(r.toBuffer)return e.from(r.toBuffer());throw new Error("invalid type")};t.bufferToInt=function(e){return new i.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")};t.fromSigned=function(e){return new i.BN(e).fromTwos(256)};t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())};t.addHexPrefix=function(e){return"string"!=typeof e||(0,o.isHexPrefixed)(e)?e:"0x"+e};t.toUtf8=function(t){if((t=(0,o.stripHexPrefix)(t)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return e.from(t.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};t.baToJSON=function(r){if(e.isBuffer(r))return"0x".concat(r.toString("hex"));if(r instanceof Array){for(var n=[],a=0;a0&&0===d[0])throw new Error("".concat(f," cannot have leading zeroes, received: ").concat(d.toString("hex")))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},t.arrToBufArr=function t(r){return Array.isArray(r)?r.map((function(e){return t(e)})):e.from(r)},t.bufArrToArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):Uint8Array.from(null!=t?t:[])}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var i=r(41),o=r(71),c=r(112);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToBuffer=function(r){var n=(0,t.intToHex)(r);return e.from((0,o.padToEven)(n.slice(2)),"hex")};t.zeros=function(t){return e.allocUnsafe(t).fill(0)};var f=function(e,r,n){var a=(0,t.zeros)(r);return n?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,c.assertIsBuffer)(e),d(e)};t.unpadArray=function(e){return(0,c.assertIsArray)(e),d(e)};t.unpadHexString=function(e){return(0,c.assertIsHexString)(e),e=(0,o.stripHexPrefix)(e),d(e)};t.toBuffer=function(r){if(null==r)return e.allocUnsafe(0);if(e.isBuffer(r))return e.from(r);if(Array.isArray(r)||r instanceof Uint8Array)return e.from(r);if("string"==typeof r){if(!(0,o.isHexString)(r))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(r));return e.from((0,o.padToEven)((0,o.stripHexPrefix)(r)),"hex")}if("number"==typeof r)return(0,t.intToBuffer)(r);if(i.BN.isBN(r)){if(r.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(r));return r.toArrayLike(e)}if(r.toArray)return e.from(r.toArray());if(r.toBuffer)return e.from(r.toBuffer());throw new Error("invalid type")};t.bufferToInt=function(e){return new i.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")};t.fromSigned=function(e){return new i.BN(e).fromTwos(256)};t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())};t.addHexPrefix=function(e){return"string"!=typeof e||(0,o.isHexPrefixed)(e)?e:"0x"+e};t.toUtf8=function(t){if((t=(0,o.stripHexPrefix)(t)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return e.from(t.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};t.baToJSON=function(r){if(e.isBuffer(r))return"0x".concat(r.toString("hex"));if(r instanceof Array){for(var n=[],a=0;a0&&0===d[0])throw new Error("".concat(f," cannot have leading zeroes, received: ").concat(d.toString("hex")))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},t.arrToBufArr=function t(r){return Array.isArray(r)?r.map((function(e){return t(e)})):e.from(r)},t.bufArrToArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):Uint8Array.from(null!=t?t:[])}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var i=r(42),o=r(72),c=r(113);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToBuffer=function(r){var n=(0,t.intToHex)(r);return e.from((0,o.padToEven)(n.slice(2)),"hex")};t.zeros=function(t){return e.allocUnsafe(t).fill(0)};var f=function(e,r,n){var a=(0,t.zeros)(r);return n?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,c.assertIsBuffer)(e),d(e)};t.unpadArray=function(e){return(0,c.assertIsArray)(e),d(e)};t.unpadHexString=function(e){return(0,c.assertIsHexString)(e),e=(0,o.stripHexPrefix)(e),d(e)};t.toBuffer=function(r){if(null==r)return e.allocUnsafe(0);if(e.isBuffer(r))return e.from(r);if(Array.isArray(r)||r instanceof Uint8Array)return e.from(r);if("string"==typeof r){if(!(0,o.isHexString)(r))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(r));return e.from((0,o.padToEven)((0,o.stripHexPrefix)(r)),"hex")}if("number"==typeof r)return(0,t.intToBuffer)(r);if(i.BN.isBN(r)){if(r.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(r));return r.toArrayLike(e)}if(r.toArray)return e.from(r.toArray());if(r.toBuffer)return e.from(r.toBuffer());throw new Error("invalid type")};t.bufferToInt=function(e){return new i.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")};t.fromSigned=function(e){return new i.BN(e).fromTwos(256)};t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())};t.addHexPrefix=function(e){return"string"!=typeof e||(0,o.isHexPrefixed)(e)?e:"0x"+e};t.toUtf8=function(t){if((t=(0,o.stripHexPrefix)(t)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return e.from(t.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};t.baToJSON=function(r){if(e.isBuffer(r))return"0x".concat(r.toString("hex"));if(r instanceof Array){for(var n=[],a=0;a0&&0===d[0])throw new Error("".concat(f," cannot have leading zeroes, received: ").concat(d.toString("hex")))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},t.arrToBufArr=function t(r){return Array.isArray(r)?r.map((function(e){return t(e)})):e.from(r)},t.bufArrToArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):Uint8Array.from(null!=t?t:[])}}).call(this,r(0).Buffer)},function(e,t,r){var n,a,i,o;function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}o=function(e){var t,r,n,a,i,o,c;return r=(t=e).lib,n=r.WordArray,a=r.Hasher,i=t.algo,o=[],c=i.SHA1=a.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],a=r[1],i=r[2],c=r[3],f=r[4],d=0;d<80;d++){if(d<16)o[d]=0|e[t+d];else{var s=o[d-3]^o[d-8]^o[d-14]^o[d-16];o[d]=s<<1|s>>>31}var u=(n<<5|n>>>27)+f+o[d];u+=d<20?1518500249+(a&i|~a&c):d<40?1859775393+(a^i^c):d<60?(a&i|a&c|i&c)-1894007588:(a^i^c)-899497514,f=c,c=i,i=a<<30|a>>>2,a=n,n=u}r[0]=r[0]+n|0,r[1]=r[1]+a|0,r[2]=r[2]+i|0,r[3]=r[3]+c|0,r[4]=r[4]+f|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}}),t.SHA1=a._createHelper(c),t.HmacSHA1=a._createHmacHelper(c),e.SHA1},"object"===c(t)?e.exports=t=o(r(2)):(a=[r(2)],void 0===(i="function"==typeof(n=o)?n.apply(t,a):n)||(e.exports=i))},function(e,t,r){"use strict";(function(e){var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var i=r(43),o=r(75),c=r(117);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToBuffer=function(r){var n=(0,t.intToHex)(r);return e.from((0,o.padToEven)(n.slice(2)),"hex")};t.zeros=function(t){return e.allocUnsafe(t).fill(0)};var f=function(e,r,n){var a=(0,t.zeros)(r);return n?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,c.assertIsBuffer)(e),d(e)};t.unpadArray=function(e){return(0,c.assertIsArray)(e),d(e)};t.unpadHexString=function(e){return(0,c.assertIsHexString)(e),e=(0,o.stripHexPrefix)(e),d(e)};t.toBuffer=function(r){if(null==r)return e.allocUnsafe(0);if(e.isBuffer(r))return e.from(r);if(Array.isArray(r)||r instanceof Uint8Array)return e.from(r);if("string"==typeof r){if(!(0,o.isHexString)(r))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(r));return e.from((0,o.padToEven)((0,o.stripHexPrefix)(r)),"hex")}if("number"==typeof r)return(0,t.intToBuffer)(r);if(i.BN.isBN(r)){if(r.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(r));return r.toArrayLike(e)}if(r.toArray)return e.from(r.toArray());if(r.toBuffer)return e.from(r.toBuffer());throw new Error("invalid type")};t.bufferToInt=function(e){return new i.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")};t.fromSigned=function(e){return new i.BN(e).fromTwos(256)};t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())};t.addHexPrefix=function(e){return"string"!=typeof e||(0,o.isHexPrefixed)(e)?e:"0x"+e};t.toUtf8=function(t){if((t=(0,o.stripHexPrefix)(t)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return e.from(t.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};t.baToJSON=function(r){if(e.isBuffer(r))return"0x".concat(r.toString("hex"));if(r instanceof Array){for(var n=[],a=0;a0&&0===d[0])throw new Error("".concat(f," cannot have leading zeroes, received: ").concat(d.toString("hex")))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},t.arrToBufArr=function t(r){return Array.isArray(r)?r.map((function(e){return t(e)})):e.from(r)},t.bufArrToArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):Uint8Array.from(null!=t?t:[])}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAsync=void 0;var n,a=r(795),i=(n=a)&&n.__esModule?n:{default:n};var o="function"==typeof Symbol;function c(e){return o&&"AsyncFunction"===e[Symbol.toStringTag]}t.default=function(e){return c(e)?(0,i.default)(e):e},t.isAsync=c},function(e,t,r){"use strict";r.d(t,"c",(function(){return a})),r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return o}));var n=r(17);function a(e){return n.c.includes(e)}function i(e){return Object.keys(n.f).includes(e)?n.f[e]:n.f[n.a]}function o(e){var t=Object.values(n.f).find((function(t){return t.code===e}));return t||n.f[n.a]}},,function(e,t,r){"use strict";(function(e){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e){if("string"!=typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type ".concat(r(e)));return"0"===e[0]&&"x"===e[1]}Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,t.isHexPrefixed=n;function a(e){var t=e;if("string"!=typeof t)throw new Error("[padToEven] value must be type 'string', received ".concat(r(t)));return t.length%2&&(t="0".concat(t)),t}t.stripHexPrefix=function(e){if("string"!=typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received ".concat(r(e)));return n(e)?e.slice(2):e},t.padToEven=a,t.getBinarySize=function(t){if("string"!=typeof t)throw new Error("[getBinarySize] method requires input type 'string', recieved ".concat(r(t)));return e.byteLength(t,"utf8")},t.arrayContainsArray=function(e,t,n){if(!0!==Array.isArray(e))throw new Error("[arrayContainsArray] method requires input 'superset' to be an array, got type '".concat(r(e),"'"));if(!0!==Array.isArray(t))throw new Error("[arrayContainsArray] method requires input 'subset' to be an array, got type '".concat(r(t),"'"));return t[n?"some":"every"]((function(t){return e.indexOf(t)>=0}))},t.toAscii=function(e){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,r){var a,i,c,f;if("string"==typeof t&&(i="not ",t.substr(!c||c<0?0:+c,i.length)===i)?(a="must not be",t=t.replace(/^not /,"")):a="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))f="The ".concat(e," ").concat(a," ").concat(o(t,"type"));else{var d=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";f='The "'.concat(e,'" ').concat(d," ").concat(a," ").concat(o(t,"type"))}return f+=". Received type ".concat(n(r))}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=a},function(e,t,r){"use strict";(function(t){var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=d;var a=r(207),i=r(211);r(4)(d,a);for(var o=n(i.prototype),c=0;c2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,r){var a,i,c,f;if("string"==typeof t&&(i="not ",t.substr(!c||c<0?0:+c,i.length)===i)?(a="must not be",t=t.replace(/^not /,"")):a="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))f="The ".concat(e," ").concat(a," ").concat(o(t,"type"));else{var d=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";f='The "'.concat(e,'" ').concat(d," ").concat(a," ").concat(o(t,"type"))}return f+=". Received type ".concat(n(r))}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=a},function(e,t,r){"use strict";(function(t){var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=d;var a=r(214),i=r(218);r(4)(d,a);for(var o=n(i.prototype),c=0;c=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,a=(r-n)/4294967296;this._block.writeUInt32BE(a,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i},a.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=a},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a={};function i(e,t,r){r||(r=Error);var n=function(e){var r,n;function a(r,n,a){return e.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,a))||this}return n=e,(r=a).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,a}(r);n.prototype.name=r.name,n.prototype.code=e,a[e]=n}function o(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,r){var a,i,c,f;if("string"==typeof t&&(i="not ",t.substr(!c||c<0?0:+c,i.length)===i)?(a="must not be",t=t.replace(/^not /,"")):a="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))f="The ".concat(e," ").concat(a," ").concat(o(t,"type"));else{var d=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";f='The "'.concat(e,'" ').concat(d," ").concat(a," ").concat(o(t,"type"))}return f+=". Received type ".concat(n(r))}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=a},function(e,t,r){"use strict";(function(t){var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=d;var a=r(257),i=r(261);r(4)(d,a);for(var o=n(i.prototype),c=0;c=0}))},t.toAscii=function(e){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r=0}))},t.toAscii=function(e){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r=0}))},t.toAscii=function(e){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r>>7)^(l<<14|l>>>18)^l>>>3,m=d[h-2],x=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;d[h]=p+d[h-7]+x+d[h-16]}var y=n&a^n&i^a&i,v=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),g=b+((c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25))+(c&s^~c&u)+f[h]+d[h];b=u,u=s,s=c,c=o+g|0,o=i,i=a,a=n,n=g+(v+y)|0}r[0]=r[0]+n|0,r[1]=r[1]+a|0,r[2]=r[2]+i|0,r[3]=r[3]+o|0,r[4]=r[4]+c|0,r[5]=r[5]+s|0,r[6]=r[6]+u|0,r[7]=r[7]+b|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,a=8*e.sigBytes;return r[a>>>5]|=128<<24-a%32,r[14+(a+64>>>9<<4)]=t.floor(n/4294967296),r[15+(a+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});r.SHA256=i._createHelper(s),r.HmacSHA256=i._createHmacHelper(s)}(Math),e.SHA256},"object"===c(t)?e.exports=t=o(r(2)):(a=[r(2)],void 0===(i="function"==typeof(n=o)?n.apply(t,a):n)||(e.exports=i))},function(e,t,r){var n,a,i,o;function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}o=function(e){var t,r,n;r=(t=e).lib.Base,n=t.enc.Utf8,t.algo.HMAC=r.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=n.parse(t));var r=e.blockSize,a=4*r;t.sigBytes>a&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),o=this._iKey=t.clone(),c=i.words,f=o.words,d=0;d=0}))},t.toAscii=function(e){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var a=0;a>>24&255,n[a++]=e>>>16&255,n[a++]=e>>>8&255,n[a++]=255&e}else for(n[a++]=255&e,n[a++]=e>>>8&255,n[a++]=e>>>16&255,n[a++]=e>>>24&255,n[a++]=0,n[a++]=0,n[a++]=0,n[a++]=0,i=8;i",'"',"`"," ","\r","\n","\t"]),u=["'"].concat(s),b=["%","/","?",";","#"].concat(u),h=["/","?","#"],l=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},x={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=r(456);function g(e,t,r){if(e&&i.isObject(e)&&e instanceof o)return e;var n=new o;return n.parse(e,t,r),n}o.prototype.parse=function(e,t,r){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+n(e));var o=e.indexOf("?"),f=-1!==o&&o127?C+="x":C+=R[I];if(!C.match(l)){var N=j.slice(0,O),U=j.slice(O+1),z=R.match(p);z&&(N.push(z[1]),U.unshift(z[2])),U.length&&(g="/"+U.join(".")+g),this.hostname=N.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),P||(this.hostname=a.toASCII(this.hostname));var F=this.port?":"+this.port:"",q=this.hostname||"";this.host=q+F,this.href+=this.host,P&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==g[0]&&(g="/"+g))}if(!m[M])for(O=0,B=u.length;O0)&&r.host.split("@"))&&(r.auth=T.shift(),r.host=r.hostname=T.shift());return r.search=e.search,r.query=e.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!M.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var S=M.slice(-1)[0],A=(r.host||e.host||M.length>1)&&("."===S||".."===S)||""===S,E=0,O=M.length;O>=0;O--)"."===(S=M[O])?M.splice(O,1):".."===S?(M.splice(O,1),E++):E&&(M.splice(O,1),E--);if(!w&&!_)for(;E--;E)M.unshift("..");!w||""===M[0]||M[0]&&"/"===M[0].charAt(0)||M.unshift(""),A&&"/"!==M.join("/").substr(-1)&&M.push("");var T,P=""===M[0]||M[0]&&"/"===M[0].charAt(0);k&&(r.hostname=r.host=P?"":M.length?M.shift():"",(T=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=T.shift(),r.host=r.hostname=T.shift()));return(w=w||r.host&&M.length)&&!P&&M.unshift(""),M.length?r.pathname=M.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var e=this.host,t=f.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t){e.exports=function(){for(var e={},t=0;t0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e},t.stripZeros=t.unpad,t.toBuffer=function(t){if(!e.isBuffer(t))if(Array.isArray(t))t=e.from(t);else if("string"==typeof t){if(!n.isHexString(t))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+t);t=e.from(n.padToEven(n.stripHexPrefix(t)),"hex")}else if("number"==typeof t)t=n.intToBuffer(t);else if(null==t)t=e.allocUnsafe(0);else if(a.isBN(t))t=t.toArrayLike(e);else{if(!t.toArray)throw new Error("invalid type");t=e.from(t.toArray())}return t},t.bufferToInt=function(e){return new a(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=t.toBuffer(e)).toString("hex")},t.fromSigned=function(e){return new a(e).fromTwos(256)},t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())},t.addHexPrefix=function(e){return"string"!=typeof e||n.isHexPrefixed(e)?e:"0x"+e},t.baToJSON=function(r){if(e.isBuffer(r))return"0x"+r.toString("hex");if(r instanceof Array){for(var n=[],a=0;a0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e},t.stripZeros=t.unpad,t.toBuffer=function(t){if(!e.isBuffer(t))if(Array.isArray(t))t=e.from(t);else if("string"==typeof t){if(!n.isHexString(t))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+t);t=e.from(n.padToEven(n.stripHexPrefix(t)),"hex")}else if("number"==typeof t)t=n.intToBuffer(t);else if(null==t)t=e.allocUnsafe(0);else if(a.isBN(t))t=t.toArrayLike(e);else{if(!t.toArray)throw new Error("invalid type");t=e.from(t.toArray())}return t},t.bufferToInt=function(e){return new a(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=t.toBuffer(e)).toString("hex")},t.fromSigned=function(e){return new a(e).fromTwos(256)},t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())},t.addHexPrefix=function(e){return"string"!=typeof e||n.isHexPrefixed(e)?e:"0x"+e},t.baToJSON=function(r){if(e.isBuffer(r))return"0x"+r.toString("hex");if(r instanceof Array){for(var n=[],a=0;a0&&"0"===r.toString();)r=(e=e.slice(1))[0];return e},t.toBuffer=function(e){if(!p.isBuffer(e))if(Array.isArray(e))e=p.from(e);else if("string"==typeof e)e=t.isHexString(e)?p.from(t.padToEven(t.stripHexPrefix(e)),"hex"):p.from(e);else if("number"==typeof e)e=t.intToBuffer(e);else if(null==e)e=p.allocUnsafe(0);else if(h.isBN(e))e=e.toArrayLike(p);else{if(!e.toArray)throw new Error("invalid type");e=p.from(e.toArray())}return e},t.bufferToInt=function(e){return new h(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=t.toBuffer(e)).toString("hex")},t.fromSigned=function(e){return new h(e).fromTwos(256)},t.toUnsigned=function(e){return p.from(e.toTwos(256).toArray())},t.keccak=function(e,r){switch(e=t.toBuffer(e),r||(r=256),r){case 224:return o(e);case 256:return f(e);case 384:return c(e);case 512:return d(e);default:throw new Error("Invald algorithm: keccak"+r)}},t.keccak256=function(e){return t.keccak(e)},t.sha3=t.keccak,t.sha256=function(e){return e=t.toBuffer(e),l("sha256").update(e).digest()},t.ripemd160=function(e,r){e=t.toBuffer(e);var n=l("rmd160").update(e).digest();return!0===r?t.setLength(n,32):n},t.rlphash=function(e){return t.keccak(b.encode(e))},t.isValidPrivate=function(e){return s.privateKeyVerify(e)},t.isValidPublic=function(e,t){return 64===e.length?s.publicKeyVerify(p.concat([p.from([4]),e])):!!t&&s.publicKeyVerify(e)},t.pubToAddress=t.publicToAddress=function(e,r){return e=t.toBuffer(e),r&&64!==e.length&&(e=s.publicKeyConvert(e,!1).slice(1)),u(64===e.length),t.keccak(e).slice(-20)};var m=t.privateToPublic=function(e){return e=t.toBuffer(e),s.publicKeyCreate(e,!1).slice(1)};t.importPublic=function(e){return 64!==(e=t.toBuffer(e)).length&&(e=s.publicKeyConvert(e,!1).slice(1)),e},t.ecsign=function(e,t){var r=s.sign(e,t),n={};return n.r=r.signature.slice(0,32),n.s=r.signature.slice(32,64),n.v=r.recovery+27,n},t.hashPersonalMessage=function(e){var r=t.toBuffer("Ethereum Signed Message:\n"+e.length.toString());return t.keccak(p.concat([r,e]))},t.ecrecover=function(e,r,n,a){var i=p.concat([t.setLength(n,32),t.setLength(a,32)],64),o=r-27;if(0!==o&&1!==o)throw new Error("Invalid signature v value");var c=s.recover(e,i,o);return s.publicKeyConvert(c,!1).slice(1)},t.toRpcSig=function(e,r,n){if(27!==e&&28!==e)throw new Error("Invalid recovery id");return t.bufferToHex(p.concat([t.setLengthLeft(r,32),t.setLengthLeft(n,32),t.toBuffer(e-27)]))},t.fromRpcSig=function(e){if(65!==(e=t.toBuffer(e)).length)throw new Error("Invalid signature length");var r=e[64];return r<27&&(r+=27),{v:r,r:e.slice(0,32),s:e.slice(32,64)}},t.privateToAddress=function(e){return t.publicToAddress(m(e))},t.isValidAddress=function(e){return/^0x[0-9a-fA-F]{40}$/.test(e)},t.isZeroAddress=function(e){return t.zeroAddress()===t.addHexPrefix(e)},t.toChecksumAddress=function(e){e=t.stripHexPrefix(e).toLowerCase();for(var r=t.keccak(e).toString("hex"),n="0x",a=0;a=8?n+=e[a].toUpperCase():n+=e[a];return n},t.isValidChecksumAddress=function(e){return t.isValidAddress(e)&&t.toChecksumAddress(e)===e},t.generateAddress=function(e,r){return e=t.toBuffer(e),r=(r=new h(r)).isZero()?null:p.from(r.toArray()),t.rlphash([e,r]).slice(-20)},t.isPrecompiled=function(e){var r=t.unpad(e);return 1===r.length&&r[0]>=1&&r[0]<=8},t.addHexPrefix=function(e){return"string"!=typeof e||t.isHexPrefixed(e)?e:"0x"+e},t.isValidSignature=function(e,t,r,n){var a=new h("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),i=new h("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return 32===t.length&&32===r.length&&((27===e||28===e)&&(t=new h(t),r=new h(r),!(t.isZero()||t.gt(i)||r.isZero()||r.gt(i))&&(!1!==n||1!==new h(r).cmp(a))))},t.baToJSON=function(e){if(p.isBuffer(e))return"0x"+e.toString("hex");if(e instanceof Array){for(var r=[],n=0;n=a.length,"The field "+r.name+" must not have more "+r.length+" bytes")):r.allowZero&&0===a.length||!r.length||u(r.length===a.length,"The field "+r.name+" must have byte length of "+r.length),e.raw[n]=a}e._fields.push(r.name),Object.defineProperty(e,r.name,{enumerable:!0,configurable:!0,get:a,set:i}),r.default&&(e[r.name]=r.default),r.alias&&Object.defineProperty(e,r.alias,{enumerable:!1,configurable:!0,set:i,get:a})})),n)if("string"==typeof n&&(n=p.from(t.stripHexPrefix(n),"hex")),p.isBuffer(n)&&(n=b.decode(n)),Array.isArray(n)){if(n.length>e._fields.length)throw new Error("wrong number of fields in data");n.forEach((function(r,n){e[e._fields[n]]=t.toBuffer(r)}))}else{if("object"!==(void 0===n?"undefined":a(n)))throw new Error("invalid data");var i=Object.keys(n);r.forEach((function(t){-1!==i.indexOf(t.name)&&(e[t.name]=n[t.name]),-1!==i.indexOf(t.alias)&&(e[t.alias]=n[t.alias])}))}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JC_CONTRACTS=t.DEFAULT_NFT_TYPES=t.DEFALUT_TOKENS=t.BASE_TOKEN_URI=void 0,t.BASE_TOKEN_URI="https://market.cebg.games/api/nft/info/",t.DEFALUT_TOKENS={321:[{type:"eth",address:"eth",symbol:"KCS",decimal:18},{type:"erc20",address:"0xcaA011E902103752435AC98657B046B282E36509",symbol:"CEC",decimal:18},{type:"erc20",address:"0xBE023C9D294A4668f0d510E2570CB81B4536cE77",symbol:"CEG",decimal:18}],322:[{type:"eth",address:"eth",symbol:"tKCS",decimal:18},{type:"erc20",address:"0xdb6D4bB22E2C12686Efff25a79EC78f9f078fe7D",symbol:"CEC",decimal:18},{type:"erc20",address:"0xC5Cd606b3e9B80b758e8274B198c76D929aA094A",symbol:"CEG",decimal:18}],97:[{type:"eth",address:"eth",symbol:"BNB",decimal:18}],56:[{type:"eth",address:"eth",symbol:"BNB",decimal:18}],137:[{type:"eth",address:"eth",symbol:"MATIC",decimal:18}],80001:[{type:"eth",address:"eth",symbol:"MATIC",decimal:18}],1338:[{type:"eth",address:"eth",symbol:"ETH",decimal:18},{type:"erc20",address:"0x94247cc867ED6277b901AFED817F3b13962814eD",symbol:"CEC",decimal:18},{type:"erc20",address:"0x28901774C7C74D3C78a17A18697D7BFFB999d3f7",symbol:"CEG",decimal:18}]},t.DEFAULT_NFT_TYPES={321:{hero:{address:"0x0EB362BD40F2288fF25A6Ee1b487cB0cb4638e0D",type:"erc721"},weapon:{address:"0x29F67A372AC1c6AcF478A564992D421FE20F2cc8",type:"erc721"},chip:{address:"0x54B6ED7EDe9355b471985439421Aa1DC7Da6Dc20",type:"erc1155"},shard:{address:"0x54B6ED7EDe9355b471985439421Aa1DC7Da6Dc20",type:"erc1155"}},322:{hero:{address:"0x52917087cd4E48bDb5f336012E677f471f9E1C2D",type:"erc721"},weapon:{address:"0x500AD8A4D50d71Af5cA8eA3b12B914f7aE5466f7",type:"erc721"},chip:{address:"0x0640958BDb4D7956e1452FacEBD550C6Cf42aC94",type:"erc1155"},shard:{address:"0x54B6ED7EDe9355b471985439421Aa1DC7Da6Dc20",type:"erc1155"}},137:{hero:{address:"0xaE08adb5278B107D2501e7c61907e41FEf3887D7",type:"erc721"},weapon:{address:"0xee0044BF2ACEf7C3D7f6781d8f5DC4d2Dd1CE64c",type:"erc721"},chip:{address:"0xc058411B15E544291765F15B13c88582b7bceaD0",type:"erc1155"},shard:{address:"0x1d4c7908E6a6795aE4335D0F072B0A129AAFFdc1",type:"erc1155"}},80001:{hero:{address:"0xaE08adb5278B107D2501e7c61907e41FEf3887D7",type:"erc721"},weapon:{address:"0xee0044BF2ACEf7C3D7f6781d8f5DC4d2Dd1CE64c",type:"erc721"},chip:{address:"0xc058411B15E544291765F15B13c88582b7bceaD0",type:"erc1155"},shard:{address:"0x1d4c7908E6a6795aE4335D0F072B0A129AAFFdc1",type:"erc1155"}},1338:{hero:{address:"0xF07F3D7c1f64E9bC0005308c24e715D555195D6D",type:"erc721"},weapon:{address:"0xFA58cA95FF52dFF0C57bC0BE54462894003a5394",type:"erc721"},chip:{address:"0x615d4BE4Cba8e68efFe6F00e8E42AE07c4f84A7d",type:"erc1155"},shard:{address:"0x0f30db053d360225f43b845Cc8Fb0A456aFD4CA2",type:"erc1155"}}},t.JC_CONTRACTS={321:{nftMall:"0xa44927698D0aC8EF29e91508839cd6e10f773EE0",evolveFactory:"0x07Bad070e403a4Bad2Eec3BA3894c4524d3d2674",minterFactory:"0x5ecEFA2707e3f09B9A169ae696B36Df8dB7410ED"},322:{nftMall:"0xa44927698D0aC8EF29e91508839cd6e10f773EE0",evolveFactory:"0x07Bad070e403a4Bad2Eec3BA3894c4524d3d2674",minterFactory:"0x5ecEFA2707e3f09B9A169ae696B36Df8dB7410ED"},137:{nftMall:"0xa44927698D0aC8EF29e91508839cd6e10f773EE0",evolveFactory:"0x07Bad070e403a4Bad2Eec3BA3894c4524d3d2674",minterFactory:"0x5ecEFA2707e3f09B9A169ae696B36Df8dB7410ED"},80001:{nftMall:"0xa44927698D0aC8EF29e91508839cd6e10f773EE0",evolveFactory:"0x07Bad070e403a4Bad2Eec3BA3894c4524d3d2674",minterFactory:"0x5ecEFA2707e3f09B9A169ae696B36Df8dB7410ED"},1338:{nftMall:"0xC04F9c0461DA8C19a60c8d4C95733b12D51e6Eca",evolveFactory:"0x54B6f621e8c8dD2Cfcd49f2E7aD1dF19E60bf4B9",minterFactory:"0x4b848789f6994d24cAEfaB187fD6c8bE3E0B97cf",chipLocker:"0xb288bA87a02d34ec827a15487633D11faB79b718"}}},function(e,t){e.exports=function(){}},function(e,t){function r(e){return e.sort((function(e,t){return"latest"===e||"earliest"===t?1:"latest"===t||"earliest"===e?-1:n(e)-n(t)}))}function n(e){return null==e?e:Number.parseInt(e,16)}function a(e){if(null==e)return e;var t=e.toString(16);return t.length%2&&(t="0"+t),"0x"+t}function i(){return Math.floor(16*Math.random()).toString(16)}e.exports={minBlockRef:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e},t.stripZeros=t.unpad,t.toBuffer=function(t){if(!e.isBuffer(t))if(Array.isArray(t))t=e.from(t);else if("string"==typeof t){if(!n.isHexString(t))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+t);t=e.from(n.padToEven(n.stripHexPrefix(t)),"hex")}else if("number"==typeof t)t=n.intToBuffer(t);else if(null==t)t=e.allocUnsafe(0);else if(a.isBN(t))t=t.toArrayLike(e);else{if(!t.toArray)throw new Error("invalid type");t=e.from(t.toArray())}return t},t.bufferToInt=function(e){return new a(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=t.toBuffer(e)).toString("hex")},t.fromSigned=function(e){return new a(e).fromTwos(256)},t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())},t.addHexPrefix=function(e){return"string"!=typeof e||n.isHexPrefixed(e)?e:"0x"+e},t.baToJSON=function(r){if(e.isBuffer(r))return"0x"+r.toString("hex");if(r instanceof Array){for(var n=[],a=0;a=0;f--)if(s[f]!==u[f])return!1;for(f=s.length-1;f>=0;f--)if(o=s[f],!g(e[o],t[o],r,n))return!1;return!0}(e,t,r,a))}return r?e===t:e==t}function w(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function _(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function M(e,t,r,n){var a;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),a=function(e){var t;try{e()}catch(e){t=e}return t}(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!a&&y(a,r,"Missing expected exception"+n);var i="string"==typeof n,o=!e&&a&&!r;if((!e&&c.isError(a)&&i&&_(a,r)||o)&&y(a,r,"Got unwanted exception"+n),e&&a&&r&&!_(a,r)||!e&&a)throw a}h.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return m(x(e.actual),128)+" "+e.operator+" "+m(x(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||y;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,a=p(t),i=n.indexOf("\n"+a);if(i>=0){var o=n.indexOf("\n",i+1);n=n.substring(o+1)}this.stack=n}}},c.inherits(h.AssertionError,Error),h.fail=y,h.ok=v,h.equal=function(e,t,r){e!=t&&y(e,t,r,"==",h.equal)},h.notEqual=function(e,t,r){e==t&&y(e,t,r,"!=",h.notEqual)},h.deepEqual=function(e,t,r){g(e,t,!1)||y(e,t,r,"deepEqual",h.deepEqual)},h.deepStrictEqual=function(e,t,r){g(e,t,!0)||y(e,t,r,"deepStrictEqual",h.deepStrictEqual)},h.notDeepEqual=function(e,t,r){g(e,t,!1)&&y(e,t,r,"notDeepEqual",h.notDeepEqual)},h.notDeepStrictEqual=function e(t,r,n){g(t,r,!0)&&y(t,r,n,"notDeepStrictEqual",e)},h.strictEqual=function(e,t,r){e!==t&&y(e,t,r,"===",h.strictEqual)},h.notStrictEqual=function(e,t,r){e===t&&y(e,t,r,"!==",h.notStrictEqual)},h.throws=function(e,t,r){M(!0,e,t,r)},h.doesNotThrow=function(e,t,r){M(!1,e,t,r)},h.ifError=function(e){if(e)throw e},h.strict=a((function e(t,r){t||y(t,!0,r,"==",e)}),h,{equal:h.strictEqual,deepEqual:h.deepStrictEqual,notEqual:h.notStrictEqual,notDeepEqual:h.notDeepStrictEqual}),h.strict.strict=h.strict;var k=Object.keys||function(e){var t=[];for(var r in e)f.call(e,r)&&t.push(r);return t}}).call(this,r(13))},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,r){"use strict";var n=r(376),a=r(377);e.exports={errors:n,formatters:a}},function(e,t,r){"use strict";var n;function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}r.d(t,"b",(function(){return i})),r.d(t,"d",(function(){return o})),r.d(t,"c",(function(){return c})),r.d(t,"e",(function(){return f})),r.d(t,"f",(function(){return d})),r.d(t,"a",(function(){return s}));var i="INTERNAL_ERROR",o="SERVER_ERROR",c=[-32700,-32600,-32601,-32602,-32603],f=[-32e3,-32099],d=(a(n={},"PARSE_ERROR",{code:-32700,message:"Parse error"}),a(n,"INVALID_REQUEST",{code:-32600,message:"Invalid Request"}),a(n,"METHOD_NOT_FOUND",{code:-32601,message:"Method not found"}),a(n,"INVALID_PARAMS",{code:-32602,message:"Invalid params"}),a(n,i,{code:-32603,message:"Internal error"}),a(n,o,{code:-32e3,message:"Server error"}),n),s=o},function(e,t,r){"use strict";(function(t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=r(196),i=r(195);function o(e){var t=e;if("string"!=typeof t)throw new Error("[ethjs-util] while padding to even, value must be string, is currently "+n(t)+", while padToEven.");return t.length%2&&(t="0"+t),t}function c(e){return"0x"+e.toString(16)}e.exports={arrayContainsArray:function(e,t,r){if(!0!==Array.isArray(e))throw new Error("[ethjs-util] method arrayContainsArray requires input 'superset' to be an array got type '"+n(e)+"'");if(!0!==Array.isArray(t))throw new Error("[ethjs-util] method arrayContainsArray requires input 'subset' to be an array got type '"+n(t)+"'");return t[Boolean(r)?"some":"every"]((function(t){return e.indexOf(t)>=0}))},intToBuffer:function(e){var r=c(e);return new t(o(r.slice(2)),"hex")},getBinarySize:function(e){if("string"!=typeof e)throw new Error("[ethjs-util] while getting binary size, method getBinarySize requires input 'str' to be type String, got '"+n(e)+"'.");return t.byteLength(e,"utf8")},isHexPrefixed:a,stripHexPrefix:i,padToEven:o,intToHex:c,fromAscii:function(e){for(var t="",r=0;rr.length)throw new Error("invalid rlp: total length is larger than the data");if(0===(c=r.slice(a,u)).length)throw new Error("invalid rlp, List has a invalid length");for(;c.length;)f=t(c),d.push(f.data),c=f.remainder;return{data:d,remainder:r.slice(u)}}(d(t));if(r)return n;if(0!==n.remainder.length)throw new Error("invalid remainder");return n.data},t.getLength=function(t){if(!t||0===t.length)return e.from([]);var r=d(t),n=r[0];if(n<=127)return r.length;if(n<=183)return n-127;if(n<=191)return n-182;if(n<=247)return n-191;var a=n-246;return a+i(r.slice(1,a).toString("hex"),16)}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{f(n.next(e))}catch(e){i(e)}}function c(e){try{f(n.throw(e))}catch(e){i(e)}}function f(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}f((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=o.trys,(a=a.length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]0&&o.length>a&&!o.warned){o.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=e,f.type=t,f.count=o.length,c=f,console&&console.warn&&console.warn(c)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function l(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},a=h.bind(n);return a.listener=r,n.wrapFn=a,a}function p(e,t,r){var n=e._events;if(void 0===n)return[];var a=n[t];return void 0===a?[]:"function"==typeof a?r?[a.listener||a]:[a]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(i=t[0]),i instanceof Error)throw i;var c=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw c.context=i,c}var f=a[e];if(void 0===f)return!1;if("function"==typeof f)o(f,this,t);else{var d=f.length,s=x(f,d);for(r=0;r=0;i--)if(r[i]===t||r[i].listener===t){o=r[i].listener,a=i;break}if(a<0)return this;0===a?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},f.prototype.listeners=function(e){return p(this,e,!0)},f.prototype.rawListeners=function(e){return p(this,e,!1)},f.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},f.prototype.listenerCount=m,f.prototype.eventNames=function(){return this._eventsCount>0?a(this._events):[]}},function(e,t,r){var n,a,i,o;function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}o=function(e){var t,r,n,a,i,o,c;return r=(t=e).lib,n=r.Base,a=r.WordArray,i=t.algo,o=i.MD5,c=i.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r,n=this.cfg,i=n.hasher.create(),o=a.create(),c=o.words,f=n.keySize,d=n.iterations;c.length=0&&(i=r.type.substring(o));var c=e(t,r.components);Array.isArray(c)&&t?a.push("tuple("+c.join(",")+")"+i):t?a.push("("+c+")"):a.push("("+c.join(",")+")"+i)}else a.push(r.type)})),a},s=function(e){if(!i.isHexStrict(e))throw new Error("The parameter must be a valid HEX string.");var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r7?r+=e[n].toUpperCase():r+=e[n];return r},toHex:i.toHex,toBN:i.toBN,bytesToHex:i.bytesToHex,hexToBytes:i.hexToBytes,hexToNumberString:i.hexToNumberString,hexToNumber:i.hexToNumber,toDecimal:i.hexToNumber,numberToHex:i.numberToHex,fromDecimal:i.numberToHex,hexToUtf8:i.hexToUtf8,hexToString:i.hexToUtf8,toUtf8:i.hexToUtf8,stripHexPrefix:i.stripHexPrefix,utf8ToHex:i.utf8ToHex,stringToHex:i.utf8ToHex,fromUtf8:i.utf8ToHex,hexToAscii:s,toAscii:s,asciiToHex:u,fromAscii:u,unitMap:a.unitMap,toWei:function(e,t){if(t=b(t),!i.isBN(e)&&"string"!=typeof e)throw new Error("Please pass numbers as strings or BN objects to avoid precision errors.");return i.isBN(e)?a.toWei(e,t):a.toWei(e,t).toString(10)},fromWei:function(e,t){if(t=b(t),!i.isBN(e)&&"string"!=typeof e)throw new Error("Please pass numbers as strings or BN objects to avoid precision errors.");return i.isBN(e)?a.fromWei(e,t):a.fromWei(e,t).toString(10)},padLeft:i.leftPad,leftPad:i.leftPad,padRight:i.rightPad,rightPad:i.rightPad,toTwosComplement:i.toTwosComplement,isBloom:i.isBloom,isUserEthereumAddressInBloom:i.isUserEthereumAddressInBloom,isContractAddressInBloom:i.isContractAddressInBloom,isTopic:i.isTopic,isTopicInBloom:i.isTopicInBloom,isInBloom:i.isInBloom,compareBlockNumbers:function(e,t){if(e==t)return 0;if("genesis"!=e&&"earliest"!=e&&0!=e||"genesis"!=t&&"earliest"!=t&&0!=t){if("genesis"==e||"earliest"==e)return-1;if("genesis"==t||"earliest"==t)return 1;if("latest"==e)return"pending"==t?-1:1;if("latest"===t)return"pending"==e?1:-1;if("pending"==e)return 1;if("pending"==t)return-1;var r=new f(e),n=new f(t);return r.lt(n)?-1:r.eq(n)?0:1}return 0},toNumber:i.toNumber}},function(e,t,r){var n,a,i,o;function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}o=function(e){return function(t){var r=e,n=r.lib,a=n.WordArray,i=n.Hasher,o=r.algo,c=[];!function(){for(var e=0;e<64;e++)c[e]=4294967296*t.abs(t.sin(e+1))|0}();var f=o.MD5=i.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,a=e[n];e[n]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}var i=this._hash.words,o=e[t+0],f=e[t+1],h=e[t+2],l=e[t+3],p=e[t+4],m=e[t+5],x=e[t+6],y=e[t+7],v=e[t+8],g=e[t+9],w=e[t+10],_=e[t+11],M=e[t+12],k=e[t+13],S=e[t+14],A=e[t+15],E=i[0],O=i[1],T=i[2],P=i[3];E=d(E,O,T,P,o,7,c[0]),P=d(P,E,O,T,f,12,c[1]),T=d(T,P,E,O,h,17,c[2]),O=d(O,T,P,E,l,22,c[3]),E=d(E,O,T,P,p,7,c[4]),P=d(P,E,O,T,m,12,c[5]),T=d(T,P,E,O,x,17,c[6]),O=d(O,T,P,E,y,22,c[7]),E=d(E,O,T,P,v,7,c[8]),P=d(P,E,O,T,g,12,c[9]),T=d(T,P,E,O,w,17,c[10]),O=d(O,T,P,E,_,22,c[11]),E=d(E,O,T,P,M,7,c[12]),P=d(P,E,O,T,k,12,c[13]),T=d(T,P,E,O,S,17,c[14]),E=s(E,O=d(O,T,P,E,A,22,c[15]),T,P,f,5,c[16]),P=s(P,E,O,T,x,9,c[17]),T=s(T,P,E,O,_,14,c[18]),O=s(O,T,P,E,o,20,c[19]),E=s(E,O,T,P,m,5,c[20]),P=s(P,E,O,T,w,9,c[21]),T=s(T,P,E,O,A,14,c[22]),O=s(O,T,P,E,p,20,c[23]),E=s(E,O,T,P,g,5,c[24]),P=s(P,E,O,T,S,9,c[25]),T=s(T,P,E,O,l,14,c[26]),O=s(O,T,P,E,v,20,c[27]),E=s(E,O,T,P,k,5,c[28]),P=s(P,E,O,T,h,9,c[29]),T=s(T,P,E,O,y,14,c[30]),E=u(E,O=s(O,T,P,E,M,20,c[31]),T,P,m,4,c[32]),P=u(P,E,O,T,v,11,c[33]),T=u(T,P,E,O,_,16,c[34]),O=u(O,T,P,E,S,23,c[35]),E=u(E,O,T,P,f,4,c[36]),P=u(P,E,O,T,p,11,c[37]),T=u(T,P,E,O,y,16,c[38]),O=u(O,T,P,E,w,23,c[39]),E=u(E,O,T,P,k,4,c[40]),P=u(P,E,O,T,o,11,c[41]),T=u(T,P,E,O,l,16,c[42]),O=u(O,T,P,E,x,23,c[43]),E=u(E,O,T,P,g,4,c[44]),P=u(P,E,O,T,M,11,c[45]),T=u(T,P,E,O,A,16,c[46]),E=b(E,O=u(O,T,P,E,h,23,c[47]),T,P,o,6,c[48]),P=b(P,E,O,T,y,10,c[49]),T=b(T,P,E,O,S,15,c[50]),O=b(O,T,P,E,m,21,c[51]),E=b(E,O,T,P,M,6,c[52]),P=b(P,E,O,T,l,10,c[53]),T=b(T,P,E,O,w,15,c[54]),O=b(O,T,P,E,f,21,c[55]),E=b(E,O,T,P,v,6,c[56]),P=b(P,E,O,T,A,10,c[57]),T=b(T,P,E,O,x,15,c[58]),O=b(O,T,P,E,k,21,c[59]),E=b(E,O,T,P,p,6,c[60]),P=b(P,E,O,T,_,10,c[61]),T=b(T,P,E,O,h,15,c[62]),O=b(O,T,P,E,g,21,c[63]),i[0]=i[0]+E|0,i[1]=i[1]+O|0,i[2]=i[2]+T|0,i[3]=i[3]+P|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,a=8*e.sigBytes;r[a>>>5]|=128<<24-a%32;var i=t.floor(n/4294967296),o=n;r[15+(a+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),r[14+(a+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),e.sigBytes=4*(r.length+1),this._process();for(var c=this._hash,f=c.words,d=0;d<4;d++){var s=f[d];f[d]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return c},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});function d(e,t,r,n,a,i,o){var c=e+(t&r|~t&n)+a+o;return(c<>>32-i)+t}function s(e,t,r,n,a,i,o){var c=e+(t&n|r&~n)+a+o;return(c<>>32-i)+t}function u(e,t,r,n,a,i,o){var c=e+(t^r^n)+a+o;return(c<>>32-i)+t}function b(e,t,r,n,a,i,o){var c=e+(r^(t|~n))+a+o;return(c<>>32-i)+t}r.MD5=i._createHelper(f),r.HmacMD5=i._createHmacHelper(f)}(Math),e.MD5},"object"===c(t)?e.exports=t=o(r(2)):(a=[r(2)],void 0===(i="function"==typeof(n=o)?n.apply(t,a):n)||(e.exports=i))},function(e,t,r){"use strict";var n=t,a=r(9),i=r(30),o=r(201);n.assert=i,n.toArray=o.toArray,n.zero2=o.zero2,n.toHex=o.toHex,n.encode=o.encode,n.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var a=1<(a>>1)-1?(a>>1)-f:f,i.isubn(c)):c=0,n[o]=c,i.iushrn(1)}return n},n.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,a=0,i=0;e.cmpn(-a)>0||t.cmpn(-i)>0;){var o,c,f=e.andln(3)+a&3,d=t.andln(3)+i&3;3===f&&(f=-1),3===d&&(d=-1),o=0==(1&f)?0:3!==(n=e.andln(7)+a&7)&&5!==n||2!==d?f:-f,r[0].push(o),c=0==(1&d)?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==f?d:-d,r[1].push(c),2*a===o+1&&(a=1-a),2*i===c+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},n.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new a(e,"hex","le")}},function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=r,r.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},function(e,t,r){var n,a,i,o;function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}o=function(e){var t,r;return r=(t=e).lib.WordArray,t.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var a=[],i=0;i>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,c=0;c<4&&i+.75*c>>6*(3-c)&63));var f=n.charAt(64);if(f)for(;a.length%4;)a.push(f);return a.join("")},parse:function(e){var t=e.length,n=this._map,a=this._reverseMap;if(!a){a=this._reverseMap=[];for(var i=0;i>>6-o%4*2,d=c|f;a[i>>>2]|=d<<24-i%4*8,i++}return r.create(a,i)}(e,t,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},e.enc.Base64},"object"===c(t)?e.exports=t=o(r(2)):(a=[r(2)],void 0===(i="function"==typeof(n=o)?n.apply(t,a):n)||(e.exports=i))},function(e,t,r){"use strict";(function(t,n){var a=r(6).Buffer,i=t.crypto||t.msCrypto;function o(e){for(var t=0,r=e.length;t4294967295)throw new RangeError("requested too many random bytes");var r=a.allocUnsafe(e);if(e>0)if(e>65536)for(var o=0;o4294967295)throw new RangeError("requested too many random bytes");var r=a.allocUnsafe(e);if(e>0)if(e>65536)for(var i=0;i>1]>>4>=8&&(t[f]=t[f].toUpperCase()),(15&c[f>>1])>=8&&(t[f+1]=t[f+1].toUpperCase());return"0x"+t.join("")}for(var f={},d=0;d<10;d++)f[String(d)]=String(d);for(var s=0;s<26;s++)f[String.fromCharCode(65+s)]=String(10+s);var u,b=Math.floor((u=9007199254740991,Math.log10?Math.log10(u):Math.log(u)/Math.LN10));function h(e){for(var t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((function(e){return f[e]})).join("");t.length>=b;){var r=t.substring(0,b);t=parseInt(r,10)%97+t.substring(r.length)}for(var n=String(98-parseInt(t,10)%97);n.length<2;)n="0"+n;return n}function l(e){var t=null;if("string"!=typeof e&&o.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=c(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&o.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==h(e)&&o.throwArgumentError("bad icap checksum","address",e),t=Object(a.c)(e.substring(4));t.length<40;)t="0"+t;t=c("0x"+t)}else o.throwArgumentError("invalid address","address",e);return t}},function(e,t,r){"use strict";r.d(t,"b",(function(){return f})),r.d(t,"a",(function(){return u}));var n=r(1),a=r(3),i=new a.a("rlp/5.6.1");function o(e){for(var t=[];e;)t.unshift(255&e),e>>=8;return t}function c(e,t,r){for(var n=0,a=0;at+1+n&&i.throwError("child data too short",a.a.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:o}}function s(e,t){if(0===e.length&&i.throwError("data too short",a.a.errors.BUFFER_OVERRUN,{}),e[t]>=248){var r=e[t]-247;t+1+r>e.length&&i.throwError("data short segment too short",a.a.errors.BUFFER_OVERRUN,{});var o=c(e,t+1,r);return t+1+r+o>e.length&&i.throwError("data long segment too short",a.a.errors.BUFFER_OVERRUN,{}),d(e,t,t+1+r,r+o)}if(e[t]>=192){var f=e[t]-192;return t+1+f>e.length&&i.throwError("data array too short",a.a.errors.BUFFER_OVERRUN,{}),d(e,t,t+1,f)}if(e[t]>=184){var s=e[t]-183;t+1+s>e.length&&i.throwError("data array too short",a.a.errors.BUFFER_OVERRUN,{});var u=c(e,t+1,s);return t+1+s+u>e.length&&i.throwError("data array too short",a.a.errors.BUFFER_OVERRUN,{}),{consumed:1+s+u,result:Object(n.g)(e.slice(t+1+s,t+1+s+u))}}if(e[t]>=128){var b=e[t]-128;return t+1+b>e.length&&i.throwError("data too short",a.a.errors.BUFFER_OVERRUN,{}),{consumed:1+b,result:Object(n.g)(e.slice(t+1,t+1+b))}}return{consumed:1,result:Object(n.g)(e[t])}}function u(e){var t=Object(n.a)(e),r=s(t,0);return r.consumed!==t.length&&i.throwArgumentError("invalid rlp data","data",e),r.result}},function(e,t,r){"use strict";var n=r(30),a=r(4);function i(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function o(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function c(e){return 1===e.length?"0"+e:e}function f(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=a,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),a=0;a>6|192,r[n++]=63&o|128):i(e,a)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++a)),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=63&o|128)}else for(a=0;a>>0}return o},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,a=0;n>>24,r[a+1]=i>>>16&255,r[a+2]=i>>>8&255,r[a+3]=255&i):(r[a+3]=i>>>24,r[a+2]=i>>>16&255,r[a+1]=i>>>8&255,r[a]=255&i)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,a){return e+t+r+n+a>>>0},t.sum64=function(e,t,r,n){var a=e[t],i=n+e[t+1]>>>0,o=(i>>0,e[t+1]=i},t.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,a,i,o,c){var f=0,d=t;return f+=(d=d+n>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,r,n,a,i,o,c){return t+n+i+c>>>0},t.sum64_5_hi=function(e,t,r,n,a,i,o,c,f,d){var s=0,u=t;return s+=(u=u+n>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,n,a,i,o,c,f,d){return t+n+i+c+d>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return a(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var c=o(r(98));t.BN=c.default;var f=i(r(21));t.rlp=f},function(e,t,r){"use strict";var n=t;n.version=r(387).version,n.utils=r(29),n.rand=r(124),n.curve=r(202),n.curves=r(125),n.ec=r(399),n.eddsa=r(403)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(128),a=r(407);t.keccak224=n.createHashFunction((function(){return a("keccak224")})),t.keccak256=n.createHashFunction((function(){return a("keccak256")})),t.keccak384=n.createHashFunction((function(){return a("keccak384")})),t.keccak512=n.createHashFunction((function(){return a("keccak512")}))},function(e,t,r){"use strict";var n=r(6).Buffer,a=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function i(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===a||!a(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=f,this.end=d,t=4;break;case"utf8":this.fillLast=c,t=4;break;case"base64":this.text=s,this.end=u,t=3;break;default:return this.write=b,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function c(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function f(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function d(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function s(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function u(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function b(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=i,i.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0)return a>0&&(e.lastNeed=a-1),a;if(--n=0)return a>0&&(e.lastNeed=a-2),a;if(--n=0)return a>0&&(2===a?a=0:e.lastNeed=a-3),a;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return a(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var c=o(r(580));t.BN=c.default;var f=i(r(21));t.rlp=f},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return a(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var c=o(r(587));t.BN=c.default;var f=i(r(21));t.rlp=f},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return a(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var c=o(r(650));t.BN=c.default;var f=i(r(21));t.rlp=f},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return a(t,e),t},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.rlp=t.BN=void 0;var c=o(r(707));t.BN=c.default;var f=i(r(21));t.rlp=f},function(e,t,r){(function(e){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n=a)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),c=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),p(r)?n.showHidden=r:r&&t._extend(n,r),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=d),u(n,e,n.depth)}function d(e,t){var r=f.styles[t];return r?"["+f.colors[r][0]+"m"+e+"["+f.colors[r][1]+"m":e}function s(e,t){return e}function u(e,r,n){if(e.customInspect&&r&&k(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var a=r.inspect(n,e);return y(a)||(a=u(e,a,n)),a}var i=function(e,t){if(v(t))return e.stylize("undefined","undefined");if(y(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(x(t))return e.stylize(""+t,"number");if(p(t))return e.stylize(""+t,"boolean");if(m(t))return e.stylize("null","null")}(e,r);if(i)return i;var o=Object.keys(r),c=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(r)),M(r)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return b(r);if(0===o.length){if(k(r)){var f=r.name?": "+r.name:"";return e.stylize("[Function"+f+"]","special")}if(g(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(_(r))return e.stylize(Date.prototype.toString.call(r),"date");if(M(r))return b(r)}var d,s="",w=!1,S=["{","}"];(l(r)&&(w=!0,S=["[","]"]),k(r))&&(s=" [Function"+(r.name?": "+r.name:"")+"]");return g(r)&&(s=" "+RegExp.prototype.toString.call(r)),_(r)&&(s=" "+Date.prototype.toUTCString.call(r)),M(r)&&(s=" "+b(r)),0!==o.length||w&&0!=r.length?n<0?g(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),d=w?function(e,t,r,n,a){for(var i=[],o=0,c=t.length;o=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(d,s,S)):S[0]+s+S[1]}function b(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,a,i){var o,c,f;if((f=Object.getOwnPropertyDescriptor(t,a)||{value:t[a]}).get?c=f.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):f.set&&(c=e.stylize("[Setter]","special")),T(n,a)||(o="["+a+"]"),c||(e.seen.indexOf(f.value)<0?(c=m(r)?u(e,f.value,null):u(e,f.value,r-1)).indexOf("\n")>-1&&(c=i?c.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+c.split("\n").map((function(e){return" "+e})).join("\n")):c=e.stylize("[Circular]","special")),v(o)){if(i&&a.match(/^\d+$/))return c;(o=JSON.stringify(""+a)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+c}function l(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function m(e){return null===e}function x(e){return"number"==typeof e}function y(e){return"string"==typeof e}function v(e){return void 0===e}function g(e){return w(e)&&"[object RegExp]"===S(e)}function w(e){return"object"===n(e)&&null!==e}function _(e){return w(e)&&"[object Date]"===S(e)}function M(e){return w(e)&&("[object Error]"===S(e)||e instanceof Error)}function k(e){return"function"==typeof e}function S(e){return Object.prototype.toString.call(e)}function A(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(r){if(v(o)&&(o=e.env.NODE_DEBUG||""),r=r.toUpperCase(),!c[r])if(new RegExp("\\b"+r+"\\b","i").test(o)){var n=e.pid;c[r]=function(){var e=t.format.apply(t,arguments);console.error("%s %d: %s",r,n,e)}}else c[r]=function(){};return c[r]},t.inspect=f,f.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},f.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=l,t.isBoolean=p,t.isNull=m,t.isNullOrUndefined=function(e){return null==e},t.isNumber=x,t.isString=y,t.isSymbol=function(e){return"symbol"===n(e)},t.isUndefined=v,t.isRegExp=g,t.isObject=w,t.isDate=_,t.isError=M,t.isFunction=k,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"===n(e)||void 0===e},t.isBuffer=r(374);var E=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function O(){var e=new Date,t=[A(e.getHours()),A(e.getMinutes()),A(e.getSeconds())].join(":");return[e.getDate(),E[e.getMonth()],t].join(" ")}function T(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",O(),t.format.apply(t,arguments))},t.inherits=r(375),t._extend=function(e,t){if(!t||!w(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var P="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function j(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(P&&e[P]){var t;if("function"!=typeof(t=e[P]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,P,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise((function(e,n){t=e,r=n})),a=[],i=0;i=9007199254740991||t<=-9007199254740991)&&m("overflow","BigNumber.from",t),e.from(String(t));var r=t;if("bigint"==typeof r)return e.from(r.toString());if(Object(i.h)(r))return e.from(Object(i.g)(r));if(r)if(r.toHexString){var n=r.toHexString();if("string"==typeof n)return e.from(n)}else{var a=r._hex;if(null==a&&"BigNumber"===r.type&&(a=r.hex),"string"==typeof a&&(Object(i.j)(a)||"-"===a[0]&&Object(i.j)(a.substring(1))))return e.from(a)}return d.throwArgumentError("invalid BigNumber value","value",t)}},{key:"isBigNumber",value:function(e){return!(!e||!e._isBigNumber)}}],(r=[{key:"fromTwos",value:function(e){return l(p(this).fromTwos(e))}},{key:"toTwos",value:function(e){return l(p(this).toTwos(e))}},{key:"abs",value:function(){return"-"===this._hex[0]?e.from(this._hex.substring(1)):this}},{key:"add",value:function(e){return l(p(this).add(p(e)))}},{key:"sub",value:function(e){return l(p(this).sub(p(e)))}},{key:"div",value:function(t){return e.from(t).isZero()&&m("division-by-zero","div"),l(p(this).div(p(t)))}},{key:"mul",value:function(e){return l(p(this).mul(p(e)))}},{key:"mod",value:function(e){var t=p(e);return t.isNeg()&&m("division-by-zero","mod"),l(p(this).umod(t))}},{key:"pow",value:function(e){var t=p(e);return t.isNeg()&&m("negative-power","pow"),l(p(this).pow(t))}},{key:"and",value:function(e){var t=p(e);return(this.isNegative()||t.isNeg())&&m("unbound-bitwise-result","and"),l(p(this).and(t))}},{key:"or",value:function(e){var t=p(e);return(this.isNegative()||t.isNeg())&&m("unbound-bitwise-result","or"),l(p(this).or(t))}},{key:"xor",value:function(e){var t=p(e);return(this.isNegative()||t.isNeg())&&m("unbound-bitwise-result","xor"),l(p(this).xor(t))}},{key:"mask",value:function(e){return(this.isNegative()||e<0)&&m("negative-width","mask"),l(p(this).maskn(e))}},{key:"shl",value:function(e){return(this.isNegative()||e<0)&&m("negative-width","shl"),l(p(this).shln(e))}},{key:"shr",value:function(e){return(this.isNegative()||e<0)&&m("negative-width","shr"),l(p(this).shrn(e))}},{key:"eq",value:function(e){return p(this).eq(p(e))}},{key:"lt",value:function(e){return p(this).lt(p(e))}},{key:"lte",value:function(e){return p(this).lte(p(e))}},{key:"gt",value:function(e){return p(this).gt(p(e))}},{key:"gte",value:function(e){return p(this).gte(p(e))}},{key:"isNegative",value:function(){return"-"===this._hex[0]}},{key:"isZero",value:function(){return p(this).isZero()}},{key:"toNumber",value:function(){try{return p(this).toNumber()}catch(e){m("overflow","toNumber",this.toString())}return null}},{key:"toBigInt",value:function(){try{return BigInt(this.toString())}catch(e){}return d.throwError("this platform does not support BigInt",o.a.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}},{key:"toString",value:function(){return arguments.length>0&&(10===arguments[0]?u||(u=!0,d.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?d.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",o.a.errors.UNEXPECTED_ARGUMENT,{}):d.throwError("BigNumber.toString does not accept parameters",o.a.errors.UNEXPECTED_ARGUMENT,{})),p(this).toString(10)}},{key:"toHexString",value:function(){return this._hex}},{key:"toJSON",value:function(e){return{type:"BigNumber",hex:this.toHexString()}}}])&&c(t.prototype,r),n&&c(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function h(e){if("string"!=typeof e)return h(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&d.throwArgumentError("invalid hex","value",e),"0x00"===(e=h(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function l(e){return b.from(h(e))}function p(e){var t=b.from(e).toHexString();return"-"===t[0]?new f("-"+t.substring(3),16):new f(t.substring(2),16)}function m(e,t,r){var n={fault:e,operation:t};return null!=r&&(n.value=r),d.throwError(e,o.a.errors.NUMERIC_FAULT,n)}function x(e){return new f(e,36).toString(16)}function y(e){return new f(e,16).toString(36)}},function(e,t,r){var n=r(373),a=r(475);e.exports={packageInit:function(e,t){if(t=Array.prototype.slice.call(t),!e)throw new Error('You need to instantiate using the "new" keyword.');Object.defineProperty(e,"currentProvider",{get:function(){return e._provider},set:function(t){return e.setProvider(t)},enumerable:!0,configurable:!0}),t[0]&&t[0]._requestManager?e._requestManager=t[0]._requestManager:e._requestManager=new n.Manager(t[0],t[1]),e.givenProvider=n.Manager.givenProvider,e.providers=n.Manager.providers,e._provider=e._requestManager.provider,e.setProvider||(e.setProvider=function(t,r){return e._requestManager.setProvider(t,r),e._provider=e._requestManager.provider,!0}),e.setRequestManager=function(t){e._requestManager=t,e._provider=t.provider},e.BatchRequest=n.BatchManager.bind(null,e._requestManager),e.extend=a(e)},addProviders:function(e){e.givenProvider=n.Manager.givenProvider,e.providers=n.Manager.providers}}},function(e,t,r){"use strict";(function(e){var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var i=r(36),o=r(61),c=r(100);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToBuffer=function(r){var n=(0,t.intToHex)(r);return e.from((0,o.padToEven)(n.slice(2)),"hex")};t.zeros=function(t){return e.allocUnsafe(t).fill(0)};var f=function(e,r,n){var a=(0,t.zeros)(r);return n?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,c.assertIsBuffer)(e),d(e)};t.unpadArray=function(e){return(0,c.assertIsArray)(e),d(e)};t.unpadHexString=function(e){return(0,c.assertIsHexString)(e),e=(0,o.stripHexPrefix)(e),d(e)};t.toBuffer=function(r){if(null==r)return e.allocUnsafe(0);if(e.isBuffer(r))return e.from(r);if(Array.isArray(r)||r instanceof Uint8Array)return e.from(r);if("string"==typeof r){if(!(0,o.isHexString)(r))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(r));return e.from((0,o.padToEven)((0,o.stripHexPrefix)(r)),"hex")}if("number"==typeof r)return(0,t.intToBuffer)(r);if(i.BN.isBN(r)){if(r.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(r));return r.toArrayLike(e)}if(r.toArray)return e.from(r.toArray());if(r.toBuffer)return e.from(r.toBuffer());throw new Error("invalid type")};t.bufferToInt=function(e){return new i.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")};t.fromSigned=function(e){return new i.BN(e).fromTwos(256)};t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())};t.addHexPrefix=function(e){return"string"!=typeof e||(0,o.isHexPrefixed)(e)?e:"0x"+e};t.toUtf8=function(t){if((t=(0,o.stripHexPrefix)(t)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return e.from(t.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};t.baToJSON=function(r){if(e.isBuffer(r))return"0x".concat(r.toString("hex"));if(r instanceof Array){for(var n=[],a=0;a0&&0===d[0])throw new Error("".concat(f," cannot have leading zeroes, received: ").concat(d.toString("hex")))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},t.arrToBufArr=function t(r){return Array.isArray(r)?r.map((function(e){return t(e)})):e.from(r)},t.bufArrToArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):Uint8Array.from(null!=t?t:[])}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=r(102),a=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=u;var i=Object.create(r(78));i.inherits=r(4);var o=r(222),c=r(135);i.inherits(u,o);for(var f=a(c.prototype),d=0;de.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--a){var i=this.tryEntries[a],o=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),f=r.call(i,"finallyLoc");if(c&&f){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),k(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;k(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:A(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),b}},e}function d(e,t,r,n,a,i,o){try{var c=e[i](o),f=c.value}catch(e){return void r(e)}c.done?t(f):Promise.resolve(f).then(n,a)}function s(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var i=e.apply(t,r);function o(e){d(i,n,a,o,c,"next",e)}function c(e){d(i,n,a,o,c,"throw",e)}o(void 0)}))}}function u(e){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var b=r(16).errors,h=r(16).formatters,l=r(27),p=r(104),m=r(105).subscriptions,x=r(854),y=function(e){if(!e.call||!e.name)throw new Error('When creating a method you need to provide at least the "name" and "call" property.');this.name=e.name,this.call=e.call,this.params=e.params||0,this.inputFormatter=e.inputFormatter,this.outputFormatter=e.outputFormatter,this.transformPayload=e.transformPayload,this.extraFormatters=e.extraFormatters,this.abiCoder=e.abiCoder,this.requestManager=e.requestManager,this.accounts=e.accounts,this.defaultBlock=e.defaultBlock||"latest",this.defaultAccount=e.defaultAccount||null,this.transactionBlockTimeout=e.transactionBlockTimeout||50,this.transactionConfirmationBlocks=e.transactionConfirmationBlocks||24,this.transactionPollingTimeout=e.transactionPollingTimeout||750,this.transactionPollingInterval=e.transactionPollingInterval||1e3,this.blockHeaderTimeout=e.blockHeaderTimeout||10,this.defaultCommon=e.defaultCommon,this.defaultChain=e.defaultChain,this.defaultHardfork=e.defaultHardfork,this.handleRevert=e.handleRevert};y.prototype.setRequestManager=function(e,t){this.requestManager=e,t&&(this.accounts=t)},y.prototype.createFunction=function(e,t){var r=this.buildCall();return Object.defineProperty(r,"call",{configurable:!0,writable:!0,value:this.call}),this.setRequestManager(e||this.requestManager,t||this.accounts),r},y.prototype.attachToObject=function(e){var t=this.buildCall();Object.defineProperty(t,"call",{configurable:!0,writable:!0,value:this.call});var r=this.name.split(".");r.length>1?(e[r[0]]=e[r[0]]||{},e[r[0]][r[1]]=t):e[r[0]]=t},y.prototype.getCall=function(e){return"function"==typeof this.call?this.call(e):this.call},y.prototype.extractCallback=function(e){if("function"==typeof e[e.length-1])return e.pop()},y.prototype.validateArgs=function(e){if(e.length!==this.params)throw b.InvalidNumberOfParams(e.length,this.params,this.name)},y.prototype.formatInput=function(e){var t=this;return this.inputFormatter?this.inputFormatter.map((function(r,n){return r?r.call(t,e[n]):e[n]})):e},y.prototype.formatOutput=function(e){var t=this;return Array.isArray(e)?e.map((function(e){return t.outputFormatter&&e?t.outputFormatter(e):e})):this.outputFormatter&&e?this.outputFormatter(e):e},y.prototype.toPayload=function(e){var t=this.getCall(e),r=this.extractCallback(e),n=this.formatInput(e);this.validateArgs(n);var a={method:t,params:n,callback:r};return this.transformPayload&&(a=this.transformPayload(a)),a},y.prototype._confirmTransaction=function(e,t,r){var n=this,a=!1,i=!0,o=0,c=0,d=null,v=null,g=null,w=r.params[0]&&"object"===u(r.params[0])&&r.params[0].gas?r.params[0].gas:null,_=!!r.params[0]&&"object"===u(r.params[0])&&r.params[0].data&&r.params[0].from&&!r.params[0].to,M=_&&r.params[0].data.length>2,k=[new y({name:"getBlockByNumber",call:"eth_getBlockByNumber",params:2,inputFormatter:[h.inputBlockNumberFormatter,function(e){return!!e}],outputFormatter:h.outputBlockFormatter}),new y({name:"getTransactionReceipt",call:"eth_getTransactionReceipt",params:1,inputFormatter:[null],outputFormatter:h.outputTransactionReceiptFormatter}),new y({name:"getCode",call:"eth_getCode",params:2,inputFormatter:[h.inputAddressFormatter,h.inputDefaultBlockNumberFormatter]}),new y({name:"getTransactionByHash",call:"eth_getTransactionByHash",params:1,inputFormatter:[null],outputFormatter:h.outputTransactionFormatter}),new m({name:"subscribe",type:"eth",subscriptions:{newBlockHeaders:{subscriptionName:"newHeads",params:0,outputFormatter:h.outputBlockFormatter}}})],S={};k.forEach((function(e){e.attachToObject(S),e.requestManager=n.requestManager}));var A=function(u,m,y,k,A){if(!y)return A||(A={unsubscribe:function(){clearInterval(d),clearTimeout(v)}}),(u?p.resolve(u):S.getTransactionReceipt(t)).catch((function(t){A.unsubscribe(),a=!0,l._fireError({message:"Failed to check for transaction receipt:",data:t},e.eventEmitter,e.reject)})).then(function(){var t=s(f().mark((function t(r){var a,o,d;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r&&r.blockHash){t.next=2;break}throw new Error("Receipt missing or blockHash null");case 2:if(n.extraFormatters&&n.extraFormatters.receiptFormatter&&(r=n.extraFormatters.receiptFormatter(r)),!(e.eventEmitter.listeners("confirmation").length>0)){t.next=28;break}if(void 0!==u&&0===c){t.next=25;break}return t.next=7,S.getBlockByNumber("latest");case 7:if(o=t.sent,d=o?o.hash:null,!m){t.next=24;break}if(!g){t.next=17;break}return t.next=13,S.getBlockByNumber(g.number+1);case 13:(a=t.sent)&&(g=a,e.eventEmitter.emit("confirmation",c,r,d)),t.next=22;break;case 17:return t.next=19,S.getBlockByNumber(r.blockNumber);case 19:a=t.sent,g=a,e.eventEmitter.emit("confirmation",c,r,d);case 22:t.next=25;break;case 24:e.eventEmitter.emit("confirmation",c,r,d);case 25:(m&&a||!m)&&c++,i=!1,c===n.transactionConfirmationBlocks+1&&(A.unsubscribe(),e.eventEmitter.removeAllListeners());case 28:return t.abrupt("return",r);case 29:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).then(function(){var t=s(f().mark((function t(r){var o;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!_||a){t.next=19;break}if(r.contractAddress){t.next=5;break}return i&&(A.unsubscribe(),a=!0),l._fireError(b.NoContractAddressFoundError(r),e.eventEmitter,e.reject,null,r),t.abrupt("return");case 5:return t.prev=5,t.next=8,S.getCode(r.contractAddress);case 8:o=t.sent,t.next=13;break;case 11:t.prev=11,t.t0=t.catch(5);case 13:if(o){t.next=15;break}return t.abrupt("return");case 15:!0===r.status&&M||o.length>2?(e.eventEmitter.emit("receipt",r),n.extraFormatters&&n.extraFormatters.contractDeployFormatter?e.resolve(n.extraFormatters.contractDeployFormatter(r)):e.resolve(r),i&&e.eventEmitter.removeAllListeners()):l._fireError(b.ContractCodeNotStoredError(r),e.eventEmitter,e.reject,null,r),i&&A.unsubscribe(),a=!0;case 19:return t.abrupt("return",r);case 20:case"end":return t.stop()}}),t,null,[[5,11]])})));return function(e){return t.apply(this,arguments)}}()).then(function(){var t=s(f().mark((function t(o){var c,d,s,u;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(_||a){t.next=35;break}if(o.outOfGas||w&&w===o.gasUsed||!0!==o.status&&"0x1"!==o.status&&void 0!==o.status){t.next=7;break}e.eventEmitter.emit("receipt",o),e.resolve(o),i&&e.eventEmitter.removeAllListeners(),t.next=33;break;case 7:if(JSON.stringify(o,null,2),!1!==o.status&&"0x0"!==o.status){t.next=32;break}if(t.prev=9,c=null,!n.handleRevert||"eth_sendTransaction"!==n.call&&"eth_sendRawTransaction"!==n.call){t.next=24;break}return d=r.params[0],"eth_sendRawTransaction"===n.call&&(s=r.params[0],u=x.parse(s),d=h.inputTransactionFormatter({data:u.data,to:u.to,from:u.from,gas:u.gasLimit.toHexString(),gasPrice:u.gasPrice?u.gasPrice.toHexString():void 0,value:u.value.toHexString()})),t.next=16,n.getRevertReason(d,o.blockNumber);case 16:if(!(c=t.sent)){t.next=21;break}l._fireError(b.TransactionRevertInstructionError(c.reason,c.signature,o),e.eventEmitter,e.reject,null,o),t.next=22;break;case 21:throw!1;case 22:t.next=25;break;case 24:throw!1;case 25:t.next=30;break;case 27:t.prev=27,t.t0=t.catch(9),l._fireError(b.TransactionRevertedWithoutReasonError(o),e.eventEmitter,e.reject,null,o);case 30:t.next=33;break;case 32:l._fireError(b.TransactionOutOfGasError(o),e.eventEmitter,e.reject,null,o);case 33:i&&A.unsubscribe(),a=!0;case 35:case"end":return t.stop()}}),t,null,[[9,27]])})));return function(e){return t.apply(this,arguments)}}()).catch((function(){o++,m?o-1>=n.transactionPollingTimeout&&(A.unsubscribe(),a=!0,l._fireError(b.TransactionError("Transaction was not mined within "+n.transactionPollingTimeout+" seconds, please make sure your transaction was properly sent. Be aware that it might still be mined!"),e.eventEmitter,e.reject)):o-1>=n.transactionBlockTimeout&&(A.unsubscribe(),a=!0,l._fireError(b.TransactionError("Transaction was not mined within "+n.transactionBlockTimeout+" blocks, please make sure your transaction was properly sent. Be aware that it might still be mined!"),e.eventEmitter,e.reject))}));A.unsubscribe(),a=!0,l._fireError({message:"Failed to subscribe to new newBlockHeaders to confirm the transaction receipts.",data:y},e.eventEmitter,e.reject)},E=function(e){var t=!1,r=function(){d=setInterval(A.bind(null,e,!0),n.transactionPollingInterval)};if(!this.requestManager.provider.on)return r();S.subscribe("newBlockHeaders",(function(n,a,i){if(t=!0,n||!a)return r();A(e,!1,n,0,i)})),v=setTimeout((function(){t||r()}),1e3*this.blockHeaderTimeout)}.bind(this);S.getTransactionReceipt(t).then((function(t){t&&t.blockHash?(e.eventEmitter.listeners("confirmation").length>0&&E(t),A(t,!1)):a||E()})).catch((function(){a||E()}))};var v=function(e,t){return"number"==typeof e?t.wallet[e]:e&&"object"===u(e)&&e.address&&e.privateKey?e:t.wallet[e.toLowerCase()]};function g(e,t){return new Promise((function(r,a){try{var i=new y({name:"getBlockByNumber",call:"eth_getBlockByNumber",params:2,inputFormatter:[function(e){return e?l.toHex(e):"latest"},function(){return!1}]}).createFunction(e.requestManager),o=new y({name:"getGasPrice",call:"eth_gasPrice",params:0}).createFunction(e.requestManager);Promise.all([i(),o()]).then((function(e){var a=n(e,2),i=a[0],o=a[1];if(("0x2"===t.type||void 0===t.type)&&i&&i.baseFeePerGas){var c,f;t.gasPrice?(c=t.gasPrice,f=t.gasPrice,delete t.gasPrice):(c=t.maxPriorityFeePerGas||"0x9502F900",f=t.maxFeePerGas||l.toHex(l.toBN(i.baseFeePerGas).mul(l.toBN(2)).add(l.toBN(c)))),r({maxFeePerGas:f,maxPriorityFeePerGas:c})}else{if(t.maxPriorityFeePerGas||t.maxFeePerGas)throw Error("Network doesn't support eip-1559");r({gasPrice:o})}}))}catch(e){a(e)}}))}y.prototype.buildCall=function(){var e=this,t="eth_sendTransaction"===e.call||"eth_sendRawTransaction"===e.call,r="eth_call"===e.call,n=function(){var n=p(!t),a=e.toPayload(Array.prototype.slice.call(arguments)),i=function(i,o){var c;if(e.handleRevert&&r&&e.abiCoder&&(!i&&e.isRevertReasonString(o)?c=o.substring(10):i&&i.data&&(c=i.data.substring(10)),c)){var f=e.abiCoder.decodeParameter("string","0x"+c);return void l._fireError(b.RevertInstructionError(f,"Error(String)"),n.eventEmitter,n.reject,a.callback,{reason:f,signature:"Error(String)"})}try{o=e.formatOutput(o)}catch(e){i=e}if(o instanceof Error&&(i=o),i)return i.error&&(i=i.error),l._fireError(i,n.eventEmitter,n.reject,a.callback);a.callback&&a.callback(null,o),t?(n.eventEmitter.emit("transactionHash",o),e._confirmTransaction(n,o,a)):i||n.resolve(o)},c=function(t){var r=o(o({},a),{},{method:"eth_sendRawTransaction",params:[t.rawTransaction]});e.requestManager.send(r,i)},f=function(e,t){var r;if(t&&t.accounts&&t.accounts.wallet&&t.accounts.wallet.length)if("eth_sendTransaction"===e.method){var a=e.params[0];if((r=v(a&&"object"===u(a)?a.from:null,t.accounts))&&r.privateKey)return delete(a=JSON.parse(JSON.stringify(a))).from,t.defaultChain&&!a.chain&&(a.chain=t.defaultChain),t.defaultHardfork&&!a.hardfork&&(a.hardfork=t.defaultHardfork),t.defaultCommon&&!a.common&&(a.common=t.defaultCommon),void t.accounts.signTransaction(a,r.privateKey).then(c).catch((function(e){if("function"==typeof n.eventEmitter.listeners&&n.eventEmitter.listeners("error").length){try{n.eventEmitter.emit("error",e)}catch(e){}n.eventEmitter.removeAllListeners(),n.eventEmitter.catch((function(){}))}n.reject(e)}))}else if("eth_sign"===e.method){var o=e.params[1];if((r=v(e.params[0],t.accounts))&&r.privateKey){var f=t.accounts.sign(o,r.privateKey);return e.callback&&e.callback(null,f.signature),void n.resolve(f.signature)}}return t.requestManager.send(e,i)};return t&&a.params[0]&&"object"===u(a.params[0])&&void 0===a.params[0].gasPrice&&(void 0===a.params[0].maxPriorityFeePerGas||void 0===a.params[0].maxFeePerGas)?g(e,a.params[0]).then((function(r){void 0!==r.gasPrice?a.params[0].gasPrice=r.gasPrice:void 0!==r.maxPriorityFeePerGas&&void 0!==r.maxFeePerGas&&(a.params[0].maxPriorityFeePerGas=r.maxPriorityFeePerGas,a.params[0].maxFeePerGas=r.maxFeePerGas),t&&setTimeout((function(){n.eventEmitter.emit("sending",a)}),0),f(a,e)})):(t&&setTimeout((function(){n.eventEmitter.emit("sending",a)}),0),f(a,e)),t&&setTimeout((function(){n.eventEmitter.emit("sent",a)}),0),n.eventEmitter};return n.method=e,n.request=this.request.bind(this),n},y.prototype.getRevertReason=function(e,t){var r=this;return new Promise((function(n,a){new y({name:"call",call:"eth_call",params:2,abiCoder:r.abiCoder,handleRevert:!0}).createFunction(r.requestManager)(e,l.numberToHex(t)).then((function(){n(!1)})).catch((function(e){e.reason?n({reason:e.reason,signature:e.signature}):a(e)}))}))},y.prototype.isRevertReasonString=function(e){return"string"==typeof e&&(e.length-2)/2%32==4&&"0x08c379a0"===e.substring(0,10)},y.prototype.request=function(){var e=this.toPayload(Array.prototype.slice.call(arguments));return e.format=this.formatOutput.bind(this),e},e.exports=y},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,a(r(275),t),a(r(276),t),a(r(582),t),a(r(156),t),a(r(583),t),a(r(53),t),a(r(584),t),a(r(40),t),a(r(157),t);var i=r(69);Object.defineProperty(t,"isHexPrefixed",{enumerable:!0,get:function(){return i.isHexPrefixed}}),Object.defineProperty(t,"stripHexPrefix",{enumerable:!0,get:function(){return i.stripHexPrefix}}),Object.defineProperty(t,"padToEven",{enumerable:!0,get:function(){return i.padToEven}}),Object.defineProperty(t,"getBinarySize",{enumerable:!0,get:function(){return i.getBinarySize}}),Object.defineProperty(t,"arrayContainsArray",{enumerable:!0,get:function(){return i.arrayContainsArray}}),Object.defineProperty(t,"toAscii",{enumerable:!0,get:function(){return i.toAscii}}),Object.defineProperty(t,"fromUtf8",{enumerable:!0,get:function(){return i.fromUtf8}}),Object.defineProperty(t,"fromAscii",{enumerable:!0,get:function(){return i.fromAscii}}),Object.defineProperty(t,"getKeys",{enumerable:!0,get:function(){return i.getKeys}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return i.isHexString}})},function(e,t,r){"use strict";(function(e){var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var i=r(40),o=r(69),c=r(111);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToBuffer=function(r){var n=(0,t.intToHex)(r);return e.from((0,o.padToEven)(n.slice(2)),"hex")};t.zeros=function(t){return e.allocUnsafe(t).fill(0)};var f=function(e,r,n){var a=(0,t.zeros)(r);return n?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,c.assertIsBuffer)(e),d(e)};t.unpadArray=function(e){return(0,c.assertIsArray)(e),d(e)};t.unpadHexString=function(e){return(0,c.assertIsHexString)(e),e=(0,o.stripHexPrefix)(e),d(e)};t.toBuffer=function(r){if(null==r)return e.allocUnsafe(0);if(e.isBuffer(r))return e.from(r);if(Array.isArray(r)||r instanceof Uint8Array)return e.from(r);if("string"==typeof r){if(!(0,o.isHexString)(r))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(r));return e.from((0,o.padToEven)((0,o.stripHexPrefix)(r)),"hex")}if("number"==typeof r)return(0,t.intToBuffer)(r);if(i.BN.isBN(r)){if(r.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(r));return r.toArrayLike(e)}if(r.toArray)return e.from(r.toArray());if(r.toBuffer)return e.from(r.toBuffer());throw new Error("invalid type")};t.bufferToInt=function(e){return new i.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")};t.fromSigned=function(e){return new i.BN(e).fromTwos(256)};t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())};t.addHexPrefix=function(e){return"string"!=typeof e||(0,o.isHexPrefixed)(e)?e:"0x"+e};t.toUtf8=function(t){if((t=(0,o.stripHexPrefix)(t)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return e.from(t.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};t.baToJSON=function(r){if(e.isBuffer(r))return"0x".concat(r.toString("hex"));if(r instanceof Array){for(var n=[],a=0;a0&&0===d[0])throw new Error("".concat(f," cannot have leading zeroes, received: ").concat(d.toString("hex")))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},t.arrToBufArr=function t(r){return Array.isArray(r)?r.map((function(e){return t(e)})):e.from(r)},t.bufArrToArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):Uint8Array.from(null!=t?t:[])}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var i=r(41),o=r(71),c=r(112);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToBuffer=function(r){var n=(0,t.intToHex)(r);return e.from((0,o.padToEven)(n.slice(2)),"hex")};t.zeros=function(t){return e.allocUnsafe(t).fill(0)};var f=function(e,r,n){var a=(0,t.zeros)(r);return n?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,c.assertIsBuffer)(e),d(e)};t.unpadArray=function(e){return(0,c.assertIsArray)(e),d(e)};t.unpadHexString=function(e){return(0,c.assertIsHexString)(e),e=(0,o.stripHexPrefix)(e),d(e)};t.toBuffer=function(r){if(null==r)return e.allocUnsafe(0);if(e.isBuffer(r))return e.from(r);if(Array.isArray(r)||r instanceof Uint8Array)return e.from(r);if("string"==typeof r){if(!(0,o.isHexString)(r))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(r));return e.from((0,o.padToEven)((0,o.stripHexPrefix)(r)),"hex")}if("number"==typeof r)return(0,t.intToBuffer)(r);if(i.BN.isBN(r)){if(r.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(r));return r.toArrayLike(e)}if(r.toArray)return e.from(r.toArray());if(r.toBuffer)return e.from(r.toBuffer());throw new Error("invalid type")};t.bufferToInt=function(e){return new i.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")};t.fromSigned=function(e){return new i.BN(e).fromTwos(256)};t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())};t.addHexPrefix=function(e){return"string"!=typeof e||(0,o.isHexPrefixed)(e)?e:"0x"+e};t.toUtf8=function(t){if((t=(0,o.stripHexPrefix)(t)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return e.from(t.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};t.baToJSON=function(r){if(e.isBuffer(r))return"0x".concat(r.toString("hex"));if(r instanceof Array){for(var n=[],a=0;a0&&0===d[0])throw new Error("".concat(f," cannot have leading zeroes, received: ").concat(d.toString("hex")))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},t.arrToBufArr=function t(r){return Array.isArray(r)?r.map((function(e){return t(e)})):e.from(r)},t.bufArrToArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):Uint8Array.from(null!=t?t:[])}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var i=r(42),o=r(72),c=r(113);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToBuffer=function(r){var n=(0,t.intToHex)(r);return e.from((0,o.padToEven)(n.slice(2)),"hex")};t.zeros=function(t){return e.allocUnsafe(t).fill(0)};var f=function(e,r,n){var a=(0,t.zeros)(r);return n?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,c.assertIsBuffer)(e),d(e)};t.unpadArray=function(e){return(0,c.assertIsArray)(e),d(e)};t.unpadHexString=function(e){return(0,c.assertIsHexString)(e),e=(0,o.stripHexPrefix)(e),d(e)};t.toBuffer=function(r){if(null==r)return e.allocUnsafe(0);if(e.isBuffer(r))return e.from(r);if(Array.isArray(r)||r instanceof Uint8Array)return e.from(r);if("string"==typeof r){if(!(0,o.isHexString)(r))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(r));return e.from((0,o.padToEven)((0,o.stripHexPrefix)(r)),"hex")}if("number"==typeof r)return(0,t.intToBuffer)(r);if(i.BN.isBN(r)){if(r.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(r));return r.toArrayLike(e)}if(r.toArray)return e.from(r.toArray());if(r.toBuffer)return e.from(r.toBuffer());throw new Error("invalid type")};t.bufferToInt=function(e){return new i.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")};t.fromSigned=function(e){return new i.BN(e).fromTwos(256)};t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())};t.addHexPrefix=function(e){return"string"!=typeof e||(0,o.isHexPrefixed)(e)?e:"0x"+e};t.toUtf8=function(t){if((t=(0,o.stripHexPrefix)(t)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return e.from(t.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};t.baToJSON=function(r){if(e.isBuffer(r))return"0x".concat(r.toString("hex"));if(r instanceof Array){for(var n=[],a=0;a0&&0===d[0])throw new Error("".concat(f," cannot have leading zeroes, received: ").concat(d.toString("hex")))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},t.arrToBufArr=function t(r){return Array.isArray(r)?r.map((function(e){return t(e)})):e.from(r)},t.bufArrToArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):Uint8Array.from(null!=t?t:[])}}).call(this,r(0).Buffer)},function(e,t,r){var n,a,i,o;function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}o=function(e){var t,r,n,a,i,o,c;return r=(t=e).lib,n=r.WordArray,a=r.Hasher,i=t.algo,o=[],c=i.SHA1=a.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],a=r[1],i=r[2],c=r[3],f=r[4],d=0;d<80;d++){if(d<16)o[d]=0|e[t+d];else{var s=o[d-3]^o[d-8]^o[d-14]^o[d-16];o[d]=s<<1|s>>>31}var u=(n<<5|n>>>27)+f+o[d];u+=d<20?1518500249+(a&i|~a&c):d<40?1859775393+(a^i^c):d<60?(a&i|a&c|i&c)-1894007588:(a^i^c)-899497514,f=c,c=i,i=a<<30|a>>>2,a=n,n=u}r[0]=r[0]+n|0,r[1]=r[1]+a|0,r[2]=r[2]+i|0,r[3]=r[3]+c|0,r[4]=r[4]+f|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}}),t.SHA1=a._createHelper(c),t.HmacSHA1=a._createHmacHelper(c),e.SHA1},"object"===c(t)?e.exports=t=o(r(2)):(a=[r(2)],void 0===(i="function"==typeof(n=o)?n.apply(t,a):n)||(e.exports=i))},function(e,t,r){"use strict";(function(e){var n=this&&this.__values||function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},a=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o};Object.defineProperty(t,"__esModule",{value:!0}),t.bufArrToArr=t.arrToBufArr=t.validateNoLeadingZeroes=t.baToJSON=t.toUtf8=t.addHexPrefix=t.toUnsigned=t.fromSigned=t.bufferToHex=t.bufferToInt=t.toBuffer=t.unpadHexString=t.unpadArray=t.unpadBuffer=t.setLengthRight=t.setLengthLeft=t.zeros=t.intToBuffer=t.intToHex=void 0;var i=r(43),o=r(75),c=r(117);t.intToHex=function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Received an invalid integer type: ".concat(e));return"0x".concat(e.toString(16))};t.intToBuffer=function(r){var n=(0,t.intToHex)(r);return e.from((0,o.padToEven)(n.slice(2)),"hex")};t.zeros=function(t){return e.allocUnsafe(t).fill(0)};var f=function(e,r,n){var a=(0,t.zeros)(r);return n?e.length0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e};t.unpadBuffer=function(e){return(0,c.assertIsBuffer)(e),d(e)};t.unpadArray=function(e){return(0,c.assertIsArray)(e),d(e)};t.unpadHexString=function(e){return(0,c.assertIsHexString)(e),e=(0,o.stripHexPrefix)(e),d(e)};t.toBuffer=function(r){if(null==r)return e.allocUnsafe(0);if(e.isBuffer(r))return e.from(r);if(Array.isArray(r)||r instanceof Uint8Array)return e.from(r);if("string"==typeof r){if(!(0,o.isHexString)(r))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: ".concat(r));return e.from((0,o.padToEven)((0,o.stripHexPrefix)(r)),"hex")}if("number"==typeof r)return(0,t.intToBuffer)(r);if(i.BN.isBN(r)){if(r.isNeg())throw new Error("Cannot convert negative BN to buffer. Given: ".concat(r));return r.toArrayLike(e)}if(r.toArray)return e.from(r.toArray());if(r.toBuffer)return e.from(r.toBuffer());throw new Error("invalid type")};t.bufferToInt=function(e){return new i.BN((0,t.toBuffer)(e)).toNumber()};t.bufferToHex=function(e){return"0x"+(e=(0,t.toBuffer)(e)).toString("hex")};t.fromSigned=function(e){return new i.BN(e).fromTwos(256)};t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())};t.addHexPrefix=function(e){return"string"!=typeof e||(0,o.isHexPrefixed)(e)?e:"0x"+e};t.toUtf8=function(t){if((t=(0,o.stripHexPrefix)(t)).length%2!=0)throw new Error("Invalid non-even hex string input for toUtf8() provided");return e.from(t.replace(/^(00)+|(00)+$/g,""),"hex").toString("utf8")};t.baToJSON=function(r){if(e.isBuffer(r))return"0x".concat(r.toString("hex"));if(r instanceof Array){for(var n=[],a=0;a0&&0===d[0])throw new Error("".concat(f," cannot have leading zeroes, received: ").concat(d.toString("hex")))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},t.arrToBufArr=function t(r){return Array.isArray(r)?r.map((function(e){return t(e)})):e.from(r)},t.bufArrToArr=function e(t){return Array.isArray(t)?t.map((function(t){return e(t)})):Uint8Array.from(null!=t?t:[])}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isAsync=void 0;var n,a=r(795),i=(n=a)&&n.__esModule?n:{default:n};var o="function"==typeof Symbol;function c(e){return o&&"AsyncFunction"===e[Symbol.toStringTag]}t.default=function(e){return c(e)?(0,i.default)(e):e},t.isAsync=c},function(e,t,r){"use strict";r.d(t,"c",(function(){return a})),r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return o}));var n=r(17);function a(e){return n.c.includes(e)}function i(e){return Object.keys(n.f).includes(e)?n.f[e]:n.f[n.a]}function o(e){var t=Object.values(n.f).find((function(t){return t.code===e}));return t||n.f[n.a]}},,function(e,t,r){"use strict";(function(e){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e){if("string"!=typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type ".concat(r(e)));return"0"===e[0]&&"x"===e[1]}Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,t.isHexPrefixed=n;function a(e){var t=e;if("string"!=typeof t)throw new Error("[padToEven] value must be type 'string', received ".concat(r(t)));return t.length%2&&(t="0".concat(t)),t}t.stripHexPrefix=function(e){if("string"!=typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received ".concat(r(e)));return n(e)?e.slice(2):e},t.padToEven=a,t.getBinarySize=function(t){if("string"!=typeof t)throw new Error("[getBinarySize] method requires input type 'string', recieved ".concat(r(t)));return e.byteLength(t,"utf8")},t.arrayContainsArray=function(e,t,n){if(!0!==Array.isArray(e))throw new Error("[arrayContainsArray] method requires input 'superset' to be an array, got type '".concat(r(e),"'"));if(!0!==Array.isArray(t))throw new Error("[arrayContainsArray] method requires input 'subset' to be an array, got type '".concat(r(t),"'"));return t[n?"some":"every"]((function(t){return e.indexOf(t)>=0}))},t.toAscii=function(e){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,r){var a,i,c,f;if("string"==typeof t&&(i="not ",t.substr(!c||c<0?0:+c,i.length)===i)?(a="must not be",t=t.replace(/^not /,"")):a="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))f="The ".concat(e," ").concat(a," ").concat(o(t,"type"));else{var d=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";f='The "'.concat(e,'" ').concat(d," ").concat(a," ").concat(o(t,"type"))}return f+=". Received type ".concat(n(r))}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=a},function(e,t,r){"use strict";(function(t){var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=d;var a=r(207),i=r(211);r(4)(d,a);for(var o=n(i.prototype),c=0;c2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,r){var a,i,c,f;if("string"==typeof t&&(i="not ",t.substr(!c||c<0?0:+c,i.length)===i)?(a="must not be",t=t.replace(/^not /,"")):a="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))f="The ".concat(e," ").concat(a," ").concat(o(t,"type"));else{var d=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";f='The "'.concat(e,'" ').concat(d," ").concat(a," ").concat(o(t,"type"))}return f+=". Received type ".concat(n(r))}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=a},function(e,t,r){"use strict";(function(t){var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=d;var a=r(214),i=r(218);r(4)(d,a);for(var o=n(i.prototype),c=0;c=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0,a=(r-n)/4294967296;this._block.writeUInt32BE(a,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i},a.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=a},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a={};function i(e,t,r){r||(r=Error);var n=function(e){var r,n;function a(r,n,a){return e.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,a))||this}return n=e,(r=a).prototype=Object.create(n.prototype),r.prototype.constructor=r,r.__proto__=n,a}(r);n.prototype.name=r.name,n.prototype.code=e,a[e]=n}function o(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}i("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),i("ERR_INVALID_ARG_TYPE",(function(e,t,r){var a,i,c,f;if("string"==typeof t&&(i="not ",t.substr(!c||c<0?0:+c,i.length)===i)?(a="must not be",t=t.replace(/^not /,"")):a="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}(e," argument"))f="The ".concat(e," ").concat(a," ").concat(o(t,"type"));else{var d=function(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}(e,".")?"property":"argument";f='The "'.concat(e,'" ').concat(d," ").concat(a," ").concat(o(t,"type"))}return f+=". Received type ".concat(n(r))}),TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=a},function(e,t,r){"use strict";(function(t){var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=d;var a=r(257),i=r(261);r(4)(d,a);for(var o=n(i.prototype),c=0;c=0}))},t.toAscii=function(e){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r=0}))},t.toAscii=function(e){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r=0}))},t.toAscii=function(e){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r>>7)^(l<<14|l>>>18)^l>>>3,m=d[h-2],x=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;d[h]=p+d[h-7]+x+d[h-16]}var y=n&a^n&i^a&i,v=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),g=b+((c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25))+(c&s^~c&u)+f[h]+d[h];b=u,u=s,s=c,c=o+g|0,o=i,i=a,a=n,n=g+(v+y)|0}r[0]=r[0]+n|0,r[1]=r[1]+a|0,r[2]=r[2]+i|0,r[3]=r[3]+o|0,r[4]=r[4]+c|0,r[5]=r[5]+s|0,r[6]=r[6]+u|0,r[7]=r[7]+b|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,a=8*e.sigBytes;return r[a>>>5]|=128<<24-a%32,r[14+(a+64>>>9<<4)]=t.floor(n/4294967296),r[15+(a+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});r.SHA256=i._createHelper(s),r.HmacSHA256=i._createHmacHelper(s)}(Math),e.SHA256},"object"===c(t)?e.exports=t=o(r(2)):(a=[r(2)],void 0===(i="function"==typeof(n=o)?n.apply(t,a):n)||(e.exports=i))},function(e,t,r){var n,a,i,o;function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}o=function(e){var t,r,n;r=(t=e).lib.Base,n=t.enc.Utf8,t.algo.HMAC=r.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=n.parse(t));var r=e.blockSize,a=4*r;t.sigBytes>a&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),o=this._iKey=t.clone(),c=i.words,f=o.words,d=0;d=0}))},t.toAscii=function(e){var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var a=0;a>>24&255,n[a++]=e>>>16&255,n[a++]=e>>>8&255,n[a++]=255&e}else for(n[a++]=255&e,n[a++]=e>>>8&255,n[a++]=e>>>16&255,n[a++]=e>>>24&255,n[a++]=0,n[a++]=0,n[a++]=0,n[a++]=0,i=8;i",'"',"`"," ","\r","\n","\t"]),u=["'"].concat(s),b=["%","/","?",";","#"].concat(u),h=["/","?","#"],l=/^[+a-z0-9A-Z_-]{0,63}$/,p=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},x={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=r(456);function g(e,t,r){if(e&&i.isObject(e)&&e instanceof o)return e;var n=new o;return n.parse(e,t,r),n}o.prototype.parse=function(e,t,r){if(!i.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+n(e));var o=e.indexOf("?"),f=-1!==o&&o127?C+="x":C+=R[I];if(!C.match(l)){var N=j.slice(0,O),U=j.slice(O+1),z=R.match(p);z&&(N.push(z[1]),U.unshift(z[2])),U.length&&(g="/"+U.join(".")+g),this.hostname=N.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),P||(this.hostname=a.toASCII(this.hostname));var F=this.port?":"+this.port:"",q=this.hostname||"";this.host=q+F,this.href+=this.host,P&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==g[0]&&(g="/"+g))}if(!m[M])for(O=0,B=u.length;O0)&&r.host.split("@"))&&(r.auth=T.shift(),r.host=r.hostname=T.shift());return r.search=e.search,r.query=e.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!M.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var S=M.slice(-1)[0],A=(r.host||e.host||M.length>1)&&("."===S||".."===S)||""===S,E=0,O=M.length;O>=0;O--)"."===(S=M[O])?M.splice(O,1):".."===S?(M.splice(O,1),E++):E&&(M.splice(O,1),E--);if(!w&&!_)for(;E--;E)M.unshift("..");!w||""===M[0]||M[0]&&"/"===M[0].charAt(0)||M.unshift(""),A&&"/"!==M.join("/").substr(-1)&&M.push("");var T,P=""===M[0]||M[0]&&"/"===M[0].charAt(0);k&&(r.hostname=r.host=P?"":M.length?M.shift():"",(T=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=T.shift(),r.host=r.hostname=T.shift()));return(w=w||r.host&&M.length)&&!P&&M.unshift(""),M.length?r.pathname=M.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var e=this.host,t=f.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},function(e,t){e.exports=function(){for(var e={},t=0;t0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e},t.stripZeros=t.unpad,t.toBuffer=function(t){if(!e.isBuffer(t))if(Array.isArray(t))t=e.from(t);else if("string"==typeof t){if(!n.isHexString(t))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+t);t=e.from(n.padToEven(n.stripHexPrefix(t)),"hex")}else if("number"==typeof t)t=n.intToBuffer(t);else if(null==t)t=e.allocUnsafe(0);else if(a.isBN(t))t=t.toArrayLike(e);else{if(!t.toArray)throw new Error("invalid type");t=e.from(t.toArray())}return t},t.bufferToInt=function(e){return new a(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=t.toBuffer(e)).toString("hex")},t.fromSigned=function(e){return new a(e).fromTwos(256)},t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())},t.addHexPrefix=function(e){return"string"!=typeof e||n.isHexPrefixed(e)?e:"0x"+e},t.baToJSON=function(r){if(e.isBuffer(r))return"0x"+r.toString("hex");if(r instanceof Array){for(var n=[],a=0;a0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e},t.stripZeros=t.unpad,t.toBuffer=function(t){if(!e.isBuffer(t))if(Array.isArray(t))t=e.from(t);else if("string"==typeof t){if(!n.isHexString(t))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+t);t=e.from(n.padToEven(n.stripHexPrefix(t)),"hex")}else if("number"==typeof t)t=n.intToBuffer(t);else if(null==t)t=e.allocUnsafe(0);else if(a.isBN(t))t=t.toArrayLike(e);else{if(!t.toArray)throw new Error("invalid type");t=e.from(t.toArray())}return t},t.bufferToInt=function(e){return new a(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=t.toBuffer(e)).toString("hex")},t.fromSigned=function(e){return new a(e).fromTwos(256)},t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())},t.addHexPrefix=function(e){return"string"!=typeof e||n.isHexPrefixed(e)?e:"0x"+e},t.baToJSON=function(r){if(e.isBuffer(r))return"0x"+r.toString("hex");if(r instanceof Array){for(var n=[],a=0;a0&&"0"===r.toString();)r=(e=e.slice(1))[0];return e},t.toBuffer=function(e){if(!p.isBuffer(e))if(Array.isArray(e))e=p.from(e);else if("string"==typeof e)e=t.isHexString(e)?p.from(t.padToEven(t.stripHexPrefix(e)),"hex"):p.from(e);else if("number"==typeof e)e=t.intToBuffer(e);else if(null==e)e=p.allocUnsafe(0);else if(h.isBN(e))e=e.toArrayLike(p);else{if(!e.toArray)throw new Error("invalid type");e=p.from(e.toArray())}return e},t.bufferToInt=function(e){return new h(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=t.toBuffer(e)).toString("hex")},t.fromSigned=function(e){return new h(e).fromTwos(256)},t.toUnsigned=function(e){return p.from(e.toTwos(256).toArray())},t.keccak=function(e,r){switch(e=t.toBuffer(e),r||(r=256),r){case 224:return o(e);case 256:return f(e);case 384:return c(e);case 512:return d(e);default:throw new Error("Invald algorithm: keccak"+r)}},t.keccak256=function(e){return t.keccak(e)},t.sha3=t.keccak,t.sha256=function(e){return e=t.toBuffer(e),l("sha256").update(e).digest()},t.ripemd160=function(e,r){e=t.toBuffer(e);var n=l("rmd160").update(e).digest();return!0===r?t.setLength(n,32):n},t.rlphash=function(e){return t.keccak(b.encode(e))},t.isValidPrivate=function(e){return s.privateKeyVerify(e)},t.isValidPublic=function(e,t){return 64===e.length?s.publicKeyVerify(p.concat([p.from([4]),e])):!!t&&s.publicKeyVerify(e)},t.pubToAddress=t.publicToAddress=function(e,r){return e=t.toBuffer(e),r&&64!==e.length&&(e=s.publicKeyConvert(e,!1).slice(1)),u(64===e.length),t.keccak(e).slice(-20)};var m=t.privateToPublic=function(e){return e=t.toBuffer(e),s.publicKeyCreate(e,!1).slice(1)};t.importPublic=function(e){return 64!==(e=t.toBuffer(e)).length&&(e=s.publicKeyConvert(e,!1).slice(1)),e},t.ecsign=function(e,t){var r=s.sign(e,t),n={};return n.r=r.signature.slice(0,32),n.s=r.signature.slice(32,64),n.v=r.recovery+27,n},t.hashPersonalMessage=function(e){var r=t.toBuffer("Ethereum Signed Message:\n"+e.length.toString());return t.keccak(p.concat([r,e]))},t.ecrecover=function(e,r,n,a){var i=p.concat([t.setLength(n,32),t.setLength(a,32)],64),o=r-27;if(0!==o&&1!==o)throw new Error("Invalid signature v value");var c=s.recover(e,i,o);return s.publicKeyConvert(c,!1).slice(1)},t.toRpcSig=function(e,r,n){if(27!==e&&28!==e)throw new Error("Invalid recovery id");return t.bufferToHex(p.concat([t.setLengthLeft(r,32),t.setLengthLeft(n,32),t.toBuffer(e-27)]))},t.fromRpcSig=function(e){if(65!==(e=t.toBuffer(e)).length)throw new Error("Invalid signature length");var r=e[64];return r<27&&(r+=27),{v:r,r:e.slice(0,32),s:e.slice(32,64)}},t.privateToAddress=function(e){return t.publicToAddress(m(e))},t.isValidAddress=function(e){return/^0x[0-9a-fA-F]{40}$/.test(e)},t.isZeroAddress=function(e){return t.zeroAddress()===t.addHexPrefix(e)},t.toChecksumAddress=function(e){e=t.stripHexPrefix(e).toLowerCase();for(var r=t.keccak(e).toString("hex"),n="0x",a=0;a=8?n+=e[a].toUpperCase():n+=e[a];return n},t.isValidChecksumAddress=function(e){return t.isValidAddress(e)&&t.toChecksumAddress(e)===e},t.generateAddress=function(e,r){return e=t.toBuffer(e),r=(r=new h(r)).isZero()?null:p.from(r.toArray()),t.rlphash([e,r]).slice(-20)},t.isPrecompiled=function(e){var r=t.unpad(e);return 1===r.length&&r[0]>=1&&r[0]<=8},t.addHexPrefix=function(e){return"string"!=typeof e||t.isHexPrefixed(e)?e:"0x"+e},t.isValidSignature=function(e,t,r,n){var a=new h("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),i=new h("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);return 32===t.length&&32===r.length&&((27===e||28===e)&&(t=new h(t),r=new h(r),!(t.isZero()||t.gt(i)||r.isZero()||r.gt(i))&&(!1!==n||1!==new h(r).cmp(a))))},t.baToJSON=function(e){if(p.isBuffer(e))return"0x"+e.toString("hex");if(e instanceof Array){for(var r=[],n=0;n=a.length,"The field "+r.name+" must not have more "+r.length+" bytes")):r.allowZero&&0===a.length||!r.length||u(r.length===a.length,"The field "+r.name+" must have byte length of "+r.length),e.raw[n]=a}e._fields.push(r.name),Object.defineProperty(e,r.name,{enumerable:!0,configurable:!0,get:a,set:i}),r.default&&(e[r.name]=r.default),r.alias&&Object.defineProperty(e,r.alias,{enumerable:!1,configurable:!0,set:i,get:a})})),n)if("string"==typeof n&&(n=p.from(t.stripHexPrefix(n),"hex")),p.isBuffer(n)&&(n=b.decode(n)),Array.isArray(n)){if(n.length>e._fields.length)throw new Error("wrong number of fields in data");n.forEach((function(r,n){e[e._fields[n]]=t.toBuffer(r)}))}else{if("object"!==(void 0===n?"undefined":a(n)))throw new Error("invalid data");var i=Object.keys(n);r.forEach((function(t){-1!==i.indexOf(t.name)&&(e[t.name]=n[t.name]),-1!==i.indexOf(t.alias)&&(e[t.alias]=n[t.alias])}))}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JC_CONTRACTS=t.DEFAULT_NFT_TYPES=t.DEFALUT_TOKENS=t.BASE_TOKEN_URI=void 0,t.BASE_TOKEN_URI="https://market.cebg.games/api/nft/info/",t.DEFALUT_TOKENS={321:[{type:"eth",address:"eth",symbol:"KCS",decimal:18},{type:"erc20",address:"0xcaA011E902103752435AC98657B046B282E36509",symbol:"CEC",decimal:18},{type:"erc20",address:"0xBE023C9D294A4668f0d510E2570CB81B4536cE77",symbol:"CEG",decimal:18}],322:[{type:"eth",address:"eth",symbol:"tKCS",decimal:18},{type:"erc20",address:"0xdb6D4bB22E2C12686Efff25a79EC78f9f078fe7D",symbol:"CEC",decimal:18},{type:"erc20",address:"0xC5Cd606b3e9B80b758e8274B198c76D929aA094A",symbol:"CEG",decimal:18}],97:[{type:"eth",address:"eth",symbol:"BNB",decimal:18}],56:[{type:"eth",address:"eth",symbol:"BNB",decimal:18}],137:[{type:"eth",address:"eth",symbol:"MATIC",decimal:18}],80001:[{type:"eth",address:"eth",symbol:"MATIC",decimal:18},{type:"erc20",address:"0xfa513999031dC1DCf86e99d91101e17d07839235",symbol:"CEC",decimal:18},{type:"erc20",address:"0x9f87eCA8F0479383fF11a5AB2336b5A6c383d6F3",symbol:"CEG",decimal:18}],1338:[{type:"eth",address:"eth",symbol:"ETH",decimal:18},{type:"erc20",address:"0x94247cc867ED6277b901AFED817F3b13962814eD",symbol:"CEC",decimal:18},{type:"erc20",address:"0x28901774C7C74D3C78a17A18697D7BFFB999d3f7",symbol:"CEG",decimal:18}]},t.DEFAULT_NFT_TYPES={321:{hero:{address:"0x0EB362BD40F2288fF25A6Ee1b487cB0cb4638e0D",type:"erc721"},weapon:{address:"0x29F67A372AC1c6AcF478A564992D421FE20F2cc8",type:"erc721"},chip:{address:"0x54B6ED7EDe9355b471985439421Aa1DC7Da6Dc20",type:"erc1155"},shard:{address:"0x54B6ED7EDe9355b471985439421Aa1DC7Da6Dc20",type:"erc1155"}},322:{hero:{address:"0x52917087cd4E48bDb5f336012E677f471f9E1C2D",type:"erc721"},weapon:{address:"0x500AD8A4D50d71Af5cA8eA3b12B914f7aE5466f7",type:"erc721"},chip:{address:"0x0640958BDb4D7956e1452FacEBD550C6Cf42aC94",type:"erc1155"},shard:{address:"0x54B6ED7EDe9355b471985439421Aa1DC7Da6Dc20",type:"erc1155"}},137:{hero:{address:"0xaE08adb5278B107D2501e7c61907e41FEf3887D7",type:"erc721"},weapon:{address:"0xee0044BF2ACEf7C3D7f6781d8f5DC4d2Dd1CE64c",type:"erc721"},chip:{address:"0xc058411B15E544291765F15B13c88582b7bceaD0",type:"erc1155"},shard:{address:"0x1d4c7908E6a6795aE4335D0F072B0A129AAFFdc1",type:"erc1155"}},80001:{hero:{address:"0x3EBF5196dADC8F3F09C808333f98FE8A4b7d1e62",type:"erc721"},weapon:{address:"0x2F2Ed1c403cB7156617449795dE1CB47A0302a25",type:"erc721"},chip:{address:"0x73482411443E87CAC124C12A10B34e9Aaa2De168",type:"erc1155"},shard:{address:"0xFc21A863bFb4E4534B246078772e2074e076f0a7",type:"erc1155"}},1338:{hero:{address:"0xF07F3D7c1f64E9bC0005308c24e715D555195D6D",type:"erc721"},weapon:{address:"0xFA58cA95FF52dFF0C57bC0BE54462894003a5394",type:"erc721"},chip:{address:"0x615d4BE4Cba8e68efFe6F00e8E42AE07c4f84A7d",type:"erc1155"},shard:{address:"0x0f30db053d360225f43b845Cc8Fb0A456aFD4CA2",type:"erc1155"}}},t.JC_CONTRACTS={321:{nftMall:"0xa44927698D0aC8EF29e91508839cd6e10f773EE0",evolveFactory:"0x07Bad070e403a4Bad2Eec3BA3894c4524d3d2674",minterFactory:"0x5ecEFA2707e3f09B9A169ae696B36Df8dB7410ED"},322:{nftMall:"0xa44927698D0aC8EF29e91508839cd6e10f773EE0",evolveFactory:"0x07Bad070e403a4Bad2Eec3BA3894c4524d3d2674",minterFactory:"0x5ecEFA2707e3f09B9A169ae696B36Df8dB7410ED"},137:{nftMall:"0xa44927698D0aC8EF29e91508839cd6e10f773EE0",evolveFactory:"0x07Bad070e403a4Bad2Eec3BA3894c4524d3d2674",minterFactory:"0x5ecEFA2707e3f09B9A169ae696B36Df8dB7410ED"},80001:{nftMall:"0x1F6293c44633a50311Ec5Ab02ff14034b5c31272",evolveFactory:"0x9e6167B11Ad15D8407865E21D4770E9F6CF10853",minterFactory:"0xb60c7312F56da4303CE3bf27124f1850dBe1D0E5",chipLocker:"0x4Ef766854EE104053cF2D243620b7A643fCC2B54"},1338:{nftMall:"0xC04F9c0461DA8C19a60c8d4C95733b12D51e6Eca",evolveFactory:"0x54B6f621e8c8dD2Cfcd49f2E7aD1dF19E60bf4B9",minterFactory:"0x4b848789f6994d24cAEfaB187fD6c8bE3E0B97cf",chipLocker:"0xb288bA87a02d34ec827a15487633D11faB79b718"}}},function(e,t){e.exports=function(){}},function(e,t){function r(e){return e.sort((function(e,t){return"latest"===e||"earliest"===t?1:"latest"===t||"earliest"===e?-1:n(e)-n(t)}))}function n(e){return null==e?e:Number.parseInt(e,16)}function a(e){if(null==e)return e;var t=e.toString(16);return t.length%2&&(t="0"+t),"0x"+t}function i(){return Math.floor(16*Math.random()).toString(16)}e.exports={minBlockRef:function(){for(var e=arguments.length,t=new Array(e),n=0;n0&&"0"===t.toString();)t=(e=e.slice(1))[0];return e},t.stripZeros=t.unpad,t.toBuffer=function(t){if(!e.isBuffer(t))if(Array.isArray(t))t=e.from(t);else if("string"==typeof t){if(!n.isHexString(t))throw new Error("Cannot convert string to buffer. toBuffer only supports 0x-prefixed hex strings and this string was given: "+t);t=e.from(n.padToEven(n.stripHexPrefix(t)),"hex")}else if("number"==typeof t)t=n.intToBuffer(t);else if(null==t)t=e.allocUnsafe(0);else if(a.isBN(t))t=t.toArrayLike(e);else{if(!t.toArray)throw new Error("invalid type");t=e.from(t.toArray())}return t},t.bufferToInt=function(e){return new a(t.toBuffer(e)).toNumber()},t.bufferToHex=function(e){return"0x"+(e=t.toBuffer(e)).toString("hex")},t.fromSigned=function(e){return new a(e).fromTwos(256)},t.toUnsigned=function(t){return e.from(t.toTwos(256).toArray())},t.addHexPrefix=function(e){return"string"!=typeof e||n.isHexPrefixed(e)?e:"0x"+e},t.baToJSON=function(r){if(e.isBuffer(r))return"0x"+r.toString("hex");if(r instanceof Array){for(var n=[],a=0;a>24&255)){var t=e>>16&255,r=e>>8&255,n=255&e;255===t?(t=0,255===r?(r=0,255===n?n=0:++n):++r):++t,e=0,e+=t<<16,e+=r<<8,e+=n}else e+=1<<24;return e}var n=t.Encryptor=t.extend({processBlock:function(e,t){var n=this._cipher,a=n.blockSize,i=this._iv,o=this._counter;i&&(o=this._counter=i.slice(0),this._iv=void 0),function(e){0===(e[0]=r(e[0]))&&(e[1]=r(e[1]))}(o);var c=o.slice(0);n.encryptBlock(c,0);for(var f=0;f>>2]|=a<<24-i%4*8,e.sigBytes+=a},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Ansix923},"object"===c(t)?e.exports=t=o(r(2),r(12)):(a=[r(2),r(12)],void 0===(i="function"==typeof(n=o)?n.apply(t,a):n)||(e.exports=i))},function(e,t,r){var n,a,i,o;function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}o=function(e){return e.pad.Iso10126={pad:function(t,r){var n=4*r,a=n-t.sigBytes%n;t.concat(e.lib.WordArray.random(a-1)).concat(e.lib.WordArray.create([a<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},e.pad.Iso10126},"object"===c(t)?e.exports=t=o(r(2),r(12)):(a=[r(2),r(12)],void 0===(i="function"==typeof(n=o)?n.apply(t,a):n)||(e.exports=i))},function(e,t,r){var n,a,i,o;function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}o=function(e){return e.pad.Iso97971={pad:function(t,r){t.concat(e.lib.WordArray.create([2147483648],1)),e.pad.ZeroPadding.pad(t,r)},unpad:function(t){e.pad.ZeroPadding.unpad(t),t.sigBytes--}},e.pad.Iso97971},"object"===c(t)?e.exports=t=o(r(2),r(12)):(a=[r(2),r(12)],void 0===(i="function"==typeof(n=o)?n.apply(t,a):n)||(e.exports=i))},function(e,t,r){var n,a,i,o;function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}o=function(e){return e.pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){var t=e.words,r=e.sigBytes-1;for(r=e.sigBytes-1;r>=0;r--)if(t[r>>>2]>>>24-r%4*8&255){e.sigBytes=r+1;break}}},e.pad.ZeroPadding},"object"===c(t)?e.exports=t=o(r(2),r(12)):(a=[r(2),r(12)],void 0===(i="function"==typeof(n=o)?n.apply(t,a):n)||(e.exports=i))},function(e,t,r){var n,a,i,o;function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}o=function(e){return e.pad.NoPadding={pad:function(){},unpad:function(){}},e.pad.NoPadding},"object"===c(t)?e.exports=t=o(r(2),r(12)):(a=[r(2),r(12)],void 0===(i="function"==typeof(n=o)?n.apply(t,a):n)||(e.exports=i))},function(e,t,r){var n,a,i,o;function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}o=function(e){var t,r,n;return r=(t=e).lib.CipherParams,n=t.enc.Hex,t.format.Hex={stringify:function(e){return e.ciphertext.toString(n)},parse:function(e){var t=n.parse(e);return r.create({ciphertext:t})}},e.format.Hex},"object"===c(t)?e.exports=t=o(r(2),r(12)):(a=[r(2),r(12)],void 0===(i="function"==typeof(n=o)?n.apply(t,a):n)||(e.exports=i))},function(e,t,r){var n,a,i,o;function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}o=function(e){return function(){var t=e,r=t.lib.BlockCipher,n=t.algo,a=[],i=[],o=[],c=[],f=[],d=[],s=[],u=[],b=[],h=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var r=0,n=0;for(t=0;t<256;t++){var l=n^n<<1^n<<2^n<<3^n<<4;l=l>>>8^255&l^99,a[r]=l,i[l]=r;var p=e[r],m=e[p],x=e[m],y=257*e[l]^16843008*l;o[r]=y<<24|y>>>8,c[r]=y<<16|y>>>16,f[r]=y<<8|y>>>24,d[r]=y,y=16843009*x^65537*m^257*p^16843008*r,s[l]=y<<24|y>>>8,u[l]=y<<16|y>>>16,b[l]=y<<8|y>>>24,h[l]=y,r?(r=p^e[e[e[x^p]]],n^=e[e[n]]):r=n=1}}();var l=[0,1,2,4,8,16,32,64,128,27,54],p=n.AES=r.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,n=4*((this._nRounds=r+6)+1),i=this._keySchedule=[],o=0;o6&&o%r==4&&(d=a[d>>>24]<<24|a[d>>>16&255]<<16|a[d>>>8&255]<<8|a[255&d]):(d=a[(d=d<<8|d>>>24)>>>24]<<24|a[d>>>16&255]<<16|a[d>>>8&255]<<8|a[255&d],d^=l[o/r|0]<<24),i[o]=i[o-r]^d);for(var c=this._invKeySchedule=[],f=0;f>>24]]^u[a[d>>>16&255]]^b[a[d>>>8&255]]^h[a[255&d]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,o,c,f,d,a)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,s,u,b,h,i),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,a,i,o,c){for(var f=this._nRounds,d=e[t]^r[0],s=e[t+1]^r[1],u=e[t+2]^r[2],b=e[t+3]^r[3],h=4,l=1;l>>24]^a[s>>>16&255]^i[u>>>8&255]^o[255&b]^r[h++],m=n[s>>>24]^a[u>>>16&255]^i[b>>>8&255]^o[255&d]^r[h++],x=n[u>>>24]^a[b>>>16&255]^i[d>>>8&255]^o[255&s]^r[h++],y=n[b>>>24]^a[d>>>16&255]^i[s>>>8&255]^o[255&u]^r[h++];d=p,s=m,u=x,b=y}p=(c[d>>>24]<<24|c[s>>>16&255]<<16|c[u>>>8&255]<<8|c[255&b])^r[h++],m=(c[s>>>24]<<24|c[u>>>16&255]<<16|c[b>>>8&255]<<8|c[255&d])^r[h++],x=(c[u>>>24]<<24|c[b>>>16&255]<<16|c[d>>>8&255]<<8|c[255&s])^r[h++],y=(c[b>>>24]<<24|c[d>>>16&255]<<16|c[s>>>8&255]<<8|c[255&u])^r[h++],e[t]=p,e[t+1]=m,e[t+2]=x,e[t+3]=y},keySize:8});t.AES=r._createHelper(p)}(),e.AES},"object"===c(t)?e.exports=t=o(r(2),r(31),r(28),r(24),r(12)):(a=[r(2),r(31),r(28),r(24),r(12)],void 0===(i="function"==typeof(n=o)?n.apply(t,a):n)||(e.exports=i))},function(e,t,r){var n,a,i,o;function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}o=function(e){return function(){var t=e,r=t.lib,n=r.WordArray,a=r.BlockCipher,i=t.algo,o=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],c=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],f=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],d=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],s=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],u=i.DES=a.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var n=o[r]-1;t[r]=e[n>>>5]>>>31-n%32&1}for(var a=this._subKeys=[],i=0;i<16;i++){var d=a[i]=[],s=f[i];for(r=0;r<24;r++)d[r/6|0]|=t[(c[r]-1+s)%28]<<31-r%6,d[4+(r/6|0)]|=t[28+(c[r+24]-1+s)%28]<<31-r%6;for(d[0]=d[0]<<1|d[0]>>>31,r=1;r<7;r++)d[r]=d[r]>>>4*(r-1)+3;d[7]=d[7]<<5|d[7]>>>27}var u=this._invSubKeys=[];for(r=0;r<16;r++)u[r]=a[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,r){this._lBlock=e[t],this._rBlock=e[t+1],b.call(this,4,252645135),b.call(this,16,65535),h.call(this,2,858993459),h.call(this,8,16711935),b.call(this,1,1431655765);for(var n=0;n<16;n++){for(var a=r[n],i=this._lBlock,o=this._rBlock,c=0,f=0;f<8;f++)c|=d[f][((o^a[f])&s[f])>>>0];this._lBlock=o,this._rBlock=i^c}var u=this._lBlock;this._lBlock=this._rBlock,this._rBlock=u,b.call(this,1,1431655765),h.call(this,8,16711935),h.call(this,2,858993459),b.call(this,16,65535),b.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function b(e,t){var r=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=r,this._lBlock^=r<>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<192.");var t=e.slice(0,2),r=e.length<4?e.slice(0,2):e.slice(2,4),a=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=u.createEncryptor(n.create(t)),this._des2=u.createEncryptor(n.create(r)),this._des3=u.createEncryptor(n.create(a))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});t.TripleDES=a._createHelper(l)}(),e.TripleDES},"object"===c(t)?e.exports=t=o(r(2),r(31),r(28),r(24),r(12)):(a=[r(2),r(31),r(28),r(24),r(12)],void 0===(i="function"==typeof(n=o)?n.apply(t,a):n)||(e.exports=i))},function(e,t,r){var n,a,i,o;function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}o=function(e){return function(){var t=e,r=t.lib.StreamCipher,n=t.algo,a=n.RC4=r.extend({_doReset:function(){for(var e=this._key,t=e.words,r=e.sigBytes,n=this._S=[],a=0;a<256;a++)n[a]=a;a=0;for(var i=0;a<256;a++){var o=a%r,c=t[o>>>2]>>>24-o%4*8&255;i=(i+n[a]+c)%256;var f=n[a];n[a]=n[i],n[i]=f}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=i.call(this)},keySize:8,ivSize:0});function i(){for(var e=this._S,t=this._i,r=this._j,n=0,a=0;a<4;a++){r=(r+e[t=(t+1)%256])%256;var i=e[t];e[t]=e[r],e[r]=i,n|=e[(e[t]+e[r])%256]<<24-8*a}return this._i=t,this._j=r,n}t.RC4=r._createHelper(a);var o=n.RC4Drop=a.extend({cfg:a.cfg.extend({drop:192}),_doReset:function(){a._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)i.call(this)}});t.RC4Drop=r._createHelper(o)}(),e.RC4},"object"===c(t)?e.exports=t=o(r(2),r(31),r(28),r(24),r(12)):(a=[r(2),r(31),r(28),r(24),r(12)],void 0===(i="function"==typeof(n=o)?n.apply(t,a):n)||(e.exports=i))},function(e,t,r){var n,a,i,o;function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}o=function(e){return function(){var t=e,r=t.lib.StreamCipher,n=t.algo,a=[],i=[],o=[],c=n.Rabbit=r.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,r=0;r<4;r++)e[r]=16711935&(e[r]<<8|e[r]>>>24)|4278255360&(e[r]<<24|e[r]>>>8);var n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],a=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,r=0;r<4;r++)f.call(this);for(r=0;r<8;r++)a[r]^=n[r+4&7];if(t){var i=t.words,o=i[0],c=i[1],d=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),s=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),u=d>>>16|4294901760&s,b=s<<16|65535&d;for(a[0]^=d,a[1]^=u,a[2]^=s,a[3]^=b,a[4]^=d,a[5]^=u,a[6]^=s,a[7]^=b,r=0;r<4;r++)f.call(this)}},_doProcessBlock:function(e,t){var r=this._X;f.call(this),a[0]=r[0]^r[5]>>>16^r[3]<<16,a[1]=r[2]^r[7]>>>16^r[5]<<16,a[2]=r[4]^r[1]>>>16^r[7]<<16,a[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)a[n]=16711935&(a[n]<<8|a[n]>>>24)|4278255360&(a[n]<<24|a[n]>>>8),e[t+n]^=a[n]},blockSize:4,ivSize:2});function f(){for(var e=this._X,t=this._C,r=0;r<8;r++)i[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],a=65535&n,c=n>>>16,f=((a*a>>>17)+a*c>>>15)+c*c,d=((4294901760&n)*n|0)+((65535&n)*n|0);o[r]=f^d}e[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,e[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,e[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,e[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,e[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,e[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,e[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,e[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}t.Rabbit=r._createHelper(c)}(),e.Rabbit},"object"===c(t)?e.exports=t=o(r(2),r(31),r(28),r(24),r(12)):(a=[r(2),r(31),r(28),r(24),r(12)],void 0===(i="function"==typeof(n=o)?n.apply(t,a):n)||(e.exports=i))},function(e,t,r){var n,a,i,o;function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}o=function(e){return function(){var t=e,r=t.lib.StreamCipher,n=t.algo,a=[],i=[],o=[],c=n.RabbitLegacy=r.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],n=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var a=0;a<4;a++)f.call(this);for(a=0;a<8;a++)n[a]^=r[a+4&7];if(t){var i=t.words,o=i[0],c=i[1],d=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),s=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),u=d>>>16|4294901760&s,b=s<<16|65535&d;for(n[0]^=d,n[1]^=u,n[2]^=s,n[3]^=b,n[4]^=d,n[5]^=u,n[6]^=s,n[7]^=b,a=0;a<4;a++)f.call(this)}},_doProcessBlock:function(e,t){var r=this._X;f.call(this),a[0]=r[0]^r[5]>>>16^r[3]<<16,a[1]=r[2]^r[7]>>>16^r[5]<<16,a[2]=r[4]^r[1]>>>16^r[7]<<16,a[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)a[n]=16711935&(a[n]<<8|a[n]>>>24)|4278255360&(a[n]<<24|a[n]>>>8),e[t+n]^=a[n]},blockSize:4,ivSize:2});function f(){for(var e=this._X,t=this._C,r=0;r<8;r++)i[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],a=65535&n,c=n>>>16,f=((a*a>>>17)+a*c>>>15)+c*c,d=((4294901760&n)*n|0)+((65535&n)*n|0);o[r]=f^d}e[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,e[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,e[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,e[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,e[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,e[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,e[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,e[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}t.RabbitLegacy=r._createHelper(c)}(),e.RabbitLegacy},"object"===c(t)?e.exports=t=o(r(2),r(31),r(28),r(24),r(12)):(a=[r(2),r(31),r(28),r(24),r(12)],void 0===(i="function"==typeof(n=o)?n.apply(t,a):n)||(e.exports=i))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WALLET_API_HOST=t.WALLET_STORAGE_KEY_NAME=void 0,t.WALLET_STORAGE_KEY_NAME="jc_wallet_data",t.WALLET_API_HOST="http://10.0.1.3:3007"},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,a(r(315),t),a(r(316),t),a(r(709),t),a(r(173),t),a(r(710),t),a(r(57),t),a(r(711),t),a(r(43),t),a(r(174),t);var i=r(75);Object.defineProperty(t,"isHexPrefixed",{enumerable:!0,get:function(){return i.isHexPrefixed}}),Object.defineProperty(t,"stripHexPrefix",{enumerable:!0,get:function(){return i.stripHexPrefix}}),Object.defineProperty(t,"padToEven",{enumerable:!0,get:function(){return i.padToEven}}),Object.defineProperty(t,"getBinarySize",{enumerable:!0,get:function(){return i.getBinarySize}}),Object.defineProperty(t,"arrayContainsArray",{enumerable:!0,get:function(){return i.arrayContainsArray}}),Object.defineProperty(t,"toAscii",{enumerable:!0,get:function(){return i.toAscii}}),Object.defineProperty(t,"fromUtf8",{enumerable:!0,get:function(){return i.fromUtf8}}),Object.defineProperty(t,"fromAscii",{enumerable:!0,get:function(){return i.fromAscii}}),Object.defineProperty(t,"getKeys",{enumerable:!0,get:function(){return i.getKeys}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return i.isHexString}})},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KECCAK256_RLP=t.KECCAK256_RLP_S=t.KECCAK256_RLP_ARRAY=t.KECCAK256_RLP_ARRAY_S=t.KECCAK256_NULL=t.KECCAK256_NULL_S=t.TWO_POW256=t.MAX_INTEGER=t.MAX_UINT64=void 0;var n=r(0),a=r(43);t.MAX_UINT64=new a.BN("ffffffffffffffff",16),t.MAX_INTEGER=new a.BN("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16),t.TWO_POW256=new a.BN("10000000000000000000000000000000000000000000000000000000000000000",16),t.KECCAK256_NULL_S="c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470",t.KECCAK256_NULL=n.Buffer.from(t.KECCAK256_NULL_S,"hex"),t.KECCAK256_RLP_ARRAY_S="1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",t.KECCAK256_RLP_ARRAY=n.Buffer.from(t.KECCAK256_RLP_ARRAY_S,"hex"),t.KECCAK256_RLP_S="56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",t.KECCAK256_RLP=n.Buffer.from(t.KECCAK256_RLP_S,"hex")},function(e,t,r){"use strict";(function(e){var n=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isZeroAddress=t.zeroAddress=t.importPublic=t.privateToAddress=t.privateToPublic=t.publicToAddress=t.pubToAddress=t.isValidPublic=t.isValidPrivate=t.generateAddress2=t.generateAddress=t.isValidChecksumAddress=t.toChecksumAddress=t.isValidAddress=t.Account=void 0;var i=a(r(14)),o=r(43),c=r(22),f=r(75),d=r(315),s=r(57),u=r(173),b=r(117),h=r(174),l=function(){function e(e,t,r,n){void 0===e&&(e=new o.BN(0)),void 0===t&&(t=new o.BN(0)),void 0===r&&(r=d.KECCAK256_RLP),void 0===n&&(n=d.KECCAK256_NULL),this.nonce=e,this.balance=t,this.stateRoot=r,this.codeHash=n,this._validate()}return e.fromAccountData=function(t){var r=t.nonce,n=t.balance,a=t.stateRoot,i=t.codeHash;return new e(r?new o.BN((0,s.toBuffer)(r)):void 0,n?new o.BN((0,s.toBuffer)(n)):void 0,a?(0,s.toBuffer)(a):void 0,i?(0,s.toBuffer)(i):void 0)},e.fromRlpSerializedAccount=function(e){var t=o.rlp.decode(e);if(!Array.isArray(t))throw new Error("Invalid serialized account input. Must be array");return this.fromValuesArray(t)},e.fromValuesArray=function(t){var r=n(t,4),a=r[0],i=r[1],c=r[2],f=r[3];return new e(new o.BN(a),new o.BN(i),c,f)},e.prototype._validate=function(){if(this.nonce.lt(new o.BN(0)))throw new Error("nonce must be greater than zero");if(this.balance.lt(new o.BN(0)))throw new Error("balance must be greater than zero");if(32!==this.stateRoot.length)throw new Error("stateRoot must have a length of 32");if(32!==this.codeHash.length)throw new Error("codeHash must have a length of 32")},e.prototype.raw=function(){return[(0,h.bnToUnpaddedBuffer)(this.nonce),(0,h.bnToUnpaddedBuffer)(this.balance),this.stateRoot,this.codeHash]},e.prototype.serialize=function(){return o.rlp.encode(this.raw())},e.prototype.isContract=function(){return!this.codeHash.equals(d.KECCAK256_NULL)},e.prototype.isEmpty=function(){return this.balance.isZero()&&this.nonce.isZero()&&this.codeHash.equals(d.KECCAK256_NULL)},e}();t.Account=l;t.isValidAddress=function(e){try{(0,b.assertIsString)(e)}catch(e){return!1}return/^0x[0-9a-fA-F]{40}$/.test(e)};t.toChecksumAddress=function(e,t){(0,b.assertIsHexString)(e);var r=(0,f.stripHexPrefix)(e).toLowerCase(),n="";t&&(n=(0,h.toType)(t,h.TypeOutput.BN).toString()+"0x");for(var a=(0,u.keccakFromString)(n+r).toString("hex"),i="0x",o=0;o=8?i+=r[o].toUpperCase():i+=r[o];return i};t.isValidChecksumAddress=function(e,r){return(0,t.isValidAddress)(e)&&(0,t.toChecksumAddress)(e,r)===e};t.generateAddress=function(t,r){(0,b.assertIsBuffer)(t),(0,b.assertIsBuffer)(r);var n=new o.BN(r);return n.isZero()?(0,u.rlphash)([t,null]).slice(-20):(0,u.rlphash)([t,e.from(n.toArray())]).slice(-20)};t.generateAddress2=function(t,r,n){return(0,b.assertIsBuffer)(t),(0,b.assertIsBuffer)(r),(0,b.assertIsBuffer)(n),(0,i.default)(20===t.length),(0,i.default)(32===r.length),(0,u.keccak256)(e.concat([e.from("ff","hex"),t,r,(0,u.keccak256)(n)])).slice(-20)};t.isValidPrivate=function(e){return(0,c.privateKeyVerify)(e)};t.isValidPublic=function(t,r){return void 0===r&&(r=!1),(0,b.assertIsBuffer)(t),64===t.length?(0,c.publicKeyVerify)(e.concat([e.from([4]),t])):!!r&&(0,c.publicKeyVerify)(t)};t.pubToAddress=function(t,r){return void 0===r&&(r=!1),(0,b.assertIsBuffer)(t),r&&64!==t.length&&(t=e.from((0,c.publicKeyConvert)(t,!1).slice(1))),(0,i.default)(64===t.length),(0,u.keccak)(t).slice(-20)},t.publicToAddress=t.pubToAddress;t.privateToPublic=function(t){return(0,b.assertIsBuffer)(t),e.from((0,c.publicKeyCreate)(t,!1)).slice(1)};t.privateToAddress=function(e){return(0,t.publicToAddress)((0,t.privateToPublic)(e))};t.importPublic=function(t){return(0,b.assertIsBuffer)(t),64!==t.length&&(t=e.from((0,c.publicKeyConvert)(t,!1).slice(1))),t};t.zeroAddress=function(){var e=(0,s.zeros)(20);return(0,s.bufferToHex)(e)};t.isZeroAddress=function(e){try{(0,b.assertIsString)(e)}catch(e){return!1}return(0,t.zeroAddress)()===e}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";var n=r(19),a=r(715);e.exports=a((function(e){var t=n("sha256").update(e).digest();return n("sha256").update(t).digest()}))},function(e,t,r){ /*! MIT License. Copyright 2015-2018 Richard Moore . See LICENSE.txt. */ -!function(t){"use strict";function r(e){return parseInt(e)===e}function n(e){if(!r(e.length))return!1;for(var t=0;t255)return!1;return!0}function a(e,t){if(e.buffer&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!n(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(r(e.length)&&n(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function i(e){return new Uint8Array(e)}function o(e,t,r,n,a){null==n&&null==a||(e=e.slice?e.slice(n,a):Array.prototype.slice.call(e,n,a)),t.set(e,r)}var c,f={toBytes:function(e){var t=[],r=0;for(e=encodeURI(e);r191&&n<224?(t.push(String.fromCharCode((31&n)<<6|63&e[r+1])),r+=2):(t.push(String.fromCharCode((15&n)<<12|(63&e[r+1])<<6|63&e[r+2])),r+=3)}return t.join("")}},d=(c="0123456789abcdef",{toBytes:function(e){for(var t=[],r=0;r>4]+c[15&n])}return t.join("")}}),s={16:10,24:12,32:14},u=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],b=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],h=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],l=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],p=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],m=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],x=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],y=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],v=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],g=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],w=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],_=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],M=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],k=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],S=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function A(e){for(var t=[],r=0;r>2,this._Ke[r][t%4]=i[t],this._Kd[e-r][t%4]=i[t];for(var o,c=0,f=a;f>16&255]<<24^b[o>>8&255]<<16^b[255&o]<<8^b[o>>24&255]^u[c]<<24,c+=1,8!=a)for(t=1;t>8&255]<<8^b[o>>16&255]<<16^b[o>>24&255]<<24;for(t=a/2+1;t>2,h=f%4,this._Ke[d][h]=i[t],this._Kd[e-d][h]=i[t++],f++}for(var d=1;d>24&255]^M[o>>16&255]^k[o>>8&255]^S[255&o]},E.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,r=[0,0,0,0],n=A(e),a=0;a<4;a++)n[a]^=this._Ke[0][a];for(var o=1;o>24&255]^p[n[(a+1)%4]>>16&255]^m[n[(a+2)%4]>>8&255]^x[255&n[(a+3)%4]]^this._Ke[o][a];n=r.slice()}var c,f=i(16);for(a=0;a<4;a++)c=this._Ke[t][a],f[4*a]=255&(b[n[a]>>24&255]^c>>24),f[4*a+1]=255&(b[n[(a+1)%4]>>16&255]^c>>16),f[4*a+2]=255&(b[n[(a+2)%4]>>8&255]^c>>8),f[4*a+3]=255&(b[255&n[(a+3)%4]]^c);return f},E.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,r=[0,0,0,0],n=A(e),a=0;a<4;a++)n[a]^=this._Kd[0][a];for(var o=1;o>24&255]^v[n[(a+3)%4]>>16&255]^g[n[(a+2)%4]>>8&255]^w[255&n[(a+1)%4]]^this._Kd[o][a];n=r.slice()}var c,f=i(16);for(a=0;a<4;a++)c=this._Kd[t][a],f[4*a]=255&(h[n[a]>>24&255]^c>>24),f[4*a+1]=255&(h[n[(a+3)%4]>>16&255]^c>>16),f[4*a+2]=255&(h[n[(a+2)%4]>>8&255]^c>>8),f[4*a+3]=255&(h[255&n[(a+1)%4]]^c);return f};var O=function e(t){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new E(t)};O.prototype.encrypt=function(e){if((e=a(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=i(e.length),r=i(16),n=0;nNumber.MAX_SAFE_INTEGER)throw new Error("integer value out of safe range");for(var t=15;t>=0;--t)this._counter[t]=e%256,e=parseInt(e/256)},B.prototype.setBytes=function(e){if(16!=(e=a(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},B.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var R=function e(t,r){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",r instanceof B||(r=new B(r)),this._counter=r,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new E(t)};R.prototype.encrypt=function(e){for(var t=a(e,!0),r=0;r16)throw new Error("PKCS#7 padding byte out of range");for(var r=e.length-t,n=0;n=0;f--)(i=e[f])&&(c=(o<3?i(c):o>3?i(t,r,c):i(t,r))||c);return o>3&&c&&Object.defineProperty(t,r,c),c};Object.defineProperty(t,"__esModule",{value:!0}),t.NativeSvr=void 0;var i=r(5),o=r(115),c=r(97),f=function(){function e(){this._event=o.createWalletEvents()}return e.prototype._subscribeToResponse=function(e,t){this._event.on("response:"+e,t)},e.prototype._subscribeToCallResponse=function(e){var t=this;return new Promise((function(r,n){t._subscribeToResponse(e,(function(e){e.errcode?n(e.errcode):r(e.data)}))}))},e.prototype.handleNativeCallback=function(){for(var e=[],t=0;t=0;f--)(i=e[f])&&(c=(o<3?i(c):o>3?i(t,r,c):i(t,r))||c);return o>3&&c&&Object.defineProperty(t,r,c),c};Object.defineProperty(t,"__esModule",{value:!0}),t.WalletEnv=void 0;var i=r(115),o=r(97),c=function(){function e(){this.handler=i.createWalletEvents()}return e=a([o.singleton],e)}();t.WalletEnv=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.abiERC1155=void 0,t.abiERC1155=[{inputs:[{internalType:"string",name:"uri_",type:"string"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256[]",name:"ids",type:"uint256[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"}],name:"TransferBatch",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"TransferSingle",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"value",type:"string"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"URI",type:"event"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"accounts",type:"address[]"},{internalType:"uint256[]",name:"ids",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"uri",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}]},function(e,t,r){"use strict";var n,a=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WalletConnect=void 0;var o=i(r(852)),c=r(752),f=function(e){function t(t,r){return e.call(this,{cryptoLib:c,connectorOpts:t,pushServerOpts:r})||this}return a(t,e),t.getInstance=function(e,r){return this._instance||(this._instance=new t(e,r)),this._instance},t}(o.default);t.WalletConnect=f},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),a(r(755),t),a(r(756),t),a(r(757),t),a(r(335),t),a(r(758),t)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LENGTH_1024=t.LENGTH_512=t.LENGTH_256=t.LENGTH_128=t.LENGTH_64=t.LENGTH_32=t.LENGTH_16=t.LENGTH_1=t.LENGTH_0=void 0,t.LENGTH_0=0,t.LENGTH_1=1,t.LENGTH_16=16,t.LENGTH_32=32,t.LENGTH_64=64,t.LENGTH_128=128,t.LENGTH_256=256,t.LENGTH_512=512,t.LENGTH_1024=1024},function(e,t,r){"use strict";var n=function(e,t){return function(){for(var r=this,n=t.promiseModule,a=new Array(arguments.length),i=0;i-1&&e%1==0&&e<=9007199254740991}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(t,r,f){if(f=(0,a.default)(f||n.default),e<=0||!t)return f(null);var d=(0,i.default)(t),s=!1,u=0,b=!1;function h(e,t){if(u-=1,e)s=!0,f(e);else{if(t===c.default||s&&u<=0)return s=!0,f(null);b||l()}}function l(){for(b=!0;u=e.params.length?e.params:"eth_getBlockByNumber"===e.method?e.params.slice(1):e.params.slice(0,t)}function o(e){switch(e.method){case"eth_getStorageAt":return 2;case"eth_getBalance":case"eth_getCode":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":return 1;case"eth_getBlockByNumber":return 0;default:return}}function c(e){switch(e.method){case"web3_clientVersion":case"web3_sha3":case"eth_protocolVersion":case"eth_getBlockTransactionCountByHash":case"eth_getUncleCountByBlockHash":case"eth_getCode":case"eth_getBlockByHash":case"eth_getTransactionByHash":case"eth_getTransactionByBlockHashAndIndex":case"eth_getTransactionReceipt":case"eth_getUncleByBlockHashAndIndex":case"eth_getCompilers":case"eth_compileLLL":case"eth_compileSolidity":case"eth_compileSerpent":case"shh_version":return"perma";case"eth_getBlockByNumber":case"eth_getBlockTransactionCountByNumber":case"eth_getUncleCountByBlockNumber":case"eth_getTransactionByBlockNumberAndIndex":case"eth_getUncleByBlockNumberAndIndex":return"fork";case"eth_gasPrice":case"eth_getBalance":case"eth_getStorageAt":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":case"eth_getFilterLogs":case"eth_getLogs":case"eth_blockNumber":return"block";case"net_version":case"net_peerCount":case"net_listening":case"eth_syncing":case"eth_sign":case"eth_coinbase":case"eth_mining":case"eth_hashrate":case"eth_accounts":case"eth_sendTransaction":case"eth_sendRawTransaction":case"eth_newFilter":case"eth_newBlockFilter":case"eth_newPendingTransactionFilter":case"eth_uninstallFilter":case"eth_getFilterChanges":case"eth_getWork":case"eth_submitWork":case"eth_submitHashrate":case"db_putString":case"db_getString":case"db_putHex":case"db_getHex":case"shh_post":case"shh_newIdentity":case"shh_hasIdentity":case"shh_newGroup":case"shh_addToGroup":case"shh_newFilter":case"shh_uninstallFilter":case"shh_getFilterChanges":case"shh_getMessages":return"never"}}e.exports={cacheIdentifierForPayload:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!a(e))return null;var r=t.includeBlockRef,o=r?e.params:i(e);return e.method+":"+n(o)},canCache:a,blockTagForPayload:function(e){var t=o(e);if(t>=e.params.length)return null;return e.params[t]},paramsWithoutBlockTag:i,blockTagParamIndex:o,cacheTypeForPayload:c}},function(e,t,r){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a="undefined"!=typeof JSON?JSON:r(803);e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r=t.space||"";"number"==typeof r&&(r=Array(r+1).join(" "));var c,f="boolean"==typeof t.cycles&&t.cycles,d=t.replacer||function(e,t){return t},s=t.cmp&&(c=t.cmp,function(e){return function(t,r){var n={key:t,value:e[t]},a={key:r,value:e[r]};return c(n,a)}}),u=[];return function e(t,c,b,h){var l=r?"\n"+new Array(h+1).join(r):"",p=r?": ":":";if(b&&b.toJSON&&"function"==typeof b.toJSON&&(b=b.toJSON()),void 0!==(b=d.call(t,c,b))){if("object"!==n(b)||null===b)return a.stringify(b);if(i(b)){for(var m=[],x=0;x=0;--a){var i=this.tryEntries[a],o=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),f=r.call(i,"finallyLoc");if(c&&f){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),k(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;k(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:A(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),b}},e}function i(e,t,r,n,a,i,o){try{var c=e[i](o),f=c.value}catch(e){return void r(e)}c.done?t(f):Promise.resolve(f).then(n,a)}function o(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function c(e){i(o,n,a,c,f,"next",e)}function f(e){i(o,n,a,c,f,"throw",e)}c(void 0)}))}}var c=r(853).Mutex,f=r(351).createAsyncMiddleware,d=r(355),s=r(821),u=r(824),b=r(825),h=r(91),l=h.intToHex,p=h.hexToInt;function m(e){return x(o(a().mark((function t(){var r,n,i=arguments;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.apply(void 0,i);case 2:return r=t.sent,n=l(r.id),t.abrupt("return",n);case 5:case"end":return t.stop()}}),t)}))))}function x(e){return f(function(){var t=o(a().mark((function t(r,n){var i;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.apply(null,r.params);case 2:i=t.sent,n.result=i;case 4:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}())}function y(e,t){var r=[];for(var n in e)r.push(e[n]);return r}e.exports=function(e){var t=e.blockTracker,r=e.provider,n=0,i={},f=new c,h=function(e){var t=e.mutex;return function(e){return function(){var r=o(a().mark((function r(n,i,o,c){return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.acquire();case 2:(0,r.sent)(),e(n,i,o,c);case 5:case"end":return r.stop()}}),r)})));return function(e,t,n,a){return r.apply(this,arguments)}}()}}({mutex:f}),v=d({eth_newFilter:h(m(w)),eth_newBlockFilter:h(m(M)),eth_newPendingTransactionFilter:h(m(S)),eth_uninstallFilter:h(x(j)),eth_getFilterChanges:h(x(E)),eth_getFilterLogs:h(x(T))}),g=function(){var e=o(a().mark((function e(t){var r,n,c;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.oldBlock,n=t.newBlock,0!==i.length){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,f.acquire();case 5:return c=e.sent,e.prev=6,e.next=9,Promise.all(y(i).map(function(){var e=o(a().mark((function e(t){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.update({oldBlock:r,newBlock:n});case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error(e.t0);case 8:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(t){return e.apply(this,arguments)}}()));case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),console.error(e.t0);case 14:c();case 15:case"end":return e.stop()}}),e,null,[[6,11]])})));return function(t){return e.apply(this,arguments)}}();return v.newLogFilter=w,v.newBlockFilter=M,v.newPendingTransactionFilter=S,v.uninstallFilter=j,v.getFilterChanges=E,v.getFilterLogs=T,v.destroy=function(){!function(){N.apply(this,arguments)}()},v;function w(e){return _.apply(this,arguments)}function _(){return(_=o(a().mark((function e(t){var n;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new s({provider:r,params:t}),e.next=3,R(n);case 3:return e.sent,e.abrupt("return",n);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function M(){return k.apply(this,arguments)}function k(){return(k=o(a().mark((function e(){var t;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new u({provider:r}),e.next=3,R(t);case 3:return e.sent,e.abrupt("return",t);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function S(){return A.apply(this,arguments)}function A(){return(A=o(a().mark((function e(){var t;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new b({provider:r}),e.next=3,R(t);case 3:return e.sent,e.abrupt("return",t);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function E(e){return O.apply(this,arguments)}function O(){return(O=o(a().mark((function e(t){var r,n,o;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=p(t),n=i[r]){e.next=4;break}throw new Error('No filter for index "'.concat(r,'"'));case 4:return o=n.getChangesAndClear(),e.abrupt("return",o);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function T(e){return P.apply(this,arguments)}function P(){return(P=o(a().mark((function e(t){var r,n;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=p(t),n=i[r]){e.next=4;break}throw new Error('No filter for index "'.concat(r,'"'));case 4:return"log"===n.type?results=n.getAllResults():results=[],e.abrupt("return",results);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function j(e){return B.apply(this,arguments)}function B(){return(B=o(a().mark((function e(t){var r,n,o;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=p(t),n=i[r],!(o=Boolean(n))){e.next=6;break}return e.next=6,I(r);case 6:return e.abrupt("return",o);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function R(e){return C.apply(this,arguments)}function C(){return(C=o(a().mark((function e(r){var o,c,f;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=y(i).length,e.next=3,t.getLatestBlock();case 3:return c=e.sent,e.next=6,r.initialize({currentBlock:c});case 6:return n++,i[n]=r,r.id=n,r.idHex=l(n),f=y(i).length,U({prevFilterCount:o,newFilterCount:f}),e.abrupt("return",n);case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function I(e){return L.apply(this,arguments)}function L(){return(L=o(a().mark((function e(t){var r,n;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=y(i).length,delete i[t],n=y(i).length,U({prevFilterCount:r,newFilterCount:n});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function N(){return(N=o(a().mark((function e(){var t;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=y(i).length,i={},U({prevFilterCount:t,newFilterCount:0});case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function U(e){var r=e.prevFilterCount,n=e.newFilterCount;0===r&&n>0?t.on("sync",g):r>0&&0===n&&t.removeListener("sync",g)}}},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),a(r(813),t),a(r(814),t),a(r(815),t),a(r(352),t),a(r(353),t),a(r(819),t)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUniqueId=void 0;var n=Math.floor(4294967295*Math.random());t.getUniqueId=function(){return n=(n+1)%4294967295}},function(e,t,r){"use strict";function n(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=c(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,f=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){f=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(f)throw i}}}}function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",c=n.asyncIterator||"@@asyncIterator",f=n.toStringTag||"@@toStringTag";function d(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,r){return e[t]=r}}function s(e,t,r,n){var a=t&&t.prototype instanceof h?t:h,i=Object.create(a.prototype),o=new S(n||[]);return i._invoke=function(e,t,r){var n="suspendedStart";return function(a,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw i;return E()}for(r.method=a,r.arg=i;;){var o=r.delegate;if(o){var c=_(o,r);if(c){if(c===b)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var f=u(e,t,r);if("normal"===f.type){if(n=r.done?"completed":"suspendedYield",f.arg===b)continue;return{value:f.arg,done:r.done}}"throw"===f.type&&(n="completed",r.method="throw",r.arg=f.arg)}}}(e,r,o),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var b={};function h(){}function l(){}function p(){}var m={};d(m,o,(function(){return this}));var x=Object.getPrototypeOf,y=x&&x(x(A([])));y&&y!==t&&r.call(y,o)&&(m=y);var v=p.prototype=h.prototype=Object.create(m);function g(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){var n;this._invoke=function(i,o){function c(){return new t((function(n,c){!function n(i,o,c,f){var d=u(e[i],e,o);if("throw"!==d.type){var s=d.arg,b=s.value;return b&&"object"==a(b)&&r.call(b,"__await")?t.resolve(b.__await).then((function(e){n("next",e,c,f)}),(function(e){n("throw",e,c,f)})):t.resolve(b).then((function(e){s.value=e,c(s)}),(function(e){return n("throw",e,c,f)}))}f(d.arg)}(i,o,n,c)}))}return n=n?n.then(c,c):c()}}function _(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,_(e,t),"throw"===t.method))return b;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return b}var n=u(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,b;var a=n.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,b):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,b)}function M(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(M,this),this.reset(!0)}function A(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n=0;--a){var i=this.tryEntries[a],o=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),f=r.call(i,"finallyLoc");if(c&&f){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),k(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;k(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:A(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),b}},e}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,a,i=[],o=!0,c=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);o=!0);}catch(e){c=!0,a=e}finally{try{o||null==r.return||r.return()}finally{if(c)throw a}}return i}(e,t)||c(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){if(e){if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(e,t):void 0}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:c;if(Number.isInteger(e)){var n=e.toString();if(h(a.errorValues,n))return a.errorValues[n].message;if(u(e))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return r}function s(e){if(!Number.isInteger(e))return!1;var t=e.toString();return!!a.errorValues[t]||!!u(e)}function u(e){return e>=-32099&&e<=-32e3}function b(e){return e&&"object"===n(e)&&!Array.isArray(e)?Object.assign({},e):e}function h(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=d,t.isValidCode=s,t.serializeError=function(e){var t,r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=a.fallbackError,c=void 0===o?f:o,u=a.shouldIncludeStack,l=void 0!==u&&u;if(!c||!Number.isInteger(c.code)||"string"!=typeof c.message)throw new Error("Must provide fallback error with integer number code and string message.");if(e instanceof i.EthereumRpcError)return e.serialize();var p={};if(e&&"object"===n(e)&&!Array.isArray(e)&&h(e,"code")&&s(e.code)){var m=e;p.code=m.code,m.message&&"string"==typeof m.message?(p.message=m.message,h(m,"data")&&(p.data=m.data)):(p.message=d(p.code),p.data={originalError:b(e)})}else{p.code=c.code;var x=null===(t=e)||void 0===t?void 0:t.message;p.message=x&&"string"==typeof x?x:c.message,p.data={originalError:b(e)}}var y=null===(r=e)||void 0===r?void 0:r.stack;return l&&e&&y&&"string"==typeof y&&(p.stack=y),p}},function(e,t,r){e.exports=r(820)},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{f(n.next(e))}catch(e){i(e)}}function c(e){try{f(n.throw(e))}catch(e){i(e)}}function f(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}f((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=o.trys,(a=a.length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]=a)n="0."+n;else{var i=a-t;n=n.slice(0,i)+"."+n.slice(i)}return n=n.slice(0,n.lastIndexOf(".")+r+1)},t.toHexChainId=function(e){return"0x"+e.toString(16)},t.getTypeByAddress=function(e,r){var n=i.DEFAULT_NFT_TYPES[e],a=t.UNKNOW,o="erc721";if(n)for(var c in n)n[c]&&n[c].address===r&&(a=c,o=n[c].type);return{categor:a,type:o}},t.getJCErc721Info=function(e){return n(this,void 0,void 0,(function(){var t;return a(this,(function(r){return t=""+i.BASE_TOKEN_URI+e,[2,fetch(t).then((function(e){return e.json()}))]}))}))}},function(e,t,r){"use strict";r.r(t),r.d(t,"ConstructorFragment",(function(){return P})),r.d(t,"ErrorFragment",(function(){return R})),r.d(t,"EventFragment",(function(){return A})),r.d(t,"Fragment",(function(){return S})),r.d(t,"FunctionFragment",(function(){return j})),r.d(t,"ParamType",(function(){return M})),r.d(t,"FormatTypes",(function(){return w})),r.d(t,"AbiCoder",(function(){return Ct})),r.d(t,"defaultAbiCoder",(function(){return It})),r.d(t,"Interface",(function(){return er})),r.d(t,"Indexed",(function(){return Yt})),r.d(t,"checkResultErrors",(function(){return D})),r.d(t,"LogDescription",(function(){return Zt})),r.d(t,"TransactionDescription",(function(){return Jt}));var n=r(47),a=r(10),i=r(3);function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}function f(e,t){return(f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=u(e);if(t){var a=u(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return s(this,r)}}function s(e,t){if(t&&("object"===o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function b(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var r=0;r=0||"tuple"===e)&&y[t])return!0;return(x[t]||"payable"===t)&&p.throwArgumentError("invalid modifier","name",t),!1}function g(e,t){for(var r in t)Object(a.c)(e,r,t[r])}var w=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),_=new RegExp(/^(.*)\[([0-9]*)\]$/),M=function(){function e(t,r){b(this,e),t!==m&&p.throwError("use fromString",i.a.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),g(this,r);var n=this.type.match(_);g(this,n?{arrayLength:parseInt(n[2]||"-1"),arrayChildren:e.fromObject({type:n[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}return l(e,[{key:"format",value:function(e){if(e||(e=w.sighash),w[e]||p.throwArgumentError("invalid format type","format",e),e===w.json){var t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((function(t){return JSON.parse(t.format(e))}))),JSON.stringify(t)}var r="";return"array"===this.baseType?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==w.sighash&&(r+=this.type),r+="("+this.components.map((function(t){return t.format(e)})).join(e===w.full?", ":",")+")"):r+=this.type,e!==w.sighash&&(!0===this.indexed&&(r+=" indexed"),e===w.full&&this.name&&(r+=" "+this.name)),r}}],[{key:"from",value:function(t,r){return"string"==typeof t?e.fromString(t,r):e.fromObject(t)}},{key:"fromObject",value:function(t){return e.isParamType(t)?t:new e(m,{name:t.name||null,type:C(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(e.fromObject):null})}},{key:"fromString",value:function(t,r){return function(t){return e.fromObject({name:t.name,type:t.type,indexed:t.indexed,components:t.components})}(function(e,t){var r=e;function n(t){p.throwArgumentError("unexpected character at position ".concat(t),"param",e)}function a(e){var r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");for(var i={type:"",name:"",state:{allowType:!0}},o=i,c=0;c2&&p.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||p.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=n.a.from(r[1]),r[0]):e}function O(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((function(e){switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function T(e){var t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&p.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&p.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||p.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&p.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&p.throwArgumentError("unable to determine stateMutability","value",e),t}var P=function(e){c(r,e);var t=d(r);function r(){return b(this,r),t.apply(this,arguments)}return l(r,[{key:"format",value:function(e){if(e||(e=w.sighash),w[e]||p.throwArgumentError("invalid format type","format",e),e===w.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((function(t){return JSON.parse(t.format(e))}))});e===w.sighash&&p.throwError("cannot format a constructor for sighash",i.a.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});var t="constructor("+this.inputs.map((function(t){return t.format(e)})).join(e===w.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}}],[{key:"from",value:function(e){return"string"==typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isConstructorFragment(e))return e;"constructor"!==e.type&&p.throwArgumentError("invalid constructor object","value",e);var t=T(e);t.constant&&p.throwArgumentError("constructor cannot be constant","value",e);var a={name:null,type:e.type,inputs:e.inputs?e.inputs.map(M.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?n.a.from(e.gas):null};return new r(m,a)}},{key:"fromString",value:function(e){var t={type:"constructor"},n=(e=E(e,t)).match(N);return n&&"constructor"===n[1].trim()||p.throwArgumentError("invalid constructor string","value",e),t.inputs=k(n[2].trim(),!1),O(n[3].trim(),t),r.fromObject(t)}},{key:"isConstructorFragment",value:function(e){return e&&e._isFragment&&"constructor"===e.type}}]),r}(S),j=function(e){c(r,e);var t=d(r);function r(){return b(this,r),t.apply(this,arguments)}return l(r,[{key:"format",value:function(e){if(e||(e=w.sighash),w[e]||p.throwArgumentError("invalid format type","format",e),e===w.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((function(t){return JSON.parse(t.format(e))})),outputs:this.outputs.map((function(t){return JSON.parse(t.format(e))}))});var t="";return e!==w.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===w.full?", ":",")+") ",e!==w.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((function(t){return t.format(e)})).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}}],[{key:"from",value:function(e){return"string"==typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isFunctionFragment(e))return e;"function"!==e.type&&p.throwArgumentError("invalid function object","value",e);var t=T(e),a={type:e.type,name:L(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(M.fromObject):[],outputs:e.outputs?e.outputs.map(M.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?n.a.from(e.gas):null};return new r(m,a)}},{key:"fromString",value:function(e){var t={type:"function"},n=(e=E(e,t)).split(" returns ");n.length>2&&p.throwArgumentError("invalid function string","value",e);var a=n[0].match(N);if(a||p.throwArgumentError("invalid function signature","value",e),t.name=a[1].trim(),t.name&&L(t.name),t.inputs=k(a[2],!1),O(a[3].trim(),t),n.length>1){var i=n[1].match(N);""==i[1].trim()&&""==i[3].trim()||p.throwArgumentError("unexpected tokens","value",e),t.outputs=k(i[2],!1)}else t.outputs=[];return r.fromObject(t)}},{key:"isFunctionFragment",value:function(e){return e&&e._isFragment&&"function"===e.type}}]),r}(P);function B(e){var t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||p.throwArgumentError("cannot specify user defined ".concat(t," error"),"fragment",e),e}var R=function(e){c(r,e);var t=d(r);function r(){return b(this,r),t.apply(this,arguments)}return l(r,[{key:"format",value:function(e){if(e||(e=w.sighash),w[e]||p.throwArgumentError("invalid format type","format",e),e===w.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))});var t="";return e!==w.sighash&&(t+="error "),(t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===w.full?", ":",")+") ").trim()}}],[{key:"from",value:function(e){return"string"==typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isErrorFragment(e))return e;"error"!==e.type&&p.throwArgumentError("invalid error object","value",e);var t={type:e.type,name:L(e.name),inputs:e.inputs?e.inputs.map(M.fromObject):[]};return B(new r(m,t))}},{key:"fromString",value:function(e){var t={type:"error"},n=e.match(N);return n||p.throwArgumentError("invalid error signature","value",e),t.name=n[1].trim(),t.name&&L(t.name),t.inputs=k(n[2],!1),B(r.fromObject(t))}},{key:"isErrorFragment",value:function(e){return e&&e._isFragment&&"error"===e.type}}]),r}(S);function C(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}var I=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function L(e){return e&&e.match(I)||p.throwArgumentError('invalid identifier "'.concat(e,'"'),"value",e),e}var N=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");var U=r(1);function z(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F(e,t){for(var r=0;rthis.wordSize&&H.throwError("value out-of-bounds",i.a.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=Object(U.b)([this._padding.slice(t.length%this.wordSize),t])),t}},{key:"writeValue",value:function(e){return this._writeData(this._getValue(e))}},{key:"writeUpdatableValue",value:function(){var e=this,t=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,function(r){e._data[t]=e._getValue(r)}}}]),e}(),W=function(){function e(t,r,n,i){z(this,e),Object(a.c)(this,"_data",Object(U.a)(t)),Object(a.c)(this,"wordSize",r||32),Object(a.c)(this,"_coerceFunc",n),Object(a.c)(this,"allowLoose",i),this._offset=0}return q(e,[{key:"data",get:function(){return Object(U.g)(this._data)}},{key:"consumed",get:function(){return this._offset}},{key:"coerce",value:function(t,r){return this._coerceFunc?this._coerceFunc(t,r):e.coerce(t,r)}},{key:"_peekBytes",value:function(e,t,r){var n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:H.throwError("data out-of-bounds",i.a.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}},{key:"subReader",value:function(t){return new e(this._data.slice(this._offset+t),this.wordSize,this._coerceFunc,this.allowLoose)}},{key:"readBytes",value:function(e,t){var r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}},{key:"readValue",value:function(){return n.a.from(this.readBytes(this.wordSize))}}],[{key:"coerce",value:function(e,t){var r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}}]),e}(),V=r(33);function Z(e){return(Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function J(e,t){for(var r=0;r=0?t:"")+"]",c=-1===t||e.dynamic;return(n=a.call(this,"array",i,r,c)).coder=e,n.length=t,n}return t=o,(r=[{key:"defaultValue",value:function(){for(var e=this.coder.defaultValue(),t=[],r=0;re._data.length&&le.throwError("insufficient data length",i.a.errors.BUFFER_OVERRUN,{length:e._data.length,count:t});for(var r=[],n=0;n>6==2;o++)i++;return i}return e===ot.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(it||(it={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(ot||(ot={}));var st=Object.freeze({error:function(e,t,r,n,a){return ft.throwArgumentError("invalid codepoint at offset ".concat(t,"; ").concat(e),"bytes",r)},ignore:dt,replace:function(e,t,r,n,a){return e===ot.OVERLONG?(n.push(a),0):(n.push(65533),dt(e,t,r))}});function ut(e,t){null==t&&(t=st.error),e=Object(U.a)(e);for(var r=[],n=0;n>7!=0){var i=null,o=null;if(192==(224&a))i=1,o=127;else if(224==(240&a))i=2,o=2047;else{if(240!=(248&a)){n+=t(128==(192&a)?ot.UNEXPECTED_CONTINUE:ot.BAD_PREFIX,n-1,e,r);continue}i=3,o=65535}if(n-1+i>=e.length)n+=t(ot.OVERRUN,n-1,e,r);else{for(var c=a&(1<<8-i-1)-1,f=0;f1114111?n+=t(ot.OUT_OF_RANGE,n-1-i,e,r,c):c>=55296&&c<=57343?n+=t(ot.UTF16_SURROGATE,n-1-i,e,r,c):c<=o?n+=t(ot.OVERLONG,n-1-i,e,r,c):r.push(c))}}else r.push(a)}return r}function bt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:it.current;t!=it.current&&(ft.checkNormalize(),e=e.normalize(t));for(var r=[],n=0;n>6|192),r.push(63&a|128);else if(55296==(64512&a)){n++;var i=e.charCodeAt(n);if(n>=e.length||56320!=(64512&i))throw new Error("invalid utf-8 string");var o=65536+((1023&a)<<10)+(1023&i);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(63&o|128)}else r.push(a>>12|224),r.push(a>>6&63|128),r.push(63&a|128)}return Object(U.a)(r)}function ht(e,t){return ut(e,t).map((function(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e)))})).join("")}function lt(e){return(lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pt(e,t){for(var r=0;r256||n%8!=0)&&jt.throwArgumentError("invalid "+r[1]+" bit length","param",e),new ct(n/8,"int"===r[1],e.name)}if(r=e.type.match(Bt)){var a=parseInt(r[1]);return(0===a||a>32)&&jt.throwArgumentError("invalid bytes length","param",e),new Ke(a,e.name)}return jt.throwArgumentError("invalid type","type",e.type)}},{key:"_getWordSize",value:function(){return 32}},{key:"_getReader",value:function(e,t){return new W(e,this._getWordSize(),this.coerceFunc,t)}},{key:"_getWriter",value:function(){return new G(this._getWordSize())}},{key:"getDefaultValue",value:function(e){var t=this,r=e.map((function(e){return t._getCoder(M.from(e))}));return new Tt(r,"_").defaultValue()}},{key:"encode",value:function(e,t){var r=this;e.length!==t.length&&jt.throwError("types/values length mismatch",i.a.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});var n=e.map((function(e){return r._getCoder(M.from(e))})),a=new Tt(n,"_"),o=this._getWriter();return a.encode(o,t),o.data}},{key:"decode",value:function(e,t,r){var n=this,a=e.map((function(e){return n._getCoder(M.from(e))}));return new Tt(a,"_").decode(this._getReader(Object(U.a)(t),r))}}])&&Pt(t.prototype,r),n&&Pt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),It=new Ct,Lt=r(20);function Nt(e){return Object(Lt.a)(bt(e))}function Ut(e){return(Ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function zt(e,t){for(var r=0;r1&&Vt.throwArgumentError("multiple matching functions","name",r),this.functions[n[0]]}var a=this.functions[j.fromString(e).format()];return a||Vt.throwArgumentError("no matching function","signature",e),a}},{key:"getEvent",value:function(e){if(Object(U.j)(e)){var t=e.toLowerCase();for(var r in this.events)if(t===this.getEventTopic(r))return this.events[r];Vt.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){var n=e.trim(),a=Object.keys(this.events).filter((function(e){return e.split("(")[0]===n}));return 0===a.length?Vt.throwArgumentError("no matching event","name",n):a.length>1&&Vt.throwArgumentError("multiple matching events","name",n),this.events[a[0]]}var i=this.events[A.fromString(e).format()];return i||Vt.throwArgumentError("no matching event","signature",e),i}},{key:"getError",value:function(e){if(Object(U.j)(e)){var t=Object(a.d)(this.constructor,"getSighash");for(var r in this.errors){if(e===t(this.errors[r]))return this.errors[r]}Vt.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){var n=e.trim(),i=Object.keys(this.errors).filter((function(e){return e.split("(")[0]===n}));return 0===i.length?Vt.throwArgumentError("no matching error","name",n):i.length>1&&Vt.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}var o=this.errors[j.fromString(e).format()];return o||Vt.throwArgumentError("no matching error","signature",e),o}},{key:"getSighash",value:function(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return Object(a.d)(this.constructor,"getSighash")(e)}},{key:"getEventTopic",value:function(e){return"string"==typeof e&&(e=this.getEvent(e)),Object(a.d)(this.constructor,"getEventTopic")(e)}},{key:"_decodeParams",value:function(e,t){return this._abiCoder.decode(e,t)}},{key:"_encodeParams",value:function(e,t){return this._abiCoder.encode(e,t)}},{key:"encodeDeploy",value:function(e){return this._encodeParams(this.deploy.inputs,e||[])}},{key:"decodeErrorResult",value:function(e,t){"string"==typeof e&&(e=this.getError(e));var r=Object(U.a)(t);return Object(U.g)(r.slice(0,4))!==this.getSighash(e)&&Vt.throwArgumentError("data signature does not match error ".concat(e.name,"."),"data",Object(U.g)(r)),this._decodeParams(e.inputs,r.slice(4))}},{key:"encodeErrorResult",value:function(e,t){return"string"==typeof e&&(e=this.getError(e)),Object(U.g)(Object(U.b)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionData",value:function(e,t){"string"==typeof e&&(e=this.getFunction(e));var r=Object(U.a)(t);return Object(U.g)(r.slice(0,4))!==this.getSighash(e)&&Vt.throwArgumentError("data signature does not match function ".concat(e.name,"."),"data",Object(U.g)(r)),this._decodeParams(e.inputs,r.slice(4))}},{key:"encodeFunctionData",value:function(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Object(U.g)(Object(U.b)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionResult",value:function(e,t){"string"==typeof e&&(e=this.getFunction(e));var r=Object(U.a)(t),n=null,a="",o=null,c=null,f=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(u){}break;case 4:var d=Object(U.g)(r.slice(0,4)),s=$t[d];if(s)o=this._abiCoder.decode(s.inputs,r.slice(4)),c=s.name,f=s.signature,s.reason&&(n=o[0]),"Error"===c?a="; VM Exception while processing transaction: reverted with reason string ".concat(JSON.stringify(o[0])):"Panic"===c&&(a="; VM Exception while processing transaction: reverted with panic code ".concat(o[0]));else try{var u=this.getError(d);o=this._abiCoder.decode(u.inputs,r.slice(4)),c=u.name,f=u.format()}catch(u){}}return Vt.throwError("call revert exception"+a,i.a.errors.CALL_EXCEPTION,{method:e.format(),data:Object(U.g)(t),errorArgs:o,errorName:c,errorSignature:f,reason:n})}},{key:"encodeFunctionResult",value:function(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Object(U.g)(this._abiCoder.encode(e.outputs,t||[]))}},{key:"encodeFilterTopics",value:function(e,t){var r=this;"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&Vt.throwError("too many arguments for "+e.format(),i.a.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});var a=[];e.anonymous||a.push(this.getEventTopic(e));var o=function(e,t){return"string"===e.type?Nt(t):"bytes"===e.type?Object(Lt.a)(Object(U.g)(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=n.a.from(t).toHexString()),"address"===e.type&&r._abiCoder.encode(["address"],[t]),Object(U.f)(Object(U.g)(t),32))};for(t.forEach((function(t,r){var n=e.inputs[r];n.indexed?null==t?a.push(null):"array"===n.baseType||"tuple"===n.baseType?Vt.throwArgumentError("filtering with tuples or arrays not supported","contract."+n.name,t):Array.isArray(t)?a.push(t.map((function(e){return o(n,e)}))):a.push(o(n,t)):null!=t&&Vt.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+n.name,t)}));a.length&&null===a[a.length-1];)a.pop();return a}},{key:"encodeEventLog",value:function(e,t){var r=this;"string"==typeof e&&(e=this.getEvent(e));var n=[],a=[],i=[];return e.anonymous||n.push(this.getEventTopic(e)),t.length!==e.inputs.length&&Vt.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach((function(e,o){var c=t[o];if(e.indexed)if("string"===e.type)n.push(Nt(c));else if("bytes"===e.type)n.push(Object(Lt.a)(c));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");n.push(r._abiCoder.encode([e.type],[c]))}else a.push(e),i.push(c)})),{data:this._abiCoder.encode(a,i),topics:n}}},{key:"decodeEventLog",value:function(e,t,r){if("string"==typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){var n=this.getEventTopic(e);Object(U.j)(r[0],32)&&r[0].toLowerCase()===n||Vt.throwError("fragment/topic mismatch",i.a.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:n,value:r[0]}),r=r.slice(1)}var a=[],o=[],c=[];e.inputs.forEach((function(e,t){e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(a.push(M.fromObject({type:"bytes32",name:e.name})),c.push(!0)):(a.push(e),c.push(!1)):(o.push(e),c.push(!1))}));var f=null!=r?this._abiCoder.decode(a,Object(U.b)(r)):null,d=this._abiCoder.decode(o,t,!0),s=[],u=0,b=0;e.inputs.forEach((function(e,t){if(e.indexed)if(null==f)s[t]=new Yt({_isIndexed:!0,hash:null});else if(c[t])s[t]=new Yt({_isIndexed:!0,hash:f[b++]});else try{s[t]=f[b++]}catch(e){s[t]=e}else try{s[t]=d[u++]}catch(e){s[t]=e}if(e.name&&null==s[e.name]){var r=s[t];r instanceof Error?Object.defineProperty(s,e.name,{enumerable:!0,get:function(){throw Qt("property ".concat(JSON.stringify(e.name)),r)}}):s[e.name]=r}}));for(var h=function(e){var t=s[e];t instanceof Error&&Object.defineProperty(s,e,{enumerable:!0,get:function(){throw Qt("index ".concat(e),t)}})},l=0;l=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void a(!1,"Invalid character in "+e)}function d(e,t,r){var n=f(e,r);return r-1>=t&&(n|=f(e,r-1)<<4),n}function s(e,t,r,n){for(var i=0,o=0,c=Math.min(e.length,r),f=t;f=49?d-49+10:d>=17?d-17+10:d,a(d>=0&&o0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,r,n){if("number"==typeof e)return this._initNumber(e,r,n);if("object"===t(e))return this._initArray(e,r,n);"hex"===r&&(r=16),a(r===(0|r)&&r>=2&&r<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;n-=3)o=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[i]|=o<>>26-c&67108863,(c+=24)>=26&&(c-=26,i++);else if("le"===r)for(n=0,i=0;n>>26-c&67108863,(c+=24)>=26&&(c-=26,i++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)a=d(e,t,n)<=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,a=1;a<=67108863;a*=t)n++;n--,a=a/t|0;for(var i=e.length-r,o=i%n,c=Math.min(i,i-o)+r,f=0,d=r;d1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=b}catch(e){o.prototype.inspect=b}else o.prototype.inspect=b;function b(){return(this.red?""}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,i=0,o=0;o>>24-n&16777215,(n+=2)>=26&&(n-=26,o--),r=0!==i||o!==this.length-1?h[6-f.length]+f+r:f+r}for(0!==i&&(r=i.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=l[e],s=p[e];r="";var u=this.clone();for(u.negative=0;!u.isZero();){var b=u.modrn(s).toString(e);r=(u=u.idivn(s)).isZero()?b+r:h[d-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}a(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&a(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},c&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(c,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function m(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var a=0|e.words[0],i=0|t.words[0],o=a*i,c=67108863&o,f=o/67108864|0;r.words[0]=c;for(var d=1;d>>26,u=67108863&f,b=Math.min(d,t.length-1),h=Math.max(0,d-e.length+1);h<=b;h++){var l=d-h|0;s+=(o=(a=0|e.words[l])*(i=0|t.words[h])+u)/67108864|0,u=67108863&o}r.words[d]=0|u,f=0|s}return 0!==f?r.words[d]=0|f:r.length--,r._strip()}o.prototype.toArrayLike=function(e,t,r){this._strip();var n=this.byteLength(),i=r||Math.max(1,n);a(n<=i,"byte array longer than desired length"),a(i>0,"Requested array length <= 0");var o=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,n),o},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,a=0,i=0;a>8&255),r>16&255),6===i?(r>24&255),n=0,i=0):(n=o>>>24,i+=2)}if(r=0&&(e[r--]=o>>8&255),r>=0&&(e[r--]=o>>16&255),6===i?(r>=0&&(e[r--]=o>>24&255),n=0,i=0):(n=o>>>24,i+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){a("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){a("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var a=0,i=0;i>>26;for(;0!==a&&i>>26;if(this.length=r.length,0!==a)this.words[this.length]=a,this.length++;else if(r!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,a=this.cmp(e);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==i&&o>26,this.words[o]=67108863&t;if(0===i&&o>>13,h=0|o[1],l=8191&h,p=h>>>13,m=0|o[2],x=8191&m,y=m>>>13,v=0|o[3],g=8191&v,w=v>>>13,_=0|o[4],M=8191&_,k=_>>>13,S=0|o[5],A=8191&S,E=S>>>13,O=0|o[6],T=8191&O,P=O>>>13,j=0|o[7],B=8191&j,R=j>>>13,C=0|o[8],I=8191&C,L=C>>>13,N=0|o[9],U=8191&N,z=N>>>13,F=0|c[0],q=8191&F,H=F>>>13,D=0|c[1],K=8191&D,G=D>>>13,W=0|c[2],V=8191&W,Z=W>>>13,J=0|c[3],X=8191&J,Y=J>>>13,$=0|c[4],Q=8191&$,ee=$>>>13,te=0|c[5],re=8191&te,ne=te>>>13,ae=0|c[6],ie=8191&ae,oe=ae>>>13,ce=0|c[7],fe=8191&ce,de=ce>>>13,se=0|c[8],ue=8191&se,be=se>>>13,he=0|c[9],le=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(d+(n=Math.imul(u,q))|0)+((8191&(a=(a=Math.imul(u,H))+Math.imul(b,q)|0))<<13)|0;d=((i=Math.imul(b,H))+(a>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(l,q),a=(a=Math.imul(l,H))+Math.imul(p,q)|0,i=Math.imul(p,H);var xe=(d+(n=n+Math.imul(u,K)|0)|0)+((8191&(a=(a=a+Math.imul(u,G)|0)+Math.imul(b,K)|0))<<13)|0;d=((i=i+Math.imul(b,G)|0)+(a>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(x,q),a=(a=Math.imul(x,H))+Math.imul(y,q)|0,i=Math.imul(y,H),n=n+Math.imul(l,K)|0,a=(a=a+Math.imul(l,G)|0)+Math.imul(p,K)|0,i=i+Math.imul(p,G)|0;var ye=(d+(n=n+Math.imul(u,V)|0)|0)+((8191&(a=(a=a+Math.imul(u,Z)|0)+Math.imul(b,V)|0))<<13)|0;d=((i=i+Math.imul(b,Z)|0)+(a>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(g,q),a=(a=Math.imul(g,H))+Math.imul(w,q)|0,i=Math.imul(w,H),n=n+Math.imul(x,K)|0,a=(a=a+Math.imul(x,G)|0)+Math.imul(y,K)|0,i=i+Math.imul(y,G)|0,n=n+Math.imul(l,V)|0,a=(a=a+Math.imul(l,Z)|0)+Math.imul(p,V)|0,i=i+Math.imul(p,Z)|0;var ve=(d+(n=n+Math.imul(u,X)|0)|0)+((8191&(a=(a=a+Math.imul(u,Y)|0)+Math.imul(b,X)|0))<<13)|0;d=((i=i+Math.imul(b,Y)|0)+(a>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(M,q),a=(a=Math.imul(M,H))+Math.imul(k,q)|0,i=Math.imul(k,H),n=n+Math.imul(g,K)|0,a=(a=a+Math.imul(g,G)|0)+Math.imul(w,K)|0,i=i+Math.imul(w,G)|0,n=n+Math.imul(x,V)|0,a=(a=a+Math.imul(x,Z)|0)+Math.imul(y,V)|0,i=i+Math.imul(y,Z)|0,n=n+Math.imul(l,X)|0,a=(a=a+Math.imul(l,Y)|0)+Math.imul(p,X)|0,i=i+Math.imul(p,Y)|0;var ge=(d+(n=n+Math.imul(u,Q)|0)|0)+((8191&(a=(a=a+Math.imul(u,ee)|0)+Math.imul(b,Q)|0))<<13)|0;d=((i=i+Math.imul(b,ee)|0)+(a>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(A,q),a=(a=Math.imul(A,H))+Math.imul(E,q)|0,i=Math.imul(E,H),n=n+Math.imul(M,K)|0,a=(a=a+Math.imul(M,G)|0)+Math.imul(k,K)|0,i=i+Math.imul(k,G)|0,n=n+Math.imul(g,V)|0,a=(a=a+Math.imul(g,Z)|0)+Math.imul(w,V)|0,i=i+Math.imul(w,Z)|0,n=n+Math.imul(x,X)|0,a=(a=a+Math.imul(x,Y)|0)+Math.imul(y,X)|0,i=i+Math.imul(y,Y)|0,n=n+Math.imul(l,Q)|0,a=(a=a+Math.imul(l,ee)|0)+Math.imul(p,Q)|0,i=i+Math.imul(p,ee)|0;var we=(d+(n=n+Math.imul(u,re)|0)|0)+((8191&(a=(a=a+Math.imul(u,ne)|0)+Math.imul(b,re)|0))<<13)|0;d=((i=i+Math.imul(b,ne)|0)+(a>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(T,q),a=(a=Math.imul(T,H))+Math.imul(P,q)|0,i=Math.imul(P,H),n=n+Math.imul(A,K)|0,a=(a=a+Math.imul(A,G)|0)+Math.imul(E,K)|0,i=i+Math.imul(E,G)|0,n=n+Math.imul(M,V)|0,a=(a=a+Math.imul(M,Z)|0)+Math.imul(k,V)|0,i=i+Math.imul(k,Z)|0,n=n+Math.imul(g,X)|0,a=(a=a+Math.imul(g,Y)|0)+Math.imul(w,X)|0,i=i+Math.imul(w,Y)|0,n=n+Math.imul(x,Q)|0,a=(a=a+Math.imul(x,ee)|0)+Math.imul(y,Q)|0,i=i+Math.imul(y,ee)|0,n=n+Math.imul(l,re)|0,a=(a=a+Math.imul(l,ne)|0)+Math.imul(p,re)|0,i=i+Math.imul(p,ne)|0;var _e=(d+(n=n+Math.imul(u,ie)|0)|0)+((8191&(a=(a=a+Math.imul(u,oe)|0)+Math.imul(b,ie)|0))<<13)|0;d=((i=i+Math.imul(b,oe)|0)+(a>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(B,q),a=(a=Math.imul(B,H))+Math.imul(R,q)|0,i=Math.imul(R,H),n=n+Math.imul(T,K)|0,a=(a=a+Math.imul(T,G)|0)+Math.imul(P,K)|0,i=i+Math.imul(P,G)|0,n=n+Math.imul(A,V)|0,a=(a=a+Math.imul(A,Z)|0)+Math.imul(E,V)|0,i=i+Math.imul(E,Z)|0,n=n+Math.imul(M,X)|0,a=(a=a+Math.imul(M,Y)|0)+Math.imul(k,X)|0,i=i+Math.imul(k,Y)|0,n=n+Math.imul(g,Q)|0,a=(a=a+Math.imul(g,ee)|0)+Math.imul(w,Q)|0,i=i+Math.imul(w,ee)|0,n=n+Math.imul(x,re)|0,a=(a=a+Math.imul(x,ne)|0)+Math.imul(y,re)|0,i=i+Math.imul(y,ne)|0,n=n+Math.imul(l,ie)|0,a=(a=a+Math.imul(l,oe)|0)+Math.imul(p,ie)|0,i=i+Math.imul(p,oe)|0;var Me=(d+(n=n+Math.imul(u,fe)|0)|0)+((8191&(a=(a=a+Math.imul(u,de)|0)+Math.imul(b,fe)|0))<<13)|0;d=((i=i+Math.imul(b,de)|0)+(a>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(I,q),a=(a=Math.imul(I,H))+Math.imul(L,q)|0,i=Math.imul(L,H),n=n+Math.imul(B,K)|0,a=(a=a+Math.imul(B,G)|0)+Math.imul(R,K)|0,i=i+Math.imul(R,G)|0,n=n+Math.imul(T,V)|0,a=(a=a+Math.imul(T,Z)|0)+Math.imul(P,V)|0,i=i+Math.imul(P,Z)|0,n=n+Math.imul(A,X)|0,a=(a=a+Math.imul(A,Y)|0)+Math.imul(E,X)|0,i=i+Math.imul(E,Y)|0,n=n+Math.imul(M,Q)|0,a=(a=a+Math.imul(M,ee)|0)+Math.imul(k,Q)|0,i=i+Math.imul(k,ee)|0,n=n+Math.imul(g,re)|0,a=(a=a+Math.imul(g,ne)|0)+Math.imul(w,re)|0,i=i+Math.imul(w,ne)|0,n=n+Math.imul(x,ie)|0,a=(a=a+Math.imul(x,oe)|0)+Math.imul(y,ie)|0,i=i+Math.imul(y,oe)|0,n=n+Math.imul(l,fe)|0,a=(a=a+Math.imul(l,de)|0)+Math.imul(p,fe)|0,i=i+Math.imul(p,de)|0;var ke=(d+(n=n+Math.imul(u,ue)|0)|0)+((8191&(a=(a=a+Math.imul(u,be)|0)+Math.imul(b,ue)|0))<<13)|0;d=((i=i+Math.imul(b,be)|0)+(a>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(U,q),a=(a=Math.imul(U,H))+Math.imul(z,q)|0,i=Math.imul(z,H),n=n+Math.imul(I,K)|0,a=(a=a+Math.imul(I,G)|0)+Math.imul(L,K)|0,i=i+Math.imul(L,G)|0,n=n+Math.imul(B,V)|0,a=(a=a+Math.imul(B,Z)|0)+Math.imul(R,V)|0,i=i+Math.imul(R,Z)|0,n=n+Math.imul(T,X)|0,a=(a=a+Math.imul(T,Y)|0)+Math.imul(P,X)|0,i=i+Math.imul(P,Y)|0,n=n+Math.imul(A,Q)|0,a=(a=a+Math.imul(A,ee)|0)+Math.imul(E,Q)|0,i=i+Math.imul(E,ee)|0,n=n+Math.imul(M,re)|0,a=(a=a+Math.imul(M,ne)|0)+Math.imul(k,re)|0,i=i+Math.imul(k,ne)|0,n=n+Math.imul(g,ie)|0,a=(a=a+Math.imul(g,oe)|0)+Math.imul(w,ie)|0,i=i+Math.imul(w,oe)|0,n=n+Math.imul(x,fe)|0,a=(a=a+Math.imul(x,de)|0)+Math.imul(y,fe)|0,i=i+Math.imul(y,de)|0,n=n+Math.imul(l,ue)|0,a=(a=a+Math.imul(l,be)|0)+Math.imul(p,ue)|0,i=i+Math.imul(p,be)|0;var Se=(d+(n=n+Math.imul(u,le)|0)|0)+((8191&(a=(a=a+Math.imul(u,pe)|0)+Math.imul(b,le)|0))<<13)|0;d=((i=i+Math.imul(b,pe)|0)+(a>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(U,K),a=(a=Math.imul(U,G))+Math.imul(z,K)|0,i=Math.imul(z,G),n=n+Math.imul(I,V)|0,a=(a=a+Math.imul(I,Z)|0)+Math.imul(L,V)|0,i=i+Math.imul(L,Z)|0,n=n+Math.imul(B,X)|0,a=(a=a+Math.imul(B,Y)|0)+Math.imul(R,X)|0,i=i+Math.imul(R,Y)|0,n=n+Math.imul(T,Q)|0,a=(a=a+Math.imul(T,ee)|0)+Math.imul(P,Q)|0,i=i+Math.imul(P,ee)|0,n=n+Math.imul(A,re)|0,a=(a=a+Math.imul(A,ne)|0)+Math.imul(E,re)|0,i=i+Math.imul(E,ne)|0,n=n+Math.imul(M,ie)|0,a=(a=a+Math.imul(M,oe)|0)+Math.imul(k,ie)|0,i=i+Math.imul(k,oe)|0,n=n+Math.imul(g,fe)|0,a=(a=a+Math.imul(g,de)|0)+Math.imul(w,fe)|0,i=i+Math.imul(w,de)|0,n=n+Math.imul(x,ue)|0,a=(a=a+Math.imul(x,be)|0)+Math.imul(y,ue)|0,i=i+Math.imul(y,be)|0;var Ae=(d+(n=n+Math.imul(l,le)|0)|0)+((8191&(a=(a=a+Math.imul(l,pe)|0)+Math.imul(p,le)|0))<<13)|0;d=((i=i+Math.imul(p,pe)|0)+(a>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(U,V),a=(a=Math.imul(U,Z))+Math.imul(z,V)|0,i=Math.imul(z,Z),n=n+Math.imul(I,X)|0,a=(a=a+Math.imul(I,Y)|0)+Math.imul(L,X)|0,i=i+Math.imul(L,Y)|0,n=n+Math.imul(B,Q)|0,a=(a=a+Math.imul(B,ee)|0)+Math.imul(R,Q)|0,i=i+Math.imul(R,ee)|0,n=n+Math.imul(T,re)|0,a=(a=a+Math.imul(T,ne)|0)+Math.imul(P,re)|0,i=i+Math.imul(P,ne)|0,n=n+Math.imul(A,ie)|0,a=(a=a+Math.imul(A,oe)|0)+Math.imul(E,ie)|0,i=i+Math.imul(E,oe)|0,n=n+Math.imul(M,fe)|0,a=(a=a+Math.imul(M,de)|0)+Math.imul(k,fe)|0,i=i+Math.imul(k,de)|0,n=n+Math.imul(g,ue)|0,a=(a=a+Math.imul(g,be)|0)+Math.imul(w,ue)|0,i=i+Math.imul(w,be)|0;var Ee=(d+(n=n+Math.imul(x,le)|0)|0)+((8191&(a=(a=a+Math.imul(x,pe)|0)+Math.imul(y,le)|0))<<13)|0;d=((i=i+Math.imul(y,pe)|0)+(a>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(U,X),a=(a=Math.imul(U,Y))+Math.imul(z,X)|0,i=Math.imul(z,Y),n=n+Math.imul(I,Q)|0,a=(a=a+Math.imul(I,ee)|0)+Math.imul(L,Q)|0,i=i+Math.imul(L,ee)|0,n=n+Math.imul(B,re)|0,a=(a=a+Math.imul(B,ne)|0)+Math.imul(R,re)|0,i=i+Math.imul(R,ne)|0,n=n+Math.imul(T,ie)|0,a=(a=a+Math.imul(T,oe)|0)+Math.imul(P,ie)|0,i=i+Math.imul(P,oe)|0,n=n+Math.imul(A,fe)|0,a=(a=a+Math.imul(A,de)|0)+Math.imul(E,fe)|0,i=i+Math.imul(E,de)|0,n=n+Math.imul(M,ue)|0,a=(a=a+Math.imul(M,be)|0)+Math.imul(k,ue)|0,i=i+Math.imul(k,be)|0;var Oe=(d+(n=n+Math.imul(g,le)|0)|0)+((8191&(a=(a=a+Math.imul(g,pe)|0)+Math.imul(w,le)|0))<<13)|0;d=((i=i+Math.imul(w,pe)|0)+(a>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(U,Q),a=(a=Math.imul(U,ee))+Math.imul(z,Q)|0,i=Math.imul(z,ee),n=n+Math.imul(I,re)|0,a=(a=a+Math.imul(I,ne)|0)+Math.imul(L,re)|0,i=i+Math.imul(L,ne)|0,n=n+Math.imul(B,ie)|0,a=(a=a+Math.imul(B,oe)|0)+Math.imul(R,ie)|0,i=i+Math.imul(R,oe)|0,n=n+Math.imul(T,fe)|0,a=(a=a+Math.imul(T,de)|0)+Math.imul(P,fe)|0,i=i+Math.imul(P,de)|0,n=n+Math.imul(A,ue)|0,a=(a=a+Math.imul(A,be)|0)+Math.imul(E,ue)|0,i=i+Math.imul(E,be)|0;var Te=(d+(n=n+Math.imul(M,le)|0)|0)+((8191&(a=(a=a+Math.imul(M,pe)|0)+Math.imul(k,le)|0))<<13)|0;d=((i=i+Math.imul(k,pe)|0)+(a>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(U,re),a=(a=Math.imul(U,ne))+Math.imul(z,re)|0,i=Math.imul(z,ne),n=n+Math.imul(I,ie)|0,a=(a=a+Math.imul(I,oe)|0)+Math.imul(L,ie)|0,i=i+Math.imul(L,oe)|0,n=n+Math.imul(B,fe)|0,a=(a=a+Math.imul(B,de)|0)+Math.imul(R,fe)|0,i=i+Math.imul(R,de)|0,n=n+Math.imul(T,ue)|0,a=(a=a+Math.imul(T,be)|0)+Math.imul(P,ue)|0,i=i+Math.imul(P,be)|0;var Pe=(d+(n=n+Math.imul(A,le)|0)|0)+((8191&(a=(a=a+Math.imul(A,pe)|0)+Math.imul(E,le)|0))<<13)|0;d=((i=i+Math.imul(E,pe)|0)+(a>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(U,ie),a=(a=Math.imul(U,oe))+Math.imul(z,ie)|0,i=Math.imul(z,oe),n=n+Math.imul(I,fe)|0,a=(a=a+Math.imul(I,de)|0)+Math.imul(L,fe)|0,i=i+Math.imul(L,de)|0,n=n+Math.imul(B,ue)|0,a=(a=a+Math.imul(B,be)|0)+Math.imul(R,ue)|0,i=i+Math.imul(R,be)|0;var je=(d+(n=n+Math.imul(T,le)|0)|0)+((8191&(a=(a=a+Math.imul(T,pe)|0)+Math.imul(P,le)|0))<<13)|0;d=((i=i+Math.imul(P,pe)|0)+(a>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(U,fe),a=(a=Math.imul(U,de))+Math.imul(z,fe)|0,i=Math.imul(z,de),n=n+Math.imul(I,ue)|0,a=(a=a+Math.imul(I,be)|0)+Math.imul(L,ue)|0,i=i+Math.imul(L,be)|0;var Be=(d+(n=n+Math.imul(B,le)|0)|0)+((8191&(a=(a=a+Math.imul(B,pe)|0)+Math.imul(R,le)|0))<<13)|0;d=((i=i+Math.imul(R,pe)|0)+(a>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(U,ue),a=(a=Math.imul(U,be))+Math.imul(z,ue)|0,i=Math.imul(z,be);var Re=(d+(n=n+Math.imul(I,le)|0)|0)+((8191&(a=(a=a+Math.imul(I,pe)|0)+Math.imul(L,le)|0))<<13)|0;d=((i=i+Math.imul(L,pe)|0)+(a>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Ce=(d+(n=Math.imul(U,le))|0)+((8191&(a=(a=Math.imul(U,pe))+Math.imul(z,le)|0))<<13)|0;return d=((i=Math.imul(z,pe))+(a>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,f[0]=me,f[1]=xe,f[2]=ye,f[3]=ve,f[4]=ge,f[5]=we,f[6]=_e,f[7]=Me,f[8]=ke,f[9]=Se,f[10]=Ae,f[11]=Ee,f[12]=Oe,f[13]=Te,f[14]=Pe,f[15]=je,f[16]=Be,f[17]=Re,f[18]=Ce,0!==d&&(f[19]=d,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,a=0,i=0;i>>26)|0)>>>26,o&=67108863}r.words[i]=c,n=o,o=a}return 0!==n?r.words[i]=n:r.length--,r._strip()}function v(e,t,r){return y(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(x=m),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?x(this,e,t):r<63?m(this,e,t):r<1024?y(this,e,t):v(this,e,t)},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},g.prototype.permute=function(e,t,r,n,a,i){for(var o=0;o>>=1)a++;return 1<>>=13,r[2*o+1]=8191&i,i>>>=13;for(o=2*t;o>=26,r+=i/67108864|0,r+=o>>>26,this.words[n]=67108863&o}return 0!==r&&(this.words[n]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>a&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,n=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var i=e%26,o=Math.min((e-i)/26,this.length),c=67108863^67108863>>>i<o)for(this.length-=o,d=0;d=0&&(0!==s||d>=n);d--){var u=0|this.words[d];this.words[d]=s<<26-i|u>>>i,s=u&c}return f&&0!==s&&(f.words[f.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return a(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){a("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(a(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(a("number"==typeof e),a(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(f/67108864|0),this.words[n+r]=67108863&i}for(;n>26,this.words[n+r]=67108863&i;if(0===c)return this._strip();for(a(-1===c),c=0,n=0;n>26,this.words[n]=67108863&i;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),a=e,i=0|a.words[a.length-1];0!==(r=26-this._countBits(i))&&(a=a.ushln(r),n.iushln(r),i=0|a.words[a.length-1]);var c,f=n.length-a.length;if("mod"!==t){(c=new o(null)).length=f+1,c.words=new Array(c.length);for(var d=0;d=0;u--){var b=67108864*(0|n.words[a.length+u])+(0|n.words[a.length+u-1]);for(b=Math.min(b/i|0,67108863),n._ishlnsubmul(a,b,u);0!==n.negative;)b--,n.negative=0,n._ishlnsubmul(a,1,u),n.isZero()||(n.negative^=1);c&&(c.words[u]=b)}return c&&c._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:c||null,mod:n}},o.prototype.divmod=function(e,t,r){return a(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(c=this.neg().divmod(e,t),"mod"!==t&&(n=c.div.neg()),"div"!==t&&(i=c.mod.neg(),r&&0!==i.negative&&i.iadd(e)),{div:n,mod:i}):0===this.negative&&0!==e.negative?(c=this.divmod(e.neg(),t),"mod"!==t&&(n=c.div.neg()),{div:n,mod:c.mod}):0!=(this.negative&e.negative)?(c=this.neg().divmod(e.neg(),t),"div"!==t&&(i=c.mod.neg(),r&&0!==i.negative&&i.isub(e)),{div:c.div,mod:i}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var n,i,c},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),a=e.andln(1),i=r.cmp(n);return i<0||1===a&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),a(e<=67108863);for(var r=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(r*n+(0|this.words[i]))%e;return t?-n:n},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),a(e<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*r;this.words[n]=i/e|0,r=i%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new o(1),i=new o(0),c=new o(0),f=new o(1),d=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++d;for(var s=r.clone(),u=t.clone();!t.isZero();){for(var b=0,h=1;0==(t.words[0]&h)&&b<26;++b,h<<=1);if(b>0)for(t.iushrn(b);b-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(s),i.isub(u)),n.iushrn(1),i.iushrn(1);for(var l=0,p=1;0==(r.words[0]&p)&&l<26;++l,p<<=1);if(l>0)for(r.iushrn(l);l-- >0;)(c.isOdd()||f.isOdd())&&(c.iadd(s),f.isub(u)),c.iushrn(1),f.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(c),i.isub(f)):(r.isub(t),c.isub(n),f.isub(i))}return{a:c,b:f,gcd:r.iushln(d)}},o.prototype._invmp=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,i=new o(1),c=new o(0),f=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var d=0,s=1;0==(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0)for(t.iushrn(d);d-- >0;)i.isOdd()&&i.iadd(f),i.iushrn(1);for(var u=0,b=1;0==(r.words[0]&b)&&u<26;++u,b<<=1);if(u>0)for(r.iushrn(u);u-- >0;)c.isOdd()&&c.iadd(f),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(c)):(r.isub(t),c.isub(i))}return(n=0===t.cmpn(1)?i:c).cmpn(0)<0&&n.iadd(e),n},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var a=t.cmp(r);if(a<0){var i=t;t=r,r=i}else if(0===a||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){a("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<>>26,c&=67108863,this.words[o]=c}return 0!==i&&(this.words[o]=i,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),a(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var n=0|this.words[r],a=0|e.words[r];if(n!==a){na&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new E(e)},o.prototype.toRed=function(e){return a(!this.red,"Already a number in reduction context"),a(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return a(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return a(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return a(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function _(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function M(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function k(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else a(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function O(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}_.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},_.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},_.prototype.split=function(e,t){e.iushrn(this.n,0,t)},_.prototype.imulK=function(e){return e.imul(this.k)},i(M,_),M.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,a=i}a>>>=22,e.words[n-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},M.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=a,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new M;else if("p224"===e)t=new k;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return w[e]=t,t},E.prototype._verify1=function(e){a(0===e.negative,"red works only with positives"),a(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){a(0==(e.negative|t.negative),"red works only with positives"),a(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(a(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),i=0;!n.isZero()&&0===n.andln(1);)i++,n.iushrn(1);a(!n.isZero());var c=new o(1).toRed(this),f=c.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new o(2*s*s).toRed(this);0!==this.pow(s,d).cmp(f);)s.redIAdd(f);for(var u=this.pow(s,n),b=this.pow(e,n.addn(1).iushrn(1)),h=this.pow(e,n),l=i;0!==h.cmp(c);){for(var p=h,m=0;0!==p.cmp(c);m++)p=p.redSqr();a(m=0;n--){for(var d=t.words[n],s=f-1;s>=0;s--){var u=d>>s&1;a!==r[0]&&(a=this.sqr(a)),0!==u||0!==i?(i<<=1,i|=u,(4===++c||0===n&&0===s)&&(a=this.mul(a,r[i]),c=0,i=0)):c=0}f=26}return a},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new O(e)},i(O,E),O.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},O.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},O.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},O.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},O.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(15)(e))},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return D}));var n=r(8),a=r.n(n),i=r(25),o=r.n(i);function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e||"undefined"!=typeof self&&self;function f(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}var d=s;function s(e,t){if(!e)throw new Error(t||"Assertion failed")}s.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var u=f((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function a(e){for(var t="",r=0;r>8,o=255&a;i?r.push(i,o):r.push(o)}return r},r.zero2=n,r.toHex=a,r.encode=function(e,t){return"hex"===t?a(e):e}})),b=f((function(e,t){var r=t;r.assert=d,r.toArray=u.toArray,r.zero2=u.zero2,r.toHex=u.toHex,r.encode=u.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var a=1<(a>>1)-1?(a>>1)-f:f,i.isubn(c)):c=0,n[o]=c,i.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,a=0,i=0;e.cmpn(-a)>0||t.cmpn(-i)>0;){var o,c,f=e.andln(3)+a&3,d=t.andln(3)+i&3;3===f&&(f=-1),3===d&&(d=-1),o=0==(1&f)?0:3!==(n=e.andln(7)+a&7)&&5!==n||2!==d?f:-f,r[0].push(o),c=0==(1&d)?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==f?d:-d,r[1].push(c),2*a===o+1&&(a=1-a),2*i===c+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new a.a(e,"hex","le")}})),h=b.getNAF,l=b.getJSF,p=b.assert;function m(e,t){this.type=e,this.p=new a.a(t.p,16),this.red=t.prime?a.a.red(t.prime):a.a.mont(this.p),this.zero=new a.a(0).toRed(this.red),this.one=new a.a(1).toRed(this.red),this.two=new a.a(2).toRed(this.red),this.n=t.n&&new a.a(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var x=m;function y(e,t){this.curve=e,this.type=t,this.precomputed=null}m.prototype.point=function(){throw new Error("Not implemented")},m.prototype.validate=function(){throw new Error("Not implemented")},m.prototype._fixedNafMul=function(e,t){p(e.precomputed);var r=e._getDoubles(),n=h(t,1,this._bitLength),a=(1<=i;f--)o=(o<<1)+n[f];c.push(o)}for(var d=this.jpoint(null,null,null),s=this.jpoint(null,null,null),u=a;u>0;u--){for(i=0;i=0;c--){for(var f=0;c>=0&&0===i[c];c--)f++;if(c>=0&&f++,o=o.dblp(f),c<0)break;var d=i[c];p(0!==d),o="affine"===e.type?d>0?o.mixedAdd(a[d-1>>1]):o.mixedAdd(a[-d-1>>1].neg()):d>0?o.add(a[d-1>>1]):o.add(a[-d-1>>1].neg())}return"affine"===e.type?o.toP():o},m.prototype._wnafMulAdd=function(e,t,r,n,a){var i,o,c,f=this._wnafT1,d=this._wnafT2,s=this._wnafT3,u=0;for(i=0;i=1;i-=2){var p=i-1,m=i;if(1===f[p]&&1===f[m]){var x=[t[p],null,null,t[m]];0===t[p].y.cmp(t[m].y)?(x[1]=t[p].add(t[m]),x[2]=t[p].toJ().mixedAdd(t[m].neg())):0===t[p].y.cmp(t[m].y.redNeg())?(x[1]=t[p].toJ().mixedAdd(t[m]),x[2]=t[p].add(t[m].neg())):(x[1]=t[p].toJ().mixedAdd(t[m]),x[2]=t[p].toJ().mixedAdd(t[m].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],v=l(r[p],r[m]);for(u=Math.max(v[0].length,u),s[p]=new Array(u),s[m]=new Array(u),o=0;o=0;i--){for(var k=0;i>=0;){var S=!0;for(o=0;o=0&&k++,_=_.dblp(k),i<0)break;for(o=0;o0?c=d[o][A-1>>1]:A<0&&(c=d[o][-A-1>>1].neg()),_="affine"===c.type?_.mixedAdd(c):_.add(c))}}for(i=0;i=Math.ceil((e.bitLength()+1)/t.step)},y.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,a=0;a=0&&(o=t,c=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),c=c.neg()),[{a:n,b:i},{a:o,b:c}]},w.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],a=n.b.mul(e).divRound(this.n),i=r.b.neg().mul(e).divRound(this.n),o=a.mul(r.a),c=i.mul(n.a),f=a.mul(r.b),d=i.mul(n.b);return{k1:e.sub(o).sub(c),k2:f.add(d).neg()}},w.prototype.pointFromX=function(e,t){(e=new a.a(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},w.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),a=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(a).cmpn(0)},w.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,a=this._endoWnafT2,i=0;i":""},M.prototype.isInfinity=function(){return this.inf},M.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},M.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),a=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),i=a.redSqr().redISub(this.x.redAdd(this.x)),o=a.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,o)},M.prototype.getX=function(){return this.x.fromRed()},M.prototype.getY=function(){return this.y.fromRed()},M.prototype.mul=function(e){return e=new a.a(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},M.prototype.mulAdd=function(e,t,r){var n=[this,t],a=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,a):this.curve._wnafMulAdd(1,n,a,2)},M.prototype.jmulAdd=function(e,t,r){var n=[this,t],a=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,a,!0):this.curve._wnafMulAdd(1,n,a,2,!0)},M.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},M.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},M.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},v(k,x.BasePoint),w.prototype.jpoint=function(e,t,r){return new k(this,e,t,r)},k.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},k.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},k.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),a=e.x.redMul(r),i=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),c=n.redSub(a),f=i.redSub(o);if(0===c.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var d=c.redSqr(),s=d.redMul(c),u=n.redMul(d),b=f.redSqr().redIAdd(s).redISub(u).redISub(u),h=f.redMul(u.redISub(b)).redISub(i.redMul(s)),l=this.z.redMul(e.z).redMul(c);return this.curve.jpoint(b,h,l)},k.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),a=this.y,i=e.y.redMul(t).redMul(this.z),o=r.redSub(n),c=a.redSub(i);if(0===o.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=o.redSqr(),d=f.redMul(o),s=r.redMul(f),u=c.redSqr().redIAdd(d).redISub(s).redISub(s),b=c.redMul(s.redISub(u)).redISub(a.redMul(d)),h=this.z.redMul(o);return this.curve.jpoint(u,b,h)},k.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t=0)return!1;if(r.redIAdd(a),0===this.x.cmp(r))return!0}},k.prototype.inspect=function(){return this.isInfinity()?"":""},k.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var S=f((function(e,t){var r=t;r.base=x,r.short=_,r.mont=null,r.edwards=null})),A=f((function(e,t){var r,n=t,a=b.assert;function i(e){"short"===e.type?this.curve=new S.short(e):"edwards"===e.type?this.curve=new S.edwards(e):this.curve=new S.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new i(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=i,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.a.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.a.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.a.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(e){r=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function E(e){if(!(this instanceof E))return new E(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=u.toArray(e.entropy,e.entropyEnc||"hex"),r=u.toArray(e.nonce,e.nonceEnc||"hex"),n=u.toArray(e.pers,e.persEnc||"hex");d(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var O=E;E.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var a=0;a=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},E.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=u.toArray(r,n||"hex"),this._update(r));for(var a=[];a.length"};var B=b.assert;function R(e,t){if(e instanceof R)return e;this._importDER(e,t)||(B(e.r&&e.s,"Signature without r or s"),this.r=new a.a(e.r,16),this.s=new a.a(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var C=R;function I(){this.place=0}function L(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var a=0,i=0,o=t.place;i>>=0;return!(a<=127)&&(t.place=o,a)}function N(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}R.prototype._importDER=function(e,t){e=b.toArray(e,t);var r=new I;if(48!==e[r.place++])return!1;var n=L(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=L(e,r);if(!1===i)return!1;var o=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var c=L(e,r);if(!1===c)return!1;if(e.length!==c+r.place)return!1;var f=e.slice(r.place,c+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new a.a(o),this.s=new a.a(f),this.recoveryParam=null,!0},R.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=N(t),r=N(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];U(n,t.length),(n=n.concat(t)).push(2),U(n,r.length);var a=n.concat(r),i=[48];return U(i,a.length),i=i.concat(a),b.encode(i,e)};var z=function(){throw new Error("unsupported")},F=b.assert;function q(e){if(!(this instanceof q))return new q(e);"string"==typeof e&&(F(Object.prototype.hasOwnProperty.call(A,e),"Unknown curve "+e),e=A[e]),e instanceof A.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var H=q;q.prototype.keyPair=function(e){return new j(this,e)},q.prototype.keyFromPrivate=function(e,t){return j.fromPrivate(this,e,t)},q.prototype.keyFromPublic=function(e,t){return j.fromPublic(this,e,t)},q.prototype.genKeyPair=function(e){e||(e={});for(var t=new O({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||z(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new a.a(2));;){var i=new a.a(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},q.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},q.prototype.sign=function(e,t,r,n){"object"===c(r)&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new a.a(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),f=e.toArray("be",i),d=new O({hash:this.hash,entropy:o,nonce:f,pers:n.pers,persEnc:n.persEnc||"utf8"}),s=this.n.sub(new a.a(1)),u=0;;u++){var b=n.k?n.k(u):new a.a(d.generate(this.n.byteLength()));if(!((b=this._truncateToN(b,!0)).cmpn(1)<=0||b.cmp(s)>=0)){var h=this.g.mul(b);if(!h.isInfinity()){var l=h.getX(),p=l.umod(this.n);if(0!==p.cmpn(0)){var m=b.invm(this.n).mul(p.mul(t.getPrivate()).iadd(e));if(0!==(m=m.umod(this.n)).cmpn(0)){var x=(h.getY().isOdd()?1:0)|(0!==l.cmp(p)?2:0);return n.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),x^=1),new C({r:p,s:m,recoveryParam:x})}}}}}},q.prototype.verify=function(e,t,r,n){e=this._truncateToN(new a.a(e,16)),r=this.keyFromPublic(r,n);var i=(t=new C(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var c,f=o.invm(this.n),d=f.mul(e).umod(this.n),s=f.mul(i).umod(this.n);return this.curve._maxwellTrick?!(c=this.g.jmulAdd(d,r.getPublic(),s)).isInfinity()&&c.eqXToP(i):!(c=this.g.mulAdd(d,r.getPublic(),s)).isInfinity()&&0===c.getX().umod(this.n).cmp(i)},q.prototype.recoverPubKey=function(e,t,r,n){F((3&r)===r,"The recovery param is more than two bits"),t=new C(t,n);var i=this.n,o=new a.a(e),c=t.r,f=t.s,d=1&r,s=r>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&s)throw new Error("Unable to find sencond key candinate");c=s?this.curve.pointFromX(c.add(this.curve.n),d):this.curve.pointFromX(c,d);var u=t.r.invm(i),b=i.sub(o).mul(u).umod(i),h=f.mul(u).umod(i);return this.g.mulAdd(b,c,h)},q.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new C(t,n)).recoveryParam)return t.recoveryParam;for(var a=0;a<4;a++){var i;try{i=this.recoverPubKey(e,t,a)}catch(e){continue}if(i.eq(r))return a}throw new Error("Unable to find valid recovery factor")};var D=f((function(e,t){var r=t;r.version="6.5.4",r.utils=b,r.rand=function(){throw new Error("unsupported")},r.curve=S,r.curves=A,r.ec=H,r.eddsa=null})).ec}).call(this,r(13))},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.getWindowMetadata=void 0;var a=r(26);t.getWindowMetadata=function(){var e,t;try{e=a.getDocumentOrThrow(),t=a.getLocationOrThrow()}catch(e){return null}function r(){for(var t=arguments.length,r=new Array(t),a=0;a-1){var c=i.getAttribute("href");if(c)if(-1===c.toLowerCase().indexOf("https:")&&-1===c.toLowerCase().indexOf("http:")&&0!==c.indexOf("//")){var f=t.protocol+"//"+t.host;if(0===c.indexOf("/"))f+=c;else{var d=t.pathname.split("/");d.pop(),f+=d.join("/")+"/"+c}n.push(f)}else if(0===c.indexOf("//")){var s=t.protocol+c;n.push(s)}else n.push(c)}}return n}(),name:i}}},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return b}));var n=function(){for(var e=0,t=0,r=arguments.length;t=0;--a){var i=this.tryEntries[a],o=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),f=r.call(i,"finallyLoc");if(c&&f){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),k(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;k(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:A(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),b}},e}function c(e,t,r,n,a,i,o){try{var c=e[i](o),f=c.value}catch(e){return void r(e)}c.done?t(f):Promise.resolve(f).then(n,a)}function f(e,t){for(var r=0;r=0;f--)(i=e[f])&&(c=(o<3?i(c):o>3?i(t,r,c):i(t,r))||c);return o>3&&c&&Object.defineProperty(t,r,c),c},o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||a(t,e,r)},c=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{f(n.next(e))}catch(e){i(e)}}function c(e){try{f(n.throw(e))}catch(e){i(e)}}function f(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}f((n=n.apply(e,t||[])).next())}))},f=this&&this.__generator||function(e,t){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=o.trys,(a=a.length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},s=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o},u=this&&this.__spread||function(){for(var e=[],t=0;tt&&c[t].tokenId&&!n)&&(this.updateTokenInfo(c[t],e,t,r),_.saveData(this.data)),[2,c[t]]}))}))},t.prototype.nftList=function(e,t){return c(this,void 0,void 0,(function(){var r,n,a,i,o,c,d,s,u;return f(this,(function(f){switch(f.label){case 0:return t=t||this.currentAccount().address,r=this.wallet.currentChain.id,[4,this.erc721Standard.getBalance(e,t)];case 1:if(n=f.sent(),a=P.getTypeByAddress(r,e),i=a.categor,o=a.type,c=[],i!==P.UNKNOW&&(c=this.currentAccountData.tokenData[r][i+"s"]),d=!1,c.length!==n&&(d=!0),d)for(c.length=0,s=0;s0?o-4:o;for(r=0;r>16&255,f[s++]=t>>8&255,f[s++]=255&t;2===c&&(t=a[e.charCodeAt(r)]<<2|a[e.charCodeAt(r+1)]>>4,f[s++]=255&t);1===c&&(t=a[e.charCodeAt(r)]<<10|a[e.charCodeAt(r+1)]<<4|a[e.charCodeAt(r+2)]>>2,f[s++]=t>>8&255,f[s++]=255&t);return f},t.fromByteArray=function(e){for(var t,r=e.length,a=r%3,i=[],o=0,c=r-a;oc?c:o+16383));1===a?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+"==")):2===a&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return i.join("")};for(var n=[],a=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0,f=o.length;c0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function s(e,t,r){for(var a,i,o=[],c=t;c>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return o.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},function(e,t){ +!function(t){"use strict";function r(e){return parseInt(e)===e}function n(e){if(!r(e.length))return!1;for(var t=0;t255)return!1;return!0}function a(e,t){if(e.buffer&&"Uint8Array"===e.name)return t&&(e=e.slice?e.slice():Array.prototype.slice.call(e)),e;if(Array.isArray(e)){if(!n(e))throw new Error("Array contains invalid value: "+e);return new Uint8Array(e)}if(r(e.length)&&n(e))return new Uint8Array(e);throw new Error("unsupported array-like object")}function i(e){return new Uint8Array(e)}function o(e,t,r,n,a){null==n&&null==a||(e=e.slice?e.slice(n,a):Array.prototype.slice.call(e,n,a)),t.set(e,r)}var c,f={toBytes:function(e){var t=[],r=0;for(e=encodeURI(e);r191&&n<224?(t.push(String.fromCharCode((31&n)<<6|63&e[r+1])),r+=2):(t.push(String.fromCharCode((15&n)<<12|(63&e[r+1])<<6|63&e[r+2])),r+=3)}return t.join("")}},d=(c="0123456789abcdef",{toBytes:function(e){for(var t=[],r=0;r>4]+c[15&n])}return t.join("")}}),s={16:10,24:12,32:14},u=[1,2,4,8,16,32,64,128,27,54,108,216,171,77,154,47,94,188,99,198,151,53,106,212,179,125,250,239,197,145],b=[99,124,119,123,242,107,111,197,48,1,103,43,254,215,171,118,202,130,201,125,250,89,71,240,173,212,162,175,156,164,114,192,183,253,147,38,54,63,247,204,52,165,229,241,113,216,49,21,4,199,35,195,24,150,5,154,7,18,128,226,235,39,178,117,9,131,44,26,27,110,90,160,82,59,214,179,41,227,47,132,83,209,0,237,32,252,177,91,106,203,190,57,74,76,88,207,208,239,170,251,67,77,51,133,69,249,2,127,80,60,159,168,81,163,64,143,146,157,56,245,188,182,218,33,16,255,243,210,205,12,19,236,95,151,68,23,196,167,126,61,100,93,25,115,96,129,79,220,34,42,144,136,70,238,184,20,222,94,11,219,224,50,58,10,73,6,36,92,194,211,172,98,145,149,228,121,231,200,55,109,141,213,78,169,108,86,244,234,101,122,174,8,186,120,37,46,28,166,180,198,232,221,116,31,75,189,139,138,112,62,181,102,72,3,246,14,97,53,87,185,134,193,29,158,225,248,152,17,105,217,142,148,155,30,135,233,206,85,40,223,140,161,137,13,191,230,66,104,65,153,45,15,176,84,187,22],h=[82,9,106,213,48,54,165,56,191,64,163,158,129,243,215,251,124,227,57,130,155,47,255,135,52,142,67,68,196,222,233,203,84,123,148,50,166,194,35,61,238,76,149,11,66,250,195,78,8,46,161,102,40,217,36,178,118,91,162,73,109,139,209,37,114,248,246,100,134,104,152,22,212,164,92,204,93,101,182,146,108,112,72,80,253,237,185,218,94,21,70,87,167,141,157,132,144,216,171,0,140,188,211,10,247,228,88,5,184,179,69,6,208,44,30,143,202,63,15,2,193,175,189,3,1,19,138,107,58,145,17,65,79,103,220,234,151,242,207,206,240,180,230,115,150,172,116,34,231,173,53,133,226,249,55,232,28,117,223,110,71,241,26,113,29,41,197,137,111,183,98,14,170,24,190,27,252,86,62,75,198,210,121,32,154,219,192,254,120,205,90,244,31,221,168,51,136,7,199,49,177,18,16,89,39,128,236,95,96,81,127,169,25,181,74,13,45,229,122,159,147,201,156,239,160,224,59,77,174,42,245,176,200,235,187,60,131,83,153,97,23,43,4,126,186,119,214,38,225,105,20,99,85,33,12,125],l=[3328402341,4168907908,4000806809,4135287693,4294111757,3597364157,3731845041,2445657428,1613770832,33620227,3462883241,1445669757,3892248089,3050821474,1303096294,3967186586,2412431941,528646813,2311702848,4202528135,4026202645,2992200171,2387036105,4226871307,1101901292,3017069671,1604494077,1169141738,597466303,1403299063,3832705686,2613100635,1974974402,3791519004,1033081774,1277568618,1815492186,2118074177,4126668546,2211236943,1748251740,1369810420,3521504564,4193382664,3799085459,2883115123,1647391059,706024767,134480908,2512897874,1176707941,2646852446,806885416,932615841,168101135,798661301,235341577,605164086,461406363,3756188221,3454790438,1311188841,2142417613,3933566367,302582043,495158174,1479289972,874125870,907746093,3698224818,3025820398,1537253627,2756858614,1983593293,3084310113,2108928974,1378429307,3722699582,1580150641,327451799,2790478837,3117535592,0,3253595436,1075847264,3825007647,2041688520,3059440621,3563743934,2378943302,1740553945,1916352843,2487896798,2555137236,2958579944,2244988746,3151024235,3320835882,1336584933,3992714006,2252555205,2588757463,1714631509,293963156,2319795663,3925473552,67240454,4269768577,2689618160,2017213508,631218106,1269344483,2723238387,1571005438,2151694528,93294474,1066570413,563977660,1882732616,4059428100,1673313503,2008463041,2950355573,1109467491,537923632,3858759450,4260623118,3218264685,2177748300,403442708,638784309,3287084079,3193921505,899127202,2286175436,773265209,2479146071,1437050866,4236148354,2050833735,3362022572,3126681063,840505643,3866325909,3227541664,427917720,2655997905,2749160575,1143087718,1412049534,999329963,193497219,2353415882,3354324521,1807268051,672404540,2816401017,3160301282,369822493,2916866934,3688947771,1681011286,1949973070,336202270,2454276571,201721354,1210328172,3093060836,2680341085,3184776046,1135389935,3294782118,965841320,831886756,3554993207,4068047243,3588745010,2345191491,1849112409,3664604599,26054028,2983581028,2622377682,1235855840,3630984372,2891339514,4092916743,3488279077,3395642799,4101667470,1202630377,268961816,1874508501,4034427016,1243948399,1546530418,941366308,1470539505,1941222599,2546386513,3421038627,2715671932,3899946140,1042226977,2521517021,1639824860,227249030,260737669,3765465232,2084453954,1907733956,3429263018,2420656344,100860677,4160157185,470683154,3261161891,1781871967,2924959737,1773779408,394692241,2579611992,974986535,664706745,3655459128,3958962195,731420851,571543859,3530123707,2849626480,126783113,865375399,765172662,1008606754,361203602,3387549984,2278477385,2857719295,1344809080,2782912378,59542671,1503764984,160008576,437062935,1707065306,3622233649,2218934982,3496503480,2185314755,697932208,1512910199,504303377,2075177163,2824099068,1841019862,739644986],p=[2781242211,2230877308,2582542199,2381740923,234877682,3184946027,2984144751,1418839493,1348481072,50462977,2848876391,2102799147,434634494,1656084439,3863849899,2599188086,1167051466,2636087938,1082771913,2281340285,368048890,3954334041,3381544775,201060592,3963727277,1739838676,4250903202,3930435503,3206782108,4149453988,2531553906,1536934080,3262494647,484572669,2923271059,1783375398,1517041206,1098792767,49674231,1334037708,1550332980,4098991525,886171109,150598129,2481090929,1940642008,1398944049,1059722517,201851908,1385547719,1699095331,1587397571,674240536,2704774806,252314885,3039795866,151914247,908333586,2602270848,1038082786,651029483,1766729511,3447698098,2682942837,454166793,2652734339,1951935532,775166490,758520603,3000790638,4004797018,4217086112,4137964114,1299594043,1639438038,3464344499,2068982057,1054729187,1901997871,2534638724,4121318227,1757008337,0,750906861,1614815264,535035132,3363418545,3988151131,3201591914,1183697867,3647454910,1265776953,3734260298,3566750796,3903871064,1250283471,1807470800,717615087,3847203498,384695291,3313910595,3617213773,1432761139,2484176261,3481945413,283769337,100925954,2180939647,4037038160,1148730428,3123027871,3813386408,4087501137,4267549603,3229630528,2315620239,2906624658,3156319645,1215313976,82966005,3747855548,3245848246,1974459098,1665278241,807407632,451280895,251524083,1841287890,1283575245,337120268,891687699,801369324,3787349855,2721421207,3431482436,959321879,1469301956,4065699751,2197585534,1199193405,2898814052,3887750493,724703513,2514908019,2696962144,2551808385,3516813135,2141445340,1715741218,2119445034,2872807568,2198571144,3398190662,700968686,3547052216,1009259540,2041044702,3803995742,487983883,1991105499,1004265696,1449407026,1316239930,504629770,3683797321,168560134,1816667172,3837287516,1570751170,1857934291,4014189740,2797888098,2822345105,2754712981,936633572,2347923833,852879335,1133234376,1500395319,3084545389,2348912013,1689376213,3533459022,3762923945,3034082412,4205598294,133428468,634383082,2949277029,2398386810,3913789102,403703816,3580869306,2297460856,1867130149,1918643758,607656988,4049053350,3346248884,1368901318,600565992,2090982877,2632479860,557719327,3717614411,3697393085,2249034635,2232388234,2430627952,1115438654,3295786421,2865522278,3633334344,84280067,33027830,303828494,2747425121,1600795957,4188952407,3496589753,2434238086,1486471617,658119965,3106381470,953803233,334231800,3005978776,857870609,3151128937,1890179545,2298973838,2805175444,3056442267,574365214,2450884487,550103529,1233637070,4289353045,2018519080,2057691103,2399374476,4166623649,2148108681,387583245,3664101311,836232934,3330556482,3100665960,3280093505,2955516313,2002398509,287182607,3413881008,4238890068,3597515707,975967766],m=[1671808611,2089089148,2006576759,2072901243,4061003762,1807603307,1873927791,3310653893,810573872,16974337,1739181671,729634347,4263110654,3613570519,2883997099,1989864566,3393556426,2191335298,3376449993,2106063485,4195741690,1508618841,1204391495,4027317232,2917941677,3563566036,2734514082,2951366063,2629772188,2767672228,1922491506,3227229120,3082974647,4246528509,2477669779,644500518,911895606,1061256767,4144166391,3427763148,878471220,2784252325,3845444069,4043897329,1905517169,3631459288,827548209,356461077,67897348,3344078279,593839651,3277757891,405286936,2527147926,84871685,2595565466,118033927,305538066,2157648768,3795705826,3945188843,661212711,2999812018,1973414517,152769033,2208177539,745822252,439235610,455947803,1857215598,1525593178,2700827552,1391895634,994932283,3596728278,3016654259,695947817,3812548067,795958831,2224493444,1408607827,3513301457,0,3979133421,543178784,4229948412,2982705585,1542305371,1790891114,3410398667,3201918910,961245753,1256100938,1289001036,1491644504,3477767631,3496721360,4012557807,2867154858,4212583931,1137018435,1305975373,861234739,2241073541,1171229253,4178635257,33948674,2139225727,1357946960,1011120188,2679776671,2833468328,1374921297,2751356323,1086357568,2408187279,2460827538,2646352285,944271416,4110742005,3168756668,3066132406,3665145818,560153121,271589392,4279952895,4077846003,3530407890,3444343245,202643468,322250259,3962553324,1608629855,2543990167,1154254916,389623319,3294073796,2817676711,2122513534,1028094525,1689045092,1575467613,422261273,1939203699,1621147744,2174228865,1339137615,3699352540,577127458,712922154,2427141008,2290289544,1187679302,3995715566,3100863416,339486740,3732514782,1591917662,186455563,3681988059,3762019296,844522546,978220090,169743370,1239126601,101321734,611076132,1558493276,3260915650,3547250131,2901361580,1655096418,2443721105,2510565781,3828863972,2039214713,3878868455,3359869896,928607799,1840765549,2374762893,3580146133,1322425422,2850048425,1823791212,1459268694,4094161908,3928346602,1706019429,2056189050,2934523822,135794696,3134549946,2022240376,628050469,779246638,472135708,2800834470,3032970164,3327236038,3894660072,3715932637,1956440180,522272287,1272813131,3185336765,2340818315,2323976074,1888542832,1044544574,3049550261,1722469478,1222152264,50660867,4127324150,236067854,1638122081,895445557,1475980887,3117443513,2257655686,3243809217,489110045,2662934430,3778599393,4162055160,2561878936,288563729,1773916777,3648039385,2391345038,2493985684,2612407707,505560094,2274497927,3911240169,3460925390,1442818645,678973480,3749357023,2358182796,2717407649,2306869641,219617805,3218761151,3862026214,1120306242,1756942440,1103331905,2578459033,762796589,252780047,2966125488,1425844308,3151392187,372911126],x=[1667474886,2088535288,2004326894,2071694838,4075949567,1802223062,1869591006,3318043793,808472672,16843522,1734846926,724270422,4278065639,3621216949,2880169549,1987484396,3402253711,2189597983,3385409673,2105378810,4210693615,1499065266,1195886990,4042263547,2913856577,3570689971,2728590687,2947541573,2627518243,2762274643,1920112356,3233831835,3082273397,4261223649,2475929149,640051788,909531756,1061110142,4160160501,3435941763,875846760,2779116625,3857003729,4059105529,1903268834,3638064043,825316194,353713962,67374088,3351728789,589522246,3284360861,404236336,2526454071,84217610,2593830191,117901582,303183396,2155911963,3806477791,3958056653,656894286,2998062463,1970642922,151591698,2206440989,741110872,437923380,454765878,1852748508,1515908788,2694904667,1381168804,993742198,3604373943,3014905469,690584402,3823320797,791638366,2223281939,1398011302,3520161977,0,3991743681,538992704,4244381667,2981218425,1532751286,1785380564,3419096717,3200178535,960056178,1246420628,1280103576,1482221744,3486468741,3503319995,4025428677,2863326543,4227536621,1128514950,1296947098,859002214,2240123921,1162203018,4193849577,33687044,2139062782,1347481760,1010582648,2678045221,2829640523,1364325282,2745433693,1077985408,2408548869,2459086143,2644360225,943212656,4126475505,3166494563,3065430391,3671750063,555836226,269496352,4294908645,4092792573,3537006015,3452783745,202118168,320025894,3974901699,1600119230,2543297077,1145359496,387397934,3301201811,2812801621,2122220284,1027426170,1684319432,1566435258,421079858,1936954854,1616945344,2172753945,1330631070,3705438115,572679748,707427924,2425400123,2290647819,1179044492,4008585671,3099120491,336870440,3739122087,1583276732,185277718,3688593069,3772791771,842159716,976899700,168435220,1229577106,101059084,606366792,1549591736,3267517855,3553849021,2897014595,1650632388,2442242105,2509612081,3840161747,2038008818,3890688725,3368567691,926374254,1835907034,2374863873,3587531953,1313788572,2846482505,1819063512,1448540844,4109633523,3941213647,1701162954,2054852340,2930698567,134748176,3132806511,2021165296,623210314,774795868,471606328,2795958615,3031746419,3334885783,3907527627,3722280097,1953799400,522133822,1263263126,3183336545,2341176845,2324333839,1886425312,1044267644,3048588401,1718004428,1212733584,50529542,4143317495,235803164,1633788866,892690282,1465383342,3115962473,2256965911,3250673817,488449850,2661202215,3789633753,4177007595,2560144171,286339874,1768537042,3654906025,2391705863,2492770099,2610673197,505291324,2273808917,3924369609,3469625735,1431699370,673740880,3755965093,2358021891,2711746649,2307489801,218961690,3217021541,3873845719,1111672452,1751693520,1094828930,2576986153,757954394,252645662,2964376443,1414855848,3149649517,370555436],y=[1374988112,2118214995,437757123,975658646,1001089995,530400753,2902087851,1273168787,540080725,2910219766,2295101073,4110568485,1340463100,3307916247,641025152,3043140495,3736164937,632953703,1172967064,1576976609,3274667266,2169303058,2370213795,1809054150,59727847,361929877,3211623147,2505202138,3569255213,1484005843,1239443753,2395588676,1975683434,4102977912,2572697195,666464733,3202437046,4035489047,3374361702,2110667444,1675577880,3843699074,2538681184,1649639237,2976151520,3144396420,4269907996,4178062228,1883793496,2403728665,2497604743,1383856311,2876494627,1917518562,3810496343,1716890410,3001755655,800440835,2261089178,3543599269,807962610,599762354,33778362,3977675356,2328828971,2809771154,4077384432,1315562145,1708848333,101039829,3509871135,3299278474,875451293,2733856160,92987698,2767645557,193195065,1080094634,1584504582,3178106961,1042385657,2531067453,3711829422,1306967366,2438237621,1908694277,67556463,1615861247,429456164,3602770327,2302690252,1742315127,2968011453,126454664,3877198648,2043211483,2709260871,2084704233,4169408201,0,159417987,841739592,504459436,1817866830,4245618683,260388950,1034867998,908933415,168810852,1750902305,2606453969,607530554,202008497,2472011535,3035535058,463180190,2160117071,1641816226,1517767529,470948374,3801332234,3231722213,1008918595,303765277,235474187,4069246893,766945465,337553864,1475418501,2943682380,4003061179,2743034109,4144047775,1551037884,1147550661,1543208500,2336434550,3408119516,3069049960,3102011747,3610369226,1113818384,328671808,2227573024,2236228733,3535486456,2935566865,3341394285,496906059,3702665459,226906860,2009195472,733156972,2842737049,294930682,1206477858,2835123396,2700099354,1451044056,573804783,2269728455,3644379585,2362090238,2564033334,2801107407,2776292904,3669462566,1068351396,742039012,1350078989,1784663195,1417561698,4136440770,2430122216,775550814,2193862645,2673705150,1775276924,1876241833,3475313331,3366754619,270040487,3902563182,3678124923,3441850377,1851332852,3969562369,2203032232,3868552805,2868897406,566021896,4011190502,3135740889,1248802510,3936291284,699432150,832877231,708780849,3332740144,899835584,1951317047,4236429990,3767586992,866637845,4043610186,1106041591,2144161806,395441711,1984812685,1139781709,3433712980,3835036895,2664543715,1282050075,3240894392,1181045119,2640243204,25965917,4203181171,4211818798,3009879386,2463879762,3910161971,1842759443,2597806476,933301370,1509430414,3943906441,3467192302,3076639029,3776767469,2051518780,2631065433,1441952575,404016761,1942435775,1408749034,1610459739,3745345300,2017778566,3400528769,3110650942,941896748,3265478751,371049330,3168937228,675039627,4279080257,967311729,135050206,3635733660,1683407248,2076935265,3576870512,1215061108,3501741890],v=[1347548327,1400783205,3273267108,2520393566,3409685355,4045380933,2880240216,2471224067,1428173050,4138563181,2441661558,636813900,4233094615,3620022987,2149987652,2411029155,1239331162,1730525723,2554718734,3781033664,46346101,310463728,2743944855,3328955385,3875770207,2501218972,3955191162,3667219033,768917123,3545789473,692707433,1150208456,1786102409,2029293177,1805211710,3710368113,3065962831,401639597,1724457132,3028143674,409198410,2196052529,1620529459,1164071807,3769721975,2226875310,486441376,2499348523,1483753576,428819965,2274680428,3075636216,598438867,3799141122,1474502543,711349675,129166120,53458370,2592523643,2782082824,4063242375,2988687269,3120694122,1559041666,730517276,2460449204,4042459122,2706270690,3446004468,3573941694,533804130,2328143614,2637442643,2695033685,839224033,1973745387,957055980,2856345839,106852767,1371368976,4181598602,1033297158,2933734917,1179510461,3046200461,91341917,1862534868,4284502037,605657339,2547432937,3431546947,2003294622,3182487618,2282195339,954669403,3682191598,1201765386,3917234703,3388507166,0,2198438022,1211247597,2887651696,1315723890,4227665663,1443857720,507358933,657861945,1678381017,560487590,3516619604,975451694,2970356327,261314535,3535072918,2652609425,1333838021,2724322336,1767536459,370938394,182621114,3854606378,1128014560,487725847,185469197,2918353863,3106780840,3356761769,2237133081,1286567175,3152976349,4255350624,2683765030,3160175349,3309594171,878443390,1988838185,3704300486,1756818940,1673061617,3403100636,272786309,1075025698,545572369,2105887268,4174560061,296679730,1841768865,1260232239,4091327024,3960309330,3497509347,1814803222,2578018489,4195456072,575138148,3299409036,446754879,3629546796,4011996048,3347532110,3252238545,4270639778,915985419,3483825537,681933534,651868046,2755636671,3828103837,223377554,2607439820,1649704518,3270937875,3901806776,1580087799,4118987695,3198115200,2087309459,2842678573,3016697106,1003007129,2802849917,1860738147,2077965243,164439672,4100872472,32283319,2827177882,1709610350,2125135846,136428751,3874428392,3652904859,3460984630,3572145929,3593056380,2939266226,824852259,818324884,3224740454,930369212,2801566410,2967507152,355706840,1257309336,4148292826,243256656,790073846,2373340630,1296297904,1422699085,3756299780,3818836405,457992840,3099667487,2135319889,77422314,1560382517,1945798516,788204353,1521706781,1385356242,870912086,325965383,2358957921,2050466060,2388260884,2313884476,4006521127,901210569,3990953189,1014646705,1503449823,1062597235,2031621326,3212035895,3931371469,1533017514,350174575,2256028891,2177544179,1052338372,741876788,1606591296,1914052035,213705253,2334669897,1107234197,1899603969,3725069491,2631447780,2422494913,1635502980,1893020342,1950903388,1120974935],g=[2807058932,1699970625,2764249623,1586903591,1808481195,1173430173,1487645946,59984867,4199882800,1844882806,1989249228,1277555970,3623636965,3419915562,1149249077,2744104290,1514790577,459744698,244860394,3235995134,1963115311,4027744588,2544078150,4190530515,1608975247,2627016082,2062270317,1507497298,2200818878,567498868,1764313568,3359936201,2305455554,2037970062,1047239e3,1910319033,1337376481,2904027272,2892417312,984907214,1243112415,830661914,861968209,2135253587,2011214180,2927934315,2686254721,731183368,1750626376,4246310725,1820824798,4172763771,3542330227,48394827,2404901663,2871682645,671593195,3254988725,2073724613,145085239,2280796200,2779915199,1790575107,2187128086,472615631,3029510009,4075877127,3802222185,4107101658,3201631749,1646252340,4270507174,1402811438,1436590835,3778151818,3950355702,3963161475,4020912224,2667994737,273792366,2331590177,104699613,95345982,3175501286,2377486676,1560637892,3564045318,369057872,4213447064,3919042237,1137477952,2658625497,1119727848,2340947849,1530455833,4007360968,172466556,266959938,516552836,0,2256734592,3980931627,1890328081,1917742170,4294704398,945164165,3575528878,958871085,3647212047,2787207260,1423022939,775562294,1739656202,3876557655,2530391278,2443058075,3310321856,547512796,1265195639,437656594,3121275539,719700128,3762502690,387781147,218828297,3350065803,2830708150,2848461854,428169201,122466165,3720081049,1627235199,648017665,4122762354,1002783846,2117360635,695634755,3336358691,4234721005,4049844452,3704280881,2232435299,574624663,287343814,612205898,1039717051,840019705,2708326185,793451934,821288114,1391201670,3822090177,376187827,3113855344,1224348052,1679968233,2361698556,1058709744,752375421,2431590963,1321699145,3519142200,2734591178,188127444,2177869557,3727205754,2384911031,3215212461,2648976442,2450346104,3432737375,1180849278,331544205,3102249176,4150144569,2952102595,2159976285,2474404304,766078933,313773861,2570832044,2108100632,1668212892,3145456443,2013908262,418672217,3070356634,2594734927,1852171925,3867060991,3473416636,3907448597,2614737639,919489135,164948639,2094410160,2997825956,590424639,2486224549,1723872674,3157750862,3399941250,3501252752,3625268135,2555048196,3673637356,1343127501,4130281361,3599595085,2957853679,1297403050,81781910,3051593425,2283490410,532201772,1367295589,3926170974,895287692,1953757831,1093597963,492483431,3528626907,1446242576,1192455638,1636604631,209336225,344873464,1015671571,669961897,3375740769,3857572124,2973530695,3747192018,1933530610,3464042516,935293895,3454686199,2858115069,1863638845,3683022916,4085369519,3292445032,875313188,1080017571,3279033885,621591778,1233856572,2504130317,24197544,3017672716,3835484340,3247465558,2220981195,3060847922,1551124588,1463996600],w=[4104605777,1097159550,396673818,660510266,2875968315,2638606623,4200115116,3808662347,821712160,1986918061,3430322568,38544885,3856137295,718002117,893681702,1654886325,2975484382,3122358053,3926825029,4274053469,796197571,1290801793,1184342925,3556361835,2405426947,2459735317,1836772287,1381620373,3196267988,1948373848,3764988233,3385345166,3263785589,2390325492,1480485785,3111247143,3780097726,2293045232,548169417,3459953789,3746175075,439452389,1362321559,1400849762,1685577905,1806599355,2174754046,137073913,1214797936,1174215055,3731654548,2079897426,1943217067,1258480242,529487843,1437280870,3945269170,3049390895,3313212038,923313619,679998e3,3215307299,57326082,377642221,3474729866,2041877159,133361907,1776460110,3673476453,96392454,878845905,2801699524,777231668,4082475170,2330014213,4142626212,2213296395,1626319424,1906247262,1846563261,562755902,3708173718,1040559837,3871163981,1418573201,3294430577,114585348,1343618912,2566595609,3186202582,1078185097,3651041127,3896688048,2307622919,425408743,3371096953,2081048481,1108339068,2216610296,0,2156299017,736970802,292596766,1517440620,251657213,2235061775,2933202493,758720310,265905162,1554391400,1532285339,908999204,174567692,1474760595,4002861748,2610011675,3234156416,3693126241,2001430874,303699484,2478443234,2687165888,585122620,454499602,151849742,2345119218,3064510765,514443284,4044981591,1963412655,2581445614,2137062819,19308535,1928707164,1715193156,4219352155,1126790795,600235211,3992742070,3841024952,836553431,1669664834,2535604243,3323011204,1243905413,3141400786,4180808110,698445255,2653899549,2989552604,2253581325,3252932727,3004591147,1891211689,2487810577,3915653703,4237083816,4030667424,2100090966,865136418,1229899655,953270745,3399679628,3557504664,4118925222,2061379749,3079546586,2915017791,983426092,2022837584,1607244650,2118541908,2366882550,3635996816,972512814,3283088770,1568718495,3499326569,3576539503,621982671,2895723464,410887952,2623762152,1002142683,645401037,1494807662,2595684844,1335535747,2507040230,4293295786,3167684641,367585007,3885750714,1865862730,2668221674,2960971305,2763173681,1059270954,2777952454,2724642869,1320957812,2194319100,2429595872,2815956275,77089521,3973773121,3444575871,2448830231,1305906550,4021308739,2857194700,2516901860,3518358430,1787304780,740276417,1699839814,1592394909,2352307457,2272556026,188821243,1729977011,3687994002,274084841,3594982253,3613494426,2701949495,4162096729,322734571,2837966542,1640576439,484830689,1202797690,3537852828,4067639125,349075736,3342319475,4157467219,4255800159,1030690015,1155237496,2951971274,1757691577,607398968,2738905026,499347990,3794078908,1011452712,227885567,2818666809,213114376,3034881240,1455525988,3414450555,850817237,1817998408,3092726480],_=[0,235474187,470948374,303765277,941896748,908933415,607530554,708780849,1883793496,2118214995,1817866830,1649639237,1215061108,1181045119,1417561698,1517767529,3767586992,4003061179,4236429990,4069246893,3635733660,3602770327,3299278474,3400528769,2430122216,2664543715,2362090238,2193862645,2835123396,2801107407,3035535058,3135740889,3678124923,3576870512,3341394285,3374361702,3810496343,3977675356,4279080257,4043610186,2876494627,2776292904,3076639029,3110650942,2472011535,2640243204,2403728665,2169303058,1001089995,899835584,666464733,699432150,59727847,226906860,530400753,294930682,1273168787,1172967064,1475418501,1509430414,1942435775,2110667444,1876241833,1641816226,2910219766,2743034109,2976151520,3211623147,2505202138,2606453969,2302690252,2269728455,3711829422,3543599269,3240894392,3475313331,3843699074,3943906441,4178062228,4144047775,1306967366,1139781709,1374988112,1610459739,1975683434,2076935265,1775276924,1742315127,1034867998,866637845,566021896,800440835,92987698,193195065,429456164,395441711,1984812685,2017778566,1784663195,1683407248,1315562145,1080094634,1383856311,1551037884,101039829,135050206,437757123,337553864,1042385657,807962610,573804783,742039012,2531067453,2564033334,2328828971,2227573024,2935566865,2700099354,3001755655,3168937228,3868552805,3902563182,4203181171,4102977912,3736164937,3501741890,3265478751,3433712980,1106041591,1340463100,1576976609,1408749034,2043211483,2009195472,1708848333,1809054150,832877231,1068351396,766945465,599762354,159417987,126454664,361929877,463180190,2709260871,2943682380,3178106961,3009879386,2572697195,2538681184,2236228733,2336434550,3509871135,3745345300,3441850377,3274667266,3910161971,3877198648,4110568485,4211818798,2597806476,2497604743,2261089178,2295101073,2733856160,2902087851,3202437046,2968011453,3936291284,3835036895,4136440770,4169408201,3535486456,3702665459,3467192302,3231722213,2051518780,1951317047,1716890410,1750902305,1113818384,1282050075,1584504582,1350078989,168810852,67556463,371049330,404016761,841739592,1008918595,775550814,540080725,3969562369,3801332234,4035489047,4269907996,3569255213,3669462566,3366754619,3332740144,2631065433,2463879762,2160117071,2395588676,2767645557,2868897406,3102011747,3069049960,202008497,33778362,270040487,504459436,875451293,975658646,675039627,641025152,2084704233,1917518562,1615861247,1851332852,1147550661,1248802510,1484005843,1451044056,933301370,967311729,733156972,632953703,260388950,25965917,328671808,496906059,1206477858,1239443753,1543208500,1441952575,2144161806,1908694277,1675577880,1842759443,3610369226,3644379585,3408119516,3307916247,4011190502,3776767469,4077384432,4245618683,2809771154,2842737049,3144396420,3043140495,2673705150,2438237621,2203032232,2370213795],M=[0,185469197,370938394,487725847,741876788,657861945,975451694,824852259,1483753576,1400783205,1315723890,1164071807,1950903388,2135319889,1649704518,1767536459,2967507152,3152976349,2801566410,2918353863,2631447780,2547432937,2328143614,2177544179,3901806776,3818836405,4270639778,4118987695,3299409036,3483825537,3535072918,3652904859,2077965243,1893020342,1841768865,1724457132,1474502543,1559041666,1107234197,1257309336,598438867,681933534,901210569,1052338372,261314535,77422314,428819965,310463728,3409685355,3224740454,3710368113,3593056380,3875770207,3960309330,4045380933,4195456072,2471224067,2554718734,2237133081,2388260884,3212035895,3028143674,2842678573,2724322336,4138563181,4255350624,3769721975,3955191162,3667219033,3516619604,3431546947,3347532110,2933734917,2782082824,3099667487,3016697106,2196052529,2313884476,2499348523,2683765030,1179510461,1296297904,1347548327,1533017514,1786102409,1635502980,2087309459,2003294622,507358933,355706840,136428751,53458370,839224033,957055980,605657339,790073846,2373340630,2256028891,2607439820,2422494913,2706270690,2856345839,3075636216,3160175349,3573941694,3725069491,3273267108,3356761769,4181598602,4063242375,4011996048,3828103837,1033297158,915985419,730517276,545572369,296679730,446754879,129166120,213705253,1709610350,1860738147,1945798516,2029293177,1239331162,1120974935,1606591296,1422699085,4148292826,4233094615,3781033664,3931371469,3682191598,3497509347,3446004468,3328955385,2939266226,2755636671,3106780840,2988687269,2198438022,2282195339,2501218972,2652609425,1201765386,1286567175,1371368976,1521706781,1805211710,1620529459,2105887268,1988838185,533804130,350174575,164439672,46346101,870912086,954669403,636813900,788204353,2358957921,2274680428,2592523643,2441661558,2695033685,2880240216,3065962831,3182487618,3572145929,3756299780,3270937875,3388507166,4174560061,4091327024,4006521127,3854606378,1014646705,930369212,711349675,560487590,272786309,457992840,106852767,223377554,1678381017,1862534868,1914052035,2031621326,1211247597,1128014560,1580087799,1428173050,32283319,182621114,401639597,486441376,768917123,651868046,1003007129,818324884,1503449823,1385356242,1333838021,1150208456,1973745387,2125135846,1673061617,1756818940,2970356327,3120694122,2802849917,2887651696,2637442643,2520393566,2334669897,2149987652,3917234703,3799141122,4284502037,4100872472,3309594171,3460984630,3545789473,3629546796,2050466060,1899603969,1814803222,1730525723,1443857720,1560382517,1075025698,1260232239,575138148,692707433,878443390,1062597235,243256656,91341917,409198410,325965383,3403100636,3252238545,3704300486,3620022987,3874428392,3990953189,4042459122,4227665663,2460449204,2578018489,2226875310,2411029155,3198115200,3046200461,2827177882,2743944855],k=[0,218828297,437656594,387781147,875313188,958871085,775562294,590424639,1750626376,1699970625,1917742170,2135253587,1551124588,1367295589,1180849278,1265195639,3501252752,3720081049,3399941250,3350065803,3835484340,3919042237,4270507174,4085369519,3102249176,3051593425,2734591178,2952102595,2361698556,2177869557,2530391278,2614737639,3145456443,3060847922,2708326185,2892417312,2404901663,2187128086,2504130317,2555048196,3542330227,3727205754,3375740769,3292445032,3876557655,3926170974,4246310725,4027744588,1808481195,1723872674,1910319033,2094410160,1608975247,1391201670,1173430173,1224348052,59984867,244860394,428169201,344873464,935293895,984907214,766078933,547512796,1844882806,1627235199,2011214180,2062270317,1507497298,1423022939,1137477952,1321699145,95345982,145085239,532201772,313773861,830661914,1015671571,731183368,648017665,3175501286,2957853679,2807058932,2858115069,2305455554,2220981195,2474404304,2658625497,3575528878,3625268135,3473416636,3254988725,3778151818,3963161475,4213447064,4130281361,3599595085,3683022916,3432737375,3247465558,3802222185,4020912224,4172763771,4122762354,3201631749,3017672716,2764249623,2848461854,2331590177,2280796200,2431590963,2648976442,104699613,188127444,472615631,287343814,840019705,1058709744,671593195,621591778,1852171925,1668212892,1953757831,2037970062,1514790577,1463996600,1080017571,1297403050,3673637356,3623636965,3235995134,3454686199,4007360968,3822090177,4107101658,4190530515,2997825956,3215212461,2830708150,2779915199,2256734592,2340947849,2627016082,2443058075,172466556,122466165,273792366,492483431,1047239e3,861968209,612205898,695634755,1646252340,1863638845,2013908262,1963115311,1446242576,1530455833,1277555970,1093597963,1636604631,1820824798,2073724613,1989249228,1436590835,1487645946,1337376481,1119727848,164948639,81781910,331544205,516552836,1039717051,821288114,669961897,719700128,2973530695,3157750862,2871682645,2787207260,2232435299,2283490410,2667994737,2450346104,3647212047,3564045318,3279033885,3464042516,3980931627,3762502690,4150144569,4199882800,3070356634,3121275539,2904027272,2686254721,2200818878,2384911031,2570832044,2486224549,3747192018,3528626907,3310321856,3359936201,3950355702,3867060991,4049844452,4234721005,1739656202,1790575107,2108100632,1890328081,1402811438,1586903591,1233856572,1149249077,266959938,48394827,369057872,418672217,1002783846,919489135,567498868,752375421,209336225,24197544,376187827,459744698,945164165,895287692,574624663,793451934,1679968233,1764313568,2117360635,1933530610,1343127501,1560637892,1243112415,1192455638,3704280881,3519142200,3336358691,3419915562,3907448597,3857572124,4075877127,4294704398,3029510009,3113855344,2927934315,2744104290,2159976285,2377486676,2594734927,2544078150],S=[0,151849742,303699484,454499602,607398968,758720310,908999204,1059270954,1214797936,1097159550,1517440620,1400849762,1817998408,1699839814,2118541908,2001430874,2429595872,2581445614,2194319100,2345119218,3034881240,3186202582,2801699524,2951971274,3635996816,3518358430,3399679628,3283088770,4237083816,4118925222,4002861748,3885750714,1002142683,850817237,698445255,548169417,529487843,377642221,227885567,77089521,1943217067,2061379749,1640576439,1757691577,1474760595,1592394909,1174215055,1290801793,2875968315,2724642869,3111247143,2960971305,2405426947,2253581325,2638606623,2487810577,3808662347,3926825029,4044981591,4162096729,3342319475,3459953789,3576539503,3693126241,1986918061,2137062819,1685577905,1836772287,1381620373,1532285339,1078185097,1229899655,1040559837,923313619,740276417,621982671,439452389,322734571,137073913,19308535,3871163981,4021308739,4104605777,4255800159,3263785589,3414450555,3499326569,3651041127,2933202493,2815956275,3167684641,3049390895,2330014213,2213296395,2566595609,2448830231,1305906550,1155237496,1607244650,1455525988,1776460110,1626319424,2079897426,1928707164,96392454,213114376,396673818,514443284,562755902,679998e3,865136418,983426092,3708173718,3557504664,3474729866,3323011204,4180808110,4030667424,3945269170,3794078908,2507040230,2623762152,2272556026,2390325492,2975484382,3092726480,2738905026,2857194700,3973773121,3856137295,4274053469,4157467219,3371096953,3252932727,3673476453,3556361835,2763173681,2915017791,3064510765,3215307299,2156299017,2307622919,2459735317,2610011675,2081048481,1963412655,1846563261,1729977011,1480485785,1362321559,1243905413,1126790795,878845905,1030690015,645401037,796197571,274084841,425408743,38544885,188821243,3613494426,3731654548,3313212038,3430322568,4082475170,4200115116,3780097726,3896688048,2668221674,2516901860,2366882550,2216610296,3141400786,2989552604,2837966542,2687165888,1202797690,1320957812,1437280870,1554391400,1669664834,1787304780,1906247262,2022837584,265905162,114585348,499347990,349075736,736970802,585122620,972512814,821712160,2595684844,2478443234,2293045232,2174754046,3196267988,3079546586,2895723464,2777952454,3537852828,3687994002,3234156416,3385345166,4142626212,4293295786,3841024952,3992742070,174567692,57326082,410887952,292596766,777231668,660510266,1011452712,893681702,1108339068,1258480242,1343618912,1494807662,1715193156,1865862730,1948373848,2100090966,2701949495,2818666809,3004591147,3122358053,2235061775,2352307457,2535604243,2653899549,3915653703,3764988233,4219352155,4067639125,3444575871,3294430577,3746175075,3594982253,836553431,953270745,600235211,718002117,367585007,484830689,133361907,251657213,2041877159,1891211689,1806599355,1654886325,1568718495,1418573201,1335535747,1184342925];function A(e){for(var t=[],r=0;r>2,this._Ke[r][t%4]=i[t],this._Kd[e-r][t%4]=i[t];for(var o,c=0,f=a;f>16&255]<<24^b[o>>8&255]<<16^b[255&o]<<8^b[o>>24&255]^u[c]<<24,c+=1,8!=a)for(t=1;t>8&255]<<8^b[o>>16&255]<<16^b[o>>24&255]<<24;for(t=a/2+1;t>2,h=f%4,this._Ke[d][h]=i[t],this._Kd[e-d][h]=i[t++],f++}for(var d=1;d>24&255]^M[o>>16&255]^k[o>>8&255]^S[255&o]},E.prototype.encrypt=function(e){if(16!=e.length)throw new Error("invalid plaintext size (must be 16 bytes)");for(var t=this._Ke.length-1,r=[0,0,0,0],n=A(e),a=0;a<4;a++)n[a]^=this._Ke[0][a];for(var o=1;o>24&255]^p[n[(a+1)%4]>>16&255]^m[n[(a+2)%4]>>8&255]^x[255&n[(a+3)%4]]^this._Ke[o][a];n=r.slice()}var c,f=i(16);for(a=0;a<4;a++)c=this._Ke[t][a],f[4*a]=255&(b[n[a]>>24&255]^c>>24),f[4*a+1]=255&(b[n[(a+1)%4]>>16&255]^c>>16),f[4*a+2]=255&(b[n[(a+2)%4]>>8&255]^c>>8),f[4*a+3]=255&(b[255&n[(a+3)%4]]^c);return f},E.prototype.decrypt=function(e){if(16!=e.length)throw new Error("invalid ciphertext size (must be 16 bytes)");for(var t=this._Kd.length-1,r=[0,0,0,0],n=A(e),a=0;a<4;a++)n[a]^=this._Kd[0][a];for(var o=1;o>24&255]^v[n[(a+3)%4]>>16&255]^g[n[(a+2)%4]>>8&255]^w[255&n[(a+1)%4]]^this._Kd[o][a];n=r.slice()}var c,f=i(16);for(a=0;a<4;a++)c=this._Kd[t][a],f[4*a]=255&(h[n[a]>>24&255]^c>>24),f[4*a+1]=255&(h[n[(a+3)%4]>>16&255]^c>>16),f[4*a+2]=255&(h[n[(a+2)%4]>>8&255]^c>>8),f[4*a+3]=255&(h[255&n[(a+1)%4]]^c);return f};var O=function e(t){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");this.description="Electronic Code Block",this.name="ecb",this._aes=new E(t)};O.prototype.encrypt=function(e){if((e=a(e)).length%16!=0)throw new Error("invalid plaintext size (must be multiple of 16 bytes)");for(var t=i(e.length),r=i(16),n=0;nNumber.MAX_SAFE_INTEGER)throw new Error("integer value out of safe range");for(var t=15;t>=0;--t)this._counter[t]=e%256,e=parseInt(e/256)},B.prototype.setBytes=function(e){if(16!=(e=a(e,!0)).length)throw new Error("invalid counter bytes size (must be 16 bytes)");this._counter=e},B.prototype.increment=function(){for(var e=15;e>=0;e--){if(255!==this._counter[e]){this._counter[e]++;break}this._counter[e]=0}};var R=function e(t,r){if(!(this instanceof e))throw Error("AES must be instanitated with `new`");this.description="Counter",this.name="ctr",r instanceof B||(r=new B(r)),this._counter=r,this._remainingCounter=null,this._remainingCounterIndex=16,this._aes=new E(t)};R.prototype.encrypt=function(e){for(var t=a(e,!0),r=0;r16)throw new Error("PKCS#7 padding byte out of range");for(var r=e.length-t,n=0;n=0;f--)(i=e[f])&&(c=(o<3?i(c):o>3?i(t,r,c):i(t,r))||c);return o>3&&c&&Object.defineProperty(t,r,c),c};Object.defineProperty(t,"__esModule",{value:!0}),t.NativeSvr=void 0;var i=r(5),o=r(115),c=r(97),f=function(){function e(){this._event=o.createWalletEvents()}return e.prototype._subscribeToResponse=function(e,t){this._event.on("response:"+e,t)},e.prototype._subscribeToCallResponse=function(e){var t=this;return new Promise((function(r,n){t._subscribeToResponse(e,(function(e){e.errcode?n(e.errcode):r(e.data)}))}))},e.prototype.handleNativeCallback=function(){for(var e=[],t=0;t=0;f--)(i=e[f])&&(c=(o<3?i(c):o>3?i(t,r,c):i(t,r))||c);return o>3&&c&&Object.defineProperty(t,r,c),c};Object.defineProperty(t,"__esModule",{value:!0}),t.WalletEnv=void 0;var i=r(115),o=r(97),c=function(){function e(){this.handler=i.createWalletEvents()}return e=a([o.singleton],e)}();t.WalletEnv=c},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.abiERC1155=void 0,t.abiERC1155=[{inputs:[{internalType:"string",name:"uri_",type:"string"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256[]",name:"ids",type:"uint256[]"},{indexed:!1,internalType:"uint256[]",name:"values",type:"uint256[]"}],name:"TransferBatch",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"TransferSingle",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"value",type:"string"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"URI",type:"event"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"accounts",type:"address[]"},{internalType:"uint256[]",name:"ids",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"uri",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}]},function(e,t,r){"use strict";var n,a=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WalletConnect=void 0;var o=i(r(852)),c=r(752),f=function(e){function t(t,r){return e.call(this,{cryptoLib:c,connectorOpts:t,pushServerOpts:r})||this}return a(t,e),t.getInstance=function(e,r){return this._instance||(this._instance=new t(e,r)),this._instance},t}(o.default);t.WalletConnect=f},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),a(r(755),t),a(r(756),t),a(r(757),t),a(r(335),t),a(r(758),t)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LENGTH_1024=t.LENGTH_512=t.LENGTH_256=t.LENGTH_128=t.LENGTH_64=t.LENGTH_32=t.LENGTH_16=t.LENGTH_1=t.LENGTH_0=void 0,t.LENGTH_0=0,t.LENGTH_1=1,t.LENGTH_16=16,t.LENGTH_32=32,t.LENGTH_64=64,t.LENGTH_128=128,t.LENGTH_256=256,t.LENGTH_512=512,t.LENGTH_1024=1024},function(e,t,r){"use strict";var n=function(e,t){return function(){for(var r=this,n=t.promiseModule,a=new Array(arguments.length),i=0;i-1&&e%1==0&&e<=9007199254740991}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={},e.exports=t.default},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return function(t,r,f){if(f=(0,a.default)(f||n.default),e<=0||!t)return f(null);var d=(0,i.default)(t),s=!1,u=0,b=!1;function h(e,t){if(u-=1,e)s=!0,f(e);else{if(t===c.default||s&&u<=0)return s=!0,f(null);b||l()}}function l(){for(b=!0;u=e.params.length?e.params:"eth_getBlockByNumber"===e.method?e.params.slice(1):e.params.slice(0,t)}function o(e){switch(e.method){case"eth_getStorageAt":return 2;case"eth_getBalance":case"eth_getCode":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":return 1;case"eth_getBlockByNumber":return 0;default:return}}function c(e){switch(e.method){case"web3_clientVersion":case"web3_sha3":case"eth_protocolVersion":case"eth_getBlockTransactionCountByHash":case"eth_getUncleCountByBlockHash":case"eth_getCode":case"eth_getBlockByHash":case"eth_getTransactionByHash":case"eth_getTransactionByBlockHashAndIndex":case"eth_getTransactionReceipt":case"eth_getUncleByBlockHashAndIndex":case"eth_getCompilers":case"eth_compileLLL":case"eth_compileSolidity":case"eth_compileSerpent":case"shh_version":return"perma";case"eth_getBlockByNumber":case"eth_getBlockTransactionCountByNumber":case"eth_getUncleCountByBlockNumber":case"eth_getTransactionByBlockNumberAndIndex":case"eth_getUncleByBlockNumberAndIndex":return"fork";case"eth_gasPrice":case"eth_getBalance":case"eth_getStorageAt":case"eth_getTransactionCount":case"eth_call":case"eth_estimateGas":case"eth_getFilterLogs":case"eth_getLogs":case"eth_blockNumber":return"block";case"net_version":case"net_peerCount":case"net_listening":case"eth_syncing":case"eth_sign":case"eth_coinbase":case"eth_mining":case"eth_hashrate":case"eth_accounts":case"eth_sendTransaction":case"eth_sendRawTransaction":case"eth_newFilter":case"eth_newBlockFilter":case"eth_newPendingTransactionFilter":case"eth_uninstallFilter":case"eth_getFilterChanges":case"eth_getWork":case"eth_submitWork":case"eth_submitHashrate":case"db_putString":case"db_getString":case"db_putHex":case"db_getHex":case"shh_post":case"shh_newIdentity":case"shh_hasIdentity":case"shh_newGroup":case"shh_addToGroup":case"shh_newFilter":case"shh_uninstallFilter":case"shh_getFilterChanges":case"shh_getMessages":return"never"}}e.exports={cacheIdentifierForPayload:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!a(e))return null;var r=t.includeBlockRef,o=r?e.params:i(e);return e.method+":"+n(o)},canCache:a,blockTagForPayload:function(e){var t=o(e);if(t>=e.params.length)return null;return e.params[t]},paramsWithoutBlockTag:i,blockTagParamIndex:o,cacheTypeForPayload:c}},function(e,t,r){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a="undefined"!=typeof JSON?JSON:r(803);e.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r=t.space||"";"number"==typeof r&&(r=Array(r+1).join(" "));var c,f="boolean"==typeof t.cycles&&t.cycles,d=t.replacer||function(e,t){return t},s=t.cmp&&(c=t.cmp,function(e){return function(t,r){var n={key:t,value:e[t]},a={key:r,value:e[r]};return c(n,a)}}),u=[];return function e(t,c,b,h){var l=r?"\n"+new Array(h+1).join(r):"",p=r?": ":":";if(b&&b.toJSON&&"function"==typeof b.toJSON&&(b=b.toJSON()),void 0!==(b=d.call(t,c,b))){if("object"!==n(b)||null===b)return a.stringify(b);if(i(b)){for(var m=[],x=0;x=0;--a){var i=this.tryEntries[a],o=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),f=r.call(i,"finallyLoc");if(c&&f){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),k(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;k(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:A(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),b}},e}function i(e,t,r,n,a,i,o){try{var c=e[i](o),f=c.value}catch(e){return void r(e)}c.done?t(f):Promise.resolve(f).then(n,a)}function o(e){return function(){var t=this,r=arguments;return new Promise((function(n,a){var o=e.apply(t,r);function c(e){i(o,n,a,c,f,"next",e)}function f(e){i(o,n,a,c,f,"throw",e)}c(void 0)}))}}var c=r(853).Mutex,f=r(351).createAsyncMiddleware,d=r(355),s=r(821),u=r(824),b=r(825),h=r(91),l=h.intToHex,p=h.hexToInt;function m(e){return x(o(a().mark((function t(){var r,n,i=arguments;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.apply(void 0,i);case 2:return r=t.sent,n=l(r.id),t.abrupt("return",n);case 5:case"end":return t.stop()}}),t)}))))}function x(e){return f(function(){var t=o(a().mark((function t(r,n){var i;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.apply(null,r.params);case 2:i=t.sent,n.result=i;case 4:case"end":return t.stop()}}),t)})));return function(e,r){return t.apply(this,arguments)}}())}function y(e,t){var r=[];for(var n in e)r.push(e[n]);return r}e.exports=function(e){var t=e.blockTracker,r=e.provider,n=0,i={},f=new c,h=function(e){var t=e.mutex;return function(e){return function(){var r=o(a().mark((function r(n,i,o,c){return a().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.acquire();case 2:(0,r.sent)(),e(n,i,o,c);case 5:case"end":return r.stop()}}),r)})));return function(e,t,n,a){return r.apply(this,arguments)}}()}}({mutex:f}),v=d({eth_newFilter:h(m(w)),eth_newBlockFilter:h(m(M)),eth_newPendingTransactionFilter:h(m(S)),eth_uninstallFilter:h(x(j)),eth_getFilterChanges:h(x(E)),eth_getFilterLogs:h(x(T))}),g=function(){var e=o(a().mark((function e(t){var r,n,c;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.oldBlock,n=t.newBlock,0!==i.length){e.next=3;break}return e.abrupt("return");case 3:return e.next=5,f.acquire();case 5:return c=e.sent,e.prev=6,e.next=9,Promise.all(y(i).map(function(){var e=o(a().mark((function e(t){return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.update({oldBlock:r,newBlock:n});case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.error(e.t0);case 8:case"end":return e.stop()}}),e,null,[[0,5]])})));return function(t){return e.apply(this,arguments)}}()));case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),console.error(e.t0);case 14:c();case 15:case"end":return e.stop()}}),e,null,[[6,11]])})));return function(t){return e.apply(this,arguments)}}();return v.newLogFilter=w,v.newBlockFilter=M,v.newPendingTransactionFilter=S,v.uninstallFilter=j,v.getFilterChanges=E,v.getFilterLogs=T,v.destroy=function(){!function(){N.apply(this,arguments)}()},v;function w(e){return _.apply(this,arguments)}function _(){return(_=o(a().mark((function e(t){var n;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=new s({provider:r,params:t}),e.next=3,R(n);case 3:return e.sent,e.abrupt("return",n);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function M(){return k.apply(this,arguments)}function k(){return(k=o(a().mark((function e(){var t;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new u({provider:r}),e.next=3,R(t);case 3:return e.sent,e.abrupt("return",t);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function S(){return A.apply(this,arguments)}function A(){return(A=o(a().mark((function e(){var t;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=new b({provider:r}),e.next=3,R(t);case 3:return e.sent,e.abrupt("return",t);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function E(e){return O.apply(this,arguments)}function O(){return(O=o(a().mark((function e(t){var r,n,o;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=p(t),n=i[r]){e.next=4;break}throw new Error('No filter for index "'.concat(r,'"'));case 4:return o=n.getChangesAndClear(),e.abrupt("return",o);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function T(e){return P.apply(this,arguments)}function P(){return(P=o(a().mark((function e(t){var r,n;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=p(t),n=i[r]){e.next=4;break}throw new Error('No filter for index "'.concat(r,'"'));case 4:return"log"===n.type?results=n.getAllResults():results=[],e.abrupt("return",results);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function j(e){return B.apply(this,arguments)}function B(){return(B=o(a().mark((function e(t){var r,n,o;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=p(t),n=i[r],!(o=Boolean(n))){e.next=6;break}return e.next=6,I(r);case 6:return e.abrupt("return",o);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function R(e){return C.apply(this,arguments)}function C(){return(C=o(a().mark((function e(r){var o,c,f;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=y(i).length,e.next=3,t.getLatestBlock();case 3:return c=e.sent,e.next=6,r.initialize({currentBlock:c});case 6:return n++,i[n]=r,r.id=n,r.idHex=l(n),f=y(i).length,U({prevFilterCount:o,newFilterCount:f}),e.abrupt("return",n);case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function I(e){return L.apply(this,arguments)}function L(){return(L=o(a().mark((function e(t){var r,n;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=y(i).length,delete i[t],n=y(i).length,U({prevFilterCount:r,newFilterCount:n});case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function N(){return(N=o(a().mark((function e(){var t;return a().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=y(i).length,i={},U({prevFilterCount:t,newFilterCount:0});case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function U(e){var r=e.prevFilterCount,n=e.newFilterCount;0===r&&n>0?t.on("sync",g):r>0&&0===n&&t.removeListener("sync",g)}}},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),a(r(813),t),a(r(814),t),a(r(815),t),a(r(352),t),a(r(353),t),a(r(819),t)},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getUniqueId=void 0;var n=Math.floor(4294967295*Math.random());t.getUniqueId=function(){return n=(n+1)%4294967295}},function(e,t,r){"use strict";function n(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=c(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,a=function(){};return{s:a,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,f=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){f=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(f)throw i}}}}function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",c=n.asyncIterator||"@@asyncIterator",f=n.toStringTag||"@@toStringTag";function d(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(e){d=function(e,t,r){return e[t]=r}}function s(e,t,r,n){var a=t&&t.prototype instanceof h?t:h,i=Object.create(a.prototype),o=new S(n||[]);return i._invoke=function(e,t,r){var n="suspendedStart";return function(a,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===a)throw i;return E()}for(r.method=a,r.arg=i;;){var o=r.delegate;if(o){var c=_(o,r);if(c){if(c===b)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var f=u(e,t,r);if("normal"===f.type){if(n=r.done?"completed":"suspendedYield",f.arg===b)continue;return{value:f.arg,done:r.done}}"throw"===f.type&&(n="completed",r.method="throw",r.arg=f.arg)}}}(e,r,o),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var b={};function h(){}function l(){}function p(){}var m={};d(m,o,(function(){return this}));var x=Object.getPrototypeOf,y=x&&x(x(A([])));y&&y!==t&&r.call(y,o)&&(m=y);var v=p.prototype=h.prototype=Object.create(m);function g(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function w(e,t){var n;this._invoke=function(i,o){function c(){return new t((function(n,c){!function n(i,o,c,f){var d=u(e[i],e,o);if("throw"!==d.type){var s=d.arg,b=s.value;return b&&"object"==a(b)&&r.call(b,"__await")?t.resolve(b.__await).then((function(e){n("next",e,c,f)}),(function(e){n("throw",e,c,f)})):t.resolve(b).then((function(e){s.value=e,c(s)}),(function(e){return n("throw",e,c,f)}))}f(d.arg)}(i,o,n,c)}))}return n=n?n.then(c,c):c()}}function _(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,_(e,t),"throw"===t.method))return b;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return b}var n=u(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,b;var a=n.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,b):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,b)}function M(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(M,this),this.reset(!0)}function A(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function t(){for(;++n=0;--a){var i=this.tryEntries[a],o=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),f=r.call(i,"finallyLoc");if(c&&f){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),k(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;k(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:A(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),b}},e}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==r)return;var n,a,i=[],o=!0,c=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);o=!0);}catch(e){c=!0,a=e}finally{try{o||null==r.return||r.return()}finally{if(c)throw a}}return i}(e,t)||c(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){if(e){if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?f(e,t):void 0}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:c;if(Number.isInteger(e)){var n=e.toString();if(h(a.errorValues,n))return a.errorValues[n].message;if(u(e))return t.JSON_RPC_SERVER_ERROR_MESSAGE}return r}function s(e){if(!Number.isInteger(e))return!1;var t=e.toString();return!!a.errorValues[t]||!!u(e)}function u(e){return e>=-32099&&e<=-32e3}function b(e){return e&&"object"===n(e)&&!Array.isArray(e)?Object.assign({},e):e}function h(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=d,t.isValidCode=s,t.serializeError=function(e){var t,r,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=a.fallbackError,c=void 0===o?f:o,u=a.shouldIncludeStack,l=void 0!==u&&u;if(!c||!Number.isInteger(c.code)||"string"!=typeof c.message)throw new Error("Must provide fallback error with integer number code and string message.");if(e instanceof i.EthereumRpcError)return e.serialize();var p={};if(e&&"object"===n(e)&&!Array.isArray(e)&&h(e,"code")&&s(e.code)){var m=e;p.code=m.code,m.message&&"string"==typeof m.message?(p.message=m.message,h(m,"data")&&(p.data=m.data)):(p.message=d(p.code),p.data={originalError:b(e)})}else{p.code=c.code;var x=null===(t=e)||void 0===t?void 0:t.message;p.message=x&&"string"==typeof x?x:c.message,p.data={originalError:b(e)}}var y=null===(r=e)||void 0===r?void 0:r.stack;return l&&e&&y&&"string"==typeof y&&(p.stack=y),p}},function(e,t,r){e.exports=r(820)},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{f(n.next(e))}catch(e){i(e)}}function c(e){try{f(n.throw(e))}catch(e){i(e)}}function f(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}f((n=n.apply(e,t||[])).next())}))},a=this&&this.__generator||function(e,t){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=o.trys,(a=a.length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]=a)n="0."+n;else{var i=a-t;n=n.slice(0,i)+"."+n.slice(i)}return n=n.slice(0,n.lastIndexOf(".")+r+1)},t.toHexChainId=function(e){return"0x"+e.toString(16)},t.getTypeByAddress=function(e,r){var n=i.DEFAULT_NFT_TYPES[e],a=t.UNKNOW,o="erc721";if(n)for(var c in n)n[c]&&n[c].address===r&&(a=c,o=n[c].type);return{categor:a,type:o}},t.getJCErc721Info=function(e){return n(this,void 0,void 0,(function(){var t;return a(this,(function(r){return t=""+i.BASE_TOKEN_URI+e,[2,fetch(t).then((function(e){return e.json()}))]}))}))}},function(e,t,r){"use strict";r.r(t),r.d(t,"ConstructorFragment",(function(){return P})),r.d(t,"ErrorFragment",(function(){return R})),r.d(t,"EventFragment",(function(){return A})),r.d(t,"Fragment",(function(){return S})),r.d(t,"FunctionFragment",(function(){return j})),r.d(t,"ParamType",(function(){return M})),r.d(t,"FormatTypes",(function(){return w})),r.d(t,"AbiCoder",(function(){return Ct})),r.d(t,"defaultAbiCoder",(function(){return It})),r.d(t,"Interface",(function(){return er})),r.d(t,"Indexed",(function(){return Yt})),r.d(t,"checkResultErrors",(function(){return D})),r.d(t,"LogDescription",(function(){return Zt})),r.d(t,"TransactionDescription",(function(){return Jt}));var n=r(47),a=r(10),i=r(3);function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}function f(e,t){return(f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function d(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=u(e);if(t){var a=u(this).constructor;r=Reflect.construct(n,arguments,a)}else r=n.apply(this,arguments);return s(this,r)}}function s(e,t){if(t&&("object"===o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function b(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function h(e,t){for(var r=0;r=0||"tuple"===e)&&y[t])return!0;return(x[t]||"payable"===t)&&p.throwArgumentError("invalid modifier","name",t),!1}function g(e,t){for(var r in t)Object(a.c)(e,r,t[r])}var w=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),_=new RegExp(/^(.*)\[([0-9]*)\]$/),M=function(){function e(t,r){b(this,e),t!==m&&p.throwError("use fromString",i.a.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),g(this,r);var n=this.type.match(_);g(this,n?{arrayLength:parseInt(n[2]||"-1"),arrayChildren:e.fromObject({type:n[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}return l(e,[{key:"format",value:function(e){if(e||(e=w.sighash),w[e]||p.throwArgumentError("invalid format type","format",e),e===w.json){var t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((function(t){return JSON.parse(t.format(e))}))),JSON.stringify(t)}var r="";return"array"===this.baseType?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==w.sighash&&(r+=this.type),r+="("+this.components.map((function(t){return t.format(e)})).join(e===w.full?", ":",")+")"):r+=this.type,e!==w.sighash&&(!0===this.indexed&&(r+=" indexed"),e===w.full&&this.name&&(r+=" "+this.name)),r}}],[{key:"from",value:function(t,r){return"string"==typeof t?e.fromString(t,r):e.fromObject(t)}},{key:"fromObject",value:function(t){return e.isParamType(t)?t:new e(m,{name:t.name||null,type:C(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(e.fromObject):null})}},{key:"fromString",value:function(t,r){return function(t){return e.fromObject({name:t.name,type:t.type,indexed:t.indexed,components:t.components})}(function(e,t){var r=e;function n(t){p.throwArgumentError("unexpected character at position ".concat(t),"param",e)}function a(e){var r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");for(var i={type:"",name:"",state:{allowType:!0}},o=i,c=0;c2&&p.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||p.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=n.a.from(r[1]),r[0]):e}function O(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((function(e){switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function T(e){var t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&p.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&p.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||p.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&p.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&p.throwArgumentError("unable to determine stateMutability","value",e),t}var P=function(e){c(r,e);var t=d(r);function r(){return b(this,r),t.apply(this,arguments)}return l(r,[{key:"format",value:function(e){if(e||(e=w.sighash),w[e]||p.throwArgumentError("invalid format type","format",e),e===w.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((function(t){return JSON.parse(t.format(e))}))});e===w.sighash&&p.throwError("cannot format a constructor for sighash",i.a.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});var t="constructor("+this.inputs.map((function(t){return t.format(e)})).join(e===w.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}}],[{key:"from",value:function(e){return"string"==typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isConstructorFragment(e))return e;"constructor"!==e.type&&p.throwArgumentError("invalid constructor object","value",e);var t=T(e);t.constant&&p.throwArgumentError("constructor cannot be constant","value",e);var a={name:null,type:e.type,inputs:e.inputs?e.inputs.map(M.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?n.a.from(e.gas):null};return new r(m,a)}},{key:"fromString",value:function(e){var t={type:"constructor"},n=(e=E(e,t)).match(N);return n&&"constructor"===n[1].trim()||p.throwArgumentError("invalid constructor string","value",e),t.inputs=k(n[2].trim(),!1),O(n[3].trim(),t),r.fromObject(t)}},{key:"isConstructorFragment",value:function(e){return e&&e._isFragment&&"constructor"===e.type}}]),r}(S),j=function(e){c(r,e);var t=d(r);function r(){return b(this,r),t.apply(this,arguments)}return l(r,[{key:"format",value:function(e){if(e||(e=w.sighash),w[e]||p.throwArgumentError("invalid format type","format",e),e===w.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((function(t){return JSON.parse(t.format(e))})),outputs:this.outputs.map((function(t){return JSON.parse(t.format(e))}))});var t="";return e!==w.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===w.full?", ":",")+") ",e!==w.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((function(t){return t.format(e)})).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}}],[{key:"from",value:function(e){return"string"==typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isFunctionFragment(e))return e;"function"!==e.type&&p.throwArgumentError("invalid function object","value",e);var t=T(e),a={type:e.type,name:L(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(M.fromObject):[],outputs:e.outputs?e.outputs.map(M.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?n.a.from(e.gas):null};return new r(m,a)}},{key:"fromString",value:function(e){var t={type:"function"},n=(e=E(e,t)).split(" returns ");n.length>2&&p.throwArgumentError("invalid function string","value",e);var a=n[0].match(N);if(a||p.throwArgumentError("invalid function signature","value",e),t.name=a[1].trim(),t.name&&L(t.name),t.inputs=k(a[2],!1),O(a[3].trim(),t),n.length>1){var i=n[1].match(N);""==i[1].trim()&&""==i[3].trim()||p.throwArgumentError("unexpected tokens","value",e),t.outputs=k(i[2],!1)}else t.outputs=[];return r.fromObject(t)}},{key:"isFunctionFragment",value:function(e){return e&&e._isFragment&&"function"===e.type}}]),r}(P);function B(e){var t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||p.throwArgumentError("cannot specify user defined ".concat(t," error"),"fragment",e),e}var R=function(e){c(r,e);var t=d(r);function r(){return b(this,r),t.apply(this,arguments)}return l(r,[{key:"format",value:function(e){if(e||(e=w.sighash),w[e]||p.throwArgumentError("invalid format type","format",e),e===w.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))});var t="";return e!==w.sighash&&(t+="error "),(t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===w.full?", ":",")+") ").trim()}}],[{key:"from",value:function(e){return"string"==typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isErrorFragment(e))return e;"error"!==e.type&&p.throwArgumentError("invalid error object","value",e);var t={type:e.type,name:L(e.name),inputs:e.inputs?e.inputs.map(M.fromObject):[]};return B(new r(m,t))}},{key:"fromString",value:function(e){var t={type:"error"},n=e.match(N);return n||p.throwArgumentError("invalid error signature","value",e),t.name=n[1].trim(),t.name&&L(t.name),t.inputs=k(n[2],!1),B(r.fromObject(t))}},{key:"isErrorFragment",value:function(e){return e&&e._isFragment&&"error"===e.type}}]),r}(S);function C(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}var I=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function L(e){return e&&e.match(I)||p.throwArgumentError('invalid identifier "'.concat(e,'"'),"value",e),e}var N=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");var U=r(1);function z(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function F(e,t){for(var r=0;rthis.wordSize&&H.throwError("value out-of-bounds",i.a.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=Object(U.b)([this._padding.slice(t.length%this.wordSize),t])),t}},{key:"writeValue",value:function(e){return this._writeData(this._getValue(e))}},{key:"writeUpdatableValue",value:function(){var e=this,t=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,function(r){e._data[t]=e._getValue(r)}}}]),e}(),W=function(){function e(t,r,n,i){z(this,e),Object(a.c)(this,"_data",Object(U.a)(t)),Object(a.c)(this,"wordSize",r||32),Object(a.c)(this,"_coerceFunc",n),Object(a.c)(this,"allowLoose",i),this._offset=0}return q(e,[{key:"data",get:function(){return Object(U.g)(this._data)}},{key:"consumed",get:function(){return this._offset}},{key:"coerce",value:function(t,r){return this._coerceFunc?this._coerceFunc(t,r):e.coerce(t,r)}},{key:"_peekBytes",value:function(e,t,r){var n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:H.throwError("data out-of-bounds",i.a.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}},{key:"subReader",value:function(t){return new e(this._data.slice(this._offset+t),this.wordSize,this._coerceFunc,this.allowLoose)}},{key:"readBytes",value:function(e,t){var r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}},{key:"readValue",value:function(){return n.a.from(this.readBytes(this.wordSize))}}],[{key:"coerce",value:function(e,t){var r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}}]),e}(),V=r(33);function Z(e){return(Z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function J(e,t){for(var r=0;r=0?t:"")+"]",c=-1===t||e.dynamic;return(n=a.call(this,"array",i,r,c)).coder=e,n.length=t,n}return t=o,(r=[{key:"defaultValue",value:function(){for(var e=this.coder.defaultValue(),t=[],r=0;re._data.length&&le.throwError("insufficient data length",i.a.errors.BUFFER_OVERRUN,{length:e._data.length,count:t});for(var r=[],n=0;n>6==2;o++)i++;return i}return e===ot.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(it||(it={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(ot||(ot={}));var st=Object.freeze({error:function(e,t,r,n,a){return ft.throwArgumentError("invalid codepoint at offset ".concat(t,"; ").concat(e),"bytes",r)},ignore:dt,replace:function(e,t,r,n,a){return e===ot.OVERLONG?(n.push(a),0):(n.push(65533),dt(e,t,r))}});function ut(e,t){null==t&&(t=st.error),e=Object(U.a)(e);for(var r=[],n=0;n>7!=0){var i=null,o=null;if(192==(224&a))i=1,o=127;else if(224==(240&a))i=2,o=2047;else{if(240!=(248&a)){n+=t(128==(192&a)?ot.UNEXPECTED_CONTINUE:ot.BAD_PREFIX,n-1,e,r);continue}i=3,o=65535}if(n-1+i>=e.length)n+=t(ot.OVERRUN,n-1,e,r);else{for(var c=a&(1<<8-i-1)-1,f=0;f1114111?n+=t(ot.OUT_OF_RANGE,n-1-i,e,r,c):c>=55296&&c<=57343?n+=t(ot.UTF16_SURROGATE,n-1-i,e,r,c):c<=o?n+=t(ot.OVERLONG,n-1-i,e,r,c):r.push(c))}}else r.push(a)}return r}function bt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:it.current;t!=it.current&&(ft.checkNormalize(),e=e.normalize(t));for(var r=[],n=0;n>6|192),r.push(63&a|128);else if(55296==(64512&a)){n++;var i=e.charCodeAt(n);if(n>=e.length||56320!=(64512&i))throw new Error("invalid utf-8 string");var o=65536+((1023&a)<<10)+(1023&i);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(63&o|128)}else r.push(a>>12|224),r.push(a>>6&63|128),r.push(63&a|128)}return Object(U.a)(r)}function ht(e,t){return ut(e,t).map((function(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e)))})).join("")}function lt(e){return(lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function pt(e,t){for(var r=0;r256||n%8!=0)&&jt.throwArgumentError("invalid "+r[1]+" bit length","param",e),new ct(n/8,"int"===r[1],e.name)}if(r=e.type.match(Bt)){var a=parseInt(r[1]);return(0===a||a>32)&&jt.throwArgumentError("invalid bytes length","param",e),new Ke(a,e.name)}return jt.throwArgumentError("invalid type","type",e.type)}},{key:"_getWordSize",value:function(){return 32}},{key:"_getReader",value:function(e,t){return new W(e,this._getWordSize(),this.coerceFunc,t)}},{key:"_getWriter",value:function(){return new G(this._getWordSize())}},{key:"getDefaultValue",value:function(e){var t=this,r=e.map((function(e){return t._getCoder(M.from(e))}));return new Tt(r,"_").defaultValue()}},{key:"encode",value:function(e,t){var r=this;e.length!==t.length&&jt.throwError("types/values length mismatch",i.a.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});var n=e.map((function(e){return r._getCoder(M.from(e))})),a=new Tt(n,"_"),o=this._getWriter();return a.encode(o,t),o.data}},{key:"decode",value:function(e,t,r){var n=this,a=e.map((function(e){return n._getCoder(M.from(e))}));return new Tt(a,"_").decode(this._getReader(Object(U.a)(t),r))}}])&&Pt(t.prototype,r),n&&Pt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),It=new Ct,Lt=r(20);function Nt(e){return Object(Lt.a)(bt(e))}function Ut(e){return(Ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function zt(e,t){for(var r=0;r1&&Vt.throwArgumentError("multiple matching functions","name",r),this.functions[n[0]]}var a=this.functions[j.fromString(e).format()];return a||Vt.throwArgumentError("no matching function","signature",e),a}},{key:"getEvent",value:function(e){if(Object(U.j)(e)){var t=e.toLowerCase();for(var r in this.events)if(t===this.getEventTopic(r))return this.events[r];Vt.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){var n=e.trim(),a=Object.keys(this.events).filter((function(e){return e.split("(")[0]===n}));return 0===a.length?Vt.throwArgumentError("no matching event","name",n):a.length>1&&Vt.throwArgumentError("multiple matching events","name",n),this.events[a[0]]}var i=this.events[A.fromString(e).format()];return i||Vt.throwArgumentError("no matching event","signature",e),i}},{key:"getError",value:function(e){if(Object(U.j)(e)){var t=Object(a.d)(this.constructor,"getSighash");for(var r in this.errors){if(e===t(this.errors[r]))return this.errors[r]}Vt.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){var n=e.trim(),i=Object.keys(this.errors).filter((function(e){return e.split("(")[0]===n}));return 0===i.length?Vt.throwArgumentError("no matching error","name",n):i.length>1&&Vt.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}var o=this.errors[j.fromString(e).format()];return o||Vt.throwArgumentError("no matching error","signature",e),o}},{key:"getSighash",value:function(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return Object(a.d)(this.constructor,"getSighash")(e)}},{key:"getEventTopic",value:function(e){return"string"==typeof e&&(e=this.getEvent(e)),Object(a.d)(this.constructor,"getEventTopic")(e)}},{key:"_decodeParams",value:function(e,t){return this._abiCoder.decode(e,t)}},{key:"_encodeParams",value:function(e,t){return this._abiCoder.encode(e,t)}},{key:"encodeDeploy",value:function(e){return this._encodeParams(this.deploy.inputs,e||[])}},{key:"decodeErrorResult",value:function(e,t){"string"==typeof e&&(e=this.getError(e));var r=Object(U.a)(t);return Object(U.g)(r.slice(0,4))!==this.getSighash(e)&&Vt.throwArgumentError("data signature does not match error ".concat(e.name,"."),"data",Object(U.g)(r)),this._decodeParams(e.inputs,r.slice(4))}},{key:"encodeErrorResult",value:function(e,t){return"string"==typeof e&&(e=this.getError(e)),Object(U.g)(Object(U.b)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionData",value:function(e,t){"string"==typeof e&&(e=this.getFunction(e));var r=Object(U.a)(t);return Object(U.g)(r.slice(0,4))!==this.getSighash(e)&&Vt.throwArgumentError("data signature does not match function ".concat(e.name,"."),"data",Object(U.g)(r)),this._decodeParams(e.inputs,r.slice(4))}},{key:"encodeFunctionData",value:function(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Object(U.g)(Object(U.b)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionResult",value:function(e,t){"string"==typeof e&&(e=this.getFunction(e));var r=Object(U.a)(t),n=null,a="",o=null,c=null,f=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(u){}break;case 4:var d=Object(U.g)(r.slice(0,4)),s=$t[d];if(s)o=this._abiCoder.decode(s.inputs,r.slice(4)),c=s.name,f=s.signature,s.reason&&(n=o[0]),"Error"===c?a="; VM Exception while processing transaction: reverted with reason string ".concat(JSON.stringify(o[0])):"Panic"===c&&(a="; VM Exception while processing transaction: reverted with panic code ".concat(o[0]));else try{var u=this.getError(d);o=this._abiCoder.decode(u.inputs,r.slice(4)),c=u.name,f=u.format()}catch(u){}}return Vt.throwError("call revert exception"+a,i.a.errors.CALL_EXCEPTION,{method:e.format(),data:Object(U.g)(t),errorArgs:o,errorName:c,errorSignature:f,reason:n})}},{key:"encodeFunctionResult",value:function(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Object(U.g)(this._abiCoder.encode(e.outputs,t||[]))}},{key:"encodeFilterTopics",value:function(e,t){var r=this;"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&Vt.throwError("too many arguments for "+e.format(),i.a.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});var a=[];e.anonymous||a.push(this.getEventTopic(e));var o=function(e,t){return"string"===e.type?Nt(t):"bytes"===e.type?Object(Lt.a)(Object(U.g)(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=n.a.from(t).toHexString()),"address"===e.type&&r._abiCoder.encode(["address"],[t]),Object(U.f)(Object(U.g)(t),32))};for(t.forEach((function(t,r){var n=e.inputs[r];n.indexed?null==t?a.push(null):"array"===n.baseType||"tuple"===n.baseType?Vt.throwArgumentError("filtering with tuples or arrays not supported","contract."+n.name,t):Array.isArray(t)?a.push(t.map((function(e){return o(n,e)}))):a.push(o(n,t)):null!=t&&Vt.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+n.name,t)}));a.length&&null===a[a.length-1];)a.pop();return a}},{key:"encodeEventLog",value:function(e,t){var r=this;"string"==typeof e&&(e=this.getEvent(e));var n=[],a=[],i=[];return e.anonymous||n.push(this.getEventTopic(e)),t.length!==e.inputs.length&&Vt.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach((function(e,o){var c=t[o];if(e.indexed)if("string"===e.type)n.push(Nt(c));else if("bytes"===e.type)n.push(Object(Lt.a)(c));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");n.push(r._abiCoder.encode([e.type],[c]))}else a.push(e),i.push(c)})),{data:this._abiCoder.encode(a,i),topics:n}}},{key:"decodeEventLog",value:function(e,t,r){if("string"==typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){var n=this.getEventTopic(e);Object(U.j)(r[0],32)&&r[0].toLowerCase()===n||Vt.throwError("fragment/topic mismatch",i.a.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:n,value:r[0]}),r=r.slice(1)}var a=[],o=[],c=[];e.inputs.forEach((function(e,t){e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(a.push(M.fromObject({type:"bytes32",name:e.name})),c.push(!0)):(a.push(e),c.push(!1)):(o.push(e),c.push(!1))}));var f=null!=r?this._abiCoder.decode(a,Object(U.b)(r)):null,d=this._abiCoder.decode(o,t,!0),s=[],u=0,b=0;e.inputs.forEach((function(e,t){if(e.indexed)if(null==f)s[t]=new Yt({_isIndexed:!0,hash:null});else if(c[t])s[t]=new Yt({_isIndexed:!0,hash:f[b++]});else try{s[t]=f[b++]}catch(e){s[t]=e}else try{s[t]=d[u++]}catch(e){s[t]=e}if(e.name&&null==s[e.name]){var r=s[t];r instanceof Error?Object.defineProperty(s,e.name,{enumerable:!0,get:function(){throw Qt("property ".concat(JSON.stringify(e.name)),r)}}):s[e.name]=r}}));for(var h=function(e){var t=s[e];t instanceof Error&&Object.defineProperty(s,e,{enumerable:!0,get:function(){throw Qt("index ".concat(e),t)}})},l=0;l=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void a(!1,"Invalid character in "+e)}function d(e,t,r){var n=f(e,r);return r-1>=t&&(n|=f(e,r-1)<<4),n}function s(e,t,r,n){for(var i=0,o=0,c=Math.min(e.length,r),f=t;f=49?d-49+10:d>=17?d-17+10:d,a(d>=0&&o0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,r,n){if("number"==typeof e)return this._initNumber(e,r,n);if("object"===t(e))return this._initArray(e,r,n);"hex"===r&&(r=16),a(r===(0|r)&&r>=2&&r<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;n-=3)o=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[i]|=o<>>26-c&67108863,(c+=24)>=26&&(c-=26,i++);else if("le"===r)for(n=0,i=0;n>>26-c&67108863,(c+=24)>=26&&(c-=26,i++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)a=d(e,t,n)<=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,a=1;a<=67108863;a*=t)n++;n--,a=a/t|0;for(var i=e.length-r,o=i%n,c=Math.min(i,i-o)+r,f=0,d=r;d1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=b}catch(e){o.prototype.inspect=b}else o.prototype.inspect=b;function b(){return(this.red?""}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,i=0,o=0;o>>24-n&16777215,(n+=2)>=26&&(n-=26,o--),r=0!==i||o!==this.length-1?h[6-f.length]+f+r:f+r}for(0!==i&&(r=i.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=l[e],s=p[e];r="";var u=this.clone();for(u.negative=0;!u.isZero();){var b=u.modrn(s).toString(e);r=(u=u.idivn(s)).isZero()?b+r:h[d-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}a(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&a(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},c&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(c,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function m(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var a=0|e.words[0],i=0|t.words[0],o=a*i,c=67108863&o,f=o/67108864|0;r.words[0]=c;for(var d=1;d>>26,u=67108863&f,b=Math.min(d,t.length-1),h=Math.max(0,d-e.length+1);h<=b;h++){var l=d-h|0;s+=(o=(a=0|e.words[l])*(i=0|t.words[h])+u)/67108864|0,u=67108863&o}r.words[d]=0|u,f=0|s}return 0!==f?r.words[d]=0|f:r.length--,r._strip()}o.prototype.toArrayLike=function(e,t,r){this._strip();var n=this.byteLength(),i=r||Math.max(1,n);a(n<=i,"byte array longer than desired length"),a(i>0,"Requested array length <= 0");var o=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,n),o},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,a=0,i=0;a>8&255),r>16&255),6===i?(r>24&255),n=0,i=0):(n=o>>>24,i+=2)}if(r=0&&(e[r--]=o>>8&255),r>=0&&(e[r--]=o>>16&255),6===i?(r>=0&&(e[r--]=o>>24&255),n=0,i=0):(n=o>>>24,i+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){a("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){a("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var a=0,i=0;i>>26;for(;0!==a&&i>>26;if(this.length=r.length,0!==a)this.words[this.length]=a,this.length++;else if(r!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,a=this.cmp(e);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==i&&o>26,this.words[o]=67108863&t;if(0===i&&o>>13,h=0|o[1],l=8191&h,p=h>>>13,m=0|o[2],x=8191&m,y=m>>>13,v=0|o[3],g=8191&v,w=v>>>13,_=0|o[4],M=8191&_,k=_>>>13,S=0|o[5],A=8191&S,E=S>>>13,O=0|o[6],T=8191&O,P=O>>>13,j=0|o[7],B=8191&j,R=j>>>13,C=0|o[8],I=8191&C,L=C>>>13,N=0|o[9],U=8191&N,z=N>>>13,F=0|c[0],q=8191&F,H=F>>>13,D=0|c[1],K=8191&D,G=D>>>13,W=0|c[2],V=8191&W,Z=W>>>13,J=0|c[3],X=8191&J,Y=J>>>13,$=0|c[4],Q=8191&$,ee=$>>>13,te=0|c[5],re=8191&te,ne=te>>>13,ae=0|c[6],ie=8191&ae,oe=ae>>>13,ce=0|c[7],fe=8191&ce,de=ce>>>13,se=0|c[8],ue=8191&se,be=se>>>13,he=0|c[9],le=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(d+(n=Math.imul(u,q))|0)+((8191&(a=(a=Math.imul(u,H))+Math.imul(b,q)|0))<<13)|0;d=((i=Math.imul(b,H))+(a>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(l,q),a=(a=Math.imul(l,H))+Math.imul(p,q)|0,i=Math.imul(p,H);var xe=(d+(n=n+Math.imul(u,K)|0)|0)+((8191&(a=(a=a+Math.imul(u,G)|0)+Math.imul(b,K)|0))<<13)|0;d=((i=i+Math.imul(b,G)|0)+(a>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(x,q),a=(a=Math.imul(x,H))+Math.imul(y,q)|0,i=Math.imul(y,H),n=n+Math.imul(l,K)|0,a=(a=a+Math.imul(l,G)|0)+Math.imul(p,K)|0,i=i+Math.imul(p,G)|0;var ye=(d+(n=n+Math.imul(u,V)|0)|0)+((8191&(a=(a=a+Math.imul(u,Z)|0)+Math.imul(b,V)|0))<<13)|0;d=((i=i+Math.imul(b,Z)|0)+(a>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(g,q),a=(a=Math.imul(g,H))+Math.imul(w,q)|0,i=Math.imul(w,H),n=n+Math.imul(x,K)|0,a=(a=a+Math.imul(x,G)|0)+Math.imul(y,K)|0,i=i+Math.imul(y,G)|0,n=n+Math.imul(l,V)|0,a=(a=a+Math.imul(l,Z)|0)+Math.imul(p,V)|0,i=i+Math.imul(p,Z)|0;var ve=(d+(n=n+Math.imul(u,X)|0)|0)+((8191&(a=(a=a+Math.imul(u,Y)|0)+Math.imul(b,X)|0))<<13)|0;d=((i=i+Math.imul(b,Y)|0)+(a>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(M,q),a=(a=Math.imul(M,H))+Math.imul(k,q)|0,i=Math.imul(k,H),n=n+Math.imul(g,K)|0,a=(a=a+Math.imul(g,G)|0)+Math.imul(w,K)|0,i=i+Math.imul(w,G)|0,n=n+Math.imul(x,V)|0,a=(a=a+Math.imul(x,Z)|0)+Math.imul(y,V)|0,i=i+Math.imul(y,Z)|0,n=n+Math.imul(l,X)|0,a=(a=a+Math.imul(l,Y)|0)+Math.imul(p,X)|0,i=i+Math.imul(p,Y)|0;var ge=(d+(n=n+Math.imul(u,Q)|0)|0)+((8191&(a=(a=a+Math.imul(u,ee)|0)+Math.imul(b,Q)|0))<<13)|0;d=((i=i+Math.imul(b,ee)|0)+(a>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(A,q),a=(a=Math.imul(A,H))+Math.imul(E,q)|0,i=Math.imul(E,H),n=n+Math.imul(M,K)|0,a=(a=a+Math.imul(M,G)|0)+Math.imul(k,K)|0,i=i+Math.imul(k,G)|0,n=n+Math.imul(g,V)|0,a=(a=a+Math.imul(g,Z)|0)+Math.imul(w,V)|0,i=i+Math.imul(w,Z)|0,n=n+Math.imul(x,X)|0,a=(a=a+Math.imul(x,Y)|0)+Math.imul(y,X)|0,i=i+Math.imul(y,Y)|0,n=n+Math.imul(l,Q)|0,a=(a=a+Math.imul(l,ee)|0)+Math.imul(p,Q)|0,i=i+Math.imul(p,ee)|0;var we=(d+(n=n+Math.imul(u,re)|0)|0)+((8191&(a=(a=a+Math.imul(u,ne)|0)+Math.imul(b,re)|0))<<13)|0;d=((i=i+Math.imul(b,ne)|0)+(a>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(T,q),a=(a=Math.imul(T,H))+Math.imul(P,q)|0,i=Math.imul(P,H),n=n+Math.imul(A,K)|0,a=(a=a+Math.imul(A,G)|0)+Math.imul(E,K)|0,i=i+Math.imul(E,G)|0,n=n+Math.imul(M,V)|0,a=(a=a+Math.imul(M,Z)|0)+Math.imul(k,V)|0,i=i+Math.imul(k,Z)|0,n=n+Math.imul(g,X)|0,a=(a=a+Math.imul(g,Y)|0)+Math.imul(w,X)|0,i=i+Math.imul(w,Y)|0,n=n+Math.imul(x,Q)|0,a=(a=a+Math.imul(x,ee)|0)+Math.imul(y,Q)|0,i=i+Math.imul(y,ee)|0,n=n+Math.imul(l,re)|0,a=(a=a+Math.imul(l,ne)|0)+Math.imul(p,re)|0,i=i+Math.imul(p,ne)|0;var _e=(d+(n=n+Math.imul(u,ie)|0)|0)+((8191&(a=(a=a+Math.imul(u,oe)|0)+Math.imul(b,ie)|0))<<13)|0;d=((i=i+Math.imul(b,oe)|0)+(a>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(B,q),a=(a=Math.imul(B,H))+Math.imul(R,q)|0,i=Math.imul(R,H),n=n+Math.imul(T,K)|0,a=(a=a+Math.imul(T,G)|0)+Math.imul(P,K)|0,i=i+Math.imul(P,G)|0,n=n+Math.imul(A,V)|0,a=(a=a+Math.imul(A,Z)|0)+Math.imul(E,V)|0,i=i+Math.imul(E,Z)|0,n=n+Math.imul(M,X)|0,a=(a=a+Math.imul(M,Y)|0)+Math.imul(k,X)|0,i=i+Math.imul(k,Y)|0,n=n+Math.imul(g,Q)|0,a=(a=a+Math.imul(g,ee)|0)+Math.imul(w,Q)|0,i=i+Math.imul(w,ee)|0,n=n+Math.imul(x,re)|0,a=(a=a+Math.imul(x,ne)|0)+Math.imul(y,re)|0,i=i+Math.imul(y,ne)|0,n=n+Math.imul(l,ie)|0,a=(a=a+Math.imul(l,oe)|0)+Math.imul(p,ie)|0,i=i+Math.imul(p,oe)|0;var Me=(d+(n=n+Math.imul(u,fe)|0)|0)+((8191&(a=(a=a+Math.imul(u,de)|0)+Math.imul(b,fe)|0))<<13)|0;d=((i=i+Math.imul(b,de)|0)+(a>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(I,q),a=(a=Math.imul(I,H))+Math.imul(L,q)|0,i=Math.imul(L,H),n=n+Math.imul(B,K)|0,a=(a=a+Math.imul(B,G)|0)+Math.imul(R,K)|0,i=i+Math.imul(R,G)|0,n=n+Math.imul(T,V)|0,a=(a=a+Math.imul(T,Z)|0)+Math.imul(P,V)|0,i=i+Math.imul(P,Z)|0,n=n+Math.imul(A,X)|0,a=(a=a+Math.imul(A,Y)|0)+Math.imul(E,X)|0,i=i+Math.imul(E,Y)|0,n=n+Math.imul(M,Q)|0,a=(a=a+Math.imul(M,ee)|0)+Math.imul(k,Q)|0,i=i+Math.imul(k,ee)|0,n=n+Math.imul(g,re)|0,a=(a=a+Math.imul(g,ne)|0)+Math.imul(w,re)|0,i=i+Math.imul(w,ne)|0,n=n+Math.imul(x,ie)|0,a=(a=a+Math.imul(x,oe)|0)+Math.imul(y,ie)|0,i=i+Math.imul(y,oe)|0,n=n+Math.imul(l,fe)|0,a=(a=a+Math.imul(l,de)|0)+Math.imul(p,fe)|0,i=i+Math.imul(p,de)|0;var ke=(d+(n=n+Math.imul(u,ue)|0)|0)+((8191&(a=(a=a+Math.imul(u,be)|0)+Math.imul(b,ue)|0))<<13)|0;d=((i=i+Math.imul(b,be)|0)+(a>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(U,q),a=(a=Math.imul(U,H))+Math.imul(z,q)|0,i=Math.imul(z,H),n=n+Math.imul(I,K)|0,a=(a=a+Math.imul(I,G)|0)+Math.imul(L,K)|0,i=i+Math.imul(L,G)|0,n=n+Math.imul(B,V)|0,a=(a=a+Math.imul(B,Z)|0)+Math.imul(R,V)|0,i=i+Math.imul(R,Z)|0,n=n+Math.imul(T,X)|0,a=(a=a+Math.imul(T,Y)|0)+Math.imul(P,X)|0,i=i+Math.imul(P,Y)|0,n=n+Math.imul(A,Q)|0,a=(a=a+Math.imul(A,ee)|0)+Math.imul(E,Q)|0,i=i+Math.imul(E,ee)|0,n=n+Math.imul(M,re)|0,a=(a=a+Math.imul(M,ne)|0)+Math.imul(k,re)|0,i=i+Math.imul(k,ne)|0,n=n+Math.imul(g,ie)|0,a=(a=a+Math.imul(g,oe)|0)+Math.imul(w,ie)|0,i=i+Math.imul(w,oe)|0,n=n+Math.imul(x,fe)|0,a=(a=a+Math.imul(x,de)|0)+Math.imul(y,fe)|0,i=i+Math.imul(y,de)|0,n=n+Math.imul(l,ue)|0,a=(a=a+Math.imul(l,be)|0)+Math.imul(p,ue)|0,i=i+Math.imul(p,be)|0;var Se=(d+(n=n+Math.imul(u,le)|0)|0)+((8191&(a=(a=a+Math.imul(u,pe)|0)+Math.imul(b,le)|0))<<13)|0;d=((i=i+Math.imul(b,pe)|0)+(a>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(U,K),a=(a=Math.imul(U,G))+Math.imul(z,K)|0,i=Math.imul(z,G),n=n+Math.imul(I,V)|0,a=(a=a+Math.imul(I,Z)|0)+Math.imul(L,V)|0,i=i+Math.imul(L,Z)|0,n=n+Math.imul(B,X)|0,a=(a=a+Math.imul(B,Y)|0)+Math.imul(R,X)|0,i=i+Math.imul(R,Y)|0,n=n+Math.imul(T,Q)|0,a=(a=a+Math.imul(T,ee)|0)+Math.imul(P,Q)|0,i=i+Math.imul(P,ee)|0,n=n+Math.imul(A,re)|0,a=(a=a+Math.imul(A,ne)|0)+Math.imul(E,re)|0,i=i+Math.imul(E,ne)|0,n=n+Math.imul(M,ie)|0,a=(a=a+Math.imul(M,oe)|0)+Math.imul(k,ie)|0,i=i+Math.imul(k,oe)|0,n=n+Math.imul(g,fe)|0,a=(a=a+Math.imul(g,de)|0)+Math.imul(w,fe)|0,i=i+Math.imul(w,de)|0,n=n+Math.imul(x,ue)|0,a=(a=a+Math.imul(x,be)|0)+Math.imul(y,ue)|0,i=i+Math.imul(y,be)|0;var Ae=(d+(n=n+Math.imul(l,le)|0)|0)+((8191&(a=(a=a+Math.imul(l,pe)|0)+Math.imul(p,le)|0))<<13)|0;d=((i=i+Math.imul(p,pe)|0)+(a>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(U,V),a=(a=Math.imul(U,Z))+Math.imul(z,V)|0,i=Math.imul(z,Z),n=n+Math.imul(I,X)|0,a=(a=a+Math.imul(I,Y)|0)+Math.imul(L,X)|0,i=i+Math.imul(L,Y)|0,n=n+Math.imul(B,Q)|0,a=(a=a+Math.imul(B,ee)|0)+Math.imul(R,Q)|0,i=i+Math.imul(R,ee)|0,n=n+Math.imul(T,re)|0,a=(a=a+Math.imul(T,ne)|0)+Math.imul(P,re)|0,i=i+Math.imul(P,ne)|0,n=n+Math.imul(A,ie)|0,a=(a=a+Math.imul(A,oe)|0)+Math.imul(E,ie)|0,i=i+Math.imul(E,oe)|0,n=n+Math.imul(M,fe)|0,a=(a=a+Math.imul(M,de)|0)+Math.imul(k,fe)|0,i=i+Math.imul(k,de)|0,n=n+Math.imul(g,ue)|0,a=(a=a+Math.imul(g,be)|0)+Math.imul(w,ue)|0,i=i+Math.imul(w,be)|0;var Ee=(d+(n=n+Math.imul(x,le)|0)|0)+((8191&(a=(a=a+Math.imul(x,pe)|0)+Math.imul(y,le)|0))<<13)|0;d=((i=i+Math.imul(y,pe)|0)+(a>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(U,X),a=(a=Math.imul(U,Y))+Math.imul(z,X)|0,i=Math.imul(z,Y),n=n+Math.imul(I,Q)|0,a=(a=a+Math.imul(I,ee)|0)+Math.imul(L,Q)|0,i=i+Math.imul(L,ee)|0,n=n+Math.imul(B,re)|0,a=(a=a+Math.imul(B,ne)|0)+Math.imul(R,re)|0,i=i+Math.imul(R,ne)|0,n=n+Math.imul(T,ie)|0,a=(a=a+Math.imul(T,oe)|0)+Math.imul(P,ie)|0,i=i+Math.imul(P,oe)|0,n=n+Math.imul(A,fe)|0,a=(a=a+Math.imul(A,de)|0)+Math.imul(E,fe)|0,i=i+Math.imul(E,de)|0,n=n+Math.imul(M,ue)|0,a=(a=a+Math.imul(M,be)|0)+Math.imul(k,ue)|0,i=i+Math.imul(k,be)|0;var Oe=(d+(n=n+Math.imul(g,le)|0)|0)+((8191&(a=(a=a+Math.imul(g,pe)|0)+Math.imul(w,le)|0))<<13)|0;d=((i=i+Math.imul(w,pe)|0)+(a>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(U,Q),a=(a=Math.imul(U,ee))+Math.imul(z,Q)|0,i=Math.imul(z,ee),n=n+Math.imul(I,re)|0,a=(a=a+Math.imul(I,ne)|0)+Math.imul(L,re)|0,i=i+Math.imul(L,ne)|0,n=n+Math.imul(B,ie)|0,a=(a=a+Math.imul(B,oe)|0)+Math.imul(R,ie)|0,i=i+Math.imul(R,oe)|0,n=n+Math.imul(T,fe)|0,a=(a=a+Math.imul(T,de)|0)+Math.imul(P,fe)|0,i=i+Math.imul(P,de)|0,n=n+Math.imul(A,ue)|0,a=(a=a+Math.imul(A,be)|0)+Math.imul(E,ue)|0,i=i+Math.imul(E,be)|0;var Te=(d+(n=n+Math.imul(M,le)|0)|0)+((8191&(a=(a=a+Math.imul(M,pe)|0)+Math.imul(k,le)|0))<<13)|0;d=((i=i+Math.imul(k,pe)|0)+(a>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(U,re),a=(a=Math.imul(U,ne))+Math.imul(z,re)|0,i=Math.imul(z,ne),n=n+Math.imul(I,ie)|0,a=(a=a+Math.imul(I,oe)|0)+Math.imul(L,ie)|0,i=i+Math.imul(L,oe)|0,n=n+Math.imul(B,fe)|0,a=(a=a+Math.imul(B,de)|0)+Math.imul(R,fe)|0,i=i+Math.imul(R,de)|0,n=n+Math.imul(T,ue)|0,a=(a=a+Math.imul(T,be)|0)+Math.imul(P,ue)|0,i=i+Math.imul(P,be)|0;var Pe=(d+(n=n+Math.imul(A,le)|0)|0)+((8191&(a=(a=a+Math.imul(A,pe)|0)+Math.imul(E,le)|0))<<13)|0;d=((i=i+Math.imul(E,pe)|0)+(a>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(U,ie),a=(a=Math.imul(U,oe))+Math.imul(z,ie)|0,i=Math.imul(z,oe),n=n+Math.imul(I,fe)|0,a=(a=a+Math.imul(I,de)|0)+Math.imul(L,fe)|0,i=i+Math.imul(L,de)|0,n=n+Math.imul(B,ue)|0,a=(a=a+Math.imul(B,be)|0)+Math.imul(R,ue)|0,i=i+Math.imul(R,be)|0;var je=(d+(n=n+Math.imul(T,le)|0)|0)+((8191&(a=(a=a+Math.imul(T,pe)|0)+Math.imul(P,le)|0))<<13)|0;d=((i=i+Math.imul(P,pe)|0)+(a>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(U,fe),a=(a=Math.imul(U,de))+Math.imul(z,fe)|0,i=Math.imul(z,de),n=n+Math.imul(I,ue)|0,a=(a=a+Math.imul(I,be)|0)+Math.imul(L,ue)|0,i=i+Math.imul(L,be)|0;var Be=(d+(n=n+Math.imul(B,le)|0)|0)+((8191&(a=(a=a+Math.imul(B,pe)|0)+Math.imul(R,le)|0))<<13)|0;d=((i=i+Math.imul(R,pe)|0)+(a>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(U,ue),a=(a=Math.imul(U,be))+Math.imul(z,ue)|0,i=Math.imul(z,be);var Re=(d+(n=n+Math.imul(I,le)|0)|0)+((8191&(a=(a=a+Math.imul(I,pe)|0)+Math.imul(L,le)|0))<<13)|0;d=((i=i+Math.imul(L,pe)|0)+(a>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Ce=(d+(n=Math.imul(U,le))|0)+((8191&(a=(a=Math.imul(U,pe))+Math.imul(z,le)|0))<<13)|0;return d=((i=Math.imul(z,pe))+(a>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,f[0]=me,f[1]=xe,f[2]=ye,f[3]=ve,f[4]=ge,f[5]=we,f[6]=_e,f[7]=Me,f[8]=ke,f[9]=Se,f[10]=Ae,f[11]=Ee,f[12]=Oe,f[13]=Te,f[14]=Pe,f[15]=je,f[16]=Be,f[17]=Re,f[18]=Ce,0!==d&&(f[19]=d,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,a=0,i=0;i>>26)|0)>>>26,o&=67108863}r.words[i]=c,n=o,o=a}return 0!==n?r.words[i]=n:r.length--,r._strip()}function v(e,t,r){return y(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(x=m),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?x(this,e,t):r<63?m(this,e,t):r<1024?y(this,e,t):v(this,e,t)},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},g.prototype.permute=function(e,t,r,n,a,i){for(var o=0;o>>=1)a++;return 1<>>=13,r[2*o+1]=8191&i,i>>>=13;for(o=2*t;o>=26,r+=i/67108864|0,r+=o>>>26,this.words[n]=67108863&o}return 0!==r&&(this.words[n]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>a&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,n=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var i=e%26,o=Math.min((e-i)/26,this.length),c=67108863^67108863>>>i<o)for(this.length-=o,d=0;d=0&&(0!==s||d>=n);d--){var u=0|this.words[d];this.words[d]=s<<26-i|u>>>i,s=u&c}return f&&0!==s&&(f.words[f.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return a(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){a("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(a(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(a("number"==typeof e),a(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(f/67108864|0),this.words[n+r]=67108863&i}for(;n>26,this.words[n+r]=67108863&i;if(0===c)return this._strip();for(a(-1===c),c=0,n=0;n>26,this.words[n]=67108863&i;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),a=e,i=0|a.words[a.length-1];0!==(r=26-this._countBits(i))&&(a=a.ushln(r),n.iushln(r),i=0|a.words[a.length-1]);var c,f=n.length-a.length;if("mod"!==t){(c=new o(null)).length=f+1,c.words=new Array(c.length);for(var d=0;d=0;u--){var b=67108864*(0|n.words[a.length+u])+(0|n.words[a.length+u-1]);for(b=Math.min(b/i|0,67108863),n._ishlnsubmul(a,b,u);0!==n.negative;)b--,n.negative=0,n._ishlnsubmul(a,1,u),n.isZero()||(n.negative^=1);c&&(c.words[u]=b)}return c&&c._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:c||null,mod:n}},o.prototype.divmod=function(e,t,r){return a(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(c=this.neg().divmod(e,t),"mod"!==t&&(n=c.div.neg()),"div"!==t&&(i=c.mod.neg(),r&&0!==i.negative&&i.iadd(e)),{div:n,mod:i}):0===this.negative&&0!==e.negative?(c=this.divmod(e.neg(),t),"mod"!==t&&(n=c.div.neg()),{div:n,mod:c.mod}):0!=(this.negative&e.negative)?(c=this.neg().divmod(e.neg(),t),"div"!==t&&(i=c.mod.neg(),r&&0!==i.negative&&i.isub(e)),{div:c.div,mod:i}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var n,i,c},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),a=e.andln(1),i=r.cmp(n);return i<0||1===a&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),a(e<=67108863);for(var r=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(r*n+(0|this.words[i]))%e;return t?-n:n},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),a(e<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*r;this.words[n]=i/e|0,r=i%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new o(1),i=new o(0),c=new o(0),f=new o(1),d=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++d;for(var s=r.clone(),u=t.clone();!t.isZero();){for(var b=0,h=1;0==(t.words[0]&h)&&b<26;++b,h<<=1);if(b>0)for(t.iushrn(b);b-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(s),i.isub(u)),n.iushrn(1),i.iushrn(1);for(var l=0,p=1;0==(r.words[0]&p)&&l<26;++l,p<<=1);if(l>0)for(r.iushrn(l);l-- >0;)(c.isOdd()||f.isOdd())&&(c.iadd(s),f.isub(u)),c.iushrn(1),f.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(c),i.isub(f)):(r.isub(t),c.isub(n),f.isub(i))}return{a:c,b:f,gcd:r.iushln(d)}},o.prototype._invmp=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,i=new o(1),c=new o(0),f=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var d=0,s=1;0==(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0)for(t.iushrn(d);d-- >0;)i.isOdd()&&i.iadd(f),i.iushrn(1);for(var u=0,b=1;0==(r.words[0]&b)&&u<26;++u,b<<=1);if(u>0)for(r.iushrn(u);u-- >0;)c.isOdd()&&c.iadd(f),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(c)):(r.isub(t),c.isub(i))}return(n=0===t.cmpn(1)?i:c).cmpn(0)<0&&n.iadd(e),n},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var a=t.cmp(r);if(a<0){var i=t;t=r,r=i}else if(0===a||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){a("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<>>26,c&=67108863,this.words[o]=c}return 0!==i&&(this.words[o]=i,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),a(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var n=0|this.words[r],a=0|e.words[r];if(n!==a){na&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new E(e)},o.prototype.toRed=function(e){return a(!this.red,"Already a number in reduction context"),a(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return a(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return a(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return a(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function _(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function M(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function k(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else a(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function O(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}_.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},_.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},_.prototype.split=function(e,t){e.iushrn(this.n,0,t)},_.prototype.imulK=function(e){return e.imul(this.k)},i(M,_),M.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,a=i}a>>>=22,e.words[n-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},M.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=a,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new M;else if("p224"===e)t=new k;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return w[e]=t,t},E.prototype._verify1=function(e){a(0===e.negative,"red works only with positives"),a(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){a(0==(e.negative|t.negative),"red works only with positives"),a(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(a(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),i=0;!n.isZero()&&0===n.andln(1);)i++,n.iushrn(1);a(!n.isZero());var c=new o(1).toRed(this),f=c.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new o(2*s*s).toRed(this);0!==this.pow(s,d).cmp(f);)s.redIAdd(f);for(var u=this.pow(s,n),b=this.pow(e,n.addn(1).iushrn(1)),h=this.pow(e,n),l=i;0!==h.cmp(c);){for(var p=h,m=0;0!==p.cmp(c);m++)p=p.redSqr();a(m=0;n--){for(var d=t.words[n],s=f-1;s>=0;s--){var u=d>>s&1;a!==r[0]&&(a=this.sqr(a)),0!==u||0!==i?(i<<=1,i|=u,(4===++c||0===n&&0===s)&&(a=this.mul(a,r[i]),c=0,i=0)):c=0}f=26}return a},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new O(e)},i(O,E),O.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},O.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},O.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},O.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},O.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(15)(e))},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return D}));var n=r(8),a=r.n(n),i=r(25),o=r.n(i);function c(e){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==e||"undefined"!=typeof self&&self;function f(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},r.exports),r.exports}var d=s;function s(e,t){if(!e)throw new Error(t||"Assertion failed")}s.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var u=f((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function a(e){for(var t="",r=0;r>8,o=255&a;i?r.push(i,o):r.push(o)}return r},r.zero2=n,r.toHex=a,r.encode=function(e,t){return"hex"===t?a(e):e}})),b=f((function(e,t){var r=t;r.assert=d,r.toArray=u.toArray,r.zero2=u.zero2,r.toHex=u.toHex,r.encode=u.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var a=1<(a>>1)-1?(a>>1)-f:f,i.isubn(c)):c=0,n[o]=c,i.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,a=0,i=0;e.cmpn(-a)>0||t.cmpn(-i)>0;){var o,c,f=e.andln(3)+a&3,d=t.andln(3)+i&3;3===f&&(f=-1),3===d&&(d=-1),o=0==(1&f)?0:3!==(n=e.andln(7)+a&7)&&5!==n||2!==d?f:-f,r[0].push(o),c=0==(1&d)?0:3!==(n=t.andln(7)+i&7)&&5!==n||2!==f?d:-d,r[1].push(c),2*a===o+1&&(a=1-a),2*i===c+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new a.a(e,"hex","le")}})),h=b.getNAF,l=b.getJSF,p=b.assert;function m(e,t){this.type=e,this.p=new a.a(t.p,16),this.red=t.prime?a.a.red(t.prime):a.a.mont(this.p),this.zero=new a.a(0).toRed(this.red),this.one=new a.a(1).toRed(this.red),this.two=new a.a(2).toRed(this.red),this.n=t.n&&new a.a(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var x=m;function y(e,t){this.curve=e,this.type=t,this.precomputed=null}m.prototype.point=function(){throw new Error("Not implemented")},m.prototype.validate=function(){throw new Error("Not implemented")},m.prototype._fixedNafMul=function(e,t){p(e.precomputed);var r=e._getDoubles(),n=h(t,1,this._bitLength),a=(1<=i;f--)o=(o<<1)+n[f];c.push(o)}for(var d=this.jpoint(null,null,null),s=this.jpoint(null,null,null),u=a;u>0;u--){for(i=0;i=0;c--){for(var f=0;c>=0&&0===i[c];c--)f++;if(c>=0&&f++,o=o.dblp(f),c<0)break;var d=i[c];p(0!==d),o="affine"===e.type?d>0?o.mixedAdd(a[d-1>>1]):o.mixedAdd(a[-d-1>>1].neg()):d>0?o.add(a[d-1>>1]):o.add(a[-d-1>>1].neg())}return"affine"===e.type?o.toP():o},m.prototype._wnafMulAdd=function(e,t,r,n,a){var i,o,c,f=this._wnafT1,d=this._wnafT2,s=this._wnafT3,u=0;for(i=0;i=1;i-=2){var p=i-1,m=i;if(1===f[p]&&1===f[m]){var x=[t[p],null,null,t[m]];0===t[p].y.cmp(t[m].y)?(x[1]=t[p].add(t[m]),x[2]=t[p].toJ().mixedAdd(t[m].neg())):0===t[p].y.cmp(t[m].y.redNeg())?(x[1]=t[p].toJ().mixedAdd(t[m]),x[2]=t[p].add(t[m].neg())):(x[1]=t[p].toJ().mixedAdd(t[m]),x[2]=t[p].toJ().mixedAdd(t[m].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],v=l(r[p],r[m]);for(u=Math.max(v[0].length,u),s[p]=new Array(u),s[m]=new Array(u),o=0;o=0;i--){for(var k=0;i>=0;){var S=!0;for(o=0;o=0&&k++,_=_.dblp(k),i<0)break;for(o=0;o0?c=d[o][A-1>>1]:A<0&&(c=d[o][-A-1>>1].neg()),_="affine"===c.type?_.mixedAdd(c):_.add(c))}}for(i=0;i=Math.ceil((e.bitLength()+1)/t.step)},y.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,a=0;a=0&&(o=t,c=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),c=c.neg()),[{a:n,b:i},{a:o,b:c}]},w.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],a=n.b.mul(e).divRound(this.n),i=r.b.neg().mul(e).divRound(this.n),o=a.mul(r.a),c=i.mul(n.a),f=a.mul(r.b),d=i.mul(n.b);return{k1:e.sub(o).sub(c),k2:f.add(d).neg()}},w.prototype.pointFromX=function(e,t){(e=new a.a(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},w.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),a=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(a).cmpn(0)},w.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,a=this._endoWnafT2,i=0;i":""},M.prototype.isInfinity=function(){return this.inf},M.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},M.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),a=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),i=a.redSqr().redISub(this.x.redAdd(this.x)),o=a.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,o)},M.prototype.getX=function(){return this.x.fromRed()},M.prototype.getY=function(){return this.y.fromRed()},M.prototype.mul=function(e){return e=new a.a(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},M.prototype.mulAdd=function(e,t,r){var n=[this,t],a=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,a):this.curve._wnafMulAdd(1,n,a,2)},M.prototype.jmulAdd=function(e,t,r){var n=[this,t],a=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,a,!0):this.curve._wnafMulAdd(1,n,a,2,!0)},M.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},M.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},M.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},v(k,x.BasePoint),w.prototype.jpoint=function(e,t,r){return new k(this,e,t,r)},k.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},k.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},k.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),a=e.x.redMul(r),i=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),c=n.redSub(a),f=i.redSub(o);if(0===c.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var d=c.redSqr(),s=d.redMul(c),u=n.redMul(d),b=f.redSqr().redIAdd(s).redISub(u).redISub(u),h=f.redMul(u.redISub(b)).redISub(i.redMul(s)),l=this.z.redMul(e.z).redMul(c);return this.curve.jpoint(b,h,l)},k.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),a=this.y,i=e.y.redMul(t).redMul(this.z),o=r.redSub(n),c=a.redSub(i);if(0===o.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=o.redSqr(),d=f.redMul(o),s=r.redMul(f),u=c.redSqr().redIAdd(d).redISub(s).redISub(s),b=c.redMul(s.redISub(u)).redISub(a.redMul(d)),h=this.z.redMul(o);return this.curve.jpoint(u,b,h)},k.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t=0)return!1;if(r.redIAdd(a),0===this.x.cmp(r))return!0}},k.prototype.inspect=function(){return this.isInfinity()?"":""},k.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var S=f((function(e,t){var r=t;r.base=x,r.short=_,r.mont=null,r.edwards=null})),A=f((function(e,t){var r,n=t,a=b.assert;function i(e){"short"===e.type?this.curve=new S.short(e):"edwards"===e.type?this.curve=new S.edwards(e):this.curve=new S.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function c(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new i(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=i,c("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.a.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.a.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.a.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.a.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),c("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.a.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.a.sha256,gRed:!1,g:["9"]}),c("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.a.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(e){r=void 0}c("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.a.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function E(e){if(!(this instanceof E))return new E(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=u.toArray(e.entropy,e.entropyEnc||"hex"),r=u.toArray(e.nonce,e.nonceEnc||"hex"),n=u.toArray(e.pers,e.persEnc||"hex");d(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var O=E;E.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var a=0;a=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},E.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=u.toArray(r,n||"hex"),this._update(r));for(var a=[];a.length"};var B=b.assert;function R(e,t){if(e instanceof R)return e;this._importDER(e,t)||(B(e.r&&e.s,"Signature without r or s"),this.r=new a.a(e.r,16),this.s=new a.a(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var C=R;function I(){this.place=0}function L(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var a=0,i=0,o=t.place;i>>=0;return!(a<=127)&&(t.place=o,a)}function N(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}R.prototype._importDER=function(e,t){e=b.toArray(e,t);var r=new I;if(48!==e[r.place++])return!1;var n=L(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=L(e,r);if(!1===i)return!1;var o=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var c=L(e,r);if(!1===c)return!1;if(e.length!==c+r.place)return!1;var f=e.slice(r.place,c+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new a.a(o),this.s=new a.a(f),this.recoveryParam=null,!0},R.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=N(t),r=N(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];U(n,t.length),(n=n.concat(t)).push(2),U(n,r.length);var a=n.concat(r),i=[48];return U(i,a.length),i=i.concat(a),b.encode(i,e)};var z=function(){throw new Error("unsupported")},F=b.assert;function q(e){if(!(this instanceof q))return new q(e);"string"==typeof e&&(F(Object.prototype.hasOwnProperty.call(A,e),"Unknown curve "+e),e=A[e]),e instanceof A.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var H=q;q.prototype.keyPair=function(e){return new j(this,e)},q.prototype.keyFromPrivate=function(e,t){return j.fromPrivate(this,e,t)},q.prototype.keyFromPublic=function(e,t){return j.fromPublic(this,e,t)},q.prototype.genKeyPair=function(e){e||(e={});for(var t=new O({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||z(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new a.a(2));;){var i=new a.a(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},q.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},q.prototype.sign=function(e,t,r,n){"object"===c(r)&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new a.a(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),f=e.toArray("be",i),d=new O({hash:this.hash,entropy:o,nonce:f,pers:n.pers,persEnc:n.persEnc||"utf8"}),s=this.n.sub(new a.a(1)),u=0;;u++){var b=n.k?n.k(u):new a.a(d.generate(this.n.byteLength()));if(!((b=this._truncateToN(b,!0)).cmpn(1)<=0||b.cmp(s)>=0)){var h=this.g.mul(b);if(!h.isInfinity()){var l=h.getX(),p=l.umod(this.n);if(0!==p.cmpn(0)){var m=b.invm(this.n).mul(p.mul(t.getPrivate()).iadd(e));if(0!==(m=m.umod(this.n)).cmpn(0)){var x=(h.getY().isOdd()?1:0)|(0!==l.cmp(p)?2:0);return n.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),x^=1),new C({r:p,s:m,recoveryParam:x})}}}}}},q.prototype.verify=function(e,t,r,n){e=this._truncateToN(new a.a(e,16)),r=this.keyFromPublic(r,n);var i=(t=new C(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var c,f=o.invm(this.n),d=f.mul(e).umod(this.n),s=f.mul(i).umod(this.n);return this.curve._maxwellTrick?!(c=this.g.jmulAdd(d,r.getPublic(),s)).isInfinity()&&c.eqXToP(i):!(c=this.g.mulAdd(d,r.getPublic(),s)).isInfinity()&&0===c.getX().umod(this.n).cmp(i)},q.prototype.recoverPubKey=function(e,t,r,n){F((3&r)===r,"The recovery param is more than two bits"),t=new C(t,n);var i=this.n,o=new a.a(e),c=t.r,f=t.s,d=1&r,s=r>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&s)throw new Error("Unable to find sencond key candinate");c=s?this.curve.pointFromX(c.add(this.curve.n),d):this.curve.pointFromX(c,d);var u=t.r.invm(i),b=i.sub(o).mul(u).umod(i),h=f.mul(u).umod(i);return this.g.mulAdd(b,c,h)},q.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new C(t,n)).recoveryParam)return t.recoveryParam;for(var a=0;a<4;a++){var i;try{i=this.recoverPubKey(e,t,a)}catch(e){continue}if(i.eq(r))return a}throw new Error("Unable to find valid recovery factor")};var D=f((function(e,t){var r=t;r.version="6.5.4",r.utils=b,r.rand=function(){throw new Error("unsupported")},r.curve=S,r.curves=A,r.ec=H,r.eddsa=null})).ec}).call(this,r(13))},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.getWindowMetadata=void 0;var a=r(26);t.getWindowMetadata=function(){var e,t;try{e=a.getDocumentOrThrow(),t=a.getLocationOrThrow()}catch(e){return null}function r(){for(var t=arguments.length,r=new Array(t),a=0;a-1){var c=i.getAttribute("href");if(c)if(-1===c.toLowerCase().indexOf("https:")&&-1===c.toLowerCase().indexOf("http:")&&0!==c.indexOf("//")){var f=t.protocol+"//"+t.host;if(0===c.indexOf("/"))f+=c;else{var d=t.pathname.split("/");d.pop(),f+=d.join("/")+"/"+c}n.push(f)}else if(0===c.indexOf("//")){var s=t.protocol+c;n.push(s)}else n.push(c)}}return n}(),name:i}}},function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return b}));var n=function(){for(var e=0,t=0,r=arguments.length;t=0;--a){var i=this.tryEntries[a],o=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=r.call(i,"catchLoc"),f=r.call(i,"finallyLoc");if(c&&f){if(this.prev=0;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),k(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var a=n.arg;k(r)}return a}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:A(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),b}},e}function c(e,t,r,n,a,i,o){try{var c=e[i](o),f=c.value}catch(e){return void r(e)}c.done?t(f):Promise.resolve(f).then(n,a)}function f(e,t){for(var r=0;r=0;f--)(i=e[f])&&(c=(o<3?i(c):o>3?i(t,r,c):i(t,r))||c);return o>3&&c&&Object.defineProperty(t,r,c),c},o=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||a(t,e,r)},c=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(a,i){function o(e){try{f(n.next(e))}catch(e){i(e)}}function c(e){try{f(n.throw(e))}catch(e){i(e)}}function f(e){var t;e.done?a(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,c)}f((n=n.apply(e,t||[])).next())}))},f=this&&this.__generator||function(e,t){var r,n,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(a=2&i[0]?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[2&i[0],a.value]),i[0]){case 0:case 1:a=i;break;case 4:return o.label++,{value:i[1],done:!1};case 5:o.label++,n=i[1],i=[0];continue;case 7:i=o.ops.pop(),o.trys.pop();continue;default:if(!(a=o.trys,(a=a.length>0&&a[a.length-1])||6!==i[0]&&2!==i[0])){o=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},s=this&&this.__read||function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,a,i=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(e){a={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(a)throw a.error}}return o},u=this&&this.__spread||function(){for(var e=[],t=0;tt&&c[t].tokenId&&!n)&&(this.updateTokenInfo(c[t],e,t,r),_.saveData(this.data)),[2,c[t]]}))}))},t.prototype.nftList=function(e,t){return c(this,void 0,void 0,(function(){var r,n,a,i,o,c,d,s,u;return f(this,(function(f){switch(f.label){case 0:return t=t||this.currentAccount().address,r=this.wallet.currentChain.id,[4,this.erc721Standard.getBalance(e,t)];case 1:if(n=f.sent(),a=P.getTypeByAddress(r,e),i=a.categor,o=a.type,c=[],i!==P.UNKNOW&&(c=this.currentAccountData.tokenData[r][i+"s"]),d=!1,c.length!==n&&(d=!0),d)for(c.length=0,s=0;s0?o-4:o;for(r=0;r>16&255,f[s++]=t>>8&255,f[s++]=255&t;2===c&&(t=a[e.charCodeAt(r)]<<2|a[e.charCodeAt(r+1)]>>4,f[s++]=255&t);1===c&&(t=a[e.charCodeAt(r)]<<10|a[e.charCodeAt(r+1)]<<4|a[e.charCodeAt(r+2)]>>2,f[s++]=t>>8&255,f[s++]=255&t);return f},t.fromByteArray=function(e){for(var t,r=e.length,a=r%3,i=[],o=0,c=r-a;oc?c:o+16383));1===a?(t=e[r-1],i.push(n[t>>2]+n[t<<4&63]+"==")):2===a&&(t=(e[r-2]<<8)+e[r-1],i.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return i.join("")};for(var n=[],a=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0,f=o.length;c0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function s(e,t,r){for(var a,i,o=[],c=t;c>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return o.join("")}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},function(e,t){ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ t.read=function(e,t,r,n,a){var i,o,c=8*a-n-1,f=(1<>1,s=-7,u=r?a-1:0,b=r?-1:1,h=e[t+u];for(u+=b,i=h&(1<<-s)-1,h>>=-s,s+=c;s>0;i=256*i+e[t+u],u+=b,s-=8);for(o=i&(1<<-s)-1,i>>=-s,s+=n;s>0;o=256*o+e[t+u],u+=b,s-=8);if(0===i)i=1-d;else{if(i===f)return o?NaN:1/0*(h?-1:1);o+=Math.pow(2,n),i-=d}return(h?-1:1)*o*Math.pow(2,i-n)},t.write=function(e,t,r,n,a,i){var o,c,f,d=8*i-a-1,s=(1<>1,b=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:i-1,l=n?1:-1,p=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(c=isNaN(t)?1:0,o=s):(o=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-o))<1&&(o--,f*=2),(t+=o+u>=1?b/f:b*Math.pow(2,1-u))*f>=2&&(o++,f/=2),o+u>=s?(c=0,o=s):o+u>=1?(c=(t*f-1)*Math.pow(2,a),o+=u):(c=t*Math.pow(2,u-1)*Math.pow(2,a),o=0));a>=8;e[r+h]=255&c,h+=l,c/=256,a-=8);for(o=o<0;e[r+h]=255&o,h+=l,o/=256,d-=8);e[r+h-l]|=128*p}},function(e){e.exports=JSON.parse('{"name":"web3","version":"1.7.4","description":"Ethereum JavaScript API","repository":"https://github.com/ethereum/web3.js","license":"LGPL-3.0","engines":{"node":">=8.0.0"},"main":"lib/index.js","bugs":{"url":"https://github.com/ethereum/web3.js/issues"},"keywords":["Ethereum","JavaScript","API"],"author":"ethereum.org","types":"types/index.d.ts","scripts":{"compile":"tsc -b tsconfig.json","dtslint":"dtslint --localTs ../../node_modules/typescript/lib types","postinstall":"echo \\"WARNING: the web3-shh and web3-bzz api will be deprecated in the next version\\""},"authors":[{"name":"Fabian Vogelsteller","email":"fabian@ethereum.org","homepage":"http://frozeman.de"},{"name":"Marek Kotewicz","email":"marek@parity.io","url":"https://github.com/debris"},{"name":"Marian Oancea","url":"https://github.com/cubedro"},{"name":"Gav Wood","email":"g@parity.io","homepage":"http://gavwood.com"},{"name":"Jeffery Wilcke","email":"jeffrey.wilcke@ethereum.org","url":"https://github.com/obscuren"}],"dependencies":{"web3-bzz":"1.7.4","web3-core":"1.7.4","web3-eth":"1.7.4","web3-eth-personal":"1.7.4","web3-net":"1.7.4","web3-shh":"1.7.4","web3-utils":"1.7.4"},"devDependencies":{"@types/node":"^12.12.6","dtslint":"^3.4.1","typescript":"^3.9.5","web3-core-helpers":"1.7.4"},"gitHead":"77005c072a64fdd364eace821df0c39388871102"}')},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=r(44).callbackify,i=r(16).errors,o=r(227),c=r(451),f=r(452),d=function e(t,r){this.provider=null,this.providers=e.providers,this.setProvider(t,r),this.subscriptions=new Map};d.givenProvider=f,d.providers={WebsocketProvider:r(453),HttpProvider:r(463),IpcProvider:r(473)},d.prototype.setProvider=function(e,t){var r=this;if(e&&"string"==typeof e&&this.providers)if(/^http(s)?:\/\//i.test(e))e=new this.providers.HttpProvider(e);else if(/^ws(s)?:\/\//i.test(e))e=new this.providers.WebsocketProvider(e);else if(e&&"object"===n(t)&&"function"==typeof t.connect)e=new this.providers.IpcProvider(e,t);else if(e)throw new Error("Can't autodetect provider for \""+e+'"');if(this.provider&&this.provider.connected&&this.clearSubscriptions(),this.provider=e||null,this.provider&&this.provider.on){"function"==typeof e.request?this.provider.on("message",(function(e){if(e&&"eth_subscription"===e.type&&e.data){var t=e.data;t.subscription&&r.subscriptions.has(t.subscription)&&r.subscriptions.get(t.subscription).callback(null,t.result)}})):this.provider.on("data",(function(e,t){(e=e||t).method&&e.params&&e.params.subscription&&r.subscriptions.has(e.params.subscription)&&r.subscriptions.get(e.params.subscription).callback(null,e.params.result)})),this.provider.on("connect",(function(){r.subscriptions.forEach((function(e){e.subscription.resubscribe()}))})),this.provider.on("error",(function(e){r.subscriptions.forEach((function(t){t.callback(e)}))}));this.provider.on("disconnect",(function(e){r._isCleanCloseEvent(e)&&!r._isIpcCloseError(e)||(r.subscriptions.forEach((function(t){t.callback(i.ConnectionCloseError(e)),r.subscriptions.delete(t.subscription.id)})),r.provider&&r.provider.emit&&r.provider.emit("error",i.ConnectionCloseError(e))),r.provider&&r.provider.emit&&r.provider.emit("end",e)}))}},d.prototype.send=function(e,t){if(t=t||function(){},!this.provider)return t(i.InvalidProvider());var r=e.method,n=e.params,c=o.toPayload(r,n),f=this._jsonrpcResultCallback(t,c);if(this.provider.request)a(this.provider.request.bind(this.provider))({method:r,params:n},t);else if(this.provider.sendAsync)this.provider.sendAsync(c,f);else{if(!this.provider.send)throw new Error("Provider does not have a request or send method to use.");this.provider.send(c,f)}},d.prototype.sendBatch=function(e,t){if(!this.provider)return t(i.InvalidProvider());var r=o.toBatchPayload(e);this.provider[this.provider.sendAsync?"sendAsync":"send"](r,(function(e,r){return e?t(e):Array.isArray(r)?void t(null,r):t(i.InvalidResponse(r))}))},d.prototype.addSubscription=function(e,t){if(!this.provider.on)throw new Error("The provider doesn't support subscriptions: "+this.provider.constructor.name);this.subscriptions.set(e.id,{callback:t,subscription:e})},d.prototype.removeSubscription=function(e,t){if(this.subscriptions.has(e)){var r=this.subscriptions.get(e).subscription.options.type;return this.subscriptions.delete(e),void this.send({method:r+"_unsubscribe",params:[e]},t)}"function"==typeof t&&t(null)},d.prototype.clearSubscriptions=function(e){try{var t=this;return this.subscriptions.size>0&&this.subscriptions.forEach((function(r,n){e&&"syncing"===r.name||t.removeSubscription(n)})),this.provider.reset&&this.provider.reset(),!0}catch(e){throw new Error("Error while clearing subscriptions: ".concat(e))}},d.prototype._isCleanCloseEvent=function(e){return"object"===n(e)&&([1e3].includes(e.code)||!0===e.wasClean)},d.prototype._isIpcCloseError=function(e){return"boolean"==typeof e&&e},d.prototype._jsonrpcResultCallback=function(e,t){return function(r,n){return n&&n.id&&t.id!==n.id?e(new Error("Wrong response id ".concat(n.id," (expected: ").concat(t.id,") in ").concat(JSON.stringify(t)))):r?e(r):n&&n.error?e(i.ErrorResponse(n)):o.isValidResponse(n)?void e(null,n.result):e(i.InvalidResponse(n))}},e.exports={Manager:d,BatchManager:c}},function(e,t){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports=function(e){return e&&"object"===r(e)&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports={ErrorResponse:function(e){var t=e&&e.error&&e.error.message?e.error.message:JSON.stringify(e),r=e.error&&e.error.data?e.error.data:null,n=new Error("Returned error: "+t);return n.data=r,n},InvalidNumberOfParams:function(e,t,r){return new Error('Invalid number of parameters for "'+r+'". Got '+e+" expected "+t+"!")},InvalidConnection:function(e,t){return this.ConnectionError("CONNECTION ERROR: Couldn't connect to node "+e+".",t)},InvalidProvider:function(){return new Error("Provider not set or invalid")},InvalidResponse:function(e){var t=e&&e.error&&e.error.message?e.error.message:"Invalid JSON RPC response: "+JSON.stringify(e);return new Error(t)},ConnectionTimeout:function(e){return new Error("CONNECTION TIMEOUT: timeout of "+e+" ms achived")},ConnectionNotOpenError:function(e){return this.ConnectionError("connection not open on send()",e)},ConnectionCloseError:function(e){return"object"===n(e)&&e.code&&e.reason?this.ConnectionError("CONNECTION ERROR: The connection got closed with the close code `"+e.code+"` and the following reason string `"+e.reason+"`",e):new Error("CONNECTION ERROR: The connection closed unexpectedly")},MaxAttemptsReachedOnReconnectingError:function(){return new Error("Maximum number of reconnect attempts reached!")},PendingRequestsOnReconnectingError:function(){return new Error("CONNECTION ERROR: Provider started to reconnect before the response got received!")},ConnectionError:function(e,t){var r=new Error(e);return t&&(r.code=t.code,r.reason=t.reason),r},RevertInstructionError:function(e,t){var r=new Error("Your request got reverted with the following reason string: "+e);return r.reason=e,r.signature=t,r},TransactionRevertInstructionError:function(e,t,r){var n=new Error("Transaction has been reverted by the EVM:\n"+JSON.stringify(r,null,2));return n.reason=e,n.signature=t,n.receipt=r,n},TransactionError:function(e,t){var r=new Error(e);return r.receipt=t,r},NoContractAddressFoundError:function(e){return this.TransactionError("The transaction receipt didn't contain a contract address.",e)},ContractCodeNotStoredError:function(e){return this.TransactionError("The contract code couldn't be stored, please check your gas limit.",e)},TransactionRevertedWithoutReasonError:function(e){return this.TransactionError("Transaction has been reverted by the EVM:\n"+JSON.stringify(e,null,2),e)},TransactionOutOfGasError:function(e){return this.TransactionError("Transaction ran out of gas. Please provide more gas:\n"+JSON.stringify(e,null,2),e)},ResolverMethodMissingError:function(e,t){return new Error("The resolver at "+e+'does not implement requested method: "'+t+'".')},ContractMissingABIError:function(){return new Error("You must provide the json interface of the contract when instantiating a contract object.")},ContractOnceRequiresCallbackError:function(){return new Error("Once requires a callback as the second parameter.")},ContractEventDoesNotExistError:function(e){return new Error('Event "'+e+"\" doesn't exist in this contract.")},ContractReservedEventError:function(e){return new Error('The event "'+e+"\" is a reserved event name, you can't use it.")},ContractMissingDeployDataError:function(){return new Error('No "data" specified in neither the given options, nor the default options.')},ContractNoAddressDefinedError:function(){return new Error("This contract object doesn't have address set yet, please set an address first.")},ContractNoFromAddressDefinedError:function(){return new Error('No "from" address specified in neither the given options, nor the default options.')}}},function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e){for(var t=1;t2)throw new Error("[ethjs-unit] while converting number "+e+" to wei, too many decimal points");var b=u[0],h=u[1];if(b||(b="0"),h||(h="0"),h.length>i)throw new Error("[ethjs-unit] while converting number "+e+" to wei, too many decimal places");for(;h.length=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function d(e,t,r,n){for(var a=0,i=Math.min(e.length,r),o=t;o=49?c-49+10:c>=17?c-17+10:c}return a}o.isBN=function(e){return e instanceof o||null!==e&&"object"===t(e)&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,r,n){if("number"==typeof e)return this._initNumber(e,r,n);if("object"===t(e))return this._initArray(e,r,n);"hex"===r&&(r=16),a(r===(0|r)&&r>=2&&r<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===r?this._parseHex(e,i):this._parseBase(e,r,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),r,n)},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(a(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(a("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)o=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[i]|=o<>>26-c&67108863,(c+=24)>=26&&(c-=26,i++);else if("le"===r)for(n=0,i=0;n>>26-c&67108863,(c+=24)>=26&&(c-=26,i++);return this.strip()},o.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)a=f(e,r,r+6),this.words[n]|=a<>>26-i&4194303,(i+=24)>=26&&(i-=26,n++);r+6!==t&&(a=f(e,t,r+6),this.words[n]|=a<>>26-i&4194303),this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,a=1;a<=67108863;a*=t)n++;n--,a=a/t|0;for(var i=e.length-r,o=i%n,c=Math.min(i,i-o)+r,f=0,s=r;s1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var s=["","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"],u=[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],b=[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 h(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var a=0|e.words[0],i=0|t.words[0],o=a*i,c=67108863&o,f=o/67108864|0;r.words[0]=c;for(var d=1;d>>26,u=67108863&f,b=Math.min(d,t.length-1),h=Math.max(0,d-e.length+1);h<=b;h++){var l=d-h|0;s+=(o=(a=0|e.words[l])*(i=0|t.words[h])+u)/67108864|0,u=67108863&o}r.words[d]=0|u,f=0|s}return 0!==f?r.words[d]=0|f:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,i=0,o=0;o>>24-n&16777215)||o!==this.length-1?s[6-f.length]+f+r:f+r,(n+=2)>=26&&(n-=26,o--)}for(0!==i&&(r=i.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=u[e],h=b[e];r="";var l=this.clone();for(l.negative=0;!l.isZero();){var p=l.modn(h).toString(e);r=(l=l.idivn(h)).isZero()?p+r:s[d-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}a(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&a(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return a(void 0!==c),this.toArrayLike(c,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var n=this.byteLength(),i=r||Math.max(1,n);a(n<=i,"byte array longer than desired length"),a(i>0,"Requested array length <= 0"),this.strip();var o,c,f="le"===t,d=new e(i),s=this.clone();if(f){for(c=0;!s.isZero();c++)o=s.andln(255),s.iushrn(8),d[c]=o;for(;c=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){a("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){a("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var a=0,i=0;i>>26;for(;0!==a&&i>>26;if(this.length=r.length,0!==a)this.words[this.length]=a,this.length++;else if(r!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,a=this.cmp(e);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==i&&o>26,this.words[o]=67108863&t;if(0===i&&o>>13,h=0|o[1],l=8191&h,p=h>>>13,m=0|o[2],x=8191&m,y=m>>>13,v=0|o[3],g=8191&v,w=v>>>13,_=0|o[4],M=8191&_,k=_>>>13,S=0|o[5],A=8191&S,E=S>>>13,O=0|o[6],T=8191&O,P=O>>>13,j=0|o[7],B=8191&j,R=j>>>13,C=0|o[8],I=8191&C,L=C>>>13,N=0|o[9],U=8191&N,z=N>>>13,F=0|c[0],q=8191&F,H=F>>>13,D=0|c[1],K=8191&D,G=D>>>13,W=0|c[2],V=8191&W,Z=W>>>13,J=0|c[3],X=8191&J,Y=J>>>13,$=0|c[4],Q=8191&$,ee=$>>>13,te=0|c[5],re=8191&te,ne=te>>>13,ae=0|c[6],ie=8191&ae,oe=ae>>>13,ce=0|c[7],fe=8191&ce,de=ce>>>13,se=0|c[8],ue=8191&se,be=se>>>13,he=0|c[9],le=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(d+(n=Math.imul(u,q))|0)+((8191&(a=(a=Math.imul(u,H))+Math.imul(b,q)|0))<<13)|0;d=((i=Math.imul(b,H))+(a>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(l,q),a=(a=Math.imul(l,H))+Math.imul(p,q)|0,i=Math.imul(p,H);var xe=(d+(n=n+Math.imul(u,K)|0)|0)+((8191&(a=(a=a+Math.imul(u,G)|0)+Math.imul(b,K)|0))<<13)|0;d=((i=i+Math.imul(b,G)|0)+(a>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(x,q),a=(a=Math.imul(x,H))+Math.imul(y,q)|0,i=Math.imul(y,H),n=n+Math.imul(l,K)|0,a=(a=a+Math.imul(l,G)|0)+Math.imul(p,K)|0,i=i+Math.imul(p,G)|0;var ye=(d+(n=n+Math.imul(u,V)|0)|0)+((8191&(a=(a=a+Math.imul(u,Z)|0)+Math.imul(b,V)|0))<<13)|0;d=((i=i+Math.imul(b,Z)|0)+(a>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(g,q),a=(a=Math.imul(g,H))+Math.imul(w,q)|0,i=Math.imul(w,H),n=n+Math.imul(x,K)|0,a=(a=a+Math.imul(x,G)|0)+Math.imul(y,K)|0,i=i+Math.imul(y,G)|0,n=n+Math.imul(l,V)|0,a=(a=a+Math.imul(l,Z)|0)+Math.imul(p,V)|0,i=i+Math.imul(p,Z)|0;var ve=(d+(n=n+Math.imul(u,X)|0)|0)+((8191&(a=(a=a+Math.imul(u,Y)|0)+Math.imul(b,X)|0))<<13)|0;d=((i=i+Math.imul(b,Y)|0)+(a>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(M,q),a=(a=Math.imul(M,H))+Math.imul(k,q)|0,i=Math.imul(k,H),n=n+Math.imul(g,K)|0,a=(a=a+Math.imul(g,G)|0)+Math.imul(w,K)|0,i=i+Math.imul(w,G)|0,n=n+Math.imul(x,V)|0,a=(a=a+Math.imul(x,Z)|0)+Math.imul(y,V)|0,i=i+Math.imul(y,Z)|0,n=n+Math.imul(l,X)|0,a=(a=a+Math.imul(l,Y)|0)+Math.imul(p,X)|0,i=i+Math.imul(p,Y)|0;var ge=(d+(n=n+Math.imul(u,Q)|0)|0)+((8191&(a=(a=a+Math.imul(u,ee)|0)+Math.imul(b,Q)|0))<<13)|0;d=((i=i+Math.imul(b,ee)|0)+(a>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(A,q),a=(a=Math.imul(A,H))+Math.imul(E,q)|0,i=Math.imul(E,H),n=n+Math.imul(M,K)|0,a=(a=a+Math.imul(M,G)|0)+Math.imul(k,K)|0,i=i+Math.imul(k,G)|0,n=n+Math.imul(g,V)|0,a=(a=a+Math.imul(g,Z)|0)+Math.imul(w,V)|0,i=i+Math.imul(w,Z)|0,n=n+Math.imul(x,X)|0,a=(a=a+Math.imul(x,Y)|0)+Math.imul(y,X)|0,i=i+Math.imul(y,Y)|0,n=n+Math.imul(l,Q)|0,a=(a=a+Math.imul(l,ee)|0)+Math.imul(p,Q)|0,i=i+Math.imul(p,ee)|0;var we=(d+(n=n+Math.imul(u,re)|0)|0)+((8191&(a=(a=a+Math.imul(u,ne)|0)+Math.imul(b,re)|0))<<13)|0;d=((i=i+Math.imul(b,ne)|0)+(a>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(T,q),a=(a=Math.imul(T,H))+Math.imul(P,q)|0,i=Math.imul(P,H),n=n+Math.imul(A,K)|0,a=(a=a+Math.imul(A,G)|0)+Math.imul(E,K)|0,i=i+Math.imul(E,G)|0,n=n+Math.imul(M,V)|0,a=(a=a+Math.imul(M,Z)|0)+Math.imul(k,V)|0,i=i+Math.imul(k,Z)|0,n=n+Math.imul(g,X)|0,a=(a=a+Math.imul(g,Y)|0)+Math.imul(w,X)|0,i=i+Math.imul(w,Y)|0,n=n+Math.imul(x,Q)|0,a=(a=a+Math.imul(x,ee)|0)+Math.imul(y,Q)|0,i=i+Math.imul(y,ee)|0,n=n+Math.imul(l,re)|0,a=(a=a+Math.imul(l,ne)|0)+Math.imul(p,re)|0,i=i+Math.imul(p,ne)|0;var _e=(d+(n=n+Math.imul(u,ie)|0)|0)+((8191&(a=(a=a+Math.imul(u,oe)|0)+Math.imul(b,ie)|0))<<13)|0;d=((i=i+Math.imul(b,oe)|0)+(a>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(B,q),a=(a=Math.imul(B,H))+Math.imul(R,q)|0,i=Math.imul(R,H),n=n+Math.imul(T,K)|0,a=(a=a+Math.imul(T,G)|0)+Math.imul(P,K)|0,i=i+Math.imul(P,G)|0,n=n+Math.imul(A,V)|0,a=(a=a+Math.imul(A,Z)|0)+Math.imul(E,V)|0,i=i+Math.imul(E,Z)|0,n=n+Math.imul(M,X)|0,a=(a=a+Math.imul(M,Y)|0)+Math.imul(k,X)|0,i=i+Math.imul(k,Y)|0,n=n+Math.imul(g,Q)|0,a=(a=a+Math.imul(g,ee)|0)+Math.imul(w,Q)|0,i=i+Math.imul(w,ee)|0,n=n+Math.imul(x,re)|0,a=(a=a+Math.imul(x,ne)|0)+Math.imul(y,re)|0,i=i+Math.imul(y,ne)|0,n=n+Math.imul(l,ie)|0,a=(a=a+Math.imul(l,oe)|0)+Math.imul(p,ie)|0,i=i+Math.imul(p,oe)|0;var Me=(d+(n=n+Math.imul(u,fe)|0)|0)+((8191&(a=(a=a+Math.imul(u,de)|0)+Math.imul(b,fe)|0))<<13)|0;d=((i=i+Math.imul(b,de)|0)+(a>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(I,q),a=(a=Math.imul(I,H))+Math.imul(L,q)|0,i=Math.imul(L,H),n=n+Math.imul(B,K)|0,a=(a=a+Math.imul(B,G)|0)+Math.imul(R,K)|0,i=i+Math.imul(R,G)|0,n=n+Math.imul(T,V)|0,a=(a=a+Math.imul(T,Z)|0)+Math.imul(P,V)|0,i=i+Math.imul(P,Z)|0,n=n+Math.imul(A,X)|0,a=(a=a+Math.imul(A,Y)|0)+Math.imul(E,X)|0,i=i+Math.imul(E,Y)|0,n=n+Math.imul(M,Q)|0,a=(a=a+Math.imul(M,ee)|0)+Math.imul(k,Q)|0,i=i+Math.imul(k,ee)|0,n=n+Math.imul(g,re)|0,a=(a=a+Math.imul(g,ne)|0)+Math.imul(w,re)|0,i=i+Math.imul(w,ne)|0,n=n+Math.imul(x,ie)|0,a=(a=a+Math.imul(x,oe)|0)+Math.imul(y,ie)|0,i=i+Math.imul(y,oe)|0,n=n+Math.imul(l,fe)|0,a=(a=a+Math.imul(l,de)|0)+Math.imul(p,fe)|0,i=i+Math.imul(p,de)|0;var ke=(d+(n=n+Math.imul(u,ue)|0)|0)+((8191&(a=(a=a+Math.imul(u,be)|0)+Math.imul(b,ue)|0))<<13)|0;d=((i=i+Math.imul(b,be)|0)+(a>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(U,q),a=(a=Math.imul(U,H))+Math.imul(z,q)|0,i=Math.imul(z,H),n=n+Math.imul(I,K)|0,a=(a=a+Math.imul(I,G)|0)+Math.imul(L,K)|0,i=i+Math.imul(L,G)|0,n=n+Math.imul(B,V)|0,a=(a=a+Math.imul(B,Z)|0)+Math.imul(R,V)|0,i=i+Math.imul(R,Z)|0,n=n+Math.imul(T,X)|0,a=(a=a+Math.imul(T,Y)|0)+Math.imul(P,X)|0,i=i+Math.imul(P,Y)|0,n=n+Math.imul(A,Q)|0,a=(a=a+Math.imul(A,ee)|0)+Math.imul(E,Q)|0,i=i+Math.imul(E,ee)|0,n=n+Math.imul(M,re)|0,a=(a=a+Math.imul(M,ne)|0)+Math.imul(k,re)|0,i=i+Math.imul(k,ne)|0,n=n+Math.imul(g,ie)|0,a=(a=a+Math.imul(g,oe)|0)+Math.imul(w,ie)|0,i=i+Math.imul(w,oe)|0,n=n+Math.imul(x,fe)|0,a=(a=a+Math.imul(x,de)|0)+Math.imul(y,fe)|0,i=i+Math.imul(y,de)|0,n=n+Math.imul(l,ue)|0,a=(a=a+Math.imul(l,be)|0)+Math.imul(p,ue)|0,i=i+Math.imul(p,be)|0;var Se=(d+(n=n+Math.imul(u,le)|0)|0)+((8191&(a=(a=a+Math.imul(u,pe)|0)+Math.imul(b,le)|0))<<13)|0;d=((i=i+Math.imul(b,pe)|0)+(a>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(U,K),a=(a=Math.imul(U,G))+Math.imul(z,K)|0,i=Math.imul(z,G),n=n+Math.imul(I,V)|0,a=(a=a+Math.imul(I,Z)|0)+Math.imul(L,V)|0,i=i+Math.imul(L,Z)|0,n=n+Math.imul(B,X)|0,a=(a=a+Math.imul(B,Y)|0)+Math.imul(R,X)|0,i=i+Math.imul(R,Y)|0,n=n+Math.imul(T,Q)|0,a=(a=a+Math.imul(T,ee)|0)+Math.imul(P,Q)|0,i=i+Math.imul(P,ee)|0,n=n+Math.imul(A,re)|0,a=(a=a+Math.imul(A,ne)|0)+Math.imul(E,re)|0,i=i+Math.imul(E,ne)|0,n=n+Math.imul(M,ie)|0,a=(a=a+Math.imul(M,oe)|0)+Math.imul(k,ie)|0,i=i+Math.imul(k,oe)|0,n=n+Math.imul(g,fe)|0,a=(a=a+Math.imul(g,de)|0)+Math.imul(w,fe)|0,i=i+Math.imul(w,de)|0,n=n+Math.imul(x,ue)|0,a=(a=a+Math.imul(x,be)|0)+Math.imul(y,ue)|0,i=i+Math.imul(y,be)|0;var Ae=(d+(n=n+Math.imul(l,le)|0)|0)+((8191&(a=(a=a+Math.imul(l,pe)|0)+Math.imul(p,le)|0))<<13)|0;d=((i=i+Math.imul(p,pe)|0)+(a>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(U,V),a=(a=Math.imul(U,Z))+Math.imul(z,V)|0,i=Math.imul(z,Z),n=n+Math.imul(I,X)|0,a=(a=a+Math.imul(I,Y)|0)+Math.imul(L,X)|0,i=i+Math.imul(L,Y)|0,n=n+Math.imul(B,Q)|0,a=(a=a+Math.imul(B,ee)|0)+Math.imul(R,Q)|0,i=i+Math.imul(R,ee)|0,n=n+Math.imul(T,re)|0,a=(a=a+Math.imul(T,ne)|0)+Math.imul(P,re)|0,i=i+Math.imul(P,ne)|0,n=n+Math.imul(A,ie)|0,a=(a=a+Math.imul(A,oe)|0)+Math.imul(E,ie)|0,i=i+Math.imul(E,oe)|0,n=n+Math.imul(M,fe)|0,a=(a=a+Math.imul(M,de)|0)+Math.imul(k,fe)|0,i=i+Math.imul(k,de)|0,n=n+Math.imul(g,ue)|0,a=(a=a+Math.imul(g,be)|0)+Math.imul(w,ue)|0,i=i+Math.imul(w,be)|0;var Ee=(d+(n=n+Math.imul(x,le)|0)|0)+((8191&(a=(a=a+Math.imul(x,pe)|0)+Math.imul(y,le)|0))<<13)|0;d=((i=i+Math.imul(y,pe)|0)+(a>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(U,X),a=(a=Math.imul(U,Y))+Math.imul(z,X)|0,i=Math.imul(z,Y),n=n+Math.imul(I,Q)|0,a=(a=a+Math.imul(I,ee)|0)+Math.imul(L,Q)|0,i=i+Math.imul(L,ee)|0,n=n+Math.imul(B,re)|0,a=(a=a+Math.imul(B,ne)|0)+Math.imul(R,re)|0,i=i+Math.imul(R,ne)|0,n=n+Math.imul(T,ie)|0,a=(a=a+Math.imul(T,oe)|0)+Math.imul(P,ie)|0,i=i+Math.imul(P,oe)|0,n=n+Math.imul(A,fe)|0,a=(a=a+Math.imul(A,de)|0)+Math.imul(E,fe)|0,i=i+Math.imul(E,de)|0,n=n+Math.imul(M,ue)|0,a=(a=a+Math.imul(M,be)|0)+Math.imul(k,ue)|0,i=i+Math.imul(k,be)|0;var Oe=(d+(n=n+Math.imul(g,le)|0)|0)+((8191&(a=(a=a+Math.imul(g,pe)|0)+Math.imul(w,le)|0))<<13)|0;d=((i=i+Math.imul(w,pe)|0)+(a>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(U,Q),a=(a=Math.imul(U,ee))+Math.imul(z,Q)|0,i=Math.imul(z,ee),n=n+Math.imul(I,re)|0,a=(a=a+Math.imul(I,ne)|0)+Math.imul(L,re)|0,i=i+Math.imul(L,ne)|0,n=n+Math.imul(B,ie)|0,a=(a=a+Math.imul(B,oe)|0)+Math.imul(R,ie)|0,i=i+Math.imul(R,oe)|0,n=n+Math.imul(T,fe)|0,a=(a=a+Math.imul(T,de)|0)+Math.imul(P,fe)|0,i=i+Math.imul(P,de)|0,n=n+Math.imul(A,ue)|0,a=(a=a+Math.imul(A,be)|0)+Math.imul(E,ue)|0,i=i+Math.imul(E,be)|0;var Te=(d+(n=n+Math.imul(M,le)|0)|0)+((8191&(a=(a=a+Math.imul(M,pe)|0)+Math.imul(k,le)|0))<<13)|0;d=((i=i+Math.imul(k,pe)|0)+(a>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(U,re),a=(a=Math.imul(U,ne))+Math.imul(z,re)|0,i=Math.imul(z,ne),n=n+Math.imul(I,ie)|0,a=(a=a+Math.imul(I,oe)|0)+Math.imul(L,ie)|0,i=i+Math.imul(L,oe)|0,n=n+Math.imul(B,fe)|0,a=(a=a+Math.imul(B,de)|0)+Math.imul(R,fe)|0,i=i+Math.imul(R,de)|0,n=n+Math.imul(T,ue)|0,a=(a=a+Math.imul(T,be)|0)+Math.imul(P,ue)|0,i=i+Math.imul(P,be)|0;var Pe=(d+(n=n+Math.imul(A,le)|0)|0)+((8191&(a=(a=a+Math.imul(A,pe)|0)+Math.imul(E,le)|0))<<13)|0;d=((i=i+Math.imul(E,pe)|0)+(a>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(U,ie),a=(a=Math.imul(U,oe))+Math.imul(z,ie)|0,i=Math.imul(z,oe),n=n+Math.imul(I,fe)|0,a=(a=a+Math.imul(I,de)|0)+Math.imul(L,fe)|0,i=i+Math.imul(L,de)|0,n=n+Math.imul(B,ue)|0,a=(a=a+Math.imul(B,be)|0)+Math.imul(R,ue)|0,i=i+Math.imul(R,be)|0;var je=(d+(n=n+Math.imul(T,le)|0)|0)+((8191&(a=(a=a+Math.imul(T,pe)|0)+Math.imul(P,le)|0))<<13)|0;d=((i=i+Math.imul(P,pe)|0)+(a>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(U,fe),a=(a=Math.imul(U,de))+Math.imul(z,fe)|0,i=Math.imul(z,de),n=n+Math.imul(I,ue)|0,a=(a=a+Math.imul(I,be)|0)+Math.imul(L,ue)|0,i=i+Math.imul(L,be)|0;var Be=(d+(n=n+Math.imul(B,le)|0)|0)+((8191&(a=(a=a+Math.imul(B,pe)|0)+Math.imul(R,le)|0))<<13)|0;d=((i=i+Math.imul(R,pe)|0)+(a>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(U,ue),a=(a=Math.imul(U,be))+Math.imul(z,ue)|0,i=Math.imul(z,be);var Re=(d+(n=n+Math.imul(I,le)|0)|0)+((8191&(a=(a=a+Math.imul(I,pe)|0)+Math.imul(L,le)|0))<<13)|0;d=((i=i+Math.imul(L,pe)|0)+(a>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Ce=(d+(n=Math.imul(U,le))|0)+((8191&(a=(a=Math.imul(U,pe))+Math.imul(z,le)|0))<<13)|0;return d=((i=Math.imul(z,pe))+(a>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,f[0]=me,f[1]=xe,f[2]=ye,f[3]=ve,f[4]=ge,f[5]=we,f[6]=_e,f[7]=Me,f[8]=ke,f[9]=Se,f[10]=Ae,f[11]=Ee,f[12]=Oe,f[13]=Te,f[14]=Pe,f[15]=je,f[16]=Be,f[17]=Re,f[18]=Ce,0!==d&&(f[19]=d,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(l=h),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?l(this,e,t):r<63?h(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,a=0,i=0;i>>26)|0)>>>26,o&=67108863}r.words[i]=c,n=o,o=a}return 0!==n?r.words[i]=n:r.length--,r.strip()}(this,e,t):p(this,e,t)},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},m.prototype.permute=function(e,t,r,n,a,i){for(var o=0;o>>=1)a++;return 1<>>=13,r[2*o+1]=8191&i,i>>>=13;for(o=2*t;o>=26,t+=n/67108864|0,t+=i>>>26,this.words[r]=67108863&i}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>a}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,n=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var i=e%26,o=Math.min((e-i)/26,this.length),c=67108863^67108863>>>i<o)for(this.length-=o,d=0;d=0&&(0!==s||d>=n);d--){var u=0|this.words[d];this.words[d]=s<<26-i|u>>>i,s=u&c}return f&&0!==s&&(f.words[f.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return a(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){a("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(a(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(a("number"==typeof e),a(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(f/67108864|0),this.words[n+r]=67108863&i}for(;n>26,this.words[n+r]=67108863&i;if(0===c)return this.strip();for(a(-1===c),c=0,n=0;n>26,this.words[n]=67108863&i;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),a=e,i=0|a.words[a.length-1];0!==(r=26-this._countBits(i))&&(a=a.ushln(r),n.iushln(r),i=0|a.words[a.length-1]);var c,f=n.length-a.length;if("mod"!==t){(c=new o(null)).length=f+1,c.words=new Array(c.length);for(var d=0;d=0;u--){var b=67108864*(0|n.words[a.length+u])+(0|n.words[a.length+u-1]);for(b=Math.min(b/i|0,67108863),n._ishlnsubmul(a,b,u);0!==n.negative;)b--,n.negative=0,n._ishlnsubmul(a,1,u),n.isZero()||(n.negative^=1);c&&(c.words[u]=b)}return c&&c.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:c||null,mod:n}},o.prototype.divmod=function(e,t,r){return a(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(c=this.neg().divmod(e,t),"mod"!==t&&(n=c.div.neg()),"div"!==t&&(i=c.mod.neg(),r&&0!==i.negative&&i.iadd(e)),{div:n,mod:i}):0===this.negative&&0!==e.negative?(c=this.divmod(e.neg(),t),"mod"!==t&&(n=c.div.neg()),{div:n,mod:c.mod}):0!=(this.negative&e.negative)?(c=this.neg().divmod(e.neg(),t),"div"!==t&&(i=c.mod.neg(),r&&0!==i.negative&&i.isub(e)),{div:c.div,mod:i}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var n,i,c},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),a=e.andln(1),i=r.cmp(n);return i<0||1===a&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){a(e<=67108863);for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;return r},o.prototype.idivn=function(e){a(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t;this.words[r]=n/e|0,t=n%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new o(1),i=new o(0),c=new o(0),f=new o(1),d=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++d;for(var s=r.clone(),u=t.clone();!t.isZero();){for(var b=0,h=1;0==(t.words[0]&h)&&b<26;++b,h<<=1);if(b>0)for(t.iushrn(b);b-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(s),i.isub(u)),n.iushrn(1),i.iushrn(1);for(var l=0,p=1;0==(r.words[0]&p)&&l<26;++l,p<<=1);if(l>0)for(r.iushrn(l);l-- >0;)(c.isOdd()||f.isOdd())&&(c.iadd(s),f.isub(u)),c.iushrn(1),f.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(c),i.isub(f)):(r.isub(t),c.isub(n),f.isub(i))}return{a:c,b:f,gcd:r.iushln(d)}},o.prototype._invmp=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,i=new o(1),c=new o(0),f=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var d=0,s=1;0==(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0)for(t.iushrn(d);d-- >0;)i.isOdd()&&i.iadd(f),i.iushrn(1);for(var u=0,b=1;0==(r.words[0]&b)&&u<26;++u,b<<=1);if(u>0)for(r.iushrn(u);u-- >0;)c.isOdd()&&c.iadd(f),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(c)):(r.isub(t),c.isub(i))}return(n=0===t.cmpn(1)?i:c).cmpn(0)<0&&n.iadd(e),n},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var a=t.cmp(r);if(a<0){var i=t;t=r,r=i}else if(0===a||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){a("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<>>26,c&=67108863,this.words[o]=c}return 0!==i&&(this.words[o]=i,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),a(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var n=0|this.words[r],a=0|e.words[r];if(n!==a){na&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new M(e)},o.prototype.toRed=function(e){return a(!this.red,"Already a number in reduction context"),a(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return a(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return a(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return a(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var x={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function g(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else a(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):r.strip(),r},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},i(v,y),v.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,a=i}a>>>=22,e.words[n-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=a,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(x[e])return x[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new g;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return x[e]=t,t},M.prototype._verify1=function(e){a(0===e.negative,"red works only with positives"),a(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){a(0==(e.negative|t.negative),"red works only with positives"),a(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(a(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),i=0;!n.isZero()&&0===n.andln(1);)i++,n.iushrn(1);a(!n.isZero());var c=new o(1).toRed(this),f=c.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new o(2*s*s).toRed(this);0!==this.pow(s,d).cmp(f);)s.redIAdd(f);for(var u=this.pow(s,n),b=this.pow(e,n.addn(1).iushrn(1)),h=this.pow(e,n),l=i;0!==h.cmp(c);){for(var p=h,m=0;0!==p.cmp(c);m++)p=p.redSqr();a(m=0;n--){for(var d=t.words[n],s=f-1;s>=0;s--){var u=d>>s&1;a!==r[0]&&(a=this.sqr(a)),0!==u||0!==i?(i<<=1,i|=u,(4===++c||0===n&&0===s)&&(a=this.mul(a,r[i]),c=0,i=0)):c=0}f=26}return a},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new k(e)},i(k,M),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(15)(e))},function(e,t,r){(function(e){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e,n){"use strict";function a(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var c;"object"===t(e)?e.exports=o:n.BN=o,o.BN=o,o.wordSize=26;try{c=r(0).Buffer}catch(e){}function f(e,t,r){for(var n=0,a=Math.min(e.length,r),i=t;i=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return n}function d(e,t,r,n){for(var a=0,i=Math.min(e.length,r),o=t;o=49?c-49+10:c>=17?c-17+10:c}return a}o.isBN=function(e){return e instanceof o||null!==e&&"object"===t(e)&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,r,n){if("number"==typeof e)return this._initNumber(e,r,n);if("object"===t(e))return this._initArray(e,r,n);"hex"===r&&(r=16),a(r===(0|r)&&r>=2&&r<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&i++,16===r?this._parseHex(e,i):this._parseBase(e,r,i),"-"===e[0]&&(this.negative=1),this.strip(),"le"===n&&this._initArray(this.toArray(),r,n)},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(a(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(a("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)o=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[i]|=o<>>26-c&67108863,(c+=24)>=26&&(c-=26,i++);else if("le"===r)for(n=0,i=0;n>>26-c&67108863,(c+=24)>=26&&(c-=26,i++);return this.strip()},o.prototype._parseHex=function(e,t){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r=t;r-=6)a=f(e,r,r+6),this.words[n]|=a<>>26-i&4194303,(i+=24)>=26&&(i-=26,n++);r+6!==t&&(a=f(e,t,r+6),this.words[n]|=a<>>26-i&4194303),this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,a=1;a<=67108863;a*=t)n++;n--,a=a/t|0;for(var i=e.length-r,o=i%n,c=Math.min(i,i-o)+r,f=0,s=r;s1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var s=["","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"],u=[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],b=[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 h(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var a=0|e.words[0],i=0|t.words[0],o=a*i,c=67108863&o,f=o/67108864|0;r.words[0]=c;for(var d=1;d>>26,u=67108863&f,b=Math.min(d,t.length-1),h=Math.max(0,d-e.length+1);h<=b;h++){var l=d-h|0;s+=(o=(a=0|e.words[l])*(i=0|t.words[h])+u)/67108864|0,u=67108863&o}r.words[d]=0|u,f=0|s}return 0!==f?r.words[d]=0|f:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,i=0,o=0;o>>24-n&16777215)||o!==this.length-1?s[6-f.length]+f+r:f+r,(n+=2)>=26&&(n-=26,o--)}for(0!==i&&(r=i.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=u[e],h=b[e];r="";var l=this.clone();for(l.negative=0;!l.isZero();){var p=l.modn(h).toString(e);r=(l=l.idivn(h)).isZero()?p+r:s[d-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}a(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&a(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return a(void 0!==c),this.toArrayLike(c,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var n=this.byteLength(),i=r||Math.max(1,n);a(n<=i,"byte array longer than desired length"),a(i>0,"Requested array length <= 0"),this.strip();var o,c,f="le"===t,d=new e(i),s=this.clone();if(f){for(c=0;!s.isZero();c++)o=s.andln(255),s.iushrn(8),d[c]=o;for(;c=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){a("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){a("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var a=0,i=0;i>>26;for(;0!==a&&i>>26;if(this.length=r.length,0!==a)this.words[this.length]=a,this.length++;else if(r!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,a=this.cmp(e);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==i&&o>26,this.words[o]=67108863&t;if(0===i&&o>>13,h=0|o[1],l=8191&h,p=h>>>13,m=0|o[2],x=8191&m,y=m>>>13,v=0|o[3],g=8191&v,w=v>>>13,_=0|o[4],M=8191&_,k=_>>>13,S=0|o[5],A=8191&S,E=S>>>13,O=0|o[6],T=8191&O,P=O>>>13,j=0|o[7],B=8191&j,R=j>>>13,C=0|o[8],I=8191&C,L=C>>>13,N=0|o[9],U=8191&N,z=N>>>13,F=0|c[0],q=8191&F,H=F>>>13,D=0|c[1],K=8191&D,G=D>>>13,W=0|c[2],V=8191&W,Z=W>>>13,J=0|c[3],X=8191&J,Y=J>>>13,$=0|c[4],Q=8191&$,ee=$>>>13,te=0|c[5],re=8191&te,ne=te>>>13,ae=0|c[6],ie=8191&ae,oe=ae>>>13,ce=0|c[7],fe=8191&ce,de=ce>>>13,se=0|c[8],ue=8191&se,be=se>>>13,he=0|c[9],le=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(d+(n=Math.imul(u,q))|0)+((8191&(a=(a=Math.imul(u,H))+Math.imul(b,q)|0))<<13)|0;d=((i=Math.imul(b,H))+(a>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(l,q),a=(a=Math.imul(l,H))+Math.imul(p,q)|0,i=Math.imul(p,H);var xe=(d+(n=n+Math.imul(u,K)|0)|0)+((8191&(a=(a=a+Math.imul(u,G)|0)+Math.imul(b,K)|0))<<13)|0;d=((i=i+Math.imul(b,G)|0)+(a>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(x,q),a=(a=Math.imul(x,H))+Math.imul(y,q)|0,i=Math.imul(y,H),n=n+Math.imul(l,K)|0,a=(a=a+Math.imul(l,G)|0)+Math.imul(p,K)|0,i=i+Math.imul(p,G)|0;var ye=(d+(n=n+Math.imul(u,V)|0)|0)+((8191&(a=(a=a+Math.imul(u,Z)|0)+Math.imul(b,V)|0))<<13)|0;d=((i=i+Math.imul(b,Z)|0)+(a>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(g,q),a=(a=Math.imul(g,H))+Math.imul(w,q)|0,i=Math.imul(w,H),n=n+Math.imul(x,K)|0,a=(a=a+Math.imul(x,G)|0)+Math.imul(y,K)|0,i=i+Math.imul(y,G)|0,n=n+Math.imul(l,V)|0,a=(a=a+Math.imul(l,Z)|0)+Math.imul(p,V)|0,i=i+Math.imul(p,Z)|0;var ve=(d+(n=n+Math.imul(u,X)|0)|0)+((8191&(a=(a=a+Math.imul(u,Y)|0)+Math.imul(b,X)|0))<<13)|0;d=((i=i+Math.imul(b,Y)|0)+(a>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(M,q),a=(a=Math.imul(M,H))+Math.imul(k,q)|0,i=Math.imul(k,H),n=n+Math.imul(g,K)|0,a=(a=a+Math.imul(g,G)|0)+Math.imul(w,K)|0,i=i+Math.imul(w,G)|0,n=n+Math.imul(x,V)|0,a=(a=a+Math.imul(x,Z)|0)+Math.imul(y,V)|0,i=i+Math.imul(y,Z)|0,n=n+Math.imul(l,X)|0,a=(a=a+Math.imul(l,Y)|0)+Math.imul(p,X)|0,i=i+Math.imul(p,Y)|0;var ge=(d+(n=n+Math.imul(u,Q)|0)|0)+((8191&(a=(a=a+Math.imul(u,ee)|0)+Math.imul(b,Q)|0))<<13)|0;d=((i=i+Math.imul(b,ee)|0)+(a>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(A,q),a=(a=Math.imul(A,H))+Math.imul(E,q)|0,i=Math.imul(E,H),n=n+Math.imul(M,K)|0,a=(a=a+Math.imul(M,G)|0)+Math.imul(k,K)|0,i=i+Math.imul(k,G)|0,n=n+Math.imul(g,V)|0,a=(a=a+Math.imul(g,Z)|0)+Math.imul(w,V)|0,i=i+Math.imul(w,Z)|0,n=n+Math.imul(x,X)|0,a=(a=a+Math.imul(x,Y)|0)+Math.imul(y,X)|0,i=i+Math.imul(y,Y)|0,n=n+Math.imul(l,Q)|0,a=(a=a+Math.imul(l,ee)|0)+Math.imul(p,Q)|0,i=i+Math.imul(p,ee)|0;var we=(d+(n=n+Math.imul(u,re)|0)|0)+((8191&(a=(a=a+Math.imul(u,ne)|0)+Math.imul(b,re)|0))<<13)|0;d=((i=i+Math.imul(b,ne)|0)+(a>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(T,q),a=(a=Math.imul(T,H))+Math.imul(P,q)|0,i=Math.imul(P,H),n=n+Math.imul(A,K)|0,a=(a=a+Math.imul(A,G)|0)+Math.imul(E,K)|0,i=i+Math.imul(E,G)|0,n=n+Math.imul(M,V)|0,a=(a=a+Math.imul(M,Z)|0)+Math.imul(k,V)|0,i=i+Math.imul(k,Z)|0,n=n+Math.imul(g,X)|0,a=(a=a+Math.imul(g,Y)|0)+Math.imul(w,X)|0,i=i+Math.imul(w,Y)|0,n=n+Math.imul(x,Q)|0,a=(a=a+Math.imul(x,ee)|0)+Math.imul(y,Q)|0,i=i+Math.imul(y,ee)|0,n=n+Math.imul(l,re)|0,a=(a=a+Math.imul(l,ne)|0)+Math.imul(p,re)|0,i=i+Math.imul(p,ne)|0;var _e=(d+(n=n+Math.imul(u,ie)|0)|0)+((8191&(a=(a=a+Math.imul(u,oe)|0)+Math.imul(b,ie)|0))<<13)|0;d=((i=i+Math.imul(b,oe)|0)+(a>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(B,q),a=(a=Math.imul(B,H))+Math.imul(R,q)|0,i=Math.imul(R,H),n=n+Math.imul(T,K)|0,a=(a=a+Math.imul(T,G)|0)+Math.imul(P,K)|0,i=i+Math.imul(P,G)|0,n=n+Math.imul(A,V)|0,a=(a=a+Math.imul(A,Z)|0)+Math.imul(E,V)|0,i=i+Math.imul(E,Z)|0,n=n+Math.imul(M,X)|0,a=(a=a+Math.imul(M,Y)|0)+Math.imul(k,X)|0,i=i+Math.imul(k,Y)|0,n=n+Math.imul(g,Q)|0,a=(a=a+Math.imul(g,ee)|0)+Math.imul(w,Q)|0,i=i+Math.imul(w,ee)|0,n=n+Math.imul(x,re)|0,a=(a=a+Math.imul(x,ne)|0)+Math.imul(y,re)|0,i=i+Math.imul(y,ne)|0,n=n+Math.imul(l,ie)|0,a=(a=a+Math.imul(l,oe)|0)+Math.imul(p,ie)|0,i=i+Math.imul(p,oe)|0;var Me=(d+(n=n+Math.imul(u,fe)|0)|0)+((8191&(a=(a=a+Math.imul(u,de)|0)+Math.imul(b,fe)|0))<<13)|0;d=((i=i+Math.imul(b,de)|0)+(a>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(I,q),a=(a=Math.imul(I,H))+Math.imul(L,q)|0,i=Math.imul(L,H),n=n+Math.imul(B,K)|0,a=(a=a+Math.imul(B,G)|0)+Math.imul(R,K)|0,i=i+Math.imul(R,G)|0,n=n+Math.imul(T,V)|0,a=(a=a+Math.imul(T,Z)|0)+Math.imul(P,V)|0,i=i+Math.imul(P,Z)|0,n=n+Math.imul(A,X)|0,a=(a=a+Math.imul(A,Y)|0)+Math.imul(E,X)|0,i=i+Math.imul(E,Y)|0,n=n+Math.imul(M,Q)|0,a=(a=a+Math.imul(M,ee)|0)+Math.imul(k,Q)|0,i=i+Math.imul(k,ee)|0,n=n+Math.imul(g,re)|0,a=(a=a+Math.imul(g,ne)|0)+Math.imul(w,re)|0,i=i+Math.imul(w,ne)|0,n=n+Math.imul(x,ie)|0,a=(a=a+Math.imul(x,oe)|0)+Math.imul(y,ie)|0,i=i+Math.imul(y,oe)|0,n=n+Math.imul(l,fe)|0,a=(a=a+Math.imul(l,de)|0)+Math.imul(p,fe)|0,i=i+Math.imul(p,de)|0;var ke=(d+(n=n+Math.imul(u,ue)|0)|0)+((8191&(a=(a=a+Math.imul(u,be)|0)+Math.imul(b,ue)|0))<<13)|0;d=((i=i+Math.imul(b,be)|0)+(a>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(U,q),a=(a=Math.imul(U,H))+Math.imul(z,q)|0,i=Math.imul(z,H),n=n+Math.imul(I,K)|0,a=(a=a+Math.imul(I,G)|0)+Math.imul(L,K)|0,i=i+Math.imul(L,G)|0,n=n+Math.imul(B,V)|0,a=(a=a+Math.imul(B,Z)|0)+Math.imul(R,V)|0,i=i+Math.imul(R,Z)|0,n=n+Math.imul(T,X)|0,a=(a=a+Math.imul(T,Y)|0)+Math.imul(P,X)|0,i=i+Math.imul(P,Y)|0,n=n+Math.imul(A,Q)|0,a=(a=a+Math.imul(A,ee)|0)+Math.imul(E,Q)|0,i=i+Math.imul(E,ee)|0,n=n+Math.imul(M,re)|0,a=(a=a+Math.imul(M,ne)|0)+Math.imul(k,re)|0,i=i+Math.imul(k,ne)|0,n=n+Math.imul(g,ie)|0,a=(a=a+Math.imul(g,oe)|0)+Math.imul(w,ie)|0,i=i+Math.imul(w,oe)|0,n=n+Math.imul(x,fe)|0,a=(a=a+Math.imul(x,de)|0)+Math.imul(y,fe)|0,i=i+Math.imul(y,de)|0,n=n+Math.imul(l,ue)|0,a=(a=a+Math.imul(l,be)|0)+Math.imul(p,ue)|0,i=i+Math.imul(p,be)|0;var Se=(d+(n=n+Math.imul(u,le)|0)|0)+((8191&(a=(a=a+Math.imul(u,pe)|0)+Math.imul(b,le)|0))<<13)|0;d=((i=i+Math.imul(b,pe)|0)+(a>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(U,K),a=(a=Math.imul(U,G))+Math.imul(z,K)|0,i=Math.imul(z,G),n=n+Math.imul(I,V)|0,a=(a=a+Math.imul(I,Z)|0)+Math.imul(L,V)|0,i=i+Math.imul(L,Z)|0,n=n+Math.imul(B,X)|0,a=(a=a+Math.imul(B,Y)|0)+Math.imul(R,X)|0,i=i+Math.imul(R,Y)|0,n=n+Math.imul(T,Q)|0,a=(a=a+Math.imul(T,ee)|0)+Math.imul(P,Q)|0,i=i+Math.imul(P,ee)|0,n=n+Math.imul(A,re)|0,a=(a=a+Math.imul(A,ne)|0)+Math.imul(E,re)|0,i=i+Math.imul(E,ne)|0,n=n+Math.imul(M,ie)|0,a=(a=a+Math.imul(M,oe)|0)+Math.imul(k,ie)|0,i=i+Math.imul(k,oe)|0,n=n+Math.imul(g,fe)|0,a=(a=a+Math.imul(g,de)|0)+Math.imul(w,fe)|0,i=i+Math.imul(w,de)|0,n=n+Math.imul(x,ue)|0,a=(a=a+Math.imul(x,be)|0)+Math.imul(y,ue)|0,i=i+Math.imul(y,be)|0;var Ae=(d+(n=n+Math.imul(l,le)|0)|0)+((8191&(a=(a=a+Math.imul(l,pe)|0)+Math.imul(p,le)|0))<<13)|0;d=((i=i+Math.imul(p,pe)|0)+(a>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(U,V),a=(a=Math.imul(U,Z))+Math.imul(z,V)|0,i=Math.imul(z,Z),n=n+Math.imul(I,X)|0,a=(a=a+Math.imul(I,Y)|0)+Math.imul(L,X)|0,i=i+Math.imul(L,Y)|0,n=n+Math.imul(B,Q)|0,a=(a=a+Math.imul(B,ee)|0)+Math.imul(R,Q)|0,i=i+Math.imul(R,ee)|0,n=n+Math.imul(T,re)|0,a=(a=a+Math.imul(T,ne)|0)+Math.imul(P,re)|0,i=i+Math.imul(P,ne)|0,n=n+Math.imul(A,ie)|0,a=(a=a+Math.imul(A,oe)|0)+Math.imul(E,ie)|0,i=i+Math.imul(E,oe)|0,n=n+Math.imul(M,fe)|0,a=(a=a+Math.imul(M,de)|0)+Math.imul(k,fe)|0,i=i+Math.imul(k,de)|0,n=n+Math.imul(g,ue)|0,a=(a=a+Math.imul(g,be)|0)+Math.imul(w,ue)|0,i=i+Math.imul(w,be)|0;var Ee=(d+(n=n+Math.imul(x,le)|0)|0)+((8191&(a=(a=a+Math.imul(x,pe)|0)+Math.imul(y,le)|0))<<13)|0;d=((i=i+Math.imul(y,pe)|0)+(a>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(U,X),a=(a=Math.imul(U,Y))+Math.imul(z,X)|0,i=Math.imul(z,Y),n=n+Math.imul(I,Q)|0,a=(a=a+Math.imul(I,ee)|0)+Math.imul(L,Q)|0,i=i+Math.imul(L,ee)|0,n=n+Math.imul(B,re)|0,a=(a=a+Math.imul(B,ne)|0)+Math.imul(R,re)|0,i=i+Math.imul(R,ne)|0,n=n+Math.imul(T,ie)|0,a=(a=a+Math.imul(T,oe)|0)+Math.imul(P,ie)|0,i=i+Math.imul(P,oe)|0,n=n+Math.imul(A,fe)|0,a=(a=a+Math.imul(A,de)|0)+Math.imul(E,fe)|0,i=i+Math.imul(E,de)|0,n=n+Math.imul(M,ue)|0,a=(a=a+Math.imul(M,be)|0)+Math.imul(k,ue)|0,i=i+Math.imul(k,be)|0;var Oe=(d+(n=n+Math.imul(g,le)|0)|0)+((8191&(a=(a=a+Math.imul(g,pe)|0)+Math.imul(w,le)|0))<<13)|0;d=((i=i+Math.imul(w,pe)|0)+(a>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(U,Q),a=(a=Math.imul(U,ee))+Math.imul(z,Q)|0,i=Math.imul(z,ee),n=n+Math.imul(I,re)|0,a=(a=a+Math.imul(I,ne)|0)+Math.imul(L,re)|0,i=i+Math.imul(L,ne)|0,n=n+Math.imul(B,ie)|0,a=(a=a+Math.imul(B,oe)|0)+Math.imul(R,ie)|0,i=i+Math.imul(R,oe)|0,n=n+Math.imul(T,fe)|0,a=(a=a+Math.imul(T,de)|0)+Math.imul(P,fe)|0,i=i+Math.imul(P,de)|0,n=n+Math.imul(A,ue)|0,a=(a=a+Math.imul(A,be)|0)+Math.imul(E,ue)|0,i=i+Math.imul(E,be)|0;var Te=(d+(n=n+Math.imul(M,le)|0)|0)+((8191&(a=(a=a+Math.imul(M,pe)|0)+Math.imul(k,le)|0))<<13)|0;d=((i=i+Math.imul(k,pe)|0)+(a>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(U,re),a=(a=Math.imul(U,ne))+Math.imul(z,re)|0,i=Math.imul(z,ne),n=n+Math.imul(I,ie)|0,a=(a=a+Math.imul(I,oe)|0)+Math.imul(L,ie)|0,i=i+Math.imul(L,oe)|0,n=n+Math.imul(B,fe)|0,a=(a=a+Math.imul(B,de)|0)+Math.imul(R,fe)|0,i=i+Math.imul(R,de)|0,n=n+Math.imul(T,ue)|0,a=(a=a+Math.imul(T,be)|0)+Math.imul(P,ue)|0,i=i+Math.imul(P,be)|0;var Pe=(d+(n=n+Math.imul(A,le)|0)|0)+((8191&(a=(a=a+Math.imul(A,pe)|0)+Math.imul(E,le)|0))<<13)|0;d=((i=i+Math.imul(E,pe)|0)+(a>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(U,ie),a=(a=Math.imul(U,oe))+Math.imul(z,ie)|0,i=Math.imul(z,oe),n=n+Math.imul(I,fe)|0,a=(a=a+Math.imul(I,de)|0)+Math.imul(L,fe)|0,i=i+Math.imul(L,de)|0,n=n+Math.imul(B,ue)|0,a=(a=a+Math.imul(B,be)|0)+Math.imul(R,ue)|0,i=i+Math.imul(R,be)|0;var je=(d+(n=n+Math.imul(T,le)|0)|0)+((8191&(a=(a=a+Math.imul(T,pe)|0)+Math.imul(P,le)|0))<<13)|0;d=((i=i+Math.imul(P,pe)|0)+(a>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(U,fe),a=(a=Math.imul(U,de))+Math.imul(z,fe)|0,i=Math.imul(z,de),n=n+Math.imul(I,ue)|0,a=(a=a+Math.imul(I,be)|0)+Math.imul(L,ue)|0,i=i+Math.imul(L,be)|0;var Be=(d+(n=n+Math.imul(B,le)|0)|0)+((8191&(a=(a=a+Math.imul(B,pe)|0)+Math.imul(R,le)|0))<<13)|0;d=((i=i+Math.imul(R,pe)|0)+(a>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(U,ue),a=(a=Math.imul(U,be))+Math.imul(z,ue)|0,i=Math.imul(z,be);var Re=(d+(n=n+Math.imul(I,le)|0)|0)+((8191&(a=(a=a+Math.imul(I,pe)|0)+Math.imul(L,le)|0))<<13)|0;d=((i=i+Math.imul(L,pe)|0)+(a>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Ce=(d+(n=Math.imul(U,le))|0)+((8191&(a=(a=Math.imul(U,pe))+Math.imul(z,le)|0))<<13)|0;return d=((i=Math.imul(z,pe))+(a>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,f[0]=me,f[1]=xe,f[2]=ye,f[3]=ve,f[4]=ge,f[5]=we,f[6]=_e,f[7]=Me,f[8]=ke,f[9]=Se,f[10]=Ae,f[11]=Ee,f[12]=Oe,f[13]=Te,f[14]=Pe,f[15]=je,f[16]=Be,f[17]=Re,f[18]=Ce,0!==d&&(f[19]=d,r.length++),r};function p(e,t,r){return(new m).mulp(e,t,r)}function m(e,t){this.x=e,this.y=t}Math.imul||(l=h),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?l(this,e,t):r<63?h(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,a=0,i=0;i>>26)|0)>>>26,o&=67108863}r.words[i]=c,n=o,o=a}return 0!==n?r.words[i]=n:r.length--,r.strip()}(this,e,t):p(this,e,t)},m.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},m.prototype.permute=function(e,t,r,n,a,i){for(var o=0;o>>=1)a++;return 1<>>=13,r[2*o+1]=8191&i,i>>>=13;for(o=2*t;o>=26,t+=n/67108864|0,t+=i>>>26,this.words[r]=67108863&i}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>a}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,n=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var i=e%26,o=Math.min((e-i)/26,this.length),c=67108863^67108863>>>i<o)for(this.length-=o,d=0;d=0&&(0!==s||d>=n);d--){var u=0|this.words[d];this.words[d]=s<<26-i|u>>>i,s=u&c}return f&&0!==s&&(f.words[f.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return a(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){a("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(a(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(a("number"==typeof e),a(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(f/67108864|0),this.words[n+r]=67108863&i}for(;n>26,this.words[n+r]=67108863&i;if(0===c)return this.strip();for(a(-1===c),c=0,n=0;n>26,this.words[n]=67108863&i;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),a=e,i=0|a.words[a.length-1];0!==(r=26-this._countBits(i))&&(a=a.ushln(r),n.iushln(r),i=0|a.words[a.length-1]);var c,f=n.length-a.length;if("mod"!==t){(c=new o(null)).length=f+1,c.words=new Array(c.length);for(var d=0;d=0;u--){var b=67108864*(0|n.words[a.length+u])+(0|n.words[a.length+u-1]);for(b=Math.min(b/i|0,67108863),n._ishlnsubmul(a,b,u);0!==n.negative;)b--,n.negative=0,n._ishlnsubmul(a,1,u),n.isZero()||(n.negative^=1);c&&(c.words[u]=b)}return c&&c.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:c||null,mod:n}},o.prototype.divmod=function(e,t,r){return a(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(c=this.neg().divmod(e,t),"mod"!==t&&(n=c.div.neg()),"div"!==t&&(i=c.mod.neg(),r&&0!==i.negative&&i.iadd(e)),{div:n,mod:i}):0===this.negative&&0!==e.negative?(c=this.divmod(e.neg(),t),"mod"!==t&&(n=c.div.neg()),{div:n,mod:c.mod}):0!=(this.negative&e.negative)?(c=this.neg().divmod(e.neg(),t),"div"!==t&&(i=c.mod.neg(),r&&0!==i.negative&&i.isub(e)),{div:c.div,mod:i}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var n,i,c},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),a=e.andln(1),i=r.cmp(n);return i<0||1===a&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){a(e<=67108863);for(var t=(1<<26)%e,r=0,n=this.length-1;n>=0;n--)r=(t*r+(0|this.words[n]))%e;return r},o.prototype.idivn=function(e){a(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*t;this.words[r]=n/e|0,t=n%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new o(1),i=new o(0),c=new o(0),f=new o(1),d=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++d;for(var s=r.clone(),u=t.clone();!t.isZero();){for(var b=0,h=1;0==(t.words[0]&h)&&b<26;++b,h<<=1);if(b>0)for(t.iushrn(b);b-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(s),i.isub(u)),n.iushrn(1),i.iushrn(1);for(var l=0,p=1;0==(r.words[0]&p)&&l<26;++l,p<<=1);if(l>0)for(r.iushrn(l);l-- >0;)(c.isOdd()||f.isOdd())&&(c.iadd(s),f.isub(u)),c.iushrn(1),f.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(c),i.isub(f)):(r.isub(t),c.isub(n),f.isub(i))}return{a:c,b:f,gcd:r.iushln(d)}},o.prototype._invmp=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,i=new o(1),c=new o(0),f=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var d=0,s=1;0==(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0)for(t.iushrn(d);d-- >0;)i.isOdd()&&i.iadd(f),i.iushrn(1);for(var u=0,b=1;0==(r.words[0]&b)&&u<26;++u,b<<=1);if(u>0)for(r.iushrn(u);u-- >0;)c.isOdd()&&c.iadd(f),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(c)):(r.isub(t),c.isub(i))}return(n=0===t.cmpn(1)?i:c).cmpn(0)<0&&n.iadd(e),n},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var a=t.cmp(r);if(a<0){var i=t;t=r,r=i}else if(0===a||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){a("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<>>26,c&=67108863,this.words[o]=c}return 0!==i&&(this.words[o]=i,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),a(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var n=0|this.words[r],a=0|e.words[r];if(n!==a){na&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new M(e)},o.prototype.toRed=function(e){return a(!this.red,"Already a number in reduction context"),a(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return a(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return a(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return a(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var x={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function g(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else a(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){M.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):r.strip(),r},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},i(v,y),v.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,a=i}a>>>=22,e.words[n-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=a,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(x[e])return x[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new g;else if("p192"===e)t=new w;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return x[e]=t,t},M.prototype._verify1=function(e){a(0===e.negative,"red works only with positives"),a(e.red,"red works only with red numbers")},M.prototype._verify2=function(e,t){a(0==(e.negative|t.negative),"red works only with positives"),a(e.red&&e.red===t.red,"red works only with red numbers")},M.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},M.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},M.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},M.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},M.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},M.prototype.isqr=function(e){return this.imul(e,e.clone())},M.prototype.sqr=function(e){return this.mul(e,e)},M.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(a(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),i=0;!n.isZero()&&0===n.andln(1);)i++,n.iushrn(1);a(!n.isZero());var c=new o(1).toRed(this),f=c.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new o(2*s*s).toRed(this);0!==this.pow(s,d).cmp(f);)s.redIAdd(f);for(var u=this.pow(s,n),b=this.pow(e,n.addn(1).iushrn(1)),h=this.pow(e,n),l=i;0!==h.cmp(c);){for(var p=h,m=0;0!==p.cmp(c);m++)p=p.redSqr();a(m=0;n--){for(var d=t.words[n],s=f-1;s>=0;s--){var u=d>>s&1;a!==r[0]&&(a=this.sqr(a)),0!==u||0!==i?(i<<=1,i|=u,(4===++c||0===n&&0===s)&&(a=this.mul(a,r[i]),c=0,i=0)):c=0}f=26}return a},M.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},M.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new k(e)},i(k,M),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(15)(e))},function(e,t){},function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var a=Object.getOwnPropertyDescriptor(t,r);a&&!("get"in a?!t.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,a)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.isHexString=t.getKeys=t.fromAscii=t.fromUtf8=t.toAscii=t.arrayContainsArray=t.getBinarySize=t.padToEven=t.stripHexPrefix=t.isHexPrefixed=void 0,a(r(199),t),a(r(200),t),a(r(443),t),a(r(127),t),a(r(444),t),a(r(49),t),a(r(445),t),a(r(36),t),a(r(136),t);var i=r(61);Object.defineProperty(t,"isHexPrefixed",{enumerable:!0,get:function(){return i.isHexPrefixed}}),Object.defineProperty(t,"stripHexPrefix",{enumerable:!0,get:function(){return i.stripHexPrefix}}),Object.defineProperty(t,"padToEven",{enumerable:!0,get:function(){return i.padToEven}}),Object.defineProperty(t,"getBinarySize",{enumerable:!0,get:function(){return i.getBinarySize}}),Object.defineProperty(t,"arrayContainsArray",{enumerable:!0,get:function(){return i.arrayContainsArray}}),Object.defineProperty(t,"toAscii",{enumerable:!0,get:function(){return i.toAscii}}),Object.defineProperty(t,"fromUtf8",{enumerable:!0,get:function(){return i.fromUtf8}}),Object.defineProperty(t,"fromAscii",{enumerable:!0,get:function(){return i.fromAscii}}),Object.defineProperty(t,"getKeys",{enumerable:!0,get:function(){return i.getKeys}}),Object.defineProperty(t,"isHexString",{enumerable:!0,get:function(){return i.isHexString}})},function(e,t,r){(function(e){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e,n){"use strict";function a(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var c;"object"===t(e)?e.exports=o:n.BN=o,o.BN=o,o.wordSize=26;try{c="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(384).Buffer}catch(e){}function f(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void a(!1,"Invalid character in "+e)}function d(e,t,r){var n=f(e,r);return r-1>=t&&(n|=f(e,r-1)<<4),n}function s(e,t,r,n){for(var i=0,o=0,c=Math.min(e.length,r),f=t;f=49?d-49+10:d>=17?d-17+10:d,a(d>=0&&o0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,r,n){if("number"==typeof e)return this._initNumber(e,r,n);if("object"===t(e))return this._initArray(e,r,n);"hex"===r&&(r=16),a(r===(0|r)&&r>=2&&r<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;n-=3)o=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[i]|=o<>>26-c&67108863,(c+=24)>=26&&(c-=26,i++);else if("le"===r)for(n=0,i=0;n>>26-c&67108863,(c+=24)>=26&&(c-=26,i++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)a=d(e,t,n)<=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,a=1;a<=67108863;a*=t)n++;n--,a=a/t|0;for(var i=e.length-r,o=i%n,c=Math.min(i,i-o)+r,f=0,d=r;d1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=b}catch(e){o.prototype.inspect=b}else o.prototype.inspect=b;function b(){return(this.red?""}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,i=0,o=0;o>>24-n&16777215,(n+=2)>=26&&(n-=26,o--),r=0!==i||o!==this.length-1?h[6-f.length]+f+r:f+r}for(0!==i&&(r=i.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=l[e],s=p[e];r="";var u=this.clone();for(u.negative=0;!u.isZero();){var b=u.modrn(s).toString(e);r=(u=u.idivn(s)).isZero()?b+r:h[d-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}a(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&a(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},c&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(c,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function m(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var a=0|e.words[0],i=0|t.words[0],o=a*i,c=67108863&o,f=o/67108864|0;r.words[0]=c;for(var d=1;d>>26,u=67108863&f,b=Math.min(d,t.length-1),h=Math.max(0,d-e.length+1);h<=b;h++){var l=d-h|0;s+=(o=(a=0|e.words[l])*(i=0|t.words[h])+u)/67108864|0,u=67108863&o}r.words[d]=0|u,f=0|s}return 0!==f?r.words[d]=0|f:r.length--,r._strip()}o.prototype.toArrayLike=function(e,t,r){this._strip();var n=this.byteLength(),i=r||Math.max(1,n);a(n<=i,"byte array longer than desired length"),a(i>0,"Requested array length <= 0");var o=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,n),o},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,a=0,i=0;a>8&255),r>16&255),6===i?(r>24&255),n=0,i=0):(n=o>>>24,i+=2)}if(r=0&&(e[r--]=o>>8&255),r>=0&&(e[r--]=o>>16&255),6===i?(r>=0&&(e[r--]=o>>24&255),n=0,i=0):(n=o>>>24,i+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){a("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){a("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var a=0,i=0;i>>26;for(;0!==a&&i>>26;if(this.length=r.length,0!==a)this.words[this.length]=a,this.length++;else if(r!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,a=this.cmp(e);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==i&&o>26,this.words[o]=67108863&t;if(0===i&&o>>13,h=0|o[1],l=8191&h,p=h>>>13,m=0|o[2],x=8191&m,y=m>>>13,v=0|o[3],g=8191&v,w=v>>>13,_=0|o[4],M=8191&_,k=_>>>13,S=0|o[5],A=8191&S,E=S>>>13,O=0|o[6],T=8191&O,P=O>>>13,j=0|o[7],B=8191&j,R=j>>>13,C=0|o[8],I=8191&C,L=C>>>13,N=0|o[9],U=8191&N,z=N>>>13,F=0|c[0],q=8191&F,H=F>>>13,D=0|c[1],K=8191&D,G=D>>>13,W=0|c[2],V=8191&W,Z=W>>>13,J=0|c[3],X=8191&J,Y=J>>>13,$=0|c[4],Q=8191&$,ee=$>>>13,te=0|c[5],re=8191&te,ne=te>>>13,ae=0|c[6],ie=8191&ae,oe=ae>>>13,ce=0|c[7],fe=8191&ce,de=ce>>>13,se=0|c[8],ue=8191&se,be=se>>>13,he=0|c[9],le=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(d+(n=Math.imul(u,q))|0)+((8191&(a=(a=Math.imul(u,H))+Math.imul(b,q)|0))<<13)|0;d=((i=Math.imul(b,H))+(a>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(l,q),a=(a=Math.imul(l,H))+Math.imul(p,q)|0,i=Math.imul(p,H);var xe=(d+(n=n+Math.imul(u,K)|0)|0)+((8191&(a=(a=a+Math.imul(u,G)|0)+Math.imul(b,K)|0))<<13)|0;d=((i=i+Math.imul(b,G)|0)+(a>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(x,q),a=(a=Math.imul(x,H))+Math.imul(y,q)|0,i=Math.imul(y,H),n=n+Math.imul(l,K)|0,a=(a=a+Math.imul(l,G)|0)+Math.imul(p,K)|0,i=i+Math.imul(p,G)|0;var ye=(d+(n=n+Math.imul(u,V)|0)|0)+((8191&(a=(a=a+Math.imul(u,Z)|0)+Math.imul(b,V)|0))<<13)|0;d=((i=i+Math.imul(b,Z)|0)+(a>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(g,q),a=(a=Math.imul(g,H))+Math.imul(w,q)|0,i=Math.imul(w,H),n=n+Math.imul(x,K)|0,a=(a=a+Math.imul(x,G)|0)+Math.imul(y,K)|0,i=i+Math.imul(y,G)|0,n=n+Math.imul(l,V)|0,a=(a=a+Math.imul(l,Z)|0)+Math.imul(p,V)|0,i=i+Math.imul(p,Z)|0;var ve=(d+(n=n+Math.imul(u,X)|0)|0)+((8191&(a=(a=a+Math.imul(u,Y)|0)+Math.imul(b,X)|0))<<13)|0;d=((i=i+Math.imul(b,Y)|0)+(a>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(M,q),a=(a=Math.imul(M,H))+Math.imul(k,q)|0,i=Math.imul(k,H),n=n+Math.imul(g,K)|0,a=(a=a+Math.imul(g,G)|0)+Math.imul(w,K)|0,i=i+Math.imul(w,G)|0,n=n+Math.imul(x,V)|0,a=(a=a+Math.imul(x,Z)|0)+Math.imul(y,V)|0,i=i+Math.imul(y,Z)|0,n=n+Math.imul(l,X)|0,a=(a=a+Math.imul(l,Y)|0)+Math.imul(p,X)|0,i=i+Math.imul(p,Y)|0;var ge=(d+(n=n+Math.imul(u,Q)|0)|0)+((8191&(a=(a=a+Math.imul(u,ee)|0)+Math.imul(b,Q)|0))<<13)|0;d=((i=i+Math.imul(b,ee)|0)+(a>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(A,q),a=(a=Math.imul(A,H))+Math.imul(E,q)|0,i=Math.imul(E,H),n=n+Math.imul(M,K)|0,a=(a=a+Math.imul(M,G)|0)+Math.imul(k,K)|0,i=i+Math.imul(k,G)|0,n=n+Math.imul(g,V)|0,a=(a=a+Math.imul(g,Z)|0)+Math.imul(w,V)|0,i=i+Math.imul(w,Z)|0,n=n+Math.imul(x,X)|0,a=(a=a+Math.imul(x,Y)|0)+Math.imul(y,X)|0,i=i+Math.imul(y,Y)|0,n=n+Math.imul(l,Q)|0,a=(a=a+Math.imul(l,ee)|0)+Math.imul(p,Q)|0,i=i+Math.imul(p,ee)|0;var we=(d+(n=n+Math.imul(u,re)|0)|0)+((8191&(a=(a=a+Math.imul(u,ne)|0)+Math.imul(b,re)|0))<<13)|0;d=((i=i+Math.imul(b,ne)|0)+(a>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(T,q),a=(a=Math.imul(T,H))+Math.imul(P,q)|0,i=Math.imul(P,H),n=n+Math.imul(A,K)|0,a=(a=a+Math.imul(A,G)|0)+Math.imul(E,K)|0,i=i+Math.imul(E,G)|0,n=n+Math.imul(M,V)|0,a=(a=a+Math.imul(M,Z)|0)+Math.imul(k,V)|0,i=i+Math.imul(k,Z)|0,n=n+Math.imul(g,X)|0,a=(a=a+Math.imul(g,Y)|0)+Math.imul(w,X)|0,i=i+Math.imul(w,Y)|0,n=n+Math.imul(x,Q)|0,a=(a=a+Math.imul(x,ee)|0)+Math.imul(y,Q)|0,i=i+Math.imul(y,ee)|0,n=n+Math.imul(l,re)|0,a=(a=a+Math.imul(l,ne)|0)+Math.imul(p,re)|0,i=i+Math.imul(p,ne)|0;var _e=(d+(n=n+Math.imul(u,ie)|0)|0)+((8191&(a=(a=a+Math.imul(u,oe)|0)+Math.imul(b,ie)|0))<<13)|0;d=((i=i+Math.imul(b,oe)|0)+(a>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(B,q),a=(a=Math.imul(B,H))+Math.imul(R,q)|0,i=Math.imul(R,H),n=n+Math.imul(T,K)|0,a=(a=a+Math.imul(T,G)|0)+Math.imul(P,K)|0,i=i+Math.imul(P,G)|0,n=n+Math.imul(A,V)|0,a=(a=a+Math.imul(A,Z)|0)+Math.imul(E,V)|0,i=i+Math.imul(E,Z)|0,n=n+Math.imul(M,X)|0,a=(a=a+Math.imul(M,Y)|0)+Math.imul(k,X)|0,i=i+Math.imul(k,Y)|0,n=n+Math.imul(g,Q)|0,a=(a=a+Math.imul(g,ee)|0)+Math.imul(w,Q)|0,i=i+Math.imul(w,ee)|0,n=n+Math.imul(x,re)|0,a=(a=a+Math.imul(x,ne)|0)+Math.imul(y,re)|0,i=i+Math.imul(y,ne)|0,n=n+Math.imul(l,ie)|0,a=(a=a+Math.imul(l,oe)|0)+Math.imul(p,ie)|0,i=i+Math.imul(p,oe)|0;var Me=(d+(n=n+Math.imul(u,fe)|0)|0)+((8191&(a=(a=a+Math.imul(u,de)|0)+Math.imul(b,fe)|0))<<13)|0;d=((i=i+Math.imul(b,de)|0)+(a>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(I,q),a=(a=Math.imul(I,H))+Math.imul(L,q)|0,i=Math.imul(L,H),n=n+Math.imul(B,K)|0,a=(a=a+Math.imul(B,G)|0)+Math.imul(R,K)|0,i=i+Math.imul(R,G)|0,n=n+Math.imul(T,V)|0,a=(a=a+Math.imul(T,Z)|0)+Math.imul(P,V)|0,i=i+Math.imul(P,Z)|0,n=n+Math.imul(A,X)|0,a=(a=a+Math.imul(A,Y)|0)+Math.imul(E,X)|0,i=i+Math.imul(E,Y)|0,n=n+Math.imul(M,Q)|0,a=(a=a+Math.imul(M,ee)|0)+Math.imul(k,Q)|0,i=i+Math.imul(k,ee)|0,n=n+Math.imul(g,re)|0,a=(a=a+Math.imul(g,ne)|0)+Math.imul(w,re)|0,i=i+Math.imul(w,ne)|0,n=n+Math.imul(x,ie)|0,a=(a=a+Math.imul(x,oe)|0)+Math.imul(y,ie)|0,i=i+Math.imul(y,oe)|0,n=n+Math.imul(l,fe)|0,a=(a=a+Math.imul(l,de)|0)+Math.imul(p,fe)|0,i=i+Math.imul(p,de)|0;var ke=(d+(n=n+Math.imul(u,ue)|0)|0)+((8191&(a=(a=a+Math.imul(u,be)|0)+Math.imul(b,ue)|0))<<13)|0;d=((i=i+Math.imul(b,be)|0)+(a>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(U,q),a=(a=Math.imul(U,H))+Math.imul(z,q)|0,i=Math.imul(z,H),n=n+Math.imul(I,K)|0,a=(a=a+Math.imul(I,G)|0)+Math.imul(L,K)|0,i=i+Math.imul(L,G)|0,n=n+Math.imul(B,V)|0,a=(a=a+Math.imul(B,Z)|0)+Math.imul(R,V)|0,i=i+Math.imul(R,Z)|0,n=n+Math.imul(T,X)|0,a=(a=a+Math.imul(T,Y)|0)+Math.imul(P,X)|0,i=i+Math.imul(P,Y)|0,n=n+Math.imul(A,Q)|0,a=(a=a+Math.imul(A,ee)|0)+Math.imul(E,Q)|0,i=i+Math.imul(E,ee)|0,n=n+Math.imul(M,re)|0,a=(a=a+Math.imul(M,ne)|0)+Math.imul(k,re)|0,i=i+Math.imul(k,ne)|0,n=n+Math.imul(g,ie)|0,a=(a=a+Math.imul(g,oe)|0)+Math.imul(w,ie)|0,i=i+Math.imul(w,oe)|0,n=n+Math.imul(x,fe)|0,a=(a=a+Math.imul(x,de)|0)+Math.imul(y,fe)|0,i=i+Math.imul(y,de)|0,n=n+Math.imul(l,ue)|0,a=(a=a+Math.imul(l,be)|0)+Math.imul(p,ue)|0,i=i+Math.imul(p,be)|0;var Se=(d+(n=n+Math.imul(u,le)|0)|0)+((8191&(a=(a=a+Math.imul(u,pe)|0)+Math.imul(b,le)|0))<<13)|0;d=((i=i+Math.imul(b,pe)|0)+(a>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(U,K),a=(a=Math.imul(U,G))+Math.imul(z,K)|0,i=Math.imul(z,G),n=n+Math.imul(I,V)|0,a=(a=a+Math.imul(I,Z)|0)+Math.imul(L,V)|0,i=i+Math.imul(L,Z)|0,n=n+Math.imul(B,X)|0,a=(a=a+Math.imul(B,Y)|0)+Math.imul(R,X)|0,i=i+Math.imul(R,Y)|0,n=n+Math.imul(T,Q)|0,a=(a=a+Math.imul(T,ee)|0)+Math.imul(P,Q)|0,i=i+Math.imul(P,ee)|0,n=n+Math.imul(A,re)|0,a=(a=a+Math.imul(A,ne)|0)+Math.imul(E,re)|0,i=i+Math.imul(E,ne)|0,n=n+Math.imul(M,ie)|0,a=(a=a+Math.imul(M,oe)|0)+Math.imul(k,ie)|0,i=i+Math.imul(k,oe)|0,n=n+Math.imul(g,fe)|0,a=(a=a+Math.imul(g,de)|0)+Math.imul(w,fe)|0,i=i+Math.imul(w,de)|0,n=n+Math.imul(x,ue)|0,a=(a=a+Math.imul(x,be)|0)+Math.imul(y,ue)|0,i=i+Math.imul(y,be)|0;var Ae=(d+(n=n+Math.imul(l,le)|0)|0)+((8191&(a=(a=a+Math.imul(l,pe)|0)+Math.imul(p,le)|0))<<13)|0;d=((i=i+Math.imul(p,pe)|0)+(a>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(U,V),a=(a=Math.imul(U,Z))+Math.imul(z,V)|0,i=Math.imul(z,Z),n=n+Math.imul(I,X)|0,a=(a=a+Math.imul(I,Y)|0)+Math.imul(L,X)|0,i=i+Math.imul(L,Y)|0,n=n+Math.imul(B,Q)|0,a=(a=a+Math.imul(B,ee)|0)+Math.imul(R,Q)|0,i=i+Math.imul(R,ee)|0,n=n+Math.imul(T,re)|0,a=(a=a+Math.imul(T,ne)|0)+Math.imul(P,re)|0,i=i+Math.imul(P,ne)|0,n=n+Math.imul(A,ie)|0,a=(a=a+Math.imul(A,oe)|0)+Math.imul(E,ie)|0,i=i+Math.imul(E,oe)|0,n=n+Math.imul(M,fe)|0,a=(a=a+Math.imul(M,de)|0)+Math.imul(k,fe)|0,i=i+Math.imul(k,de)|0,n=n+Math.imul(g,ue)|0,a=(a=a+Math.imul(g,be)|0)+Math.imul(w,ue)|0,i=i+Math.imul(w,be)|0;var Ee=(d+(n=n+Math.imul(x,le)|0)|0)+((8191&(a=(a=a+Math.imul(x,pe)|0)+Math.imul(y,le)|0))<<13)|0;d=((i=i+Math.imul(y,pe)|0)+(a>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(U,X),a=(a=Math.imul(U,Y))+Math.imul(z,X)|0,i=Math.imul(z,Y),n=n+Math.imul(I,Q)|0,a=(a=a+Math.imul(I,ee)|0)+Math.imul(L,Q)|0,i=i+Math.imul(L,ee)|0,n=n+Math.imul(B,re)|0,a=(a=a+Math.imul(B,ne)|0)+Math.imul(R,re)|0,i=i+Math.imul(R,ne)|0,n=n+Math.imul(T,ie)|0,a=(a=a+Math.imul(T,oe)|0)+Math.imul(P,ie)|0,i=i+Math.imul(P,oe)|0,n=n+Math.imul(A,fe)|0,a=(a=a+Math.imul(A,de)|0)+Math.imul(E,fe)|0,i=i+Math.imul(E,de)|0,n=n+Math.imul(M,ue)|0,a=(a=a+Math.imul(M,be)|0)+Math.imul(k,ue)|0,i=i+Math.imul(k,be)|0;var Oe=(d+(n=n+Math.imul(g,le)|0)|0)+((8191&(a=(a=a+Math.imul(g,pe)|0)+Math.imul(w,le)|0))<<13)|0;d=((i=i+Math.imul(w,pe)|0)+(a>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(U,Q),a=(a=Math.imul(U,ee))+Math.imul(z,Q)|0,i=Math.imul(z,ee),n=n+Math.imul(I,re)|0,a=(a=a+Math.imul(I,ne)|0)+Math.imul(L,re)|0,i=i+Math.imul(L,ne)|0,n=n+Math.imul(B,ie)|0,a=(a=a+Math.imul(B,oe)|0)+Math.imul(R,ie)|0,i=i+Math.imul(R,oe)|0,n=n+Math.imul(T,fe)|0,a=(a=a+Math.imul(T,de)|0)+Math.imul(P,fe)|0,i=i+Math.imul(P,de)|0,n=n+Math.imul(A,ue)|0,a=(a=a+Math.imul(A,be)|0)+Math.imul(E,ue)|0,i=i+Math.imul(E,be)|0;var Te=(d+(n=n+Math.imul(M,le)|0)|0)+((8191&(a=(a=a+Math.imul(M,pe)|0)+Math.imul(k,le)|0))<<13)|0;d=((i=i+Math.imul(k,pe)|0)+(a>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(U,re),a=(a=Math.imul(U,ne))+Math.imul(z,re)|0,i=Math.imul(z,ne),n=n+Math.imul(I,ie)|0,a=(a=a+Math.imul(I,oe)|0)+Math.imul(L,ie)|0,i=i+Math.imul(L,oe)|0,n=n+Math.imul(B,fe)|0,a=(a=a+Math.imul(B,de)|0)+Math.imul(R,fe)|0,i=i+Math.imul(R,de)|0,n=n+Math.imul(T,ue)|0,a=(a=a+Math.imul(T,be)|0)+Math.imul(P,ue)|0,i=i+Math.imul(P,be)|0;var Pe=(d+(n=n+Math.imul(A,le)|0)|0)+((8191&(a=(a=a+Math.imul(A,pe)|0)+Math.imul(E,le)|0))<<13)|0;d=((i=i+Math.imul(E,pe)|0)+(a>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(U,ie),a=(a=Math.imul(U,oe))+Math.imul(z,ie)|0,i=Math.imul(z,oe),n=n+Math.imul(I,fe)|0,a=(a=a+Math.imul(I,de)|0)+Math.imul(L,fe)|0,i=i+Math.imul(L,de)|0,n=n+Math.imul(B,ue)|0,a=(a=a+Math.imul(B,be)|0)+Math.imul(R,ue)|0,i=i+Math.imul(R,be)|0;var je=(d+(n=n+Math.imul(T,le)|0)|0)+((8191&(a=(a=a+Math.imul(T,pe)|0)+Math.imul(P,le)|0))<<13)|0;d=((i=i+Math.imul(P,pe)|0)+(a>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(U,fe),a=(a=Math.imul(U,de))+Math.imul(z,fe)|0,i=Math.imul(z,de),n=n+Math.imul(I,ue)|0,a=(a=a+Math.imul(I,be)|0)+Math.imul(L,ue)|0,i=i+Math.imul(L,be)|0;var Be=(d+(n=n+Math.imul(B,le)|0)|0)+((8191&(a=(a=a+Math.imul(B,pe)|0)+Math.imul(R,le)|0))<<13)|0;d=((i=i+Math.imul(R,pe)|0)+(a>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(U,ue),a=(a=Math.imul(U,be))+Math.imul(z,ue)|0,i=Math.imul(z,be);var Re=(d+(n=n+Math.imul(I,le)|0)|0)+((8191&(a=(a=a+Math.imul(I,pe)|0)+Math.imul(L,le)|0))<<13)|0;d=((i=i+Math.imul(L,pe)|0)+(a>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Ce=(d+(n=Math.imul(U,le))|0)+((8191&(a=(a=Math.imul(U,pe))+Math.imul(z,le)|0))<<13)|0;return d=((i=Math.imul(z,pe))+(a>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,f[0]=me,f[1]=xe,f[2]=ye,f[3]=ve,f[4]=ge,f[5]=we,f[6]=_e,f[7]=Me,f[8]=ke,f[9]=Se,f[10]=Ae,f[11]=Ee,f[12]=Oe,f[13]=Te,f[14]=Pe,f[15]=je,f[16]=Be,f[17]=Re,f[18]=Ce,0!==d&&(f[19]=d,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,a=0,i=0;i>>26)|0)>>>26,o&=67108863}r.words[i]=c,n=o,o=a}return 0!==n?r.words[i]=n:r.length--,r._strip()}function v(e,t,r){return y(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(x=m),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?x(this,e,t):r<63?m(this,e,t):r<1024?y(this,e,t):v(this,e,t)},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},g.prototype.permute=function(e,t,r,n,a,i){for(var o=0;o>>=1)a++;return 1<>>=13,r[2*o+1]=8191&i,i>>>=13;for(o=2*t;o>=26,r+=i/67108864|0,r+=o>>>26,this.words[n]=67108863&o}return 0!==r&&(this.words[n]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>a&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,n=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var i=e%26,o=Math.min((e-i)/26,this.length),c=67108863^67108863>>>i<o)for(this.length-=o,d=0;d=0&&(0!==s||d>=n);d--){var u=0|this.words[d];this.words[d]=s<<26-i|u>>>i,s=u&c}return f&&0!==s&&(f.words[f.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return a(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){a("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(a(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(a("number"==typeof e),a(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(f/67108864|0),this.words[n+r]=67108863&i}for(;n>26,this.words[n+r]=67108863&i;if(0===c)return this._strip();for(a(-1===c),c=0,n=0;n>26,this.words[n]=67108863&i;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),a=e,i=0|a.words[a.length-1];0!==(r=26-this._countBits(i))&&(a=a.ushln(r),n.iushln(r),i=0|a.words[a.length-1]);var c,f=n.length-a.length;if("mod"!==t){(c=new o(null)).length=f+1,c.words=new Array(c.length);for(var d=0;d=0;u--){var b=67108864*(0|n.words[a.length+u])+(0|n.words[a.length+u-1]);for(b=Math.min(b/i|0,67108863),n._ishlnsubmul(a,b,u);0!==n.negative;)b--,n.negative=0,n._ishlnsubmul(a,1,u),n.isZero()||(n.negative^=1);c&&(c.words[u]=b)}return c&&c._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:c||null,mod:n}},o.prototype.divmod=function(e,t,r){return a(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(c=this.neg().divmod(e,t),"mod"!==t&&(n=c.div.neg()),"div"!==t&&(i=c.mod.neg(),r&&0!==i.negative&&i.iadd(e)),{div:n,mod:i}):0===this.negative&&0!==e.negative?(c=this.divmod(e.neg(),t),"mod"!==t&&(n=c.div.neg()),{div:n,mod:c.mod}):0!=(this.negative&e.negative)?(c=this.neg().divmod(e.neg(),t),"div"!==t&&(i=c.mod.neg(),r&&0!==i.negative&&i.isub(e)),{div:c.div,mod:i}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var n,i,c},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),a=e.andln(1),i=r.cmp(n);return i<0||1===a&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),a(e<=67108863);for(var r=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(r*n+(0|this.words[i]))%e;return t?-n:n},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),a(e<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*r;this.words[n]=i/e|0,r=i%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new o(1),i=new o(0),c=new o(0),f=new o(1),d=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++d;for(var s=r.clone(),u=t.clone();!t.isZero();){for(var b=0,h=1;0==(t.words[0]&h)&&b<26;++b,h<<=1);if(b>0)for(t.iushrn(b);b-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(s),i.isub(u)),n.iushrn(1),i.iushrn(1);for(var l=0,p=1;0==(r.words[0]&p)&&l<26;++l,p<<=1);if(l>0)for(r.iushrn(l);l-- >0;)(c.isOdd()||f.isOdd())&&(c.iadd(s),f.isub(u)),c.iushrn(1),f.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(c),i.isub(f)):(r.isub(t),c.isub(n),f.isub(i))}return{a:c,b:f,gcd:r.iushln(d)}},o.prototype._invmp=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,i=new o(1),c=new o(0),f=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var d=0,s=1;0==(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0)for(t.iushrn(d);d-- >0;)i.isOdd()&&i.iadd(f),i.iushrn(1);for(var u=0,b=1;0==(r.words[0]&b)&&u<26;++u,b<<=1);if(u>0)for(r.iushrn(u);u-- >0;)c.isOdd()&&c.iadd(f),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(c)):(r.isub(t),c.isub(i))}return(n=0===t.cmpn(1)?i:c).cmpn(0)<0&&n.iadd(e),n},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var a=t.cmp(r);if(a<0){var i=t;t=r,r=i}else if(0===a||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){a("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<>>26,c&=67108863,this.words[o]=c}return 0!==i&&(this.words[o]=i,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),a(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var n=0|this.words[r],a=0|e.words[r];if(n!==a){na&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new E(e)},o.prototype.toRed=function(e){return a(!this.red,"Already a number in reduction context"),a(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return a(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return a(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return a(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function _(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function M(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function k(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else a(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function O(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}_.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},_.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},_.prototype.split=function(e,t){e.iushrn(this.n,0,t)},_.prototype.imulK=function(e){return e.imul(this.k)},i(M,_),M.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,a=i}a>>>=22,e.words[n-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},M.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=a,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new M;else if("p224"===e)t=new k;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return w[e]=t,t},E.prototype._verify1=function(e){a(0===e.negative,"red works only with positives"),a(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){a(0==(e.negative|t.negative),"red works only with positives"),a(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(a(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),i=0;!n.isZero()&&0===n.andln(1);)i++,n.iushrn(1);a(!n.isZero());var c=new o(1).toRed(this),f=c.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new o(2*s*s).toRed(this);0!==this.pow(s,d).cmp(f);)s.redIAdd(f);for(var u=this.pow(s,n),b=this.pow(e,n.addn(1).iushrn(1)),h=this.pow(e,n),l=i;0!==h.cmp(c);){for(var p=h,m=0;0!==p.cmp(c);m++)p=p.redSqr();a(m=0;n--){for(var d=t.words[n],s=f-1;s>=0;s--){var u=d>>s&1;a!==r[0]&&(a=this.sqr(a)),0!==u||0!==i?(i<<=1,i|=u,(4===++c||0===n&&0===s)&&(a=this.mul(a,r[i]),c=0,i=0)):c=0}f=26}return a},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new O(e)},i(O,E),O.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},O.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},O.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},O.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},O.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(15)(e))},function(e,t){},function(e,t){function r(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var a=0,i=function(){};return{s:i,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,c=!0,f=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){f=!0,o=e},f:function(){try{c||null==r.return||r.return()}finally{if(f)throw o}}}}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&void 0!==arguments[0]?arguments[0]:function(e){return new Uint8Array(e)},t=arguments.length>1?arguments[1]:void 0;return"function"==typeof e&&(e=e(t)),x("output",e,t),e}function g(e){return Object.prototype.toString.call(e).slice(8,-1)}e.exports=function(e){return{contextRandomize:function(t){switch(m(null===t||t instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),null!==t&&x("seed",t,32),e.contextRandomize(t)){case 1:throw new Error(c)}},privateKeyVerify:function(t){return x("private key",t,32),0===e.privateKeyVerify(t)},privateKeyNegate:function(t){switch(x("private key",t,32),e.privateKeyNegate(t)){case 0:return t;case 1:throw new Error(a)}},privateKeyTweakAdd:function(t,r){switch(x("private key",t,32),x("tweak",r,32),e.privateKeyTweakAdd(t,r)){case 0:return t;case 1:throw new Error(i)}},privateKeyTweakMul:function(t,r){switch(x("private key",t,32),x("tweak",r,32),e.privateKeyTweakMul(t,r)){case 0:return t;case 1:throw new Error(o)}},publicKeyVerify:function(t){return x("public key",t,[33,65]),0===e.publicKeyVerify(t)},publicKeyCreate:function(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0;switch(x("private key",t,32),y(r),n=v(n,r?33:65),e.publicKeyCreate(n,t)){case 0:return n;case 1:throw new Error(f);case 2:throw new Error(s)}},publicKeyConvert:function(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0;switch(x("public key",t,[33,65]),y(r),n=v(n,r?33:65),e.publicKeyConvert(n,t)){case 0:return n;case 1:throw new Error(d);case 2:throw new Error(s)}},publicKeyNegate:function(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0;switch(x("public key",t,[33,65]),y(r),n=v(n,r?33:65),e.publicKeyNegate(n,t)){case 0:return n;case 1:throw new Error(d);case 2:throw new Error(a);case 3:throw new Error(s)}},publicKeyCombine:function(t){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],a=arguments.length>2?arguments[2]:void 0;m(Array.isArray(t),"Expected public keys to be an Array"),m(t.length>0,"Expected public keys array will have more than zero items");var i,o=r(t);try{for(o.s();!(i=o.n()).done;){var c=i.value;x("public key",c,[33,65])}}catch(e){o.e(e)}finally{o.f()}switch(y(n),a=v(a,n?33:65),e.publicKeyCombine(a,t)){case 0:return a;case 1:throw new Error(d);case 2:throw new Error(u);case 3:throw new Error(s)}},publicKeyTweakAdd:function(t,r){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=arguments.length>3?arguments[3]:void 0;switch(x("public key",t,[33,65]),x("tweak",r,32),y(n),a=v(a,n?33:65),e.publicKeyTweakAdd(a,t,r)){case 0:return a;case 1:throw new Error(d);case 2:throw new Error(i)}},publicKeyTweakMul:function(t,r){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=arguments.length>3?arguments[3]:void 0;switch(x("public key",t,[33,65]),x("tweak",r,32),y(n),a=v(a,n?33:65),e.publicKeyTweakMul(a,t,r)){case 0:return a;case 1:throw new Error(d);case 2:throw new Error(o)}},signatureNormalize:function(t){switch(x("signature",t,64),e.signatureNormalize(t)){case 0:return t;case 1:throw new Error(b)}},signatureExport:function(t,r){x("signature",t,64);var n={output:r=v(r,72),outputlen:72};switch(e.signatureExport(n,t)){case 0:return r.slice(0,n.outputlen);case 1:throw new Error(b);case 2:throw new Error(a)}},signatureImport:function(t,r){switch(x("signature",t),r=v(r,64),e.signatureImport(r,t)){case 0:return r;case 1:throw new Error(b);case 2:throw new Error(a)}},ecdsaSign:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;x("message",t,32),x("private key",r,32),m("Object"===g(n),"Expected options to be an Object"),void 0!==n.data&&x("options.data",n.data),void 0!==n.noncefn&&m("Function"===g(n.noncefn),"Expected options.noncefn to be a Function");var o={signature:i=v(i,64),recid:null};switch(e.ecdsaSign(o,t,r,n.data,n.noncefn)){case 0:return o;case 1:throw new Error(h);case 2:throw new Error(a)}},ecdsaVerify:function(t,r,n){switch(x("signature",t,64),x("message",r,32),x("public key",n,[33,65]),e.ecdsaVerify(t,r,n)){case 0:return!0;case 3:return!1;case 1:throw new Error(b);case 2:throw new Error(d)}},ecdsaRecover:function(t,r,n){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4?arguments[4]:void 0;switch(x("signature",t,64),m("Number"===g(r)&&r>=0&&r<=3,"Expected recovery id to be a Number within interval [0, 3]"),x("message",n,32),y(i),o=v(o,i?33:65),e.ecdsaRecover(o,t,r,n)){case 0:return o;case 1:throw new Error(b);case 2:throw new Error(l);case 3:throw new Error(a)}},ecdh:function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0;switch(x("public key",t,[33,65]),x("private key",r,32),m("Object"===g(n),"Expected options to be an Object"),void 0!==n.data&&x("options.data",n.data),void 0!==n.hashfn?(m("Function"===g(n.hashfn),"Expected options.hashfn to be a Function"),void 0!==n.xbuf&&x("options.xbuf",n.xbuf,32),void 0!==n.ybuf&&x("options.ybuf",n.ybuf,32),x("output",a)):a=v(a,32),e.ecdh(a,t,r,n.data,n.hashfn,n.xbuf,n.ybuf)){case 0:return a;case 1:throw new Error(d);case 2:throw new Error(p)}}}}},function(e,t,r){var n=new(0,r(37).ec)("secp256k1"),a=n.curve,i=a.n.constructor;function o(e){var t=e[0];switch(t){case 2:case 3:return 33!==e.length?null:function(e,t){var r=new i(t);if(r.cmp(a.p)>=0)return null;var o=(r=r.toRed(a.red)).redSqr().redIMul(r).redIAdd(a.b).redSqrt();return 3===e!==o.isOdd()&&(o=o.redNeg()),n.keyPair({pub:{x:r,y:o}})}(t,e.subarray(1,33));case 4:case 6:case 7:return 65!==e.length?null:function(e,t,r){var o=new i(t),c=new i(r);if(o.cmp(a.p)>=0||c.cmp(a.p)>=0)return null;if(o=o.toRed(a.red),c=c.toRed(a.red),(6===e||7===e)&&c.isOdd()!==(7===e))return null;var f=o.redSqr().redIMul(o);return c.redSqr().redISub(f.redIAdd(a.b)).isZero()?n.keyPair({pub:{x:o,y:c}}):null}(t,e.subarray(1,33),e.subarray(33,65));default:return null}}function c(e,t){for(var r=t.encode(null,33===e.length),n=0;n=0)return 1;if(r.iadd(new i(e)),r.cmp(a.n)>=0&&r.isub(a.n),r.isZero())return 1;var n=r.toArrayLike(Uint8Array,"be",32);return e.set(n),0},privateKeyTweakMul:function(e,t){var r=new i(t);if(r.cmp(a.n)>=0||r.isZero())return 1;r.imul(new i(e)),r.cmp(a.n)>=0&&(r=r.umod(a.n));var n=r.toArrayLike(Uint8Array,"be",32);return e.set(n),0},publicKeyVerify:function(e){return null===o(e)?1:0},publicKeyCreate:function(e,t){var r=new i(t);return r.cmp(a.n)>=0||r.isZero()?1:(c(e,n.keyFromPrivate(t).getPublic()),0)},publicKeyConvert:function(e,t){var r=o(t);return null===r?1:(c(e,r.getPublic()),0)},publicKeyNegate:function(e,t){var r=o(t);if(null===r)return 1;var n=r.getPublic();return n.y=n.y.redNeg(),c(e,n),0},publicKeyCombine:function(e,t){for(var r=new Array(t.length),n=0;n=0)return 2;var f=n.getPublic().add(a.g.mul(r));return f.isInfinity()?2:(c(e,f),0)},publicKeyTweakMul:function(e,t,r){var n=o(t);return null===n?1:(r=new i(r)).cmp(a.n)>=0||r.isZero()?2:(c(e,n.getPublic().mul(r)),0)},signatureNormalize:function(e){var t=new i(e.subarray(0,32)),r=new i(e.subarray(32,64));return t.cmp(a.n)>=0||r.cmp(a.n)>=0?1:(1===r.cmp(n.nh)&&e.set(a.n.sub(r).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport:function(e,t){var r=t.subarray(0,32),n=t.subarray(32,64);if(new i(r).cmp(a.n)>=0)return 1;if(new i(n).cmp(a.n)>=0)return 1;var o=e.output,c=o.subarray(4,37);c[0]=0,c.set(r,1);for(var f=33,d=0;f>1&&0===c[d]&&!(128&c[d+1]);--f,++d);if(128&(c=c.subarray(d))[0])return 1;if(f>1&&0===c[0]&&!(128&c[1]))return 1;var s=o.subarray(39,72);s[0]=0,s.set(n,1);for(var u=33,b=0;u>1&&0===s[b]&&!(128&s[b+1]);--u,++b);return 128&(s=s.subarray(b))[0]||u>1&&0===s[0]&&!(128&s[1])?1:(e.outputlen=6+f+u,o[0]=48,o[1]=e.outputlen-2,o[2]=2,o[3]=c.length,o.set(c,4),o[4+f]=2,o[5+f]=s.length,o.set(s,6+f),0)},signatureImport:function(e,t){if(t.length<8)return 1;if(t.length>72)return 1;if(48!==t[0])return 1;if(t[1]!==t.length-2)return 1;if(2!==t[2])return 1;var r=t[3];if(0===r)return 1;if(5+r>=t.length)return 1;if(2!==t[4+r])return 1;var n=t[5+r];if(0===n)return 1;if(6+r+n!==t.length)return 1;if(128&t[4])return 1;if(r>1&&0===t[4]&&!(128&t[5]))return 1;if(128&t[r+6])return 1;if(n>1&&0===t[r+6]&&!(128&t[r+7]))return 1;var o=t.subarray(4,4+r);if(33===o.length&&0===o[0]&&(o=o.subarray(1)),o.length>32)return 1;var c=t.subarray(6+r);if(33===c.length&&0===c[0]&&(c=c.slice(1)),c.length>32)throw new Error("S length is too long");var f=new i(o);f.cmp(a.n)>=0&&(f=new i(0));var d=new i(t.subarray(6+r));return d.cmp(a.n)>=0&&(d=new i(0)),e.set(f.toArrayLike(Uint8Array,"be",32),0),e.set(d.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign:function(e,t,r,o,c){if(c){var f=c;c=function(e){var n=f(t,r,null,o,e);if(!(n instanceof Uint8Array&&32===n.length))throw new Error("This is the way");return new i(n)}}var d,s=new i(r);if(s.cmp(a.n)>=0||s.isZero())return 1;try{d=n.sign(t,r,{canonical:!0,k:c,pers:o})}catch(e){return 1}return e.signature.set(d.r.toArrayLike(Uint8Array,"be",32),0),e.signature.set(d.s.toArrayLike(Uint8Array,"be",32),32),e.recid=d.recoveryParam,0},ecdsaVerify:function(e,t,r){var c={r:e.subarray(0,32),s:e.subarray(32,64)},f=new i(c.r),d=new i(c.s);if(f.cmp(a.n)>=0||d.cmp(a.n)>=0)return 1;if(1===d.cmp(n.nh)||f.isZero()||d.isZero())return 3;var s=o(r);if(null===s)return 2;var u=s.getPublic();return n.verify(t,c,u)?0:3},ecdsaRecover:function(e,t,r,o){var f,d={r:t.slice(0,32),s:t.slice(32,64)},s=new i(d.r),u=new i(d.s);if(s.cmp(a.n)>=0||u.cmp(a.n)>=0)return 1;if(s.isZero()||u.isZero())return 2;try{f=n.recoverPubKey(o,d,r)}catch(e){return 2}return c(e,f),0},ecdh:function(e,t,r,c,f,d,s){var u=o(t);if(null===u)return 1;var b=new i(r);if(b.cmp(a.n)>=0||b.isZero())return 2;var h=u.getPublic().mul(b);if(void 0===f)for(var l=h.encode(null,!0),p=n.hash().update(l).digest(),m=0;m<32;++m)e[m]=p[m];else{d||(d=new Uint8Array(32));for(var x=h.getX().toArray("be",32),y=0;y<32;++y)d[y]=x[y];s||(s=new Uint8Array(32));for(var v=h.getY().toArray("be",32),g=0;g<32;++g)s[g]=v[g];var w=f(d,s,c);if(!(w instanceof Uint8Array&&w.length===e.length))return 2;e.set(w)}return 0}}},function(e){e.exports=JSON.parse('{"name":"elliptic","version":"6.5.4","description":"EC cryptography","main":"lib/elliptic.js","files":["lib"],"scripts":{"lint":"eslint lib test","lint:fix":"npm run lint -- --fix","unit":"istanbul test _mocha --reporter=spec test/index.js","test":"npm run lint && npm run unit","version":"grunt dist && git add dist/"},"repository":{"type":"git","url":"git@github.com:indutny/elliptic"},"keywords":["EC","Elliptic","curve","Cryptography"],"author":"Fedor Indutny ","license":"MIT","bugs":{"url":"https://github.com/indutny/elliptic/issues"},"homepage":"https://github.com/indutny/elliptic","devDependencies":{"brfs":"^2.0.2","coveralls":"^3.1.0","eslint":"^7.6.0","grunt":"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1","istanbul":"^0.4.5","mocha":"^8.0.1"},"dependencies":{"bn.js":"^4.11.9","brorand":"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1","inherits":"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}')},function(e,t){},function(e,t){},function(e,t,r){"use strict";var n=r(29),a=r(9),i=r(4),o=r(99),c=n.assert;function f(e){o.call(this,"short",e),this.a=new a(e.a,16).toRed(this.red),this.b=new a(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function d(e,t,r,n){o.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new a(t,16),this.y=new a(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function s(e,t,r,n){o.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new a(0)):(this.x=new a(t,16),this.y=new a(r,16),this.z=new a(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}i(f,o),e.exports=f,f.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new a(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new a(e.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))?r=i[0]:(r=i[1],c(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new a(e.a,16),b:new a(e.b,16)}})):this._getEndoBasis(r)}}},f.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:a.mont(e),r=new a(2).toRed(t).redInvm(),n=r.redNeg(),i=new a(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},f.prototype._getEndoBasis=function(e){for(var t,r,n,i,o,c,f,d,s,u=this.n.ushrn(Math.floor(this.n.bitLength()/2)),b=e,h=this.n.clone(),l=new a(1),p=new a(0),m=new a(0),x=new a(1),y=0;0!==b.cmpn(0);){var v=h.div(b);d=h.sub(v.mul(b)),s=m.sub(v.mul(l));var g=x.sub(v.mul(p));if(!n&&d.cmp(u)<0)t=f.neg(),r=l,n=d.neg(),i=s;else if(n&&2==++y)break;f=d,h=b,b=d,m=l,l=s,x=p,p=g}o=d.neg(),c=s;var w=n.sqr().add(i.sqr());return o.sqr().add(c.sqr()).cmp(w)>=0&&(o=t,c=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),c=c.neg()),[{a:n,b:i},{a:o,b:c}]},f.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],a=n.b.mul(e).divRound(this.n),i=r.b.neg().mul(e).divRound(this.n),o=a.mul(r.a),c=i.mul(n.a),f=a.mul(r.b),d=i.mul(n.b);return{k1:e.sub(o).sub(c),k2:f.add(d).neg()}},f.prototype.pointFromX=function(e,t){(e=new a(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},f.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),a=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(a).cmpn(0)},f.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,a=this._endoWnafT2,i=0;i":""},d.prototype.isInfinity=function(){return this.inf},d.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},d.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),a=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),i=a.redSqr().redISub(this.x.redAdd(this.x)),o=a.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,o)},d.prototype.getX=function(){return this.x.fromRed()},d.prototype.getY=function(){return this.y.fromRed()},d.prototype.mul=function(e){return e=new a(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},d.prototype.mulAdd=function(e,t,r){var n=[this,t],a=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,a):this.curve._wnafMulAdd(1,n,a,2)},d.prototype.jmulAdd=function(e,t,r){var n=[this,t],a=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,a,!0):this.curve._wnafMulAdd(1,n,a,2,!0)},d.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},d.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},d.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},i(s,o.BasePoint),f.prototype.jpoint=function(e,t,r){return new s(this,e,t,r)},s.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},s.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},s.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),a=e.x.redMul(r),i=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),c=n.redSub(a),f=i.redSub(o);if(0===c.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var d=c.redSqr(),s=d.redMul(c),u=n.redMul(d),b=f.redSqr().redIAdd(s).redISub(u).redISub(u),h=f.redMul(u.redISub(b)).redISub(i.redMul(s)),l=this.z.redMul(e.z).redMul(c);return this.curve.jpoint(b,h,l)},s.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),a=this.y,i=e.y.redMul(t).redMul(this.z),o=r.redSub(n),c=a.redSub(i);if(0===o.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=o.redSqr(),d=f.redMul(o),s=r.redMul(f),u=c.redSqr().redIAdd(d).redISub(s).redISub(s),b=c.redMul(s.redISub(u)).redISub(a.redMul(d)),h=this.z.redMul(o);return this.curve.jpoint(u,b,h)},s.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t=0)return!1;if(r.redIAdd(a),0===this.x.cmp(r))return!0}},s.prototype.inspect=function(){return this.isInfinity()?"":""},s.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(e,t,r){"use strict";var n=r(9),a=r(4),i=r(99),o=r(29);function c(e){i.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function f(e,t,r){i.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}a(c,i),e.exports=c,c.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},a(f,i.BasePoint),c.prototype.decodePoint=function(e,t){return this.point(o.toArray(e,t),1)},c.prototype.point=function(e,t){return new f(this,e,t)},c.prototype.pointFromJSON=function(e){return f.fromJSON(this,e)},f.prototype.precompute=function(){},f.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},f.fromJSON=function(e,t){return new f(e,t[0],t[1]||e.one)},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},f.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),a=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,a)},f.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),a=e.x.redAdd(e.z),i=e.x.redSub(e.z).redMul(r),o=a.redMul(n),c=t.z.redMul(i.redAdd(o).redSqr()),f=t.x.redMul(i.redISub(o).redSqr());return this.curve.point(c,f)},f.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),a=[];0!==t.cmpn(0);t.iushrn(1))a.push(t.andln(1));for(var i=a.length-1;i>=0;i--)0===a[i]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},f.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},f.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},f.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(e,t,r){"use strict";var n=r(29),a=r(9),i=r(4),o=r(99),c=n.assert;function f(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,o.call(this,"edwards",e),this.a=new a(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new a(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new a(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),c(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function d(e,t,r,n,i){o.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new a(t,16),this.y=new a(r,16),this.z=n?new a(n,16):this.curve.one,this.t=i&&new a(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}i(f,o),e.exports=f,f.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},f.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},f.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},f.prototype.pointFromX=function(e,t){(e=new a(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),i=this.one.redSub(this.c2.redMul(this.d).redMul(r)),o=n.redMul(i.redInvm()),c=o.redSqrt();if(0!==c.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");var f=c.fromRed().isOdd();return(t&&!f||!t&&f)&&(c=c.redNeg()),this.point(e,c)},f.prototype.pointFromY=function(e,t){(e=new a(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),i=r.redMul(this.d).redMul(this.c2).redSub(this.a),o=n.redMul(i.redInvm());if(0===o.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var c=o.redSqrt();if(0!==c.redSqr().redSub(o).cmp(this.zero))throw new Error("invalid point");return c.fromRed().isOdd()!==t&&(c=c.redNeg()),this.point(c,e)},f.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),a=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(a)},i(d,o.BasePoint),f.prototype.pointFromJSON=function(e){return d.fromJSON(this,e)},f.prototype.point=function(e,t,r,n){return new d(this,e,t,r,n)},d.fromJSON=function(e,t){return new d(e,t[0],t[1],t[2])},d.prototype.inspect=function(){return this.isInfinity()?"":""},d.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},d.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),a=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),i=n.redAdd(t),o=i.redSub(r),c=n.redSub(t),f=a.redMul(o),d=i.redMul(c),s=a.redMul(c),u=o.redMul(i);return this.curve.point(f,d,u,s)},d.prototype._projDbl=function(){var e,t,r,n,a,i,o=this.x.redAdd(this.y).redSqr(),c=this.x.redSqr(),f=this.y.redSqr();if(this.curve.twisted){var d=(n=this.curve._mulA(c)).redAdd(f);this.zOne?(e=o.redSub(c).redSub(f).redMul(d.redSub(this.curve.two)),t=d.redMul(n.redSub(f)),r=d.redSqr().redSub(d).redSub(d)):(a=this.z.redSqr(),i=d.redSub(a).redISub(a),e=o.redSub(c).redISub(f).redMul(i),t=d.redMul(n.redSub(f)),r=d.redMul(i))}else n=c.redAdd(f),a=this.curve._mulC(this.z).redSqr(),i=n.redSub(a).redSub(a),e=this.curve._mulC(o.redISub(n)).redMul(i),t=this.curve._mulC(n).redMul(c.redISub(f)),r=n.redMul(i);return this.curve.point(e,t,r)},d.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},d.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),a=this.z.redMul(e.z.redAdd(e.z)),i=r.redSub(t),o=a.redSub(n),c=a.redAdd(n),f=r.redAdd(t),d=i.redMul(o),s=c.redMul(f),u=i.redMul(f),b=o.redMul(c);return this.curve.point(d,s,b,u)},d.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),a=n.redSqr(),i=this.x.redMul(e.x),o=this.y.redMul(e.y),c=this.curve.d.redMul(i).redMul(o),f=a.redSub(c),d=a.redAdd(c),s=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(o),u=n.redMul(f).redMul(s);return this.curve.twisted?(t=n.redMul(d).redMul(o.redSub(this.curve._mulA(i))),r=f.redMul(d)):(t=n.redMul(d).redMul(o.redSub(i)),r=this.curve._mulC(f).redMul(d)),this.curve.point(u,t,r)},d.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},d.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},d.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},d.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},d.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},d.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},d.prototype.getX=function(){return this.normalize(),this.x.fromRed()},d.prototype.getY=function(){return this.normalize(),this.y.fromRed()},d.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},d.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},d.prototype.toP=d.prototype.normalize,d.prototype.mixedAdd=d.prototype.add},function(e,t,r){"use strict";t.sha1=r(394),t.sha224=r(395),t.sha256=r(126),t.sha384=r(396),t.sha512=r(204)},function(e,t,r){"use strict";var n=r(35),a=r(76),i=r(203),o=n.rotl32,c=n.sum32,f=n.sum32_5,d=i.ft_1,s=a.BlockHash,u=[1518500249,1859775393,2400959708,3395469782];function b(){if(!(this instanceof b))return new b;s.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(b,s),e.exports=b,b.blockSize=512,b.outSize=160,b.hmacStrength=80,b.padLength=64,b.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;nthis.blockSize&&(e=(new this.Hash).update(e).digest()),a(e.length<=this.blockSize);for(var t=e.length;t0))return o.iaddn(1),this.keyFromPrivate(o)}},b.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},b.prototype.sign=function(e,t,r,o){"object"===n(r)&&(o=r,r=null),o||(o={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new a(e,16));for(var c=this.n.byteLength(),f=t.getPrivate().toArray("be",c),d=e.toArray("be",c),s=new i({hash:this.hash,entropy:f,nonce:d,pers:o.pers,persEnc:o.persEnc||"utf8"}),b=this.n.sub(new a(1)),h=0;;h++){var l=o.k?o.k(h):new a(s.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(b)>=0)){var p=this.g.mul(l);if(!p.isInfinity()){var m=p.getX(),x=m.umod(this.n);if(0!==x.cmpn(0)){var y=l.invm(this.n).mul(x.mul(t.getPrivate()).iadd(e));if(0!==(y=y.umod(this.n)).cmpn(0)){var v=(p.getY().isOdd()?1:0)|(0!==m.cmp(x)?2:0);return o.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),v^=1),new u({r:x,s:y,recoveryParam:v})}}}}}},b.prototype.verify=function(e,t,r,n){e=this._truncateToN(new a(e,16)),r=this.keyFromPublic(r,n);var i=(t=new u(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var c,f=o.invm(this.n),d=f.mul(e).umod(this.n),s=f.mul(i).umod(this.n);return this.curve._maxwellTrick?!(c=this.g.jmulAdd(d,r.getPublic(),s)).isInfinity()&&c.eqXToP(i):!(c=this.g.mulAdd(d,r.getPublic(),s)).isInfinity()&&0===c.getX().umod(this.n).cmp(i)},b.prototype.recoverPubKey=function(e,t,r,n){d((3&r)===r,"The recovery param is more than two bits"),t=new u(t,n);var i=this.n,o=new a(e),c=t.r,f=t.s,s=1&r,b=r>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&b)throw new Error("Unable to find sencond key candinate");c=b?this.curve.pointFromX(c.add(this.curve.n),s):this.curve.pointFromX(c,s);var h=t.r.invm(i),l=i.sub(o).mul(h).umod(i),p=f.mul(h).umod(i);return this.g.mulAdd(l,c,p)},b.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new u(t,n)).recoveryParam)return t.recoveryParam;for(var a=0;a<4;a++){var i;try{i=this.recoverPubKey(e,t,a)}catch(e){continue}if(i.eq(r))return a}throw new Error("Unable to find valid recovery factor")}},function(e,t,r){"use strict";var n=r(25),a=r(201),i=r(30);function o(e){if(!(this instanceof o))return new o(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=a.toArray(e.entropy,e.entropyEnc||"hex"),r=a.toArray(e.nonce,e.nonceEnc||"hex"),n=a.toArray(e.pers,e.persEnc||"hex");i(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=o,o.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var a=0;a=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},o.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=a.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"}},function(e,t,r){"use strict";var n=r(9),a=r(29),i=a.assert;function o(e,t){if(e instanceof o)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function c(){this.place=0}function f(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var a=0,i=0,o=t.place;i>>=0;return!(a<=127)&&(t.place=o,a)}function d(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=o,o.prototype._importDER=function(e,t){e=a.toArray(e,t);var r=new c;if(48!==e[r.place++])return!1;var i=f(e,r);if(!1===i)return!1;if(i+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var o=f(e,r);if(!1===o)return!1;var d=e.slice(r.place,o+r.place);if(r.place+=o,2!==e[r.place++])return!1;var s=f(e,r);if(!1===s)return!1;if(e.length!==s+r.place)return!1;var u=e.slice(r.place,s+r.place);if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}return this.r=new n(d),this.s=new n(u),this.recoveryParam=null,!0},o.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=d(t),r=d(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];s(n,t.length),(n=n.concat(t)).push(2),s(n,r.length);var i=n.concat(r),o=[48];return s(o,i.length),o=o.concat(i),a.encode(o,e)}},function(e,t,r){"use strict";var n=r(25),a=r(125),i=r(29),o=i.assert,c=i.parseBytes,f=r(404),d=r(405);function s(e){if(o("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof s))return new s(e);e=a[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=s,s.prototype.sign=function(e,t){e=c(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),a=this.g.mul(n),i=this.encodePoint(a),o=this.hashInt(i,r.pubBytes(),e).mul(r.priv()),f=n.add(o).umod(this.curve.n);return this.makeSignature({R:a,S:f,Rencoded:i})},s.prototype.verify=function(e,t,r){e=c(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),a=this.hashInt(t.Rencoded(),n.pubBytes(),e),i=this.g.mul(t.S());return t.R().add(n.pub().mul(a)).eq(i)},s.prototype.hashInt=function(){for(var e=this.hash(),t=0;t0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return o.alloc(0);for(var t,r,n,a=o.allocUnsafe(e>>>0),i=this.head,c=0;i;)t=i.data,r=a,n=c,o.prototype.copy.call(t,r,n),c+=i.data.length,i=i.next;return a}},{key:"consume",value:function(e,t){var r;return ea.length?a.length:e;if(i===a.length?n+=a:n+=a.slice(0,e),0==(e-=i)){i===a.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=a.slice(i));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=o.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var a=r.data,i=e>a.length?a.length:e;if(a.copy(t,t.length-e,0,i),0==(e-=i)){i===a.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=a.slice(i));break}++n}return this.length-=n,t}},{key:f,value:function(e,t){return c(this,function(e){for(var t=1;t0,(function(e){n||(n=e),e&&o.forEach(d),i||(o.forEach(d),a(n))}))}));return t.reduce(s)}},function(e,t,r){(function(t){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){for(var r=0;r>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(n.p1600(this.state),this.count=0);return r},a.prototype.copy=function(e){for(var t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing},e.exports=a}).call(this,r(0).Buffer)},function(e,t){var r=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];t.p1600=function(e){for(var t=0;t<24;++t){var n=e[0]^e[10]^e[20]^e[30]^e[40],a=e[1]^e[11]^e[21]^e[31]^e[41],i=e[2]^e[12]^e[22]^e[32]^e[42],o=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],f=e[5]^e[15]^e[25]^e[35]^e[45],d=e[6]^e[16]^e[26]^e[36]^e[46],s=e[7]^e[17]^e[27]^e[37]^e[47],u=e[8]^e[18]^e[28]^e[38]^e[48],b=e[9]^e[19]^e[29]^e[39]^e[49],h=u^(i<<1|o>>>31),l=b^(o<<1|i>>>31),p=e[0]^h,m=e[1]^l,x=e[10]^h,y=e[11]^l,v=e[20]^h,g=e[21]^l,w=e[30]^h,_=e[31]^l,M=e[40]^h,k=e[41]^l;h=n^(c<<1|f>>>31),l=a^(f<<1|c>>>31);var S=e[2]^h,A=e[3]^l,E=e[12]^h,O=e[13]^l,T=e[22]^h,P=e[23]^l,j=e[32]^h,B=e[33]^l,R=e[42]^h,C=e[43]^l;h=i^(d<<1|s>>>31),l=o^(s<<1|d>>>31);var I=e[4]^h,L=e[5]^l,N=e[14]^h,U=e[15]^l,z=e[24]^h,F=e[25]^l,q=e[34]^h,H=e[35]^l,D=e[44]^h,K=e[45]^l;h=c^(u<<1|b>>>31),l=f^(b<<1|u>>>31);var G=e[6]^h,W=e[7]^l,V=e[16]^h,Z=e[17]^l,J=e[26]^h,X=e[27]^l,Y=e[36]^h,$=e[37]^l,Q=e[46]^h,ee=e[47]^l;h=d^(n<<1|a>>>31),l=s^(a<<1|n>>>31);var te=e[8]^h,re=e[9]^l,ne=e[18]^h,ae=e[19]^l,ie=e[28]^h,oe=e[29]^l,ce=e[38]^h,fe=e[39]^l,de=e[48]^h,se=e[49]^l,ue=p,be=m,he=y<<4|x>>>28,le=x<<4|y>>>28,pe=v<<3|g>>>29,me=g<<3|v>>>29,xe=_<<9|w>>>23,ye=w<<9|_>>>23,ve=M<<18|k>>>14,ge=k<<18|M>>>14,we=S<<1|A>>>31,_e=A<<1|S>>>31,Me=O<<12|E>>>20,ke=E<<12|O>>>20,Se=T<<10|P>>>22,Ae=P<<10|T>>>22,Ee=B<<13|j>>>19,Oe=j<<13|B>>>19,Te=R<<2|C>>>30,Pe=C<<2|R>>>30,je=L<<30|I>>>2,Be=I<<30|L>>>2,Re=N<<6|U>>>26,Ce=U<<6|N>>>26,Ie=F<<11|z>>>21,Le=z<<11|F>>>21,Ne=q<<15|H>>>17,Ue=H<<15|q>>>17,ze=K<<29|D>>>3,Fe=D<<29|K>>>3,qe=G<<28|W>>>4,He=W<<28|G>>>4,De=Z<<23|V>>>9,Ke=V<<23|Z>>>9,Ge=J<<25|X>>>7,We=X<<25|J>>>7,Ve=Y<<21|$>>>11,Ze=$<<21|Y>>>11,Je=ee<<24|Q>>>8,Xe=Q<<24|ee>>>8,Ye=te<<27|re>>>5,$e=re<<27|te>>>5,Qe=ne<<20|ae>>>12,et=ae<<20|ne>>>12,tt=oe<<7|ie>>>25,rt=ie<<7|oe>>>25,nt=ce<<8|fe>>>24,at=fe<<8|ce>>>24,it=de<<14|se>>>18,ot=se<<14|de>>>18;e[0]=ue^~Me&Ie,e[1]=be^~ke&Le,e[10]=qe^~Qe&pe,e[11]=He^~et&me,e[20]=we^~Re&Ge,e[21]=_e^~Ce&We,e[30]=Ye^~he&Se,e[31]=$e^~le&Ae,e[40]=je^~De&tt,e[41]=Be^~Ke&rt,e[2]=Me^~Ie&Ve,e[3]=ke^~Le&Ze,e[12]=Qe^~pe&Ee,e[13]=et^~me&Oe,e[22]=Re^~Ge&nt,e[23]=Ce^~We&at,e[32]=he^~Se&Ne,e[33]=le^~Ae&Ue,e[42]=De^~tt&xe,e[43]=Ke^~rt&ye,e[4]=Ie^~Ve&it,e[5]=Le^~Ze&ot,e[14]=pe^~Ee&ze,e[15]=me^~Oe&Fe,e[24]=Ge^~nt&ve,e[25]=We^~at&ge,e[34]=Se^~Ne&Je,e[35]=Ae^~Ue&Xe,e[44]=tt^~xe&Te,e[45]=rt^~ye&Pe,e[6]=Ve^~it&ue,e[7]=Ze^~ot&be,e[16]=Ee^~ze&qe,e[17]=Oe^~Fe&He,e[26]=nt^~ve&we,e[27]=at^~ge&_e,e[36]=Ne^~Je&Ye,e[37]=Ue^~Xe&$e,e[46]=xe^~Te&je,e[47]=ye^~Pe&Be,e[8]=it^~ue&Me,e[9]=ot^~be&ke,e[18]=ze^~qe&Qe,e[19]=Fe^~He&et,e[28]=ve^~we&Re,e[29]=ge^~_e&Ce,e[38]=Je^~Ye&he,e[39]=Xe^~$e&le,e[48]=Te^~je&De,e[49]=Pe^~Be&Ke,e[0]^=r[2*t],e[1]^=r[2*t+1]}}},function(e,t,r){(t=e.exports=r(214)).Stream=t,t.Readable=t,t.Writable=r(218),t.Duplex=r(65),t.Transform=r(219),t.PassThrough=r(426),t.finished=r(131),t.pipeline=r(427)},function(e,t){},function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function i(e,t){for(var r=0;r0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return o.alloc(0);for(var t,r,n,a=o.allocUnsafe(e>>>0),i=this.head,c=0;i;)t=i.data,r=a,n=c,o.prototype.copy.call(t,r,n),c+=i.data.length,i=i.next;return a}},{key:"consume",value:function(e,t){var r;return ea.length?a.length:e;if(i===a.length?n+=a:n+=a.slice(0,e),0==(e-=i)){i===a.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=a.slice(i));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=o.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var a=r.data,i=e>a.length?a.length:e;if(a.copy(t,t.length-e,0,i),0==(e-=i)){i===a.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=a.slice(i));break}++n}return this.length-=n,t}},{key:f,value:function(e,t){return c(this,function(e){for(var t=1;t0,(function(e){n||(n=e),e&&o.forEach(d),i||(o.forEach(d),a(n))}))}));return t.reduce(s)}},function(e,t,r){var n=r(4),a=r(66),i=r(6).Buffer,o=[1518500249,1859775393,-1894007588,-899497514],c=new Array(80);function f(){this.init(),this._w=c,a.call(this,64,56)}function d(e){return e<<30|e>>>2}function s(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(f,a),f.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},f.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,a=0|this._b,i=0|this._c,c=0|this._d,f=0|this._e,u=0;u<16;++u)r[u]=e.readInt32BE(4*u);for(;u<80;++u)r[u]=r[u-3]^r[u-8]^r[u-14]^r[u-16];for(var b=0;b<80;++b){var h=~~(b/20),l=0|((t=n)<<5|t>>>27)+s(h,a,i,c)+f+r[b]+o[h];f=c,c=i,i=d(a),a=n,n=l}this._a=n+this._a|0,this._b=a+this._b|0,this._c=i+this._c|0,this._d=c+this._d|0,this._e=f+this._e|0},f.prototype._hash=function(){var e=i.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=f},function(e,t,r){var n=r(4),a=r(66),i=r(6).Buffer,o=[1518500249,1859775393,-1894007588,-899497514],c=new Array(80);function f(){this.init(),this._w=c,a.call(this,64,56)}function d(e){return e<<5|e>>>27}function s(e){return e<<30|e>>>2}function u(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(f,a),f.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},f.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,a=0|this._b,i=0|this._c,c=0|this._d,f=0|this._e,b=0;b<16;++b)r[b]=e.readInt32BE(4*b);for(;b<80;++b)r[b]=(t=r[b-3]^r[b-8]^r[b-14]^r[b-16])<<1|t>>>31;for(var h=0;h<80;++h){var l=~~(h/20),p=d(n)+u(l,a,i,c)+f+r[h]+o[l]|0;f=c,c=i,i=s(a),a=n,n=p}this._a=n+this._a|0,this._b=a+this._b|0,this._c=i+this._c|0,this._d=c+this._d|0,this._e=f+this._e|0},f.prototype._hash=function(){var e=i.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=f},function(e,t,r){var n=r(4),a=r(220),i=r(66),o=r(6).Buffer,c=new Array(64);function f(){this.init(),this._w=c,i.call(this,64,56)}n(f,a),f.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},f.prototype._hash=function(){var e=o.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=f},function(e,t,r){var n=r(4),a=r(221),i=r(66),o=r(6).Buffer,c=new Array(160);function f(){this.init(),this._w=c,i.call(this,128,112)}n(f,a),f.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},f.prototype._hash=function(){var e=o.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=f},function(e,t,r){e.exports=a;var n=r(23).EventEmitter;function a(){n.call(this)}r(433)(a,n),a.Readable=r(77),a.Writable=r(439),a.Duplex=r(440),a.Transform=r(441),a.PassThrough=r(442),a.Stream=a,a.prototype.pipe=function(e,t){var r=this;function a(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",a),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",c),r.on("close",f));var o=!1;function c(){o||(o=!0,e.end())}function f(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function d(e){if(s(),0===n.listenerCount(this,"error"))throw e}function s(){r.removeListener("data",a),e.removeListener("drain",i),r.removeListener("end",c),r.removeListener("close",f),r.removeListener("error",d),e.removeListener("error",d),r.removeListener("end",s),r.removeListener("close",s),e.removeListener("close",s)}return r.on("error",d),e.on("error",d),r.on("end",s),r.on("close",s),e.on("close",s),e.emit("pipe",r),e}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},function(e,t){},function(e,t,r){"use strict";var n=r(134).Buffer,a=r(436);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t,r,a,i=n.allocUnsafe(e>>>0),o=this.head,c=0;o;)t=o.data,r=i,a=c,t.copy(r,a),c+=o.data.length,o=o.next;return i},e}(),a&&a.inspect&&a.inspect.custom&&(e.exports.prototype[a.inspect.custom]=function(){var e=a.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var n,a,i,o,c,f=1,d={},s=!1,u=e.document,b=Object.getPrototypeOf&&Object.getPrototypeOf(e);b=b&&b.setTimeout?b:e,"[object process]"==={}.toString.call(e.process)?n=function(e){t.nextTick((function(){l(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){l(e.data)},n=function(e){i.port2.postMessage(e)}):u&&"onreadystatechange"in u.createElement("script")?(a=u.documentElement,n=function(e){var t=u.createElement("script");t.onreadystatechange=function(){l(e),t.onreadystatechange=null,a.removeChild(t),t=null},a.appendChild(t)}):n=function(e){setTimeout(l,0,e)}:(o="setImmediate$"+Math.random()+"$",c=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&l(+t.data.slice(o.length))},e.addEventListener?e.addEventListener("message",c,!1):e.attachEvent("onmessage",c),n=function(t){e.postMessage(o+t,"*")}),b.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r28&&o%2==1||1===o||28===o)&&((c=e.from(n))[0]|=128),(0,i.bufferToHex)(e.concat([(0,i.setLengthLeft)(r,32),(0,i.setLengthLeft)(c,32)]))};t.fromRpcSig=function(e){var t,r,n,a=(0,i.toBuffer)(e);if(a.length>=65)t=a.slice(0,32),r=a.slice(32,64),n=(0,i.bufferToInt)(a.slice(64));else{if(64!==a.length)throw new Error("Invalid signature length");t=a.slice(0,32),r=a.slice(32,64),n=(0,i.bufferToInt)(a.slice(32,33))>>7,r[0]&=127}return n<27&&(n+=27),{v:n,r:t,s:r}};t.isValidSignature=function(e,t,r,n,i){void 0===n&&(n=!0);var o=new a.BN("7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0",16),c=new a.BN("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",16);if(32!==t.length||32!==r.length)return!1;if(!s(d(e,i)))return!1;var f=new a.BN(t),u=new a.BN(r);return!(f.isZero()||f.gt(c)||u.isZero()||u.gt(c))&&(!n||1!==u.cmp(o))};t.hashPersonalMessage=function(t){(0,c.assertIsBuffer)(t);var r=e.from("Ethereum Signed Message:\n".concat(t.length),"utf-8");return(0,o.keccak)(e.concat([r,t]))}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";(function(e){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.defineProperties=void 0;var i=a(r(14)),o=r(61),c=r(36),f=r(49);t.defineProperties=function(t,r,a){if(t.raw=[],t._fields=[],t.toJSON=function(e){if(void 0===e&&(e=!1),e){var r={};return t._fields.forEach((function(e){r[e]="0x".concat(t[e].toString("hex"))})),r}return(0,f.baToJSON)(t.raw)},t.serialize=function(){return c.rlp.encode(t.raw)},r.forEach((function(r,n){function a(){return t.raw[n]}function o(a){"00"!==(a=(0,f.toBuffer)(a)).toString("hex")||r.allowZero||(a=e.allocUnsafe(0)),r.allowLess&&r.length?(a=(0,f.unpadBuffer)(a),(0,i.default)(r.length>=a.length,"The field ".concat(r.name," must not have more ").concat(r.length," bytes"))):r.allowZero&&0===a.length||!r.length||(0,i.default)(r.length===a.length,"The field ".concat(r.name," must have byte length of ").concat(r.length)),t.raw[n]=a}t._fields.push(r.name),Object.defineProperty(t,r.name,{enumerable:!0,configurable:!0,get:a,set:o}),r.default&&(t[r.name]=r.default),r.alias&&Object.defineProperty(t,r.alias,{enumerable:!1,configurable:!0,set:o,get:a})})),a)if("string"==typeof a&&(a=e.from((0,o.stripHexPrefix)(a),"hex")),e.isBuffer(a)&&(a=c.rlp.decode(a)),Array.isArray(a)){if(a.length>t._fields.length)throw new Error("wrong number of fields in data");a.forEach((function(e,r){t[t._fields[r]]=(0,f.toBuffer)(e)}))}else{if("object"!==n(a))throw new Error("invalid data");var d=Object.keys(a);r.forEach((function(e){-1!==d.indexOf(e.name)&&(t[e.name]=a[e.name]),-1!==d.indexOf(e.alias)&&(t[e.alias]=a[e.alias])}))}}}).call(this,r(0).Buffer)},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}Object.defineProperty(t,"__esModule",{value:!0});var a=r(447);function i(e){return"string"==typeof e&&(!!/^(0x)?[0-9a-f]{512}$/i.test(e)&&!(!/^(0x)?[0-9a-f]{512}$/.test(e)&&!/^(0x)?[0-9A-F]{512}$/.test(e)))}function o(e,t){"object"===n(t)&&t.constructor===Uint8Array&&(t=a.bytesToHex(t));for(var r=a.keccak256(t).replace("0x",""),i=0;i<12;i+=4){var o=(parseInt(r.substr(i,2),16)<<8)+parseInt(r.substr(i+2,2),16)&2047,f=1<=48&&e<=57)return e-48;if(e>=65&&e<=70)return e-55;if(e>=97&&e<=102)return e-87;throw new Error("invalid bloom")}function f(e){return"string"==typeof e&&(!!/^(0x)?[0-9a-f]{64}$/i.test(e)&&!(!/^(0x)?[0-9a-f]{64}$/.test(e)&&!/^(0x)?[0-9A-F]{64}$/.test(e)))}function d(e){return"string"==typeof e&&(!!e.match(/^(0x)?[0-9a-fA-F]{40}$/)||!!e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/))}t.isBloom=i,t.isInBloom=o,t.isUserEthereumAddressInBloom=function(e,t){if(!i(e))throw new Error("Invalid bloom given");if(!d(t))throw new Error('Invalid ethereum address given: "'.concat(t,'"'));return o(e,a.padLeft(t,64))},t.isContractAddressInBloom=function(e,t){if(!i(e))throw new Error("Invalid bloom given");if(!d(t))throw new Error('Invalid contract address given: "'.concat(t,'"'));return o(e,t)},t.isTopicInBloom=function(e,t){if(!i(e))throw new Error("Invalid bloom given");if(!f(t))throw new Error("Invalid topic");return o(e,t)},t.isTopic=f,t.isAddress=d},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(94);function a(e){if(null==e)throw new Error("cannot convert null value to array");if("string"==typeof e){var t=e.match(/^(0x)?[0-9a-fA-F]*$/);if(!t)throw new Error("invalid hexidecimal string");if("0x"!==t[1])throw new Error("hex string must have 0x prefix");(e=e.substring(2)).length%2&&(e="0"+e);for(var r=[],n=0;n=256||parseInt(String(r))!=r)return!1}return!0}(e))return i(new Uint8Array(e));throw new Error("invalid arrayify value")}function i(e){var t=arguments;return void 0!==e.slice||(e.slice=function(){var r=Array.prototype.slice.call(t);return i(new Uint8Array(Array.prototype.slice.apply(e,r)))}),e}t.keccak256=function(e){return"0x"+n.keccak_256(a(e))},t.padLeft=function(e,t){var r=/^0x/i.test(e)||"number"==typeof e,n=t-(e=e.toString().replace(/^0x/i,"")).length+1>=0?t-e.length+1:0;return(r?"0x":"")+new Array(n).join("0")+e},t.bytesToHex=function(e){for(var t=[],r=0;r>>4).toString(16)),t.push((15&e[r]).toString(16));return"0x".concat(t.join("").replace(/^0+/,""))},t.toByteArray=a},function(e,t,r){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=r(98),i=r(197),o=function(e){var t=n(e);if("string"===t)return i.isHexStrict(e)?new a(e.replace(/0x/i,""),16):new a(e,10);if("number"===t)return new a(e);if(i.isBigNumber(e))return new a(e.toString(10));if(i.isBN(e))return e;throw new Error(e+" is not a number")},c=function(e,t,r){var n,c;if("bytes"===(e=function(e){return e.startsWith("int[")?"int256"+e.slice(3):"int"===e?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):"uint"===e?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):"fixed"===e?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):"ufixed"===e?"ufixed128x128":e}(e))){if(t.replace(/^0x/i,"").length%2!=0)throw new Error("Invalid bytes characters "+t.length);return t}if("string"===e)return i.utf8ToHex(t);if("bool"===e)return t?"01":"00";if(e.startsWith("address")){if(n=r?64:40,!i.isAddress(t))throw new Error(t+" is not a valid address, or the checksum is invalid.");return i.leftPad(t.toLowerCase(),n)}if(n=function(e){var t=/^\D+(\d+).*$/.exec(e);return t?parseInt(t[1],10):null}(e),e.startsWith("bytes")){if(!n)throw new Error("bytes[] not yet supported in solidity");if(r&&(n=32),n<1||n>32||n256)throw new Error("Invalid uint"+n+" size");if((c=o(t)).bitLength()>n)throw new Error("Supplied uint exceeds width: "+n+" vs "+c.bitLength());if(c.lt(new a(0)))throw new Error("Supplied uint "+c.toString()+" is negative");return n?i.leftPad(c.toString("hex"),n/8*2):c}if(e.startsWith("int")){if(n%8||n<8||n>256)throw new Error("Invalid int"+n+" size");if((c=o(t)).bitLength()>n)throw new Error("Supplied int exceeds width: "+n+" vs "+c.bitLength());return c.lt(new a(0))?c.toTwos(n).toString("hex"):n?i.leftPad(c.toString("hex"),n/8*2):c}throw new Error("Unsupported or invalid type: "+e)},f=function(e){if(Array.isArray(e))throw new Error("Autodetection of array types is not supported.");var t,r,o="";if(e&&"object"===n(e)&&(e.hasOwnProperty("v")||e.hasOwnProperty("t")||e.hasOwnProperty("value")||e.hasOwnProperty("type"))?(t=e.hasOwnProperty("t")?e.t:e.type,o=e.hasOwnProperty("v")?e.v:e.value):(t=i.toHex(e,!0),o=i.toHex(e),t.startsWith("int")||t.startsWith("uint")||(t="bytes")),!t.startsWith("int")&&!t.startsWith("uint")||"string"!=typeof o||/^(-)?0x/i.test(o)||(o=new a(o)),Array.isArray(o)){if((r=function(e){var t=/^\D+\d*\[(\d+)\]$/.exec(e);return t?parseInt(t[1],10):null}(t))&&o.length!==r)throw new Error(t+" is not matching the given array "+JSON.stringify(o));r=o.length}return Array.isArray(o)?o.map((function(e){return c(t,e,r).toString("hex").replace("0x","")})).join(""):c(t,o,r).toString("hex").replace("0x","")};e.exports={soliditySha3:function(){var e=Array.prototype.slice.call(arguments),t=e.map(f);return i.sha3("0x"+t.join(""))},soliditySha3Raw:function(){return i.sha3Raw("0x"+Array.prototype.slice.call(arguments).map(f).join(""))},encodePacked:function(){var e=Array.prototype.slice.call(arguments),t=e.map(f);return"0x"+t.join("").toLowerCase()}}},function(e,t,r){(function(e){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(e,n){"use strict";function a(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var c;"object"===t(e)?e.exports=o:n.BN=o,o.BN=o,o.wordSize=26;try{c="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(450).Buffer}catch(e){}function f(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void a(!1,"Invalid character in "+e)}function d(e,t,r){var n=f(e,r);return r-1>=t&&(n|=f(e,r-1)<<4),n}function s(e,t,r,n){for(var i=0,o=0,c=Math.min(e.length,r),f=t;f=49?d-49+10:d>=17?d-17+10:d,a(d>=0&&o0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,r,n){if("number"==typeof e)return this._initNumber(e,r,n);if("object"===t(e))return this._initArray(e,r,n);"hex"===r&&(r=16),a(r===(0|r)&&r>=2&&r<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;n-=3)o=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[i]|=o<>>26-c&67108863,(c+=24)>=26&&(c-=26,i++);else if("le"===r)for(n=0,i=0;n>>26-c&67108863,(c+=24)>=26&&(c-=26,i++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)a=d(e,t,n)<=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(i-=18,o+=1,this.words[o]|=a>>>26):i+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,a=1;a<=67108863;a*=t)n++;n--,a=a/t|0;for(var i=e.length-r,o=i%n,c=Math.min(i,i-o)+r,f=0,d=r;d1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=b}catch(e){o.prototype.inspect=b}else o.prototype.inspect=b;function b(){return(this.red?""}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var n=0,i=0,o=0;o>>24-n&16777215,(n+=2)>=26&&(n-=26,o--),r=0!==i||o!==this.length-1?h[6-f.length]+f+r:f+r}for(0!==i&&(r=i.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=l[e],s=p[e];r="";var u=this.clone();for(u.negative=0;!u.isZero();){var b=u.modrn(s).toString(e);r=(u=u.idivn(s)).isZero()?b+r:h[d-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}a(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&a(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},c&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(c,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function m(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var a=0|e.words[0],i=0|t.words[0],o=a*i,c=67108863&o,f=o/67108864|0;r.words[0]=c;for(var d=1;d>>26,u=67108863&f,b=Math.min(d,t.length-1),h=Math.max(0,d-e.length+1);h<=b;h++){var l=d-h|0;s+=(o=(a=0|e.words[l])*(i=0|t.words[h])+u)/67108864|0,u=67108863&o}r.words[d]=0|u,f=0|s}return 0!==f?r.words[d]=0|f:r.length--,r._strip()}o.prototype.toArrayLike=function(e,t,r){this._strip();var n=this.byteLength(),i=r||Math.max(1,n);a(n<=i,"byte array longer than desired length"),a(i>0,"Requested array length <= 0");var o=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,i);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,n),o},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,a=0,i=0;a>8&255),r>16&255),6===i?(r>24&255),n=0,i=0):(n=o>>>24,i+=2)}if(r=0&&(e[r--]=o>>8&255),r>=0&&(e[r--]=o>>16&255),6===i?(r>=0&&(e[r--]=o>>24&255),n=0,i=0):(n=o>>>24,i+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){a("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){a("number"==typeof e&&e>=0);var r=e/26|0,n=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var a=0,i=0;i>>26;for(;0!==a&&i>>26;if(this.length=r.length,0!==a)this.words[this.length]=a,this.length++;else if(r!==this)for(;ie.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,a=this.cmp(e);if(0===a)return this.negative=0,this.length=1,this.words[0]=0,this;a>0?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>26,this.words[o]=67108863&t;for(;0!==i&&o>26,this.words[o]=67108863&t;if(0===i&&o>>13,h=0|o[1],l=8191&h,p=h>>>13,m=0|o[2],x=8191&m,y=m>>>13,v=0|o[3],g=8191&v,w=v>>>13,_=0|o[4],M=8191&_,k=_>>>13,S=0|o[5],A=8191&S,E=S>>>13,O=0|o[6],T=8191&O,P=O>>>13,j=0|o[7],B=8191&j,R=j>>>13,C=0|o[8],I=8191&C,L=C>>>13,N=0|o[9],U=8191&N,z=N>>>13,F=0|c[0],q=8191&F,H=F>>>13,D=0|c[1],K=8191&D,G=D>>>13,W=0|c[2],V=8191&W,Z=W>>>13,J=0|c[3],X=8191&J,Y=J>>>13,$=0|c[4],Q=8191&$,ee=$>>>13,te=0|c[5],re=8191&te,ne=te>>>13,ae=0|c[6],ie=8191&ae,oe=ae>>>13,ce=0|c[7],fe=8191&ce,de=ce>>>13,se=0|c[8],ue=8191&se,be=se>>>13,he=0|c[9],le=8191&he,pe=he>>>13;r.negative=e.negative^t.negative,r.length=19;var me=(d+(n=Math.imul(u,q))|0)+((8191&(a=(a=Math.imul(u,H))+Math.imul(b,q)|0))<<13)|0;d=((i=Math.imul(b,H))+(a>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(l,q),a=(a=Math.imul(l,H))+Math.imul(p,q)|0,i=Math.imul(p,H);var xe=(d+(n=n+Math.imul(u,K)|0)|0)+((8191&(a=(a=a+Math.imul(u,G)|0)+Math.imul(b,K)|0))<<13)|0;d=((i=i+Math.imul(b,G)|0)+(a>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(x,q),a=(a=Math.imul(x,H))+Math.imul(y,q)|0,i=Math.imul(y,H),n=n+Math.imul(l,K)|0,a=(a=a+Math.imul(l,G)|0)+Math.imul(p,K)|0,i=i+Math.imul(p,G)|0;var ye=(d+(n=n+Math.imul(u,V)|0)|0)+((8191&(a=(a=a+Math.imul(u,Z)|0)+Math.imul(b,V)|0))<<13)|0;d=((i=i+Math.imul(b,Z)|0)+(a>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(g,q),a=(a=Math.imul(g,H))+Math.imul(w,q)|0,i=Math.imul(w,H),n=n+Math.imul(x,K)|0,a=(a=a+Math.imul(x,G)|0)+Math.imul(y,K)|0,i=i+Math.imul(y,G)|0,n=n+Math.imul(l,V)|0,a=(a=a+Math.imul(l,Z)|0)+Math.imul(p,V)|0,i=i+Math.imul(p,Z)|0;var ve=(d+(n=n+Math.imul(u,X)|0)|0)+((8191&(a=(a=a+Math.imul(u,Y)|0)+Math.imul(b,X)|0))<<13)|0;d=((i=i+Math.imul(b,Y)|0)+(a>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(M,q),a=(a=Math.imul(M,H))+Math.imul(k,q)|0,i=Math.imul(k,H),n=n+Math.imul(g,K)|0,a=(a=a+Math.imul(g,G)|0)+Math.imul(w,K)|0,i=i+Math.imul(w,G)|0,n=n+Math.imul(x,V)|0,a=(a=a+Math.imul(x,Z)|0)+Math.imul(y,V)|0,i=i+Math.imul(y,Z)|0,n=n+Math.imul(l,X)|0,a=(a=a+Math.imul(l,Y)|0)+Math.imul(p,X)|0,i=i+Math.imul(p,Y)|0;var ge=(d+(n=n+Math.imul(u,Q)|0)|0)+((8191&(a=(a=a+Math.imul(u,ee)|0)+Math.imul(b,Q)|0))<<13)|0;d=((i=i+Math.imul(b,ee)|0)+(a>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(A,q),a=(a=Math.imul(A,H))+Math.imul(E,q)|0,i=Math.imul(E,H),n=n+Math.imul(M,K)|0,a=(a=a+Math.imul(M,G)|0)+Math.imul(k,K)|0,i=i+Math.imul(k,G)|0,n=n+Math.imul(g,V)|0,a=(a=a+Math.imul(g,Z)|0)+Math.imul(w,V)|0,i=i+Math.imul(w,Z)|0,n=n+Math.imul(x,X)|0,a=(a=a+Math.imul(x,Y)|0)+Math.imul(y,X)|0,i=i+Math.imul(y,Y)|0,n=n+Math.imul(l,Q)|0,a=(a=a+Math.imul(l,ee)|0)+Math.imul(p,Q)|0,i=i+Math.imul(p,ee)|0;var we=(d+(n=n+Math.imul(u,re)|0)|0)+((8191&(a=(a=a+Math.imul(u,ne)|0)+Math.imul(b,re)|0))<<13)|0;d=((i=i+Math.imul(b,ne)|0)+(a>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(T,q),a=(a=Math.imul(T,H))+Math.imul(P,q)|0,i=Math.imul(P,H),n=n+Math.imul(A,K)|0,a=(a=a+Math.imul(A,G)|0)+Math.imul(E,K)|0,i=i+Math.imul(E,G)|0,n=n+Math.imul(M,V)|0,a=(a=a+Math.imul(M,Z)|0)+Math.imul(k,V)|0,i=i+Math.imul(k,Z)|0,n=n+Math.imul(g,X)|0,a=(a=a+Math.imul(g,Y)|0)+Math.imul(w,X)|0,i=i+Math.imul(w,Y)|0,n=n+Math.imul(x,Q)|0,a=(a=a+Math.imul(x,ee)|0)+Math.imul(y,Q)|0,i=i+Math.imul(y,ee)|0,n=n+Math.imul(l,re)|0,a=(a=a+Math.imul(l,ne)|0)+Math.imul(p,re)|0,i=i+Math.imul(p,ne)|0;var _e=(d+(n=n+Math.imul(u,ie)|0)|0)+((8191&(a=(a=a+Math.imul(u,oe)|0)+Math.imul(b,ie)|0))<<13)|0;d=((i=i+Math.imul(b,oe)|0)+(a>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(B,q),a=(a=Math.imul(B,H))+Math.imul(R,q)|0,i=Math.imul(R,H),n=n+Math.imul(T,K)|0,a=(a=a+Math.imul(T,G)|0)+Math.imul(P,K)|0,i=i+Math.imul(P,G)|0,n=n+Math.imul(A,V)|0,a=(a=a+Math.imul(A,Z)|0)+Math.imul(E,V)|0,i=i+Math.imul(E,Z)|0,n=n+Math.imul(M,X)|0,a=(a=a+Math.imul(M,Y)|0)+Math.imul(k,X)|0,i=i+Math.imul(k,Y)|0,n=n+Math.imul(g,Q)|0,a=(a=a+Math.imul(g,ee)|0)+Math.imul(w,Q)|0,i=i+Math.imul(w,ee)|0,n=n+Math.imul(x,re)|0,a=(a=a+Math.imul(x,ne)|0)+Math.imul(y,re)|0,i=i+Math.imul(y,ne)|0,n=n+Math.imul(l,ie)|0,a=(a=a+Math.imul(l,oe)|0)+Math.imul(p,ie)|0,i=i+Math.imul(p,oe)|0;var Me=(d+(n=n+Math.imul(u,fe)|0)|0)+((8191&(a=(a=a+Math.imul(u,de)|0)+Math.imul(b,fe)|0))<<13)|0;d=((i=i+Math.imul(b,de)|0)+(a>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(I,q),a=(a=Math.imul(I,H))+Math.imul(L,q)|0,i=Math.imul(L,H),n=n+Math.imul(B,K)|0,a=(a=a+Math.imul(B,G)|0)+Math.imul(R,K)|0,i=i+Math.imul(R,G)|0,n=n+Math.imul(T,V)|0,a=(a=a+Math.imul(T,Z)|0)+Math.imul(P,V)|0,i=i+Math.imul(P,Z)|0,n=n+Math.imul(A,X)|0,a=(a=a+Math.imul(A,Y)|0)+Math.imul(E,X)|0,i=i+Math.imul(E,Y)|0,n=n+Math.imul(M,Q)|0,a=(a=a+Math.imul(M,ee)|0)+Math.imul(k,Q)|0,i=i+Math.imul(k,ee)|0,n=n+Math.imul(g,re)|0,a=(a=a+Math.imul(g,ne)|0)+Math.imul(w,re)|0,i=i+Math.imul(w,ne)|0,n=n+Math.imul(x,ie)|0,a=(a=a+Math.imul(x,oe)|0)+Math.imul(y,ie)|0,i=i+Math.imul(y,oe)|0,n=n+Math.imul(l,fe)|0,a=(a=a+Math.imul(l,de)|0)+Math.imul(p,fe)|0,i=i+Math.imul(p,de)|0;var ke=(d+(n=n+Math.imul(u,ue)|0)|0)+((8191&(a=(a=a+Math.imul(u,be)|0)+Math.imul(b,ue)|0))<<13)|0;d=((i=i+Math.imul(b,be)|0)+(a>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(U,q),a=(a=Math.imul(U,H))+Math.imul(z,q)|0,i=Math.imul(z,H),n=n+Math.imul(I,K)|0,a=(a=a+Math.imul(I,G)|0)+Math.imul(L,K)|0,i=i+Math.imul(L,G)|0,n=n+Math.imul(B,V)|0,a=(a=a+Math.imul(B,Z)|0)+Math.imul(R,V)|0,i=i+Math.imul(R,Z)|0,n=n+Math.imul(T,X)|0,a=(a=a+Math.imul(T,Y)|0)+Math.imul(P,X)|0,i=i+Math.imul(P,Y)|0,n=n+Math.imul(A,Q)|0,a=(a=a+Math.imul(A,ee)|0)+Math.imul(E,Q)|0,i=i+Math.imul(E,ee)|0,n=n+Math.imul(M,re)|0,a=(a=a+Math.imul(M,ne)|0)+Math.imul(k,re)|0,i=i+Math.imul(k,ne)|0,n=n+Math.imul(g,ie)|0,a=(a=a+Math.imul(g,oe)|0)+Math.imul(w,ie)|0,i=i+Math.imul(w,oe)|0,n=n+Math.imul(x,fe)|0,a=(a=a+Math.imul(x,de)|0)+Math.imul(y,fe)|0,i=i+Math.imul(y,de)|0,n=n+Math.imul(l,ue)|0,a=(a=a+Math.imul(l,be)|0)+Math.imul(p,ue)|0,i=i+Math.imul(p,be)|0;var Se=(d+(n=n+Math.imul(u,le)|0)|0)+((8191&(a=(a=a+Math.imul(u,pe)|0)+Math.imul(b,le)|0))<<13)|0;d=((i=i+Math.imul(b,pe)|0)+(a>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(U,K),a=(a=Math.imul(U,G))+Math.imul(z,K)|0,i=Math.imul(z,G),n=n+Math.imul(I,V)|0,a=(a=a+Math.imul(I,Z)|0)+Math.imul(L,V)|0,i=i+Math.imul(L,Z)|0,n=n+Math.imul(B,X)|0,a=(a=a+Math.imul(B,Y)|0)+Math.imul(R,X)|0,i=i+Math.imul(R,Y)|0,n=n+Math.imul(T,Q)|0,a=(a=a+Math.imul(T,ee)|0)+Math.imul(P,Q)|0,i=i+Math.imul(P,ee)|0,n=n+Math.imul(A,re)|0,a=(a=a+Math.imul(A,ne)|0)+Math.imul(E,re)|0,i=i+Math.imul(E,ne)|0,n=n+Math.imul(M,ie)|0,a=(a=a+Math.imul(M,oe)|0)+Math.imul(k,ie)|0,i=i+Math.imul(k,oe)|0,n=n+Math.imul(g,fe)|0,a=(a=a+Math.imul(g,de)|0)+Math.imul(w,fe)|0,i=i+Math.imul(w,de)|0,n=n+Math.imul(x,ue)|0,a=(a=a+Math.imul(x,be)|0)+Math.imul(y,ue)|0,i=i+Math.imul(y,be)|0;var Ae=(d+(n=n+Math.imul(l,le)|0)|0)+((8191&(a=(a=a+Math.imul(l,pe)|0)+Math.imul(p,le)|0))<<13)|0;d=((i=i+Math.imul(p,pe)|0)+(a>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(U,V),a=(a=Math.imul(U,Z))+Math.imul(z,V)|0,i=Math.imul(z,Z),n=n+Math.imul(I,X)|0,a=(a=a+Math.imul(I,Y)|0)+Math.imul(L,X)|0,i=i+Math.imul(L,Y)|0,n=n+Math.imul(B,Q)|0,a=(a=a+Math.imul(B,ee)|0)+Math.imul(R,Q)|0,i=i+Math.imul(R,ee)|0,n=n+Math.imul(T,re)|0,a=(a=a+Math.imul(T,ne)|0)+Math.imul(P,re)|0,i=i+Math.imul(P,ne)|0,n=n+Math.imul(A,ie)|0,a=(a=a+Math.imul(A,oe)|0)+Math.imul(E,ie)|0,i=i+Math.imul(E,oe)|0,n=n+Math.imul(M,fe)|0,a=(a=a+Math.imul(M,de)|0)+Math.imul(k,fe)|0,i=i+Math.imul(k,de)|0,n=n+Math.imul(g,ue)|0,a=(a=a+Math.imul(g,be)|0)+Math.imul(w,ue)|0,i=i+Math.imul(w,be)|0;var Ee=(d+(n=n+Math.imul(x,le)|0)|0)+((8191&(a=(a=a+Math.imul(x,pe)|0)+Math.imul(y,le)|0))<<13)|0;d=((i=i+Math.imul(y,pe)|0)+(a>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(U,X),a=(a=Math.imul(U,Y))+Math.imul(z,X)|0,i=Math.imul(z,Y),n=n+Math.imul(I,Q)|0,a=(a=a+Math.imul(I,ee)|0)+Math.imul(L,Q)|0,i=i+Math.imul(L,ee)|0,n=n+Math.imul(B,re)|0,a=(a=a+Math.imul(B,ne)|0)+Math.imul(R,re)|0,i=i+Math.imul(R,ne)|0,n=n+Math.imul(T,ie)|0,a=(a=a+Math.imul(T,oe)|0)+Math.imul(P,ie)|0,i=i+Math.imul(P,oe)|0,n=n+Math.imul(A,fe)|0,a=(a=a+Math.imul(A,de)|0)+Math.imul(E,fe)|0,i=i+Math.imul(E,de)|0,n=n+Math.imul(M,ue)|0,a=(a=a+Math.imul(M,be)|0)+Math.imul(k,ue)|0,i=i+Math.imul(k,be)|0;var Oe=(d+(n=n+Math.imul(g,le)|0)|0)+((8191&(a=(a=a+Math.imul(g,pe)|0)+Math.imul(w,le)|0))<<13)|0;d=((i=i+Math.imul(w,pe)|0)+(a>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(U,Q),a=(a=Math.imul(U,ee))+Math.imul(z,Q)|0,i=Math.imul(z,ee),n=n+Math.imul(I,re)|0,a=(a=a+Math.imul(I,ne)|0)+Math.imul(L,re)|0,i=i+Math.imul(L,ne)|0,n=n+Math.imul(B,ie)|0,a=(a=a+Math.imul(B,oe)|0)+Math.imul(R,ie)|0,i=i+Math.imul(R,oe)|0,n=n+Math.imul(T,fe)|0,a=(a=a+Math.imul(T,de)|0)+Math.imul(P,fe)|0,i=i+Math.imul(P,de)|0,n=n+Math.imul(A,ue)|0,a=(a=a+Math.imul(A,be)|0)+Math.imul(E,ue)|0,i=i+Math.imul(E,be)|0;var Te=(d+(n=n+Math.imul(M,le)|0)|0)+((8191&(a=(a=a+Math.imul(M,pe)|0)+Math.imul(k,le)|0))<<13)|0;d=((i=i+Math.imul(k,pe)|0)+(a>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(U,re),a=(a=Math.imul(U,ne))+Math.imul(z,re)|0,i=Math.imul(z,ne),n=n+Math.imul(I,ie)|0,a=(a=a+Math.imul(I,oe)|0)+Math.imul(L,ie)|0,i=i+Math.imul(L,oe)|0,n=n+Math.imul(B,fe)|0,a=(a=a+Math.imul(B,de)|0)+Math.imul(R,fe)|0,i=i+Math.imul(R,de)|0,n=n+Math.imul(T,ue)|0,a=(a=a+Math.imul(T,be)|0)+Math.imul(P,ue)|0,i=i+Math.imul(P,be)|0;var Pe=(d+(n=n+Math.imul(A,le)|0)|0)+((8191&(a=(a=a+Math.imul(A,pe)|0)+Math.imul(E,le)|0))<<13)|0;d=((i=i+Math.imul(E,pe)|0)+(a>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(U,ie),a=(a=Math.imul(U,oe))+Math.imul(z,ie)|0,i=Math.imul(z,oe),n=n+Math.imul(I,fe)|0,a=(a=a+Math.imul(I,de)|0)+Math.imul(L,fe)|0,i=i+Math.imul(L,de)|0,n=n+Math.imul(B,ue)|0,a=(a=a+Math.imul(B,be)|0)+Math.imul(R,ue)|0,i=i+Math.imul(R,be)|0;var je=(d+(n=n+Math.imul(T,le)|0)|0)+((8191&(a=(a=a+Math.imul(T,pe)|0)+Math.imul(P,le)|0))<<13)|0;d=((i=i+Math.imul(P,pe)|0)+(a>>>13)|0)+(je>>>26)|0,je&=67108863,n=Math.imul(U,fe),a=(a=Math.imul(U,de))+Math.imul(z,fe)|0,i=Math.imul(z,de),n=n+Math.imul(I,ue)|0,a=(a=a+Math.imul(I,be)|0)+Math.imul(L,ue)|0,i=i+Math.imul(L,be)|0;var Be=(d+(n=n+Math.imul(B,le)|0)|0)+((8191&(a=(a=a+Math.imul(B,pe)|0)+Math.imul(R,le)|0))<<13)|0;d=((i=i+Math.imul(R,pe)|0)+(a>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(U,ue),a=(a=Math.imul(U,be))+Math.imul(z,ue)|0,i=Math.imul(z,be);var Re=(d+(n=n+Math.imul(I,le)|0)|0)+((8191&(a=(a=a+Math.imul(I,pe)|0)+Math.imul(L,le)|0))<<13)|0;d=((i=i+Math.imul(L,pe)|0)+(a>>>13)|0)+(Re>>>26)|0,Re&=67108863;var Ce=(d+(n=Math.imul(U,le))|0)+((8191&(a=(a=Math.imul(U,pe))+Math.imul(z,le)|0))<<13)|0;return d=((i=Math.imul(z,pe))+(a>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,f[0]=me,f[1]=xe,f[2]=ye,f[3]=ve,f[4]=ge,f[5]=we,f[6]=_e,f[7]=Me,f[8]=ke,f[9]=Se,f[10]=Ae,f[11]=Ee,f[12]=Oe,f[13]=Te,f[14]=Pe,f[15]=je,f[16]=Be,f[17]=Re,f[18]=Ce,0!==d&&(f[19]=d,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,a=0,i=0;i>>26)|0)>>>26,o&=67108863}r.words[i]=c,n=o,o=a}return 0!==n?r.words[i]=n:r.length--,r._strip()}function v(e,t,r){return y(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(x=m),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?x(this,e,t):r<63?m(this,e,t):r<1024?y(this,e,t):v(this,e,t)},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},g.prototype.permute=function(e,t,r,n,a,i){for(var o=0;o>>=1)a++;return 1<>>=13,r[2*o+1]=8191&i,i>>>=13;for(o=2*t;o>=26,r+=i/67108864|0,r+=o>>>26,this.words[n]=67108863&o}return 0!==r&&(this.words[n]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>a&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,n=(e-r)/26,i=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0),n=t?(t-t%26)/26:0;var i=e%26,o=Math.min((e-i)/26,this.length),c=67108863^67108863>>>i<o)for(this.length-=o,d=0;d=0&&(0!==s||d>=n);d--){var u=0|this.words[d];this.words[d]=s<<26-i|u>>>i,s=u&c}return f&&0!==s&&(f.words[f.length++]=s),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return a(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){a("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,n=1<=0);var t=e%26,r=(e-t)/26;if(a(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var n=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(a("number"==typeof e),a(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(f/67108864|0),this.words[n+r]=67108863&i}for(;n>26,this.words[n+r]=67108863&i;if(0===c)return this._strip();for(a(-1===c),c=0,n=0;n>26,this.words[n]=67108863&i;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),a=e,i=0|a.words[a.length-1];0!==(r=26-this._countBits(i))&&(a=a.ushln(r),n.iushln(r),i=0|a.words[a.length-1]);var c,f=n.length-a.length;if("mod"!==t){(c=new o(null)).length=f+1,c.words=new Array(c.length);for(var d=0;d=0;u--){var b=67108864*(0|n.words[a.length+u])+(0|n.words[a.length+u-1]);for(b=Math.min(b/i|0,67108863),n._ishlnsubmul(a,b,u);0!==n.negative;)b--,n.negative=0,n._ishlnsubmul(a,1,u),n.isZero()||(n.negative^=1);c&&(c.words[u]=b)}return c&&c._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:c||null,mod:n}},o.prototype.divmod=function(e,t,r){return a(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(c=this.neg().divmod(e,t),"mod"!==t&&(n=c.div.neg()),"div"!==t&&(i=c.mod.neg(),r&&0!==i.negative&&i.iadd(e)),{div:n,mod:i}):0===this.negative&&0!==e.negative?(c=this.divmod(e.neg(),t),"mod"!==t&&(n=c.div.neg()),{div:n,mod:c.mod}):0!=(this.negative&e.negative)?(c=this.neg().divmod(e.neg(),t),"div"!==t&&(i=c.mod.neg(),r&&0!==i.negative&&i.isub(e)),{div:c.div,mod:i}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var n,i,c},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),a=e.andln(1),i=r.cmp(n);return i<0||1===a&&0===i?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),a(e<=67108863);for(var r=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(r*n+(0|this.words[i]))%e;return t?-n:n},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),a(e<=67108863);for(var r=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*r;this.words[n]=i/e|0,r=i%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n=new o(1),i=new o(0),c=new o(0),f=new o(1),d=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++d;for(var s=r.clone(),u=t.clone();!t.isZero();){for(var b=0,h=1;0==(t.words[0]&h)&&b<26;++b,h<<=1);if(b>0)for(t.iushrn(b);b-- >0;)(n.isOdd()||i.isOdd())&&(n.iadd(s),i.isub(u)),n.iushrn(1),i.iushrn(1);for(var l=0,p=1;0==(r.words[0]&p)&&l<26;++l,p<<=1);if(l>0)for(r.iushrn(l);l-- >0;)(c.isOdd()||f.isOdd())&&(c.iadd(s),f.isub(u)),c.iushrn(1),f.iushrn(1);t.cmp(r)>=0?(t.isub(r),n.isub(c),i.isub(f)):(r.isub(t),c.isub(n),f.isub(i))}return{a:c,b:f,gcd:r.iushln(d)}},o.prototype._invmp=function(e){a(0===e.negative),a(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var n,i=new o(1),c=new o(0),f=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var d=0,s=1;0==(t.words[0]&s)&&d<26;++d,s<<=1);if(d>0)for(t.iushrn(d);d-- >0;)i.isOdd()&&i.iadd(f),i.iushrn(1);for(var u=0,b=1;0==(r.words[0]&b)&&u<26;++u,b<<=1);if(u>0)for(r.iushrn(u);u-- >0;)c.isOdd()&&c.iadd(f),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(c)):(r.isub(t),c.isub(i))}return(n=0===t.cmpn(1)?i:c).cmpn(0)<0&&n.iadd(e),n},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var a=t.cmp(r);if(a<0){var i=t;t=r,r=i}else if(0===a||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){a("number"==typeof e);var t=e%26,r=(e-t)/26,n=1<>>26,c&=67108863,this.words[o]=c}return 0!==i&&(this.words[o]=i,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),a(e<=67108863,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var n=0|this.words[r],a=0|e.words[r];if(n!==a){na&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new E(e)},o.prototype.toRed=function(e){return a(!this.red,"Already a number in reduction context"),a(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return a(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return a(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return a(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return a(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return a(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return a(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return a(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return a(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return a(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return a(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return a(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return a(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return a(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return a(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function _(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function M(){_.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function k(){_.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){_.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function A(){_.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else a(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function O(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}_.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},_.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},_.prototype.split=function(e,t){e.iushrn(this.n,0,t)},_.prototype.imulK=function(e){return e.imul(this.k)},i(M,_),M.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,a=i}a>>>=22,e.words[n-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},M.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=a,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new M;else if("p224"===e)t=new k;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new A}return w[e]=t,t},E.prototype._verify1=function(e){a(0===e.negative,"red works only with positives"),a(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){a(0==(e.negative|t.negative),"red works only with positives"),a(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(a(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var n=this.m.subn(1),i=0;!n.isZero()&&0===n.andln(1);)i++,n.iushrn(1);a(!n.isZero());var c=new o(1).toRed(this),f=c.redNeg(),d=this.m.subn(1).iushrn(1),s=this.m.bitLength();for(s=new o(2*s*s).toRed(this);0!==this.pow(s,d).cmp(f);)s.redIAdd(f);for(var u=this.pow(s,n),b=this.pow(e,n.addn(1).iushrn(1)),h=this.pow(e,n),l=i;0!==h.cmp(c);){for(var p=h,m=0;0!==p.cmp(c);m++)p=p.redSqr();a(m=0;n--){for(var d=t.words[n],s=f-1;s>=0;s--){var u=d>>s&1;a!==r[0]&&(a=this.sqr(a)),0!==u||0!==i?(i<<=1,i|=u,(4===++c||0===n&&0===s)&&(a=this.mul(a,r[i]),c=0,i=0)):c=0}f=26}return a},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new O(e)},i(O,E),O.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},O.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},O.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},O.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).iushrn(this.shift),i=a;return a.cmp(this.m)>=0?i=a.isub(this.m):a.cmpn(0)<0&&(i=a.iadd(this.m)),i._forceRed(this)},O.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,this)}).call(this,r(15)(e))},function(e,t){},function(e,t,r){"use strict";var n=r(227),a=r(16).errors,i=function(e){this.requestManager=e,this.requests=[]};i.prototype.add=function(e){this.requests.push(e)},i.prototype.execute=function(){var e=this.requests,t=this._sortResponses.bind(this);this.requestManager.sendBatch(e,(function(r,i){i=t(i),e.map((function(e,t){return i[t]||{}})).forEach((function(t,r){if(e[r].callback){if(t&&t.error)return e[r].callback(a.ErrorResponse(t));if(!n.isValidResponse(t))return e[r].callback(a.InvalidResponse(t));try{e[r].callback(null,e[r].format?e[r].format(t.result):t.result)}catch(t){e[r].callback(t)}}}))}))},i.prototype._sortResponses=function(e){return(e||[]).sort((function(e,t){return e.id-t.id}))},e.exports=i},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=null,i="object"===("undefined"==typeof globalThis?"undefined":n(globalThis))?globalThis:void 0;if(!i)try{i=Function("return this")()}catch(e){i=self}void 0!==i.ethereum?a=i.ethereum:void 0!==i.web3&&i.web3.currentProvider&&(i.web3.currentProvider.sendAsync&&(i.web3.currentProvider.send=i.web3.currentProvider.sendAsync,delete i.web3.currentProvider.sendAsync),!i.web3.currentProvider.on&&i.web3.currentProvider.connection&&"ipcProviderWrapper"===i.web3.currentProvider.connection.constructor.name&&(i.web3.currentProvider.on=function(e,t){if("function"!=typeof t)throw new Error("The second parameter callback must be a function.");switch(e){case"data":this.connection.on("data",(function(e){var r="";e=e.toString();try{r=JSON.parse(e)}catch(r){return t(new Error("Couldn't parse response data"+e))}r.id||-1===r.method.indexOf("_subscription")||t(null,r)}));break;default:this.connection.on(e,t)}}),a=i.web3.currentProvider),e.exports=a},function(e,t,r){"use strict";var n=r(138),a=r(454),i=r(16).errors,o=r(459).w3cwebsocket,c=function(e,t){n.call(this),t=t||{},this.url=e,this._customTimeout=t.timeout||15e3,this.headers=t.headers||{},this.protocol=t.protocol||void 0,this.reconnectOptions=Object.assign({auto:!1,delay:5e3,maxAttempts:!1,onTimeout:!1},t.reconnect),this.clientConfig=t.clientConfig||void 0,this.requestOptions=t.requestOptions||void 0,this.DATA="data",this.CLOSE="close",this.ERROR="error",this.CONNECT="connect",this.RECONNECT="reconnect",this.connection=null,this.requestQueue=new Map,this.responseQueue=new Map,this.reconnectAttempts=0,this.reconnecting=!1;var r=a.parseURL(e);r.username&&r.password&&(this.headers.authorization="Basic "+a.btoa(r.username+":"+r.password)),r.auth&&(this.headers.authorization="Basic "+a.btoa(r.auth)),Object.defineProperty(this,"connected",{get:function(){return this.connection&&this.connection.readyState===this.connection.OPEN},enumerable:!0}),this.connect()};(c.prototype=Object.create(n.prototype)).constructor=c,c.prototype.connect=function(){this.connection=new o(this.url,this.protocol,void 0,this.headers,this.requestOptions,this.clientConfig),this._addSocketListeners()},c.prototype._onMessage=function(e){var t=this;this._parseResponse("string"==typeof e.data?e.data:"").forEach((function(e){if(e.method&&-1!==e.method.indexOf("_subscription"))t.emit(t.DATA,e);else{var r=e.id;Array.isArray(e)&&(r=e[0].id),t.responseQueue.has(r)&&(void 0!==t.responseQueue.get(r).callback&&t.responseQueue.get(r).callback(!1,e),t.responseQueue.delete(r))}}))},c.prototype._onConnect=function(){if(this.emit(this.CONNECT),this.reconnectAttempts=0,this.reconnecting=!1,this.requestQueue.size>0){var e=this;this.requestQueue.forEach((function(t,r){e.send(t.payload,t.callback),e.requestQueue.delete(r)}))}},c.prototype._onClose=function(e){var t=this;!this.reconnectOptions.auto||[1e3,1001].includes(e.code)&&!1!==e.wasClean?(this.emit(this.CLOSE,e),this.requestQueue.size>0&&this.requestQueue.forEach((function(r,n){r.callback(i.ConnectionNotOpenError(e)),t.requestQueue.delete(n)})),this.responseQueue.size>0&&this.responseQueue.forEach((function(r,n){r.callback(i.InvalidConnection("on WS",e)),t.responseQueue.delete(n)})),this._removeSocketListeners(),this.removeAllListeners()):this.reconnect()},c.prototype._addSocketListeners=function(){this.connection.addEventListener("message",this._onMessage.bind(this)),this.connection.addEventListener("open",this._onConnect.bind(this)),this.connection.addEventListener("close",this._onClose.bind(this))},c.prototype._removeSocketListeners=function(){this.connection.removeEventListener("message",this._onMessage),this.connection.removeEventListener("open",this._onConnect),this.connection.removeEventListener("close",this._onClose)},c.prototype._parseResponse=function(e){var t=this,r=[];return e.replace(/\}[\n\r]?\{/g,"}|--|{").replace(/\}\][\n\r]?\[\{/g,"}]|--|[{").replace(/\}[\n\r]?\[\{/g,"}|--|[{").replace(/\}\][\n\r]?\{/g,"}]|--|{").split("|--|").forEach((function(e){t.lastChunk&&(e=t.lastChunk+e);var n=null;try{n=JSON.parse(e)}catch(r){return t.lastChunk=e,clearTimeout(t.lastChunkTimeout),void(t.lastChunkTimeout=setTimeout((function(){t.reconnectOptions.auto&&t.reconnectOptions.onTimeout?t.reconnect():(t.emit(t.ERROR,i.ConnectionTimeout(t._customTimeout)),t.requestQueue.size>0&&t.requestQueue.forEach((function(e,r){e.callback(i.ConnectionTimeout(t._customTimeout)),t.requestQueue.delete(r)})))}),t._customTimeout))}clearTimeout(t.lastChunkTimeout),t.lastChunk=null,n&&r.push(n)})),r},c.prototype.send=function(e,t){var r=e.id,n={payload:e,callback:t};if(Array.isArray(e)&&(r=e[0].id),this.connection.readyState===this.connection.CONNECTING||this.reconnecting)this.requestQueue.set(r,n);else{if(this.connection.readyState!==this.connection.OPEN)return this.requestQueue.delete(r),this.emit(this.ERROR,i.ConnectionNotOpenError()),void n.callback(i.ConnectionNotOpenError());this.responseQueue.set(r,n),this.requestQueue.delete(r);try{this.connection.send(JSON.stringify(n.payload))}catch(e){n.callback(e),this.responseQueue.delete(r)}}},c.prototype.reset=function(){this.responseQueue.clear(),this.requestQueue.clear(),this.removeAllListeners(),this._removeSocketListeners(),this._addSocketListeners()},c.prototype.disconnect=function(e,t){this._removeSocketListeners(),this.connection.close(e||1e3,t)},c.prototype.supportsSubscriptions=function(){return!0},c.prototype.reconnect=function(){var e=this;this.reconnecting=!0,this.responseQueue.size>0&&this.responseQueue.forEach((function(t,r){t.callback(i.PendingRequestsOnReconnectingError()),e.responseQueue.delete(r)})),!this.reconnectOptions.maxAttempts||this.reconnectAttempts0&&this.requestQueue.forEach((function(t,r){t.callback(i.MaxAttemptsReachedOnReconnectingError()),e.requestQueue.delete(r)})))},e.exports=c},function(e,t,r){(function(t,n){function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i="[object process]"===Object.prototype.toString.call(void 0!==t?t:0),o="undefined"!=typeof navigator&&"ReactNative"===navigator.product,c=null,f=null;if(i||o){c=function(e){return n.from(e).toString("base64")};var d=r(79);if(d.URL){var s=d.URL;f=function(e){return new s(e)}}else f=r(79).parse}else c=btoa.bind("object"===("undefined"==typeof globalThis?"undefined":a(globalThis))?globalThis:self),f=function(e){return new URL(e)};e.exports={parseURL:f,btoa:c}}).call(this,r(11),r(0).Buffer)},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"===n(e)&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},function(e,t,r){"use strict";t.decode=t.parse=r(457),t.encode=t.stringify=r(458)},function(e,t,r){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,t,r,i){t=t||"&",r=r||"=";var o={};if("string"!=typeof e||0===e.length)return o;var c=/\+/g;e=e.split(t);var f=1e3;i&&"number"==typeof i.maxKeys&&(f=i.maxKeys);var d=e.length;f>0&&d>f&&(d=f);for(var s=0;s=0?(u=p.substr(0,m),b=p.substr(m+1)):(u=p,b=""),h=decodeURIComponent(u),l=decodeURIComponent(b),n(o,h)?a(o[h])?o[h].push(l):o[h]=[o[h],l]:o[h]=l}return o};var a=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var a=function(e){switch(n(e)){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,t,r,f){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"===n(e)?o(c(e),(function(n){var c=encodeURIComponent(a(n))+r;return i(e[n])?o(e[n],(function(e){return c+encodeURIComponent(a(e))})).join(t):c+encodeURIComponent(a(e[n]))})).join(t):f?encodeURIComponent(a(f))+r+encodeURIComponent(a(e)):""};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function o(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n (https://github.com/theturtle32)","contributors":["Iñaki Baz Castillo (http://dev.sipdoc.net)"],"version":"1.0.34","repository":{"type":"git","url":"https://github.com/theturtle32/WebSocket-Node.git"},"homepage":"https://github.com/theturtle32/WebSocket-Node","engines":{"node":">=4.0.0"},"dependencies":{"bufferutil":"^4.0.1","debug":"^2.2.0","es5-ext":"^0.10.50","typedarray-to-buffer":"^3.1.5","utf-8-validate":"^5.0.2","yaeti":"^0.0.6"},"devDependencies":{"buffer-equal":"^1.0.0","gulp":"^4.0.2","gulp-jshint":"^2.0.4","jshint-stylish":"^2.2.1","jshint":"^2.0.0","tape":"^4.9.1"},"config":{"verbose":false},"scripts":{"test":"tape test/unit/*.js","gulp":"gulp"},"main":"index","directories":{"lib":"./lib"},"browser":"lib/browser.js","license":"Apache-2.0"}')},function(e,t,r){var n=r(16).errors,a=r(190).XMLHttpRequest,i=r(139),o=r(232),c=function(e,t){t=t||{},this.withCredentials=t.withCredentials||!1,this.timeout=t.timeout||0,this.headers=t.headers,this.agent=t.agent,this.connected=!1;var r=!1!==t.keepAlive;this.host=e||"http://localhost:8545",this.agent||("https"===this.host.substring(0,5)?this.httpsAgent=new o.Agent({keepAlive:r}):this.httpAgent=new i.Agent({keepAlive:r}))};c.prototype._prepareRequest=function(){var e;if("undefined"!=typeof XMLHttpRequest)e=new XMLHttpRequest;else{e=new a;var t={httpsAgent:this.httpsAgent,httpAgent:this.httpAgent,baseUrl:this.baseUrl};this.agent&&(t.httpsAgent=this.agent.https,t.httpAgent=this.agent.http,t.baseUrl=this.agent.baseUrl),e.nodejsSet(t)}return e.open("POST",this.host,!0),e.setRequestHeader("Content-Type","application/json"),e.timeout=this.timeout,e.withCredentials=this.withCredentials,this.headers&&this.headers.forEach((function(t){e.setRequestHeader(t.name,t.value)})),e},c.prototype.send=function(e,t){var r=this,a=this._prepareRequest();a.onreadystatechange=function(){if(4===a.readyState&&1!==a.timeout){var e=a.responseText,i=null;try{e=JSON.parse(e)}catch(e){i=n.InvalidResponse(a.responseText)}r.connected=!0,t(i,e)}},a.ontimeout=function(){r.connected=!1,t(n.ConnectionTimeout(this.timeout))};try{a.send(JSON.stringify(e))}catch(e){this.connected=!1,t(n.InvalidConnection(this.host))}},c.prototype.disconnect=function(){},c.prototype.supportsSubscriptions=function(){return!1},e.exports=c},function(e,t,r){"use strict";(function(e,n){var a,i=this&&this.__extends||(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},function(e,t){function r(){this.constructor=e}a(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),o=this&&this.__assign||Object.assign||function(e){for(var t,r=1,n=arguments.length;r=0)return this._url=this._parseUrl(t.headers.location),this._method="GET",this._loweredHeaders["content-type"]&&(delete this._headers[this._loweredHeaders["content-type"]],delete this._loweredHeaders["content-type"]),null!=this._headers["Content-Type"]&&delete this._headers["Content-Type"],delete this._headers["Content-Length"],this.upload._reset(),this._finalizeHeaders(),void this._sendHxxpRequest();this._response=t,this._response.on("data",(function(e){return n._onHttpResponseData(t,e)})),this._response.on("end",(function(){return n._onHttpResponseEnd(t)})),this._response.on("close",(function(){return n._onHttpResponseClose(t)})),this.responseUrl=this._url.href.split("#")[0],this.status=t.statusCode,this.statusText=c.STATUS_CODES[this.status],this._parseResponseHeaders(t);var a=this._responseHeaders["content-length"]||"";this._totalBytes=+a,this._lengthComputable=!!a,this._setReadyState(r.HEADERS_RECEIVED)}},r.prototype._onHttpResponseData=function(e,t){this._response===e&&(this._responseParts.push(new n(t)),this._loadedBytes+=t.length,this.readyState!==r.LOADING&&this._setReadyState(r.LOADING),this._dispatchProgress("progress"))},r.prototype._onHttpResponseEnd=function(e){this._response===e&&(this._parseResponse(),this._request=null,this._response=null,this._setReadyState(r.DONE),this._dispatchProgress("load"),this._dispatchProgress("loadend"))},r.prototype._onHttpResponseClose=function(e){if(this._response===e){var t=this._request;this._setError(),t.abort(),this._setReadyState(r.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend")}},r.prototype._onHttpTimeout=function(e){this._request===e&&(this._setError(),e.abort(),this._setReadyState(r.DONE),this._dispatchProgress("timeout"),this._dispatchProgress("loadend"))},r.prototype._onHttpRequestError=function(e,t){this._request===e&&(this._setError(),e.abort(),this._setReadyState(r.DONE),this._dispatchProgress("error"),this._dispatchProgress("loadend"))},r.prototype._dispatchProgress=function(e){var t=new r.ProgressEvent(e);t.lengthComputable=this._lengthComputable,t.loaded=this._loadedBytes,t.total=this._totalBytes,this.dispatchEvent(t)},r.prototype._setError=function(){this._request=null,this._response=null,this._responseHeaders=null,this._responseParts=null},r.prototype._parseUrl=function(e,t,r){var n=null==this.nodejsBaseUrl?e:s.resolve(this.nodejsBaseUrl,e),a=s.parse(n,!1,!0);a.hash=null;var i=(a.auth||"").split(":"),o=i[0],c=i[1];return(o||c||t||r)&&(a.auth=(t||o||"")+":"+(r||c||"")),a},r.prototype._parseResponseHeaders=function(e){for(var t in this._responseHeaders={},e.headers){var r=t.toLowerCase();this._privateHeaders[r]||(this._responseHeaders[r]=e.headers[t])}null!=this._mimeOverride&&(this._responseHeaders["content-type"]=this._mimeOverride)},r.prototype._parseResponse=function(){var e=n.concat(this._responseParts);switch(this._responseParts=null,this.responseType){case"json":this.responseText=null;try{this.response=JSON.parse(e.toString("utf-8"))}catch(e){this.response=null}return;case"buffer":return this.responseText=null,void(this.response=e);case"arraybuffer":this.responseText=null;for(var t=new ArrayBuffer(e.length),r=new Uint8Array(t),a=0;a