text: !function(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(i,n,function(e){return t[e]}.bind(null,n));return i},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=180)}([function(t,e,r){"use strict";function i(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),i(r(14)),i(r(12)),i(r(15)),i(r(27)),i(r(44)),i(r(6)),i(r(45))},function(t,e,r){"use strict";function i(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),i(r(12)),i(r(26)),i(r(14)),i(r(21)),i(r(13))},function(t,e,r){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(3));function o(t){return!!t.toHexString}function s(t){return t.slice?t:(t.slice=function(){var e=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(t,e)))},t)}function u(t){if(!t||parseInt(String(t.length))!=t.length||"string"==typeof t)return!1;for(var e=0;e<t.length;e++){var r=t[e];if(r<0||r>=256||parseInt(String(r))!=r)return!1}return!0}function a(t){if(null==t&&n.throwError("cannot convert null value to array",n.INVALID_ARGUMENT,{arg:"value",value:t}),o(t)&&(t=t.toHexString()),"string"==typeof t){var e=t.match(/^(0x)?[0-9a-fA-F]*$/);e||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==e[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),(t=t.substring(2)).length%2&&(t="0"+t);for(var r=[],i=0;i<t.length;i+=2)r.push(parseInt(t.substr(i,2),16));return s(new Uint8Array(r))}return u(t)?s(new Uint8Array(t)):(n.throwError("invalid arrayify value",null,{arg:"value",value:t,type:typeof t}),null)}function h(t){for(var e=[],r=0,i=0;i<t.length;i++){var n=a(t[i]);e.push(n),r+=n.length}var o=new Uint8Array(r),u=0;for(i=0;i<e.length;i++)o.set(e[i],u),u+=e[i].length;return s(o)}function l(t,e){return!("string"!=typeof t||!t.match(/^0x[0-9A-Fa-f]*$/))&&(!e||t.length===2+2*e)}e.isHexable=o,e.isArrayish=u,e.arrayify=a,e.concat=h,e.stripZeros=function(t){var e=a(t);if(0===e.length)return e;for(var r=0;0===e[r];)r++;return r&&(e=e.slice(r)),e},e.padZeros=function(t,e){if(e<(t=a(t)).length)throw new Error("cannot pad");var r=new Uint8Array(e);return r.set(t,e-t.length),s(r)},e.isHexString=l;function c(t){if(o(t))return t.toHexString();if("number"==typeof t){t<0&&n.throwError("cannot hexlify negative value",n.INVALID_ARGUMENT,{arg:"value",value:t}),t>=9007199254740991&&n.throwError("out-of-range",n.NUMERIC_FAULT,{operartion:"hexlify",fault:"out-of-safe-range"});for(var e="";t;)e="0123456789abcdef"[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("string"==typeof t){var r=t.match(/^(0x)?[0-9a-fA-F]*$/);return r||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==r[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2&&(t="0x0"+t.substring(2)),t}if(u(t)){for(var i=[],s=0;s<t.length;s++){var a=t[s];i.push("0123456789abcdef"[(240&a)>>4]+"0123456789abcdef"[15&a])}return"0x"+i.join("")}return n.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function d(t,e){for(l(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length<2*e+2;)t="0x0"+t.substring(2);return t}function f(t){var e,r=0,i="0x",o="0x";if((e=t)&&null!=e.r&&null!=e.s){null==t.v&&null==t.recoveryParam&&n.throwError("at least on of recoveryParam or v must be specified",n.INVALID_ARGUMENT,{argument:"signature",value:t}),i=d(t.r,32),o=d(t.s,32),"string"==typeof(r=t.v)&&(r=parseInt(r,16));var s=t.recoveryParam;null==s&&null!=t.v&&(s=1-r%2),r=27+s}else{var u=a(t);if(65!==u.length)throw new Error("invalid signature");i=c(u.slice(0,32)),o=c(u.slice(32,64)),27!==(r=u[64])&&28!==r&&(r=27+r%2)}return{r:i,s:o,recoveryParam:r-27,v:r}}e.hexlify=c,e.hexDataLength=function(t){return l(t)&&t.length%2==0?(t.length-2)/2:null},e.hexDataSlice=function(t,e,r){return l(t)||n.throwError("invalid hex data",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2!=0&&n.throwError("hex data length must be even",n.INVALID_ARGUMENT,{arg:"value",value:t}),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)},e.hexStripZeros=function(t){for(l(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length>3&&"0x0"===t.substring(0,3);)t="0x"+t.substring(3);return t},e.hexZeroPad=d,e.splitSignature=f,e.joinSignature=function(t){return c(h([(t=f(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(31);e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.MISSING_NEW="MISSING_NEW",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.NUMERIC_FAULT="NUMERIC_FAULT",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,o=!1;function s(t,r,n){if(o)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var s=[];Object.keys(n).forEach((function(t){try{s.push(t+"="+JSON.stringify(n[t]))}catch(e){s.push(t+"="+JSON.stringify(n[t].toString()))}})),s.push("version="+i.version);var u=t;s.length&&(t+=" ("+s.join(", ")+")");var a=new Error(t);throw a.reason=u,a.code=r,Object.keys(n).forEach((function(t){a[t]=n[t]})),a}e.throwError=s,e.checkNew=function(t,r){t instanceof r||s("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,i){i||(i=""),t<r&&s("missing argument"+i,e.MISSING_ARGUMENT,{count:t,expectedCount:r}),t>r&&s("too many arguments"+i,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&s("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o=!!t,n=!!r},e.checkNormalize=function(){try{if(["NFD","NFC","NFKD","NFKC"].forEach((function(t){try{"test".normalize(t)}catch(e){throw new Error("missing "+t)}})),String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){s("platform missing String.prototype.normalize",e.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:t.message})}};var u={debug:1,default:2,info:2,warn:3,error:4,off:5},a=u.default;function h(t,e){a>u[t]||console.log.apply(console,e)}function l(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];h("warn",t)}e.setLogLevel=function(t){var e=u[t];null!=e?a=e:l("invliad log level - "+t)},e.warn=l,e.info=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];h("info",t)}},function(t,e,r){"use strict";function i(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),i(r(28)),i(r(36)),i(r(37)),i(r(38)),i(r(39)),i(r(40)),i(r(41)),i(r(42)),i(r(43))},function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var o=i(r(9)),s=r(2),u=r(17),a=n(r(3)),h=new o.default.BN(-1);function l(t){var e=t.toString(16);return"-"===e[0]?e.length%2==0?"-0x0"+e.substring(1):"-0x"+e.substring(1):e.length%2==1?"0x0"+e:"0x"+e}function c(t){return f(_(t))}function d(t){return new p(l(t))}function f(t){var e=t._hex;return"-"===e[0]?new o.default.BN(e.substring(3),16).mul(h):new o.default.BN(e.substring(2),16)}var p=function(){function t(e){if(a.checkNew(this,t),u.setType(this,"BigNumber"),"string"==typeof e)s.isHexString(e)?("0x"==e&&(e="0x0"),u.defineReadOnly(this,"_hex",e)):"-"===e[0]&&s.isHexString(e.substring(1))?u.defineReadOnly(this,"_hex",e):e.match(/^-?[0-9]*$/)?(""==e&&(e="0"),u.defineReadOnly(this,"_hex",l(new o.default.BN(e)))):a.throwError("invalid BigNumber string value",a.INVALID_ARGUMENT,{arg:"value",value:e});else if("number"==typeof e){parseInt(String(e))!==e&&a.throwError("underflow",a.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:e,outputValue:parseInt(String(e))});try{u.defineReadOnly(this,"_hex",l(new o.default.BN(e)))}catch(t){a.throwError("overflow",a.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else e instanceof t?u.defineReadOnly(this,"_hex",e._hex):e.toHexString?u.defineReadOnly(this,"_hex",l(c(e.toHexString()))):e._hex&&s.isHexString(e._hex)?u.defineReadOnly(this,"_hex",e._hex):s.isArrayish(e)?u.defineReadOnly(this,"_hex",l(new o.default.BN(s.hexlify(e).substring(2),16))):a.throwError("invalid BigNumber value",a.INVALID_ARGUMENT,{arg:"value",value:e})}return t.prototype.fromTwos=function(t){return d(f(this).fromTwos(t))},t.prototype.toTwos=function(t){return d(f(this).toTwos(t))},t.prototype.abs=function(){return"-"===this._hex[0]?d(f(this).mul(h)):this},t.prototype.add=function(t){return d(f(this).add(c(t)))},t.prototype.sub=function(t){return d(f(this).sub(c(t)))},t.prototype.div=function(t){return _(t).isZero()&&a.throwError("division by zero",a.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),d(f(this).div(c(t)))},t.prototype.mul=function(t){return d(f(this).mul(c(t)))},t.prototype.mod=function(t){return d(f(this).mod(c(t)))},t.prototype.pow=function(t){return d(f(this).pow(c(t)))},t.prototype.maskn=function(t){return d(f(this).maskn(t))},t.prototype.eq=function(t){return f(this).eq(c(t))},t.prototype.lt=function(t){return f(this).lt(c(t))},t.prototype.lte=function(t){return f(this).lte(c(t))},t.prototype.gt=function(t){return f(this).gt(c(t))},t.prototype.gte=function(t){return f(this).gte(c(t))},t.prototype.isZero=function(){return f(this).isZero()},t.prototype.toNumber=function(){try{return f(this).toNumber()}catch(t){a.throwError("overflow",a.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},t.prototype.toString=function(){return f(this).toString(10)},t.prototype.toHexString=function(){return this._hex},t.isBigNumber=function(t){return u.isType(t,"BigNumber")},t}();function _(t){return p.isBigNumber(t)?t:new p(t)}e.BigNumber=p,e.bigNumberify=_},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.ETH_SIGN=0]="ETH_SIGN",t[t.TREZOR=1]="TREZOR",t[t.NO_PREFIX=2]="NO_PREFIX",t[t.PERSONAL_SIGN=3]="PERSONAL_SIGN"}(e.SignMethod||(e.SignMethod={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.INDEXED=1]="INDEXED"}(e.MutationEventTypeKind||(e.MutationEventTypeKind={})),function(t){t[t.LIVE=0]="LIVE",t[t.ROPSTEN=1]="ROPSTEN",t[t.RINKEBY=2]="RINKEBY"}(e.NetworkKind||(e.NetworkKind={}))},function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(9)),o=r(2),s=r(32),u=r(34),a=r(3);function h(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),i=0;i<40;i++)r[i]=e[i].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var n=0;n<40;n+=2)r[n>>1]>>4>=8&&(e[n]=e[n].toUpperCase()),(15&r[n>>1])>=8&&(e[n+1]=e[n+1].toUpperCase());return"0x"+e.join("")}for(var l={},c=0;c<10;c++)l[String(c)]=String(c);for(c=0;c<26;c++)l[String.fromCharCode(65+c)]=String(10+c);var d,f=Math.floor((d=9007199254740991,Math.log10?Math.log10(d):Math.log(d)/Math.LN10));function p(t){t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00";var e="";for(t.split("").forEach((function(t){e+=l[t]}));e.length>=f;){var r=e.substring(0,f);e=parseInt(r,10)%97+e.substring(r.length)}for(var i=String(98-parseInt(e,10)%97);i.length<2;)i="0"+i;return i}function _(t){var e=null;if("string"!=typeof t&&a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t}),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=h(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&a.throwError("bad address checksum",a.INVALID_ARGUMENT,{arg:"address",value:t});else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==p(t)&&a.throwError("bad icap checksum",a.INVALID_ARGUMENT,{arg:"address",value:t}),e=new n.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=_,e.getIcapAddress=function(t){for(var e=new n.default.BN(_(t).substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+p("XE00"+e)+e},e.getContractAddress=function(t){if(!t.from)throw new Error("missing from address");var e=t.nonce;return _("0x"+s.keccak256(u.encode([_(t.from),o.stripZeros(o.hexlify(e))])).substring(26))}},function(t,e,r){"use strict";var i,n="object"==typeof Reflect?Reflect:null,o=n&&"function"==typeof n.apply?n.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};i=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function u(){u.init.call(this)}t.exports=u,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var a=10;function h(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function l(t){return void 0===t._maxListeners?u.defaultMaxListeners:t._maxListeners}function c(t,e,r,i){var n,o,s,u;if(h(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),(n=l(t))>0&&s.length>n&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,u=a,console&&console.warn&&console.warn(u)}return t}function d(){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 f(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=d.bind(i);return n.listener=r,i.wrapFn=n,n}function p(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}(n):v(n,n.length)}function _(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function v(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}Object.defineProperty(u,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");a=t}}),u.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},u.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||s(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},u.prototype.getMaxListeners=function(){return l(this)},u.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var i="error"===t,n=this._events;if(void 0!==n)i=i&&void 0===n.error;else if(!i)return!1;if(i){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var a=n[t];if(void 0===a)return!1;if("function"==typeof a)o(a,this,e);else{var h=a.length,l=v(a,h);for(r=0;r<h;++r)o(l[r],this,e)}return!0},u.prototype.addListener=function(t,e){return c(this,t,e,!1)},u.prototype.on=u.prototype.addListener,u.prototype.prependListener=function(t,e){return c(this,t,e,!0)},u.prototype.once=function(t,e){return h(e),this.on(t,f(this,t,e)),this},u.prototype.prependOnceListener=function(t,e){return h(e),this.prependListener(t,f(this,t,e)),this},u.prototype.removeListener=function(t,e){var r,i,n,o,s;if(h(e),void 0===(i=this._events))return this;if(void 0===(r=i[t]))return this;if(r===e||r.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete i[t],i.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(n=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(r,n),1===r.length&&(i[t]=r[0]),void 0!==i.removeListener&&this.emit("removeListener",t,s||e)}return this},u.prototype.off=u.prototype.removeListener,u.prototype.removeAllListeners=function(t){var e,r,i;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var n,o=Object.keys(r);for(i=0;i<o.length;++i)"removeListener"!==(n=o[i])&&this.removeAllListeners(n);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(i=e.length-1;i>=0;i--)this.removeListener(t,e[i]);return this},u.prototype.listeners=function(t){return p(this,t,!0)},u.prototype.rawListeners=function(t){return p(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):_.call(t,e)},u.prototype.listenerCount=_,u.prototype.eventNames=function(){return this._eventsCount>0?i(this._events):[]}},function(t,e,r){(function(t){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s=r(30).Buffer}catch(t){}function u(t,e,r){for(var i=0,n=Math.min(t.length,r),o=e;o<n;o++){var s=t.charCodeAt(o)-48;i<<=4,i|=s>=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return i}function a(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s<o;s++){var u=t.charCodeAt(s)-48;n*=i,n+=u>=49?u-49+10:u>=17?u-17+10:u}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===e?this._parseHex(t,n):this._parseBase(t,e,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(i(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(i("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var o,s,u=0;if("be"===r)for(n=t.length-1,o=0;n>=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<<u&67108863,this.words[o+1]=s>>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);else if("le"===r)for(n=0,o=0;n<t.length;n+=3)s=t[n]|t[n+1]<<8|t[n+2]<<16,this.words[o]|=s<<u&67108863,this.words[o+1]=s>>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,n,o=0;for(r=t.length-6,i=0;r>=e;r-=6)n=u(t,r,r+6),this.words[i]|=n<<o&67108863,this.words[i+1]|=n>>>26-o&4194303,(o+=24)>=26&&(o-=26,i++);r+6!==e&&(n=u(t,e,r+6),this.words[i]|=n<<o&67108863,this.words[i+1]|=n>>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,u=Math.min(o,o-s)+r,h=0,l=r;l<u;l+=i)h=a(t,l,l+i,e),this.imuln(n),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h);if(0!==s){var c=1;for(h=a(t,l,t.length,e),l=0;l<s;l++)c*=e;this.imuln(c),this.words[0]+h<67108864?this.words[0]+=h:this._iaddn(h)}},o.prototype.copy=function(t){t.words=new Array(this.length);for(var e=0;e<this.length;e++)t.words[e]=this.words[e];t.length=this.length,t.negative=this.negative,t.red=this.red},o.prototype.clone=function(){var t=new o(null);return this.copy(t),t},o.prototype._expand=function(t){for(;this.length<t;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&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?"<BN-R: ":"<BN: ")+this.toString(16)+">"};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],c=[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 d(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,u=67108863&s,a=s/67108864|0;r.words[0]=u;for(var h=1;h<i;h++){for(var l=a>>>26,c=67108863&a,d=Math.min(h,e.length-1),f=Math.max(0,h-t.length+1);f<=d;f++){var p=h-f|0;l+=(s=(n=0|t.words[p])*(o=0|e.words[f])+c)/67108864|0,c=67108863&s}r.words[h]=0|c,a=0|l}return 0!==a?r.words[h]=0|a:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s<this.length;s++){var u=this.words[s],a=(16777215&(u<<n|o)).toString(16);r=0!==(o=u>>>24-n&16777215)||s!==this.length-1?h[6-a.length]+a+r:a+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var d=l[t],f=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var _=p.modn(f).toString(t);r=(p=p.idivn(f)).isZero()?_+r:h[d-_.length]+_+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,u,a="le"===e,h=new t(o),l=this.clone();if(a){for(u=0;!l.isZero();u++)s=l.andln(255),l.iushrn(8),h[u]=s;for(;u<o;u++)h[u]=0}else{for(u=0;u<o-n;u++)h[u]=0;for(u=0;!l.isZero();u++)s=l.andln(255),l.iushrn(8),h[o-u-1]=s}return h},Math.clz32?o.prototype._countBits=function(t){return 32-Math.clz32(t)}:o.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;e<this.length;e++){var r=this._zeroBits(this.words[e]);if(t+=r,26!==r)break}return t},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(t){return 0!==this.negative?this.abs().inotn(t).iaddn(1):this.clone()},o.prototype.fromTwos=function(t){return this.testn(t-1)?this.notn(t).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(t){for(;this.length<t.length;)this.words[this.length++]=0;for(var e=0;e<t.length;e++)this.words[e]=this.words[e]|t.words[e];return this.strip()},o.prototype.ior=function(t){return i(0==(this.negative|t.negative)),this.iuor(t)},o.prototype.or=function(t){return this.length>t.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;r<e.length;r++)this.words[r]=this.words[r]&t.words[r];return this.length=e.length,this.strip()},o.prototype.iand=function(t){return i(0==(this.negative|t.negative)),this.iuand(t)},o.prototype.and=function(t){return this.length>t.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;i<r.length;i++)this.words[i]=e.words[i]^r.words[i];if(this!==e)for(;i<e.length;i++)this.words[i]=e.words[i];return this.length=e.length,this.strip()},o.prototype.ixor=function(t){return i(0==(this.negative|t.negative)),this.iuxor(t)},o.prototype.xor=function(t){return this.length>t.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n<e;n++)this.words[n]=67108863&~this.words[n];return r>0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<<n:this.words[r]&~(1<<n),this.strip()},o.prototype.iadd=function(t){var e,r,i;if(0!==this.negative&&0===t.negative)return this.negative=0,e=this.isub(t),this.negative^=1,this._normSign();if(0===this.negative&&0!==t.negative)return t.negative=0,e=this.isub(t),t.negative=1,e._normSign();this.length>t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o<i.length;o++)e=(0|r.words[o])+(0|i.words[o])+n,this.words[o]=67108863&e,n=e>>>26;for(;0!==n&&o<r.length;o++)e=(0|r.words[o])+n,this.words[o]=67108863&e,n=e>>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(t){var e;return 0!==t.negative&&0===this.negative?(t.negative=0,e=this.sub(t),t.negative^=1,e):0===t.negative&&0!==this.negative?(this.negative=0,e=t.sub(this),this.negative=1,e):this.length>t.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s<i.length;s++)o=(e=(0|r.words[s])-(0|i.words[s])+o)>>26,this.words[s]=67108863&e;for(;0!==o&&s<r.length;s++)o=(e=(0|r.words[s])+o)>>26,this.words[s]=67108863&e;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(t){return this.clone().isub(t)};var f=function(t,e,r){var i,n,o,s=t.words,u=e.words,a=r.words,h=0,l=0|s[0],c=8191&l,d=l>>>13,f=0|s[1],p=8191&f,_=f>>>13,v=0|s[2],E=8191&v,m=v>>>13,g=0|s[3],A=8191&g,y=g>>>13,M=0|s[4],T=8191&M,w=M>>>13,N=0|s[5],R=8191&N,I=N>>>13,O=0|s[6],b=8191&O,S=O>>>13,D=0|s[7],P=8191&D,L=D>>>13,C=0|s[8],x=8191&C,U=C>>>13,G=0|s[9],k=8191&G,B=G>>>13,F=0|u[0],j=8191&F,Y=F>>>13,V=0|u[1],W=8191&V,X=V>>>13,K=0|u[2],Z=8191&K,H=K>>>13,z=0|u[3],q=8191&z,$=z>>>13,J=0|u[4],Q=8191&J,tt=J>>>13,et=0|u[5],rt=8191&et,it=et>>>13,nt=0|u[6],ot=8191&nt,st=nt>>>13,ut=0|u[7],at=8191&ut,ht=ut>>>13,lt=0|u[8],ct=8191&lt,dt=lt>>>13,ft=0|u[9],pt=8191&ft,_t=ft>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(i=Math.imul(c,j))|0)+((8191&(n=(n=Math.imul(c,Y))+Math.imul(d,j)|0))<<13)|0;h=((o=Math.imul(d,Y))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,j),n=(n=Math.imul(p,Y))+Math.imul(_,j)|0,o=Math.imul(_,Y);var Et=(h+(i=i+Math.imul(c,W)|0)|0)+((8191&(n=(n=n+Math.imul(c,X)|0)+Math.imul(d,W)|0))<<13)|0;h=((o=o+Math.imul(d,X)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(E,j),n=(n=Math.imul(E,Y))+Math.imul(m,j)|0,o=Math.imul(m,Y),i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,X)|0;var mt=(h+(i=i+Math.imul(c,Z)|0)|0)+((8191&(n=(n=n+Math.imul(c,H)|0)+Math.imul(d,Z)|0))<<13)|0;h=((o=o+Math.imul(d,H)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(A,j),n=(n=Math.imul(A,Y))+Math.imul(y,j)|0,o=Math.imul(y,Y),i=i+Math.imul(E,W)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,X)|0,i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,H)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,H)|0;var gt=(h+(i=i+Math.imul(c,q)|0)|0)+((8191&(n=(n=n+Math.imul(c,$)|0)+Math.imul(d,q)|0))<<13)|0;h=((o=o+Math.imul(d,$)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(T,j),n=(n=Math.imul(T,Y))+Math.imul(w,j)|0,o=Math.imul(w,Y),i=i+Math.imul(A,W)|0,n=(n=n+Math.imul(A,X)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(E,Z)|0,n=(n=n+Math.imul(E,H)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,H)|0,i=i+Math.imul(p,q)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,$)|0;var At=(h+(i=i+Math.imul(c,Q)|0)|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(d,Q)|0))<<13)|0;h=((o=o+Math.imul(d,tt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(R,j),n=(n=Math.imul(R,Y))+Math.imul(I,j)|0,o=Math.imul(I,Y),i=i+Math.imul(T,W)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(w,W)|0,o=o+Math.imul(w,X)|0,i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,H)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,H)|0,i=i+Math.imul(E,q)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,$)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0;var yt=(h+(i=i+Math.imul(c,rt)|0)|0)+((8191&(n=(n=n+Math.imul(c,it)|0)+Math.imul(d,rt)|0))<<13)|0;h=((o=o+Math.imul(d,it)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(b,j),n=(n=Math.imul(b,Y))+Math.imul(S,j)|0,o=Math.imul(S,Y),i=i+Math.imul(R,W)|0,n=(n=n+Math.imul(R,X)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,X)|0,i=i+Math.imul(T,Z)|0,n=(n=n+Math.imul(T,H)|0)+Math.imul(w,Z)|0,o=o+Math.imul(w,H)|0,i=i+Math.imul(A,q)|0,n=(n=n+Math.imul(A,$)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,$)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,it)|0;var Mt=(h+(i=i+Math.imul(c,ot)|0)|0)+((8191&(n=(n=n+Math.imul(c,st)|0)+Math.imul(d,ot)|0))<<13)|0;h=((o=o+Math.imul(d,st)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(P,j),n=(n=Math.imul(P,Y))+Math.imul(L,j)|0,o=Math.imul(L,Y),i=i+Math.imul(b,W)|0,n=(n=n+Math.imul(b,X)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,X)|0,i=i+Math.imul(R,Z)|0,n=(n=n+Math.imul(R,H)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,H)|0,i=i+Math.imul(T,q)|0,n=(n=n+Math.imul(T,$)|0)+Math.imul(w,q)|0,o=o+Math.imul(w,$)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0;var Tt=(h+(i=i+Math.imul(c,at)|0)|0)+((8191&(n=(n=n+Math.imul(c,ht)|0)+Math.imul(d,at)|0))<<13)|0;h=((o=o+Math.imul(d,ht)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(x,j),n=(n=Math.imul(x,Y))+Math.imul(U,j)|0,o=Math.imul(U,Y),i=i+Math.imul(P,W)|0,n=(n=n+Math.imul(P,X)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,X)|0,i=i+Math.imul(b,Z)|0,n=(n=n+Math.imul(b,H)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,H)|0,i=i+Math.imul(R,q)|0,n=(n=n+Math.imul(R,$)|0)+Math.imul(I,q)|0,o=o+Math.imul(I,$)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(w,Q)|0,o=o+Math.imul(w,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0,i=i+Math.imul(p,at)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(_,at)|0,o=o+Math.imul(_,ht)|0;var wt=(h+(i=i+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;h=((o=o+Math.imul(d,dt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(k,j),n=(n=Math.imul(k,Y))+Math.imul(B,j)|0,o=Math.imul(B,Y),i=i+Math.imul(x,W)|0,n=(n=n+Math.imul(x,X)|0)+Math.imul(U,W)|0,o=o+Math.imul(U,X)|0,i=i+Math.imul(P,Z)|0,n=(n=n+Math.imul(P,H)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,H)|0,i=i+Math.imul(b,q)|0,n=(n=n+Math.imul(b,$)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,$)|0,i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(w,rt)|0,o=o+Math.imul(w,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(E,at)|0,n=(n=n+Math.imul(E,ht)|0)+Math.imul(m,at)|0,o=o+Math.imul(m,ht)|0,i=i+Math.imul(p,ct)|0,n=(n=n+Math.imul(p,dt)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,dt)|0;var Nt=(h+(i=i+Math.imul(c,pt)|0)|0)+((8191&(n=(n=n+Math.imul(c,_t)|0)+Math.imul(d,pt)|0))<<13)|0;h=((o=o+Math.imul(d,_t)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,i=Math.imul(k,W),n=(n=Math.imul(k,X))+Math.imul(B,W)|0,o=Math.imul(B,X),i=i+Math.imul(x,Z)|0,n=(n=n+Math.imul(x,H)|0)+Math.imul(U,Z)|0,o=o+Math.imul(U,H)|0,i=i+Math.imul(P,q)|0,n=(n=n+Math.imul(P,$)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,$)|0,i=i+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,i=i+Math.imul(R,rt)|0,n=(n=n+Math.imul(R,it)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(w,ot)|0,o=o+Math.imul(w,st)|0,i=i+Math.imul(A,at)|0,n=(n=n+Math.imul(A,ht)|0)+Math.imul(y,at)|0,o=o+Math.imul(y,ht)|0,i=i+Math.imul(E,ct)|0,n=(n=n+Math.imul(E,dt)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,dt)|0;var Rt=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,_t)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,_t)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(k,Z),n=(n=Math.imul(k,H))+Math.imul(B,Z)|0,o=Math.imul(B,H),i=i+Math.imul(x,q)|0,n=(n=n+Math.imul(x,$)|0)+Math.imul(U,q)|0,o=o+Math.imul(U,$)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,i=i+Math.imul(b,rt)|0,n=(n=n+Math.imul(b,it)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,it)|0,i=i+Math.imul(R,ot)|0,n=(n=n+Math.imul(R,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,i=i+Math.imul(T,at)|0,n=(n=n+Math.imul(T,ht)|0)+Math.imul(w,at)|0,o=o+Math.imul(w,ht)|0,i=i+Math.imul(A,ct)|0,n=(n=n+Math.imul(A,dt)|0)+Math.imul(y,ct)|0,o=o+Math.imul(y,dt)|0;var It=(h+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,_t)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,_t)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(k,q),n=(n=Math.imul(k,$))+Math.imul(B,q)|0,o=Math.imul(B,$),i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(U,Q)|0,o=o+Math.imul(U,tt)|0,i=i+Math.imul(P,rt)|0,n=(n=n+Math.imul(P,it)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,it)|0,i=i+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,i=i+Math.imul(R,at)|0,n=(n=n+Math.imul(R,ht)|0)+Math.imul(I,at)|0,o=o+Math.imul(I,ht)|0,i=i+Math.imul(T,ct)|0,n=(n=n+Math.imul(T,dt)|0)+Math.imul(w,ct)|0,o=o+Math.imul(w,dt)|0;var Ot=(h+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,_t)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,_t)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(k,Q),n=(n=Math.imul(k,tt))+Math.imul(B,Q)|0,o=Math.imul(B,tt),i=i+Math.imul(x,rt)|0,n=(n=n+Math.imul(x,it)|0)+Math.imul(U,rt)|0,o=o+Math.imul(U,it)|0,i=i+Math.imul(P,ot)|0,n=(n=n+Math.imul(P,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,i=i+Math.imul(b,at)|0,n=(n=n+Math.imul(b,ht)|0)+Math.imul(S,at)|0,o=o+Math.imul(S,ht)|0,i=i+Math.imul(R,ct)|0,n=(n=n+Math.imul(R,dt)|0)+Math.imul(I,ct)|0,o=o+Math.imul(I,dt)|0;var bt=(h+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,_t)|0)+Math.imul(w,pt)|0))<<13)|0;h=((o=o+Math.imul(w,_t)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(k,rt),n=(n=Math.imul(k,it))+Math.imul(B,rt)|0,o=Math.imul(B,it),i=i+Math.imul(x,ot)|0,n=(n=n+Math.imul(x,st)|0)+Math.imul(U,ot)|0,o=o+Math.imul(U,st)|0,i=i+Math.imul(P,at)|0,n=(n=n+Math.imul(P,ht)|0)+Math.imul(L,at)|0,o=o+Math.imul(L,ht)|0,i=i+Math.imul(b,ct)|0,n=(n=n+Math.imul(b,dt)|0)+Math.imul(S,ct)|0,o=o+Math.imul(S,dt)|0;var St=(h+(i=i+Math.imul(R,pt)|0)|0)+((8191&(n=(n=n+Math.imul(R,_t)|0)+Math.imul(I,pt)|0))<<13)|0;h=((o=o+Math.imul(I,_t)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(k,ot),n=(n=Math.imul(k,st))+Math.imul(B,ot)|0,o=Math.imul(B,st),i=i+Math.imul(x,at)|0,n=(n=n+Math.imul(x,ht)|0)+Math.imul(U,at)|0,o=o+Math.imul(U,ht)|0,i=i+Math.imul(P,ct)|0,n=(n=n+Math.imul(P,dt)|0)+Math.imul(L,ct)|0,o=o+Math.imul(L,dt)|0;var Dt=(h+(i=i+Math.imul(b,pt)|0)|0)+((8191&(n=(n=n+Math.imul(b,_t)|0)+Math.imul(S,pt)|0))<<13)|0;h=((o=o+Math.imul(S,_t)|0)+(n>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,i=Math.imul(k,at),n=(n=Math.imul(k,ht))+Math.imul(B,at)|0,o=Math.imul(B,ht),i=i+Math.imul(x,ct)|0,n=(n=n+Math.imul(x,dt)|0)+Math.imul(U,ct)|0,o=o+Math.imul(U,dt)|0;var Pt=(h+(i=i+Math.imul(P,pt)|0)|0)+((8191&(n=(n=n+Math.imul(P,_t)|0)+Math.imul(L,pt)|0))<<13)|0;h=((o=o+Math.imul(L,_t)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(k,ct),n=(n=Math.imul(k,dt))+Math.imul(B,ct)|0,o=Math.imul(B,dt);var Lt=(h+(i=i+Math.imul(x,pt)|0)|0)+((8191&(n=(n=n+Math.imul(x,_t)|0)+Math.imul(U,pt)|0))<<13)|0;h=((o=o+Math.imul(U,_t)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var Ct=(h+(i=Math.imul(k,pt))|0)+((8191&(n=(n=Math.imul(k,_t))+Math.imul(B,pt)|0))<<13)|0;return h=((o=Math.imul(B,_t))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,a[0]=vt,a[1]=Et,a[2]=mt,a[3]=gt,a[4]=At,a[5]=yt,a[6]=Mt,a[7]=Tt,a[8]=wt,a[9]=Nt,a[10]=Rt,a[11]=It,a[12]=Ot,a[13]=bt,a[14]=St,a[15]=Dt,a[16]=Pt,a[17]=Lt,a[18]=Ct,0!==h&&(a[19]=h,r.length++),r};function p(t,e,r){return(new _).mulp(t,e,r)}function _(t,e){this.x=t,this.y=e}Math.imul||(f=d),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?f(this,t,e):r<63?d(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o<r.length-1;o++){var s=n;n=0;for(var u=67108863&i,a=Math.min(o,e.length-1),h=Math.max(0,o-t.length+1);h<=a;h++){var l=o-h,c=(0|t.words[l])*(0|e.words[h]),d=67108863&c;u=67108863&(d=d+u|0),n+=(s=(s=s+(c/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[o]=u,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},_.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i<t;i++)e[i]=this.revBin(i,r,t);return e},_.prototype.revBin=function(t,e,r){if(0===t||t===r-1)return t;for(var i=0,n=0;n<e;n++)i|=(1&t)<<e-n-1,t>>=1;return i},_.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s<o;s++)i[s]=e[t[s]],n[s]=r[t[s]]},_.prototype.transform=function(t,e,r,i,n,o){this.permute(o,t,e,r,i,n);for(var s=1;s<n;s<<=1)for(var u=s<<1,a=Math.cos(2*Math.PI/u),h=Math.sin(2*Math.PI/u),l=0;l<n;l+=u)for(var c=a,d=h,f=0;f<s;f++){var p=r[l+f],_=i[l+f],v=r[l+f+s],E=i[l+f+s],m=c*v-d*E;E=c*E+d*v,v=m,r[l+f]=p+v,i[l+f]=_+E,r[l+f+s]=p-v,i[l+f+s]=_-E,f!==u&&(m=a*c-h*d,d=a*d+h*c,c=m)}},_.prototype.guessLen13b=function(t,e){var r=1|Math.max(e,t),i=1&r,n=0;for(r=r/2|0;r;r>>>=1)n++;return 1<<n+1+i},_.prototype.conjugate=function(t,e,r){if(!(r<=1))for(var i=0;i<r/2;i++){var n=t[i];t[i]=t[r-i-1],t[r-i-1]=n,n=e[i],e[i]=-e[r-i-1],e[r-i-1]=-n}},_.prototype.normalize13b=function(t,e){for(var r=0,i=0;i<e/2;i++){var n=8192*Math.round(t[2*i+1]/e)+Math.round(t[2*i]/e)+r;t[i]=67108863&n,r=n<67108864?0:n/67108864|0}return t},_.prototype.convert13b=function(t,e,r,n){for(var o=0,s=0;s<e;s++)o+=0|t[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s<n;++s)r[s]=0;i(0===o),i(0==(-8192&o))},_.prototype.stub=function(t){for(var e=new Array(t),r=0;r<t;r++)e[r]=0;return e},_.prototype.mulp=function(t,e,r){var i=2*this.guessLen13b(t.length,e.length),n=this.makeRBT(i),o=this.stub(i),s=new Array(i),u=new Array(i),a=new Array(i),h=new Array(i),l=new Array(i),c=new Array(i),d=r.words;d.length=i,this.convert13b(t.words,t.length,s,i),this.convert13b(e.words,e.length,h,i),this.transform(s,o,u,a,i,n),this.transform(h,o,l,c,i,n);for(var f=0;f<i;f++){var p=u[f]*l[f]-a[f]*c[f];a[f]=u[f]*c[f]+a[f]*l[f],u[f]=p}return this.conjugate(u,a,i),this.transform(u,a,d,o,i,n),this.conjugate(d,o,i),this.normalize13b(d,i),r.negative=t.negative^e.negative,r.length=t.length+e.length,r.strip()},o.prototype.mul=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),this.mulTo(t,e)},o.prototype.mulf=function(t){var e=new o(null);return e.words=new Array(this.length+t.length),p(this,t,e)},o.prototype.imul=function(t){return this.clone().mulTo(t,this)},o.prototype.imuln=function(t){i("number"==typeof t),i(t<67108864);for(var e=0,r=0;r<this.length;r++){var n=(0|this.words[r])*t,o=(67108863&n)+(67108863&e);e>>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r<e.length;r++){var i=r/26|0,n=r%26;e[r]=(t.words[i]&1<<n)>>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i<e.length&&0===e[i];i++,r=r.sqr());if(++i<e.length)for(var n=r.sqr();i<e.length;i++,n=n.sqr())0!==e[i]&&(r=r.mul(n));return r},o.prototype.iushln=function(t){i("number"==typeof t&&t>=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e<this.length;e++){var u=this.words[e]&o,a=(0|this.words[e])-u<<r;this.words[e]=a|s,s=u>>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e<n;e++)this.words[e]=0;this.length+=n}return this.strip()},o.prototype.ishln=function(t){return i(0===this.negative),this.iushln(t)},o.prototype.iushrn=function(t,e,r){var n;i("number"==typeof t&&t>=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),u=67108863^67108863>>>o<<o,a=r;if(n-=s,n=Math.max(0,n),a){for(var h=0;h<s;h++)a.words[h]=this.words[h];a.length=s}if(0===s);else if(this.length>s)for(this.length-=s,h=0;h<this.length;h++)this.words[h]=this.words[h+s];else this.words[0]=0,this.length=1;var l=0;for(h=this.length-1;h>=0&&(0!==l||h>=n);h--){var c=0|this.words[h];this.words[h]=l<<26-o|c>>>o,l=c&u}return a&&0!==l&&(a.words[a.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<<e;return!(this.length<=r)&&!!(this.words[r]&n)},o.prototype.imaskn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<<e;this.words[this.length-1]&=n}return this.strip()},o.prototype.maskn=function(t){return this.clone().imaskn(t)},o.prototype.iaddn=function(t){return i("number"==typeof t),i(t<67108864),t<0?this.isubn(-t):0!==this.negative?1===this.length&&(0|this.words[0])<t?(this.words[0]=t-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(t),this.negative=1,this):this._iaddn(t)},o.prototype._iaddn=function(t){this.words[0]+=t;for(var e=0;e<this.length&&this.words[e]>=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e<this.length&&this.words[e]<0;e++)this.words[e]+=67108864,this.words[e+1]-=1;return this.strip()},o.prototype.addn=function(t){return this.clone().iaddn(t)},o.prototype.subn=function(t){return this.clone().isubn(t)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(t,e,r){var n,o,s=t.length+r;this._expand(s);var u=0;for(n=0;n<t.length;n++){o=(0|this.words[n+r])+u;var a=(0|t.words[n])*e;u=((o-=67108863&a)>>26)-(a/67108864|0),this.words[n+r]=67108863&o}for(;n<this.length-r;n++)u=(o=(0|this.words[n+r])+u)>>26,this.words[n+r]=67108863&o;if(0===u)return this.strip();for(i(-1===u),u=0,n=0;n<this.length;n++)u=(o=-(0|this.words[n])+u)>>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!==(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var u,a=i.length-n.length;if("mod"!==e){(u=new o(null)).length=a+1,u.words=new Array(u.length);for(var h=0;h<u.length;h++)u.words[h]=0}var l=i.clone()._ishlnsubmul(n,1,a);0===l.negative&&(i=l,u&&(u.words[a]=1));for(var c=a-1;c>=0;c--){var d=67108864*(0|i.words[n.length+c])+(0|i.words[n.length+c-1]);for(d=Math.min(d/s|0,67108863),i._ishlnsubmul(n,d,c);0!==i.negative;)d--,i.negative=0,i._ishlnsubmul(n,1,c),i.isZero()||(i.negative^=1);u&&(u.words[c]=d)}return u&&u.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:u||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(u=this.neg().divmod(t,e),"mod"!==e&&(n=u.div.neg()),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(u=this.divmod(t.neg(),e),"mod"!==e&&(n=u.div.neg()),{div:n,mod:u.mod}):0!=(this.negative&t.negative)?(u=this.neg().divmod(t.neg(),e),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:u.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,u},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),u=new o(0),a=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),c=e.clone();!e.isZero();){for(var d=0,f=1;0==(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(l),s.isub(c)),n.iushrn(1),s.iushrn(1);for(var p=0,_=1;0==(r.words[0]&_)&&p<26;++p,_<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(u.isOdd()||a.isOdd())&&(u.iadd(l),a.isub(c)),u.iushrn(1),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(u),s.isub(a)):(r.isub(e),u.isub(n),a.isub(s))}return{a:u,b:a,gcd:r.iushln(h)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),u=new o(0),a=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,l=1;0==(e.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(a),s.iushrn(1);for(var c=0,d=1;0==(r.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(r.iushrn(c);c-- >0;)u.isOdd()&&u.iadd(a),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(u)):(r.isub(e),u.isub(s))}return(n=0===e.cmpn(1)?s:u).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<<e;if(this.length<=r)return this._expand(r+1),this.words[r]|=n,this;for(var o=n,s=r;0!==o&&s<this.length;s++){var u=0|this.words[s];o=(u+=o)>>>26,u&=67108863,this.words[s]=u}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:n<t?-1:1}return 0!==this.negative?0|-e:e},o.prototype.cmp=function(t){if(0!==this.negative&&0===t.negative)return-1;if(0===this.negative&&0!==t.negative)return 1;var e=this.ucmp(t);return 0!==this.negative?0|-e:e},o.prototype.ucmp=function(t){if(this.length>t.length)return 1;if(this.length<t.length)return-1;for(var e=0,r=this.length-1;r>=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){i<n?e=-1:i>n&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new M(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function E(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function m(){E.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function g(){E.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){E.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function y(){E.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function T(t){M.call(this,t),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)}E.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},E.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e<this.n?-1:r.ucmp(this.p);return 0===i?(r.words[0]=0,r.length=1):i>0?r.isub(this.p):r.strip(),r},E.prototype.split=function(t,e){t.iushrn(this.n,0,e)},E.prototype.imulK=function(t){return t.imul(this.k)},n(m,E),m.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i<r;i++)e.words[i]=t.words[i];if(e.length=r,t.length<=9)return t.words[0]=0,void(t.length=1);var n=t.words[9];for(e.words[e.length++]=4194303&n,i=10;i<t.length;i++){var o=0|t.words[i];t.words[i-10]=(4194303&o)<<4|n>>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},m.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r<t.length;r++){var i=0|t.words[r];e+=977*i,t.words[r]=67108863&e,e=64*i+(e/67108864|0)}return 0===t.words[t.length-1]&&(t.length--,0===t.words[t.length-1]&&t.length--),t},n(g,E),n(A,E),n(y,E),y.prototype.imulK=function(t){for(var e=0,r=0;r<t.length;r++){var i=19*(0|t.words[r])+e,n=67108863&i;i>>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new m;else if("p224"===t)e=new g;else if("p192"===t)e=new A;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new y}return v[t]=e,e},M.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var u=new o(1).toRed(this),a=u.redNeg(),h=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,h).cmp(a);)l.redIAdd(a);for(var c=this.pow(l,n),d=this.pow(t,n.addn(1).iushrn(1)),f=this.pow(t,n),p=s;0!==f.cmp(u);){for(var _=f,v=0;0!==_.cmp(u);v++)_=_.redSqr();i(v<p);var E=this.pow(c,new o(1).iushln(p-v-1));d=d.redMul(E),c=E.redSqr(),f=f.redMul(c),p=v}return d},M.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},M.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var i=2;i<r.length;i++)r[i]=this.mul(r[i-1],t);var n=r[0],s=0,u=0,a=e.bitLength()%26;for(0===a&&(a=26),i=e.length-1;i>=0;i--){for(var h=e.words[i],l=a-1;l>=0;l--){var c=h>>l&1;n!==r[0]&&(n=this.sqr(n)),0!==c||0!==s?(s<<=1,s|=c,(4===++u||0===i&&0===l)&&(n=this.mul(n,r[s]),u=0,s=0)):u=0}a=26}return n},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new T(t)},n(T,M),T.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},T.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},T.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},T.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},T.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(29)(t))},function(t,e,r){"use strict";function i(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),i(r(48)),i(r(51)),i(r(53)),i(r(55)),i(r(56)),i(r(57)),i(r(58)),i(r(59))},function(t,e,r){"use strict";var i,n=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var s=r(16),u=o(r(3)),a=r(7),h=r(5),l=r(2),c=r(35),d=r(17),f=new RegExp(/^bytes([0-9]*)$/),p=new RegExp(/^(u?int)([0-9]*)$/),_=new RegExp(/^(.*)\[([0-9]*)\]$/);e.defaultCoerceFunc=function(t,e){var r=t.match(p);return r&&parseInt(r[2])<=48?e.toNumber():e};var v=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),E=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function m(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}function g(t,e){var r=t;function i(t){throw new Error('unexpected character "'+r[t]+'" at position '+t+' in "'+r+'"')}t=t.replace(/\s/g," ");for(var n={type:"",name:"",state:{allowType:!0}},o=n,s=0;s<t.length;s++){var u=t[s];switch(u){case"(":o.state.allowParams||i(s),o.state.allowType=!1,o.type=m(o.type),o.components=[{type:"",name:"",parent:o,state:{allowType:!0}}],o=o.components[0];break;case")":delete o.state,e&&"indexed"===o.name&&(o.indexed=!0,o.name=""),o.type=m(o.type);var a=o;(o=o.parent)||i(s),delete a.parent,o.state.allowParams=!1,o.state.allowName=!0,o.state.allowArray=!0;break;case",":delete o.state,e&&"indexed"===o.name&&(o.indexed=!0,o.name=""),o.type=m(o.type);var h={type:"",name:"",parent:o.parent,state:{allowType:!0}};o.parent.components.push(h),delete o.parent,o=h;break;case" ":o.state.allowType&&""!==o.type&&(o.type=m(o.type),delete o.state.allowType,o.state.allowName=!0,o.state.allowParams=!0),o.state.allowName&&""!==o.name&&(e&&"indexed"===o.name?(o.indexed=!0,o.name=""):o.state.allowName=!1);break;case"[":o.state.allowArray||i(s),o.type+=u,o.state.allowArray=!1,o.state.allowName=!1,o.state.readArray=!0;break;case"]":o.state.readArray||i(s),o.type+=u,o.state.readArray=!1,o.state.allowArray=!0,o.state.allowName=!0;break;default:o.state.allowType?(o.type+=u,o.state.allowParams=!0,o.state.allowArray=!0):o.state.allowName?(o.name+=u,delete o.state.allowArray):o.state.readArray?o.type+=u:i(s)}}if(o.parent)throw new Error("unexpected eof");return delete n.state,e&&"indexed"===o.name&&(o.indexed=!0,o.name=""),n.type=m(n.type),n}function A(t){return F(e.defaultCoerceFunc,t).type}e.parseParamType=function(t){return g(t,!0)},e.formatParamType=A,e.formatSignature=function(t){return t.name+"("+t.inputs.map((function(t){return A(t)})).join(",")+")"},e.parseSignature=function(t){if("string"==typeof t)return"event "===(t=(t=(t=t.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).substring(0,6)?function(t){var e={anonymous:!1,inputs:[],name:"",type:"event"},r=t.match(v);if(!r)throw new Error("invalid event: "+t);if(e.name=r[1].trim(),k(r[2]).forEach((function(t){(t=g(t,!0)).indexed=!!t.indexed,e.inputs.push(t)})),r[3].split(" ").forEach((function(t){switch(t){case"anonymous":e.anonymous=!0;break;case"":break;default:u.info("unknown modifier: "+t)}})),e.name&&!e.name.match(E))throw new Error('invalid identifier: "'+e.name+'"');return e}(t.substring(6).trim()):("function "===t.substring(0,9)&&(t=t.substring(9)),function(t){var e={constant:!1,gas:null,inputs:[],name:"",outputs:[],payable:!1,stateMutability:null,type:"function"},r=t.split("@");if(1!==r.length){if(r.length>2)throw new Error("invalid signature");if(!r[1].match(/^[0-9]+$/))throw new Error("invalid signature gas");e.gas=h.bigNumberify(r[1]),t=r[0]}var i=(r=t.split(" returns "))[0].match(v);if(!i)throw new Error("invalid signature");if(e.name=i[1].trim(),!e.name.match(E))throw new Error('invalid identifier: "'+i[1]+'"');if(k(i[2]).forEach((function(t){e.inputs.push(g(t))})),i[3].split(" ").forEach((function(t){switch(t){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:u.info("unknown modifier: "+t)}})),r.length>1){var n=r[1].match(v);if(""!=n[1].trim()||""!=n[3].trim())throw new Error("unexpected tokens");k(n[2]).forEach((function(t){e.outputs.push(g(t))}))}if("constructor"===e.name){if(e.type="constructor",e.outputs.length)throw new Error("constructor may not have outputs");delete e.name,delete e.outputs}return e}(t.trim()));throw new Error("unknown signature")};var y=function(t,e,r,i,n){this.coerceFunc=t,this.name=e,this.type=r,this.localName=i,this.dynamic=n},M=function(t){function e(e){var r=t.call(this,e.coerceFunc,e.name,e.type,void 0,e.dynamic)||this;return d.defineReadOnly(r,"coder",e),r}return n(e,t),e.prototype.encode=function(t){return this.coder.encode(t)},e.prototype.decode=function(t,e){return this.coder.decode(t,e)},e}(y),T=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return n(e,t),e.prototype.encode=function(t){return l.arrayify([])},e.prototype.decode=function(t,e){if(e>t.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},e}(y),w=function(t){function e(e,r,i,n){var o=this,s=(i?"int":"uint")+8*r;return(o=t.call(this,e,s,s,n,!1)||this).size=r,o.signed=i,o}return n(e,t),e.prototype.encode=function(t){try{var e=h.bigNumberify(t);if(this.signed){var r=s.MaxUint256.maskn(8*this.size-1);if(e.gt(r))throw new Error("out-of-bounds");if(r=r.add(s.One).mul(s.NegativeOne),e.lt(r))throw new Error("out-of-bounds")}else if(e.lt(s.Zero)||e.gt(s.MaxUint256.maskn(8*this.size)))throw new Error("out-of-bounds");return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),l.padZeros(l.arrayify(e),32)}catch(e){u.throwError("invalid number value",u.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length<e+32&&u.throwError("insufficient data for "+this.name+" type",u.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:l.hexlify(t.slice(e,e+32))});var r=32-this.size,i=h.bigNumberify(t.slice(e+r,e+32));return i=this.signed?i.fromTwos(8*this.size):i.maskn(8*this.size),{consumed:32,value:this.coerceFunc(this.name,i)}},e}(y),N=new w((function(t,e){return e}),32,!1,"none"),R=function(t){function e(e,r){return t.call(this,e,"bool","bool",r,!1)||this}return n(e,t),e.prototype.encode=function(t){return N.encode(t?1:0)},e.prototype.decode=function(t,e){try{var r=N.decode(t,e)}catch(t){throw"insufficient data for uint256 type"===t.reason&&u.throwError("insufficient data for boolean type",u.INVALID_ARGUMENT,{arg:this.localName,coderType:"boolean",value:t.value}),t}return{consumed:r.consumed,value:this.coerceFunc("bool",!r.value.isZero())}},e}(y),I=function(t){function e(e,r,i){var n=this,o="bytes"+r;return(n=t.call(this,e,o,o,i,!1)||this).length=r,n}return n(e,t),e.prototype.encode=function(t){var e=new Uint8Array(32);try{var r=l.arrayify(t);if(r.length!==this.length)throw new Error("incorrect data length");e.set(r)}catch(e){u.throwError("invalid "+this.name+" value",u.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e.value||t})}return e},e.prototype.decode=function(t,e){return t.length<e+32&&u.throwError("insufficient data for "+this.name+" type",u.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:l.hexlify(t.slice(e,e+32))}),{consumed:32,value:this.coerceFunc(this.name,l.hexlify(t.slice(e,e+this.length)))}},e}(y),O=function(t){function e(e,r){return t.call(this,e,"address","address",r,!1)||this}return n(e,t),e.prototype.encode=function(t){var e=new Uint8Array(32);try{e.set(l.arrayify(a.getAddress(t)),12)}catch(e){u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:this.localName,coderType:"address",value:t})}return e},e.prototype.decode=function(t,e){return t.length<e+32&&u.throwError("insufficuent data for address type",u.INVALID_ARGUMENT,{arg:this.localName,coderType:"address",value:l.hexlify(t.slice(e,e+32))}),{consumed:32,value:this.coerceFunc("address",a.getAddress(l.hexlify(t.slice(e+12,e+32))))}},e}(y);function b(t){var e=32*Math.ceil(t.length/32),r=new Uint8Array(e-t.length);return l.concat([N.encode(t.length),t,r])}function S(t,e,r){t.length<e+32&&u.throwError("insufficient data for dynamicBytes length",u.INVALID_ARGUMENT,{arg:r,coderType:"dynamicBytes",value:l.hexlify(t.slice(e,e+32))});var i=N.decode(t,e).value;try{i=i.toNumber()}catch(t){u.throwError("dynamic bytes count too large",u.INVALID_ARGUMENT,{arg:r,coderType:"dynamicBytes",value:i.toString()})}return t.length<e+32+i&&u.throwError("insufficient data for dynamicBytes type",u.INVALID_ARGUMENT,{arg:r,coderType:"dynamicBytes",value:l.hexlify(t.slice(e,e+32+i))}),{consumed:32+32*Math.ceil(i/32),value:t.slice(e+32,e+32+i)}}var D=function(t){function e(e,r){return t.call(this,e,"bytes","bytes",r,!0)||this}return n(e,t),e.prototype.encode=function(t){try{return b(l.arrayify(t))}catch(t){u.throwError("invalid bytes value",u.INVALID_ARGUMENT,{arg:this.localName,coderType:"bytes",value:t.value})}return null},e.prototype.decode=function(t,e){var r=S(t,e,this.localName);return r.value=this.coerceFunc("bytes",l.hexlify(r.value)),r},e}(y),P=function(t){function e(e,r){return t.call(this,e,"string","string",r,!0)||this}return n(e,t),e.prototype.encode=function(t){return"string"!=typeof t&&u.throwError("invalid string value",u.INVALID_ARGUMENT,{arg:this.localName,coderType:"string",value:t}),b(c.toUtf8Bytes(t))},e.prototype.decode=function(t,e){var r=S(t,e,this.localName);return r.value=this.coerceFunc("string",c.toUtf8String(r.value)),r},e}(y);function L(t){return 32*Math.ceil(t/32)}function C(t,e){if(Array.isArray(e));else if(e&&"object"==typeof e){var r=[];t.forEach((function(t){r.push(e[t.localName])})),e=r}else u.throwError("invalid tuple value",u.INVALID_ARGUMENT,{coderType:"tuple",value:e});t.length!==e.length&&u.throwError("types/value length mismatch",u.INVALID_ARGUMENT,{coderType:"tuple",value:e});var i=[];t.forEach((function(t,r){i.push({dynamic:t.dynamic,value:t.encode(e[r])})}));var n=0,o=0;i.forEach((function(t){t.dynamic?(n+=32,o+=L(t.value.length)):n+=L(t.value.length)}));var s=0,a=n,h=new Uint8Array(n+o);return i.forEach((function(t){t.dynamic?(h.set(N.encode(a),s),s+=32,h.set(t.value,a),a+=L(t.value.length)):(h.set(t.value,s),s+=L(t.value.length))})),h}function x(t,e,r){var i=r,n=0,o=[];return t.forEach((function(t){if(t.dynamic){var s=N.decode(e,r);(u=t.decode(e,i+s.value.toNumber())).consumed=s.consumed}else var u=t.decode(e,r);null!=u.value&&o.push(u.value),r+=u.consumed,n+=u.consumed})),t.forEach((function(t,e){var r=t.localName;r&&("length"===r&&(r="_length"),null==o[r]&&(o[r]=o[e]))})),{value:o,consumed:n}}var U=function(t){function e(e,r,i,n){var o=this,s=r.type+"["+(i>=0?i:"")+"]",u=-1===i||r.dynamic;return(o=t.call(this,e,"array",s,n,u)||this).coder=r,o.length=i,o}return n(e,t),e.prototype.encode=function(t){Array.isArray(t)||u.throwError("expected array value",u.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=N.encode(e)),u.checkArgumentCount(e,t.length," in coder array"+(this.localName?" "+this.localName:""));for(var i=[],n=0;n<t.length;n++)i.push(this.coder);return l.concat([r,C(i,t)])},e.prototype.decode=function(t,e){var r=0,i=this.length;if(-1===i){try{var n=N.decode(t,e)}catch(t){u.throwError("insufficient data for dynamic array length",u.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t.value})}try{i=n.value.toNumber()}catch(t){u.throwError("array count too large",u.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:n.value.toString()})}r+=n.consumed,e+=n.consumed}for(var o=[],s=0;s<i;s++)o.push(new M(this.coder));var a=x(o,t,e);return a.consumed+=r,a.value=this.coerceFunc(this.type,a.value),a},e}(y),G=function(t){function e(e,r,i){var n=this,o=!1,s=[];r.forEach((function(t){t.dynamic&&(o=!0),s.push(t.type)}));var u="tuple("+s.join(",")+")";return(n=t.call(this,e,"tuple",u,i,o)||this).coders=r,n}return n(e,t),e.prototype.encode=function(t){return C(this.coders,t)},e.prototype.decode=function(t,e){var r=x(this.coders,t,e);return r.value=this.coerceFunc(this.type,r.value),r},e}(y);function k(t){t=t.trim();for(var e=[],r="",i=0,n=0;n<t.length;n++){var o=t[n];if(","===o&&0===i)e.push(r),r="";else if(r+=o,"("===o)i++;else if(")"===o&&-1===--i)throw new Error("unbalanced parenthsis")}return r&&e.push(r),e}var B={address:O,bool:R,string:P,bytes:D};function F(t,e){var r,i=B[e.type];if(i)return new i(t,e.name);if(r=e.type.match(p))return(0===(n=parseInt(r[2]||"256"))||n>256||n%8!=0)&&u.throwError("invalid "+r[1]+" bit length",u.INVALID_ARGUMENT,{arg:"param",value:e}),new w(t,n/8,"int"===r[1],e.name);if(r=e.type.match(f))return(0===(n=parseInt(r[1]))||n>32)&&u.throwError("invalid bytes length",u.INVALID_ARGUMENT,{arg:"param",value:e}),new I(t,n,e.name);if(r=e.type.match(_)){var n=parseInt(r[2]||"-1");return(e=d.shallowCopy(e)).type=r[1],e=d.deepCopy(e),new U(t,F(t,e),n,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var i=[];return e.forEach((function(e){i.push(F(t,e))})),new G(t,i,r)}(t,e.components,e.name):""===e.type?new T(t,e.name):(u.throwError("invalid type",u.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var j=function(){function t(r){u.checkNew(this,t),r||(r=e.defaultCoerceFunc),d.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&u.throwError("types/values length mismatch",u.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach((function(t){var e=null;e="string"==typeof t?g(t):t,r.push(F(this.coerceFunc,e))}),this),l.hexlify(new G(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach((function(t){var e=null;e="string"==typeof t?g(t):d.deepCopy(t),r.push(F(this.coerceFunc,e))}),this),new G(this.coerceFunc,r,"_").decode(l.arrayify(e),0).value},t}();e.AbiCoder=j,e.defaultAbiCoder=new j},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(25);!function(t){t.ACCOUNT_CHANGE="accountChanged",t.NETWORK_CHANGE="networkChanged"}(e.ProviderEvent||(e.ProviderEvent={}));class n extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=i.default[t]||`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}e.ProviderError=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.GENERAL="0",t.CONTRACT_ERROR="1",t.ACTIONS_ORDER_KIND_NOT_SUPPORTED="5000001",t.DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000002",t.FIXED_ACTIONS_ORDER_SIGNATURES="5000003",t.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000004",t.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES="5000005",t.NO_RECEIVER_ID="5000006",t.PROXY_KIND_NOT_SUPPORTED="5000007",t.SENDER_ID_NOT_A_SIGNER="5000008",t.SENDER_ID_AND_RECEIVER_ID_MISSING="5000009",t.ACTION_KIND_NOT_SUPPORTED="5000010",t.ERC20_APPROVAL_RACE_CONDITION="5000011",t.ERC20_NOT_ENOUGH_BALANCE="001001",t.ERC20_NOT_ENOUGH_ALLOWANCE="001002",t.ERC721_ZERO_ADDRESS="003001",t.ERC721_NOT_VALID_NFT="003002",t.ERC721_NOT_OWNER_OR_OPERATOR="003003",t.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR="003004",t.ERC721_NOT_ABLE_TO_RECEIVE_NFT="003005",t.ERC721_NFT_ALREADY_EXISTS="003006",t.ERC721_METADATA_ZERO_ADDRESS="004001",t.ERC721_METADATA_NOT_VALID_NFT="004002",t.ERC721_METADATA_NOT_OWNER_OR_OPERATOR="004003",t.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR="004004",t.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT="004005",t.ERC721_METADATA_NFT_ALREADY_EXISTS="004006",t.ERC721_ENUMERABLE_ZERO_ADDRESS="005001",t.ERC721_ENUMERABLE_NOT_VALID_NFT="005002",t.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR="005003",t.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="005004",t.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="005005",t.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS="005006",t.ERC721_ENUMERABLE_INVALID_INDEX="005007",t.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS="006001",t.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT="006002",t.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR="006003",t.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="006004",t.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="006005",t.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS="006006",t.ERC721_METADATA_ENUMERABLE_INVALID_INDEX="006007",t.XCERT_CAPABILITY_NOT_SUPPORTED="007001",t.XCERT_TRANSFERS_DISABLED="007002",t.XCERT_NOT_VALID_XCERT="007003",t.XCERT_NOT_OWNER_OR_OPERATOR="007004",t.XCERT_INVALID_SIGNATURE="007005",t.XCERT_INVALID_SIGNATURE_KIND="007006",t.XCERT_CLAIM_PERFORMED="007007",t.XCERT_CLAIM_EXPIRED="007008",t.SAFE_MATH_OVERFLOW="008001",t.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND="008002",t.SAFE_MATH_DIVISION_BY_ZERO="008003",t.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="009001",t.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="009002",t.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED="009003",t.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE="009004",t.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED="009005",t.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="009006",t.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="009007",t.DAPP_TOKEN_NOT_ENOUGH_BALANCE="010001",t.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE="010002",t.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS="010003",t.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED="010004",t.DAPP_TOKEN_MIGRATION_STARTED="010005",t.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE="010006",t.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="011001",t.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="011002",t.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED="011003",t.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE="011004",t.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED="011005",t.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="011006",t.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="011007",t.ERC20_TRANSFER_PROXY_TRANSFER_FAILED="012001",t.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND="015001",t.ACTIONS_GATEWAY_INVALID_PROXY="015002",t.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER="015003",t.ACTIONS_GATEWAY_CLAIM_EXPIRED="015004",t.ACTIONS_GATEWAY_INVALID_SIGNATURE="015005",t.ACTIONS_GATEWAY_ORDER_CANCELED="015006",t.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED="015007",t.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER="015008",t.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY="015009",t.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY="015010",t.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY="015011",t.SIGNER_IS_NOT_DESTROY_ASSET_OWNER="015012",t.ABILITABLE_NOT_AUTHORIZED="017001",t.ABILITABLE_INVALID_INPUT="017002",t.OWNABLE_NOT_OWNER="018001",t.OWNABLE_ZERO_ADDRESS="018002",t.CLAIMABLE_NOT_PENDING_OWNER="019001"}(e.ProviderIssue||(e.ProviderIssue={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.COMPLETE="complete",t.CONFIRM="confirm",t.ERROR="error"}(e.MutationEvent||(e.MutationEvent={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(1);e.parseError=function(t){return t instanceof i.ProviderError?t:Object.values(i.ProviderIssue).includes(t)?new i.ProviderError(t):new i.ProviderError(i.ProviderIssue.CONTRACT_ERROR,t)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(5);e.AddressZero="0x0000000000000000000000000000000000000000";e.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000";e.EtherSymbol="Ξ";var n=i.bigNumberify(-1);e.NegativeOne=n;var o=i.bigNumberify(0);e.Zero=o;var s=i.bigNumberify(1);e.One=s;var u=i.bigNumberify(2);e.Two=u;var a=i.bigNumberify("1000000000000000000");e.WeiPerEther=a;var h=i.bigNumberify("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");e.MaxUint256=h},function(t,e,r){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(3));function o(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function s(t,e){return t&&t._ethersType===e}e.defineReadOnly=o,e.setType=function(t,e){Object.defineProperty(t,"_ethersType",{configurable:!1,value:e,writable:!1})},e.isType=s,e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach((function(i){var n=t[i];n instanceof Promise?r.push(n.then((function(t){return e[i]=t,null}))):e[i]=n})),Promise.all(r).then((function(){return e}))},e.checkProperties=function(t,e){t&&"object"==typeof t||n.throwError("invalid object",n.INVALID_ARGUMENT,{argument:"object",value:t}),Object.keys(t).forEach((function(r){e[r]||n.throwError("invalid object key - "+r,n.INVALID_ARGUMENT,{argument:"transaction",value:t,key:r})}))},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e};var u={boolean:!0,number:!0,string:!0};e.deepCopy=function t(e,r){if(null==e||u[typeof e])return e;if(Array.isArray(e)){var i=e.map((function(e){return t(e,r)}));return r&&Object.freeze(i),i}if("object"==typeof e){if(s(e,"BigNumber"))return e;if(s(e,"Description"))return e;if(s(e,"Indexed"))return e;i={};for(var n in e){var a=e[n];void 0!==a&&o(i,n,t(a,r))}return r&&Object.freeze(i),i}if("function"==typeof e)return e;throw new Error("Cannot deepCopy "+typeof e)},e.inheritable=function t(e){return function(r){var i,n;n=e,(i=r).super_=n,i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),o(r,"inherits",t(r))}}},,,,function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=1]="CREATE_ASSET",t[t.TRANSFER_ASSET=2]="TRANSFER_ASSET",t[t.TRANSFER_VALUE=3]="TRANSFER_VALUE",t[t.UPDATE_ASSET_IMPRINT=4]="UPDATE_ASSET_IMPRINT",t[t.SET_ABILITIES=5]="SET_ABILITIES",t[t.DESTROY_ASSET=6]="DESTROY_ASSET"}(e.ActionsOrderActionKind||(e.ActionsOrderActionKind={})),function(t){t[t.ASSET_LEDGER_DEPLOY_ORDER=1]="ASSET_LEDGER_DEPLOY_ORDER",t[t.VALUE_LEDGER_DEPLOY_ORDER=2]="VALUE_LEDGER_DEPLOY_ORDER",t[t.FIXED_ACTIONS_ORDER=3]="FIXED_ACTIONS_ORDER",t[t.DYNAMIC_ACTIONS_ORDER=4]="DYNAMIC_ACTIONS_ORDER",t[t.SIGNED_FIXED_ACTIONS_ORDER=5]="SIGNED_FIXED_ACTIONS_ORDER",t[t.SIGNED_DYNAMIC_ACTIONS_ORDER=6]="SIGNED_DYNAMIC_ACTIONS_ORDER"}(e.OrderKind||(e.OrderKind={}));e.DynamicActionsOrder=class{};e.SignedDynamicActionsOrder=class{};e.FixedActionsOrder=class{};e.SignedFixedActionsOrder=class{};e.AssetLedgerDeployOrder=class{};e.ValueLedgerDeployOrder=class{}},function(t,e){var r,i,n=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function u(t){if(r===setTimeout)return setTimeout(t,0);if((r===o||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:o}catch(t){r=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var a,h=[],l=!1,c=-1;function d(){l&&a&&(l=!1,a.length?h=a.concat(h):c=-1,h.length&&f())}function f(){if(!l){var t=u(d);l=!0;for(var e=h.length;e;){for(a=h,h=[];++c<e;)a&&a[c].run();c=-1,e=h.length}a=null,l=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===s||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function p(t,e){this.fun=t,this.array=e}function _(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];h.push(new p(t,e)),1!==h.length||l||u(f)},p.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=_,n.addListener=_,n.once=_,n.off=_,n.removeListener=_,n.removeAllListeners=_,n.emit=_,n.prependListener=_,n.prependOnceListener=_,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},,function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(13);e.default={[i.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED]:"Actions order kind not supported.",[i.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for DYNAMIC_ACTIONS_ORDER kind.",[i.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for FIXED_ACTIONS_ORDER kind.",[i.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_DYNAMIC_ACTIONS_ORDER kind.",[i.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_FIXED_ACTIONS_ORDER kind.",[i.ProviderIssue.NO_RECEIVER_ID]:"ReceiverId is not set.",[i.ProviderIssue.PROXY_KIND_NOT_SUPPORTED]:"Invalid proxy kind.",[i.ProviderIssue.SENDER_ID_NOT_A_SIGNER]:"SenderId is not a signer.",[i.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING]:"Both senderId and receiverId are missing.",[i.ProviderIssue.ACTION_KIND_NOT_SUPPORTED]:"Not implemented.",[i.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION]:"First set approval to 0. ERC-20 token potential attack.",[i.ProviderIssue.ERC20_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[i.ProviderIssue.ERC20_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[i.ProviderIssue.ERC721_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_METADATA_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_METADATA_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_METADATA_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_METADATA_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[i.ProviderIssue.XCERT_CAPABILITY_NOT_SUPPORTED]:"Asset ledger does not have capability for this action.",[i.ProviderIssue.XCERT_TRANSFERS_DISABLED]:"Transfers on this asset ledger are currently disabled.",[i.ProviderIssue.XCERT_NOT_VALID_XCERT]:"Asset with this ID does not exist.",[i.ProviderIssue.XCERT_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.XCERT_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.XCERT_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.XCERT_CLAIM_PERFORMED]:"This order was already performed.",[i.ProviderIssue.XCERT_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.SAFE_MATH_OVERFLOW]:"This action caused a math error: overflow.",[i.ProviderIssue.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND]:"This action caused a math error: subtrahend is greater than minuend.",[i.ProviderIssue.SAFE_MATH_DIVISION_BY_ZERO]:"This action caused a math error: division by zero.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[i.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[i.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[i.ProviderIssue.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS]:"Tokens cannot be sent to this recipient. Recipients are limited.",[i.ProviderIssue.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED]:"Migration is not in progress.",[i.ProviderIssue.DAPP_TOKEN_MIGRATION_STARTED]:"Migration is in progress.",[i.ProviderIssue.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE]:"Migration cannot be performed. Please notify token owner.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[i.ProviderIssue.ERC20_TRANSFER_PROXY_TRANSFER_FAILED]:"Transfer failed.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_PROXY]:"Invalid proxy.",[i.ProviderIssue.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER]:"Sender is not one of the signers.",[i.ProviderIssue.ACTIONS_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.ACTIONS_GATEWAY_ORDER_CANCELED]:"This order was canceled.",[i.ProviderIssue.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER]:"Sender is not one of the signers.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY]:"Signer of CREATE_ASSET action does not have ALLOW_CREATE_ASSET ability.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY]:"Signer of UPDATE_ASSET action does not have ALLOW_UPDATE_ASSET ability.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY]:"Signer of SET_ASSET_LEDGER_ABILITY action does not have ALLOW_MANAGE_ABILITIES ability.",[i.ProviderIssue.SIGNER_IS_NOT_DESTROY_ASSET_OWNER]:"Signer of DESTROY_ASSET action is not the asset owner.",[i.ProviderIssue.ABILITABLE_NOT_AUTHORIZED]:"Sender does not have specified ability.",[i.ProviderIssue.ABILITABLE_INVALID_INPUT]:"Ability 0 is not a valid ability.",[i.ProviderIssue.OWNABLE_NOT_OWNER]:"Sender is not an owner.",[i.ProviderIssue.OWNABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.CLAIMABLE_NOT_PENDING_OWNER]:"Sender cannot claim ownership."}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=16]="CREATE_ASSET",t[t.REVOKE_ASSET=32]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=64]="TOGGLE_TRANSFERS",t[t.UPDATE_ASSET=128]="UPDATE_ASSET",t[t.UPDATE_URI_BASE=256]="UPDATE_URI_BASE",t[t.ALLOW_CREATE_ASSET=512]="ALLOW_CREATE_ASSET",t[t.ALLOW_UPDATE_ASSET_IMPRINT=1024]="ALLOW_UPDATE_ASSET_IMPRINT"}(e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={})),function(t){t[t.MANAGE_ABILITIES=1]="MANAGE_ABILITIES",t[t.ALLOW_MANAGE_ABILITIES=2]="ALLOW_MANAGE_ABILITIES"}(e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={})),function(t){t[t.DESTROY_ASSET=1]="DESTROY_ASSET",t[t.UPDATE_ASSET=2]="UPDATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"}(e.AssetLedgerCapability||(e.AssetLedgerCapability={}))},function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{a(i.next(t))}catch(t){o(t)}}function u(t){try{a(i.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,u)}a((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(4),o=r(1),s=r(8),u=r(6);var a;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(a=e.MutationStatus||(e.MutationStatus={}));class h extends s.EventEmitter{constructor(t,e,r){super(),this._confirmations=0,this._speed=14e3,this._status=a.INITIALIZED,this._logs=[],this._id=e,this._provider=t,this._provider.sandbox&&(this._status=a.COMPLETED),this._context=r}get id(){return this._id}get provider(){return this._provider}get confirmations(){return this._confirmations}get senderId(){return this._senderId}get receiverId(){return this._receiverId}get logs(){return this._logs}isPending(){return this._status===a.PENDING}isCompleted(){return this._status===a.COMPLETED}emit(...t){return super.emit.call(this,...t),this}on(...t){return super.on.call(this,...t),this}once(...t){return super.once.call(this,...t),this}off(t,e){return e?super.off(t,e):super.removeAllListeners(t),this}complete(){return i(this,void 0,void 0,(function*(){const t=this._status===a.INITIALIZED;return this.isCompleted()?this.resolveCurrentState():(this.isPending()||(this._status=a.PENDING,this._started=Date.now()),yield new Promise((e,r)=>{this.isCompleted()?e():(this.once(o.MutationEvent.COMPLETE,()=>e()),this.once(o.MutationEvent.ERROR,t=>r(t))),t&&this.loopUntilCompleted()}),this)}))}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}resolve(){return i(this,void 0,void 0,(function*(){return this.resolveCurrentState()}))}retry(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t)throw new Error("Mutation not found");if(t.blockNumber)throw new Error("Mutation already accepted onto the blockchain");const e=yield this._provider.post({method:"eth_gasPrice",params:[]}),r=t.gasPrice,i=e.result*this._provider.retryGasPriceMultiplier,n=i>=r?i:r*this._provider.retryGasPriceMultiplier,o={from:t.from,data:t.input,nonce:t.nonce,value:t.value,gas:t.gas,gasPrice:`0x${Math.ceil(n).toString(16)}`};t.to&&(o.to=t.to);const s=yield this._provider.post({method:"eth_sendTransaction",params:[o]});this._id=s.result}))}cancel(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t)throw new Error("Mutation not found");if(t.blockNumber)throw new Error("Mutation already accepted onto the blockchain");if(t.from.toLowerCase()!==this._provider.accountId.toLowerCase())throw new Error("You are not the maker of this mutation so you cannot cancel it.");const e=`0x${Math.ceil(1.1*t.gasPrice).toString(16)}`,r={from:t.from,to:t.from,nonce:t.nonce,value:"0x0",gasPrice:e},i=yield this._provider.post({method:"eth_sendTransaction",params:[r]});this._id=i.result}))}resolveCurrentState(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t||t.to&&"0x0"!==t.to||(t.to=yield this.getTransactionReceipt().then(t=>t?t.contractAddress:null)),t&&t.to){if(this._senderId=n.normalizeAddress(t.from),this._receiverId=n.normalizeAddress(t.to),this._confirmations=yield this.getLastBlock().then(e=>e-parseInt(t.blockNumber||e)).then(t=>t<0?0:t),this._confirmations>=this._provider.requiredConfirmations)return yield this.parseLogs(),this._status=a.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}}))}loopUntilCompleted(){return i(this,void 0,void 0,(function*(){yield this.resolveCurrentState(),-1===this._provider.mutationTimeout||Date.now()-this._started<this._provider.mutationTimeout?this._timer=setTimeout(this.loopUntilCompleted.bind(this),this._speed):this.emit(o.MutationEvent.ERROR,new Error("Mutation has timed out"))}))}getTransactionObject(){return i(this,void 0,void 0,(function*(){return(yield this._provider.post({method:"eth_getTransactionByHash",params:[this.id]})).result}))}getTransactionReceipt(){return i(this,void 0,void 0,(function*(){return(yield this._provider.post({method:"eth_getTransactionReceipt",params:[this.id]})).result}))}getLastBlock(){return i(this,void 0,void 0,(function*(){const t=yield this._provider.post({method:"eth_blockNumber"});return parseInt(t.result)}))}parseLogs(){return i(this,void 0,void 0,(function*(){try{this._logs=[];const t=this._context.getContext();if(!t)return;(yield this.getTransactionReceipt()).logs.forEach(e=>{const r=t.find(t=>t.topic===e.topics[0]);if(!r)return void this._provider.log(JSON.stringify(e));const i={};i.event=r.name,i.address=e.address;const n=r.types.filter(t=>t.kind===u.MutationEventTypeKind.NORMAL),o=r.types.filter(t=>t.kind===u.MutationEventTypeKind.INDEXED);if(n.length>0){const t=n.map(t=>t.type),r=this._provider.encoder.decodeParameters(t,e.data);n.forEach((t,e)=>{i[t.name]=r[e]})}o.forEach((t,r)=>{i[t.name]=this._provider.encoder.decodeParameters([t.type],e.topics[r+1])[0]}),this._logs.push(i)})}catch(t){this._provider.log(t)}}))}}e.Mutation=h},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=new(r(11).AbiCoder);e.encodeParameters=function(t,e){return i.encode(t,e)},e.decodeParameters=function(t,e){return i.decode(t,e)}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.version="4.0.40"},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(33),n=r(2);e.keccak256=function(t){return"0x"+i.keccak_256(n.arrayify(t))}},function(t,e,r){(function(e,r){
  /**
   * [js-sha3]{@link https://github.com/emn178/js-sha3}
   *
   * @version 0.5.7
   * @author Chen, Yi-Cyuan [emn178@gmail.com]
   * @copyright Chen, Yi-Cyuan 2015-2016
   * @license MIT
   */
  !function(){"use strict";var i="object"==typeof window?window:{};!i.JS_SHA3_NO_NODE_JS&&"object"==typeof e&&e.versions&&e.versions.node&&(i=r);for(var n=!i.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,o="0123456789abcdef".split(""),s=[0,8,16,24],u=[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],a=[224,256,384,512],h=["hex","buffer","arrayBuffer","array"],l=function(t,e,r){return function(i){return new y(t,e,t).update(i)[r]()}},c=function(t,e,r){return function(i,n){return new y(t,e,n).update(i)[r]()}},d=function(t,e){var r=l(t,e,"hex");r.create=function(){return new y(t,e,t)},r.update=function(t){return r.create().update(t)};for(var i=0;i<h.length;++i){var n=h[i];r[n]=l(t,e,n)}return r},f=[{name:"keccak",padding:[1,256,65536,16777216],bits:a,createMethod:d},{name:"sha3",padding:[6,1536,393216,100663296],bits:a,createMethod:d},{name:"shake",padding:[31,7936,2031616,520093696],bits:[128,256],createMethod:function(t,e){var r=c(t,e,"hex");r.create=function(r){return new y(t,e,r)},r.update=function(t,e){return r.create(e).update(t)};for(var i=0;i<h.length;++i){var n=h[i];r[n]=c(t,e,n)}return r}}],p={},_=[],v=0;v<f.length;++v)for(var E=f[v],m=E.bits,g=0;g<m.length;++g){var A=E.name+"_"+m[g];_.push(A),p[A]=E.createMethod(m[g],E.padding)}function y(t,e,r){this.blocks=[],this.s=[],this.padding=e,this.outputBits=r,this.reset=!0,this.block=0,this.start=0,this.blockCount=1600-(t<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}y.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,i,n=t.length,o=this.blocks,u=this.byteCount,a=this.blockCount,h=0,l=this.s;h<n;){if(this.reset)for(this.reset=!1,o[0]=this.block,r=1;r<a+1;++r)o[r]=0;if(e)for(r=this.start;h<n&&r<u;++h)o[r>>2]|=t[h]<<s[3&r++];else for(r=this.start;h<n&&r<u;++h)(i=t.charCodeAt(h))<128?o[r>>2]|=i<<s[3&r++]:i<2048?(o[r>>2]|=(192|i>>6)<<s[3&r++],o[r>>2]|=(128|63&i)<<s[3&r++]):i<55296||i>=57344?(o[r>>2]|=(224|i>>12)<<s[3&r++],o[r>>2]|=(128|i>>6&63)<<s[3&r++],o[r>>2]|=(128|63&i)<<s[3&r++]):(i=65536+((1023&i)<<10|1023&t.charCodeAt(++h)),o[r>>2]|=(240|i>>18)<<s[3&r++],o[r>>2]|=(128|i>>12&63)<<s[3&r++],o[r>>2]|=(128|i>>6&63)<<s[3&r++],o[r>>2]|=(128|63&i)<<s[3&r++]);if(this.lastByteIndex=r,r>=u){for(this.start=r-u,this.block=o[a],r=0;r<a;++r)l[r]^=o[r];M(l),this.reset=!0}else this.start=r}return this},y.prototype.finalize=function(){var t=this.blocks,e=this.lastByteIndex,r=this.blockCount,i=this.s;if(t[e>>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e<r+1;++e)t[e]=0;for(t[r-1]|=2147483648,e=0;e<r;++e)i[e]^=t[e];M(i)},y.prototype.toString=y.prototype.hex=function(){this.finalize();for(var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,s=0,u=0,a="";u<i;){for(s=0;s<e&&u<i;++s,++u)t=r[s],a+=o[t>>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];u%e==0&&(M(r),s=0)}return n&&(t=r[s],n>0&&(a+=o[t>>4&15]+o[15&t]),n>1&&(a+=o[t>>12&15]+o[t>>8&15]),n>2&&(a+=o[t>>20&15]+o[t>>16&15])),a},y.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,o=0,s=0,u=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(u);for(var a=new Uint32Array(t);s<i;){for(o=0;o<e&&s<i;++o,++s)a[s]=r[o];s%e==0&&M(r)}return n&&(a[o]=r[o],t=t.slice(0,u)),t},y.prototype.buffer=y.prototype.arrayBuffer,y.prototype.digest=y.prototype.array=function(){this.finalize();for(var t,e,r=this.blockCount,i=this.s,n=this.outputBlocks,o=this.extraBytes,s=0,u=0,a=[];u<n;){for(s=0;s<r&&u<n;++s,++u)t=u<<2,e=i[s],a[t]=255&e,a[t+1]=e>>8&255,a[t+2]=e>>16&255,a[t+3]=e>>24&255;u%r==0&&M(i)}return o&&(t=u<<2,e=i[s],o>0&&(a[t]=255&e),o>1&&(a[t+1]=e>>8&255),o>2&&(a[t+2]=e>>16&255)),a};var M=function(t){var e,r,i,n,o,s,a,h,l,c,d,f,p,_,v,E,m,g,A,y,M,T,w,N,R,I,O,b,S,D,P,L,C,x,U,G,k,B,F,j,Y,V,W,X,K,Z,H,z,q,$,J,Q,tt,et,rt,it,nt,ot,st,ut,at,ht,lt;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],l=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],d=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(h<<1|l>>>31),r=o^(l<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=s^(c<<1|d>>>31),r=a^(d<<1|c>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(f<<1|p>>>31),r=l^(p<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=c^(n<<1|o>>>31),r=d^(o<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,_=t[0],v=t[1],Z=t[11]<<4|t[10]>>>28,H=t[10]<<4|t[11]>>>28,b=t[20]<<3|t[21]>>>29,S=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,x=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,E=t[13]<<12|t[12]>>>20,m=t[12]<<12|t[13]>>>20,z=t[22]<<10|t[23]>>>22,q=t[23]<<10|t[22]>>>22,D=t[33]<<13|t[32]>>>19,P=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,G=t[14]<<6|t[15]>>>26,k=t[15]<<6|t[14]>>>26,g=t[25]<<11|t[24]>>>21,A=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,J=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,N=t[6]<<28|t[7]>>>4,R=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,y=t[36]<<21|t[37]>>>11,M=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,X=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,I=t[18]<<20|t[19]>>>12,O=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,j=t[38]<<8|t[39]>>>24,Y=t[39]<<8|t[38]>>>24,T=t[48]<<14|t[49]>>>18,w=t[49]<<14|t[48]>>>18,t[0]=_^~E&g,t[1]=v^~m&A,t[10]=N^~I&b,t[11]=R^~O&S,t[20]=x^~G&B,t[21]=U^~k&F,t[30]=X^~Z&z,t[31]=K^~H&q,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=E^~g&y,t[3]=m^~A&M,t[12]=I^~b&D,t[13]=O^~S&P,t[22]=G^~B&j,t[23]=k^~F&Y,t[32]=Z^~z&$,t[33]=H^~q&J,t[42]=it^~ot&ut,t[43]=nt^~st&at,t[4]=g^~y&T,t[5]=A^~M&w,t[14]=b^~D&L,t[15]=S^~P&C,t[24]=B^~j&V,t[25]=F^~Y&W,t[34]=z^~$&Q,t[35]=q^~J&tt,t[44]=ot^~ut&ht,t[45]=st^~at&lt,t[6]=y^~T&_,t[7]=M^~w&v,t[16]=D^~L&N,t[17]=P^~C&R,t[26]=j^~V&x,t[27]=Y^~W&U,t[36]=$^~Q&X,t[37]=J^~tt&K,t[46]=ut^~ht&et,t[47]=at^~lt&rt,t[8]=T^~_&E,t[9]=w^~v&m,t[18]=L^~N&I,t[19]=C^~R&O,t[28]=V^~x&G,t[29]=W^~U&k,t[38]=Q^~X&Z,t[39]=tt^~K&H,t[48]=ht^~et&it,t[49]=lt^~rt&nt,t[0]^=u[i],t[1]^=u[i+1]};if(n)t.exports=p;else for(v=0;v<_.length;++v)i[_[v]]=p[_[v]]}()}).call(this,r(22),r(23))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2);function n(t){for(var e=[];t;)e.unshift(255&t),t>>=8;return e}function o(t,e,r){for(var i=0,n=0;n<r;n++)i=256*i+t[e+n];return i}function s(t,e,r,i){for(var n=[];r<e+1+i;){var o=u(t,r);if(n.push(o.result),(r+=o.consumed)>e+1+i)throw new Error("invalid rlp")}return{consumed:1+i,result:n}}function u(t,e){if(0===t.length)throw new Error("invalid rlp data");if(t[e]>=248){if(e+1+(r=t[e]-247)>t.length)throw new Error("too short");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("to short");return s(t,e,e+1+r,r+n)}if(t[e]>=192){if(e+1+(n=t[e]-192)>t.length)throw new Error("invalid rlp data");return s(t,e,e+1,n)}if(t[e]>=184){var r;if(e+1+(r=t[e]-183)>t.length)throw new Error("invalid rlp data");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+n,result:i.hexlify(t.slice(e+1+r,e+1+r+n))}}if(t[e]>=128){var n;if(e+1+(n=t[e]-128)>t.length)throw new Error("invalid rlp data");return{consumed:1+n,result:i.hexlify(t.slice(e+1,e+1+n))}}return{consumed:1,result:i.hexlify(t[e])}}e.encode=function(t){return i.hexlify(function t(e){if(Array.isArray(e)){var r=[];return e.forEach((function(e){r=r.concat(t(e))})),r.length<=55?(r.unshift(192+r.length),r):((o=n(r.length)).unshift(247+o.length),o.concat(r))}var o,s=Array.prototype.slice.call(i.arrayify(e));return 1===s.length&&s[0]<=127?s:s.length<=55?(s.unshift(128+s.length),s):((o=n(s.length)).unshift(183+o.length),o.concat(s))}(t))},e.decode=function(t){var e=i.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,n=r(16),o=r(3),s=r(2);function u(t,e){void 0===e&&(e=i.current),e!=i.current&&(o.checkNormalize(),t=t.normalize(e));for(var r=[],n=0;n<t.length;n++){var u=t.charCodeAt(n);if(u<128)r.push(u);else if(u<2048)r.push(u>>6|192),r.push(63&u|128);else if(55296==(64512&u)){n++;var a=t.charCodeAt(n);if(n>=t.length||56320!=(64512&a))throw new Error("invalid utf-8 string");u=65536+((1023&u)<<10)+(1023&a),r.push(u>>18|240),r.push(u>>12&63|128),r.push(u>>6&63|128),r.push(63&u|128)}else r.push(u>>12|224),r.push(u>>6&63|128),r.push(63&u|128)}return s.arrayify(r)}function a(t,e){t=s.arrayify(t);for(var r="",i=0;i<t.length;){var n=t[i++];if(n>>7!=0){var o=null,u=null;if(192==(224&n))o=1,u=127;else if(224==(240&n))o=2,u=2047;else{if(240!=(248&n)){if(!e){if(128==(192&n))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}continue}o=3,u=65535}if(i+o>t.length){if(!e)throw new Error("invalid utf8 byte sequence; too short");for(;i<t.length&&t[i]>>6==2;i++);}else{for(var a=n&(1<<8-o-1)-1,h=0;h<o;h++){var l=t[i];if(128!=(192&l)){a=null;break}a=a<<6|63&l,i++}if(null!==a)if(a<=u){if(!e)throw new Error("invalid utf8 byte sequence; overlong")}else if(a>1114111){if(!e)throw new Error("invalid utf8 byte sequence; out-of-range")}else if(a>=55296&&a<=57343){if(!e)throw new Error("invalid utf8 byte sequence; utf-16 surrogate")}else a<=65535?r+=String.fromCharCode(a):(a-=65536,r+=String.fromCharCode(55296+(a>>10&1023),56320+(1023&a)));else if(!e)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}}else r+=String.fromCharCode(n)}return r}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(i=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=u,e.toUtf8String=a,e.formatBytes32String=function(t){var e=u(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return s.hexlify(s.concat([e,n.HashZero]).slice(0,32))},e.parseBytes32String=function(t){var e=s.arrayify(t);if(32!==e.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==e[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===e[r-1];)r--;return a(e.slice(0,r))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(7);e.normalizeAddress=function(t){return t?i.getAddress(t.toLowerCase()):null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(5);var n=r(5);e.BigNumber=n.BigNumber,e.bigNumberify=function(t){return i.bigNumberify(t)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(11),n=r(7);e.Encoder=class{constructor(){this.coder=new i.AbiCoder}encodeParameters(t,e){return this.coder.encode(t,e)}decodeParameters(t,e){return this.coder.decode(t,e)}normalizeAddress(t){return t?n.getAddress(t):null}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hexToBytes=function(t){t=t.toString(16).replace(/^0x/i,"");const e=[];for(let r=0;r<t.length;r+=2)e.push(parseInt(t.substr(r,2),16));return e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.leftPad=function(t,e,r,i){const n=void 0===i?/^0x/i.test(t)||"number"==typeof t:i,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+new Array(o).join(r||"0")+t}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.rightPad=function(t,e,r,i){const n=void 0===i?/^0x/i.test(t)||"number"==typeof t:i,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+t+new Array(o).join(r||"0")}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.stringToHex=function(t){let e="";for(let r=0;r<t.length;r++)e+=t.charCodeAt(r).toString(16);return e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ZERO_ADDRESS="0x0000000000000000000000000000000000000000"},function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{a(i.next(t))}catch(t){o(t)}}function u(t){try{a(i.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,u)}a((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(4),o=r(1),s=r(8),u=r(15),a=r(6);class h extends s.EventEmitter{constructor(t){super(),this._id=0,this.encoder=void 0!==t.encoder?t.encoder:new n.Encoder,this.accountId=t.accountId,this.gatewayConfig=t.gatewayConfig,this.unsafeRecipientIds=t.unsafeRecipientIds,this.assetLedgerSource=t.assetLedgerSource||"https://conventions.0xcert.org/ethereum/xcert-mock.json",this.valueLedgerSource=t.valueLedgerSource||"https://conventions.0xcert.org/ethereum/token-mock.json",this.signMethod=void 0!==t.signMethod?t.signMethod:a.SignMethod.ETH_SIGN,this.requiredConfirmations=void 0!==t.requiredConfirmations?t.requiredConfirmations:1,this.mutationTimeout=void 0!==t.mutationTimeout?t.mutationTimeout:36e5,this.gasPriceMultiplier=void 0!==t.gasPriceMultiplier?t.gasPriceMultiplier:1.1,this.retryGasPriceMultiplier=void 0!==t.retryGasPriceMultiplier?t.retryGasPriceMultiplier:2,this.sandbox=void 0!==t.sandbox&&t.sandbox,this.verbose=void 0!==t.verbose&&t.verbose,this._client=t.client&&t.client.currentProvider?t.client.currentProvider:t.client}log(t){this.verbose&&console.log(t)}get accountId(){return this._accountId||null}set accountId(t){t=this.encoder.normalizeAddress(t),this.isCurrentAccount(t)||this.emit(o.ProviderEvent.ACCOUNT_CHANGE,t,this._accountId),this._accountId=t}get unsafeRecipientIds(){return this._unsafeRecipientIds||[]}set unsafeRecipientIds(t){this._unsafeRecipientIds=(t||[]).map(t=>this.encoder.normalizeAddress(t))}get gatewayConfig(){return this._gatewayConfig}set gatewayConfig(t){this._gatewayConfig=void 0!==t?{actionsOrderId:this.encoder.normalizeAddress(t.actionsOrderId),assetLedgerDeployOrderId:this.encoder.normalizeAddress(t.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this.encoder.normalizeAddress(t.valueLedgerDeployOrderId)}:null}emit(...t){return super.emit.call(this,...t),this}on(...t){return super.on.call(this,...t),this}once(...t){return super.once.call(this,...t),this}off(t,e){return e?super.off(t,e):super.removeAllListeners(t),this}sign(t){return i(this,void 0,void 0,(function*(){if(!this.accountId)throw new Error("accountId not set.");if(this.signMethod===a.SignMethod.PERSONAL_SIGN){return(yield this.post({method:"personal_sign",params:[t,this.accountId,null]})).result}if(this.signMethod===a.SignMethod.ETH_SIGN){return(yield this.post({method:"eth_sign",params:[this.accountId,t]})).result}throw new Error("Signing method not implemented.")}))}getAvailableAccounts(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map(t=>this.encoder.normalizeAddress(t))}))}getNetworkVersion(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"net_version",params:[]})).result}))}isCurrentAccount(t){return this.accountId===this.encoder.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.encoder.normalizeAddress(t);return!!this.unsafeRecipientIds.find(t=>t===e)}post(t){return i(this,void 0,void 0,(function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length&&(this.sandbox||void 0===e.params[0].gas)){try{const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}catch(t){if(t&&t.original&&(-32603===t.original.code||-32e3===t.original.code)){e.params.push("latest");const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_call"}));throw new o.ProviderError(o.ProviderIssue.CONTRACT_ERROR,t.result)}throw t}if(this.sandbox)return{id:null,jsonrpc:null,result:e.params[0].gas};if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(t.result*this.gasPriceMultiplier).toString(16)}`}}return this.request(e)}))}request(t){return i(this,void 0,void 0,(function*(){const e=Object.assign({jsonrpc:"2.0",id:t.id||this.getNextId(),params:[]},t);return new Promise((t,r)=>{this._client.send(e,(i,n)=>i?(this.log(i),r(i)):n.error?(this.log(i),r(n.error)):n.id!==e.id?r("Invalid RPC id"):t(n))}).catch(t=>{throw new o.ProviderError(o.ProviderIssue.GENERAL,t)}).then(t=>{if("eth_call"===e.method&&t&&t.result&&-1!==t.result.indexOf("0x08c379a0")){const e=this.encoder.decodeParameters(["string"],`0x${t.result.substring(10)}`);throw u.parseError(e[0])}return t})}))}getNextId(){return this._id++,this._id}}e.GenericProvider=h},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(6);e.buildGatewayConfig=function(t){switch(t){case i.NetworkKind.LIVE:return{actionsOrderId:"0x0000000000000000000000000000000000000000",assetLedgerDeployOrderId:"0x0000000000000000000000000000000000000000",valueLedgerDeployOrderId:"0x0000000000000000000000000000000000000000"};case i.NetworkKind.RINKEBY:return{actionsOrderId:"0x2e697eAcdCEc69A9695fb4908a35D04C80aB7E49",assetLedgerDeployOrderId:"0xBdd421cfD425BC952d704c2C68D902672FF7738D",valueLedgerDeployOrderId:"0xa5ff982d4b054F777DC3eFe77b5D91236A389800"};case i.NetworkKind.ROPSTEN:return{actionsOrderId:"0x265A62A3EfB677ca6A0F7C85dC5002EC71F2cde6",assetLedgerDeployOrderId:"0x2ED6fA578A0331Bcd598Ac0c43D26fe896b967c9",valueLedgerDeployOrderId:"0xd3bf7FF070a58A580D7ef82DF130DC0B06b567D8"};default:throw new Error("Unsupported network kind.")}}},,,function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{a(i.next(t))}catch(t){o(t)}}function u(t){try{a(i.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,u)}a((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.fetchJson=function(t,e){return i(this,void 0,void 0,(function*(){if("undefined"!=typeof window)return window.fetch(t,e).then(t=>t.json());if(0===t.lastIndexOf("http",0))return r(50)(t,e).then(t=>t.json());try{return r(49).promises.readFile(t,"utf8").then(t=>JSON.parse(t))}catch(t){return null}}))}},function(t,e){},function(t,e,r){"use strict";var i=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==i)return i;throw new Error("unable to locate global object")}();t.exports=e=i.fetch,e.default=i.fetch.bind(i),e.Headers=i.Headers,e.Request=i.Request,e.Response=i.Response},function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{a(i.next(t))}catch(t){o(t)}}function u(t){try{a(i.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,u)}a((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.sha=function(t,e){return i(this,void 0,void 0,(function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(e),i=yield window.crypto.subtle.digest(`SHA-${t}`,r);return Array.from(new Uint8Array(i)).map(t=>`00${t.toString(16)}`.slice(-2)).join("")}return r(52).createHash(`sha${t}`).update(e).digest("hex")}))}},function(t,e){t.exports=void 0},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(54);e.keccak256=function(t){return i.keccak256(t)}},function(t,e){const r="0123456789abcdef".split(""),i=[1,256,65536,16777216],n=[0,8,16,24],o=[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],s=t=>{var e,r,i,n,s,u,a,h,l,c,d,f,p,_,v,E,m,g,A,y,M,T,w,N,R,I,O,b,S,D,P,L,C,x,U,G,k,B,F,j,Y,V,W,X,K,Z,H,z,q,$,J,Q,tt,et,rt,it,nt,ot,st,ut,at,ht,lt;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],u=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],l=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],d=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(u<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|u>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(h<<1|l>>>31),r=s^(l<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=u^(c<<1|d>>>31),r=a^(d<<1|c>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(f<<1|p>>>31),r=l^(p<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=c^(n<<1|s>>>31),r=d^(s<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,_=t[0],v=t[1],Z=t[11]<<4|t[10]>>>28,H=t[10]<<4|t[11]>>>28,b=t[20]<<3|t[21]>>>29,S=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,x=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,E=t[13]<<12|t[12]>>>20,m=t[12]<<12|t[13]>>>20,z=t[22]<<10|t[23]>>>22,q=t[23]<<10|t[22]>>>22,D=t[33]<<13|t[32]>>>19,P=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,G=t[14]<<6|t[15]>>>26,k=t[15]<<6|t[14]>>>26,g=t[25]<<11|t[24]>>>21,A=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,J=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,N=t[6]<<28|t[7]>>>4,R=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,y=t[36]<<21|t[37]>>>11,M=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,X=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,I=t[18]<<20|t[19]>>>12,O=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,j=t[38]<<8|t[39]>>>24,Y=t[39]<<8|t[38]>>>24,T=t[48]<<14|t[49]>>>18,w=t[49]<<14|t[48]>>>18,t[0]=_^~E&g,t[1]=v^~m&A,t[10]=N^~I&b,t[11]=R^~O&S,t[20]=x^~G&B,t[21]=U^~k&F,t[30]=X^~Z&z,t[31]=K^~H&q,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=E^~g&y,t[3]=m^~A&M,t[12]=I^~b&D,t[13]=O^~S&P,t[22]=G^~B&j,t[23]=k^~F&Y,t[32]=Z^~z&$,t[33]=H^~q&J,t[42]=it^~ot&ut,t[43]=nt^~st&at,t[4]=g^~y&T,t[5]=A^~M&w,t[14]=b^~D&L,t[15]=S^~P&C,t[24]=B^~j&V,t[25]=F^~Y&W,t[34]=z^~$&Q,t[35]=q^~J&tt,t[44]=ot^~ut&ht,t[45]=st^~at&lt,t[6]=y^~T&_,t[7]=M^~w&v,t[16]=D^~L&N,t[17]=P^~C&R,t[26]=j^~V&x,t[27]=Y^~W&U,t[36]=$^~Q&X,t[37]=J^~tt&K,t[46]=ut^~ht&et,t[47]=at^~lt&rt,t[8]=T^~_&E,t[9]=w^~v&m,t[18]=L^~N&I,t[19]=C^~R&O,t[28]=V^~x&G,t[29]=W^~U&k,t[38]=Q^~X&Z,t[39]=tt^~K&H,t[48]=ht^~et&it,t[49]=lt^~rt&nt,t[0]^=o[i],t[1]^=o[i+1]},u=t=>e=>{var o;if("0x"===e.slice(0,2)){o=[];for(var u=2,a=e.length;u<a;u+=2)o.push(parseInt(e.slice(u,u+2),16))}else o=e;return((t,e)=>{for(var o,u=e.length,a=t.blocks,h=t.blockCount<<2,l=t.blockCount,c=t.outputBlocks,d=t.s,f=0;f<u;){if(t.reset)for(t.reset=!1,a[0]=t.block,v=1;v<l+1;++v)a[v]=0;if("string"!=typeof e)for(v=t.start;f<u&&v<h;++f)a[v>>2]|=e[f]<<n[3&v++];else for(v=t.start;f<u&&v<h;++f)(o=e.charCodeAt(f))<128?a[v>>2]|=o<<n[3&v++]:o<2048?(a[v>>2]|=(192|o>>6)<<n[3&v++],a[v>>2]|=(128|63&o)<<n[3&v++]):o<55296||o>=57344?(a[v>>2]|=(224|o>>12)<<n[3&v++],a[v>>2]|=(128|o>>6&63)<<n[3&v++],a[v>>2]|=(128|63&o)<<n[3&v++]):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++f)),a[v>>2]|=(240|o>>18)<<n[3&v++],a[v>>2]|=(128|o>>12&63)<<n[3&v++],a[v>>2]|=(128|o>>6&63)<<n[3&v++],a[v>>2]|=(128|63&o)<<n[3&v++]);if(t.lastByteIndex=v,v>=h){for(t.start=v-h,t.block=a[l],v=0;v<l;++v)d[v]^=a[v];s(d),t.reset=!0}else t.start=v}if(a[(v=t.lastByteIndex)>>2]|=i[3&v],t.lastByteIndex===h)for(a[0]=a[l],v=1;v<l+1;++v)a[v]=0;for(a[l-1]|=2147483648,v=0;v<l;++v)d[v]^=a[v];s(d);for(var p,_="",v=0,E=0;E<c;){for(v=0;v<l&&E<c;++v,++E)p=d[v],_+=r[p>>4&15]+r[15&p]+r[p>>12&15]+r[p>>8&15]+r[p>>20&15]+r[p>>16&15]+r[p>>28&15]+r[p>>24&15];E%l==0&&(s(d),v=0)}return"0x"+_})((t=>{return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(e=[0,0,0,0,0,0,0,0,0,0],[].concat(e,e,e,e,e))};var e})(t),o)};t.exports={keccak256:u(256),keccak512:u(512),keccak256s:u(256),keccak512s:u(512)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toFloat=function(t){return parseFloat(`${t}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toInteger=function(t){return"number"==typeof t&&t>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof t&&!0===t?1:parseInt(`${t}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toSeconds=function(t){return parseInt(`${parseFloat(`${t}`)/1e3}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toString=function(t){return null!=t?t.toString():null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toTuple=function t(e){if(!(e instanceof Object))return[];const r=[];let i=0;return Object.keys(e).forEach(n=>{if(e[n]instanceof Object)r[i]=t(e[n]);else if(e[n]instanceof Array){let o=0;const s=[];e[n].forEach(r=>{s[o]=t(e[n]),o++}),r[i]=s}else r[i]=e[n];i++}),r}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,r){window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(181))},function(t,e,r){"use strict";function i(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),i(r(0)),i(r(182))},function(t,e,r){"use strict";var i=this&&this.__rest||function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]])}return r};Object.defineProperty(e,"__esModule",{value:!0});const n=r(0),o=r(10);class s extends n.GenericProvider{constructor(t){super(t),this._options=t,this._client=this}static getInstance(t){return new this(t)}isSupported(){return!!this._client.fetch}send(t,e){const r=Object.assign({url:"http://localhost:8545"},this._options),{url:n}=r,s=i(r,["url"]);return o.fetchJson(n,Object.assign(Object.assign({},s),{method:"POST",body:JSON.stringify(t),headers:{"Content-Type":"application/json"}})).then(t=>t).then(t=>e(null,t)).catch(t=>e(t,null))}}e.HttpProvider=s}]);